1 /*
2 *
3 * This file is part of FFmpeg.
4 *
5 * FFmpeg is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #include <string.h>
21
26
29
31
32 #define randomize_buffers(buf, size) \
33 do { \
34 int j; \
35 for (j = 0; j < size; j+=4) \
36 AV_WN32(buf + j, rnd()); \
37 } while (0)
38
62 };
63
65 {
69 int dstW, byte_size, luma_filter_size, chr_filter_size;
70 #define LARGEST_FILTER 16
71 #define FILTER_SIZES 4
72 static const int filter_sizes[] = {1, 4, 8, 16};
73 #define LARGEST_INPUT_SIZE 512
74 #define INPUT_SIZES 6
75 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
76 uint8_t *dst0[4];
77 uint8_t *dst1[4];
78
80 const int16_t **lumSrcx, int lumFilterSize,
81 const int16_t *chrFilter, const int16_t **chrUSrcx,
82 const int16_t **chrVSrcx, int chrFilterSize,
83 const int16_t **alpSrcx, uint8_t **dest,
85
90
93
98
103
108
115
116 dst0[0] = (uint8_t*)dst0_g;
117 dst0[1] = (uint8_t*)dst0_b;
118 dst0[2] = (uint8_t*)dst0_r;
119 dst0[3] = (uint8_t*)dst0_a;
120
121 dst1[0] = (uint8_t*)dst1_g;
122 dst1[1] = (uint8_t*)dst1_b;
123 dst1[2] = (uint8_t*)dst1_r;
124 dst1[3] = (uint8_t*)dst1_a;
125
131 }
132
136
138 ctx->yuv2rgb_y_offset =
rnd();
139 ctx->yuv2rgb_y_coeff =
rnd();
140 ctx->yuv2rgb_v2r_coeff =
rnd();
141 ctx->yuv2rgb_v2g_coeff =
rnd();
142 ctx->yuv2rgb_u2g_coeff =
rnd();
143 ctx->yuv2rgb_u2b_coeff =
rnd();
144
150
151 dstW = input_sizes[isi];
152 luma_filter_size = filter_sizes[fsi];
153 chr_filter_size = filter_sizes[fsi];
154
155 if (
desc->comp[0].depth > 16) {
156 byte_size = 4;
157 }
else if (
desc->comp[0].depth > 8) {
158 byte_size = 2;
159 } else {
160 byte_size = 1;
161 }
162
165 for (
i = 0;
i < 4;
i ++) {
168 }
169
171 chr_filter, chru, chrv, chr_filter_size,
174 chr_filter, chru, chrv, chr_filter_size,
176
177 if (memcmp(dst0[0], dst1[0],
dstW * byte_size) ||
178 memcmp(dst0[1], dst1[1],
dstW * byte_size) ||
179 memcmp(dst0[2], dst1[2],
dstW * byte_size) ||
180 memcmp(dst0[3], dst1[3],
dstW * byte_size) )
182
184 chr_filter, chru, chrv, chr_filter_size,
186 }
187 }
188 }
189 }
191 }
192
193 #undef LARGEST_INPUT_SIZE
194 #undef INPUT_SIZES
195
197 {
200 int fmi, isi;
202 #define LARGEST_INPUT_SIZE 512
203 #define INPUT_SIZES 6
204 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
207
209
214
217
223
224 src[0] = (uint8_t*)src_g;
225 src[1] = (uint8_t*)src_b;
226 src[2] = (uint8_t*)src_r;
227 src[3] = (uint8_t*)src_a;
228
232
238 byte_size = 2;
239 dstW = input_sizes[isi];
240
245
248
249 if (memcmp(dst0_y, dst1_y,
dstW * byte_size))
251
253
254 }
255 }
256 }
258 }
259
260 #undef LARGEST_INPUT_SIZE
261 #undef INPUT_SIZES
262
264 {
267 int fmi, isi;
269 #define LARGEST_INPUT_SIZE 512
270 #define INPUT_SIZES 6
271 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
274
277
282
285
288
294
295 src[0] = (uint8_t*)src_g;
296 src[1] = (uint8_t*)src_b;
297 src[2] = (uint8_t*)src_r;
298 src[3] = (uint8_t*)src_a;
299
303
309 byte_size = 2;
310 dstW = input_sizes[isi];
311
318
321
322 if (memcmp(dst0_u, dst1_u,
dstW * byte_size) ||
323 memcmp(dst0_v, dst1_v,
dstW * byte_size))
325
327 }
328 }
329 }
331 }
332
333 #undef LARGEST_INPUT_SIZE
334 #undef INPUT_SIZES
335
337 {
340 int fmi, isi;
342 #define LARGEST_INPUT_SIZE 512
343 #define INPUT_SIZES 6
344 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
347
349
354
357
363
364 src[0] = (uint8_t*)src_g;
365 src[1] = (uint8_t*)src_b;
366 src[2] = (uint8_t*)src_r;
367 src[3] = (uint8_t*)src_a;
368
372
377 continue;
378
381 byte_size = 2;
382 dstW = input_sizes[isi];
383
388
391
392 if (memcmp(dst0_a, dst1_a,
dstW * byte_size))
395 }
396 }
397 }
399 }
400
402 {
404 report(
"output_yuv2gbrp");
405
407 report(
"input_planar_rgb_y");
408
410 report(
"input_planar_rgb_uv");
411
413 report(
"input_planar_rgb_a");
414 }