From 0fa352c7e6f208605b54f21b6d5859054b0c95ea Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 11 Oct 2006 13:21:42 +0000 Subject: make lps_range a global table its constant anyway (saves 1 addition for accessing it) Originally committed as revision 6653 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/cabac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libavcodec/cabac.c') diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index f2744a39bb..89e7e99c7d 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -31,7 +31,7 @@ #include "bitstream.h" #include "cabac.h" -const uint8_t ff_h264_lps_range[64][4]= { +static const uint8_t lps_range[64][4]= { {128,176,208,240}, {128,167,197,227}, {128,158,187,216}, {123,150,178,205}, {116,142,169,195}, {111,135,160,185}, {105,128,152,175}, {100,122,144,166}, { 95,116,137,158}, { 90,110,130,150}, { 85,104,123,142}, { 81, 99,117,135}, @@ -50,6 +50,8 @@ const uint8_t ff_h264_lps_range[64][4]= { { 6, 8, 9, 11}, { 6, 7, 9, 10}, { 6, 7, 8, 9}, { 2, 2, 2, 2}, }; +uint8_t ff_h264_lps_range[2*65][4]; + const uint8_t ff_h264_mps_state[64]= { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16, @@ -119,14 +121,14 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){ c->range= 0x1FE<<(CABAC_BITS + 1); } -void ff_init_cabac_states(CABACContext *c, uint8_t const (*lps_range)[4], +void ff_init_cabac_states(CABACContext *c, uint8_t const *mps_state, uint8_t const *lps_state, int state_count){ int i, j; for(i=0; ilps_range[2*i+0][j+4]= - c->lps_range[2*i+1][j+4]= lps_range[i][j]; + ff_h264_lps_range[2*i+0][j+4]= + ff_h264_lps_range[2*i+1][j+4]= lps_range[i][j]; } c->mps_state[2*i+0]= 2*mps_state[i]+0; -- cgit v1.2.3