pvmp3_polyphase_filter_window_gcc.s revision 97e3e847179c17eb9059fb322413b6facd3e5a03
1@ ------------------------------------------------------------------
2@ Copyright (C) 1998-2009 PacketVideo
3@
4@ Licensed under the Apache License, Version 2.0 (the "License");
5@ you may not use this file except in compliance with the License.
6@ You may obtain a copy of the License at
7@
8@      http://www.apache.org/licenses/LICENSE-2.0
9@
10@ Unless required by applicable law or agreed to in writing, software
11@ distributed under the License is distributed on an "AS IS" BASIS,
12@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13@ express or implied.
14@ See the License for the specific language governing permissions
15@ and limitations under the License.
16@ -------------------------------------------------------------------
17
18@
19@
20@   Filename: pvmp3_polyphase_filter_window.s
21@
22@------------------------------------------------------------------------------
23@ REVISION HISTORY
24@
25@
26@ Who:                                   Date: MM/DD/YYYY
27@ Description:
28@
29@------------------------------------------------------------------------------
30
31.arm
32
33.align 4
34
35.text
36
37.extern pqmfSynthWin
38.hidden pqmfSynthWin
39
40
41
42@------------------------------------------------------------------------------
43
44.global pvmp3_polyphase_filter_window
45
46pvmp3_polyphase_filter_window:
47        stmfd    sp!,{r0-r2,r4-r11,lr}
48
49        sub      sp,sp,#4
50        adr      r2,PolyPh_filter_coeff
51        ldr      r1,[r2]
52        add      r1,r2
53        ldr      r2,[sp,#0xc]
54
55        sub      r2,r2,#1
56        mov      r10,#1
57        str      r2,[sp]
58
59@ Accumulators r9, r11::> Initialization
60
61Loop_j:
62        mov      r9,  #0x20
63        mov      r11, #0x20
64        mov      r4,  #0x10
65Loop_i:
66        add      r2,r4,r10
67        add      r3,r0,r2,lsl #2
68        sub      r2,r4,r10
69        ldr      r5,[r3]
70        ldr      lr,[r1]
71        add      r12,r0,r2,lsl #2
72        ldr      r6,[r12,#0x780]
73        smlal    r2,r9,lr,r5
74        smlal    r2,r11,lr,r6
75        ldr      r2,[r1,#4]
76        ldr      r7,[r12,#0x80]
77        smlal    r5,r11,r2,r5
78        smull    r6,r5,r2,r6
79        sub      r9,r9,r5
80        ldr      r5,[r1,#8]
81        ldr      r8,[r3,#0x700]
82        add      r4,r4,#0x200
83        smlal    r6,r9,r5,r7
84        smull    r6,r2,r5,r8
85        ldr      r5,[r1,#0xc]
86        sub      r11,r11,r2
87        smlal    r8,r9,r5,r8
88        smlal    r7,r11,r5,r7
89        ldr      r5,[r3,#0x100]
90        ldr      r2,[r1,#0x10]
91        ldr      r6,[r12,#0x680]
92        smlal    lr,r9,r2,r5
93        smlal    lr,r11,r2,r6
94        ldr      r2,[r1,#0x14]
95        ldr      r7,[r12,#0x180]
96        smlal    r5,r11,r2,r5
97        smull    r6,r5,r2,r6
98        ldr      r6,[r1,#0x18]
99        ldr      r8,[r3,#0x600]
100        sub      r9,r9,r5
101        smlal    r5,r9,r6,r7
102        smull    r2,r5,r6,r8
103        ldr      r6,[r1,#0x1c]
104        sub      r11,r11,r5
105        smlal    r8,r9,r6,r8
106        ldr      r2,[r1,#0x20]
107        ldr      r5,[r3,#0x200]
108        smlal    r7,r11,r6,r7
109        ldr      r6,[r12,#0x580]
110        smlal    lr,r9,r2,r5
111        smlal    lr,r11,r2,r6
112        ldr      r2,[r1,#0x24]
113        ldr      r7,[r12,#0x280]
114        smlal    r5,r11,r2,r5
115        smull    r6,r5,r2,r6
116        ldr      r6,[r1,#0x28]
117        ldr      r8,[r3,#0x500]
118        sub      r9,r9,r5
119        smlal    r5,r9,r6,r7
120        smull    r2,r5,r6,r8
121        ldr      r6,[r1,#0x2c]
122        sub      r11,r11,r5
123
124        smlal    r8,r9,r6,r8
125        smlal    r7,r11,r6,r7
126        ldr      r5,[r3,#0x300]
127        ldr      r8,[r1,#0x30]
128        ldr      r6,[r12,#0x480]
129        smlal    r7,r9,r8,r5
130        smlal    r7,r11,r8,r6
131        ldr      r8,[r1,#0x34]
132        ldr      r12,[r12,#0x380]
133        smlal    r5,r11,r8,r5
134        smull    r6,r5,r8,r6
135        ldr      r6,[r1,#0x38]
136
137
138        ldr      r3,[r3,#0x400]
139        sub      r9,r9,r5
140        smlal    r7,r9,r6,r12
141        smull    r8,r7,r6,r3
142        cmp      r4,#0x210
143        sub      r11,r11,r7
144
145        ldr      r2,[r1,#0x3c]
146        add      r1,r1,#0x40
147        smlal    r3,r9,r2,r3
148        smlal    r12,r11,r2,r12
149
150        blt      Loop_i
151
152        mov      r3,r9, asr #6
153        mov      r4,r3, asr #15
154        teq      r4,r3, asr #31
155        ldr      r12,LOW_16BITS
156        ldr      r2,[sp]
157        eorne    r3,r12,r3,asr #31
158        ldr      r4,[sp,#8]
159        mov      r2,r10,lsl r2
160        add      r4,r4,r2,lsl #1
161        strh     r3,[r4]
162
163        mov      r3,r11,asr #6
164        mov      r4,r3,asr #15
165        teq      r4,r3,asr #31
166        eorne    r3,r12,r3,asr #31
167        ldr      r12,[sp,#0xc]
168        ldr      r11,[sp,#8]
169        rsb      r2,r2,r12,lsl #5
170        add      r2,r11,r2,lsl #1
171        strh     r3,[r2]
172
173        add      r10,r10,#1
174        cmp      r10,#0x10
175        blt      Loop_j
176
177@ Accumulators r4, r5 Initialization
178
179        mov      r4,#0x20
180        mov      r5,#0x20
181        mov      r3,#0x10
182PolyPh_filter_loop2:
183        add      r2,r0,r3,lsl #2
184        ldr      r12,[r2]
185        ldr      r8,[r1]
186        ldr      r6,[r2,#0x80]
187        smlal    r12,r4,r8,r12
188        ldr      r12,[r1,#4]
189        ldr      r7,[r2,#0x40]
190        smlal    r6,r4,r12,r6
191
192        ldr      r12,[r1,#8]
193        ldr      r6,[r2,#0x180]
194        smlal    r7,r5,r12,r7
195        ldr      r12,[r2,#0x100]
196        ldr      r7,[r1,#0xc]
197        ldr      r2,[r2,#0x140]
198        smlal    r12,r4,r7,r12
199        ldr      r12,[r1,#0x10]
200        add      r3,r3,#0x80
201        smlal    r6,r4,r12,r6
202        ldr      r6,[r1,#0x14]
203        cmp      r3,#0x210
204        smlal    r2,r5,r6,r2
205        add      r1,r1,#0x18
206
207        blt      PolyPh_filter_loop2
208        mov      r0,r4,asr #6
209        mov      r2,r0,asr #15
210        teq      r2,r0,asr #31
211        ldrne    r12,LOW_16BITS
212        ldr      r1,[sp,#8]
213        eorne    r0,r12,r0,asr #31
214        strh     r0,[r1,#0]
215        mov      r0,r5,asr #6
216        mov      r2,r0,asr #15
217        teq      r2,r0,asr #31
218        ldrne    r12,LOW_16BITS
219        ldr      r2,[sp]
220        mov      r1,#0x10
221        eorne    r0,r12,r0,asr #31
222        ldr      r12,[sp,#8]
223        mov      r1,r1,lsl r2
224        add      r1,r12,r1,lsl #1
225        strh     r0,[r1]
226        add      sp,sp,#0x10
227        ldmfd    sp!,{r4-r11,pc}
228
229PolyPh_filter_coeff:
230        .word      pqmfSynthWin-PolyPh_filter_coeff
231LOW_16BITS:
232        .word      0x00007fff
233
234