summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2008-07-05 00:44:01 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2008-07-05 00:44:01 +0000
commit2a75a9045c478fc55dad013d74de8c2f144d3046 (patch)
treea150ba217f42371c504f774a76e815b2a6889de8
parentc7e7d7571bc0bab316b7c055159182a4f602298b (diff)
downloadrockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.tar.gz
rockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.zip
More WMAv1 fixes by Rafael Carre.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17943 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libwma/wmadeci.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 23916f6dc8..bc89229c87 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -876,8 +876,9 @@ static int decode_exp_vlc(WMADecodeContext *s, int ch)
876 *q++ = v; 876 *q++ = v;
877 } 877 }
878 while (--n); 878 while (--n);
879 } else {
880 last_exp = 36;
879 } 881 }
880 last_exp = 36;
881 882
882 while (q < q_end) 883 while (q < q_end)
883 { 884 {
@@ -1171,15 +1172,14 @@ static int wma_decode_block(WMADecodeContext *s)
1171 1172
1172 { 1173 {
1173 int n4 = s->block_len >> 1; 1174 int n4 = s->block_len >> 1;
1174 //mdct_norm = 0x10000;
1175 //mdct_norm = fixdiv32(mdct_norm,itofix32(n4));
1176 1175
1177 mdct_norm = 0x10000>>(s->block_len_bits-1); //theres no reason to do a divide by two in fixed precision ... 1176
1177 mdct_norm = 0x10000>>(s->block_len_bits-1);
1178 1178
1179 if (s->version == 1) 1179 if (s->version == 1)
1180 { 1180 {
1181 fixed32 tmp = fixtoi32(fixsqrt32(itofix32(n4))); 1181 fixed32 tmp = fixtoi32(fixsqrt32(itofix32(n4)));
1182 mdct_norm *= tmp; // PJJ : exercise this path 1182 mdct_norm *= fixtoi32(fixsqrt32(itofix32(n4)));
1183 } 1183 }
1184 } 1184 }
1185 1185
@@ -1322,10 +1322,13 @@ static int wma_decode_block(WMADecodeContext *s)
1322 { 1322 {
1323 /*Noise coding not used, simply convert from exp to fixed representation*/ 1323 /*Noise coding not used, simply convert from exp to fixed representation*/
1324 1324
1325
1326 fixed32 mult3 = (fixed32)(fixdiv64(pow_table[total_gain+20],Fixed32To64(s->max_exponent[ch]))); 1325 fixed32 mult3 = (fixed32)(fixdiv64(pow_table[total_gain+20],Fixed32To64(s->max_exponent[ch])));
1327 mult3 = fixmul32(mult3, mdct_norm); 1326 mult3 = fixmul32(mult3, mdct_norm);
1328 1327
1328 /*zero the first 3 coefficients for WMA V1, does nothing otherwise*/
1329 for(i=0; i<s->coefs_start; i++)
1330 *coefs++=0;
1331
1329 n = nb_coefs[ch]; 1332 n = nb_coefs[ch];
1330 1333
1331 /* XXX: optimize more, unrolling this loop in asm might be a good idea */ 1334 /* XXX: optimize more, unrolling this loop in asm might be a good idea */