summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/lib/asm_mcf5249.h2
-rw-r--r--apps/codecs/lib/codeclib_misc.h7
-rw-r--r--apps/codecs/lib/mdct2.c13
3 files changed, 0 insertions, 22 deletions
diff --git a/apps/codecs/lib/asm_mcf5249.h b/apps/codecs/lib/asm_mcf5249.h
index 88b7961431..8378accb2a 100644
--- a/apps/codecs/lib/asm_mcf5249.h
+++ b/apps/codecs/lib/asm_mcf5249.h
@@ -27,8 +27,6 @@
27#ifndef _V_WIDE_MATH 27#ifndef _V_WIDE_MATH
28#define _V_WIDE_MATH 28#define _V_WIDE_MATH
29 29
30#define MB()
31
32static inline int32_t MULT32(int32_t x, int32_t y) { 30static inline int32_t MULT32(int32_t x, int32_t y) {
33 31
34 asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */ 32 asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */
diff --git a/apps/codecs/lib/codeclib_misc.h b/apps/codecs/lib/codeclib_misc.h
index f522d33544..54bebb744f 100644
--- a/apps/codecs/lib/codeclib_misc.h
+++ b/apps/codecs/lib/codeclib_misc.h
@@ -105,13 +105,6 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) {
105#endif 105#endif
106 106
107/* 107/*
108 * This should be used as a memory barrier, forcing all cached values in
109 * registers to wr writen back to memory. Might or might not be beneficial
110 * depending on the architecture and compiler.
111 */
112#define MB()
113
114/*
115 * The XPROD functions are meant to optimize the cross products found all 108 * The XPROD functions are meant to optimize the cross products found all
116 * over the place in mdct.c by forcing memory operation ordering to avoid 109 * over the place in mdct.c by forcing memory operation ordering to avoid
117 * unnecessary register reloads as soon as memory is being written to. 110 * unnecessary register reloads as soon as memory is being written to.
diff --git a/apps/codecs/lib/mdct2.c b/apps/codecs/lib/mdct2.c
index 6d9168804c..3accc51e57 100644
--- a/apps/codecs/lib/mdct2.c
+++ b/apps/codecs/lib/mdct2.c
@@ -74,7 +74,6 @@ static inline void mdct_butterfly_8(int32_t *x){
74 x[5] = r6 - r2; 74 x[5] = r6 - r2;
75 x[6] = r4 + r0; 75 x[6] = r4 + r0;
76 x[7] = r6 + r2; 76 x[7] = r6 + r2;
77 MB();
78} 77}
79 78
80/* 16 point butterfly (in place, 4 register) */ 79/* 16 point butterfly (in place, 4 register) */
@@ -86,23 +85,19 @@ static inline void mdct_butterfly_16(int32_t *x){
86 r1 = x[ 1] - x[ 9]; x[ 9] += x[ 1]; 85 r1 = x[ 1] - x[ 9]; x[ 9] += x[ 1];
87 x[ 0] = MULT31((r0 + r1) , cPI2_8); 86 x[ 0] = MULT31((r0 + r1) , cPI2_8);
88 x[ 1] = MULT31((r1 - r0) , cPI2_8); 87 x[ 1] = MULT31((r1 - r0) , cPI2_8);
89 MB();
90 88
91 r0 = x[10] - x[ 2]; x[10] += x[ 2]; 89 r0 = x[10] - x[ 2]; x[10] += x[ 2];
92 r1 = x[ 3] - x[11]; x[11] += x[ 3]; 90 r1 = x[ 3] - x[11]; x[11] += x[ 3];
93 x[ 2] = r1; x[ 3] = r0; 91 x[ 2] = r1; x[ 3] = r0;
94 MB();
95 92
96 r0 = x[12] - x[ 4]; x[12] += x[ 4]; 93 r0 = x[12] - x[ 4]; x[12] += x[ 4];
97 r1 = x[13] - x[ 5]; x[13] += x[ 5]; 94 r1 = x[13] - x[ 5]; x[13] += x[ 5];
98 x[ 4] = MULT31((r0 - r1) , cPI2_8); 95 x[ 4] = MULT31((r0 - r1) , cPI2_8);
99 x[ 5] = MULT31((r0 + r1) , cPI2_8); 96 x[ 5] = MULT31((r0 + r1) , cPI2_8);
100 MB();
101 97
102 r0 = x[14] - x[ 6]; x[14] += x[ 6]; 98 r0 = x[14] - x[ 6]; x[14] += x[ 6];
103 r1 = x[15] - x[ 7]; x[15] += x[ 7]; 99 r1 = x[15] - x[ 7]; x[15] += x[ 7];
104 x[ 6] = r0; x[ 7] = r1; 100 x[ 6] = r0; x[ 7] = r1;
105 MB();
106 101
107 mdct_butterfly_8(x); 102 mdct_butterfly_8(x);
108 mdct_butterfly_8(x+8); 103 mdct_butterfly_8(x+8);
@@ -116,44 +111,36 @@ static inline void mdct_butterfly_32(int32_t *x){
116 r0 = x[30] - x[14]; x[30] += x[14]; 111 r0 = x[30] - x[14]; x[30] += x[14];
117 r1 = x[31] - x[15]; x[31] += x[15]; 112 r1 = x[31] - x[15]; x[31] += x[15];
118 x[14] = r0; x[15] = r1; 113 x[14] = r0; x[15] = r1;
119 MB();
120 114
121 r0 = x[28] - x[12]; x[28] += x[12]; 115 r0 = x[28] - x[12]; x[28] += x[12];
122 r1 = x[29] - x[13]; x[29] += x[13]; 116 r1 = x[29] - x[13]; x[29] += x[13];
123 XNPROD31( r0, r1, cPI1_8, cPI3_8, &x[12], &x[13] ); 117 XNPROD31( r0, r1, cPI1_8, cPI3_8, &x[12], &x[13] );
124 MB();
125 118
126 r0 = x[26] - x[10]; x[26] += x[10]; 119 r0 = x[26] - x[10]; x[26] += x[10];
127 r1 = x[27] - x[11]; x[27] += x[11]; 120 r1 = x[27] - x[11]; x[27] += x[11];
128 x[10] = MULT31((r0 - r1) , cPI2_8); 121 x[10] = MULT31((r0 - r1) , cPI2_8);
129 x[11] = MULT31((r0 + r1) , cPI2_8); 122 x[11] = MULT31((r0 + r1) , cPI2_8);
130 MB();
131 123
132 r0 = x[24] - x[ 8]; x[24] += x[ 8]; 124 r0 = x[24] - x[ 8]; x[24] += x[ 8];
133 r1 = x[25] - x[ 9]; x[25] += x[ 9]; 125 r1 = x[25] - x[ 9]; x[25] += x[ 9];
134 XNPROD31( r0, r1, cPI3_8, cPI1_8, &x[ 8], &x[ 9] ); 126 XNPROD31( r0, r1, cPI3_8, cPI1_8, &x[ 8], &x[ 9] );
135 MB();
136 127
137 r0 = x[22] - x[ 6]; x[22] += x[ 6]; 128 r0 = x[22] - x[ 6]; x[22] += x[ 6];
138 r1 = x[ 7] - x[23]; x[23] += x[ 7]; 129 r1 = x[ 7] - x[23]; x[23] += x[ 7];
139 x[ 6] = r1; x[ 7] = r0; 130 x[ 6] = r1; x[ 7] = r0;
140 MB();
141 131
142 r0 = x[ 4] - x[20]; x[20] += x[ 4]; 132 r0 = x[ 4] - x[20]; x[20] += x[ 4];
143 r1 = x[ 5] - x[21]; x[21] += x[ 5]; 133 r1 = x[ 5] - x[21]; x[21] += x[ 5];
144 XPROD31 ( r0, r1, cPI3_8, cPI1_8, &x[ 4], &x[ 5] ); 134 XPROD31 ( r0, r1, cPI3_8, cPI1_8, &x[ 4], &x[ 5] );
145 MB();
146 135
147 r0 = x[ 2] - x[18]; x[18] += x[ 2]; 136 r0 = x[ 2] - x[18]; x[18] += x[ 2];
148 r1 = x[ 3] - x[19]; x[19] += x[ 3]; 137 r1 = x[ 3] - x[19]; x[19] += x[ 3];
149 x[ 2] = MULT31((r1 + r0) , cPI2_8); 138 x[ 2] = MULT31((r1 + r0) , cPI2_8);
150 x[ 3] = MULT31((r1 - r0) , cPI2_8); 139 x[ 3] = MULT31((r1 - r0) , cPI2_8);
151 MB();
152 140
153 r0 = x[ 0] - x[16]; x[16] += x[ 0]; 141 r0 = x[ 0] - x[16]; x[16] += x[ 0];
154 r1 = x[ 1] - x[17]; x[17] += x[ 1]; 142 r1 = x[ 1] - x[17]; x[17] += x[ 1];
155 XPROD31 ( r0, r1, cPI1_8, cPI3_8, &x[ 0], &x[ 1] ); 143 XPROD31 ( r0, r1, cPI1_8, cPI3_8, &x[ 0], &x[ 1] );
156 MB();
157 144
158 mdct_butterfly_16(x); 145 mdct_butterfly_16(x);
159 mdct_butterfly_16(x+16); 146 mdct_butterfly_16(x+16);