1 ;******************************************************************************
2 ;* x86 optimized channel mixing
3 ;* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
5 ;* This file is part of Libav.
7 ;* Libav 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.
12 ;* Libav 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.
17 ;* You should have received a copy of the GNU Lesser General Public
18 ;* License along with Libav; if not, write to the Free Software
19 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ;******************************************************************************
23 %include "x86util.asm"
28 ;-----------------------------------------------------------------------------
29 ; void ff_mix_2_to_1_fltp_flt(float **src, float **matrix, int len,
30 ; int out_ch, int in_ch);
31 ;-----------------------------------------------------------------------------
33 %macro MIX_2_TO_1_FLTP_FLT 0
34 cglobal mix_2_to_1_fltp_flt, 3,4,6, src, matrix, len, src1
35 mov src1q, [srcq+gprsize]
38 mov matrixq, [matrixq ]
39 VBROADCASTSS m4, [matrixq ]
40 VBROADCASTSS m5, [matrixq+4]
44 mulps m1, m5, [srcq+src1q ]
45 mulps m2, m4, [srcq+ mmsize]
46 mulps m3, m5, [srcq+src1q+mmsize]
50 mova [srcq+mmsize], m2
64 ;-----------------------------------------------------------------------------
65 ; void ff_mix_2_to_1_s16p_flt(int16_t **src, float **matrix, int len,
66 ; int out_ch, int in_ch);
67 ;-----------------------------------------------------------------------------
69 %macro MIX_2_TO_1_S16P_FLT 0
70 cglobal mix_2_to_1_s16p_flt, 3,4,6, src, matrix, len, src1
71 mov src1q, [srcq+gprsize]
74 mov matrixq, [matrixq ]
75 VBROADCASTSS m4, [matrixq ]
76 VBROADCASTSS m5, [matrixq+4]
108 ;-----------------------------------------------------------------------------
109 ; void ff_mix_2_to_1_s16p_q8(int16_t **src, int16_t **matrix, int len,
110 ; int out_ch, int in_ch);
111 ;-----------------------------------------------------------------------------
114 cglobal mix_2_to_1_s16p_q8, 3,4,6, src, matrix, len, src1
115 mov src1q, [srcq+gprsize]
118 mov matrixq, [matrixq]
129 mova m2, [srcq+src1q]
149 ;-----------------------------------------------------------------------------
150 ; void ff_mix_1_to_2_fltp_flt(float **src, float **matrix, int len,
151 ; int out_ch, int in_ch);
152 ;-----------------------------------------------------------------------------
154 %macro MIX_1_TO_2_FLTP_FLT 0
155 cglobal mix_1_to_2_fltp_flt, 3,5,4, src0, matrix0, len, src1, matrix1
156 mov src1q, [src0q+gprsize]
159 mov matrix1q, [matrix0q+gprsize]
160 mov matrix0q, [matrix0q]
161 VBROADCASTSS m2, [matrix0q]
162 VBROADCASTSS m3, [matrix1q]
169 mova [src0q+src1q], m1
183 ;-----------------------------------------------------------------------------
184 ; void ff_mix_1_to_2_s16p_flt(int16_t **src, float **matrix, int len,
185 ; int out_ch, int in_ch);
186 ;-----------------------------------------------------------------------------
188 %macro MIX_1_TO_2_S16P_FLT 0
189 cglobal mix_1_to_2_s16p_flt, 3,5,6, src0, matrix0, len, src1, matrix1
190 mov src1q, [src0q+gprsize]
193 mov matrix1q, [matrix0q+gprsize]
194 mov matrix0q, [matrix0q]
195 VBROADCASTSS m4, [matrix0q]
196 VBROADCASTSS m5, [matrix1q]
214 mova [src0q+src1q], m1