diff ffv1.c @ 2215:2a767157935e libavcodec

new signed golomb routines
author alex
date Wed, 08 Sep 2004 17:59:22 +0000
parents 6173c83664a5
children cff6c9b8ae57
line wrap: on
line diff
--- a/ffv1.c	Wed Sep 08 17:57:25 2004 +0000
+++ b/ffv1.c	Wed Sep 08 17:59:22 2004 +0000
@@ -324,10 +324,8 @@
      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 @@
 
     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