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_v_32x32_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
64  const uint8_t *a);
65 void ff_v_16x16_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
66  const uint8_t *a);
67 void ff_v_8x8_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
68  const uint8_t *a);
69 void ff_h_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
70  const uint8_t *a);
71 void ff_h_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
72  const uint8_t *a);
73 void ff_h_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
74  const uint8_t *a);
75 void ff_tm_32x32_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
76  const uint8_t *a);
77 void ff_tm_16x16_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
78  const uint8_t *a);
79 void ff_tm_8x8_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
80  const uint8_t *a);
81 void ff_tm_4x4_rvv(uint8_t *dst, ptrdiff_t stride, const uint8_t *l,
82  const uint8_t *a);
83 
84 #define VP9_8TAP_RISCV_RVV_FUNC(SIZE, type, type_idx) \
85 void ff_put_8tap_##type##_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
86  const uint8_t *src, \
87  ptrdiff_t srcstride, \
88  int h, int mx, int my); \
89  \
90 void ff_put_8tap_##type##_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
91  const uint8_t *src, \
92  ptrdiff_t srcstride, \
93  int h, int mx, int my); \
94  \
95 void ff_put_8tap_##type##_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
96  const uint8_t *src, \
97  ptrdiff_t srcstride, \
98  int h, int mx, int my); \
99  \
100 void ff_avg_8tap_##type##_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
101  const uint8_t *src, \
102  ptrdiff_t srcstride, \
103  int h, int mx, int my); \
104  \
105 void ff_avg_8tap_##type##_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
106  const uint8_t *src, \
107  ptrdiff_t srcstride, \
108  int h, int mx, int my); \
109  \
110 void ff_avg_8tap_##type##_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
111  const uint8_t *src, \
112  ptrdiff_t srcstride, \
113  int h, int mx, int my);
114 
115 #define VP9_BILINEAR_RISCV_RVV_FUNC(SIZE) \
116 void ff_put_bilin_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
117  const uint8_t *src, ptrdiff_t srcstride, \
118  int h, int mx, int my); \
119  \
120 void ff_put_bilin_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
121  const uint8_t *src, ptrdiff_t srcstride, \
122  int h, int mx, int my); \
123  \
124 void ff_put_bilin_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
125  const uint8_t *src, ptrdiff_t srcstride, \
126  int h, int mx, int my); \
127  \
128 void ff_avg_bilin_##SIZE##h_rvv(uint8_t *dst, ptrdiff_t dststride, \
129  const uint8_t *src, ptrdiff_t srcstride, \
130  int h, int mx, int my); \
131  \
132 void ff_avg_bilin_##SIZE##v_rvv(uint8_t *dst, ptrdiff_t dststride, \
133  const uint8_t *src, ptrdiff_t srcstride, \
134  int h, int mx, int my); \
135  \
136 void ff_avg_bilin_##SIZE##hv_rvv(uint8_t *dst, ptrdiff_t dststride, \
137  const uint8_t *src, ptrdiff_t srcstride, \
138  int h, int mx, int my);
139 
140 #define VP9_COPY_AVG_RISCV_RVV_FUNC(SIZE) \
141 void ff_copy##SIZE##_rvv(uint8_t *dst, ptrdiff_t dststride, \
142  const uint8_t *src, ptrdiff_t srcstride, \
143  int h, int mx, int my); \
144  \
145 void ff_avg##SIZE##_rvv(uint8_t *dst, ptrdiff_t dststride, \
146  const uint8_t *src, ptrdiff_t srcstride, \
147  int h, int mx, int my);
148 
154 
160 
166 
172 
178 
179 #define VP9_COPY_RISCV_RVI_FUNC(SIZE) \
180 void ff_copy##SIZE##_rvi(uint8_t *dst, ptrdiff_t dststride, \
181  const uint8_t *src, ptrdiff_t srcstride, \
182  int h, int mx, int my);
183 
189 
190 #undef VP9_8TAP_RISCV_RVV_FUNC
191 #undef VP9_BILINEAR_RISCV_RVV_FUNC
192 #undef VP9_COPY_AVG_RISCV_RVV_FUNC
193 
194 #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:84
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:140
ff_v_16x16_rvi
void ff_v_16x16_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
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:179
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_v_8x8_rvi
void ff_v_8x8_rvi(uint8_t *dst, ptrdiff_t stride, const uint8_t *l, const uint8_t *a)
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)
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_v_32x32_rvi
void ff_v_32x32_rvi(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:115
smooth
static float smooth(DeshakeOpenCLContext *deshake_ctx, float *gauss_kernel, int length, float max_val, AVFifo *values)
Definition: vf_deshake_opencl.c:888
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)