diff options
Diffstat (limited to 'apps/codecs')
-rwxr-xr-x | apps/codecs/libmusepack/mpc_config.h | 2 | ||||
-rw-r--r-- | apps/codecs/libmusepack/synth_filter.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/codecs/libmusepack/mpc_config.h b/apps/codecs/libmusepack/mpc_config.h index 6993775703..fa78a46695 100755 --- a/apps/codecs/libmusepack/mpc_config.h +++ b/apps/codecs/libmusepack/mpc_config.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #if defined(CPU_COLDFIRE) | 37 | #if defined(CPU_COLDFIRE) |
38 | // do nothing | 38 | // do nothing |
39 | #elif defined(CPU_ARM) | 39 | #elif defined(CPU_ARM) |
40 | #define OPTIMIZE_FOR_SPEED | 40 | //#define OPTIMIZE_FOR_SPEED |
41 | #else | 41 | #else |
42 | #define OPTIMIZE_FOR_SPEED | 42 | #define OPTIMIZE_FOR_SPEED |
43 | #endif | 43 | #endif |
diff --git a/apps/codecs/libmusepack/synth_filter.c b/apps/codecs/libmusepack/synth_filter.c index 7d83c752e7..fb956fbff4 100644 --- a/apps/codecs/libmusepack/synth_filter.c +++ b/apps/codecs/libmusepack/synth_filter.c | |||
@@ -115,8 +115,8 @@ static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR = { | |||
115 | 115 | ||
116 | #undef D | 116 | #undef D |
117 | 117 | ||
118 | // needed to prevent from internal overflow in calculate_V | 118 | // needed to prevent from internal overflow in calculate_V (see below) |
119 | #define OVERFLOW_FIX 1 | 119 | #define OVERFLOW_FIX 2 |
120 | 120 | ||
121 | // V-coefficients were expanded (<<) by V_COEFFICIENT_EXPAND | 121 | // V-coefficients were expanded (<<) by V_COEFFICIENT_EXPAND |
122 | #define V_COEFFICIENT_EXPAND 27 | 122 | #define V_COEFFICIENT_EXPAND 27 |
@@ -128,6 +128,7 @@ static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR = { | |||
128 | #define MPC_MULTIPLY_V(sample, vcoef) ( MPC_SHR_RND(sample, 12) * vcoef ) | 128 | #define MPC_MULTIPLY_V(sample, vcoef) ( MPC_SHR_RND(sample, 12) * vcoef ) |
129 | 129 | ||
130 | // pre- and postscale are used to avoid internal overflow in synthesis calculation | 130 | // pre- and postscale are used to avoid internal overflow in synthesis calculation |
131 | // samples are s15.0, v-coefs are 4.12 -> internal format is s19.12 | ||
131 | #define MPC_MULTIPLY_V_PRESCALE(sample, vcoef) ( MPC_SHR_RND(sample, (12+OVERFLOW_FIX)) * vcoef ) | 132 | #define MPC_MULTIPLY_V_PRESCALE(sample, vcoef) ( MPC_SHR_RND(sample, (12+OVERFLOW_FIX)) * vcoef ) |
132 | #define MPC_MULTIPLY_V_POSTSCALE(sample, vcoef) ( MPC_SHR_RND(sample, (12-OVERFLOW_FIX)) * vcoef ) | 133 | #define MPC_MULTIPLY_V_POSTSCALE(sample, vcoef) ( MPC_SHR_RND(sample, (12-OVERFLOW_FIX)) * vcoef ) |
133 | #define MPC_V_POSTSCALE(sample) (sample<<OVERFLOW_FIX) | 134 | #define MPC_V_POSTSCALE(sample) (sample<<OVERFLOW_FIX) |
@@ -141,6 +142,7 @@ static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR = { | |||
141 | #define MPC_MULTIPLY_V(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND) ) | 142 | #define MPC_MULTIPLY_V(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND) ) |
142 | 143 | ||
143 | // pre- and postscale are used to avoid internal overflow in synthesis calculation | 144 | // pre- and postscale are used to avoid internal overflow in synthesis calculation |
145 | // samples are s15.14, v-coefs are 4.27 -> internal format is s19.12 | ||
144 | #define MPC_MULTIPLY_V_PRESCALE(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND-OVERFLOW_FIX) ) | 146 | #define MPC_MULTIPLY_V_PRESCALE(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND-OVERFLOW_FIX) ) |
145 | #define MPC_MULTIPLY_V_POSTSCALE(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND+OVERFLOW_FIX) ) | 147 | #define MPC_MULTIPLY_V_POSTSCALE(sample, vcoef) ( (MPC_MULTIPLY_FRACT(sample, vcoef)) << (32-V_COEFFICIENT_EXPAND+OVERFLOW_FIX) ) |
146 | #define MPC_V_POSTSCALE(sample) (sample<<OVERFLOW_FIX) | 148 | #define MPC_V_POSTSCALE(sample) (sample<<OVERFLOW_FIX) |