diff options
author | Diego Biurrun <diego@biurrun.de> | 2012-01-07 20:27:31 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-01-09 14:10:41 +0100 |
commit | 1ef8ff4534706de0b1da3442f380be58a650acf2 (patch) | |
tree | e23de3869f12a856d691f9c973c6e810a028a92a /libavcodec | |
parent | 5cad97097112016ea3c414546984ec614d38d031 (diff) | |
download | ffmpeg-1ef8ff4534706de0b1da3442f380be58a650acf2.tar.gz |
cabac: remove put_cabac_u/ueg from cabac-test.
The functions are not used in any part of Libav, therefore testing them in the
cabac-test is unnecessary. Since this makes them unused, remove the functions.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cabac.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index 466d6239dc..54414fa1e5 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -248,67 +248,6 @@ static int put_cabac_terminate(CABACContext *c, int bit){ return (put_bits_count(&c->pb)+7)>>3; } -/** - * put (truncated) unary binarization. - */ -static void put_cabac_u(CABACContext *c, uint8_t * state, int v, int max, int max_index, int truncated){ - int i; - - assert(v <= max); - - for(i=0; i<v; i++){ - put_cabac(c, state, 1); - if(i < max_index) state++; - } - if(truncated==0 || v<max) - put_cabac(c, state, 0); -} - -/** - * put unary exp golomb k-th order binarization. - */ -static void put_cabac_ueg(CABACContext *c, uint8_t * state, int v, int max, int is_signed, int k, int max_index){ - int i; - - if(v==0) - put_cabac(c, state, 0); - else{ - const int sign= v < 0; - - if(is_signed) v= FFABS(v); - - if(v<max){ - for(i=0; i<v; i++){ - put_cabac(c, state, 1); - if(i < max_index) state++; - } - - put_cabac(c, state, 0); - }else{ - int m= 1<<k; - - for(i=0; i<max; i++){ - put_cabac(c, state, 1); - if(i < max_index) state++; - } - - v -= max; - while(v >= m){ //FIXME optimize - put_cabac_bypass(c, 1); - v-= m; - m+= m; - } - put_cabac_bypass(c, 0); - while(m>>=1){ - put_cabac_bypass(c, v&m); - } - } - - if(is_signed) - put_cabac_bypass(c, sign); - } -} - int main(void){ CABACContext c; uint8_t b[9*SIZE]; @@ -337,18 +276,6 @@ START_TIMER STOP_TIMER("put_cabac") } - for(i=0; i<SIZE; i++){ -START_TIMER - put_cabac_u(&c, state, r[i], 6, 3, i&1); -STOP_TIMER("put_cabac_u") - } - - for(i=0; i<SIZE; i++){ -START_TIMER - put_cabac_ueg(&c, state, r[i], 3, 0, 1, 2); -STOP_TIMER("put_cabac_ueg") - } - put_cabac_terminate(&c, 1); ff_init_cabac_decoder(&c, b, SIZE); |