Mercurial > libavcodec.hg
changeset 7225:f8b6ec3e5538 libavcodec
fix IPCM_decode_error.h264
author | michael |
---|---|
date | Wed, 09 Jul 2008 06:03:59 +0000 |
parents | d5a52b28c9de |
children | e707d79a5ffd |
files | h264.c |
diffstat | 1 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/h264.c Tue Jul 08 23:50:03 2008 +0000 +++ b/h264.c Wed Jul 09 06:03:59 2008 +0000 @@ -4352,12 +4352,11 @@ level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part else level_code= prefix + get_bits(gb, 4); //part - }else if(prefix==15){ - level_code= (prefix<<suffix_length) + get_bits(gb, 12); //part + }else{ + level_code= (15<<suffix_length) + get_bits(gb, prefix-3); //part if(suffix_length==0) level_code+=15; //FIXME doesn't make (much)sense - }else{ - av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); - return -1; + if(prefix>=16) + level_code += (1<<(prefix-3))-4096; } if(trailing_ones < 3) level_code += 2; @@ -4375,11 +4374,10 @@ prefix = get_level_prefix(gb); if(prefix<15){ level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length); - }else if(prefix==15){ - level_code = (prefix<<suffix_length) + get_bits(gb, 12); }else{ - av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); - return -1; + level_code = (15<<suffix_length) + get_bits(gb, prefix-3); + if(prefix>=16) + level_code += (1<<(prefix-3))-4096; } mask= -(level_code&1); level[i]= (((2+level_code)>>1) ^ mask) - mask;