changeset 5607:5b80d560cdca libavcodec

add get_unary_0_33() to help gcc with inlining
author aurel
date Sun, 26 Aug 2007 22:38:57 +0000
parents 0bc48f6f78a2
children deadd90d994f
files unary.h wavpack.c
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/unary.h	Sun Aug 26 22:34:49 2007 +0000
+++ b/unary.h	Sun Aug 26 22:38:57 2007 +0000
@@ -38,4 +38,14 @@
     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 */
--- a/wavpack.c	Sun Aug 26 22:34:49 2007 +0000
+++ b/wavpack.c	Sun Aug 26 22:38:57 2007 +0000
@@ -161,7 +161,7 @@
             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 @@
         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));
         }