[FFmpeg-cvslog] r10242 - in trunk/libavcodec: unary.h wavpack.c
aurel
subversion
Mon Aug 27 00:38:57 CEST 2007
Author: aurel
Date: Mon Aug 27 00:38:57 2007
New Revision: 10242
Log:
add get_unary_0_33() to help gcc with inlining
Modified:
trunk/libavcodec/unary.h
trunk/libavcodec/wavpack.c
Modified: trunk/libavcodec/unary.h
==============================================================================
--- trunk/libavcodec/unary.h (original)
+++ trunk/libavcodec/unary.h Mon Aug 27 00:38:57 2007
@@ -38,4 +38,14 @@ static inline int get_unary(GetBitContex
return i;
}
+/**
+ * Get unary code terminated by a 0 with a maximum length of 33
+ * @param gb GetBitContext
+ * @return Unary length/index
+ */
+static inline int get_unary_0_33(GetBitContext *gb)
+{
+ return get_unary(gb, 0, 33);
+}
+
#endif /* AVCODEC_UNARY_H */
Modified: trunk/libavcodec/wavpack.c
==============================================================================
--- trunk/libavcodec/wavpack.c (original)
+++ trunk/libavcodec/wavpack.c Mon Aug 27 00:38:57 2007
@@ -161,7 +161,7 @@ static int wv_get_value(WavpackContext *
if(ctx->zeroes)
return 0;
}else{
- t = get_unary(gb, 0, 33);
+ t = get_unary_0_33(gb);
if(t >= 2) t = get_bits(gb, t - 1) | (1 << (t-1));
ctx->zeroes = t;
if(ctx->zeroes){
@@ -180,13 +180,13 @@ static int wv_get_value(WavpackContext *
t = 0;
ctx->zero = 0;
}else{
- t = get_unary(gb, 0, 33);
+ t = get_unary_0_33(gb);
if(get_bits_count(gb) >= ctx->data_size){
*last = 1;
return 0;
}
if(t == 16) {
- t2 = get_unary(gb, 0, 33);
+ t2 = get_unary_0_33(gb);
if(t2 < 2) t += t2;
else t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
}
More information about the ffmpeg-cvslog
mailing list