summaryrefslogtreecommitdiff
path: root/apps/codecs/libffmpegFLAC
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2007-11-07 18:18:56 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2007-11-07 18:18:56 +0000
commitd74a8ec85dd83f50bf03938095890267d59d9825 (patch)
treeb498e50d1ffe9f66b2a6a53e8aac34edf89c2ebb /apps/codecs/libffmpegFLAC
parent7685544b025749dd293802224c027056a0b6da21 (diff)
downloadrockbox-d74a8ec85dd83f50bf03938095890267d59d9825.zip
rockbox-d74a8ec85dd83f50bf03938095890267d59d9825.tar.gz
rockbox-d74a8ec85dd83f50bf03938095890267d59d9825.tar.bz2
rockbox-d74a8ec85dd83f50bf03938095890267d59d9825.tar.xz
from ffmpeg: Add support for FLAC's new RICE2 entropy coding method. fixes 24-bit FLAC files encoded with flac-1.2.1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15517 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libffmpegFLAC')
-rw-r--r--apps/codecs/libffmpegFLAC/decoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/libffmpegFLAC/decoder.c b/apps/codecs/libffmpegFLAC/decoder.c
index 88fcbfd..1d46eda 100644
--- a/apps/codecs/libffmpegFLAC/decoder.c
+++ b/apps/codecs/libffmpegFLAC/decoder.c
@@ -144,7 +144,7 @@ static int decode_residuals(FLACContext *s, int32_t* decoded, int pred_order)
int sample = 0, samples;
method_type = get_bits(&s->gb, 2);
- if (method_type != 0){
+ if (method_type > 1){
//fprintf(stderr,"illegal residual coding method %d\n", method_type);
return -3;
}
@@ -157,8 +157,8 @@ static int decode_residuals(FLACContext *s, int32_t* decoded, 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))
{
//fprintf(stderr,"fixed len partition\n");
tmp = get_bits(&s->gb, 5);