--- libavcodec/cabac.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libavcodec/cabac.h | 58 ---------------------------------------------------- 2 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index 57ab395..77a5e7f 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -300,6 +300,64 @@ static void put_cabac_ueg(CABACContext *c, uint8_t * state, int v, int max, int } } +#if 0 +/** + * Get (truncated) unary binarization. + */ +static int get_cabac_u(CABACContext *c, uint8_t * state, int max, int max_index, int truncated){ + int i; + + for(i=0; i<max; i++){ + if(get_cabac(c, state)==0) + return i; + + if(i< max_index) state++; + } + + return truncated ? max : -1; +} + +/** + * get unary exp golomb k-th order binarization. + */ +static int get_cabac_ueg(CABACContext *c, uint8_t * state, int max, int is_signed, int k, int max_index){ + int i, v; + int m= 1<<k; + + if(get_cabac(c, state)==0) + return 0; + + if(0 < max_index) state++; + + for(i=1; i<max; i++){ + if(get_cabac(c, state)==0){ + if(is_signed && get_cabac_bypass(c)){ + return -i; + }else + return i; + } + + if(i < max_index) state++; + } + + while(get_cabac_bypass(c)){ + i+= m; + m+= m; + } + + v=0; + while(m>>=1){ + v+= v + get_cabac_bypass(c); + } + i += v; + + if(is_signed && get_cabac_bypass(c)){ + return -i; + }else + return i; +} +#endif /* 0 */ + int main(void){ CABACContext c; uint8_t b[9*SIZE]; diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 9d9ffd9..9775ec2 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -207,62 +207,4 @@ static int av_unused get_cabac_terminate(CABACContext *c){ } } -#if 0 -/** - * Get (truncated) unary binarization. - */ -static int get_cabac_u(CABACContext *c, uint8_t * state, int max, int max_index, int truncated){ - int i; - - for(i=0; i<max; i++){ - if(get_cabac(c, state)==0) - return i; - - if(i< max_index) state++; - } - - return truncated ? max : -1; -} - -/** - * get unary exp golomb k-th order binarization. - */ -static int get_cabac_ueg(CABACContext *c, uint8_t * state, int max, int is_signed, int k, int max_index){ - int i, v; - int m= 1<<k; - - if(get_cabac(c, state)==0) - return 0; - - if(0 < max_index) state++; - - for(i=1; i<max; i++){ - if(get_cabac(c, state)==0){ - if(is_signed && get_cabac_bypass(c)){ - return -i; - }else - return i; - } - - if(i < max_index) state++; - } - - while(get_cabac_bypass(c)){ - i+= m; - m+= m; - } - - v=0; - while(m>>=1){ - v+= v + get_cabac_bypass(c); - } - i += v; - - if(is_signed && get_cabac_bypass(c)){ - return -i; - }else - return i; -} -#endif /* 0 */ - #endif /* AVCODEC_CABAC_H */ -- 1.7.1 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel