aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ituh263enc.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2014-06-10 20:50:13 +0200
committerJanne Grunau <janne-libav@jannau.net>2014-06-11 21:28:39 +0200
commitcd62c04d009b3baf7582556866a7029291b54573 (patch)
treeea650daa22c6213a46dc88468dfe6b18750cdc40 /libavcodec/ituh263enc.c
parent0ddc53dabbc6f636d062b187ea27934610aaad30 (diff)
downloadffmpeg-cd62c04d009b3baf7582556866a7029291b54573.tar.gz
h263enc: keep block_last_index always valid during advanced intra coding
Prevents a triggered assert during fate-vsynth{1,2}-rv20 in dct_unquantize_h263_intra_c().
Diffstat (limited to 'libavcodec/ituh263enc.c')
-rw-r--r--libavcodec/ituh263enc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index cd4ed84ffe..5f15b2f77e 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -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{