fix ttmbf/ttfrm when vstransform is 0
authorZhao Halley <halley.zhao@intel.com>
Fri, 21 Sep 2012 02:30:55 +0000 (10:30 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 27 Sep 2012 07:08:25 +0000 (03:08 -0400)
(cherry picked from commit c7d23b1e9376808dfa88192ee66a1af5acdf3b16)

src/gen6_mfd.c [changed mode: 0644->0755]
src/gen7_mfd.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 7f8b2f3..7329d8f
@@ -1656,9 +1656,19 @@ gen6_mfd_vc1_pic_state(VADriverContextP ctx,
 
     if (picture_type == GEN6_VC1_I_PICTURE || picture_type == GEN6_VC1_BI_PICTURE) /* I picture */
         trans_ac_y = pic_param->transform_fields.bits.transform_ac_codingset_idx2;
-    else
+    else {
         trans_ac_y = pic_param->transform_fields.bits.transform_ac_codingset_idx1;
-
+        /*
+         * 8.3.6.2.1 Transform Type Selection
+         * If variable-sized transform coding is not enabled,
+         * then the 8x8 transform shall be used for all blocks.
+         * it is also MFX_VC1_PIC_STATE requirement.
+         */
+        if (pic_param->transform_fields.bits.variable_sized_transform_flag == 0) {
+            pic_param->transform_fields.bits.mb_level_transform_type_flag   = 1;
+            pic_param->transform_fields.bits.frame_level_transform_type     = 0;
+        }
+    }
 
     if (picture_type == GEN6_VC1_B_PICTURE) {
         struct gen6_vc1_surface *gen6_vc1_surface = NULL;
old mode 100644 (file)
new mode 100755 (executable)
index d8581ed..2d75baf
@@ -1633,8 +1633,19 @@ gen7_mfd_vc1_pic_state(VADriverContextP ctx,
 
     if (picture_type == GEN7_VC1_I_PICTURE || picture_type == GEN7_VC1_BI_PICTURE) /* I picture */
         trans_ac_y = pic_param->transform_fields.bits.transform_ac_codingset_idx2;
-    else
+    else {
         trans_ac_y = pic_param->transform_fields.bits.transform_ac_codingset_idx1;
+        /*
+         * 8.3.6.2.1 Transform Type Selection
+         * If variable-sized transform coding is not enabled,
+         * then the 8x8 transform shall be used for all blocks.
+         * it is also MFX_VC1_PIC_STATE requirement.
+         */
+        if (pic_param->transform_fields.bits.variable_sized_transform_flag == 0) {
+            pic_param->transform_fields.bits.mb_level_transform_type_flag   = 1;
+            pic_param->transform_fields.bits.frame_level_transform_type     = 0;
+        }
+    }
 
 
     if (picture_type == GEN7_VC1_B_PICTURE) {