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 {
70 int dstW, byte_size, luma_filter_size, chr_filter_size;
71 #define LARGEST_FILTER 16
72 #define FILTER_SIZES 4
73 static const int filter_sizes[] = {1, 4, 8, 16};
74 #define LARGEST_INPUT_SIZE 512
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,
84 int dstW, int y);
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
139
145
147 luma_filter_size = filter_sizes[fsi];
148 chr_filter_size = filter_sizes[fsi];
149
150 if (
desc->comp[0].depth > 16) {
151 byte_size = 4;
152 }
else if (
desc->comp[0].depth > 8) {
153 byte_size = 2;
154 } else {
155 byte_size = 1;
156 }
157
159 if (
check_func(
c->yuv2anyX,
"yuv2%s_full_X_%d_%d",
desc->name, luma_filter_size, dstW)) {
160 for (
i = 0;
i < 4;
i ++) {
163 }
164
165 call_ref(
c, luma_filter, luma, luma_filter_size,
166 chr_filter, chru, chrv, chr_filter_size,
167 alpha, dst0, dstW, 0);
168 call_new(
c, luma_filter, luma, luma_filter_size,
169 chr_filter, chru, chrv, chr_filter_size,
170 alpha, dst1, dstW, 0);
171
172 if (memcmp(dst0[0], dst1[0], dstW * byte_size) ||
173 memcmp(dst0[1], dst1[1], dstW * byte_size) ||
174 memcmp(dst0[2], dst1[2], dstW * byte_size) ||
175 memcmp(dst0[3], dst1[3], dstW * byte_size) )
177
178 bench_new(
c, luma_filter, luma, luma_filter_size,
179 chr_filter, chru, chrv, chr_filter_size,
180 alpha, dst1, dstW, 0);
181 }
182 }
183 }
184 }
186 }
187
188 #undef LARGEST_INPUT_SIZE
189
191 {
195 int fmi, isi;
196 int dstW, byte_size;
197 #define LARGEST_INPUT_SIZE 512
198 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
199 const uint8_t *
src[4];
201
204
209
212
218
219 src[0] = (uint8_t*)src_g;
220 src[1] = (uint8_t*)src_b;
221 src[2] = (uint8_t*)src_r;
222 src[3] = (uint8_t*)src_a;
223
227
234 byte_size = 2;
236
238 if(
check_func(
c->readLumPlanar,
"planar_%s_to_y_%d",
desc->name, dstW)) {
241
244
245 if (memcmp(dst0_y, dst1_y, dstW * byte_size))
247
249
250 }
251 }
252 }
254 }
255
256 #undef LARGEST_INPUT_SIZE
257
259 {
263 int fmi, isi;
264 int dstW, byte_size;
265 #define LARGEST_INPUT_SIZE 512
266 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
267 const uint8_t *
src[4];
269
272
277
280
283
289
290 src[0] = (uint8_t*)src_g;
291 src[1] = (uint8_t*)src_b;
292 src[2] = (uint8_t*)src_r;
293 src[3] = (uint8_t*)src_a;
294
298
305 byte_size = 2;
307
309 if(
check_func(
c->readChrPlanar,
"planar_%s_to_uv_%d",
desc->name, dstW)) {
314
317
318 if (memcmp(dst0_u, dst1_u, dstW * byte_size) ||
319 memcmp(dst0_v, dst1_v, dstW * byte_size))
321
323 }
324 }
325 }
327 }
328
329 #undef LARGEST_INPUT_SIZE
330
332 {
336 int fmi, isi;
337 int dstW, byte_size;
338 #define LARGEST_INPUT_SIZE 512
339 static const int input_sizes[] = {8, 24, 128, 144, 256, 512};
340 const uint8_t *
src[4];
342
345
350
353
359
360 src[0] = (uint8_t*)src_g;
361 src[1] = (uint8_t*)src_b;
362 src[2] = (uint8_t*)src_r;
363 src[3] = (uint8_t*)src_a;
364
368
374 continue;
375
378 byte_size = 2;
380
382 if(
check_func(
c->readAlpPlanar,
"planar_%s_to_a_%d",
desc->name, dstW)) {
385
388
389 if (memcmp(dst0_a, dst1_a, dstW * byte_size))
392 }
393 }
394 }
396 }
397
399 {
401 report(
"output_yuv2gbrp");
402
404 report(
"input_planar_rgb_y");
405
407 report(
"input_planar_rgb_uv");
408
410 report(
"input_planar_rgb_a");
411 }