From: Wim Taymans Date: Thu, 13 Nov 2014 11:00:05 +0000 (+0100) Subject: video-converter: add orc splat functions to draw border X-Git-Tag: 1.19.3~511^2~4145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc5dd035fac22283c9ee78ca6ea3b205797110a0;p=platform%2Fupstream%2Fgstreamer.git video-converter: add orc splat functions to draw border --- diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index c1487ca..3c657dd 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -755,11 +755,9 @@ gst_video_converter_new (GstVideoInfo * in_info, GstVideoInfo * out_info, if (convert->fill_border && (convert->out_height < convert->out_maxheight || convert->out_width < convert->out_maxwidth)) { - gint i; - guint8 *b; - guint64 border_val, v; + guint64 border_val; - b = convert->borderline = g_malloc0 (sizeof (guint16) * width * 4); + convert->borderline = g_malloc0 (sizeof (guint16) * width * 4); if (GST_VIDEO_INFO_IS_YUV (&convert->out_info)) { /* FIXME, convert to AYUV, just black for now */ @@ -767,26 +765,10 @@ gst_video_converter_new (GstVideoInfo * in_info, GstVideoInfo * out_info, } else { border_val = convert->border_argb; } - - if (convert->out_bits == 8) - v = (border_val << 32) | border_val; - else { - guint64 c; - - c = (border_val >> 24) & 0xff; - v = (c << 56) | (c << 48); - c = (border_val >> 16) & 0xff; - v |= (c << 40) | (c << 32); - c = (border_val >> 8) & 0xff; - v |= (c << 24) | (c << 16); - c = (border_val) & 0xff; - v |= (c << 8) | c; - } - v = GINT64_TO_BE (v); - for (i = 0; i < width; i++) { - memcpy (b, &v, 8); - b += 8; - } + if (convert->pack_bits == 8) + video_orc_splat_u32 (convert->borderline, border_val, width); + else + video_orc_splat_u64 (convert->borderline, border_val, width); } else { convert->borderline = NULL; } diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc index 5a2d1f9..7cbae15 100644 --- a/gst-libs/gst/video/video-orc.orc +++ b/gst-libs/gst/video/video-orc.orc @@ -542,6 +542,18 @@ convhwb d, s mergebw d, s, s +.function video_orc_splat_u32 +.dest 4 d1 guint8 +.param 4 p1 + +storel d1, p1 + +.function video_orc_splat_u64 +.dest 8 d1 guint8 +.param 4 p1 + +x4 mergebw d1, p1, p1 + .function video_orc_convert_I420_UYVY .dest 4 d1 guint8 .dest 4 d2 guint8