FFmpeg
h2656dsp.h
Go to the documentation of this file.
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 #ifndef AVCODEC_X86_H26X_H2656DSP_H
25 #define AVCODEC_X86_H26X_H2656DSP_H
26 
27 #include "config.h"
28 #include "libavutil/x86/asm.h"
29 #include "libavutil/x86/cpu.h"
30 #include <stdlib.h>
31 
32 #define H2656_PEL_PROTOTYPE(name, D, opt) \
33 void ff_h2656_put_ ## name ## _ ## D ## _##opt(int16_t *dst, ptrdiff_t dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width); \
34 void ff_h2656_put_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t *hf, const int8_t *vf, int width) \
35 
36 #define H2656_MC_8TAP_PROTOTYPES(fname, bitd, opt) \
37  H2656_PEL_PROTOTYPE(fname##4, bitd, opt); \
38  H2656_PEL_PROTOTYPE(fname##6, bitd, opt); \
39  H2656_PEL_PROTOTYPE(fname##8, bitd, opt); \
40  H2656_PEL_PROTOTYPE(fname##12, bitd, opt); \
41  H2656_PEL_PROTOTYPE(fname##16, bitd, opt); \
42  H2656_PEL_PROTOTYPE(fname##32, bitd, opt); \
43  H2656_PEL_PROTOTYPE(fname##64, bitd, opt); \
44  H2656_PEL_PROTOTYPE(fname##128, bitd, opt)
45 
46 H2656_MC_8TAP_PROTOTYPES(pixels , 8, sse4);
47 H2656_MC_8TAP_PROTOTYPES(pixels , 10, sse4);
48 H2656_MC_8TAP_PROTOTYPES(pixels , 12, sse4);
49 H2656_MC_8TAP_PROTOTYPES(8tap_h , 8, sse4);
50 H2656_MC_8TAP_PROTOTYPES(8tap_h , 10, sse4);
51 H2656_MC_8TAP_PROTOTYPES(8tap_h , 12, sse4);
52 H2656_MC_8TAP_PROTOTYPES(8tap_v , 8, sse4);
53 H2656_MC_8TAP_PROTOTYPES(8tap_v , 10, sse4);
54 H2656_MC_8TAP_PROTOTYPES(8tap_v , 12, sse4);
55 H2656_MC_8TAP_PROTOTYPES(8tap_hv , 8, sse4);
56 H2656_MC_8TAP_PROTOTYPES(8tap_hv , 10, sse4);
57 H2656_MC_8TAP_PROTOTYPES(8tap_hv , 12, sse4);
58 
59 #define H2656_MC_4TAP_PROTOTYPES(fname, bitd, opt) \
60  H2656_PEL_PROTOTYPE(fname##2, bitd, opt); \
61  H2656_PEL_PROTOTYPE(fname##4, bitd, opt); \
62  H2656_PEL_PROTOTYPE(fname##6, bitd, opt); \
63  H2656_PEL_PROTOTYPE(fname##8, bitd, opt); \
64  H2656_PEL_PROTOTYPE(fname##12, bitd, opt); \
65  H2656_PEL_PROTOTYPE(fname##16, bitd, opt); \
66  H2656_PEL_PROTOTYPE(fname##32, bitd, opt); \
67  H2656_PEL_PROTOTYPE(fname##64, bitd, opt); \
68  H2656_PEL_PROTOTYPE(fname##128, bitd, opt)
69 
70 #define H2656_MC_4TAP_PROTOTYPES_SSE4(bitd) \
71  H2656_PEL_PROTOTYPE(pixels2, bitd, sse4); \
72  H2656_MC_4TAP_PROTOTYPES(4tap_h, bitd, sse4); \
73  H2656_MC_4TAP_PROTOTYPES(4tap_v, bitd, sse4); \
74  H2656_MC_4TAP_PROTOTYPES(4tap_hv, bitd, sse4); \
75 
79 
80 #define H2656_MC_8TAP_PROTOTYPES_AVX2(fname) \
81  H2656_PEL_PROTOTYPE(fname##32 , 8, avx2); \
82  H2656_PEL_PROTOTYPE(fname##64 , 8, avx2); \
83  H2656_PEL_PROTOTYPE(fname##128, 8, avx2); \
84  H2656_PEL_PROTOTYPE(fname##16 ,10, avx2); \
85  H2656_PEL_PROTOTYPE(fname##32 ,10, avx2); \
86  H2656_PEL_PROTOTYPE(fname##64 ,10, avx2); \
87  H2656_PEL_PROTOTYPE(fname##128,10, avx2); \
88  H2656_PEL_PROTOTYPE(fname##16 ,12, avx2); \
89  H2656_PEL_PROTOTYPE(fname##32 ,12, avx2); \
90  H2656_PEL_PROTOTYPE(fname##64 ,12, avx2); \
91  H2656_PEL_PROTOTYPE(fname##128,12, avx2) \
92 
97 H2656_PEL_PROTOTYPE(8tap_hv16, 8, avx2);
98 
102 
103 #endif
cpu.h
H2656_MC_8TAP_PROTOTYPES_AVX2
#define H2656_MC_8TAP_PROTOTYPES_AVX2(fname)
Definition: h2656dsp.h:80
H2656_PEL_PROTOTYPE
#define H2656_PEL_PROTOTYPE(name, D, opt)
Definition: h2656dsp.h:32
asm.h
H2656_MC_4TAP_PROTOTYPES_SSE4
#define H2656_MC_4TAP_PROTOTYPES_SSE4(bitd)
Definition: h2656dsp.h:70
H2656_MC_8TAP_PROTOTYPES
#define H2656_MC_8TAP_PROTOTYPES(fname, bitd, opt)
Definition: h2656dsp.h:36