2 @ Copyright (C) 2004 AGAWA Koji <i (AT) atty (DOT) jp>
4 @ This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
5 @ See http://libmpeg2.sourceforge.net/ for updates.
7 @ mpeg2dec is free software; you can redistribute it and/or modify
8 @ it under the terms of the GNU General Public License as published by
9 @ the Free Software Foundation; either version 2 of the License, or
10 @ (at your option) any later version.
12 @ mpeg2dec is distributed in the hope that it will be useful,
13 @ but WITHOUT ANY WARRANTY; without even the implied warranty of
14 @ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 @ GNU General Public License for more details.
17 @ You should have received a copy of the GNU General Public License
18 @ along with mpeg2dec; if not, write to the Free Software
19 @ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 @ ----------------------------------------------------------------
26 .global MC_put_o_16_arm
28 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
30 stmfd sp!, {r4-r11, lr} @ R14 is also called LR
32 adr r5, MC_put_o_16_arm_align_jt
33 add r5, r5, r4, lsl #2
36 MC_put_o_16_arm_align0:
43 bne MC_put_o_16_arm_align0
44 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
49 mov r9, r4, lsr #(\shift)
51 mov r10, r5, lsr #(\shift)
52 orr r9, r9, r5, lsl #(32-\shift)
53 mov r11, r6, lsr #(\shift)
54 orr r10, r10, r6, lsl #(32-\shift)
55 mov r12, r7, lsr #(\shift)
56 orr r11, r11, r7, lsl #(32-\shift)
57 orr r12, r12, r8, lsl #(32-\shift)
63 MC_put_o_16_arm_align1:
64 and r1, r1, #0xFFFFFFFC
67 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
68 MC_put_o_16_arm_align2:
69 and r1, r1, #0xFFFFFFFC
72 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
73 MC_put_o_16_arm_align3:
74 and r1, r1, #0xFFFFFFFC
77 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
78 MC_put_o_16_arm_align_jt:
79 .word MC_put_o_16_arm_align0
80 .word MC_put_o_16_arm_align1
81 .word MC_put_o_16_arm_align2
82 .word MC_put_o_16_arm_align3
84 @ ----------------------------------------------------------------
86 .global MC_put_o_8_arm
88 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
90 stmfd sp!, {r4-r10, lr} @ R14 is also called LR
92 adr r5, MC_put_o_8_arm_align_jt
93 add r5, r5, r4, lsl #2
95 MC_put_o_8_arm_align0:
102 bne MC_put_o_8_arm_align0
103 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
108 mov r9, r4, lsr #(\shift)
110 mov r10, r5, lsr #(\shift)
111 orr r9, r9, r5, lsl #(32-\shift)
112 orr r10, r10, r6, lsl #(32-\shift)
118 MC_put_o_8_arm_align1:
119 and r1, r1, #0xFFFFFFFC
122 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
124 MC_put_o_8_arm_align2:
125 and r1, r1, #0xFFFFFFFC
128 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
130 MC_put_o_8_arm_align3:
131 and r1, r1, #0xFFFFFFFC
134 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
136 MC_put_o_8_arm_align_jt:
137 .word MC_put_o_8_arm_align0
138 .word MC_put_o_8_arm_align1
139 .word MC_put_o_8_arm_align2
140 .word MC_put_o_8_arm_align3
142 @ ----------------------------------------------------------------
143 .macro AVG_PW rW1, rW2
144 mov \rW2, \rW2, lsl #24
145 orr \rW2, \rW2, \rW1, lsr #8
149 add \rW2, \rW2, r10, lsr #1
155 .global MC_put_x_16_arm
157 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
159 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
161 adr r5, MC_put_x_16_arm_align_jt
164 add r5, r5, r4, lsl #2
167 .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4
168 mov \R0, \R0, lsr #(\shift)
169 orr \R0, \R0, \R1, lsl #(32 - \shift)
170 mov \R1, \R1, lsr #(\shift)
171 orr \R1, \R1, \R2, lsl #(32 - \shift)
172 mov \R2, \R2, lsr #(\shift)
173 orr \R2, \R2, \R3, lsl #(32 - \shift)
174 mov \R3, \R3, lsr #(\shift)
175 orr \R3, \R3, \R4, lsl #(32 - \shift)
176 mov \R4, \R4, lsr #(\shift)
177 @ and \R4, \R4, #0xFF
180 MC_put_x_16_arm_align0:
191 bne MC_put_x_16_arm_align0
192 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
193 MC_put_x_16_arm_align1:
194 and r1, r1, #0xFFFFFFFC
198 ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8
207 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
208 MC_put_x_16_arm_align2:
209 and r1, r1, #0xFFFFFFFC
213 ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8
222 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
223 MC_put_x_16_arm_align3:
224 and r1, r1, #0xFFFFFFFC
228 ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8
237 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
238 MC_put_x_16_arm_align_jt:
240 .word MC_put_x_16_arm_align0
241 .word MC_put_x_16_arm_align1
242 .word MC_put_x_16_arm_align2
243 .word MC_put_x_16_arm_align3
245 @ ----------------------------------------------------------------
247 .global MC_put_x_8_arm
249 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
251 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
253 adr r5, MC_put_x_8_arm_align_jt
256 add r5, r5, r4, lsl #2
259 .macro ADJ_ALIGN_DW shift, R0, R1, R2
260 mov \R0, \R0, lsr #(\shift)
261 orr \R0, \R0, \R1, lsl #(32 - \shift)
262 mov \R1, \R1, lsr #(\shift)
263 orr \R1, \R1, \R2, lsl #(32 - \shift)
264 mov \R2, \R2, lsr #(\shift)
265 @ and \R4, \R4, #0xFF
268 MC_put_x_8_arm_align0:
277 bne MC_put_x_8_arm_align0
278 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
279 MC_put_x_8_arm_align1:
280 and r1, r1, #0xFFFFFFFC
284 ADJ_ALIGN_DW 8, r4, r5, r6
291 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
292 MC_put_x_8_arm_align2:
293 and r1, r1, #0xFFFFFFFC
297 ADJ_ALIGN_DW 16, r4, r5, r6
304 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
305 MC_put_x_8_arm_align3:
306 and r1, r1, #0xFFFFFFFC
310 ADJ_ALIGN_DW 24, r4, r5, r6
317 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
318 MC_put_x_8_arm_align_jt:
320 .word MC_put_x_8_arm_align0
321 .word MC_put_x_8_arm_align1
322 .word MC_put_x_8_arm_align2
323 .word MC_put_x_8_arm_align3