From dcd02cd32307f6a1079d090e4f79e2f62f166aa1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 7 Nov 2014 15:45:04 +0100 Subject: [PATCH] video-chroma: add ORC version of UP_H2_CS It is however slower than the C version and thus disabled. --- gst-libs/gst/video/video-chroma.c | 12 +++++++++++- gst-libs/gst/video/video-orc.orc | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-chroma.c b/gst-libs/gst/video/video-chroma.c index fc44a21589..04d7267991 100644 --- a/gst-libs/gst/video/video-chroma.c +++ b/gst-libs/gst/video/video-chroma.c @@ -526,7 +526,17 @@ MAKE_DOWNSAMPLE_VI4 (u8, guint8); * x x * a b */ -#define MAKE_UPSAMPLE_H2_CS(name,type) \ +#define MAKE_UPSAMPLE_H2_CS_ORC(name,type) \ +static void \ +video_chroma_up_h2_cs_##name (GstVideoChromaResample *resample, \ + gpointer pixels, gint width) \ +{ \ + type *p = pixels; \ + /* ORC version is slower */ \ + video_orc_chroma_up_h2_cs_##name (p, p, p, width-1); \ +} + +#define MAKE_UPSAMPLE_H2_CS(name,type) \ static void \ video_chroma_up_h2_cs_##name (GstVideoChromaResample *resample, \ gpointer pixels, gint width) \ diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc index db23dfbe85..27eadbc860 100644 --- a/gst-libs/gst/video/video-orc.orc +++ b/gst-libs/gst/video/video-orc.orc @@ -1659,6 +1659,25 @@ x2 avgub uv1, uv1, uv2 mergewl ayuv1, ay1, uv1 mergelq d, ayuv1, ayuv2 +.function video_orc_chroma_up_h2_cs_u8 +.source 8 s guint8 +.source 4 s1 guint8 +.dest 8 d guint8 +.temp 4 ayuv1 +.temp 4 ayuv2 +.temp 4 ayuv3 +.temp 2 ay2 +.temp 2 uv2 +.temp 2 uv3 + +splitql ayuv2, ayuv1, s +ldresnearl ayuv3, s1, 0x20000, 0x20000 +splitlw uv2, ay2, ayuv2 +select1lw uv3, ayuv3 +x2 avgub uv2, uv2, uv3 +mergewl ayuv2, ay2, uv2 +mergelq d, ayuv1, ayuv2 + .function video_orc_chroma_down_v2_u8 .source 4 s1 guint8 .source 4 s2 guint8