[MOVED FROM BAD 43/68] colorspace: Add support for Y16
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 31 Oct 2010 22:25:57 +0000 (23:25 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 15 Jun 2011 14:12:55 +0000 (16:12 +0200)
gst/colorspace/colorspace.c
gst/colorspace/gstcolorspaceorc.orc

index fabcafb..26e7524 100644 (file)
@@ -527,6 +527,20 @@ putline_Y800 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
 }
 
 static void
+getline_Y16 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
+    int j)
+{
+  cogorc_getline_Y16 (dest, FRAME_GET_LINE (src, 0, j), convert->width);
+}
+
+static void
+putline_Y16 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
+    int j)
+{
+  cogorc_putline_Y16 (FRAME_GET_LINE (dest, 0, j), src, convert->width);
+}
+
+static void
 getline_BGRA (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
     int j)
 {
@@ -765,7 +779,7 @@ static const ColorspaceLine lines[] = {
   //{GST_VIDEO_FORMAT_GRAY16_LE, getline_GRAY16_LE, putline_GRAY16_LE},
   {GST_VIDEO_FORMAT_v308, getline_v308, putline_v308},
   {GST_VIDEO_FORMAT_Y800, getline_Y800, putline_Y800},
-  //{GST_VIDEO_FORMAT_Y16, getline_Y16, putline_Y16},
+  {GST_VIDEO_FORMAT_Y16, getline_Y16, putline_Y16},
   //{GST_VIDEO_FORMAT_RGB16, getline_RGB16, putline_RGB16},
   //{GST_VIDEO_FORMAT_BGR16, getline_BGR16, putline_BGR16},
   //{GST_VIDEO_FORMAT_RGB15, getline_RGB15, putline_RGB15},
index 3661c85..2776bce 100644 (file)
@@ -1413,6 +1413,17 @@ mergewl ayuv, ay, uv
 mergebw ay, c255, y
 mergewl ayuv, ay, c0x8080
 
+.function cogorc_getline_Y16
+.dest 4 ayuv guint8
+.source 2 y guint8
+.const 1 c255 255
+.const 2 c0x8080 0x8080
+.temp 2 ay
+.temp 1 yb
+
+convhwb yb, y
+mergebw ay, c255, yb
+mergewl ayuv, ay, c0x8080
 
 .function cogorc_getline_BGRA
 .dest 4 argb guint8
@@ -1615,6 +1626,16 @@ select1wb y, ay
 select0lw ay, ayuv
 select1wb y, ay
 
+.function cogorc_putline_Y16
+.dest 2 y guint8
+.source 4 ayuv guint8
+.temp 2 ay
+.temp 1 yb
+
+select0lw ay, ayuv
+select1wb yb, ay
+convubw ay, yb
+shlw y, ay, 8
 
 .function cogorc_putline_BGRA
 .dest 4 bgra guint8