FFmpeg
vp9dsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 Institue of Software Chinese Academy of Sciences (ISCAS).
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 #ifndef AVCODEC_RISCV_VP9DSP_H
22 #define AVCODEC_RISCV_VP9DSP_H
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 
27 void ff_dc_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
28  const uint8_t *a);
29 void ff_dc_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
30  const uint8_t *a);
31 void ff_dc_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
32  const uint8_t *a);
33 void ff_dc_top_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
34  const uint8_t *a);
35 void ff_dc_top_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
36  const uint8_t *a);
37 void ff_dc_top_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
38  const uint8_t *a);
39 void ff_dc_left_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
40  const uint8_t *a);
41 void ff_dc_left_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
42  const uint8_t *a);
43 void ff_dc_left_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
44  const uint8_t *a);
45 void ff_dc_127_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
46  const uint8_t *a);
47 void ff_dc_127_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
48  const uint8_t *a);
49 void ff_dc_127_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
50  const uint8_t *a);
51 void ff_dc_128_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
52  const uint8_t *a);
53 void ff_dc_128_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
54  const uint8_t *a);
55 void ff_dc_128_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
56  const uint8_t *a);
57 void ff_dc_129_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
58  const uint8_t *a);
59 void ff_dc_129_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
60  const uint8_t *a);
61 void ff_dc_129_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
62  const uint8_t *a);
63 void ff_h_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
64  const uint8_t *a);
65 void ff_h_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
66  const uint8_t *a);
67 void ff_h_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
68  const uint8_t *a);
69 void ff_tm_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
70  const uint8_t *a);
71 void ff_tm_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
72  const uint8_t *a);
73 void ff_tm_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
74  const uint8_t *a);
75 void ff_tm_4x4_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
76  const uint8_t *a);
77 
78 #define VP9_8TAP_RISCV_RVV_FUNC(SIZE, type, type_idx) \
79 void ff_put_8tap_##type##_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
80  const uint8_t *src, \
81  ptrdiff_t srcstride, \
82  int h, int mx, int my); \
83  \
84 void ff_put_8tap_##type##_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
85  const uint8_t *src, \
86  ptrdiff_t srcstride, \
87  int h, int mx, int my); \
88  \
89 void ff_put_8tap_##type##_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
90  const uint8_t *src, \
91  ptrdiff_t srcstride, \
92  int h, int mx, int my); \
93  \
94 void ff_avg_8tap_##type##_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
95  const uint8_t *src, \
96  ptrdiff_t srcstride, \
97  int h, int mx, int my); \
98  \
99 void ff_avg_8tap_##type##_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
100  const uint8_t *src, \
101  ptrdiff_t srcstride, \
102  int h, int mx, int my); \
103  \
104 void ff_avg_8tap_##type##_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
105  const uint8_t *src, \
106  ptrdiff_t srcstride, \
107  int h, int mx, int my);
108 
109 #define VP9_BILINEAR_RISCV_RVV_FUNC(SIZE) \
110 void ff_put_vp9_bilin_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
111  const uint8_t *src, ptrdiff_t srcstride, \
112  int h, int mx, int my); \
113  \
114 void ff_put_vp9_bilin_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
115  const uint8_t *src, ptrdiff_t srcstride, \
116  int h, int mx, int my); \
117  \
118 void ff_put_vp9_bilin_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
119  const uint8_t *src, ptrdiff_t srcstride, \
120  int h, int mx, int my); \
121  \
122 void ff_avg_vp9_bilin_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
123  const uint8_t *src, ptrdiff_t srcstride, \
124  int h, int mx, int my); \
125  \
126 void ff_avg_vp9_bilin_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
127  const uint8_t *src, ptrdiff_t srcstride, \
128  int h, int mx, int my); \
129  \
130 void ff_avg_vp9_bilin_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
131  const uint8_t *src, ptrdiff_t srcstride, \
132  int h, int mx, int my);
133 
134 #define VP9_COPY_AVG_RISCV_RVV_FUNC(SIZE) \
135 void ff_vp9_copy##SIZE##_rvv(uint8_t *dst, ptrdiff_t dststride, \
136  const uint8_t *src, ptrdiff_t srcstride, \
137  int h, int mx, int my); \
138  \
139 void ff_vp9_avg##SIZE##_rvv(uint8_t *dst, ptrdiff_t dststride, \
140  const uint8_t *src, ptrdiff_t srcstride, \
141  int h, int mx, int my);
142 
148 
154 
160 
166 
172 
173 #define VP9_COPY_RISCV_RVI_FUNC(SIZE) \
174 void ff_copy##SIZE##_rvi(uint8_t *dst, ptrdiff_t dststride, \
175  const uint8_t *src, ptrdiff_t srcstride, \
176  int h, int mx, int my);
177 
183 
184 #undef VP9_8TAP_RISCV_RVV_FUNC
185 #undef VP9_BILINEAR_RISCV_RVV_FUNC
186 #undef VP9_COPY_AVG_RISCV_RVV_FUNC
187 
188 #endif // #ifndef AVCODEC_RISCV_VP9DSP_H
ff_dc_127_32x32_rvv
void ff_dc_127_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_h_32x32_rvv
void ff_h_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_8x8_rvv
void ff_dc_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
VP9_8TAP_RISCV_RVV_FUNC
#define VP9_8TAP_RISCV_RVV_FUNC(SIZE, type, type_idx)
Definition: vp9dsp.h:78
ff_dc_left_16x16_rvv
void ff_dc_left_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_tm_32x32_rvv
void ff_tm_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_129_16x16_rvv
void ff_dc_129_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_top_32x32_rvv
void ff_dc_top_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
VP9_COPY_AVG_RISCV_RVV_FUNC
#define VP9_COPY_AVG_RISCV_RVV_FUNC(SIZE)
Definition: vp9dsp.h:134
ff_dc_16x16_rvv
void ff_dc_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_tm_16x16_rvv
void ff_tm_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
VP9_COPY_RISCV_RVI_FUNC
#define VP9_COPY_RISCV_RVI_FUNC(SIZE)
Definition: vp9dsp.h:173
ff_h_8x8_rvv
void ff_h_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
FILTER_8TAP_SHARP
@ FILTER_8TAP_SHARP
Definition: vp9.h:67
ff_dc_127_8x8_rvv
void ff_dc_127_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_129_32x32_rvv
void ff_dc_129_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_32x32_rvv
void ff_dc_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_128_16x16_rvv
void ff_dc_128_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_top_8x8_rvv
void ff_dc_top_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_128_8x8_rvv
void ff_dc_128_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_h_16x16_rvv
void ff_h_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
FILTER_8TAP_REGULAR
@ FILTER_8TAP_REGULAR
Definition: vp9.h:66
ff_dc_129_8x8_rvv
void ff_dc_129_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_left_32x32_rvv
void ff_dc_left_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
ff_dc_127_16x16_rvv
void ff_dc_127_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
FILTER_8TAP_SMOOTH
@ FILTER_8TAP_SMOOTH
Definition: vp9.h:65
stride
#define stride
Definition: h264pred_template.c:537
ff_dc_top_16x16_rvv
void ff_dc_top_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_tm_8x8_rvv
void ff_tm_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_dc_left_8x8_rvv
void ff_dc_left_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
VP9_BILINEAR_RISCV_RVV_FUNC
#define VP9_BILINEAR_RISCV_RVV_FUNC(SIZE)
Definition: vp9dsp.h:109
smooth
static float smooth(DeshakeOpenCLContext *deshake_ctx, float *gauss_kernel, int length, float max_val, AVFifo *values)
Definition: vf_deshake_opencl.c:887
ff_dc_128_32x32_rvv
void ff_dc_128_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
ff_tm_4x4_rvv
void ff_tm_4x4_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)