FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/x86/h26x/h2656dsp.c
Date: 2026-08-19 01:31:13
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 260 260 100.0%
Branches: 30 30 100.0%

Line Branch Exec Source
1 /*
2 * DSP for HEVC/VVC
3 *
4 * Copyright (C) 2022-2024 Nuo Mi
5 * Copyright (c) 2023-2024 Wu Jianhua
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #include "config.h"
25
26 #include "h2656dsp.h"
27
28 #define mc_rep_func(name, bitd, step, W, opt) \
29 void ff_h2656_put_##name##W##_##bitd##_##opt(int16_t *_dst, ptrdiff_t dststride, \
30 const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width) \
31 { \
32 int i; \
33 int16_t *dst; \
34 for (i = 0; i < W; i += step) { \
35 const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
36 dst = _dst + i; \
37 ff_h2656_put_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, height, hf, vf, width); \
38 } \
39 }
40
41 #define mc_rep_uni_func(name, bitd, step, W, opt) \
42 void ff_h2656_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \
43 const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width) \
44 { \
45 int i; \
46 uint8_t *dst; \
47 for (i = 0; i < W; i += step) { \
48 const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
49 dst = _dst + (i * ((bitd + 7) / 8)); \
50 ff_h2656_put_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
51 height, hf, vf, width); \
52 } \
53 }
54
55 #define mc_rep_funcs(name, bitd, step, W, opt) \
56 mc_rep_func(name, bitd, step, W, opt) \
57 mc_rep_uni_func(name, bitd, step, W, opt)
58
59 #define MC_REP_FUNCS_SSE4(fname) \
60 mc_rep_funcs(fname, 8, 16,128, sse4) \
61 mc_rep_funcs(fname, 8, 16, 64, sse4) \
62 mc_rep_funcs(fname, 8, 16, 32, sse4) \
63 mc_rep_funcs(fname, 10, 8,128, sse4) \
64 mc_rep_funcs(fname, 10, 8, 64, sse4) \
65 mc_rep_funcs(fname, 10, 8, 32, sse4) \
66 mc_rep_funcs(fname, 10, 8, 16, sse4) \
67 mc_rep_funcs(fname, 12, 8,128, sse4) \
68 mc_rep_funcs(fname, 12, 8, 64, sse4) \
69 mc_rep_funcs(fname, 12, 8, 32, sse4) \
70 mc_rep_funcs(fname, 12, 8, 16, sse4) \
71
72 #if ARCH_X86_64 && HAVE_SSE4_EXTERNAL
73
74
2/2
✓ Branch 1 taken 3996 times.
✓ Branch 2 taken 594 times.
9180 MC_REP_FUNCS_SSE4(pixels)
75
2/2
✓ Branch 1 taken 2072 times.
✓ Branch 2 taken 308 times.
4760 MC_REP_FUNCS_SSE4(4tap_h)
76
2/2
✓ Branch 1 taken 2072 times.
✓ Branch 2 taken 308 times.
4760 MC_REP_FUNCS_SSE4(4tap_v)
77
2/2
✓ Branch 1 taken 1890 times.
✓ Branch 2 taken 269 times.
4318 MC_REP_FUNCS_SSE4(4tap_hv)
78
2/2
✓ Branch 1 taken 1924 times.
✓ Branch 2 taken 286 times.
4420 MC_REP_FUNCS_SSE4(8tap_h)
79
2/2
✓ Branch 1 taken 1924 times.
✓ Branch 2 taken 286 times.
4420 MC_REP_FUNCS_SSE4(8tap_v)
80
2/2
✓ Branch 1 taken 2984 times.
✓ Branch 2 taken 864 times.
7696 MC_REP_FUNCS_SSE4(8tap_hv)
81
2/2
✓ Branch 1 taken 3806 times.
✓ Branch 2 taken 1903 times.
11418 mc_rep_funcs(8tap_hv, 8, 8, 16, sse4)
82
83 #if HAVE_AVX2_EXTERNAL
84
85 #define MC_REP_FUNCS_AVX2_NO8(fname) \
86 mc_rep_funcs(fname,10, 16, 32, avx2) \
87 mc_rep_funcs(fname,10, 16, 64, avx2) \
88 mc_rep_funcs(fname,10, 16,128, avx2) \
89 mc_rep_funcs(fname,12, 16, 32, avx2) \
90 mc_rep_funcs(fname,12, 16, 64, avx2) \
91 mc_rep_funcs(fname,12, 16,128, avx2) \
92
93 #define MC_REP_FUNCS_AVX2(fname) \
94 mc_rep_funcs(fname, 8, 32, 64, avx2) \
95 mc_rep_funcs(fname, 8, 32,128, avx2) \
96 MC_REP_FUNCS_AVX2_NO8(fname)
97
98
2/2
✓ Branch 1 taken 986 times.
✓ Branch 2 taken 232 times.
2436 MC_REP_FUNCS_AVX2(pixels)
99
2/2
✓ Branch 1 taken 476 times.
✓ Branch 2 taken 112 times.
1176 MC_REP_FUNCS_AVX2(8tap_h)
100
2/2
✓ Branch 1 taken 476 times.
✓ Branch 2 taken 112 times.
1176 MC_REP_FUNCS_AVX2(8tap_v)
101
2/2
✓ Branch 1 taken 392 times.
✓ Branch 2 taken 84 times.
952 MC_REP_FUNCS_AVX2_NO8(8tap_hv)
102
2/2
✓ Branch 1 taken 510 times.
✓ Branch 2 taken 120 times.
1260 MC_REP_FUNCS_AVX2(4tap_h)
103
2/2
✓ Branch 1 taken 510 times.
✓ Branch 2 taken 120 times.
1260 MC_REP_FUNCS_AVX2(4tap_v)
104
2/2
✓ Branch 1 taken 420 times.
✓ Branch 2 taken 90 times.
1020 MC_REP_FUNCS_AVX2_NO8(4tap_hv)
105 #endif
106 #endif
107