]> git.sesse.net Git - ffmpeg/blob - libavfilter/x86/af_afir.asm
avformat: Remove getters and setters
[ffmpeg] / libavfilter / x86 / af_afir.asm
1 ;*****************************************************************************
2 ;* x86-optimized functions for afir filter
3 ;* Copyright (c) 2017 Paul B Mahol
4 ;*
5 ;* This file is part of FFmpeg.
6 ;*
7 ;* FFmpeg is free software; you can redistribute it and/or
8 ;* modify it under the terms of the GNU Lesser General Public
9 ;* License as published by the Free Software Foundation; either
10 ;* version 2.1 of the License, or (at your option) any later version.
11 ;*
12 ;* FFmpeg 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 GNU
15 ;* Lesser General Public License for more details.
16 ;*
17 ;* You should have received a copy of the GNU Lesser General Public
18 ;* License along with FFmpeg; if not, write to the Free Software
19 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ;******************************************************************************
21
22 %include "libavutil/x86/x86util.asm"
23
24 SECTION .text
25
26 ;------------------------------------------------------------------------------
27 ; void ff_fcmul_add(float *sum, const float *t, const float *c, int len)
28 ;------------------------------------------------------------------------------
29
30 %macro FCMUL_ADD 0
31 cglobal fcmul_add, 4,4,6, sum, t, c, len
32     shl       lend, 3
33     add         tq, lenq
34     add         cq, lenq
35     add       sumq, lenq
36     neg       lenq
37 ALIGN 16
38 .loop:
39     movsldup  m0, [tq + lenq]
40     movsldup  m3, [tq + lenq+mmsize]
41     movaps    m1, [cq + lenq]
42     movaps    m4, [cq + lenq+mmsize]
43     mulps     m0, m0, m1
44     mulps     m3, m3, m4
45     shufps    m1, m1, m1, 0xb1
46     shufps    m4, m4, m4, 0xb1
47     movshdup  m2, [tq + lenq]
48     movshdup  m5, [tq + lenq+mmsize]
49     mulps     m2, m2, m1
50     mulps     m5, m5, m4
51     addsubps  m0, m0, m2
52     addsubps  m3, m3, m5
53     addps     m0, m0, [sumq + lenq]
54     addps     m3, m3, [sumq + lenq+mmsize]
55     movaps    [sumq + lenq], m0
56     movaps    [sumq + lenq+mmsize], m3
57     add       lenq, mmsize*2
58     jl .loop
59     movss xm0, [tq + lenq]
60     mulss xm0, [cq + lenq]
61     addss xm0, [sumq + lenq]
62     movss [sumq + lenq], xm0
63     RET
64 %endmacro
65
66 INIT_XMM sse3
67 FCMUL_ADD
68 INIT_YMM avx
69 FCMUL_ADD