]> git.sesse.net Git - ffmpeg/blob - libavcodec/arm/rv40dsp_neon.S
Merge remote-tracking branch 'richardpl/escape130'
[ffmpeg] / libavcodec / arm / rv40dsp_neon.S
1 /*
2  * Copyright (c) 2011 Janne Grunau <janne-libav@jannau.net>
3  *
4  * This file is part of Libav.
5  *
6  * Libav 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  * Libav 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 Libav; 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  rv40_weight
24         vmovl.u8        q8,  d2
25         vmovl.u8        q9,  d3
26         vmovl.u8        q10, d4
27         vmovl.u8        q11, d5
28         vmull.u16       q2,  d16, d0[2]
29         vmull.u16       q3,  d17, d0[2]
30         vmull.u16       q8,  d18, d0[2]
31         vmull.u16       q9,  d19, d0[2]
32         vmull.u16       q12, d20, d0[0]
33         vmull.u16       q13, d21, d0[0]
34         vmull.u16       q14, d22, d0[0]
35         vmull.u16       q15, d23, d0[0]
36         vshrn.i32       d4,  q2,  #9
37         vshrn.i32       d5,  q3,  #9
38         vshrn.i32       d6,  q8,  #9
39         vshrn.i32       d7,  q9,  #9
40         vshrn.i32       d16, q12, #9
41         vshrn.i32       d17, q13, #9
42         vshrn.i32       d18, q14, #9
43         vshrn.i32       d19, q15, #9
44         vadd.u16        q2,  q2,  q8
45         vadd.u16        q3,  q3,  q9
46         vrshrn.i16      d2,  q2,  #5
47         vrshrn.i16      d3,  q3,  #5
48 .endm
49
50 /* void ff_rv40_weight_func_16_neon(uint8_t *dst, uint8_t *src1, uint8_t *src2,
51                                     int w1, int w2, int stride) */
52 function ff_rv40_weight_func_16_neon, export=1
53         ldr             r12, [sp]
54         vmov            d0,  r3,  r12
55         ldr             r12, [sp, #4]
56         mov             r3,  #16
57 1:
58         vld1.8          {q1},     [r1,:128], r12
59         vld1.8          {q2},     [r2,:128], r12
60         rv40_weight
61         vst1.8          {q1},     [r0,:128], r12
62         subs            r3,  r3,  #1
63         bne             1b
64         bx              lr
65 endfunc
66
67 /* void ff_rv40_weight_func_8_neon(uint8_t *dst, uint8_t *src1, uint8_t *src2,
68                                    int w1, int w2, int stride) */
69 function ff_rv40_weight_func_8_neon, export=1
70         ldr             r12, [sp]
71         vmov            d0,  r3,  r12
72         ldr             r12, [sp, #4]
73         mov             r3,  #8
74 1:
75         vld1.8          {d2},     [r1,:64], r12
76         vld1.8          {d3},     [r1,:64], r12
77         vld1.8          {d4},     [r2,:64], r12
78         vld1.8          {d5},     [r2,:64], r12
79         rv40_weight
80         vst1.8          {d2},     [r0,:64], r12
81         vst1.8          {d3},     [r0,:64], r12
82         subs            r3,  r3,  #2
83         bne             1b
84         bx              lr
85 endfunc