| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (c) 2024 Rémi Denis-Courmont | ||
| 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 | |||
| 23 | #include "checkasm.h" | ||
| 24 | |||
| 25 | #include "libavcodec/h263dsp.h" | ||
| 26 | #include "libavutil/mem.h" | ||
| 27 | #include "libavutil/mem_internal.h" | ||
| 28 | |||
| 29 | typedef void (*filter)(uint8_t *src, int stride, int qscale); | ||
| 30 | |||
| 31 | 28 | static void check_loop_filter(char dim, filter func) | |
| 32 | { | ||
| 33 | 28 | LOCAL_ALIGNED_16(uint8_t, buf0, [32 * 32]); | |
| 34 | 28 | LOCAL_ALIGNED_16(uint8_t, buf1, [32 * 32]); | |
| 35 | 28 | int qscale = rnd() % 32; | |
| 36 | |||
| 37 | 28 | declare_func(void, uint8_t *, int, int); | |
| 38 | |||
| 39 |
2/2✓ Branch 0 taken 896 times.
✓ Branch 1 taken 28 times.
|
924 | for (size_t y = 0; y < 32; y++) |
| 40 |
2/2✓ Branch 0 taken 28672 times.
✓ Branch 1 taken 896 times.
|
29568 | for (size_t x = 0; x < 32; x++) |
| 41 | 28672 | buf0[y * 32 + x] = buf1[y * 32 + x] = rnd(); | |
| 42 | |||
| 43 |
2/2✓ Branch 3 taken 4 times.
✓ Branch 4 taken 24 times.
|
28 | if (check_func(func, "h263dsp.%c_loop_filter", dim)) { |
| 44 | 4 | call_ref(buf0 + 8 * 33, 32, qscale); | |
| 45 | 4 | call_new(buf1 + 8 * 33, 32, qscale); | |
| 46 | |||
| 47 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | if (memcmp(buf0, buf1, 32 * 32)) |
| 48 | ✗ | fail(); | |
| 49 | |||
| 50 |
1/8✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
|
4 | bench_new(buf1 + 8 * 33, 32, 1); |
| 51 | } | ||
| 52 | 28 | } | |
| 53 | |||
| 54 | 14 | void checkasm_check_h263dsp(void) | |
| 55 | { | ||
| 56 | H263DSPContext ctx; | ||
| 57 | |||
| 58 | 14 | ff_h263dsp_init(&ctx); | |
| 59 | 14 | check_loop_filter('h', ctx.h263_h_loop_filter); | |
| 60 | 14 | check_loop_filter('v', ctx.h263_v_loop_filter); | |
| 61 | 14 | report("loop_filter"); | |
| 62 | 14 | } | |
| 63 |