aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2004-09-08 17:59:22 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2004-09-08 17:59:22 +0000
commit4579adb00ced9233dea8848274e8355abbacf19b (patch)
tree1162e22dfbaf307241be5fd24396e2d601b3986f /libavcodec/ffv1.c
parentb2a1c77162849e43a75910a535a2d2644de73057 (diff)
downloadffmpeg-4579adb00ced9233dea8848274e8355abbacf19b.tar.gz
new signed golomb routines
Originally committed as revision 3444 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c10
1 files changed, 2 insertions, 8 deletions
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