Re: [FFmpeg-devel] [PATCH] swscale/output: Use av_sat_add32 in yuv2rgba64 templates to avoid underflow

2022-12-12 Thread Drew Dunne
Here is the problematic input video attached. On Mon, Dec 12, 2022 at 3:08 PM Drew Dunne wrote: > Previously I sent this patch to solve an overflow in these templates. That > patch wasn't used in favor of one that biased the output calculations to > avoid the double clipping. Now

[FFmpeg-devel] [PATCH] swscale/output: Use av_sat_add32 in yuv2rgba64 templates to avoid underflow

2022-12-12 Thread Drew Dunne
Previously I sent this patch to solve an overflow in these templates. That patch wasn't used in favor of one that biased the output calculations to avoid the double clipping. Now I've found an underflow case, which I've put the command below, and I'll attach an input image in a reply. ./ffmpeg \

Re: [FFmpeg-devel] [PATCH 1/2] swscale/output: Bias 16bps output calculations to improve non overflowing range

2022-11-03 Thread Drew Dunne
lex > "scale=flags=bicubic+full_chroma_int+full_chroma_inp+bitexact+accurate_rnd:in_color_matrix=bt2020:out_color_matrix=bt2020:in_range=full:out_range=full,format=rgba64[out]" > -pixel_format rgba64 -map '[out]' -y overflow_w66h64.png > > Found-by: Drew

[FFmpeg-devel] [PATCH] sws_scale: Use av_sat_add32 in yuv2rgba64 template

2022-11-01 Thread Drew Dunne
Avoid a possible integer overflow in the yuv2rgba64 templates by using av_sat_add32 when combing the R, G, B components with Y. On certain inputs, this addition can overflow to a negative, is then clipped to a power of two and shifted down 14. This results in a much different value in the output th

[FFmpeg-devel] [PATCH] Avoid possible integer overflow in yuv420 to rgba64 templates by saturating.

2022-10-26 Thread Drew Dunne
--- libswscale/output.c | 96 ++--- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index 0e1c1225a0..8c8f62682a 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1109,20 +1109,20 @@ yuv2