From 11e659c203d534c3f6033003be5c2727e2291796 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 13 Jun 2003 21:31:28 +0000 Subject: golomb rice codes use gradients instead of prediction errors as context model store independant quantization tables for each point merge contexts with opposit sign Originally committed as revision 1957 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/golomb.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'libavcodec/golomb.h') diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index f1e6d6d987..9861b18d1a 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -178,6 +178,37 @@ static inline int svq3_get_se_golomb(GetBitContext *gb){ } } +/** + * read unsigned golomb rice code. + */ +static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len){ + unsigned int buf; + int log; + + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf=GET_CACHE(re, gb); + + log= av_log2(buf); +//printf("buf:%X log:%d\n", buf, log); + if(log > 31-limit){ + buf >>= log - k; + buf += (30-log)<>= log - esc_len; + buf -= 1<=0); + + e= i>>k; + if(e