diff options
author | Michael Niedermayer | 2006-10-13 14:21:25 +0000 |
---|---|---|
committer | Michael Niedermayer | 2006-10-13 14:21:25 +0000 |
commit | 68a205edef062ab8f583a40ab8607a28faedb3b2 (patch) | |
tree | 600fbde1c81f9d2d61a7401ae282741a9f8dce74 /libavcodec/cabac.c | |
parent | a991b1fecbd8c9e6f4fc31c191bd12e4be27dbf7 (diff) |
dehack *ps_state indexing in the branchless decoder
Originally committed as revision 6683 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cabac.c')
-rw-r--r-- | libavcodec/cabac.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index 94829e9065..0cd5144801 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -50,6 +50,7 @@ static const uint8_t lps_range[64][4]= { { 6, 8, 9, 11}, { 6, 7, 9, 10}, { 6, 7, 8, 9}, { 2, 2, 2, 2}, }; +uint8_t ff_h264_mlps_state[4*64]; uint8_t ff_h264_lps_range[2*65][4]; uint8_t ff_h264_lps_state[2*64]; uint8_t ff_h264_mps_state[2*64]; @@ -132,16 +133,18 @@ void ff_init_cabac_states(CABACContext *c){ ff_h264_lps_range[2*i+1][j+4]= lps_range[i][j]; } + ff_h264_mlps_state[128+2*i+0]= ff_h264_mps_state[2*i+0]= 2*mps_state[i]+0; + ff_h264_mlps_state[128+2*i+1]= ff_h264_mps_state[2*i+1]= 2*mps_state[i]+1; if( i ){ #ifdef BRANCHLESS_CABAC_DECODER - ff_h264_mps_state[-2*i-1]= 2*lps_state[i]+0; //FIXME yes this is not valid C but iam lazy, cleanup welcome - ff_h264_mps_state[-2*i-2]= 2*lps_state[i]+1; + ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0; + ff_h264_mlps_state[128-2*i-2]= 2*lps_state[i]+1; }else{ - ff_h264_mps_state[-2*i-1]= 1; - ff_h264_mps_state[-2*i-2]= 0; + ff_h264_mlps_state[128-2*i-1]= 1; + ff_h264_mlps_state[128-2*i-2]= 0; #else ff_h264_lps_state[2*i+0]= 2*lps_state[i]+0; ff_h264_lps_state[2*i+1]= 2*lps_state[i]+1; |