Revision ca1daf0a

View differences:

libavcodec/unary.h
38 38
    return i;
39 39
}
40 40

  
41
/**
42
 * Get unary code terminated by a 0 with a maximum length of 33
43
 * @param gb GetBitContext
44
 * @return Unary length/index
45
 */
46
static inline int get_unary_0_33(GetBitContext *gb)
47
{
48
    return get_unary(gb, 0, 33);
49
}
50

  
41 51
#endif /* AVCODEC_UNARY_H */
libavcodec/wavpack.c
161 161
            if(ctx->zeroes)
162 162
                return 0;
163 163
        }else{
164
            t = get_unary(gb, 0, 33);
164
            t = get_unary_0_33(gb);
165 165
            if(t >= 2) t = get_bits(gb, t - 1) | (1 << (t-1));
166 166
            ctx->zeroes = t;
167 167
            if(ctx->zeroes){
......
180 180
        t = 0;
181 181
        ctx->zero = 0;
182 182
    }else{
183
        t = get_unary(gb, 0, 33);
183
        t = get_unary_0_33(gb);
184 184
        if(get_bits_count(gb) >= ctx->data_size){
185 185
            *last = 1;
186 186
            return 0;
187 187
        }
188 188
        if(t == 16) {
189
            t2 = get_unary(gb, 0, 33);
189
            t2 = get_unary_0_33(gb);
190 190
            if(t2 < 2) t += t2;
191 191
            else t += get_bits(gb, t2 - 1) | (1 << (t2 - 1));
192 192
        }

Also available in: Unified diff