Merge commit 'cd62c04d009b3baf7582556866a7029291b54573'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Jun 2014 20:38:24 +0000 (22:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Jun 2014 20:53:28 +0000 (22:53 +0200)
* commit 'cd62c04d009b3baf7582556866a7029291b54573':
  h263enc: keep block_last_index always valid during advanced intra coding

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ituh263enc.c

index 5db3a75..8b34fe4 100644 (file)
@@ -566,10 +566,6 @@ void ff_h263_encode_mb(MpegEncContext * s,
                 else
                     level = (level - (scale>>1))/scale;
 
-                /* AIC can change CBP */
-                if (level == 0 && s->block_last_index[i] == 0)
-                    s->block_last_index[i] = -1;
-
                 if(!s->modified_quant){
                     if (level < -127)
                         level = -127;
@@ -592,7 +588,9 @@ void ff_h263_encode_mb(MpegEncContext * s,
 
                 /* Update AC/DC tables */
                 *dc_ptr[i] = rec_intradc[i];
-                if (s->block_last_index[i] >= 0)
+                /* AIC can change CBP */
+                if (s->block_last_index[i] > 0 ||
+                    (s->block_last_index[i] == 0 && level !=0))
                     cbp |= 1 << (5 - i);
             }
         }else{