mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
video-converter: v-resample enough pixels
When we are using the fast linear resampler, use the ->inc to calculate the first and last pixel we need so that we can do vertical resampling on the right amount of pixels.
This commit is contained in:
parent
0062dadc35
commit
b2a7ac2766
2 changed files with 9 additions and 4 deletions
|
@ -1849,7 +1849,7 @@ setup_borderline (GstVideoConverter * convert)
|
||||||
}
|
}
|
||||||
w_sub = 0;
|
w_sub = 0;
|
||||||
if (out_finfo->n_planes == 1) {
|
if (out_finfo->n_planes == 1) {
|
||||||
/* for packet formats, convert based on subsampling so that we
|
/* for packed formats, convert based on subsampling so that we
|
||||||
* get a complete group of pixels */
|
* get a complete group of pixels */
|
||||||
for (i = 0; i < out_finfo->n_components; i++) {
|
for (i = 0; i < out_finfo->n_components; i++) {
|
||||||
w_sub = MAX (w_sub, out_finfo->w_sub[i]);
|
w_sub = MAX (w_sub, out_finfo->w_sub[i]);
|
||||||
|
|
|
@ -1467,10 +1467,15 @@ gst_video_scaler_2d (GstVideoScaler * hscale, GstVideoScaler * vscale,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
guint vx, vw;
|
guint vx, vw;
|
||||||
|
guint h_taps;
|
||||||
|
|
||||||
vx = hscale->resampler.offset[x];
|
h_taps = hscale->resampler.max_taps;
|
||||||
vw = hscale->resampler.offset[x + width - 1] +
|
|
||||||
hscale->resampler.max_taps;
|
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] + h_taps);
|
||||||
|
vw += 1;
|
||||||
|
|
||||||
if (vscale->tmpwidth < vw)
|
if (vscale->tmpwidth < vw)
|
||||||
realloc_tmplines (vscale, n_elems, vw);
|
realloc_tmplines (vscale, n_elems, vw);
|
||||||
|
|
Loading…
Reference in a new issue