diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2007-09-02 03:28:49 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2007-09-02 03:28:49 +0000 |
commit | a514c60fd0952c0682aa544ee1e16445e6b7df84 (patch) | |
tree | e60e6a0269e31994536567e7e6dfe972d79e3823 /apps/codecs/libwma/wmadeci.c | |
parent | f2ed1e40088fb2fcb9d715fa321c4c69e79243d4 (diff) | |
download | rockbox-a514c60fd0952c0682aa544ee1e16445e6b7df84.tar.gz rockbox-a514c60fd0952c0682aa544ee1e16445e6b7df84.zip |
Apparently, negative exponents are possible when decoding exponential VLC. Should fix occasional glitches that happened in files of all bitrates.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/wmadeci.c')
-rw-r--r-- | apps/codecs/libwma/wmadeci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index 3b81669d8f..8aa3620960 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c | |||
@@ -1110,6 +1110,9 @@ static int decode_exp_vlc(WMADecodeContext *s, int ch) | |||
1110 | fixed32 v, max_scale; | 1110 | fixed32 v, max_scale; |
1111 | fixed32 *q,*q_end; | 1111 | fixed32 *q,*q_end; |
1112 | 1112 | ||
1113 | /*accommodate the 16 negative indices */ | ||
1114 | fixed32 *pow_10_to_yover16_ptr = &pow_10_to_yover16[16]; | ||
1115 | |||
1113 | band_ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits]; | 1116 | band_ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits]; |
1114 | ptr = band_ptr; | 1117 | ptr = band_ptr; |
1115 | q = s->exponents[ch]; | 1118 | q = s->exponents[ch]; |
@@ -1142,7 +1145,7 @@ static int decode_exp_vlc(WMADecodeContext *s, int ch) | |||
1142 | /* NOTE: this offset is the same as MPEG4 AAC ! */ | 1145 | /* NOTE: this offset is the same as MPEG4 AAC ! */ |
1143 | last_exp += code - 60; | 1146 | last_exp += code - 60; |
1144 | /* XXX: use a table */ | 1147 | /* XXX: use a table */ |
1145 | v = pow_10_to_yover16[last_exp]; | 1148 | v = pow_10_to_yover16_ptr[last_exp]; |
1146 | if (v > max_scale) | 1149 | if (v > max_scale) |
1147 | { | 1150 | { |
1148 | max_scale = v; | 1151 | max_scale = v; |