1 ;******************************************************************************
2 ;* ALAC DSP SIMD optimizations
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"
29 cglobal alac_decorrelate_stereo, 2, 5, 8, buf0, len, shift, weight, buf1
31 cglobal alac_decorrelate_stereo, 2, 3, 8, buf0, len, shift, weight
38 mov buf1q, [buf0q + gprsize]
46 mova m0, [buf0q + lenq]
47 mova m1, [buf0q + lenq + mmsize]
48 mova m2, [buf1q + lenq]
49 mova m3, [buf1q + lenq + mmsize]
58 mova [buf1q + lenq], m0
59 mova [buf1q + lenq + mmsize], m1
60 mova [buf0q + lenq], m2
61 mova [buf0q + lenq + mmsize], m3
68 cglobal alac_append_extra_bits_stereo, 2, 5, 5, buf0, exbuf0, buf1, exbuf1, len
72 mov buf1q, [buf0q + gprsize]
74 mov exbuf1q, [exbuf0q + gprsize]
75 mov exbuf0q, [exbuf0q]
84 mova m0, [buf0q + lenq]
85 mova m1, [buf0q + lenq + mmsize]
88 mova m2, [buf1q + lenq]
89 mova m3, [buf1q + lenq + mmsize]
92 por m0, [exbuf0q + lenq]
93 por m1, [exbuf0q + lenq + mmsize]
94 por m2, [exbuf1q + lenq]
95 por m3, [exbuf1q + lenq + mmsize]
96 mova [buf0q + lenq ], m0
97 mova [buf0q + lenq + mmsize], m1
98 mova [buf1q + lenq ], m2
99 mova [buf1q + lenq + mmsize], m3
106 cglobal alac_append_extra_bits_mono, 2, 5, 3, buf, exbuf, exbits, ch, len
108 cglobal alac_append_extra_bits_mono, 2, 3, 3, buf, exbuf, len
122 mova m0, [bufq + lenq]
123 mova m1, [bufq + lenq + mmsize]
126 por m0, [exbufq + lenq]
127 por m1, [exbufq + lenq + mmsize]
128 mova [bufq + lenq], m0
129 mova [bufq + lenq + mmsize], m1