From 0588c9a53f187304afb20559634eb82cda7f696a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 21 Apr 2015 13:31:44 +0200 Subject: [PATCH] video-scaler: fix YUY2 scaling some more Take into account the different steps between Y and UV when calculating the line size for vertical resampling or else we might not resample enough pixels and leave bad lines. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=747790 --- gst-libs/gst/video/video-scaler.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index 07c92b0..abef4af 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -1480,16 +1480,23 @@ gst_video_scaler_2d (GstVideoScaler * hscale, GstVideoScaler * vscale, vfunc (vscale, lines, LINE (dest, dest_stride, i), i, width, n_elems); } } else { - guint vx, vw; + guint vx, vw, w1; guint h_taps; h_taps = hscale->resampler.max_taps; + w1 = x + width - 1; vx = (hscale->inc * x) >> 16; vx = MIN (vx, hscale->resampler.offset[x]); vw = (hscale->inc * (x + width)) >> 16; - vw = MAX (vw, - hscale->resampler.offset[x + width - 1] + (mult * h_taps)); + if (hscale->merged) { + if ((w1 & 1) == hscale->out_y_offset) + vw = MAX (vw, hscale->resampler.offset[w1] + (2 * h_taps)); + else + vw = MAX (vw, hscale->resampler.offset[w1] + (4 * h_taps)); + } else { + vw = MAX (vw, hscale->resampler.offset[w1] + h_taps); + } vw += 1; if (vscale->tmpwidth < vw) -- 2.7.4