summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/aacenc/src/asm/ARMV5E/PrePostMDCT_v5.s
blob: d4d3edb676e163cf9bbed2362a89a31e88c4e59d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@/*
@ ** Copyright 2003-2010, VisualOn, Inc.
@ **
@ ** Licensed under the Apache License, Version 2.0 (the "License");
@ ** you may not use this file except in compliance with the License.
@ ** You may obtain a copy of the License at
@ **
@ **     http://www.apache.org/licenses/LICENSE-2.0
@ **
@ ** Unless required by applicable law or agreed to in writing, software
@ ** distributed under the License is distributed on an "AS IS" BASIS,
@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ ** See the License for the specific language governing permissions and
@ ** limitations under the License.
@ */

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@	File:		PrePostMDCT_v5.s
@
@	Content:	premdct and postmdct function armv5 assemble
@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

	.section .text
	.global	PreMDCT

PreMDCT:
	stmdb       sp!, {r4 - r11, lr}
	
	add         r9, r0, r1, lsl #2
	sub         r3, r9, #8

	movs        r1, r1, asr #2
	beq         PreMDCT_END
	
PreMDCT_LOOP:
	ldr					r8, [r2], #4
	ldr					r9, [r2], #4
	
	ldrd				r4, [r0]
	ldrd				r6, [r3]
	
	smull				r14, r11, r4, r8					@ MULHIGH(tr1, cosa)
	smull    			r10, r12, r7, r8					@ MULHIGH(ti1, cosa)
		
	smull				r14, r8, r7, r9						@ MULHIGH(ti1, sina)
	smull				r7, r10, r4, r9						@ MULHIGH(tr1, sina)	
		
	add					r11, r11, r8						@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@	
	sub					r7, r12, r10						@ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)
	
	ldr					r8, [r2], #4
	ldr					r9, [r2], #4
	
	smull				r14, r4, r6, r8						@ MULHIGH(tr2, cosa)
	smull    			r10, r12, r5, r8					@ MULHIGH(ti2, cosa)
		
	smull				r14, r8, r5, r9						@ MULHIGH(ti2, sina)
	smull				r5, r10, r6, r9						@ MULHIGH(tr2, sina)
	
	add					r8, r8, r4
	sub					r9, r12, r10
	
	mov					r6, r11		

	strd				r6, [r0]	
	strd				r8, [r3]
	
	subs				r1, r1, #1
	sub					r3, r3, #8
	add 				r0, r0, #8
	bne					PreMDCT_LOOP

PreMDCT_END:
	ldmia       sp!, {r4 - r11, pc}
	@ENDP  @ |PreMDCT|
	
	.section .text
	.global	PostMDCT

PostMDCT:
	stmdb       sp!, {r4 - r11, lr}
	
	add         r9, r0, r1, lsl #2
	sub         r3, r9, #8

	movs        r1, r1, asr #2
	beq         PostMDCT_END
	
PostMDCT_LOOP:
	ldr					r8, [r2], #4					
	ldr					r9, [r2], #4
	
	ldrd				r4, [r0]
	ldrd				r6, [r3]
	
	smull				r14, r11, r4, r8					@ MULHIGH(tr1, cosa)
	smull    			r10, r12, r5, r8					@ MULHIGH(ti1, cosa)
		
	smull				r14, r8, r5, r9						@ MULHIGH(ti1, sina)
	smull				r5, r10, r4, r9						@ MULHIGH(tr1, sina)	
		
	add					r4, r11, r8							@ MULHIGH(cosa, tr1) + MULHIGH(sina, ti1)@	
	sub					r11, r10, r12						@ MULHIGH(ti1, cosa) - MULHIGH(tr1, sina)@
	
	ldr					r8, [r2], #4						@
	ldr					r9, [r2], #4
	
	smull				r14, r5, r6, r8						@ MULHIGH(tr2, cosa)
	smull    			r10, r12, r7, r8					@ MULHIGH(ti2, cosa)
		
	smull				r14, r8, r7, r9						@ MULHIGH(ti2, sina)
	smull				r7, r10, r6, r9						@ MULHIGH(tr2, sina)
	
	add					r6, r8, r5							@ MULHIGH(cosb, tr2) + MULHIGH(sinb, ti2)@
	sub					r5, r10, r12						@ MULHIGH(sinb, tr2) - MULHIGH(cosb, ti2)@
	
	mov					r7, r11				

	strd				r4, [r0]
	strd				r6, [r3]
	
	subs				r1, r1, #1
	sub					r3, r3, #8
	add 				r0, r0, #8
	bne					PostMDCT_LOOP

PostMDCT_END:
	ldmia       sp!, {r4 - r11, pc}
	@ENDP  @ |PostMDCT|
	.end