Update the MFX_AVC_IMAGE_STATE to follow the spec
authorZhao Yakui <yakui.zhao@intel.com>
Fri, 27 Dec 2013 07:56:37 +0000 (15:56 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 27 Feb 2014 02:30:18 +0000 (10:30 +0800)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
src/gen75_mfc.c
src/gen75_mfd.c
src/gen7_mfc.c
src/gen7_mfd.c
src/gen8_mfc.c
src/gen8_mfd.c

index 7161acd..28edd40 100644 (file)
@@ -259,7 +259,7 @@ gen75_mfc_avc_img_state(VADriverContextP ctx, struct encode_state *encode_state,
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     /*DW1. MB setting of frame */
     OUT_BCS_BATCH(batch,
-                  ((width_in_mbs * height_in_mbs) & 0xFFFF));
+                  ((width_in_mbs * height_in_mbs - 1) & 0xFFFF));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
index dc7c940..4a4de0b 100644 (file)
@@ -566,7 +566,7 @@ gen75_mfd_avc_img_state(VADriverContextP ctx,
     BEGIN_BCS_BATCH(batch, 17);
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (17 - 2));
     OUT_BCS_BATCH(batch, 
-                  width_in_mbs * height_in_mbs);
+                  (width_in_mbs * height_in_mbs - 1));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
@@ -2826,7 +2826,7 @@ gen75_jpeg_wa_avc_img_state(VADriverContextP ctx,
     BEGIN_BCS_BATCH(batch, 16);
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     OUT_BCS_BATCH(batch, 
-                  width_in_mbs * height_in_mbs);
+                  (width_in_mbs * height_in_mbs - 1));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
index 48f4bf2..394665d 100644 (file)
@@ -214,7 +214,7 @@ gen7_mfc_avc_img_state(VADriverContextP ctx, struct encode_state *encode_state,
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     /*DW1 frame size */
     OUT_BCS_BATCH(batch,
-                  ((width_in_mbs * height_in_mbs) & 0xFFFF));
+                  ((width_in_mbs * height_in_mbs - 1) & 0xFFFF));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
index 51a1850..5091034 100755 (executable)
@@ -353,7 +353,7 @@ gen7_mfd_avc_img_state(VADriverContextP ctx,
     BEGIN_BCS_BATCH(batch, 16);
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     OUT_BCS_BATCH(batch, 
-                  width_in_mbs * height_in_mbs);
+                  (width_in_mbs * height_in_mbs - 1));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
@@ -2320,7 +2320,7 @@ gen7_jpeg_wa_avc_img_state(VADriverContextP ctx,
     BEGIN_BCS_BATCH(batch, 16);
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     OUT_BCS_BATCH(batch, 
-                  width_in_mbs * height_in_mbs);
+                  (width_in_mbs * height_in_mbs - 1));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
index b1e9bd3..90092a1 100644 (file)
@@ -230,7 +230,7 @@ gen8_mfc_avc_img_state(VADriverContextP ctx, struct encode_state *encode_state,
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2));
     /*DW1. MB setting of frame */
     OUT_BCS_BATCH(batch,
-                  ((width_in_mbs * height_in_mbs) & 0xFFFF));
+                  ((width_in_mbs * height_in_mbs - 1) & 0xFFFF));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));
index 3ce8ebe..6a10663 100644 (file)
@@ -433,7 +433,7 @@ gen8_mfd_avc_img_state(VADriverContextP ctx,
     BEGIN_BCS_BATCH(batch, 17);
     OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (17 - 2));
     OUT_BCS_BATCH(batch, 
-                  width_in_mbs * height_in_mbs);
+                  (width_in_mbs * height_in_mbs - 1));
     OUT_BCS_BATCH(batch, 
                   ((height_in_mbs - 1) << 16) | 
                   ((width_in_mbs - 1) << 0));