FFmpeg
Loading...
Searching...
No Matches
vf_idet.c
Go to the documentation of this file.
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 "checkasm.h"
20
23
24#define WIDTH 512
25
26static void check_idet(int depth)
27{
29
30 LOCAL_ALIGNED_32(uint8_t, in0, [WIDTH]);
31 LOCAL_ALIGNED_32(uint8_t, in1, [WIDTH]);
32 LOCAL_ALIGNED_32(uint8_t, in2, [WIDTH]);
33
34 declare_func(int, const uint8_t *a, const uint8_t *b,
35 const uint8_t *c, int w);
36
37 ff_idet_dsp_init(&dsp, depth > 8);
38
39 for (int x = 0; x < WIDTH; x++) {
40 in0[x] = rnd() & 0xFF;
41 in1[x] = rnd() & 0xFF;
42 in2[x] = rnd() & 0xFF;
43 }
44
45 if (check_func(dsp.filter_line, "idet%d", depth)) {
46 /* Ensure odd tail is handled correctly */
47 int res_ref = call_ref(in0, in1, in2, WIDTH - 8);
48 int res_new = call_new(in0, in1, in2, WIDTH - 8);
49 if (res_ref != res_new) {
50 fprintf(stderr, "idet%d: result mismatch: %u != %u\n",
51 depth, res_ref, res_new);
52 fail();
53 }
54 bench_new(in0, in1, in2, WIDTH);
55 }
56}
57
59{
60 check_idet(8);
61 report("idet8");
62
63 check_idet(16);
64 report("idet16");
65}
#define rnd
Definition checkasm.h:136
#define declare_func
Definition test.h:489
#define fail
Definition test.h:479
#define bench_new
Definition test.h:487
#define check_func
Definition test.h:481
#define call_new
Definition test.h:486
#define call_ref
Definition test.h:485
#define report
Definition test.h:480
int a
#define b
Definition input.c:43
#define WIDTH
Definition c93.c:45
uint8_t w
Definition llvidencdsp.c:39
#define LOCAL_ALIGNED_32(t, v,...)
ff_idet_filter_func filter_line
Definition vf_idetdsp.h:27
static void check_idet(int depth)
Definition vf_idet.c:26
void checkasm_check_idet(void)
Definition vf_idet.c:58
void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth)
Definition vf_idetdsp.c:56
static double c[64]