From 4579adb00ced9233dea8848274e8355abbacf19b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 8 Sep 2004 17:59:22 +0000 Subject: new signed golomb routines Originally committed as revision 3444 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ffv1.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'libavcodec/ffv1.c') diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index abd76ba6a6..ac8069f577 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -324,10 +324,8 @@ static inline void put_vlc_symbol(PutBitContext *pb, VlcState * const state, int code= v ^ ((2*state->drift + state->count)>>31); #endif - code = -2*code-1; - code^= (code>>31); //printf("v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code, state->bias, state->error_sum, state->drift, state->count, k); - set_ur_golomb(pb, code, k, 12, bits); + set_sr_golomb_ffv1(pb, code, k, 12, bits); update_vlc_state(state, v); } @@ -344,13 +342,9 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int assert(k<=8); - v= get_ur_golomb(gb, k, 12, bits); + v= get_sr_golomb_ffv1(gb, k, 12, bits); //printf("v:%d bias:%d error:%d drift:%d count:%d k:%d", v, state->bias, state->error_sum, state->drift, state->count, k); - v++; - if(v&1) v= (v>>1); - else v= -(v>>1); - #if 0 // JPEG LS if(k==0 && 2*state->drift <= - state->count) v ^= (-1); #else -- cgit v1.2.3