video-converter: Don't use fast-path halfing/doubling rescalers for interlaced planar formats

They will mix lines from the top and bottom field and by that
effectively deinterlace the video, badly.
This commit is contained in:
Sebastian Dröge 2019-10-21 16:43:02 +03:00
parent 565b797f57
commit 255beae3ec

View file

@ -6134,14 +6134,14 @@ setup_scale (GstVideoConverter * convert)
need_v_scaler = FALSE; need_v_scaler = FALSE;
need_h_scaler = FALSE; need_h_scaler = FALSE;
if (iw == ow) { if (iw == ow) {
if (ih == oh) { if (!interlaced && ih == oh) {
convert->fconvert[i] = convert_plane_hv; convert->fconvert[i] = convert_plane_hv;
GST_DEBUG ("plane %d: copy", i); GST_DEBUG ("plane %d: copy", i);
} else if (ih == 2 * oh && pstride == 1 } else if (!interlaced && ih == 2 * oh && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) {
convert->fconvert[i] = convert_plane_v_halve; convert->fconvert[i] = convert_plane_v_halve;
GST_DEBUG ("plane %d: vertical halve", i); GST_DEBUG ("plane %d: vertical halve", i);
} else if (2 * ih == oh && pstride == 1 } else if (!interlaced && 2 * ih == oh && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) {
convert->fconvert[i] = convert_plane_v_double; convert->fconvert[i] = convert_plane_v_double;
GST_DEBUG ("plane %d: vertical double", i); GST_DEBUG ("plane %d: vertical double", i);
@ -6151,11 +6151,11 @@ setup_scale (GstVideoConverter * convert)
need_v_scaler = TRUE; need_v_scaler = TRUE;
} }
} else if (ih == oh) { } else if (ih == oh) {
if (iw == 2 * ow && pstride == 1 if (!interlaced && iw == 2 * ow && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) {
convert->fconvert[i] = convert_plane_h_halve; convert->fconvert[i] = convert_plane_h_halve;
GST_DEBUG ("plane %d: horizontal halve", i); GST_DEBUG ("plane %d: horizontal halve", i);
} else if (2 * iw == ow && pstride == 1 } else if (!interlaced && 2 * iw == ow && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) {
convert->fconvert[i] = convert_plane_h_double; convert->fconvert[i] = convert_plane_h_double;
GST_DEBUG ("plane %d: horizontal double", i); GST_DEBUG ("plane %d: horizontal double", i);
@ -6165,11 +6165,11 @@ setup_scale (GstVideoConverter * convert)
need_h_scaler = TRUE; need_h_scaler = TRUE;
} }
} else { } else {
if (iw == 2 * ow && ih == 2 * oh && pstride == 1 if (!interlaced && iw == 2 * ow && ih == 2 * oh && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_LINEAR) {
convert->fconvert[i] = convert_plane_hv_halve; convert->fconvert[i] = convert_plane_hv_halve;
GST_DEBUG ("plane %d: horizontal/vertical halve", i); GST_DEBUG ("plane %d: horizontal/vertical halve", i);
} else if (2 * iw == ow && 2 * ih == oh && pstride == 1 } else if (!interlaced && 2 * iw == ow && 2 * ih == oh && pstride == 1
&& resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) { && resample_method == GST_VIDEO_RESAMPLER_METHOD_NEAREST) {
convert->fconvert[i] = convert_plane_hv_double; convert->fconvert[i] = convert_plane_hv_double;
GST_DEBUG ("plane %d: horizontal/vertical double", i); GST_DEBUG ("plane %d: horizontal/vertical double", i);