Mercurial > libavcodec.hg
annotate arm/h264idct_neon.S @ 10382:d4d925400ba2 libavcodec
Warn when WVC1 cannot be decoded
author | kostya |
---|---|
date | Sun, 11 Oct 2009 05:36:59 +0000 |
parents | be725249ea67 |
children | 9cea4112ffaf |
rev | line source |
---|---|
8339 | 1 /* |
2 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com> | |
3 * | |
4 * This file is part of FFmpeg. | |
5 * | |
6 * FFmpeg is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU Lesser General Public | |
8 * License as published by the Free Software Foundation; either | |
9 * version 2.1 of the License, or (at your option) any later version. | |
10 * | |
11 * FFmpeg is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * Lesser General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU Lesser General Public | |
17 * License along with FFmpeg; if not, write to the Free Software | |
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
19 */ | |
20 | |
21 #include "asm.S" | |
22 | |
8462 | 23 preserve8 |
8339 | 24 .text |
25 | |
26 function ff_h264_idct_add_neon, export=1 | |
27 mov r3, #(1<<5) | |
28 vmov.i16 d16, #0 | |
29 vmov.16 d16[0], r3 | |
30 vld1.64 {d0-d3}, [r1,:128] | |
31 vadd.i16 d0, d0, d16 | |
32 | |
33 vswp d1, d2 | |
34 vadd.i16 d4, d0, d1 | |
35 vshr.s16 q8, q1, #1 | |
36 vsub.i16 d5, d0, d1 | |
37 vadd.i16 d6, d2, d17 | |
38 vsub.i16 d7, d16, d3 | |
39 vadd.i16 q0, q2, q3 | |
40 vsub.i16 q1, q2, q3 | |
41 | |
42 vtrn.16 d0, d1 | |
43 vtrn.16 d3, d2 | |
44 vtrn.32 d0, d3 | |
45 vtrn.32 d1, d2 | |
46 | |
47 vadd.i16 d4, d0, d3 | |
48 vld1.32 {d18[0]}, [r0,:32], r2 | |
49 vswp d1, d3 | |
50 vshr.s16 q8, q1, #1 | |
51 vld1.32 {d19[1]}, [r0,:32], r2 | |
52 vsub.i16 d5, d0, d1 | |
53 vld1.32 {d18[1]}, [r0,:32], r2 | |
54 vadd.i16 d6, d16, d3 | |
55 vld1.32 {d19[0]}, [r0,:32], r2 | |
56 vsub.i16 d7, d2, d17 | |
57 sub r0, r0, r2, lsl #2 | |
58 vadd.i16 q0, q2, q3 | |
59 vsub.i16 q1, q2, q3 | |
60 | |
61 vshr.s16 q0, q0, #6 | |
62 vshr.s16 q1, q1, #6 | |
63 | |
64 vaddw.u8 q0, q0, d18 | |
65 vaddw.u8 q1, q1, d19 | |
66 | |
67 vqmovun.s16 d0, q0 | |
68 vqmovun.s16 d1, q1 | |
69 | |
70 vst1.32 {d0[0]}, [r0,:32], r2 | |
71 vst1.32 {d1[1]}, [r0,:32], r2 | |
72 vst1.32 {d0[1]}, [r0,:32], r2 | |
73 vst1.32 {d1[0]}, [r0,:32], r2 | |
74 | |
75 bx lr | |
76 .endfunc | |
8340 | 77 |
78 function ff_h264_idct_dc_add_neon, export=1 | |
79 vld1.16 {d2[],d3[]}, [r1,:16] | |
80 vrshr.s16 q1, q1, #6 | |
81 vld1.32 {d0[0]}, [r0,:32], r2 | |
82 vld1.32 {d0[1]}, [r0,:32], r2 | |
83 vaddw.u8 q2, q1, d0 | |
84 vld1.32 {d1[0]}, [r0,:32], r2 | |
85 vld1.32 {d1[1]}, [r0,:32], r2 | |
86 vaddw.u8 q1, q1, d1 | |
87 vqmovun.s16 d0, q2 | |
88 vqmovun.s16 d1, q1 | |
89 sub r0, r0, r2, lsl #2 | |
90 vst1.32 {d0[0]}, [r0,:32], r2 | |
91 vst1.32 {d0[1]}, [r0,:32], r2 | |
92 vst1.32 {d1[0]}, [r0,:32], r2 | |
93 vst1.32 {d1[1]}, [r0,:32], r2 | |
94 bx lr | |
95 .endfunc | |
8462 | 96 |
97 function ff_h264_idct_add16_neon, export=1 | |
98 push {r4-r8,lr} | |
99 mov r4, r0 | |
100 mov r5, r1 | |
101 mov r1, r2 | |
102 mov r2, r3 | |
103 ldr r6, [sp, #24] | |
8507
779a9c93bf61
ARM: work around linker bug with movw/movt relocations in shared libs
mru
parents:
8462
diff
changeset
|
104 movrel r7, scan8 |
8462 | 105 mov ip, #16 |
106 1: ldrb r8, [r7], #1 | |
107 ldr r0, [r5], #4 | |
108 ldrb r8, [r6, r8] | |
109 subs r8, r8, #1 | |
110 blt 2f | |
111 ldrsh lr, [r1] | |
112 add r0, r0, r4 | |
113 movne lr, #0 | |
114 cmp lr, #0 | |
115 adrne lr, ff_h264_idct_dc_add_neon | |
116 adreq lr, ff_h264_idct_add_neon | |
117 blx lr | |
118 2: subs ip, ip, #1 | |
119 add r1, r1, #32 | |
120 bne 1b | |
121 pop {r4-r8,pc} | |
122 .endfunc | |
123 | |
124 function ff_h264_idct_add16intra_neon, export=1 | |
125 push {r4-r8,lr} | |
126 mov r4, r0 | |
127 mov r5, r1 | |
128 mov r1, r2 | |
129 mov r2, r3 | |
130 ldr r6, [sp, #24] | |
8507
779a9c93bf61
ARM: work around linker bug with movw/movt relocations in shared libs
mru
parents:
8462
diff
changeset
|
131 movrel r7, scan8 |
8462 | 132 mov ip, #16 |
133 1: ldrb r8, [r7], #1 | |
134 ldr r0, [r5], #4 | |
135 ldrb r8, [r6, r8] | |
136 add r0, r0, r4 | |
137 cmp r8, #0 | |
138 ldrsh r8, [r1] | |
139 adrne lr, ff_h264_idct_add_neon | |
140 adreq lr, ff_h264_idct_dc_add_neon | |
141 cmpeq r8, #0 | |
142 blxne lr | |
143 subs ip, ip, #1 | |
144 add r1, r1, #32 | |
145 bne 1b | |
146 pop {r4-r8,pc} | |
147 .endfunc | |
148 | |
149 function ff_h264_idct_add8_neon, export=1 | |
150 push {r4-r10,lr} | |
151 ldm r0, {r4,r9} | |
152 add r5, r1, #16*4 | |
153 add r1, r2, #16*32 | |
154 mov r2, r3 | |
155 ldr r6, [sp, #32] | |
8507
779a9c93bf61
ARM: work around linker bug with movw/movt relocations in shared libs
mru
parents:
8462
diff
changeset
|
156 movrel r7, scan8+16 |
8462 | 157 mov ip, #8 |
158 1: ldrb r8, [r7], #1 | |
159 ldr r0, [r5], #4 | |
160 ldrb r8, [r6, r8] | |
161 tst ip, #4 | |
162 addeq r0, r0, r4 | |
163 addne r0, r0, r9 | |
164 cmp r8, #0 | |
165 ldrsh r8, [r1] | |
166 adrne lr, ff_h264_idct_add_neon | |
167 adreq lr, ff_h264_idct_dc_add_neon | |
168 cmpeq r8, #0 | |
169 blxne lr | |
170 subs ip, ip, #1 | |
171 add r1, r1, #32 | |
172 bne 1b | |
173 pop {r4-r10,pc} | |
174 .endfunc | |
175 | |
176 .section .rodata | |
177 scan8: .byte 4+1*8, 5+1*8, 4+2*8, 5+2*8 | |
178 .byte 6+1*8, 7+1*8, 6+2*8, 7+2*8 | |
179 .byte 4+3*8, 5+3*8, 4+4*8, 5+4*8 | |
180 .byte 6+3*8, 7+3*8, 6+4*8, 7+4*8 | |
181 .byte 1+1*8, 2+1*8 | |
182 .byte 1+2*8, 2+2*8 | |
183 .byte 1+4*8, 2+4*8 | |
184 .byte 1+5*8, 2+5*8 |