diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-12-04 11:47:24 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-12-04 11:47:24 +0000 |
commit | ce3bcaeda1dec8bdc25d4daf5a8358feafe5d124 (patch) | |
tree | db00d0a54f159194d5739289396a823f87405551 /libavcodec/h263.c | |
parent | dc172cc13bf9030c98a9b8b4e28c6052c848e469 (diff) | |
download | ffmpeg-ce3bcaeda1dec8bdc25d4daf5a8358feafe5d124.tar.gz |
fixing illegal 3. esc bug (the mpeg4 std only requires encoders to use unescaped symbols but not esc1 or esc2 if they are shorter than esc3, andjust beause its logical to use the shortest possible vlc doesnt mean encoders do that)
Originally committed as revision 1304 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index e6578a0c58..caa1bf4552 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -3624,19 +3624,21 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, #if 1 { const int abs_level= ABS(level); - if(abs_level<=MAX_LEVEL && run<=MAX_RUN && ((s->workaround_bugs&FF_BUG_AC_VLC)==0)){ + if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ const int run1= run - rl->max_run[last][abs_level] - 1; if(abs_level <= rl->max_level[last][run]){ fprintf(stderr, "illegal 3. esc, vlc encoding possible\n"); return -1; } - if(abs_level <= rl->max_level[last][run]*2){ - fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); - return -1; - } - if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ - fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); - return -1; + if(s->error_resilience > FF_ER_COMPLIANT){ + if(abs_level <= rl->max_level[last][run]*2){ + fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); + return -1; + } + if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ + fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); + return -1; + } } } } |