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

Michael Niedermayer michael at niedermayer.cc
Thu Aug 4 18:04:41 EEST 2022


On Thu, Aug 04, 2022 at 03:57:27PM +0200, Nicolas George wrote:
> Michael Niedermayer (12022-08-04):
> > You seem to describe samples as rectangular areas of constant value IIUC.
> > If you look at the ITU/ISO specs (mpeg2, h264 or others) they are described
> > by point samples. The desity of samples matches. While the default locations
> > do not.
> > What you list above are where probably most sane people would place the
> > samples. But ISO/ITU, probably because of historic TV standard reasons and
> > interlacing convertion reasons place the chroma samples in a more crooked way
> > I think either the ascii art should be adapted or the text should clarify
> > this difference
> 
> I am not sure what exactly you explain.

What i meant is what is also in AVChromaLocation
The chroma sample locations are shifted from where one would expect


> 
> The picture represents memory cells and how we think of them when we
> implement generic functions, for example cropping or drawutils. Do we
> need to fix all this code somehow?

I suspect several filters are somewhat "wrong"
for example hflip fliping 4:1:1
would turn a:   *--- into ---*
where * is teh chroma sample location, i dont think it updates the chroma
sample location metadata nor does it apply some filter to chroma to shift by
3/4 samples. so it looks wrong, one of the 2 is neeed.

vf_scale contains some code to handle this but iam not seeing code considering
the input and output frames chroma location metadata

All this leads to small errors, often probably not vissible
when you have one one chroma sample for 4 luma samples you will always have
some artifacts on sharp color edges, if the location of the chroma sample
is wrong the artifact would be more to one side of a diagonal edge than the
other. If the locations are correct it should be more symmetric in theory.

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220804/4ae6e10b/attachment.sig>


More information about the ffmpeg-devel mailing list