summaryrefslogtreecommitdiff
path: root/apps/codecs/libmusepack
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmusepack')
-rw-r--r--apps/codecs/libmusepack/decoder.h4
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c12
-rw-r--r--apps/codecs/libmusepack/synth_filter.c4
3 files changed, 13 insertions, 7 deletions
diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h
index b3d24cf4ea..7e985407c5 100644
--- a/apps/codecs/libmusepack/decoder.h
+++ b/apps/codecs/libmusepack/decoder.h
@@ -87,8 +87,8 @@ struct mpc_decoder_t {
87 mpc_uint8_t SCF_shift[256]; 87 mpc_uint8_t SCF_shift[256];
88#endif 88#endif
89 89
90 MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960]; 90 MPC_SAMPLE_FORMAT *V_L;
91 MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960]; 91 MPC_SAMPLE_FORMAT *V_R;
92 MPC_SAMPLE_FORMAT *Y_L; 92 MPC_SAMPLE_FORMAT *Y_L;
93 MPC_SAMPLE_FORMAT *Y_R; 93 MPC_SAMPLE_FORMAT *Y_R;
94 MPC_SAMPLE_FORMAT SCF[256]; ///< holds adapted scalefactors (for clipping prevention) 94 MPC_SAMPLE_FORMAT SCF[256]; ///< holds adapted scalefactors (for clipping prevention)
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c
index 2ac855b946..c1e1d0e0d2 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -62,8 +62,10 @@ extern const mpc_can_data mpc_can_Q9up;
62 62
63//Decoder globals (g_Y_L and g_Y_R do not fit into iram for all targets) 63//Decoder globals (g_Y_L and g_Y_R do not fit into iram for all targets)
64static mpc_decoder g_mpc_decoder IBSS_ATTR; 64static mpc_decoder g_mpc_decoder IBSS_ATTR;
65static MPC_SAMPLE_FORMAT g_Y_L[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM; 65static MPC_SAMPLE_FORMAT g_V_L[MPC_V_MEM + 960 ] IBSS_ATTR __attribute__((aligned(16)));
66static MPC_SAMPLE_FORMAT g_Y_R[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM; 66static MPC_SAMPLE_FORMAT g_Y_L[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM __attribute__((aligned(16)));
67static MPC_SAMPLE_FORMAT g_V_R[MPC_V_MEM + 960 ] IBSS_ATTR __attribute__((aligned(16)));
68static MPC_SAMPLE_FORMAT g_Y_R[MPC_FRAME_LENGTH] IBSS_ATTR_MPC_LARGE_IRAM __attribute__((aligned(16)));
67 69
68//SV7 globals (decoding results for bundled quantizers (3- and 5-step)) 70//SV7 globals (decoding results for bundled quantizers (3- and 5-step))
69static const mpc_int32_t g_sv7_idx30[] ICONST_ATTR = 71static const mpc_int32_t g_sv7_idx30[] ICONST_ATTR =
@@ -236,9 +238,13 @@ static void mpc_decoder_setup(mpc_decoder *d)
236 238
237 d->__r1 = 1; 239 d->__r1 = 1;
238 d->__r2 = 1; 240 d->__r2 = 1;
241 d->V_L = g_V_L;
242 d->V_R = g_V_R;
239 d->Y_L = g_Y_L; 243 d->Y_L = g_Y_L;
240 d->Y_R = g_Y_R; 244 d->Y_R = g_Y_R;
241 245
246 memset(d->V_L, 0, sizeof(g_V_L));
247 memset(d->V_R, 0, sizeof(g_V_R));
242 memset(d->Y_L, 0, sizeof(g_Y_L)); 248 memset(d->Y_L, 0, sizeof(g_Y_L));
243 memset(d->Y_R, 0, sizeof(g_Y_R)); 249 memset(d->Y_R, 0, sizeof(g_Y_R));
244 250
diff --git a/apps/codecs/libmusepack/synth_filter.c b/apps/codecs/libmusepack/synth_filter.c
index 94c57eb213..e173702a77 100644
--- a/apps/codecs/libmusepack/synth_filter.c
+++ b/apps/codecs/libmusepack/synth_filter.c
@@ -66,9 +66,9 @@
66 // by the correct amount to have proper scaled output 66 // by the correct amount to have proper scaled output
67 #define D(value) MAKE_MPC_SAMPLE((double)value*(double)(0x1000)) 67 #define D(value) MAKE_MPC_SAMPLE((double)value*(double)(0x1000))
68#endif 68#endif
69 69
70// Di_opt coefficients are +/- 2^17 (pre-shifted by <<16) 70// Di_opt coefficients are +/- 2^17 (pre-shifted by <<16)
71static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR = { 71static const MPC_SAMPLE_FORMAT Di_opt [512] ICONST_ATTR __attribute__((aligned(16))) = {
72/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ 72/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */
73/* 0 */ D( 0), -D( 29), D(213), -D( 459), D(2037), -D(5153), D( 6574), -D(37489), D(75038), D(37489), D(6574), D(5153), D(2037), D(459), D(213), D(29), 73/* 0 */ D( 0), -D( 29), D(213), -D( 459), D(2037), -D(5153), D( 6574), -D(37489), D(75038), D(37489), D(6574), D(5153), D(2037), D(459), D(213), D(29),
74/* 1 */ -D( 1), -D( 31), D(218), -D( 519), D(2000), -D(5517), D( 5959), -D(39336), D(74992), D(35640), D(7134), D(4788), D(2063), D(401), D(208), D(26), 74/* 1 */ -D( 1), -D( 31), D(218), -D( 519), D(2000), -D(5517), D( 5959), -D(39336), D(74992), D(35640), D(7134), D(4788), D(2063), D(401), D(208), D(26),