From fae9d82515cba6d799dc83f093a7685aadb94e9e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 6 Sep 2013 12:43:27 +0200 Subject: [PATCH] video-format: fix NV24 pack/unpack function We can't reuse the NV12 functions, we need to make new ones. --- gst-libs/gst/video/video-format.c | 4 ++-- gst-libs/gst/video/video-orc.orc | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-format.c b/gst-libs/gst/video/video-format.c index 286f6ad3c0..2b3f4b0f6f 100644 --- a/gst-libs/gst/video/video-format.c +++ b/gst-libs/gst/video/video-format.c @@ -1179,7 +1179,7 @@ unpack_NV24 (const GstVideoFormatInfo * info, GstVideoPackFlags flags, gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES], const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width) { - video_orc_unpack_NV12 (dest, + video_orc_unpack_NV24 (dest, GET_PLANE_LINE (0, y), GET_PLANE_LINE (1, y), width); } @@ -1189,7 +1189,7 @@ pack_NV24 (const GstVideoFormatInfo * info, GstVideoPackFlags flags, const gint stride[GST_VIDEO_MAX_PLANES], GstVideoChromaSite chroma_site, gint y, gint width) { - video_orc_pack_NV12 (GET_PLANE_LINE (0, y), + video_orc_pack_NV24 (GET_PLANE_LINE (0, y), GET_PLANE_LINE (1, y), src, width); } diff --git a/gst-libs/gst/video/video-orc.orc b/gst-libs/gst/video/video-orc.orc index 533d9d3f1a..1f673271c3 100644 --- a/gst-libs/gst/video/video-orc.orc +++ b/gst-libs/gst/video/video-orc.orc @@ -423,6 +423,25 @@ x2 select1wb y, ay select0lw uv, uvuv swapw vu, uv +.function video_orc_unpack_NV24 +.dest 4 d guint8 +.source 1 y guint8 +.source 2 uv guint8 +.const 1 c255 255 +.temp 2 ay + +mergebw ay, c255, y +mergewl d, ay, uv + +.function video_orc_pack_NV24 +.dest 1 y guint8 +.dest 2 uv guint8 +.source 4 ayuv guint8 +.temp 2 ay + +splitlw uv, ay, ayuv +select1wb y, ay + .function video_orc_unpack_A420 .dest 4 d guint8 .source 1 y guint8