Browse code

* Fix dct_unquantize_h263_axp for changed block_last_index indexing. * Set qadd to 0 for intra with h263_aic (whatever that may be).

Originally committed as revision 1009 to svn://svn.ffmpeg.org/ffmpeg/trunk

Falk Hüffner authored on 2002/10/07 11:03:21
Showing 1 changed files
... ...
@@ -30,24 +30,26 @@ static void dct_unquantize_h263_axp(MpegEncContext *s, DCTELEM *block,
30 30
     DCTELEM *orig_block = block;
31 31
     DCTELEM block0;
32 32
 
33
+    qadd = WORD_VEC((qscale - 1) | 1);
34
+    qmul = qscale << 1;
35
+    /* This mask kills spill from negative subwords to the next subword.  */ 
36
+    correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
37
+
33 38
     if (s->mb_intra) {
34 39
         if (!s->h263_aic) {
35 40
             if (n < 4) 
36 41
                 block0 = block[0] * s->y_dc_scale;
37 42
             else
38 43
                 block0 = block[0] * s->c_dc_scale;
39
-        }
40
-        n_coeffs = 64; // does not always use zigzag table 
44
+        } else {
45
+	    qadd = 0;
46
+	}
47
+        n_coeffs = 63; // does not always use zigzag table 
41 48
     } else {
42 49
         n_coeffs = s->intra_scantable.raster_end[s->block_last_index[n]];
43 50
     }
44 51
 
45
-    qmul = qscale << 1;
46
-    qadd = WORD_VEC((qscale - 1) | 1);
47
-    /* This mask kills spill from negative subwords to the next subword.  */ 
48
-    correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
49
-
50
-    for(i = 0; i < n_coeffs; block += 4, i += 4) {
52
+    for(i = 0; i <= n_coeffs; block += 4, i += 4) {
51 53
         uint64_t levels, negmask, zeros, add;
52 54
 
53 55
         levels = ldq(block);
... ...
@@ -91,6 +93,5 @@ static void dct_unquantize_h263_axp(MpegEncContext *s, DCTELEM *block,
91 91
 
92 92
 void MPV_common_init_axp(MpegEncContext *s)
93 93
 {
94
-    /* disabled for now, buggy */
95
-    //s->dct_unquantize_h263 = dct_unquantize_h263_axp;
94
+    s->dct_unquantize_h263 = dct_unquantize_h263_axp;
96 95
 }