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
29 @ ----------------------------------------------------------------
31 .global MC_put_o_16_arm
33 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
35 stmfd sp!, {r4-r11, lr} @ R14 is also called LR
37 adr r5, MC_put_o_16_arm_align_jt
38 add r5, r5, r4, lsl #2
41 MC_put_o_16_arm_align0:
48 bne MC_put_o_16_arm_align0
49 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
54 mov r9, r4, lsr #(\shift)
56 mov r10, r5, lsr #(\shift)
57 orr r9, r9, r5, lsl #(32-\shift)
58 mov r11, r6, lsr #(\shift)
59 orr r10, r10, r6, lsl #(32-\shift)
60 mov r12, r7, lsr #(\shift)
61 orr r11, r11, r7, lsl #(32-\shift)
62 orr r12, r12, r8, lsl #(32-\shift)
68 MC_put_o_16_arm_align1:
69 and r1, r1, #0xFFFFFFFC
72 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
73 MC_put_o_16_arm_align2:
74 and r1, r1, #0xFFFFFFFC
77 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
78 MC_put_o_16_arm_align3:
79 and r1, r1, #0xFFFFFFFC
82 ldmfd sp!, {r4-r11, pc} @@ update PC with LR content.
83 MC_put_o_16_arm_align_jt:
84 .word MC_put_o_16_arm_align0
85 .word MC_put_o_16_arm_align1
86 .word MC_put_o_16_arm_align2
87 .word MC_put_o_16_arm_align3
89 @ ----------------------------------------------------------------
91 .global MC_put_o_8_arm
93 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
95 stmfd sp!, {r4-r10, lr} @ R14 is also called LR
97 adr r5, MC_put_o_8_arm_align_jt
98 add r5, r5, r4, lsl #2
100 MC_put_o_8_arm_align0:
107 bne MC_put_o_8_arm_align0
108 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
113 mov r9, r4, lsr #(\shift)
115 mov r10, r5, lsr #(\shift)
116 orr r9, r9, r5, lsl #(32-\shift)
117 orr r10, r10, r6, lsl #(32-\shift)
123 MC_put_o_8_arm_align1:
124 and r1, r1, #0xFFFFFFFC
127 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
129 MC_put_o_8_arm_align2:
130 and r1, r1, #0xFFFFFFFC
133 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
135 MC_put_o_8_arm_align3:
136 and r1, r1, #0xFFFFFFFC
139 ldmfd sp!, {r4-r10, pc} @@ update PC with LR content.
141 MC_put_o_8_arm_align_jt:
142 .word MC_put_o_8_arm_align0
143 .word MC_put_o_8_arm_align1
144 .word MC_put_o_8_arm_align2
145 .word MC_put_o_8_arm_align3
147 @ ----------------------------------------------------------------
148 .macro AVG_PW rW1, rW2
149 mov \rW2, \rW2, lsl #24
150 orr \rW2, \rW2, \rW1, lsr #8
154 add \rW2, \rW2, r10, lsr #1
160 .global MC_put_x_16_arm
162 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
164 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
166 adr r5, MC_put_x_16_arm_align_jt
169 add r5, r5, r4, lsl #2
172 .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4
173 mov \R0, \R0, lsr #(\shift)
174 orr \R0, \R0, \R1, lsl #(32 - \shift)
175 mov \R1, \R1, lsr #(\shift)
176 orr \R1, \R1, \R2, lsl #(32 - \shift)
177 mov \R2, \R2, lsr #(\shift)
178 orr \R2, \R2, \R3, lsl #(32 - \shift)
179 mov \R3, \R3, lsr #(\shift)
180 orr \R3, \R3, \R4, lsl #(32 - \shift)
181 mov \R4, \R4, lsr #(\shift)
182 @ and \R4, \R4, #0xFF
185 MC_put_x_16_arm_align0:
196 bne MC_put_x_16_arm_align0
197 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
198 MC_put_x_16_arm_align1:
199 and r1, r1, #0xFFFFFFFC
203 ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8
212 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
213 MC_put_x_16_arm_align2:
214 and r1, r1, #0xFFFFFFFC
218 ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8
227 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
228 MC_put_x_16_arm_align3:
229 and r1, r1, #0xFFFFFFFC
233 ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8
242 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
243 MC_put_x_16_arm_align_jt:
245 .word MC_put_x_16_arm_align0
246 .word MC_put_x_16_arm_align1
247 .word MC_put_x_16_arm_align2
248 .word MC_put_x_16_arm_align3
250 @ ----------------------------------------------------------------
252 .global MC_put_x_8_arm
254 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
256 stmfd sp!, {r4-r11,lr} @ R14 is also called LR
258 adr r5, MC_put_x_8_arm_align_jt
261 add r5, r5, r4, lsl #2
264 .macro ADJ_ALIGN_DW shift, R0, R1, R2
265 mov \R0, \R0, lsr #(\shift)
266 orr \R0, \R0, \R1, lsl #(32 - \shift)
267 mov \R1, \R1, lsr #(\shift)
268 orr \R1, \R1, \R2, lsl #(32 - \shift)
269 mov \R2, \R2, lsr #(\shift)
270 @ and \R4, \R4, #0xFF
273 MC_put_x_8_arm_align0:
282 bne MC_put_x_8_arm_align0
283 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
284 MC_put_x_8_arm_align1:
285 and r1, r1, #0xFFFFFFFC
289 ADJ_ALIGN_DW 8, r4, r5, r6
296 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
297 MC_put_x_8_arm_align2:
298 and r1, r1, #0xFFFFFFFC
302 ADJ_ALIGN_DW 16, r4, r5, r6
309 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
310 MC_put_x_8_arm_align3:
311 and r1, r1, #0xFFFFFFFC
315 ADJ_ALIGN_DW 24, r4, r5, r6
322 ldmfd sp!, {r4-r11,pc} @@ update PC with LR content.
323 MC_put_x_8_arm_align_jt:
325 .word MC_put_x_8_arm_align0
326 .word MC_put_x_8_arm_align1
327 .word MC_put_x_8_arm_align2
328 .word MC_put_x_8_arm_align3