On Fri, Oct 11, 2024 at 09:39:14AM +0200, Lynne via ffmpeg-devel wrote:
> On 01/10/2024 22:31, Michael Niedermayer wrote:
[...]
> > +    int i = width * (int64_t)(num_h_slices - 1) / num_h_slices;
> > +
> > +    return width % mpw && (width - i) % mpw == 0;
> 
> Would a check (if height < (subsampling ? 3 : 1)) would have been enough?

no


> This isn't really readable nor understandable.

true
if you consider 4:2:0 then
there really are 4 cases for each slice left and right side even and odd
and the ones both starting and ending odd have the last line missing
But! the ones starting odd store the previous chroma line so
the odd odd case in the middle works out its only a problem if its the
last slice on the right or bottom and thats what we test for here


> 
> Furthermore, this function is called with both width and height, yet all
> variables are named with the assumption that only width is used.

ill add a commet to clarify this, not 100% happy but i cannot think of a
good term that represents both width and height without being confusingly
generic

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to