Mercurial > libavcodec.hg
comparison alsdec.c @ 10535:95f3daa991a2 libavcodec
Use get_bits_left() instead of size_in_bits - get_bits_count().
author | rbultje |
---|---|
date | Mon, 16 Nov 2009 17:42:43 +0000 |
parents | 142645a57180 |
children | 997692df50c1 |
comparison
equal
deleted
inserted
replaced
10534:4cd2ef16fb63 | 10535:95f3daa991a2 |
---|---|
378 | 378 |
379 /** Reads and decodes a Rice codeword. | 379 /** Reads and decodes a Rice codeword. |
380 */ | 380 */ |
381 static int32_t decode_rice(GetBitContext *gb, unsigned int k) | 381 static int32_t decode_rice(GetBitContext *gb, unsigned int k) |
382 { | 382 { |
383 int max = gb->size_in_bits - get_bits_count(gb) - k; | 383 int max = get_bits_left(gb) - k; |
384 int q = get_unary(gb, 0, max); | 384 int q = get_unary(gb, 0, max); |
385 int r = k ? get_bits1(gb) : !(q & 1); | 385 int r = k ? get_bits1(gb) : !(q & 1); |
386 | 386 |
387 if (k > 1) { | 387 if (k > 1) { |
388 q <<= (k - 1); | 388 q <<= (k - 1); |