Commit ce9568ca authored by michael's avatar michael

Optimize ctx calculation in decode_cabac_mb_mvd(), code by dark shikari.

The case for 16x16 blocks becomes 10 cpu cycles faster on pentium dual,
i could not find a speed difference in the case of subblocks though.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16226 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d3bdb970
......@@ -5039,14 +5039,8 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
int amvd = abs( h->mvd_cache[list][scan8[n] - 1][l] ) +
abs( h->mvd_cache[list][scan8[n] - 8][l] );
int ctxbase = (l == 0) ? 40 : 47;
int ctx, mvd;
if( amvd < 3 )
ctx = 0;
else if( amvd > 32 )
ctx = 2;
else
ctx = 1;
int mvd;
int ctx = (amvd>2) + (amvd>32);
if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+ctx]))
return 0;
......
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