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 2
31
32 #define randomize_buffers() \
33 do { \
34 int i; \
35 for (i = 0; i < BUF_SIZE*MAX_CHANNELS; i++) { \
36 int32_t r = sign_extend(rnd(), 24); \
37 ref_buf[i] = r; \
38 new_buf[i] = r; \
39 } \
40 } while (0)
41
43 {
49
51 if (
check_func(
c.decorrelate_stereo,
"alac_decorrelate_stereo")) {
52 int len = (
rnd() & 0xFF) + 1;
56
64 }
65
66 report(
"decorrelate_stereo");
67 }
68
69 #undef randomize_buffers
70 #define randomize_buffers() \
71 do { \
72 int i, j; \
73 for (i = 0; i < BUF_SIZE; i++) { \
74 for (j = 0; j < ch; j++) { \
75 int32_t r = sign_extend(rnd(), 24); \
76 ref[j][i] = r; \
77 new[j][i] = r; \
78 r = rnd() & 0xFF; \
79 ref_ebb[j][i] = r; \
80 new_ebb[j][i] = r; \
81 } \
82 } \
83 } while (0)
84
86 {
94 static const char *
const channels[2] = {
"mono",
"stereo" };
95 int ch;
96
98 for (ch = 1; ch <= 2; ch++) {
100 int len = (
rnd() & 0xFF) + 1;
102
110 }
111 }
112
113 report(
"append_extra_bits");
114 }
115
117 {
120 }