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 #include "config.h" /* Rockbox: ARM architecture version */
27 @ ----------------------------------------------------------------
31 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
33 stmfd sp!, {r4-r7, lr} @ R14 is also called LR
35 ldr pc, [pc, r4, lsl #2]
37 .word MC_put_o_16_align0
38 .word MC_put_o_16_align1
39 .word MC_put_o_16_align2
40 .word MC_put_o_16_align3
49 bne MC_put_o_16_align0
50 ldmpc regs=r4-r7 @@ update PC with LR content.
52 .macro ADJ_ALIGN_QW shift, R0, R1, R2, R3, R4
53 mov \R0, \R0, lsr #(\shift)
54 orr \R0, \R0, \R1, lsl #(32 - \shift)
55 mov \R1, \R1, lsr #(\shift)
56 orr \R1, \R1, \R2, lsl #(32 - \shift)
57 mov \R2, \R2, lsr #(\shift)
58 orr \R2, \R2, \R3, lsl #(32 - \shift)
59 mov \R3, \R3, lsr #(\shift)
60 orr \R3, \R3, \R4, lsl #(32 - \shift)
61 mov \R4, \R4, lsr #(\shift)
65 and r1, r1, #0xFFFFFFFC
66 1: ldmia r1, {r4-r7, r12}
69 ADJ_ALIGN_QW 8, r4, r5, r6, r7, r12
74 ldmpc regs=r4-r7 @@ update PC with LR content.
77 and r1, r1, #0xFFFFFFFC
78 1: ldmia r1, {r4-r7, r12}
81 ADJ_ALIGN_QW 16, r4, r5, r6, r7, r12
86 ldmpc regs=r4-r7 @@ update PC with LR content.
89 and r1, r1, #0xFFFFFFFC
90 1: ldmia r1, {r4-r7, r12}
93 ADJ_ALIGN_QW 24, r4, r5, r6, r7, r12
98 ldmpc regs=r4-r7 @@ update PC with LR content.
100 @ ----------------------------------------------------------------
104 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
106 stmfd sp!, {r4, r5, lr} @ R14 is also called LR
108 ldr pc, [pc, r4, lsl #2]
110 .word MC_put_o_8_align0
111 .word MC_put_o_8_align1
112 .word MC_put_o_8_align2
113 .word MC_put_o_8_align3
122 bne MC_put_o_8_align0
123 ldmpc regs=r4-r5 @@ update PC with LR content.
125 .macro ADJ_ALIGN_DW shift, R0, R1, R2
126 mov \R0, \R0, lsr #(\shift)
127 orr \R0, \R0, \R1, lsl #(32 - \shift)
128 mov \R1, \R1, lsr #(\shift)
129 orr \R1, \R1, \R2, lsl #(32 - \shift)
130 mov \R2, \R2, lsr #(\shift)
134 and r1, r1, #0xFFFFFFFC
135 1: ldmia r1, {r4, r5, r12}
138 ADJ_ALIGN_DW 8, r4, r5, r12
143 ldmpc regs=r4-r5 @@ update PC with LR content.
146 and r1, r1, #0xFFFFFFFC
147 1: ldmia r1, {r4, r5, r12}
150 ADJ_ALIGN_DW 16, r4, r5, r12
155 ldmpc regs=r4-r5 @@ update PC with LR content.
158 and r1, r1, #0xFFFFFFFC
159 1: ldmia r1, {r4, r5, r12}
162 ADJ_ALIGN_DW 24, r4, r5, r12
167 ldmpc regs=r4-r5 @@ update PC with LR content.
169 @ ----------------------------------------------------------------
170 .macro AVG_PW rW1, rW2
171 mov \rW2, \rW2, lsl #24
172 orr \rW2, \rW2, \rW1, lsr #8
175 uhadd8 \rW2, \rW1, \rW2
179 add \rW2, \rW2, r10, lsr #1
186 #define HIGHEST_REG r9
188 #define HIGHEST_REG r11
194 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
196 stmfd sp!, {r4-HIGHEST_REG, lr} @ R14 is also called LR
202 ldr pc, [pc, r4, lsl #2]
204 .word MC_put_x_16_align0
205 .word MC_put_x_16_align1
206 .word MC_put_x_16_align2
207 .word MC_put_x_16_align3
220 bne MC_put_x_16_align0
221 ldmpc regs=r4-HIGHEST_REG @@ update PC with LR content.
224 and r1, r1, #0xFFFFFFFC
228 ADJ_ALIGN_QW 8, r4, r5, r6, r7, r8
237 ldmpc regs=r4-HIGHEST_REG @@ update PC with LR content.
240 and r1, r1, #0xFFFFFFFC
244 ADJ_ALIGN_QW 16, r4, r5, r6, r7, r8
253 ldmpc regs=r4-HIGHEST_REG @@ update PC with LR content.
256 and r1, r1, #0xFFFFFFFC
260 ADJ_ALIGN_QW 24, r4, r5, r6, r7, r8
269 ldmpc regs=r4-HIGHEST_REG @@ update PC with LR content.
271 @ ----------------------------------------------------------------
275 @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
277 stmfd sp!, {r6-HIGHEST_REG, lr} @ R14 is also called LR
283 ldr pc, [pc, r6, lsl #2]
285 .word MC_put_x_8_align0
286 .word MC_put_x_8_align1
287 .word MC_put_x_8_align2
288 .word MC_put_x_8_align3
299 bne MC_put_x_8_align0
300 ldmpc regs=r6-HIGHEST_REG @@ update PC with LR content.
303 and r1, r1, #0xFFFFFFFC
307 ADJ_ALIGN_DW 8, r6, r7, r8
314 ldmpc regs=r6-HIGHEST_REG @@ update PC with LR content.
317 and r1, r1, #0xFFFFFFFC
321 ADJ_ALIGN_DW 16, r6, r7, r8
328 ldmpc regs=r6-HIGHEST_REG @@ update PC with LR content.
331 and r1, r1, #0xFFFFFFFC
335 ADJ_ALIGN_DW 24, r6, r7, r8
342 ldmpc regs=r6-HIGHEST_REG @@ update PC with LR content.