1 /*
2 * Copyright (c) 2015 James Almer
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #include <string.h>
28
30 #define MAX_CHANNELS 8
31
32 #define randomize_buffers() \
33 do { \
34 int i, j; \
35 for (i = 0; i < BUF_SIZE; i += 4) { \
36 for (j = 0; j < channels; j++) { \
37 uint32_t r = rnd() & (1 << (bits - 2)) - 1; \
38 AV_WN32A(ref_src[j] + i, r); \
39 AV_WN32A(new_src[j] + i, r); \
40 } \
41 } \
42 } while (0)
43
44 static void check_decorrelate(uint8_t **ref_dst, uint8_t **ref_src, uint8_t **new_dst, uint8_t **new_src,
47
55 }
56
58 {
67 static const char * const names[3] = { "ls", "rs", "ms" };
68 static const struct {
71 } fmts[] = {
74 };
77
78 for (
i = 0;
i < 2;
i++) {
80 for (j = 0; j < 3; j++)
81 if (
check_func(
h.decorrelate[j],
"flac_decorrelate_%s_%d", names[j], fmts[
i].bits))
85 if (
check_func(
h.decorrelate[0],
"flac_decorrelate_indep%d_%d", j, fmts[
i].bits))
87 }
88 }
89
91 }