[Libva] [PATCH] vc1: fix TTFRM (picture-level transform type) packing.

Gwenole Beauchesne gwenole.beauchesne at intel.com
Mon Oct 10 01:29:58 PDT 2011


Hi,

I will push this change to master so that to fix VC-1 decoding. FFmpeg 
was wrong and was fixed last week. We definitely could not fit 3 bits
into 2. :) For libAV, my patch still hasn't reached the list after 3 days.

Regards,
Gwenole.
---
 src/gen6_mfd.c |   13 +------------
 src/gen7_mfd.c |   13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index c4c93f7..92cbce9 100644
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -1435,17 +1435,6 @@ static const int va_to_gen6_vc1_profile[4] = {
     GEN6_VC1_ADVANCED_PROFILE
 };
 
-static const int va_to_gen6_vc1_ttfrm[8] = {
-    0,  /* 8x8 */
-    1,  /* 8x4 bottom */
-    1,  /* 8x4 top */
-    1,  /* 8x4 */
-    2,  /* 4x8 bottom */
-    2,  /* 4x8 top */
-    2,  /* 4x8 */
-    3,  /* 4x4 */
-};
-
 static void 
 gen6_mfd_free_vc1_surface(void **data)
 {
@@ -1811,7 +1800,7 @@ gen6_mfd_vc1_pic_state(VADriverContextP ctx,
                   pic_param->mv_fields.bits.mv_table << 20 |
                   pic_param->mv_fields.bits.four_mv_block_pattern_table << 18 |
                   pic_param->mv_fields.bits.two_mv_block_pattern_table << 16 |
-                  va_to_gen6_vc1_ttfrm[pic_param->transform_fields.bits.frame_level_transform_type] << 12 |
+                  pic_param->transform_fields.bits.frame_level_transform_type << 12 |
                   pic_param->transform_fields.bits.mb_level_transform_type_flag << 11 |
                   pic_param->mb_mode_table << 8 |
                   trans_ac_y << 6 |
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index 6c133e1..9308999 100644
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -1390,17 +1390,6 @@ static const int va_to_gen7_vc1_profile[4] = {
     GEN7_VC1_ADVANCED_PROFILE
 };
 
-static const int va_to_gen7_vc1_ttfrm[8] = {
-    0,  /* 8x8 */
-    1,  /* 8x4 bottom */
-    1,  /* 8x4 top */
-    1,  /* 8x4 */
-    2,  /* 4x8 bottom */
-    2,  /* 4x8 top */
-    2,  /* 4x8 */
-    3,  /* 4x4 */
-};
-
 static void 
 gen7_mfd_free_vc1_surface(void **data)
 {
@@ -1786,7 +1775,7 @@ gen7_mfd_vc1_pic_state(VADriverContextP ctx,
                   pic_param->mv_fields.bits.mv_table << 20 |
                   pic_param->mv_fields.bits.four_mv_block_pattern_table << 18 |
                   pic_param->mv_fields.bits.two_mv_block_pattern_table << 16 |
-                  va_to_gen7_vc1_ttfrm[pic_param->transform_fields.bits.frame_level_transform_type] << 12 |                  
+                  pic_param->transform_fields.bits.frame_level_transform_type << 12 |                  
                   pic_param->transform_fields.bits.mb_level_transform_type_flag << 11 |
                   pic_param->mb_mode_table << 8 |
                   trans_ac_y << 6 |
-- 
1.7.4.1



More information about the Libva mailing list