From patchwork Tue Aug 2 16:54:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 37090 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp3256631pzb; Tue, 2 Aug 2022 09:54:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hg3wBfpPbs4wXOUGeYIppmVqDGSJMs8QN/L1DqARlQRVpBrHemC90xDinC/CkPZBH7mum X-Received: by 2002:aa7:c713:0:b0:43d:40ff:5f16 with SMTP id i19-20020aa7c713000000b0043d40ff5f16mr17905022edq.256.1659459293186; Tue, 02 Aug 2022 09:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659459293; cv=none; d=google.com; s=arc-20160816; b=vPkfWDiJ7PMmw9SbE5eGSs0+7yxI1yEyZ13PpqH/x7B1EMVY5mgxMtKeEtJK0zhbQ/ p3eU472koYJRw288b079lW+l4U5eRFoDSL7w9EuSItJGTboLAxircBwDfp/SSHJCF6cl hSCJh6IQn14vbAxCsHoYdYO4rmh5AseauvBcS36+5sARlYmYSdsY9goNolUCDPvH+ZAS l7+pz3tKXoTQnWAOdzV+aflqV5X6dt6gTsHY9XTWhMb6z6wl2PqZqDVBzAluUVjnDh+U MbhPf1ceymm5pCZxCszSc1SpuyffuNUdNiDo7TXJ5QPRWoFlxKXtu+mZPUCcC5Ei73ms R4Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=eL06woqLGnjg61nx7bDXUzQjfJofYGi58izYUKwq81A=; b=ARVVyZVyerrAGt6rfWd/PzNpN6IIkKn2OaELkQzjJVINjjrtSCmDQ8ShZJrw+VYr2t Wz96ug4LiFOdU54dmqtkBRxVziAiDMC1icSJF62q8nauUOBot8p/hQ/tSM6tAAekFMf5 CP/nuVMj0Dhg47wmrEu6nTmJZd1JlvuGmXggZG6+X4xWsYe+ShOrmf4C1UuUIg8hlO55 PGQqmSdUg0AD+Yc9U0q9dEZ7A2wVpTCzkVPOfWpt61aZaftpbijn8APSkYTjnQ7GQLK1 Cn6graw5u/5eNQqAmrZaCynRBlnLZL3yC/20UrOC5BZzNd/3uAQ7SVgQtyWNGZjpZXNQ Iubw== ARC-Authentication-Results: i=1; mx.google.com; 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 v18-20020a056402349200b0043c8ac1ad11si15433941edc.618.2022.08.02.09.54.52; Tue, 02 Aug 2022 09:54:53 -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; 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 7C91468BA07; Tue, 2 Aug 2022 19:54:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECB0268BA07 for ; Tue, 2 Aug 2022 19:54:25 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 272GsNNt017560 for ; Tue, 2 Aug 2022 18:54:24 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id D6F4FEB5BC; Tue, 2 Aug 2022 18:54:23 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Aug 2022 18:54:15 +0200 Message-Id: <20220802165421.137563-1-george@nsup.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 02 Aug 2022 18:54:24 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/7] lavu/pixfmt: summarize yuv naming conventions 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: YPDBP5WkAiKm Signed-off-by: Nicolas George --- libavutil/pixfmt.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) Identical to the one I posted last week. diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 2d3927cc3f..3d0f92ed4d 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -60,6 +60,23 @@ * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like * for pal8. This palette is filled in automatically by the function * allocating the picture. + * + * @par + * Summary of the naming conventions for YUV formats: + * 444 422 440 420 411 410 + * ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━┿━┿━┿━╋ ╋━┿━┿━┿━╋ + * ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╂─╂─╂─╂─╂ ╂─┼─╂─┼─╂ ╋━┿━┿━┿━╋ ╂─┼─┼─┼─╂ + * ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━┿━┿━┿━╋ ╂─┼─┼─┼─╂ + * ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╂─╂─╂─╂─╂ ╂─┼─╂─┼─╂ ╋━┿━┿━┿━╋ ╂─┼─┼─┼─╂ + * ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━╋━╋━╋━╋ ╋━┿━╋━┿━╋ ╋━┿━┿━┿━╋ ╋━┿━┿━┿━╋ + * where + * ┼─┼ = luma pixel ╋━╋ = chroma pixel + * ┼─┼ ╋━╋ + * + * yuv4ab → + * log2_chroma_w = log₂(4/a) + * log2_chroma_h = b == a ? 0 : b == 0 ? log2_chroma_w : unused + * i.e. a = horizontally, number of luma pixels for four chroma pixels */ enum AVPixelFormat { AV_PIX_FMT_NONE = -1,