allow vaDeriveImage() to work for UYVY formats
authorGwenole Beauchesne <gb.devel@gmail.com>
Fri, 26 Jul 2013 11:08:27 +0000 (13:08 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 9 Sep 2013 07:24:08 +0000 (15:24 +0800)
Hi,

I would push the following as obvious around next week.

Add support for UYVY format to vaDeriveImage(). Also remove dead code
along the way, i.e. packed YUV 4:2:2 formats have a single plane.

Regards,
Gwenole.

src/i965_drv_video.c

index 9a8d709..89e776a 100755 (executable)
@@ -3021,13 +3021,10 @@ VAStatus i965_DeriveImage(VADriverContextP ctx,
         image->offsets[2] = w_pitch * obj_surface->y_cr_offset;
         break;
     case VA_FOURCC('Y', 'U', 'Y', '2'):
+    case VA_FOURCC('U', 'Y', 'V', 'Y'):
         image->num_planes = 1;
         image->pitches[0] = obj_surface->width * 2; /* Y, width is aligned already */
         image->offsets[0] = 0;
-        image->pitches[1] = obj_surface->width * 2; /* U */
-        image->offsets[1] = 0;
-        image->pitches[2] = obj_surface->width * 2; /* V */
-        image->offsets[2] = 0;
         break;
     case VA_FOURCC('R', 'G', 'B', 'A'):
     case VA_FOURCC('R', 'G', 'B', 'X'):