From 202c3bc4b1e0682bd0dfee998f2420d0c8e37392 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sat, 23 Jul 2022 02:49:20 +1000 Subject: [PATCH] video: Fix scaling in 4x horizontal co-sited chroma 4x downscaling of chroma with co-sited chroma has never worked it seems. Fixes incorrect videotestsrc output and videoconvert conversions to Y41B, YUV9, YVU9 and IYU9 with co-sited chroma. e.g. gst-launch-1.0 videotestsrc ! video/x-raw,format=Y41B,width=1280,height=720 ! \ videoconvert ! autovideosink Part-of: --- .../gst-plugins-base/gst-libs/gst/video/video-chroma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c index c538bba4fc..2a634073df 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c @@ -260,9 +260,9 @@ struct _GstVideoChromaResample #define FILT_5_3(a,b) (5*(a) + 3*(b) + 4) >> 3 #define FILT_3_5(a,b) (3*(a) + 5*(b) + 4) >> 3 -#define FILT_10_3_2_1(a,b,c,d) (10*(a) + 3*(b) + 2*(c) + (d) + 8) >> 16 -#define FILT_1_2_3_10(a,b,c,d) ((a) + 2*(b) + 3*(c) + 10*(d) + 8) >> 16 -#define FILT_1_2_3_4_3_2_1(a,b,c,d,e,f,g) ((a) + 2*((b)+(f)) + 3*((c)+(e)) + 4*(d) + (g) + 8) >> 16 +#define FILT_10_3_2_1(a,b,c,d) (10*(a) + 3*(b) + 2*(c) + (d) + 8) >> 4 +#define FILT_1_2_3_10(a,b,c,d) ((a) + 2*(b) + 3*(c) + 10*(d) + 8) >> 4 +#define FILT_1_2_3_4_3_2_1(a,b,c,d,e,f,g) ((a) + 2*((b)+(f)) + 3*((c)+(e)) + 4*(d) + (g) + 8) >> 4 /* 2x horizontal upsampling without cositing *