From patchwork Thu Jul 4 14:30: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: 50332 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp3754397vqv; Thu, 4 Jul 2024 07:31:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXdu2/xZVtPF44uAWVCU2EvZgiagC6ueh4rO3oD7mJTSM3iAdHTuja49ayNz6FJGc3DW5zWZxcqsSSqOyR+oRbW7wblNQIJgvxZSg== X-Google-Smtp-Source: AGHT+IFBHtfGBOv9/p5FG77HoFMIu62ta+5vq7By+Oi0yT7Sydn5o4x23bgm3V3Yo7jOFUE5wClF X-Received: by 2002:a05:6512:3b27:b0:52c:9ab1:a312 with SMTP id 2adb3069b0e04-52ea06157c6mr1729248e87.4.1720103484533; Thu, 04 Jul 2024 07:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720103484; cv=none; d=google.com; s=arc-20160816; b=w1RJQzk3iLJ3PyVpY9XZ/mfuKaAtvo82orsRa/gPQaHd5igu0U80/Ij47FcMBBOj4j /GUjg1XHpnue2e0+4fUXI3frvB1A3cGQQO45NeA6i1ngvkHsj3FnG+QNwT68r6HHfSGM GXFGR8TnuLJNPD/cALmX6d6mj0ZwppzomIGYt7tdtqtpRJEwBIRbjuLNs6dpmoddGLDP 1gjQ7xy7ghpPd9E6SV0PS9WoLCui62eY/fZICyBkP8bJoupKQ6HYq7eK4j5WpqCuLGk2 6waFfGLvKjn4tCH1CZuY/aKfxV4Omx1i0ofdIRzwAGA8F9+BAXiahaLWLyEON62XEV32 VyBw== 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=epBEpieLB+VjNEtNqTSCs8XiK08oPz6TvEq4Xv1Si65u960ZjE7yVVSJjXb5X8jXzr c6EQ+Gh+YFL3kFo1Mn2s7pk7tKlEh5rszcd/BWM/2sq2SXJcNORWpXtvwXIJ6IYFpKXb 8MJQzfRL1cwaunp2Ez/CXedcwwj+P5hSHlY1HH0H/xvsuRUCt+Y4HptZ6zszfSuwOQ2z EBKcfb5ZjavRwR1RaxIV5W1BToWDB+LIIXceK2QV7qF2TcuPt4wEt+znqqwqqiHVT1/X joo5zuqov+25ZVYpc2vYUahguNjfr6I5Mmt9wJ93AM6KZx1ewps/4ZyketBvkWBz6uQn oW/Q==; 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=kT8OJSwC; 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-52e7ab2584asi4416970e87.263.2024.07.04.07.31.24; Thu, 04 Jul 2024 07:31:24 -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=kT8OJSwC; 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 466D768D9AE; Thu, 4 Jul 2024 17:31:15 +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 2AFA268D905 for ; Thu, 4 Jul 2024 17:31:07 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1720103466; bh=njzY9Ocn/6dWnV/LQc9JDqH9/D813PFysJ01a37js5I=; h=From:To:Cc:Subject:Date:From; b=kT8OJSwCMaVGjeGJsa7ZGS86ezkRPZpRu7gL25xoC/HaIEQwF3VY2kVQbYBlZiOxT fr3kTOnV7dspZjrFxv1H0eOqRW53/ZaSH8KIy8dMFExjy9SGzaHZ+pm1UtuVbFV2iC yvWrnpVE+28axhDsAPsOGIMOhmAVBA/rKG6gXepA= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id CB280402F2; Thu, 4 Jul 2024 16:31:06 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jul 2024 16:30:57 +0200 Message-ID: <20240704143104.1821386-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/8] 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: tAl5ZZK6WoF7 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