Commit 5570afd5 authored by michael's avatar michael

Faster CAVLC decoding of trailing_ones. Based on a patch by dark shikari.

decode_residual is about 3.3% faster.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16219 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f830e419
...@@ -4087,9 +4087,11 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in ...@@ -4087,9 +4087,11 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff); tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff);
assert(total_coeff<=16); assert(total_coeff<=16);
for(i=0; i<trailing_ones; i++){ i = show_bits(gb, 3);
level[i]= 1 - 2*get_bits1(gb); skip_bits(gb, trailing_ones);
} level[0] = 1-((i&4)>>1);
level[1] = 1-((i&2) );
level[2] = 1-((i&1)<<1);
if(trailing_ones<total_coeff) { if(trailing_ones<total_coeff) {
int level_code, mask; int level_code, mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment