diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-09 20:44:11 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-09 20:44:11 +0000 |
commit | 2e1aee80f4e7bd17bfcc5a386f5b879f9e2437bc (patch) | |
tree | 882628e12ecee641c065bfb0e76806c36d0d0e20 /libavcodec/cabac.c | |
parent | b420448e38ae27110953e857f5d65b58ccc8e688 (diff) | |
download | ffmpeg-2e1aee80f4e7bd17bfcc5a386f5b879f9e2437bc.tar.gz |
optimize branchless C CABAC decoder
Originally committed as revision 6607 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.c')
-rw-r--r-- | libavcodec/cabac.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index 52e6c50e47..f69b100d60 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -133,11 +133,19 @@ void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4], c->mps_state[2*i+3]= 2*mps_state[i]+3; if( i ){ +#ifdef BRANCHLESS_CABAD + c->mps_state[-2*i-3]= 2*lps_state[i]+2; //FIXME yes this is not valid C but iam lazy, cleanup welcome + c->mps_state[-2*i-4]= 2*lps_state[i]+3; + }else{ + c->mps_state[-2*i-3]= 3; + c->mps_state[-2*i-4]= 2; +#else c->lps_state[2*i+2]= 2*lps_state[i]+2; c->lps_state[2*i+3]= 2*lps_state[i]+3; }else{ c->lps_state[2*i+2]= 3; c->lps_state[2*i+3]= 2; +#endif } } } |