1 /*
2 * VVC DSP
3 *
4 * Copyright (C) 2021 Nuo Mi
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (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 GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
26
27 #define VVC_SIGN(v) (v < 0 ? -1 : !!v)
28
30 const int block_w, const int block_h)
31 {
32 int sad = 0;
33 dx -= 2;
34 dy -= 2;
37 for (int y = 0; y < block_h; y += 2) {
38 for (int x = 0; x < block_w; x++) {
40 }
43 }
44 return sad;
45 }
46
48 int *intra_mip_mode, const uint8_t mip_info)
49 {
50 if (intra_mip_transposed_flag)
51 *intra_mip_transposed_flag = (mip_info >> 1) & 0x1;
52 if (intra_mip_mode)
53 *intra_mip_mode = (mip_info >> 2) & 0
xf;
54 }
55
60
66
67 #define PROF_BORDER_EXT 1
68 #define PROF_BLOCK_SIZE (AFFINE_MIN_BLOCK_SIZE + PROF_BORDER_EXT * 2)
69
70 #define BDOF_BORDER_EXT 1
71 #define BDOF_BLOCK_SIZE 16
72 #define BDOF_MIN_BLOCK_SIZE 4
73
74 #define BIT_DEPTH 8
76 #undef BIT_DEPTH
77
78 #define BIT_DEPTH 10
80 #undef BIT_DEPTH
81
84 #undef BIT_DEPTH
85
87 {
88 #undef FUNC
89 #define FUNC(a, depth) a ## _ ## depth
90
91 #define VVC_DSP(depth) \
92 FUNC(ff_vvc_inter_dsp_init, depth)(&vvcdsp->inter); \
93 FUNC(ff_vvc_intra_dsp_init, depth)(&vvcdsp->intra); \
94 FUNC(ff_vvc_itx_dsp_init, depth)(&vvcdsp->itx); \
95 FUNC(ff_vvc_lmcs_dsp_init, depth)(&vvcdsp->lmcs); \
96 FUNC(ff_vvc_lf_dsp_init, depth)(&vvcdsp->lf); \
97 FUNC(ff_vvc_sao_dsp_init, depth)(&vvcdsp->sao); \
98 FUNC(ff_vvc_alf_dsp_init, depth)(&vvcdsp->alf); \
99
101 case 12:
103 break;
104 case 10:
106 break;
107 default:
109 break;
110 }
111
112 #if ARCH_AARCH64
114 #elif ARCH_RISCV
116 #elif ARCH_X86
118 #endif
119 }