diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc index a966a4f423..be4393e475 100644 --- a/gst-libs/gst/video/video-orc.orc +++ b/gst-libs/gst/video/video-orc.orc @@ -1802,6 +1802,28 @@ addw w1, w1, 32 shrsw w1, w1, 6 convsuswb d, w1 +.function video_orc_resample_h_2tap_u16 +.source 2 s1 guint16 +.source 2 s2 guint16 +.source 2 t1 gint16 +.source 2 t2 gint16 +.dest 2 d guint16 +.temp 4 w1 +.temp 4 w2 +.temp 4 tl1 +.temp 4 tl2 + +convuwl w1, s1 +convswl tl1, t1 +mulll w1, w1, tl1 +convuwl w2, s2 +convswl tl2, t2 +mulll w2, w2, tl2 +addl w1, w1, w2 +addl w1, w1, 4096 +shrsl w1, w1, 12 +convsuslw d, w1 + .function video_orc_resample_v_2tap_u8_lq .source 1 src1 guint8 .source 1 src2 guint8 diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index 385386971b..7a94412b81 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -752,13 +752,18 @@ video_scale_h_ntap_u16 (GstVideoScaler * scale, taps = scale->taps_s16_4; count = width * n_elems; - /* first pixels with first tap to t4 */ - video_orc_resample_h_multaps_u16 (temp, pixels, taps, count); - /* add other pixels with other taps to t4 */ - video_orc_resample_h_muladdtaps_u16 (temp, 0, pixels + count, count * 2, - taps + count, count * 2, count, max_taps - 1); - /* scale and write final result */ - video_orc_resample_scaletaps_u16 (d, temp, count); + if (max_taps == 2) { + video_orc_resample_h_2tap_u16 (d, pixels, pixels + count, taps, + taps + count, count); + } else { + /* first pixels with first tap to t4 */ + video_orc_resample_h_multaps_u16 (temp, pixels, taps, count); + /* add other pixels with other taps to t4 */ + video_orc_resample_h_muladdtaps_u16 (temp, 0, pixels + count, count * 2, + taps + count, count * 2, count, max_taps - 1); + /* scale and write final result */ + video_orc_resample_scaletaps_u16 (d, temp, count); + } } static void