annotate arm/mdct_neon.S @ 10185:25752b5ce17a libavcodec

Only use one mdct window size in atrac1.
author banan
date Thu, 17 Sep 2009 18:52:11 +0000
parents eda985c53dba
children 38ab367d4231
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
1 /*
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
2 * ARM NEON optimised MDCT
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
3 * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
4 *
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
5 * This file is part of FFmpeg.
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
6 *
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
11 *
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
15 * Lesser General Public License for more details.
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
16 *
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
20 */
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
21
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
22 #include "asm.S"
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
23
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
24 .fpu neon
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
25 .text
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
26
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
27 function ff_imdct_half_neon, export=1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
28 push {r4-r8,lr}
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
29
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
30 mov r12, #1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
31 ldr lr, [r0, #4] @ nbits
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
32 ldr r4, [r0, #8] @ tcos
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
33 ldr r5, [r0, #12] @ tsin
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
34 ldr r3, [r0, #24] @ revtab
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
35 lsl r12, r12, lr @ n = 1 << nbits
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
36 lsr lr, r12, #2 @ n4 = n >> 2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
37 add r7, r2, r12, lsl #1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
38 mov r12, #-16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
39 sub r7, r7, #16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
40
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
41 vld2.32 {d16-d17},[r7,:128],r12 @ d16=x,n1 d17=x,n0
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
42 vld2.32 {d0-d1}, [r2,:128]! @ d0 =m0,x d1 =m1,x
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
43 vrev64.32 d17, d17
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
44 vld1.32 {d2}, [r4,:64]! @ d2=c0,c1
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
45 vmul.f32 d6, d17, d2
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
46 vld1.32 {d3}, [r5,:64]! @ d3=s0,s1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
47 vmul.f32 d7, d0, d2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
48 1:
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
49 subs lr, lr, #2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
50 ldr r6, [r3], #4
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
51 vmul.f32 d4, d0, d3
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
52 vmul.f32 d5, d17, d3
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
53 vsub.f32 d4, d6, d4
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
54 vadd.f32 d5, d5, d7
10172
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
55 uxth r8, r6, ror #16
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
56 uxth r6, r6
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
57 add r8, r1, r8, lsl #3
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
58 add r6, r1, r6, lsl #3
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
59 beq 1f
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
60 vld2.32 {d16-d17},[r7,:128],r12
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
61 vld2.32 {d0-d1}, [r2,:128]!
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
62 vrev64.32 d17, d17
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
63 vld1.32 {d2}, [r4,:64]!
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
64 vmul.f32 d6, d17, d2
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
65 vld1.32 {d3}, [r5,:64]!
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
66 vmul.f32 d7, d0, d2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
67 vst2.32 {d4[0],d5[0]}, [r6,:64]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
68 vst2.32 {d4[1],d5[1]}, [r8,:64]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
69 b 1b
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
70 1:
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
71 vst2.32 {d4[0],d5[0]}, [r6,:64]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
72 vst2.32 {d4[1],d5[1]}, [r8,:64]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
73
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
74 mov r4, r0
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
75 mov r6, r1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
76 add r0, r0, #16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
77 bl ff_fft_calc_neon
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
78
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
79 mov r12, #1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
80 ldr lr, [r4, #4] @ nbits
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
81 ldr r5, [r4, #12] @ tsin
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
82 ldr r4, [r4, #8] @ tcos
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
83 lsl r12, r12, lr @ n = 1 << nbits
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
84 lsr lr, r12, #3 @ n8 = n >> 3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
85
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
86 add r4, r4, lr, lsl #2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
87 add r5, r5, lr, lsl #2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
88 add r6, r6, lr, lsl #3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
89 sub r1, r4, #8
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
90 sub r2, r5, #8
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
91 sub r3, r6, #16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
92
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
93 mov r7, #-16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
94 mov r12, #-8
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
95 mov r8, r6
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
96 mov r0, r3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
97
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
98 vld2.32 {d0-d1}, [r3,:128], r7 @ d0 =i1,r1 d1 =i0,r0
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
99 vld2.32 {d20-d21},[r6,:128]! @ d20=i2,r2 d21=i3,r3
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
100 vld1.32 {d18}, [r2,:64], r12 @ d18=s1,s0
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
101 1:
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
102 subs lr, lr, #2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
103 vmul.f32 d7, d0, d18
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
104 vld1.32 {d19}, [r5,:64]! @ d19=s2,s3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
105 vmul.f32 d4, d1, d18
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
106 vld1.32 {d16}, [r1,:64], r12 @ d16=c1,c0
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
107 vmul.f32 d5, d21, d19
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
108 vld1.32 {d17}, [r4,:64]! @ d17=c2,c3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
109 vmul.f32 d6, d20, d19
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
110 vmul.f32 d22, d1, d16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
111 vmul.f32 d23, d21, d17
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
112 vmul.f32 d24, d0, d16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
113 vmul.f32 d25, d20, d17
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
114 vadd.f32 d7, d7, d22
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
115 vadd.f32 d6, d6, d23
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
116 vsub.f32 d4, d4, d24
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
117 vsub.f32 d5, d5, d25
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
118 beq 1f
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
119 vld2.32 {d0-d1}, [r3,:128], r7
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
120 vld2.32 {d20-d21},[r6,:128]!
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
121 vld1.32 {d18}, [r2,:64], r12
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
122 vrev64.32 q3, q3
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
123 vst2.32 {d4,d6}, [r0,:128], r7
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
124 vst2.32 {d5,d7}, [r8,:128]!
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
125 b 1b
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
126 1:
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
127 vrev64.32 q3, q3
10160
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
128 vst2.32 {d4,d6}, [r0,:128]
75bab19c59a2 ARM: faster NEON IMDCT
mru
parents: 10153
diff changeset
129 vst2.32 {d5,d7}, [r8,:128]
10153
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
130
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
131 pop {r4-r8,pc}
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
132 .endfunc
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
133
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
134 function ff_imdct_calc_neon, export=1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
135 push {r4-r6,lr}
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
136
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
137 ldr r3, [r0, #4]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
138 mov r4, #1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
139 mov r5, r1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
140 lsl r4, r4, r3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
141 add r1, r1, r4
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
142
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
143 bl ff_imdct_half_neon
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
144
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
145 add r0, r5, r4, lsl #2
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
146 add r1, r5, r4, lsl #1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
147 sub r0, r0, #8
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
148 sub r2, r1, #16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
149 mov r3, #-16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
150 mov r6, #-8
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
151 vmov.i32 d30, #1<<31
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
152 1:
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
153 vld1.32 {d0-d1}, [r2,:128], r3
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
154 pld [r0, #-16]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
155 vrev64.32 q0, q0
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
156 vld1.32 {d2-d3}, [r1,:128]!
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
157 veor d4, d1, d30
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
158 pld [r2, #-16]
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
159 vrev64.32 q1, q1
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
160 veor d5, d0, d30
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
161 vst1.32 {d2}, [r0,:64], r6
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
162 vst1.32 {d3}, [r0,:64], r6
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
163 vst1.32 {d4-d5}, [r5,:128]!
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
164 subs r4, r4, #16
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
165 bgt 1b
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
166
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
167 pop {r4-r6,pc}
7a63015e4627 ARM: NEON optimised FFT and MDCT
mru
parents:
diff changeset
168 .endfunc
10162
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
169
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
170 function ff_mdct_calc_neon, export=1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
171 push {r4-r10,lr}
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
172
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
173 mov r12, #1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
174 ldr lr, [r0, #4] @ nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
175 ldr r4, [r0, #8] @ tcos
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
176 ldr r5, [r0, #12] @ tsin
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
177 ldr r3, [r0, #24] @ revtab
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
178 lsl lr, r12, lr @ n = 1 << nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
179 add r7, r2, lr @ in4u
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
180 sub r9, r7, #16 @ in4d
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
181 add r2, r7, lr, lsl #1 @ in3u
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
182 add r8, r9, lr, lsl #1 @ in3d
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
183 mov r12, #-16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
184
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
185 vld2.32 {d16,d18},[r9,:128],r12 @ x,x in4d1,in4d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
186 vld2.32 {d17,d19},[r8,:128],r12 @ x,x in3d1,in3d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
187 vld2.32 {d20,d21},[r7,:128]! @ in4u0,in4u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
188 vrev64.32 q9, q9 @ in4d0,in4d1 in3d0,in3d1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
189 vld2.32 {d0, d1}, [r2,:128]! @ in3u0,in3u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
190 vsub.f32 d20, d18, d20 @ in4d-in4u I
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
191 vld1.32 {d2}, [r4,:64]! @ c0,c1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
192 vadd.f32 d0, d0, d19 @ in3u+in3d -R
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
193 vld1.32 {d3}, [r5,:64]! @ s0,s1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
194 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
195 vmul.f32 d7, d20, d3 @ I*s
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
196 vmul.f32 d6, d0, d2 @ -R*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
197 ldr r6, [r3], #4
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
198 vmul.f32 d4, d0, d3 @ -R*s
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
199 vmul.f32 d5, d20, d2 @ I*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
200 subs lr, lr, #16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
201 vsub.f32 d6, d6, d7 @ -R*c-I*s
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
202 vadd.f32 d7, d4, d5 @ -R*s+I*c
10172
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
203 uxth r10, r6, ror #16
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
204 uxth r6, r6
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
205 add r10, r1, r10, lsl #3
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
206 add r6, r1, r6, lsl #3
10162
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
207 beq 1f
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
208 vld2.32 {d16,d18},[r9,:128],r12 @ x,x in4d1,in4d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
209 vld2.32 {d17,d19},[r8,:128],r12 @ x,x in3d1,in3d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
210 vneg.f32 d7, d7 @ R*s-I*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
211 vld2.32 {d20,d21},[r7,:128]! @ in4u0,in4u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
212 vrev64.32 q9, q9 @ in4d0,in4d1 in3d0,in3d1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
213 vld2.32 {d0, d1}, [r2,:128]! @ in3u0,in3u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
214 vsub.f32 d20, d18, d20 @ in4d-in4u I
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
215 vld1.32 {d2}, [r4,:64]! @ c0,c1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
216 vadd.f32 d0, d0, d19 @ in3u+in3d -R
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
217 vld1.32 {d3}, [r5,:64]! @ s0,s1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
218 vst2.32 {d6[0],d7[0]}, [r6,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
219 vst2.32 {d6[1],d7[1]}, [r10,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
220 b 1b
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
221 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
222 vneg.f32 d7, d7 @ R*s-I*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
223 vst2.32 {d6[0],d7[0]}, [r6,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
224 vst2.32 {d6[1],d7[1]}, [r10,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
225
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
226 mov r12, #1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
227 ldr lr, [r0, #4] @ nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
228 lsl lr, r12, lr @ n = 1 << nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
229 sub r8, r2, #16 @ in1d
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
230 add r2, r9, #16 @ in0u
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
231 sub r9, r7, #16 @ in2d
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
232 mov r12, #-16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
233
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
234 vld2.32 {d16,d18},[r9,:128],r12 @ x,x in2d1,in2d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
235 vld2.32 {d17,d19},[r8,:128],r12 @ x,x in1d1,in1d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
236 vld2.32 {d20,d21},[r7,:128]! @ in2u0,in2u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
237 vrev64.32 q9, q9 @ in2d0,in2d1 in1d0,in1d1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
238 vld2.32 {d0, d1}, [r2,:128]! @ in0u0,in0u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
239 vsub.f32 d0, d0, d18 @ in0u-in2d R
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
240 vld1.32 {d2}, [r4,:64]! @ c0,c1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
241 vadd.f32 d20, d20, d19 @ in2u+in1d -I
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
242 vld1.32 {d3}, [r5,:64]! @ s0,s1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
243 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
244 vmul.f32 d6, d0, d2 @ R*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
245 vmul.f32 d7, d20, d3 @ -I*s
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
246 ldr r6, [r3], #4
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
247 vmul.f32 d4, d0, d3 @ R*s
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
248 vmul.f32 d5, d20, d2 @ I*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
249 subs lr, lr, #16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
250 vsub.f32 d6, d7, d6 @ I*s-R*c
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
251 vadd.f32 d7, d4, d5 @ R*s-I*c
10172
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
252 uxth r10, r6, ror #16
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
253 uxth r6, r6
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
254 add r10, r1, r10, lsl #3
eda985c53dba ARM: 10l: fix large FFTs
mru
parents: 10162
diff changeset
255 add r6, r1, r6, lsl #3
10162
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
256 beq 1f
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
257 vld2.32 {d16,d18},[r9,:128],r12 @ x,x in2d1,in2d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
258 vld2.32 {d17,d19},[r8,:128],r12 @ x,x in1d1,in1d0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
259 vld2.32 {d20,d21},[r7,:128]! @ in2u0,in2u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
260 vrev64.32 q9, q9 @ in2d0,in2d1 in1d0,in1d1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
261 vld2.32 {d0, d1}, [r2,:128]! @ in0u0,in0u1 x,x
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
262 vsub.f32 d0, d0, d18 @ in0u-in2d R
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
263 vld1.32 {d2}, [r4,:64]! @ c0,c1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
264 vadd.f32 d20, d20, d19 @ in2u+in1d -I
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
265 vld1.32 {d3}, [r5,:64]! @ s0,s1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
266 vst2.32 {d6[0],d7[0]}, [r6,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
267 vst2.32 {d6[1],d7[1]}, [r10,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
268 b 1b
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
269 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
270 vst2.32 {d6[0],d7[0]}, [r6,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
271 vst2.32 {d6[1],d7[1]}, [r10,:64]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
272
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
273 mov r4, r0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
274 mov r6, r1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
275 add r0, r0, #16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
276 bl ff_fft_calc_neon
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
277
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
278 mov r12, #1
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
279 ldr lr, [r4, #4] @ nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
280 ldr r5, [r4, #12] @ tsin
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
281 ldr r4, [r4, #8] @ tcos
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
282 lsl r12, r12, lr @ n = 1 << nbits
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
283 lsr lr, r12, #3 @ n8 = n >> 3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
284
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
285 add r4, r4, lr, lsl #2
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
286 add r5, r5, lr, lsl #2
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
287 add r6, r6, lr, lsl #3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
288 sub r1, r4, #8
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
289 sub r2, r5, #8
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
290 sub r3, r6, #16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
291
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
292 mov r7, #-16
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
293 mov r12, #-8
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
294 mov r8, r6
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
295 mov r0, r3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
296
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
297 vld2.32 {d0-d1}, [r3,:128], r7 @ d0 =r1,i1 d1 =r0,i0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
298 vld2.32 {d20-d21},[r6,:128]! @ d20=r2,i2 d21=r3,i3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
299 vld1.32 {d18}, [r2,:64], r12 @ d18=s1,s0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
300 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
301 subs lr, lr, #2
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
302 vmul.f32 d7, d0, d18 @ r1*s1,r0*s0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
303 vld1.32 {d19}, [r5,:64]! @ s2,s3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
304 vmul.f32 d4, d1, d18 @ i1*s1,i0*s0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
305 vld1.32 {d16}, [r1,:64], r12 @ c1,c0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
306 vmul.f32 d5, d21, d19 @ i2*s2,i3*s3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
307 vld1.32 {d17}, [r4,:64]! @ c2,c3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
308 vmul.f32 d6, d20, d19 @ r2*s2,r3*s3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
309 vmul.f32 d24, d0, d16 @ r1*c1,r0*c0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
310 vmul.f32 d25, d20, d17 @ r2*c2,r3*c3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
311 vmul.f32 d22, d21, d17 @ i2*c2,i3*c3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
312 vmul.f32 d23, d1, d16 @ i1*c1,i0*c0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
313 vadd.f32 d4, d4, d24 @ i1*s1+r1*c1,i0*s0+r0*c0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
314 vadd.f32 d5, d5, d25 @ i2*s2+r2*c2,i3*s3+r3*c3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
315 vsub.f32 d6, d22, d6 @ i2*c2-r2*s2,i3*c3-r3*s3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
316 vsub.f32 d7, d23, d7 @ i1*c1-r1*s1,i0*c0-r0*s0
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
317 vneg.f32 q2, q2
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
318 beq 1f
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
319 vld2.32 {d0-d1}, [r3,:128], r7
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
320 vld2.32 {d20-d21},[r6,:128]!
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
321 vld1.32 {d18}, [r2,:64], r12
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
322 vrev64.32 q3, q3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
323 vst2.32 {d4,d6}, [r0,:128], r7
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
324 vst2.32 {d5,d7}, [r8,:128]!
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
325 b 1b
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
326 1:
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
327 vrev64.32 q3, q3
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
328 vst2.32 {d4,d6}, [r0,:128]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
329 vst2.32 {d5,d7}, [r8,:128]
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
330
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
331 pop {r4-r10,pc}
8d369aee733f ARM: NEON optimised MDCT
mru
parents: 10160
diff changeset
332 .endfunc