[FFmpeg-devel] [PATCH] lavu/pixfmt: summarize yuv naming conventions

Hendrik Leppkes h.leppkes at gmail.com
Wed Jul 27 18:58:09 EEST 2022


On Wed, Jul 27, 2022 at 5:25 PM Nicolas George <george at nsup.org> wrote:
>
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavutil/pixfmt.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
>
> Note: we have log2_chroma_h = 2 for yuv410p, meaning each chroma pixel
> is 4×4 luma pixels, but everywhere I look on the web, ilcuding:
> https://en.wikipedia.org/wiki/Chroma_subsampling
> I find that it is supposed to be 4×2, and we should set log2_chroma_h = 1.
> Who is right?

Following the actual naming convention, you would arrive at a 4x2
grid, however even the Wikipedia article linked above is inconsistent
with that. In the first section describing how the naming convention
works, it lists an exception that 4:1:0 is supposedly referencing a
4x4 grid, however further down where 4:1:0 is being detailed, this is
no longer the case.
Many other resources just seem to copy this second Wikipedia description.

We have a variety of decoders that use this format as it is defined
right now, presumably successfully. Of course that could just mean
this format exists, and is just named wrong, on the other hand, did
any decoder ever require the one pixel per 4x4 grid format, giving any
technical baking to the other interpretation?

- Hendrik


More information about the ffmpeg-devel mailing list