From patchwork Thu Jul 4 11:51:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 50330 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp3664251vqv; Thu, 4 Jul 2024 05:04:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7NfygHQV2PpVeQF2JxDtno+6iyEaO58ePqPmkCvZ2EXL11KQKjeF5zA7/TtqQmLDSF/H1AJfWIkfMjtfXAkdCdhFQLtVVRxg6lQ== X-Google-Smtp-Source: AGHT+IHj3k5Mpy9cRP2oDtJqjzsEzLXwNwyNLS0LCrtH73OLcLO/Ig+vvnIIHD0NwT8u3vytkQcu X-Received: by 2002:ac2:5f9b:0:b0:52c:dbe6:f5f9 with SMTP id 2adb3069b0e04-52ea061851amr1103315e87.12.1720094653143; Thu, 04 Jul 2024 05:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720094653; cv=none; d=google.com; s=arc-20160816; b=VGVCE7vQ+TgkdoxCglyYyWrnPI9sNdy+hMKrS+ny1TeFLUAi90o9ea+Cyi8A0McilO 4pI/rHM/fsT0fmfhn/yYlLkGtQGa/VVU0HwuabPDMQ2HRBQAwVNin8cg5uM0WmDSDOu6 vCMsqQ9ysnmG4k9/52sifqQqlatgKSXtbjPQaqvrsJ4fL1I0qKGR23r3sg4sfs/DXdbD /d9lBxvktP2CtUZJlUw1WooSLkRvgYC5qZ0O8hWfN94ypvuwwjW7gv42Qvqf3/sRTSVF kiDYxPwe7rghzYFSubIDRsqgZf8ny6XHwRpg4zrdkL5Ibm8TQ+oveSevgUE/Ny25/ps2 4UQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=531542hJeTFDZmpCYDoxmu5f5Tb21Er2a4er3bcJesQ=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=fxNhzTRav/CWK1RdVDHO8deSiHp+8BIo3pbHMBGUi/m6Y1dlYr1SgF/f+hzsZFjnnb nD8Z5n0dtcdu7b4ZVSeuiNLBtryJsrMBmKcBvoaMO5N0jXziWQQk5/tGusxIPmPy1EjY 0mvaHKRKxjztIMACy0pE+gaurDVvbzw06Q9wdGiaGoaUmk473O1qdeOmdvDOK1GwBD/s 8zw4JuAKun3jX7YVf+/WhfJ2FIbZF/8R4jZ81w6rxdsCmhL9cgA81MKNqK7rRcfii+oE nQXs/4WKECXeqbuzzheV2J4UwoHKSuaSk2oc0q3Pj0sqXeeM3lDeuzLdIHEzgw1pzEzy dNfA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=tnOtsTZP; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-52ea2c1a285si47284e87.613.2024.07.04.05.04.12; Thu, 04 Jul 2024 05:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=tnOtsTZP; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0CE1968DA25; Thu, 4 Jul 2024 14:54:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E3CD168DA10 for ; Thu, 4 Jul 2024 14:53:50 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1720094029; bh=njzY9Ocn/6dWnV/LQc9JDqH9/D813PFysJ01a37js5I=; h=From:To:Cc:Subject:Date:From; b=tnOtsTZPSrVI2VaAHPjKpJJ+ORUMgVKM3ULfym+Idmirxamo9ark8qaEJhVo6pqXD GTrqaFlHRFzi6LE8zx5PU2Aa0holpflMUmRT5/HFvpsO7fen2cn/3z0TcNxwNuQKVD KgWc7xo+RorOmiLRLC++HlmPO6gfR9QCy+qfeiJ8= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D2D9F4013C; Thu, 4 Jul 2024 13:53:49 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jul 2024 13:51:57 +0200 Message-ID: <20240704115202.1235954-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] swscale: document SWS_FULL_CHR_H_* flags X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: XMtJnG+JGU/d From: Niklas Haas Based on my best understanding of what they do, given the source code. --- libswscale/swscale.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 9d4612aaf3..e22931cab4 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -82,11 +82,35 @@ const char *swscale_license(void); #define SWS_PRINT_INFO 0x1000 //the following 3 flags are not completely implemented -//internal chrominance subsampling info + +/** + * Perform full chroma upsampling when converting to RGB as part of scaling. + * + * For example, when converting 50x50 yuv420p to 100x100 rgba, setting this flag + * will scale the chroma plane from 25x25 to 100x100 (4:4:4), and then convert + * the 100x100 yuv444p image to rgba in the final output step. + * + * Without this flag, the chroma plane is instead scaled to 50x100 (4:2:2), + * with a single chroma sample being re-used for both horizontally adjacent RGBA + * output pixels. + */ #define SWS_FULL_CHR_H_INT 0x2000 -//input subsampling info + +/** + * Perform full chroma interpolation when downscaling RGB sources. + * + * For example, when converting a 100x100 rgba source to 50x50 yuv444p, setting + * this flag will generate a 100x100 (4:4:4) chroma plane, which is then + * downscaled to the required 50x50. + * + * Without this flag, the chroma plane is instead generated at 50x100 (dropping + * every other pixel), before then being downscaled to the required 50x50 + * resolution. + */ #define SWS_FULL_CHR_H_INP 0x4000 + #define SWS_DIRECT_BGR 0x8000 + #define SWS_ACCURATE_RND 0x40000 #define SWS_BITEXACT 0x80000 #define SWS_ERROR_DIFFUSION 0x800000