comparison armv4l/h264idct_neon.S @ 8339:a561ec6d1bf6 libavcodec

ARM: NEON optimised h264_idct_add
author mru
date Mon, 15 Dec 2008 22:12:51 +0000
parents
children 834a77844ba3
comparison
equal deleted inserted replaced
8338:b294a0d5bc50 8339:a561ec6d1bf6
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
23 .fpu neon
24
25 .text
26
27 function ff_h264_idct_add_neon, export=1
28 mov r3, #(1<<5)
29 vmov.i16 d16, #0
30 vmov.16 d16[0], r3
31 vld1.64 {d0-d3}, [r1,:128]
32 vadd.i16 d0, d0, d16
33
34 vswp d1, d2
35 vadd.i16 d4, d0, d1
36 vshr.s16 q8, q1, #1
37 vsub.i16 d5, d0, d1
38 vadd.i16 d6, d2, d17
39 vsub.i16 d7, d16, d3
40 vadd.i16 q0, q2, q3
41 vsub.i16 q1, q2, q3
42
43 vtrn.16 d0, d1
44 vtrn.16 d3, d2
45 vtrn.32 d0, d3
46 vtrn.32 d1, d2
47
48 vadd.i16 d4, d0, d3
49 vld1.32 {d18[0]}, [r0,:32], r2
50 vswp d1, d3
51 vshr.s16 q8, q1, #1
52 vld1.32 {d19[1]}, [r0,:32], r2
53 vsub.i16 d5, d0, d1
54 vld1.32 {d18[1]}, [r0,:32], r2
55 vadd.i16 d6, d16, d3
56 vld1.32 {d19[0]}, [r0,:32], r2
57 vsub.i16 d7, d2, d17
58 sub r0, r0, r2, lsl #2
59 vadd.i16 q0, q2, q3
60 vsub.i16 q1, q2, q3
61
62 vshr.s16 q0, q0, #6
63 vshr.s16 q1, q1, #6
64
65 vaddw.u8 q0, q0, d18
66 vaddw.u8 q1, q1, d19
67
68 vqmovun.s16 d0, q0
69 vqmovun.s16 d1, q1
70
71 vst1.32 {d0[0]}, [r0,:32], r2
72 vst1.32 {d1[1]}, [r0,:32], r2
73 vst1.32 {d0[1]}, [r0,:32], r2
74 vst1.32 {d1[0]}, [r0,:32], r2
75
76 bx lr
77 .endfunc