[FFmpeg-cvslog] cabac: remove put_cabac_u/ueg from cabac-test.
Diego Biurrun
git at videolan.org
Tue Jan 10 03:52:27 CET 2012
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sat Jan 7 20:27:31 2012 +0100| [1ef8ff4534706de0b1da3442f380be58a650acf2] | committer: Diego Biurrun
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ef8ff4534706de0b1da3442f380be58a650acf2
---
libavcodec/cabac.c | 73 ----------------------------------------------------
1 files changed, 0 insertions(+), 73 deletions(-)
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 466d623..54414fa 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);
More information about the ffmpeg-cvslog
mailing list