[FFmpeg-devel] [PATCH] avcodec/tiff: Try to fix subsampling default

Michael Niedermayer michael at niedermayer.cc
Fri Oct 11 23:11:19 EEST 2019


On Sat, Sep 28, 2019 at 07:13:59PM +0300, Skakov Pavel wrote:
> >This ensures the default ycbcr_subsampling is 2 while also
> >ensuring the subsampling values are correct for all pixel formats.
> >This solution while it takes a few lines more code should be more
> >robust
> 
> In TIFF specification only CbCr subsampling is allowed. The field is explicitly named "YCbCrSubsampling", so introducing another subsampling variable serves no purpose other than introducing confusion.

Well, you are technically correct
But having subsampling of 2 "accessible" when subsampling is not 2 is asking
for out of array accesses.

I mean if you set subsampling so it is always correct for the used pixel
format then any code can use it and its fine

But if subsampling is only valid for one colorspace and 2 otherwise
now you have to proof and maintain that condition that no code ever uses the
subsampling value unless the colorspace is ycbcr

I have no strong oppinon on this but at the least the subsampling field
would need to be renamed to ycbcr_subsampling if its invalid in the
more general case

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191011/ada90d58/attachment.sig>


More information about the ffmpeg-devel mailing list