Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * This file is part of FFmpeg. | ||
3 | * | ||
4 | * FFmpeg is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (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 GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with FFmpeg; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #include <stdint.h> | ||
20 | #include <string.h> | ||
21 | |||
22 | #include "config.h" | ||
23 | #include "libavutil/attributes.h" | ||
24 | #include "blockdsp.h" | ||
25 | |||
26 | 46758895 | static void clear_block_c(int16_t *block) | |
27 | { | ||
28 | 46758895 | memset(block, 0, sizeof(int16_t) * 64); | |
29 | 46758895 | } | |
30 | |||
31 | 4259711 | static void clear_blocks_c(int16_t *blocks) | |
32 | { | ||
33 | 4259711 | memset(blocks, 0, sizeof(int16_t) * 6 * 64); | |
34 | 4259711 | } | |
35 | |||
36 | 5111 | static void fill_block16_c(uint8_t *block, uint8_t value, ptrdiff_t line_size, | |
37 | int h) | ||
38 | { | ||
39 | int i; | ||
40 | |||
41 |
2/2✓ Branch 0 taken 81776 times.
✓ Branch 1 taken 5111 times.
|
86887 | for (i = 0; i < h; i++) { |
42 | 81776 | memset(block, value, 16); | |
43 | 81776 | block += line_size; | |
44 | } | ||
45 | 5111 | } | |
46 | |||
47 | 32006 | static void fill_block8_c(uint8_t *block, uint8_t value, ptrdiff_t line_size, | |
48 | int h) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 |
2/2✓ Branch 0 taken 256048 times.
✓ Branch 1 taken 32006 times.
|
288054 | for (i = 0; i < h; i++) { |
53 | 256048 | memset(block, value, 8); | |
54 | 256048 | block += line_size; | |
55 | } | ||
56 | 32006 | } | |
57 | |||
58 | 1495 | av_cold void ff_blockdsp_init(BlockDSPContext *c) | |
59 | { | ||
60 | 1495 | c->clear_block = clear_block_c; | |
61 | 1495 | c->clear_blocks = clear_blocks_c; | |
62 | |||
63 | 1495 | c->fill_block_tab[0] = fill_block16_c; | |
64 | 1495 | c->fill_block_tab[1] = fill_block8_c; | |
65 | |||
66 | #if ARCH_ARM | ||
67 | ff_blockdsp_init_arm(c); | ||
68 | #elif ARCH_PPC | ||
69 | ff_blockdsp_init_ppc(c); | ||
70 | #elif ARCH_RISCV | ||
71 | ff_blockdsp_init_riscv(c); | ||
72 | #elif ARCH_X86 | ||
73 | 1495 | ff_blockdsp_init_x86(c); | |
74 | #elif ARCH_MIPS | ||
75 | ff_blockdsp_init_mips(c); | ||
76 | #endif | ||
77 | 1495 | } | |
78 |