diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2008-12-18 15:51:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-12-18 15:51:32 +0000 |
commit | 93445d16171a1bb9ddfdd207ae251a90b5b623c1 (patch) | |
tree | 52dc607e66ae3024d2fe850484b9ca43d8db891f /libavcodec/h264.c | |
parent | c375d87f6f22e3b5300c4c0798cc918ebda11356 (diff) | |
download | ffmpeg-93445d16171a1bb9ddfdd207ae251a90b5b623c1.tar.gz |
Replace i by trailing_ones, part of a patch by dark shikari.
No speed change meassureable with START/STOP_TIMER, but this is needed
for future optimizations.
Originally committed as revision 16218 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index aa7473aeac..d3a8e56bbc 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4091,7 +4091,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in level[i]= 1 - 2*get_bits1(gb); } - if(i<total_coeff) { + if(trailing_ones<total_coeff) { int level_code, mask; int suffix_length = total_coeff > 10 && trailing_ones < 3; int prefix= get_level_prefix(gb); @@ -4120,11 +4120,10 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in if(level_code > 5) suffix_length++; mask= -(level_code&1); - level[i]= (((2+level_code)>>1) ^ mask) - mask; - i++; + level[trailing_ones]= (((2+level_code)>>1) ^ mask) - mask; //remaining coefficients have suffix_length > 0 - for(;i<total_coeff;i++) { + for(i=trailing_ones+1;i<total_coeff;i++) { static const int suffix_limit[7] = {0,5,11,23,47,95,INT_MAX }; prefix = get_level_prefix(gb); if(prefix<15){ |