# HG changeset patch # User aurel # Date 1188167937 0 # Node ID 5b80d560cdca329636e854e97101ed0ff3fde488 # Parent 0bc48f6f78a26c5afe318d147fb61db628b4e97a add get_unary_0_33() to help gcc with inlining diff -r 0bc48f6f78a2 -r 5b80d560cdca unary.h --- 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 */ diff -r 0bc48f6f78a2 -r 5b80d560cdca wavpack.c --- 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)); }