1 /*
2 * Copyright (c) 2014 James Almer
3 *
4 * This file is part of FFmpeg.
5 *
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.
10 *
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.
15 *
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 */
20
24 #include "config.h"
25
32
35
36 #define DECORRELATE_FUNCS(fmt, opt) \
37 void ff_flac_decorrelate_ls_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
38 int len, int shift); \
39 void ff_flac_decorrelate_rs_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
40 int len, int shift); \
41 void ff_flac_decorrelate_ms_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
42 int len, int shift)
43
44 #define DECORRELATE_IFUNCS(fmt, opt) \
45 void ff_flac_decorrelate_indep2_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
46 int len, int shift); \
47 void ff_flac_decorrelate_indep4_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
48 int len, int shift); \
49 void ff_flac_decorrelate_indep6_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
50 int len, int shift); \
51 void ff_flac_decorrelate_indep8_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
52 int len, int shift)
53
62
64 {
65 #if HAVE_X86ASM
67
71 c->decorrelate[1] = ff_flac_decorrelate_ls_16_sse2;
72 c->decorrelate[2] = ff_flac_decorrelate_rs_16_sse2;
73 c->decorrelate[3] = ff_flac_decorrelate_ms_16_sse2;
75 c->decorrelate[1] = ff_flac_decorrelate_ls_32_sse2;
76 c->decorrelate[2] = ff_flac_decorrelate_rs_32_sse2;
77 c->decorrelate[3] = ff_flac_decorrelate_ms_32_sse2;
78 }
79 }
83 c->decorrelate[0] = ff_flac_decorrelate_indep2_16_ssse3;
85 c->decorrelate[0] = ff_flac_decorrelate_indep4_16_ssse3;
87 c->decorrelate[0] = ff_flac_decorrelate_indep6_16_ssse3;
88 else if (ARCH_X86_64 &&
channels == 8)
89 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_ssse3;
92 c->decorrelate[0] = ff_flac_decorrelate_indep2_32_ssse3;
94 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_ssse3;
96 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_ssse3;
97 else if (ARCH_X86_64 &&
channels == 8)
98 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_ssse3;
99 }
100 }
105 }
109 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
112 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
114 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
115 else if (ARCH_X86_64 &&
channels == 8)
116 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
117 }
118 }
121 }
122 #endif /* HAVE_X86ASM */
123 }