summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-03-04 15:45:35 (GMT)
committerWim Taymans <wtaymans@redhat.com>2015-03-04 15:45:35 (GMT)
commit6602861d00acd70976a26910576288245fd833cd (patch)
tree80266928237a17766429e2eb67fb113b5f42b294
parent72fd1345ad946b586d016fd84f3d9c04d0c6548f (diff)
downloadgst-plugins-base-6602861d00acd70976a26910576288245fd833cd.tar.gz
gst-plugins-base-6602861d00acd70976a26910576288245fd833cd.tar.xz
video-scaler: add horizontal 2tap u16 orc function
Add slightly faster u16 horizontal resampler orc function.
-rw-r--r--gst-libs/gst/video/video-orc.orc22
-rw-r--r--gst-libs/gst/video/video-scaler.c19
2 files changed, 34 insertions, 7 deletions
diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc
index a966a4f..be4393e 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 3853869..7a94412 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