diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2007-09-01 21:03:17 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2007-09-01 21:03:17 +0000 |
commit | becc0ef95b2a6dc7c4127f5cd14ca948f980ac45 (patch) | |
tree | aef06388aaf7ee2a103db78cae4c558b75b58928 /libavcodec/alac.c | |
parent | 9d14ffbccee7e6e3f521aa0aa543d9e61b07514f (diff) | |
download | ffmpeg-streaming-becc0ef95b2a6dc7c4127f5cd14ca948f980ac45.zip ffmpeg-streaming-becc0ef95b2a6dc7c4127f5cd14ca948f980ac45.tar.gz |
Remove reimplementation of get_unary.
Based on a patch by Alex Beregszaszi.
Originally committed as revision 10279 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r-- | libavcodec/alac.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 257ad1c..777c720 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -55,6 +55,7 @@ #include "avcodec.h" #include "bitstream.h" #include "bytestream.h" +#include "unary.h" #define ALAC_EXTRADATA_SIZE 36 #define MAX_CHANNELS 2 @@ -159,14 +160,12 @@ static void bastardized_rice_decompress(ALACContext *alac, int sign_modifier = 0; for (output_count = 0; output_count < output_size; output_count++) { - int32_t x = 0; + int32_t x; int32_t x_modified; int32_t final_val; /* read x - number of 1s before 0 represent the rice */ - while (x <= 8 && get_bits1(&alac->gb)) { - x++; - } + x = get_unary_0_9(&alac->gb); if (x > 8) { /* RICE THRESHOLD */ /* use alternative encoding */ @@ -227,10 +226,7 @@ static void bastardized_rice_decompress(ALACContext *alac, sign_modifier = 1; - x = 0; - while (x <= 8 && get_bits1(&alac->gb)) { - x++; - } + x = get_unary_0_9(&alac->gb); if (x > 8) { block_size = get_bits(&alac->gb, 16); |