1 ;******************************************************************************
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"
25 ; 0.85..^1 0.85..^2 0.85..^3 0.85..^4
26 tab_st: dd 0x3f599a00, 0x3f38f671, 0x3f1d382a, 0x3f05a32f
32 cglobal opus_deemphasis, 3, 3, 8, out, in, len
34 cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
37 VBROADCASTSS m0, coeffm
46 shufps m6, m4, m4, q1111
47 shufps m7, m4, m4, q2222
50 movaps m1, [inq] ; x0, x1, x2, x3
52 pslldq m2, m1, 4 ; 0, x0, x1, x2
53 pslldq m3, m1, 8 ; 0, 0, x0, x1
55 fmaddps m2, m2, m5, m1 ; x + c1*x[0-2]
56 pslldq m1, 12 ; 0, 0, 0, x0
58 fmaddps m2, m3, m6, m2 ; x + c1*x[0-2] + c2*x[0-1]
59 fmaddps m1, m1, m7, m2 ; x + c1*x[0-2] + c2*x[0-1] + c3*x[0]
60 fmaddps m0, m0, m4, m1 ; x + c1*x[0-2] + c2*x[0-1] + c3*x[0] + c*s
63 shufps m0, m0, q3333 ; new state
78 cglobal opus_postfilter, 4, 4, 8, data, period, gains, len
79 VBROADCASTSS m0, [gainsq + 0]
80 VBROADCASTSS m1, [gainsq + 4]
81 VBROADCASTSS m2, [gainsq + 8]
87 movups m3, [dataq + periodq]
91 movups m4, [dataq + periodq + 4]
92 movups m5, [dataq + periodq + 8]
93 movups m6, [dataq + periodq + 12]
94 movups m7, [dataq + periodq + 16]
96 fmaddps m3, m7, m2, m3
99 fmaddps m5, m5, m0, [dataq]
100 fmaddps m6, m6, m1, m3
108 sub lend, mmsize >> 2