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"
31 cglobal mix_2_1_%1_float, 7, 7, 6, out, in1, in2, coeffp, index1, index2, len
34 jne mix_2_1_float_u_int %+ SUFFIX
36 jne mix_2_1_float_u_int %+ SUFFIX
38 jne mix_2_1_float_u_int %+ SUFFIX
40 mix_2_1_float_u_int %+ SUFFIX
42 VBROADCASTSS m4, [coeffpq + 4*index1q]
43 VBROADCASTSS m5, [coeffpq + 4*index2q]
51 mulps m0, m4, [in1q + lenq ]
52 mulps m1, m5, [in2q + lenq ]
53 mulps m2, m4, [in1q + lenq + mmsize]
54 mulps m3, m5, [in2q + lenq + mmsize]
56 movu m0, [in1q + lenq ]
57 movu m1, [in2q + lenq ]
58 movu m2, [in1q + lenq + mmsize]
59 movu m3, [in2q + lenq + mmsize]
67 mov%1 [outq + lenq ], m0
68 mov%1 [outq + lenq + mmsize], m2
75 cglobal mix_1_1_%1_float, 5, 5, 3, out, in, coeffp, index, len
78 jne mix_1_1_float_u_int %+ SUFFIX
80 jne mix_1_1_float_u_int %+ SUFFIX
82 mix_1_1_float_u_int %+ SUFFIX
84 VBROADCASTSS m2, [coeffpq + 4*indexq]
91 mulps m0, m2, [inq + lenq ]
92 mulps m1, m2, [inq + lenq + mmsize]
94 movu m0, [inq + lenq ]
95 movu m1, [inq + lenq + mmsize]
99 mov%1 [outq + lenq ], m0
100 mov%1 [outq + lenq + mmsize], m1
107 cglobal mix_1_1_%1_int16, 5, 5, 6, out, in, coeffp, index, len
110 jne mix_1_1_int16_u_int %+ SUFFIX
112 jne mix_1_1_int16_u_int %+ SUFFIX
114 mix_1_1_int16_u_int %+ SUFFIX
116 movd m4, [coeffpq + 4*indexq]
129 mov%1 m0, [inq + lenq ]
130 mov%1 m2, [inq + lenq + mmsize]
147 mov%1 [outq + lenq ], m0
148 mov%1 [outq + lenq + mmsize], m2
160 cglobal mix_2_1_%1_int16, 7, 7, 8, out, in1, in2, coeffp, index1, index2, len
163 jne mix_2_1_int16_u_int %+ SUFFIX
165 jne mix_2_1_int16_u_int %+ SUFFIX
167 jne mix_2_1_int16_u_int %+ SUFFIX
169 mix_2_1_int16_u_int %+ SUFFIX
171 movd m4, [coeffpq + 4*index1q]
172 movd m6, [coeffpq + 4*index2q]
187 mov%1 m0, [in1q + lenq ]
188 mov%1 m2, [in2q + lenq ]
193 mov%1 m2, [in1q + lenq + mmsize]
194 mov%1 m6, [in2q + lenq + mmsize]
213 mov%1 [outq + lenq ], m0
214 mov%1 [outq + lenq + mmsize], m2
244 %if HAVE_AVX_EXTERNAL