video-format: fix range extension of UYVP
authorWim Taymans <wtaymans@redhat.com>
Thu, 6 Nov 2014 08:32:21 +0000 (09:32 +0100)
committerWim Taymans <wtaymans@redhat.com>
Thu, 6 Nov 2014 09:45:13 +0000 (10:45 +0100)
We need to shift the top 6 bits to the lower 6 bits

gst-libs/gst/video/video-format.c

index c23c08f..9afb85a 100644 (file)
@@ -1235,10 +1235,10 @@ unpack_UYVP (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
     y1 = (((s[(i / 2) * 5 + 3] & 0x03) << 8) | s[(i / 2) * 5 + 4]) << 6;
 
     if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
-      y0 |= (y0 >> 4);
-      y1 |= (y1 >> 4);
-      u0 |= (u0 >> 4);
-      v0 |= (v0 >> 4);
+      y0 |= (y0 >> 10);
+      y1 |= (y1 >> 10);
+      u0 |= (u0 >> 10);
+      v0 |= (v0 >> 10);
     }
 
     d[i * 4 + 0] = 0xffff;