OSDN Git Service

genX_mfd: fix BitplanePresentFlag for skipped pictures
authorcarpalis <jerome.borsboom@carpalis.nl>
Tue, 24 Oct 2017 18:30:16 +0000 (20:30 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 5 Jan 2018 06:57:31 +0000 (14:57 +0800)
Skipped pictures do not pass a bitplane buffer. We do, however,
locally encode a bitplane buffer with only the SKIPMB bit set. The
presence of this buffer must be passed through the BitplanePresentFlag
hardware field.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
src/gen6_mfd.c
src/gen75_mfd.c
src/gen7_mfd.c
src/gen8_mfd.c

index 044dba8..a7bfa48 100644 (file)
@@ -1376,6 +1376,7 @@ gen6_mfd_vc1_pic_state(VADriverContextP ctx,
     int profile;
     int overlap = 0;
     int loopfilter = 0;
+    int bitplane_present;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
@@ -1459,10 +1460,12 @@ gen6_mfd_vc1_pic_state(VADriverContextP ctx,
     if (pic_param->b_picture_fraction < 21)
         scale_factor = b_picture_scale_factor[pic_param->b_picture_fraction];
 
-    if (picture_type == GEN6_VC1_SKIPPED_PICTURE)
+    if (picture_type == GEN6_VC1_SKIPPED_PICTURE) {
         ptype = GEN6_VC1_P_PICTURE;
-    else {
+        bitplane_present = 1;
+    } else {
         ptype = pic_param->picture_fields.bits.picture_type;
+        bitplane_present = !!(pic_param->bitplane_present.value & 0x7f);
         loopfilter = pic_param->entrypoint_fields.bits.loopfilter;
     }
 
@@ -1563,7 +1566,7 @@ gen6_mfd_vc1_pic_state(VADriverContextP ctx,
                   ptype << 2 |
                   fcm << 0);
     OUT_BCS_BATCH(batch,
-                  !!(pic_param->bitplane_present.value & 0x7f) << 23 |
+                  bitplane_present << 23 |
                   pic_param->raw_coding.flags.forward_mb << 22 |
                   pic_param->raw_coding.flags.mv_type_mb << 21 |
                   pic_param->raw_coding.flags.skip_mb << 20 |
index fde0953..2089566 100644 (file)
@@ -1701,6 +1701,7 @@ gen75_mfd_vc1_pic_state(VADriverContextP ctx,
     int overlap = 0;
     int interpolation_mode = 0;
     int loopfilter = 0;
+    int bitplane_present;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
@@ -1784,10 +1785,12 @@ gen75_mfd_vc1_pic_state(VADriverContextP ctx,
     if (pic_param->b_picture_fraction < 21)
         scale_factor = b_picture_scale_factor[pic_param->b_picture_fraction];
 
-    if (picture_type == GEN7_VC1_SKIPPED_PICTURE)
+    if (picture_type == GEN7_VC1_SKIPPED_PICTURE) {
         ptype = GEN7_VC1_P_PICTURE;
-    else {
+        bitplane_present = 1;
+    } else {
         ptype = pic_param->picture_fields.bits.picture_type;
+        bitplane_present = !!(pic_param->bitplane_present.value & 0x7f);
         loopfilter = pic_param->entrypoint_fields.bits.loopfilter;
     }
 
@@ -1918,7 +1921,7 @@ gen75_mfd_vc1_pic_state(VADriverContextP ctx,
                   pic_param->pic_quantizer_fields.bits.half_qp << 1 |
                   pic_param->pic_quantizer_fields.bits.pic_quantizer_type << 0);
     OUT_BCS_BATCH(batch,
-                  !!(pic_param->bitplane_present.value & 0x7f) << 31 |
+                  bitplane_present << 31 |
                   pic_param->raw_coding.flags.forward_mb << 30 |
                   pic_param->raw_coding.flags.mv_type_mb << 29 |
                   pic_param->raw_coding.flags.skip_mb << 28 |
index 6d10846..b8d7a55 100644 (file)
@@ -1436,6 +1436,7 @@ gen7_mfd_vc1_pic_state(VADriverContextP ctx,
     int overlap = 0;
     int interpolation_mode = 0;
     int loopfilter = 0;
+    int bitplane_present;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
@@ -1519,10 +1520,12 @@ gen7_mfd_vc1_pic_state(VADriverContextP ctx,
     if (pic_param->b_picture_fraction < 21)
         scale_factor = b_picture_scale_factor[pic_param->b_picture_fraction];
 
-    if (picture_type == GEN7_VC1_SKIPPED_PICTURE)
+    if (picture_type == GEN7_VC1_SKIPPED_PICTURE) {
         ptype = GEN7_VC1_P_PICTURE;
-    else {
+        bitplane_present = 1;
+    } else {
         ptype = pic_param->picture_fields.bits.picture_type;
+        bitplane_present = !!(pic_param->bitplane_present.value & 0x7f);
         loopfilter = pic_param->entrypoint_fields.bits.loopfilter;
     }
 
@@ -1652,7 +1655,7 @@ gen7_mfd_vc1_pic_state(VADriverContextP ctx,
                   pic_param->pic_quantizer_fields.bits.half_qp << 1 |
                   pic_param->pic_quantizer_fields.bits.pic_quantizer_type << 0);
     OUT_BCS_BATCH(batch,
-                  !!(pic_param->bitplane_present.value & 0x7f) << 31 |
+                  bitplane_present << 31 |
                   pic_param->raw_coding.flags.forward_mb << 30 |
                   pic_param->raw_coding.flags.mv_type_mb << 29 |
                   pic_param->raw_coding.flags.skip_mb << 28 |
index 51f3bcf..de2975e 100644 (file)
@@ -1480,6 +1480,7 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx,
     int overlap = 0;
     int interpolation_mode = 0;
     int loopfilter = 0;
+    int bitplane_present;
 
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
@@ -1563,10 +1564,12 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx,
     if (pic_param->b_picture_fraction < 21)
         scale_factor = b_picture_scale_factor[pic_param->b_picture_fraction];
 
-    if (picture_type == GEN7_VC1_SKIPPED_PICTURE)
+    if (picture_type == GEN7_VC1_SKIPPED_PICTURE) {
         ptype = GEN7_VC1_P_PICTURE;
-    else {
+        bitplane_present = 1;
+    } else {
         ptype = pic_param->picture_fields.bits.picture_type;
+        bitplane_present = !!(pic_param->bitplane_present.value & 0x7f);
         loopfilter = pic_param->entrypoint_fields.bits.loopfilter;
     }
 
@@ -1697,7 +1700,7 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx,
                   pic_param->pic_quantizer_fields.bits.half_qp << 1 |
                   pic_param->pic_quantizer_fields.bits.pic_quantizer_type << 0);
     OUT_BCS_BATCH(batch,
-                  !!(pic_param->bitplane_present.value & 0x7f) << 31 |
+                  bitplane_present << 31 |
                   pic_param->raw_coding.flags.forward_mb << 30 |
                   pic_param->raw_coding.flags.mv_type_mb << 29 |
                   pic_param->raw_coding.flags.skip_mb << 28 |