• 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    .global ixheaacd_harm_idx_zerotwolp_armv7
25ixheaacd_harm_idx_zerotwolp_armv7:
26    STMFD           sp!, {r4-r12}
27    SUB             r5, r2, #1
28    MOV             r2, #-1
29    LDR             r6, [sp, #52]
30    LDR             r12, [sp, #48]
31    ADD             r10, sp, #36
32    LDR             r4, [sp, #44]
33    LDMIA           r10, {r9, r10}
34    CMP             r4, #0
35    BLE             EXIT
36    CMP             r12, #0
37    BNE             NO_NOISE
38
39
40
41LOOP1:
42    LDR             r12, [r0, #0]
43    LDRSH           r7, [r1], #2
44    LDRSH           r8, [r1], #2
45
46    ADD             r2, r2, #1
47    SMULWB          r7, r12, r7
48    SUBS            r8, r8, r5
49
50    LDRH            r12, [r3], #4
51    RSBLE           r8, r8, #0
52    MOVLE           r8, r7, ASR r8
53    MOVGT           r8, r7, LSL r8
54
55    MOVS            r12, r12, LSL #16
56    BEQ             NEXT
57
58    CMP             r6, #0
59    QADDEQ          r8, r8, r12
60    QSUBNE          r8, r8, r12
61    SUBS            r4, r4, #1
62    B               STORE
63
64NEXT:
65
66
67    LDR             r7, [r9, r2, LSL #2]
68    ADD             r12, r10, r2, LSL #2
69    LDRSH           r12, [r12, #0]
70    SUBS            r4, r4, #1
71    SMULTB          r7, r7, r12
72    ADD             r8, r8, r7, LSL #1
73
74STORE:
75    STR             r8, [r0], #4
76    BGT             LOOP1
77    B               EXIT
78
79
80NO_NOISE:
81
82LOOP2:
83    LDR             r12, [r0, #0]
84    LDRSH           r7, [r1], #2
85    LDRSH           r9, [r1], #2
86    LDRH            r10, [r3], #4
87
88    SMULWB          r7, r12, r7
89    SUBS            r9, r9, r5
90    RSBMI           r9, r9, #0
91
92    MOVMI           r12, r7, ASR r9
93    MOVPL           r12, r7, LSL r9
94
95    MOV             r7, r10, LSL #16
96
97    CMP             r6, #0
98    QADDEQ          r12, r12, r7
99    QSUBNE          r12, r12, r7
100
101    SUBS            r4, r4, #1
102    STR             r12, [r0], #4
103    BGT             LOOP2
104
105EXIT:
106    LDMFD           sp!, {r4-r12}
107    BX              lr
108
109
110