summaryrefslogtreecommitdiff
path: root/apps/codecs
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 /apps/codecs
parentc7e7d7571bc0bab316b7c055159182a4f602298b (diff)
downloadrockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.zip
rockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.tar.gz
rockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.tar.bz2
rockbox-2a75a9045c478fc55dad013d74de8c2f144d3046.tar.xz
More WMAv1 fixes by Rafael Carre.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17943 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-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 23916f6..bc89229 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)
*q++ = v;
}
while (--n);
+ } else {
+ last_exp = 36;
}
- last_exp = 36;
while (q < q_end)
{
@@ -1171,15 +1172,14 @@ static int wma_decode_block(WMADecodeContext *s)
{
int n4 = s->block_len >> 1;
- //mdct_norm = 0x10000;
- //mdct_norm = fixdiv32(mdct_norm,itofix32(n4));
- mdct_norm = 0x10000>>(s->block_len_bits-1); //theres no reason to do a divide by two in fixed precision ...
+
+ mdct_norm = 0x10000>>(s->block_len_bits-1);
if (s->version == 1)
{
fixed32 tmp = fixtoi32(fixsqrt32(itofix32(n4)));
- mdct_norm *= tmp; // PJJ : exercise this path
+ mdct_norm *= fixtoi32(fixsqrt32(itofix32(n4)));
}
}
@@ -1322,10 +1322,13 @@ static int wma_decode_block(WMADecodeContext *s)
{
/*Noise coding not used, simply convert from exp to fixed representation*/
-
fixed32 mult3 = (fixed32)(fixdiv64(pow_table[total_gain+20],Fixed32To64(s->max_exponent[ch])));
mult3 = fixmul32(mult3, mdct_norm);
+ /*zero the first 3 coefficients for WMA V1, does nothing otherwise*/
+ for(i=0; i<s->coefs_start; i++)
+ *coefs++=0;
+
n = nb_coefs[ch];
/* XXX: optimize more, unrolling this loop in asm might be a good idea */