diff options
author | Alex Converse <alex.converse@gmail.com> | 2009-03-03 05:26:39 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2009-03-03 05:26:39 +0000 |
commit | 09a64ee6140c2f30184613b1b2b9a01e083c4a84 (patch) | |
tree | aa9f7131a0d17b7a8ac5e89fcb05f4395c35b0a2 /libavcodec/h264.c | |
parent | 0c89ca72a50c0d66a1e76d77e174224602cfe11b (diff) | |
download | ffmpeg-09a64ee6140c2f30184613b1b2b9a01e083c4a84.tar.gz |
H.264: Simplify decode_residual()
Originally committed as revision 17750 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 91f20c9867..add7f1e467 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4187,17 +4187,16 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in //first coefficient has suffix_length equal to 0 or 1 if(prefix<14){ //FIXME try to build a large unified VLC table for all this if(suffix_length) - level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part + level_code= (prefix<<1) + get_bits1(gb); //part else - level_code= (prefix<<suffix_length); //part + level_code= prefix; //part }else if(prefix==14){ if(suffix_length) - level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); //part + level_code= (prefix<<1) + get_bits1(gb); //part else level_code= prefix + get_bits(gb, 4); //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 + level_code= 30 + get_bits(gb, prefix-3); //part if(prefix>=16) level_code += (1<<(prefix-3))-4096; } |