diff options
author | Mohamed Tarek <mt@rockbox.org> | 2010-07-28 18:39:10 +0000 |
---|---|---|
committer | Mohamed Tarek <mt@rockbox.org> | 2010-07-28 18:39:10 +0000 |
commit | 7722c1d459a1c9d8d7be995e83b65daf70f7714a (patch) | |
tree | dc264fe3b291681c3acd43e8a98131244fd76a20 | |
parent | a9acd1f45b6ff7553317061733c6b9d51aad9450 (diff) | |
download | rockbox-7722c1d459a1c9d8d7be995e83b65daf70f7714a.tar.gz 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.c | 4 | ||||
-rw-r--r-- | apps/codecs/libwmapro/wmaprodec.c | 2 |
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, | |||
116 | offset += run_table[code]; | 116 | offset += run_table[code]; |
117 | sign = !get_bits1(gb); | 117 | sign = !get_bits1(gb); |
118 | ptr[offset & coef_mask] = sign ? -level_table[code] : level_table[code]; | 118 | ptr[offset & coef_mask] = sign ? -level_table[code] : level_table[code]; |
119 | ptr[offset & coef_mask] <<= 16; | 119 | ptr[offset & coef_mask] <<= 17; |
120 | } else if (code == 1) { | 120 | } else if (code == 1) { |
121 | /** EOB */ | 121 | /** EOB */ |
122 | break; | 122 | break; |
@@ -144,7 +144,7 @@ int ff_wma_run_level_decode(GetBitContext* gb, | |||
144 | } | 144 | } |
145 | sign = !get_bits1(gb); | 145 | sign = !get_bits1(gb); |
146 | ptr[offset & coef_mask] = sign ? -level : level; | 146 | ptr[offset & coef_mask] = sign ? -level : level; |
147 | ptr[offset & coef_mask] <<=16; | 147 | ptr[offset & coef_mask] <<=17; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | /** NOTE: EOB can be omitted */ | 150 | /** 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) | |||
873 | for (i = 0; i < 4; i++) { | 873 | for (i = 0; i < 4; i++) { |
874 | if (vals[i]) { | 874 | if (vals[i]) { |
875 | int sign = get_bits1(&s->gb) - 1; | 875 | int sign = get_bits1(&s->gb) - 1; |
876 | ci->coeffs[cur_coeff] = (sign == -1)? -vals[i]<<16 : vals[i]<<16; | 876 | ci->coeffs[cur_coeff] = (sign == -1)? -vals[i]<<17 : vals[i]<<17; |
877 | num_zeros = 0; | 877 | num_zeros = 0; |
878 | } else { | 878 | } else { |
879 | ci->coeffs[cur_coeff] = 0; | 879 | ci->coeffs[cur_coeff] = 0; |