diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-08 11:24:37 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-08 11:24:37 +0000 |
commit | 99ce10873df41ba650e51c8069280a32a1f57961 (patch) | |
tree | 9aa4be055ebd404e039e0a1fc61b1758f52143b4 /libavcodec/cabac.h | |
parent | e16c407a817faaa6e5bed445d602f9240f5319fb (diff) | |
download | ffmpeg-99ce10873df41ba650e51c8069280a32a1f57961.tar.gz |
5% faster get_cabac()
Originally committed as revision 6586 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.h')
-rw-r--r-- | libavcodec/cabac.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 18fd51d56a..a71b75a0f4 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -39,9 +39,9 @@ typedef struct CABACContext{ #ifdef STRICT_LIMITS int symCount; #endif - uint8_t lps_range[2*65][4]; ///< rangeTabLPS - uint8_t lps_state[2*64]; ///< transIdxLPS - uint8_t mps_state[2*64]; ///< transIdxMPS + uint8_t lps_range[2*66][4]; ///< rangeTabLPS + uint8_t lps_state[2*65]; ///< transIdxLPS + uint8_t mps_state[2*65]; ///< transIdxMPS const uint8_t *bytestream_start; const uint8_t *bytestream; const uint8_t *bytestream_end; @@ -376,7 +376,23 @@ static int get_cabac(CABACContext *c, uint8_t * const state){ #if 1 if(c->low < c->range){ bit= s&1; - *state= c->mps_state[s]; +#ifdef ARCH_X86 + //P3:627 +asm( + "addb $2, %b0 \n\t" + " js 1f \n\t" + "movb %b0, %1 \n\t" + "1: \n\t" + : "+q"(s), "=m"(*state) +); +#else + *state= c->mps_state[s]; //P3:655 +/* if(s<126) //P3:657 + *state= s+2;*/ + s+=2; //P3:631 + if(s<128) + *state= s; +#endif renorm_cabac_decoder_once(c); }else{ // int shift= ff_h264_norm_shift[RangeLPS>>17]; |