1 ;******************************************************************************
2 ;* SIMD optimized MPEG-4 Parametric Stereo decoding functions
4 ;* Copyright (C) 2015 James Almer
6 ;* This file is part of FFmpeg.
8 ;* FFmpeg is free software; you can redistribute it and/or
9 ;* modify it under the terms of the GNU Lesser General Public
10 ;* License as published by the Free Software Foundation; either
11 ;* version 2.1 of the License, or (at your option) any later version.
13 ;* FFmpeg is distributed in the hope that it will be useful,
14 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;* Lesser General Public License for more details.
18 ;* You should have received a copy of the GNU Lesser General Public
19 ;* License along with FFmpeg; if not, write to the Free Software
20 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 ;******************************************************************************
23 %include "libavutil/x86/x86util.asm"
27 ps_p1m1p1m1: dd 0, 0x80000000, 0, 0x80000000
31 ;*************************************************************************
32 ;void ff_ps_add_squares_<opt>(float *dst, const float (*src)[2], int n);
33 ;*************************************************************************
34 %macro PS_ADD_SQUARES 1
35 cglobal ps_add_squares, 3, 3, %1, dst, src, n
43 movaps m1, [srcq+nq+mmsize]
60 ;*******************************************************************
61 ;void ff_ps_mul_pair_single_sse(float (*dst)[2], float (*src0)[2],
62 ; float *src1, int n);
63 ;*******************************************************************
65 cglobal ps_mul_pair_single, 4, 4, 4, dst, src1, src2, n
74 movu m1, [src1q+nq+mmsize]
82 mova [dstq+nq+mmsize], m1
88 ;***********************************************************************
89 ;void ff_ps_stereo_interpolate_sse3(float (*l)[2], float (*r)[2],
90 ; float h[2][4], float h_step[2][4],
92 ;***********************************************************************
94 cglobal ps_stereo_interpolate, 5, 5, 6, l, r, h, h_step, n
121 ;***************************************************************************
122 ;void ps_stereo_interpolate_ipdopd_sse3(float (*l)[2], float (*r)[2],
123 ; float h[2][4], float h_step[2][4],
125 ;***************************************************************************
127 cglobal ps_stereo_interpolate_ipdopd, 5, 5, 10, l, r, h, h_step, n
129 movaps m1, [hq+mmsize]
132 movaps m9, [h_stepq+mmsize]
136 %define H_STEP0 [h_stepq]
137 %define H_STEP1 [h_stepq+mmsize]
150 shufps m4, m2, m2, q2301
151 shufps m5, m3, m3, q2301
169 ;*******************************************************************
170 ;void ff_ps_hybrid_analysis_<opt>(float (*out)[2], float (*in)[2],
171 ; const float (*filter)[8][2],
172 ; int stride, int n);
173 ;*******************************************************************
174 %macro PS_HYBRID_ANALYSIS_LOOP 3
175 movu %1, [inq+mmsize*%3]
176 movu m1, [inq+mmsize*(5-%3)+8]
181 pshufd m2, [filterq+nq+mmsize*%3], q2301
185 mova m2, [filterq+nq+mmsize*%3]
205 %macro PS_HYBRID_ANALYSIS 0
206 cglobal ps_hybrid_analysis, 5, 5, 8, out, in, filter, stride, n
216 mova m7, [ps_p1m1p1m1]
220 PS_HYBRID_ANALYSIS_LOOP m0, m3, 0
221 PS_HYBRID_ANALYSIS_LOOP m5, m6, 1
222 PS_HYBRID_ANALYSIS_LOOP m5, m6, 2
242 movu m2, [inq+6*8] ; faster than movlps and no risk of overread
244 movss m3, [filterq+nq+8*6]