FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/x86/hevc/pred_init.c
Date: 2026-09-18 09:24:57
Exec Total Coverage
Lines: 13 13 100.0%
Functions: 1 1 100.0%
Branches: 6 6 100.0%

Line Branch Exec Source
1 /*
2 * SIMD-optimized HEVC intra prediction
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "config.h"
22
23 #include "libavutil/attributes.h"
24 #include "libavutil/cpu.h"
25 #include "libavutil/x86/cpu.h"
26 #include "libavcodec/hevc/pred.h"
27
28 #define PRED_PLANAR_FUNC(idx, opt) \
29 void ff_hevc_pred_planar_ ## idx ## _8_ ## opt(uint8_t *src, \
30 const uint8_t *top, \
31 const uint8_t *left, \
32 ptrdiff_t stride);
33
34 PRED_PLANAR_FUNC(0, ssse3)
35 PRED_PLANAR_FUNC(1, ssse3)
36 PRED_PLANAR_FUNC(2, ssse3)
37 PRED_PLANAR_FUNC(3, ssse3)
38
39 #define REF_FILTER_3TAP_FUNC(w, opt) \
40 void ff_hevc_ref_filter_3tap_ ## w ## x ## w ## _8_ ## opt( \
41 uint8_t *filtered_left, \
42 uint8_t *filtered_top, \
43 const uint8_t *left, \
44 const uint8_t *top, int size);
45
46 REF_FILTER_3TAP_FUNC( 8, sse2)
47 REF_FILTER_3TAP_FUNC(16, sse2)
48 REF_FILTER_3TAP_FUNC(32, sse2)
49
50 384 av_cold void ff_hevc_pred_init_x86(HEVCPredContext *hpc, int bit_depth)
51 {
52 384 int cpu_flags = av_get_cpu_flags();
53
54
2/2
✓ Branch 0 taken 273 times.
✓ Branch 1 taken 111 times.
384 if (bit_depth == 8) {
55
2/2
✓ Branch 0 taken 53 times.
✓ Branch 1 taken 220 times.
273 if (EXTERNAL_SSE2(cpu_flags)) {
56 53 hpc->ref_filter_3tap[0] = ff_hevc_ref_filter_3tap_8x8_8_sse2;
57 53 hpc->ref_filter_3tap[1] = ff_hevc_ref_filter_3tap_16x16_8_sse2;
58 53 hpc->ref_filter_3tap[2] = ff_hevc_ref_filter_3tap_32x32_8_sse2;
59 }
60
2/2
✓ Branch 0 taken 43 times.
✓ Branch 1 taken 230 times.
273 if (EXTERNAL_SSSE3(cpu_flags)) {
61 43 hpc->pred_planar[0] = ff_hevc_pred_planar_0_8_ssse3;
62 43 hpc->pred_planar[1] = ff_hevc_pred_planar_1_8_ssse3;
63 43 hpc->pred_planar[2] = ff_hevc_pred_planar_2_8_ssse3;
64 43 hpc->pred_planar[3] = ff_hevc_pred_planar_3_8_ssse3;
65 }
66 }
67 384 }
68