summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/lib/SOURCES4
-rw-r--r--apps/codecs/lib/asm_arm.h13
-rw-r--r--apps/codecs/lib/codeclib.h2
3 files changed, 11 insertions, 8 deletions
diff --git a/apps/codecs/lib/SOURCES b/apps/codecs/lib/SOURCES
index 438cd1fc62..da77f97d30 100644
--- a/apps/codecs/lib/SOURCES
+++ b/apps/codecs/lib/SOURCES
@@ -4,14 +4,14 @@ fixedpoint.c
4 4
5/* OLD MDCT */ 5/* OLD MDCT */
6/* (when all other codecs are remediated this can be remoed) */ 6/* (when all other codecs are remediated this can be remoed) */
7/* mdct2.c */ 7mdct2.c
8mdct_lookup.c 8mdct_lookup.c
9 9
10fft-ffmpeg.c 10fft-ffmpeg.c
11mdct.c 11mdct.c
12 12
13#ifdef CPU_ARM 13#ifdef CPU_ARM
14/*mdct_arm.S*/ 14mdct_arm.S
15setjmp_arm.S 15setjmp_arm.S
16../../../firmware/target/arm/support-arm.S 16../../../firmware/target/arm/support-arm.S
17#endif 17#endif
diff --git a/apps/codecs/lib/asm_arm.h b/apps/codecs/lib/asm_arm.h
index 9dcbcef755..4f31f80c3e 100644
--- a/apps/codecs/lib/asm_arm.h
+++ b/apps/codecs/lib/asm_arm.h
@@ -226,11 +226,14 @@ void vect_mult_bw(int32_t *data, int32_t *window, int n)
226#define _V_CLIP_MATH 226#define _V_CLIP_MATH
227 227
228static inline int32_t CLIP_TO_15(int32_t x) { 228static inline int32_t CLIP_TO_15(int32_t x) {
229 const int32_t mask = 0xffff7fff; 229 int tmp;
230 asm volatile("teq %0,%0,asr #31\n\t" 230 asm volatile("subs %1, %0, #32768\n\t"
231 "eorne %0,%1,%0,asr #31\n\t" 231 "movpl %0, #0x7f00\n\t"
232 : "+r"(x) 232 "orrpl %0, %0, #0xff\n"
233 : "r" (mask) 233 "adds %1, %0, #32768\n\t"
234 "movmi %0, #0x8000"
235 : "+r"(x),"=r"(tmp)
236 :
234 : "cc"); 237 : "cc");
235 return(x); 238 return(x);
236} 239}
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h
index 32a4696b9d..817d86a6a3 100644
--- a/apps/codecs/lib/codeclib.h
+++ b/apps/codecs/lib/codeclib.h
@@ -65,7 +65,7 @@ void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, con
65 65
66/*MDCT library functions*/ 66/*MDCT library functions*/
67/* -1- Tremor mdct */ 67/* -1- Tremor mdct */
68/* extern void mdct_backward(int n, int32_t *in, int32_t *out); */ 68extern void mdct_backward(int n, int32_t *in, int32_t *out);
69/* -2- ffmpeg fft-based mdct */ 69/* -2- ffmpeg fft-based mdct */
70extern void ff_imdct_half(unsigned int nbits, int32_t *output, const int32_t *input); 70extern void ff_imdct_half(unsigned int nbits, int32_t *output, const int32_t *input);
71extern void ff_imdct_calc(unsigned int nbits, int32_t *output, const int32_t *input); 71extern void ff_imdct_calc(unsigned int nbits, int32_t *output, const int32_t *input);