mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
video-converter: only make a scaler when we are scaling
Only make a scaler when we are actually doing any scaling. Without scalers, the scale function will simply do a copy.
This commit is contained in:
parent
330fb44a6f
commit
e1715f7728
1 changed files with 14 additions and 7 deletions
|
@ -3918,9 +3918,12 @@ setup_scale (GstVideoConverter * convert)
|
||||||
gst_video_scaler_free (y_scaler);
|
gst_video_scaler_free (y_scaler);
|
||||||
gst_video_scaler_free (uv_scaler);
|
gst_video_scaler_free (uv_scaler);
|
||||||
} else {
|
} else {
|
||||||
convert->fh_scaler[0] =
|
if (in_width != out_width)
|
||||||
gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, taps,
|
convert->fh_scaler[0] =
|
||||||
in_width, out_width, convert->config);
|
gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, taps,
|
||||||
|
in_width, out_width, convert->config);
|
||||||
|
else
|
||||||
|
convert->fh_scaler[0] = NULL;
|
||||||
|
|
||||||
pstride = GST_VIDEO_FORMAT_INFO_PSTRIDE (out_finfo, GST_VIDEO_COMP_R);
|
pstride = GST_VIDEO_FORMAT_INFO_PSTRIDE (out_finfo, GST_VIDEO_COMP_R);
|
||||||
convert->fin_x[0] = convert->in_x * pstride;
|
convert->fin_x[0] = convert->in_x * pstride;
|
||||||
|
@ -3929,11 +3932,15 @@ setup_scale (GstVideoConverter * convert)
|
||||||
stride = MAX (stride, GST_VIDEO_INFO_PLANE_STRIDE (in_info, 0));
|
stride = MAX (stride, GST_VIDEO_INFO_PLANE_STRIDE (in_info, 0));
|
||||||
stride = MAX (stride, GST_VIDEO_INFO_PLANE_STRIDE (out_info, 0));
|
stride = MAX (stride, GST_VIDEO_INFO_PLANE_STRIDE (out_info, 0));
|
||||||
|
|
||||||
convert->fv_scaler[0] =
|
if (in_height != out_height) {
|
||||||
gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, taps,
|
convert->fv_scaler[0] =
|
||||||
in_height, out_height, convert->config);
|
gst_video_scaler_new (method, GST_VIDEO_SCALER_FLAG_NONE, taps,
|
||||||
|
in_height, out_height, convert->config);
|
||||||
|
gst_video_scaler_get_coeff (convert->fv_scaler[0], 0, NULL, &max_taps);
|
||||||
|
} else {
|
||||||
|
convert->fv_scaler[0] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
gst_video_scaler_get_coeff (convert->fv_scaler[0], 0, NULL, &max_taps);
|
|
||||||
|
|
||||||
convert->fin_y[0] = convert->in_y;
|
convert->fin_y[0] = convert->in_y;
|
||||||
convert->fout_y[0] = convert->out_y;
|
convert->fout_y[0] = convert->out_y;
|
||||||
|
|
Loading…
Reference in a new issue