FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/vf_fsppdsp.h
Date: 2026-05-02 03:33:10
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
3 * Copyright (C) 2005 Nikolaj Poroshin <porosh3@psu.ru>
4 * Copyright (c) 2014 Arwa Arif <arwaarif1994@gmail.com>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23 #ifndef AVFILTER_FSPPDSP_H
24 #define AVFILTER_FSPPDSP_H
25
26 #include <stddef.h>
27 #include <stdint.h>
28
29 #include "config.h"
30
31 #include "libavutil/attributes_internal.h"
32
33 typedef struct FSPPDSPContext {
34 void (*store_slice)(uint8_t *restrict dst, int16_t *restrict src /* align 16 */,
35 ptrdiff_t dst_stride, ptrdiff_t src_stride,
36 ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
37
38 void (*store_slice2)(uint8_t *restrict dst, int16_t *restrict src /* align 16 */,
39 ptrdiff_t dst_stride, ptrdiff_t src_stride,
40 ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
41
42 void (*mul_thrmat)(const int16_t *restrict thr_adr_noq /* align 16 */,
43 int16_t *restrict thr_adr /* align 16 */, int q);
44
45 void (*column_fidct)(const int16_t *restrict thr_adr, const int16_t *restrict data,
46 int16_t *restrict output, int cnt);
47
48 void (*row_idct)(const int16_t *restrict workspace, int16_t *restrict output_adr,
49 ptrdiff_t output_stride, int cnt);
50
51 void (*row_fdct)(int16_t *restrict data, const uint8_t *restrict pixels,
52 ptrdiff_t line_size, int cnt);
53 } FSPPDSPContext;
54
55 FF_VISIBILITY_PUSH_HIDDEN
56 extern const uint8_t ff_fspp_dither[8][8];
57
58 void ff_store_slice_c(uint8_t *restrict dst, int16_t *restrict src,
59 ptrdiff_t dst_stride, ptrdiff_t src_stride,
60 ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
61 void ff_store_slice2_c(uint8_t *restrict dst, int16_t *restrict src,
62 ptrdiff_t dst_stride, ptrdiff_t src_stride,
63 ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
64 void ff_mul_thrmat_c(const int16_t *restrict thr_adr_noq, int16_t *restrict thr_adr, int q);
65 void ff_column_fidct_c(const int16_t *restrict thr_adr, const int16_t *restrict data,
66 int16_t *restrict output, int cnt);
67 void ff_row_idct_c(const int16_t *restrict workspace, int16_t *restrict output_adr,
68 ptrdiff_t output_stride, int cnt);
69 void ff_row_fdct_c(int16_t *restrict data, const uint8_t *restrict pixels,
70 ptrdiff_t line_size, int cnt);
71
72 void ff_fsppdsp_init_x86(FSPPDSPContext *fspp);
73 FF_VISIBILITY_POP_HIDDEN
74
75 42 static inline void ff_fsppdsp_init(FSPPDSPContext *fspp)
76 {
77 42 fspp->store_slice = ff_store_slice_c;
78 42 fspp->store_slice2 = ff_store_slice2_c;
79 42 fspp->mul_thrmat = ff_mul_thrmat_c;
80 42 fspp->column_fidct = ff_column_fidct_c;
81 42 fspp->row_idct = ff_row_idct_c;
82 42 fspp->row_fdct = ff_row_fdct_c;
83
84 #if ARCH_X86 && HAVE_X86ASM
85 42 ff_fsppdsp_init_x86(fspp);
86 #endif
87 42 }
88
89 #endif /* AVFILTER_FSPPDSP_H */
90