FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/x86/h26x/h2656dsp.c
Date: 2024-05-03 15:42:48
Exec Total Coverage
Lines: 15 15 100.0%
Functions: 260 268 97.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 "h2656dsp.h"
25
26 #define mc_rep_func(name, bitd, step, W, opt) \
27 void ff_h2656_put_##name##W##_##bitd##_##opt(int16_t *_dst, ptrdiff_t dststride, \
28 const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width) \
29 { \
30 int i; \
31 int16_t *dst; \
32 for (i = 0; i < W; i += step) { \
33 const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
34 dst = _dst + i; \
35 ff_h2656_put_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, height, hf, vf, width); \
36 } \
37 }
38
39 #define mc_rep_uni_func(name, bitd, step, W, opt) \
40 void ff_h2656_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, \
41 const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width) \
42 { \
43 int i; \
44 uint8_t *dst; \
45 for (i = 0; i < W; i += step) { \
46 const uint8_t *src = _src + (i * ((bitd + 7) / 8)); \
47 dst = _dst + (i * ((bitd + 7) / 8)); \
48 ff_h2656_put_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride, \
49 height, hf, vf, width); \
50 } \
51 }
52
53 #define mc_rep_funcs(name, bitd, step, W, opt) \
54 mc_rep_func(name, bitd, step, W, opt) \
55 mc_rep_uni_func(name, bitd, step, W, opt)
56
57 #define MC_REP_FUNCS_SSE4(fname) \
58 mc_rep_funcs(fname, 8, 16,128, sse4) \
59 mc_rep_funcs(fname, 8, 16, 64, sse4) \
60 mc_rep_funcs(fname, 8, 16, 32, sse4) \
61 mc_rep_funcs(fname, 10, 8,128, sse4) \
62 mc_rep_funcs(fname, 10, 8, 64, sse4) \
63 mc_rep_funcs(fname, 10, 8, 32, sse4) \
64 mc_rep_funcs(fname, 10, 8, 16, sse4) \
65 mc_rep_funcs(fname, 12, 8,128, sse4) \
66 mc_rep_funcs(fname, 12, 8, 64, sse4) \
67 mc_rep_funcs(fname, 12, 8, 32, sse4) \
68 mc_rep_funcs(fname, 12, 8, 16, sse4) \
69
70 #if ARCH_X86_64 && HAVE_SSE4_EXTERNAL
71
72
2/2
✓ Branch 1 taken 3700 times.
✓ Branch 2 taken 550 times.
8500 MC_REP_FUNCS_SSE4(pixels)
73
2/2
✓ Branch 1 taken 1924 times.
✓ Branch 2 taken 286 times.
4420 MC_REP_FUNCS_SSE4(4tap_h)
74
2/2
✓ Branch 1 taken 1924 times.
✓ Branch 2 taken 286 times.
4420 MC_REP_FUNCS_SSE4(4tap_v)
75
2/2
✓ Branch 1 taken 1742 times.
✓ Branch 2 taken 247 times.
3978 MC_REP_FUNCS_SSE4(4tap_hv)
76
2/2
✓ Branch 1 taken 1776 times.
✓ Branch 2 taken 264 times.
4080 MC_REP_FUNCS_SSE4(8tap_h)
77
2/2
✓ Branch 1 taken 1776 times.
✓ Branch 2 taken 264 times.
4080 MC_REP_FUNCS_SSE4(8tap_v)
78
2/2
✓ Branch 1 taken 1608 times.
✓ Branch 2 taken 228 times.
3672 MC_REP_FUNCS_SSE4(8tap_hv)
79
2/2
✓ Branch 1 taken 360 times.
✓ Branch 2 taken 180 times.
1080 mc_rep_funcs(8tap_hv, 8, 8, 16, sse4)
80
81 #if HAVE_AVX2_EXTERNAL
82
83 #define MC_REP_FUNCS_AVX2(fname) \
84 mc_rep_funcs(fname, 8, 32, 64, avx2) \
85 mc_rep_funcs(fname, 8, 32,128, avx2) \
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
2/2
✓ Branch 1 taken 850 times.
✓ Branch 2 taken 200 times.
2100 MC_REP_FUNCS_AVX2(pixels)
94
2/2
✓ Branch 1 taken 408 times.
✓ Branch 2 taken 96 times.
1008 MC_REP_FUNCS_AVX2(8tap_h)
95
2/2
✓ Branch 1 taken 408 times.
✓ Branch 2 taken 96 times.
1008 MC_REP_FUNCS_AVX2(8tap_v)
96
2/2
✓ Branch 1 taken 336 times.
✓ Branch 2 taken 72 times.
816 MC_REP_FUNCS_AVX2(8tap_hv)
97
2/2
✓ Branch 1 taken 442 times.
✓ Branch 2 taken 104 times.
1092 MC_REP_FUNCS_AVX2(4tap_h)
98
2/2
✓ Branch 1 taken 442 times.
✓ Branch 2 taken 104 times.
1092 MC_REP_FUNCS_AVX2(4tap_v)
99
2/2
✓ Branch 1 taken 364 times.
✓ Branch 2 taken 78 times.
884 MC_REP_FUNCS_AVX2(4tap_hv)
100 #endif
101 #endif
102