1 ;******************************************************************************
2 ;* x86 optimized Format Conversion Utils
3 ;* Copyright (c) 2008 Loren Merritt
5 ;* This file is part of FFmpeg.
7 ;* FFmpeg 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 ;* FFmpeg 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 FFmpeg; if not, write to the Free Software
19 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ;******************************************************************************
22 %include "libavutil/x86/x86util.asm"
26 ;------------------------------------------------------------------------------
27 ; void ff_int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul,
29 ;------------------------------------------------------------------------------
30 %macro INT32_TO_FLOAT_FMUL_SCALAR 1
32 cglobal int32_to_float_fmul_scalar, 3, 3, %1, dst, src, len
34 cglobal int32_to_float_fmul_scalar, 4, 4, %1, dst, src, mul, len
48 cvtdq2ps m1, [srcq+lenq ]
49 cvtdq2ps m2, [srcq+lenq+16]
51 cvtpi2ps m1, [srcq+lenq ]
52 cvtpi2ps m3, [srcq+lenq+ 8]
53 cvtpi2ps m2, [srcq+lenq+16]
54 cvtpi2ps m4, [srcq+lenq+24]
61 mova [dstq+lenq+16], m2
68 INT32_TO_FLOAT_FMUL_SCALAR 5
70 INT32_TO_FLOAT_FMUL_SCALAR 3
72 ;------------------------------------------------------------------------------
73 ; void ff_int32_to_float_fmul_array8(FmtConvertContext *c, float *dst, const int32_t *src,
74 ; const float *mul, int len);
75 ;------------------------------------------------------------------------------
76 %macro INT32_TO_FLOAT_FMUL_ARRAY8 0
77 cglobal int32_to_float_fmul_array8, 5, 5, 5, c, dst, src, mul, len
86 cvtdq2ps m1, [srcq+lenq ]
87 cvtdq2ps m2, [srcq+lenq+16]
89 cvtpi2ps m1, [srcq+lenq ]
90 cvtpi2ps m3, [srcq+lenq+ 8]
91 cvtpi2ps m2, [srcq+lenq+16]
92 cvtpi2ps m4, [srcq+lenq+24]
99 mova [dstq+lenq+16], m2
107 INT32_TO_FLOAT_FMUL_ARRAY8
109 INT32_TO_FLOAT_FMUL_ARRAY8