• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@/******************************************************************************
2@ *
3@ * Copyright (C) 2018 The Android Open Source Project
4@ *
5@ * Licensed under the Apache License, Version 2.0 (the "License");
6@ * you may not use this file except in compliance with the License.
7@ * You may obtain a copy of the License at:
8@ *
9@ * http://www.apache.org/licenses/LICENSE-2.0
10@ *
11@ * Unless required by applicable law or agreed to in writing, software
12@ * distributed under the License is distributed on an "AS IS" BASIS,
13@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14@ * See the License for the specific language governing permissions and
15@ * limitations under the License.
16@ *
17@ *****************************************************************************
18@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19@*/
20
21
22.text
23.p2align 2
24 .extern ixheaacd_cos_sin_mod
25.hidden ixheaacd_cos_sin_mod
26 .global ixheaacd_fwd_modulation
27ixheaacd_fwd_modulation:
28
29    STMFD           sp!, {r3-r9, r12, lr}
30    MOV             r5, r2
31    LDR             r2, [sp, #0x24]
32    MOV             lr, r1
33    MOV             r4, r1
34    MOV             r1, #0x1f
35    MOV             r7, r5
36    ADD             r8, r0, #0xfc
37    MOV             r6, r3
38LOOP1:
39    LDR             r3, [r0], #4
40    LDR             r12, [r8], #-4
41
42    MOV             r3, r3, ASR #4
43    MOV             r12, r12, ASR #4
44
45    QSUB            r9, r3, r12
46    ADD             r3, r3, r12
47
48    STR             r9, [lr], #4
49    SUBS            r1, r1, #1
50    STR             r3, [r7], #4
51
52    BPL             LOOP1
53
54    MOV             r1, r6
55    MOV             r0, r4
56
57
58
59    MOV             r3, #0xd8
60    LSL             r3, r3, #4
61    ADD             r3, r3, #8
62
63    ADD             r3, r2, r3
64
65
66    ADD             r2, r3, #4
67
68
69
70    BL              ixheaacd_cos_sin_mod
71
72    LDRSH           r1, [r6, #0x2c]
73    LDRSH           r2, [r6, #0x2a]
74    LDR             r0, [r6, #0x18]
75    SUBS            r2, r1, r2
76
77@    LDMLEFD     sp!, {r3-r9, r12, pc}
78    LDMFDLE         sp!, {r3-r9, r12, pc}
79LOOP2:
80    LDR             r1, [r0], #4
81    LDR             r12, [r5, #0]
82    LDR             r3, [r4, #0]
83
84    SMULWT          r6, r12, r1
85    SMULWB          lr, r3, r1
86
87    SMULWB          r12, r12, r1
88    SMULWT          r1, r3, r1
89
90
91
92
93    ADD             lr, lr, r6
94    QSUB            r1, r12, r1
95    MOV             r3, lr, LSL #1
96    MOV             r1, r1, LSL #1
97    STR             r3, [r4], #4
98    SUBS            r2, r2, #1
99    STR             r1, [r5], #4
100    BGT             LOOP2
101
102    LDMFD           sp!, {r3-r9, r12, pc}
103