summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-07-28 18:39:10 +0000
committerMohamed Tarek <mt@rockbox.org>2010-07-28 18:39:10 +0000
commit7722c1d459a1c9d8d7be995e83b65daf70f7714a (patch)
treedc264fe3b291681c3acd43e8a98131244fd76a20
parenta9acd1f45b6ff7553317061733c6b9d51aad9450 (diff)
downloadrockbox-7722c1d459a1c9d8d7be995e83b65daf70f7714a.tar.gz
rockbox-7722c1d459a1c9d8d7be995e83b65daf70f7714a.tar.bz2
rockbox-7722c1d459a1c9d8d7be995e83b65daf70f7714a.zip
Correct the scaling of the coeffs to 17bits.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27599 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libwmapro/wma.c4
-rw-r--r--apps/codecs/libwmapro/wmaprodec.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/libwmapro/wma.c b/apps/codecs/libwmapro/wma.c
index a23cf38fd9..c80d433b07 100644
--- a/apps/codecs/libwmapro/wma.c
+++ b/apps/codecs/libwmapro/wma.c
@@ -116,7 +116,7 @@ int ff_wma_run_level_decode(GetBitContext* gb,
offset += run_table[code];
sign = !get_bits1(gb);
ptr[offset & coef_mask] = sign ? -level_table[code] : level_table[code];
- ptr[offset & coef_mask] <<= 16;
+ ptr[offset & coef_mask] <<= 17;
} else if (code == 1) {
/** EOB */
break;
@@ -144,7 +144,7 @@ int ff_wma_run_level_decode(GetBitContext* gb,
}
sign = !get_bits1(gb);
ptr[offset & coef_mask] = sign ? -level : level;
- ptr[offset & coef_mask] <<=16;
+ ptr[offset & coef_mask] <<=17;
}
}
/** NOTE: EOB can be omitted */
diff --git a/apps/codecs/libwmapro/wmaprodec.c b/apps/codecs/libwmapro/wmaprodec.c
index 0b5caff2f2..33848d4ea3 100644
--- a/apps/codecs/libwmapro/wmaprodec.c
+++ b/apps/codecs/libwmapro/wmaprodec.c
@@ -873,7 +873,7 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
for (i = 0; i < 4; i++) {
if (vals[i]) {
int sign = get_bits1(&s->gb) - 1;
- ci->coeffs[cur_coeff] = (sign == -1)? -vals[i]<<16 : vals[i]<<16;
+ ci->coeffs[cur_coeff] = (sign == -1)? -vals[i]<<17 : vals[i]<<17;
num_zeros = 0;
} else {
ci->coeffs[cur_coeff] = 0;