9693
|
1 /*
|
|
2 * Copyright (c) 2009 David Conrad
|
|
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
|
|
23 .macro vp3_loop_filter
|
|
24 vsubl.u8 q3, d18, d17
|
|
25 vsubl.u8 q2, d16, d19
|
|
26 vadd.i16 q1, q3, q3
|
|
27 vadd.i16 q2, q2, q3
|
|
28 vadd.i16 q0, q1, q2
|
|
29 vrshr.s16 q0, q0, #3
|
|
30 vmovl.u8 q9, d18
|
|
31 vdup.u16 q15, r2
|
|
32
|
|
33 vabs.s16 q1, q0
|
|
34 vshr.s16 q0, q0, #15
|
|
35 vqsub.u16 q2, q15, q1
|
|
36 vqsub.u16 q3, q2, q1
|
|
37 vsub.i16 q1, q2, q3
|
|
38 veor q1, q1, q0
|
|
39 vsub.i16 q0, q1, q0
|
|
40
|
|
41 vaddw.u8 q2, q0, d17
|
|
42 vsub.i16 q3, q9, q0
|
|
43 vqmovun.s16 d0, q2
|
|
44 vqmovun.s16 d1, q3
|
|
45 .endm
|
|
46
|
|
47 function ff_vp3_v_loop_filter_neon, export=1
|
|
48 sub ip, r0, r1
|
|
49 sub r0, r0, r1, lsl #1
|
|
50 vld1.64 {d16}, [r0,:64], r1
|
|
51 vld1.64 {d17}, [r0,:64], r1
|
|
52 vld1.64 {d18}, [r0,:64], r1
|
|
53 vld1.64 {d19}, [r0,:64], r1
|
|
54 ldrb r2, [r2, #129*4]
|
|
55
|
|
56 vp3_loop_filter
|
|
57
|
|
58 vst1.64 {d0}, [ip,:64], r1
|
|
59 vst1.64 {d1}, [ip,:64], r1
|
|
60 bx lr
|
|
61 .endfunc
|
|
62
|
|
63 function ff_vp3_h_loop_filter_neon, export=1
|
|
64 sub ip, r0, #1
|
|
65 sub r0, r0, #2
|
|
66 vld1.32 {d16[]}, [r0], r1
|
|
67 vld1.32 {d17[]}, [r0], r1
|
|
68 vld1.32 {d18[]}, [r0], r1
|
|
69 vld1.32 {d19[]}, [r0], r1
|
|
70 vld1.32 {d16[1]}, [r0], r1
|
|
71 vld1.32 {d17[1]}, [r0], r1
|
|
72 vld1.32 {d18[1]}, [r0], r1
|
|
73 vld1.32 {d19[1]}, [r0], r1
|
|
74 ldrb r2, [r2, #129*4]
|
|
75
|
|
76 vtrn.8 d16, d17
|
|
77 vtrn.8 d18, d19
|
|
78 vtrn.16 d16, d18
|
|
79 vtrn.16 d17, d19
|
|
80
|
|
81 vp3_loop_filter
|
|
82
|
|
83 vtrn.8 d0, d1
|
|
84
|
|
85 vst1.16 {d0[0]}, [ip], r1
|
|
86 vst1.16 {d1[0]}, [ip], r1
|
|
87 vst1.16 {d0[1]}, [ip], r1
|
|
88 vst1.16 {d1[1]}, [ip], r1
|
|
89 vst1.16 {d0[2]}, [ip], r1
|
|
90 vst1.16 {d1[2]}, [ip], r1
|
|
91 vst1.16 {d0[3]}, [ip], r1
|
|
92 vst1.16 {d1[3]}, [ip], r1
|
|
93 bx lr
|
|
94 .endfunc
|