summaryrefslogtreecommitdiff
path: root/apps/codecs/libwmapro/wmapro_math.h
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-07-28 18:15:53 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-07-28 18:15:53 +0000
commit8cc8bb9bde265959ad69b3fc5cc84201461af1fb (patch)
treedb676e1e8f18d50260a5ade242f3e4e0458ab707 /apps/codecs/libwmapro/wmapro_math.h
parentf0aac62dd5bfd41c32ab375f8f03b8a1d648b919 (diff)
downloadrockbox-8cc8bb9bde265959ad69b3fc5cc84201461af1fb.tar.gz
rockbox-8cc8bb9bde265959ad69b3fc5cc84201461af1fb.zip
Submit next part of FS#11498. Unroll loop for minor speedup of libwmapro on ARM (1%).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27595 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/wmapro_math.h')
-rw-r--r--apps/codecs/libwmapro/wmapro_math.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h
index ba6421c9f5..6f8d6dbe0f 100644
--- a/apps/codecs/libwmapro/wmapro_math.h
+++ b/apps/codecs/libwmapro/wmapro_math.h
@@ -218,13 +218,13 @@ static inline void vector_fixmul_window(int32_t *dst, const int32_t *src0,
218 dst += len; 218 dst += len;
219 win += len; 219 win += len;
220 src0+= len; 220 src0+= len;
221 for(i=-len, j=len-1; i<0; i++, j--) { 221 for(i=-len, j=len-1; i<0; i++, j--) {
222 int32_t s0 = src0[i]; 222 int32_t s0 = src0[i]; /* s0 = src0[ 0 ... len-1] */
223 int32_t s1 = src1[j]; 223 int32_t s1 = src1[j]; /* s1 = src1[2*len-1 ... len] */
224 int32_t wi = -win[i]; 224 int32_t wi = -win[i]; /* wi = -win[ 0 ... len-1] */
225 int32_t wj = -win[j]; 225 int32_t wj = -win[j]; /* wj = -win[2*len-1 ... len] */
226 dst[i] = fixmul31(s0, wj) - fixmul31(s1, wi); 226 dst[i] = fixmul31(s0, wj) - fixmul31(s1, wi); /* dst[ 0 ... len-1] */
227 dst[j] = fixmul31(s0, wi) + fixmul31(s1, wj); 227 dst[j] = fixmul31(s0, wi) + fixmul31(s1, wj); /* dst[2*len-1 ... len] */
228 } 228 }
229} 229}
230#endif 230#endif
@@ -232,9 +232,15 @@ static inline void vector_fixmul_window(int32_t *dst, const int32_t *src0,
232static inline void vector_fixmul_scalar(int32_t *dst, const int32_t *src, 232static inline void vector_fixmul_scalar(int32_t *dst, const int32_t *src,
233 int32_t mul, int len) 233 int32_t mul, int len)
234{ 234{
235 /* len is _always_ a multiple of 4, because len is the difference of sfb's
236 * which themselves are always a multiple of 4. */
235 int i; 237 int i;
236 for(i=0; i<len; i++) 238 for (i=0; i<len; i+=4) {
237 dst[i] = fixmul24(src[i], mul); 239 dst[i ] = fixmul24(src[i ], mul);
240 dst[i+1] = fixmul24(src[i+1], mul);
241 dst[i+2] = fixmul24(src[i+2], mul);
242 dst[i+3] = fixmul24(src[i+3], mul);
243 }
238} 244}
239 245
240static inline int av_clip(int a, int amin, int amax) 246static inline int av_clip(int a, int amin, int amax)