[FFmpeg-devel] [PATCH v2 3/8] swscale/options: relax src/dst_h/v_chr_pos value range

Michael Niedermayer michael at niedermayer.cc
Sun Jul 7 21:56:15 EEST 2024


On Thu, Jul 04, 2024 at 04:30:59PM +0200, Niklas Haas wrote:
> From: Niklas Haas <git at haasn.dev>
> 
> When dealing with 4x subsampling ratios (log2 == 2), such as can arise
> with 4:1:1 or 4:1:0, a value range of 512 is not enough to cover the
> range of possible scenarios.
> 
> For example, bottom-sited chroma in 4:1:0 would require an offset of 768
> (three luma rows). Simply double the limit to 1024. I don't see any
> place in initFilter() that would experience overflow as a result of this
> change, especially since get_local_pos() right-shifts it by the
> subsampling ratio again.
> ---
>  libswscale/options.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

maybe limit it to the max value you know is needed instead of simply doubling.
it can be bumped up more later if we run in cases needing more

either way
LGTM

thx

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20240707/011690c8/attachment.sig>


More information about the ffmpeg-devel mailing list