1 ;******************************************************************************
2 ;* Copyright (c) 2012 Michael Niedermayer
4 ;* This file is part of FFmpeg.
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.
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.
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 ;******************************************************************************
21 %include "libavutil/x86/x86util.asm"
32 cglobal mix_2_1_%1_float, 7, 7, 6, out, in1, in2, coeffp, index1, index2, len
35 jne mix_2_1_float_u_int %+ SUFFIX
37 jne mix_2_1_float_u_int %+ SUFFIX
39 jne mix_2_1_float_u_int %+ SUFFIX
41 mix_2_1_float_u_int %+ SUFFIX
43 VBROADCASTSS m4, [coeffpq + 4*index1q]
44 VBROADCASTSS m5, [coeffpq + 4*index2q]
52 mulps m0, m4, [in1q + lenq ]
53 mulps m1, m5, [in2q + lenq ]
54 mulps m2, m4, [in1q + lenq + mmsize]
55 mulps m3, m5, [in2q + lenq + mmsize]
57 movu m0, [in1q + lenq ]
58 movu m1, [in2q + lenq ]
59 movu m2, [in1q + lenq + mmsize]
60 movu m3, [in2q + lenq + mmsize]
68 mov%1 [outq + lenq ], m0
69 mov%1 [outq + lenq + mmsize], m2
76 cglobal mix_1_1_%1_float, 5, 5, 3, out, in, coeffp, index, len
79 jne mix_1_1_float_u_int %+ SUFFIX
81 jne mix_1_1_float_u_int %+ SUFFIX
83 mix_1_1_float_u_int %+ SUFFIX
85 VBROADCASTSS m2, [coeffpq + 4*indexq]
92 mulps m0, m2, [inq + lenq ]
93 mulps m1, m2, [inq + lenq + mmsize]
95 movu m0, [inq + lenq ]
96 movu m1, [inq + lenq + mmsize]
100 mov%1 [outq + lenq ], m0
101 mov%1 [outq + lenq + mmsize], m1
108 cglobal mix_1_1_%1_int16, 5, 5, 6, out, in, coeffp, index, len
111 jne mix_1_1_int16_u_int %+ SUFFIX
113 jne mix_1_1_int16_u_int %+ SUFFIX
115 mix_1_1_int16_u_int %+ SUFFIX
117 movd m4, [coeffpq + 4*indexq]
130 mov%1 m0, [inq + lenq ]
131 mov%1 m2, [inq + lenq + mmsize]
148 mov%1 [outq + lenq ], m0
149 mov%1 [outq + lenq + mmsize], m2
161 cglobal mix_2_1_%1_int16, 7, 7, 8, out, in1, in2, coeffp, index1, index2, len
164 jne mix_2_1_int16_u_int %+ SUFFIX
166 jne mix_2_1_int16_u_int %+ SUFFIX
168 jne mix_2_1_int16_u_int %+ SUFFIX
170 mix_2_1_int16_u_int %+ SUFFIX
172 movd m4, [coeffpq + 4*index1q]
173 movd m6, [coeffpq + 4*index2q]
188 mov%1 m0, [in1q + lenq ]
189 mov%1 m2, [in2q + lenq ]
194 mov%1 m2, [in1q + lenq + mmsize]
195 mov%1 m6, [in2q + lenq + mmsize]
214 mov%1 [outq + lenq ], m0
215 mov%1 [outq + lenq + mmsize], m2
245 %if HAVE_AVX_EXTERNAL