summaryrefslogtreecommitdiff
path: root/libavcodec/flac.c
diff options
context:
space:
mode:
authorJosh Coalson <>2007-11-03 23:54:50 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2007-11-03 23:54:50 +0000
commite471443ab5eefd05fd8267b96398c6c83a3725e8 (patch)
tree3c430d55e1c678c6a0cbe6f145096bd925927005 /libavcodec/flac.c
parent9abf2433162a8ff9626be18a9699e27f55e58e1c (diff)
downloadffmpeg-e471443ab5eefd05fd8267b96398c6c83a3725e8.tar.gz
Add support for FLAC's new RICE2 entropy coding method. Patch by Josh Coalson.
Originally committed as revision 10915 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r--libavcodec/flac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index 480ede2a20..e949a46655 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -217,7 +217,7 @@ static int decode_residuals(FLACContext *s, int channel, int pred_order)
int sample = 0, samples;
method_type = get_bits(&s->gb, 2);
- if (method_type != 0){
+ if (method_type > 1){
av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type);
return -1;
}
@@ -234,8 +234,8 @@ static int decode_residuals(FLACContext *s, int channel, int pred_order)
i= pred_order;
for (partition = 0; partition < (1 << rice_order); partition++)
{
- tmp = get_bits(&s->gb, 4);
- if (tmp == 15)
+ tmp = get_bits(&s->gb, method_type == 0 ? 4 : 5);
+ if (tmp == (method_type == 0 ? 15 : 31))
{
av_log(s->avctx, AV_LOG_DEBUG, "fixed len partition\n");
tmp = get_bits(&s->gb, 5);