diff options
author | Thom Johansen <thomj@rockbox.org> | 2006-01-30 01:00:40 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2006-01-30 01:00:40 +0000 |
commit | 2b483958f961637e296432632a5b891eb061c22d (patch) | |
tree | 180fd3596df375fa56732050a7cc20ebdbc3cdb7 /apps/codecs/libmusepack/requant.c | |
parent | 58231d50f2cb940a309814e31ae583b4b0dfed24 (diff) | |
download | rockbox-2b483958f961637e296432632a5b891eb061c22d.tar.gz rockbox-2b483958f961637e296432632a5b891eb061c22d.zip |
Synced libmpcdec to musepack.net SVN.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8488 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libmusepack/requant.c')
-rw-r--r-- | apps/codecs/libmusepack/requant.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/apps/codecs/libmusepack/requant.c b/apps/codecs/libmusepack/requant.c index df1175a105..a72a165786 100644 --- a/apps/codecs/libmusepack/requant.c +++ b/apps/codecs/libmusepack/requant.c | |||
@@ -72,9 +72,9 @@ const mpc_int32_t __Dc [1 + 18] = { | |||
72 | #ifdef MPC_FIXED_POINT | 72 | #ifdef MPC_FIXED_POINT |
73 | static mpc_uint32_t find_shift(double fval) | 73 | static mpc_uint32_t find_shift(double fval) |
74 | { | 74 | { |
75 | mpc_int64_t val = (mpc_int64_t)fval; | 75 | mpc_int64_t val = (mpc_int64_t)fval; |
76 | if (val<0) val = -val; | ||
77 | mpc_uint32_t ptr = 0; | 76 | mpc_uint32_t ptr = 0; |
77 | if (val<0) val = -val; | ||
78 | while(val) {val>>=1;ptr++;} | 78 | while(val) {val>>=1;ptr++;} |
79 | 79 | ||
80 | return ptr > 31 ? 0 : 31 - ptr; | 80 | return ptr > 31 ? 0 : 31 - ptr; |
@@ -113,40 +113,8 @@ mpc_decoder_scale_output(mpc_decoder *d, double factor) | |||
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | static void | ||
117 | mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading) | ||
118 | { // conversion: quantizer -> index (bitstream writing) | ||
119 | mpc_int32_t Band = 0; | ||
120 | mpc_int32_t i; | ||
121 | |||
122 | do { | ||
123 | d->Q_bit [Band] = 4; | ||
124 | for ( i = 0; i < 16-1; i++ ) | ||
125 | d->Q_res [Band] [i] = i; | ||
126 | d->Q_res [Band][i] = 17; | ||
127 | Band++; | ||
128 | } while ( Band < 11 ); | ||
129 | |||
130 | do { | ||
131 | d->Q_bit [Band] = 3; | ||
132 | for ( i = 0; i < 8-1; i++ ) | ||
133 | d->Q_res [Band] [i] = i; | ||
134 | d->Q_res [Band] [i] = 17; | ||
135 | Band++; | ||
136 | } while ( Band < 23 ); | ||
137 | |||
138 | do { | ||
139 | d->Q_bit [Band] = 2; | ||
140 | for ( i = 0; i < 4-1; i++ ) | ||
141 | d->Q_res [Band] [i] = i; | ||
142 | d->Q_res [Band] [i] = 17; | ||
143 | Band++; | ||
144 | } while ( Band < 32 ); | ||
145 | } | ||
146 | |||
147 | void | 116 | void |
148 | mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) | 117 | mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) |
149 | { | 118 | { |
150 | mpc_decoder_quantisierungsmodes(d); | ||
151 | mpc_decoder_scale_output(d, scale_factor); | 119 | mpc_decoder_scale_output(d, scale_factor); |
152 | } | 120 | } |