1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #include <string.h>
25
28 #define SRC_STRIDE 512
29 #define PIXELS (WIDTH * HEIGHT)
30
31 #define randomize_buffers(buf, size) \
32 do { \
33 int j; \
34 uint8_t *tmp_buf = (uint8_t *)buf;\
35 for (j = 0; j< size; j++) \
36 tmp_buf[j] = rnd() & 0xFF; \
37 } while (0)
38
40 {
50 const int radius = 1;
51 const int bpc = 1;
53 const int slice_start = 0;
55 int y;
59
61
63 const uint8_t *
c[],
int peak,
int radius,
int dstride,
int stride,
int size);
64
71
72 memset(dst_ref, 0,
PIXELS);
73 memset(dst_new, 0,
PIXELS);
75
80
82 call_ref(dst_ref + yoff + xoff, sizew - 2 * radius,
85 call_new(dst_new + yoff + xoff, sizew - 2 * radius,
88 if (memcmp(dst_ref + yoff + xoff, dst_new + yoff + xoff,
slice_end -
step))
90 bench_new(dst_new + yoff + xoff, sizew - 2 * radius,
94 dst_ref += dstride;
95 }
96 }
97
98 }
99
101 {
103 report(
"convolution:sobel");
104 }