changeset 3405:58c4fd135462 libavcodec

Correctly choose global transform mode, MV mode and fix bitplane decoding
author kostya
date Tue, 04 Jul 2006 15:39:21 +0000
parents 0f56ae23d338
children 75ab0c53742a
files vc1.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/vc1.c	Tue Jul 04 15:33:28 2006 +0000
+++ b/vc1.c	Tue Jul 04 15:39:21 2006 +0000
@@ -137,11 +137,17 @@
   { TT_8X8, TT_4X8, TT_4X4, TT_8X4_BOTTOM, TT_4X8_RIGHT, TT_4X8_LEFT, TT_8X4, TT_8X4_TOP }
 };
 
+static const int ttfrm_to_tt[4] = { TT_8X8, TT_8X4, TT_4X8, TT_4X4 };
+
 /** MV P mode - the 5th element is only used for mode 1 */
 static const uint8_t mv_pmode_table[2][5] = {
   { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_MIXED_MV },
   { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_INTENSITY_COMP, MV_PMODE_1MV_HPEL_BILIN }
 };
+static const uint8_t mv_pmode_table2[2][4] = {
+  { MV_PMODE_1MV_HPEL_BILIN, MV_PMODE_1MV, MV_PMODE_1MV_HPEL, MV_PMODE_MIXED_MV },
+  { MV_PMODE_1MV, MV_PMODE_MIXED_MV, MV_PMODE_1MV_HPEL, MV_PMODE_1MV_HPEL_BILIN }
+};
 
 /** One more frame type */
 #define BI_TYPE 7
@@ -282,7 +288,6 @@
     //@}
     int ttfrm;            ///< Transform type info present at frame level
     uint8_t ttmbf;        ///< Transform type flag
-    int ttmb;             ///< Transform type
     uint8_t ttblk4x4;     ///< Value of ttblk which indicates a 4x4 transform
     int codingset;        ///< index of current table set from 11.8 to use for luma block decoding
     int codingset2;       ///< index of current table set from 11.8 to use for chroma block decoding
@@ -607,6 +612,7 @@
             }
             if(width & 1) decode_colskip(data, 1, height, stride, &v->s.gb);
         } else { // 3x2
+            planep += (height & 1) * stride;
             for(y = height & 1; y < height; y += 2) {
                 for(x = width % 3; x < width; x += 3) {
                     code = get_vlc2(gb, vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2);
@@ -1366,7 +1372,7 @@
             v->ttmbf = get_bits(gb, 1);
             if (v->ttmbf)
             {
-                v->ttfrm = get_bits(gb, 2);
+                v->ttfrm = ttfrm_to_tt[get_bits(gb, 2)];
             }
         }
         break;
@@ -2318,7 +2324,7 @@
     int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
     int cbp; /* cbp decoding stuff */
     int mqdiff, mquant; /* MB quantization */
-    int ttmb = v->ttmb; /* MB Transform type */
+    int ttmb = v->ttfrm; /* MB Transform type */
     int status;
 
     static const int size_table[6] = { 0, 2, 3, 4, 5, 8 },