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 this program; if not, write to the Free Software
19 @ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 @ ----------------------------------------------------------------
25 .global MC_put_o_16_arm
27 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
29 stmfd sp!, {r4-r11, lr} @ R14 is also called LR
31 adr r5, MC_put_o_16_arm_align_jt
32 add r5, r5, r4, lsl #2
35 MC_put_o_16_arm_align0:
42 bne MC_put_o_16_arm_align0
43 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
48 mov r9, r4, lsr #(\shift)
50 mov r10, r5, lsr #(\shift)
51 orr r9, r9, r5, lsl #(32-\shift)
52 mov r11, r6, lsr #(\shift)
53 orr r10, r10, r6, lsl #(32-\shift)
54 mov r12, r7, lsr #(\shift)
55 orr r11, r11, r7, lsl #(32-\shift)
56 orr r12, r12, r8, lsl #(32-\shift)
62 MC_put_o_16_arm_align1:
63 and r1, r1, #0xFFFFFFFC
66 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
67 MC_put_o_16_arm_align2:
68 and r1, r1, #0xFFFFFFFC
71 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
72 MC_put_o_16_arm_align3:
73 and r1, r1, #0xFFFFFFFC
76 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
77 MC_put_o_16_arm_align_jt:
78 .word MC_put_o_16_arm_align0
79 .word MC_put_o_16_arm_align1
80 .word MC_put_o_16_arm_align2
81 .word MC_put_o_16_arm_align3
83 @ ----------------------------------------------------------------
85 .global MC_put_o_8_arm
87 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
89 stmfd sp!, {r4-r10, lr} @ R14 is also called LR
91 adr r5, MC_put_o_8_arm_align_jt
92 add r5, r5, r4, lsl #2
94 MC_put_o_8_arm_align0:
101 bne MC_put_o_8_arm_align0
102 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
107 mov r9, r4, lsr #(\shift)
109 mov r10, r5, lsr #(\shift)
110 orr r9, r9, r5, lsl #(32-\shift)
111 orr r10, r10, r6, lsl #(32-\shift)
117 MC_put_o_8_arm_align1:
118 and r1, r1, #0xFFFFFFFC
121 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
123 MC_put_o_8_arm_align2:
124 and r1, r1, #0xFFFFFFFC
127 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
129 MC_put_o_8_arm_align3:
130 and r1, r1, #0xFFFFFFFC
133 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
135 MC_put_o_8_arm_align_jt:
136 .word MC_put_o_8_arm_align0
137 .word MC_put_o_8_arm_align1
138 .word MC_put_o_8_arm_align2
139 .word MC_put_o_8_arm_align3
141 @ ----------------------------------------------------------------
142 .macro AVG_PW rW1, rW2
143 mov \rW2, \rW2, lsl #24
144 orr \rW2, \rW2, \rW1, lsr #8
148 add \rW2, \rW2, r10, lsr #1
154 .global MC_put_x_16_arm
156 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
158 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
160 adr r5, MC_put_x_16_arm_align_jt
163 add r5, r5, r4, lsl #2
166 .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4
167 mov \R0, \R0, lsr #(\shift)
168 orr \R0, \R0, \R1, lsl #(32 - \shift)
169 mov \R1, \R1, lsr #(\shift)
170 orr \R1, \R1, \R2, lsl #(32 - \shift)
171 mov \R2, \R2, lsr #(\shift)
172 orr \R2, \R2, \R3, lsl #(32 - \shift)
173 mov \R3, \R3, lsr #(\shift)
174 orr \R3, \R3, \R4, lsl #(32 - \shift)
175 mov \R4, \R4, lsr #(\shift)
176 @ and \R4, \R4, #0xFF
179 MC_put_x_16_arm_align0:
190 bne MC_put_x_16_arm_align0
191 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
192 MC_put_x_16_arm_align1:
193 and r1, r1, #0xFFFFFFFC
197 ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8
206 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
207 MC_put_x_16_arm_align2:
208 and r1, r1, #0xFFFFFFFC
212 ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8
221 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
222 MC_put_x_16_arm_align3:
223 and r1, r1, #0xFFFFFFFC
227 ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8
236 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
237 MC_put_x_16_arm_align_jt:
239 .word MC_put_x_16_arm_align0
240 .word MC_put_x_16_arm_align1
241 .word MC_put_x_16_arm_align2
242 .word MC_put_x_16_arm_align3
244 @ ----------------------------------------------------------------
246 .global MC_put_x_8_arm
248 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
250 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
252 adr r5, MC_put_x_8_arm_align_jt
255 add r5, r5, r4, lsl #2
258 .macro ADJ_ALIGN_DW shift, R0, R1, R2
259 mov \R0, \R0, lsr #(\shift)
260 orr \R0, \R0, \R1, lsl #(32 - \shift)
261 mov \R1, \R1, lsr #(\shift)
262 orr \R1, \R1, \R2, lsl #(32 - \shift)
263 mov \R2, \R2, lsr #(\shift)
264 @ and \R4, \R4, #0xFF
267 MC_put_x_8_arm_align0:
276 bne MC_put_x_8_arm_align0
277 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
278 MC_put_x_8_arm_align1:
279 and r1, r1, #0xFFFFFFFC
283 ADJ_ALIGN_DW 8, r4, r5, r6
290 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
291 MC_put_x_8_arm_align2:
292 and r1, r1, #0xFFFFFFFC
296 ADJ_ALIGN_DW 16, r4, r5, r6
303 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
304 MC_put_x_8_arm_align3:
305 and r1, r1, #0xFFFFFFFC
309 ADJ_ALIGN_DW 24, r4, r5, r6
316 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
317 MC_put_x_8_arm_align_jt:
319 .word MC_put_x_8_arm_align0
320 .word MC_put_x_8_arm_align1
321 .word MC_put_x_8_arm_align2
322 .word MC_put_x_8_arm_align3