1 /*
2 * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
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>
22
25
28
30
31 #define randomize(buf, len) \
32 do { \
33 for (int i = 0; i < len; i++) \
34 buf[i] = rnd(); \
35 } while (0)
36
38
41
42 if (
check_func(
s->decorrelate_ls,
"decorrelate_ls")) {
46
49 memcpy(p2_2, p2,
BUF_SIZE *
sizeof(*p2));
50
53
54 if (memcmp(p2, p2_2,
BUF_SIZE *
sizeof(*p2)) != 0) {
56 }
57
59 }
60
62 }
63
66
67 if (
check_func(
s->decorrelate_sr,
"decorrelate_sr")) {
71
73 memcpy(p1_2, p1,
BUF_SIZE *
sizeof(*p1));
75
78
79 if (memcmp(p1, p1_2,
BUF_SIZE *
sizeof(*p1)) != 0) {
81 }
82
84 }
85
87 }
88
91
92 if (
check_func(
s->decorrelate_sm,
"decorrelate_sm")) {
97
99 memcpy(p1_2, p1,
BUF_SIZE *
sizeof(*p1));
101 memcpy(p2_2, p2,
BUF_SIZE *
sizeof(*p2));
102
105
106 if (memcmp(p1, p1_2,
BUF_SIZE *
sizeof(*p1)) != 0 ||
107 memcmp(p2, p2_2,
BUF_SIZE *
sizeof(*p2)) != 0) {
109 }
110
112 }
113
115 }
116
119
120 if (
check_func(
s->decorrelate_sf,
"decorrelate_sf")) {
124 int dshift, dfactor;
125
127 memcpy(p1_2, p1,
BUF_SIZE *
sizeof(*p1));
129 dshift = (
rnd() & 0xF) + 1;
131
134
135 if (memcmp(p1, p1_2,
BUF_SIZE *
sizeof(*p1)) != 0) {
137 }
138
140 }
141
143 }
144
146 {
149
154 }