FFmpeg
hevcdsp_lsx.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Loongson Technology Corporation Limited
3  * Contributed by Lu Wang <wanglu@loongson.cn>
4  * Hao Chen <chenhao@loongson.cn>
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 
23 #ifndef AVCODEC_LOONGARCH_HEVCDSP_LSX_H
24 #define AVCODEC_LOONGARCH_HEVCDSP_LSX_H
25 
26 #include "libavcodec/hevcdsp.h"
27 
28 #define MC(PEL, DIR, WIDTH) \
29 void ff_hevc_put_hevc_##PEL##_##DIR##WIDTH##_8_lsx(int16_t *dst, \
30  const uint8_t *src, \
31  ptrdiff_t src_stride, \
32  int height, \
33  intptr_t mx, \
34  intptr_t my, \
35  int width)
36 
37 MC(pel, pixels, 4);
38 MC(pel, pixels, 6);
39 MC(pel, pixels, 8);
40 MC(pel, pixels, 12);
41 MC(pel, pixels, 16);
42 MC(pel, pixels, 24);
43 MC(pel, pixels, 32);
44 MC(pel, pixels, 48);
45 MC(pel, pixels, 64);
46 
47 MC(qpel, h, 4);
48 MC(qpel, h, 8);
49 MC(qpel, h, 12);
50 MC(qpel, h, 16);
51 MC(qpel, h, 24);
52 MC(qpel, h, 32);
53 MC(qpel, h, 48);
54 MC(qpel, h, 64);
55 
56 MC(qpel, v, 4);
57 MC(qpel, v, 8);
58 MC(qpel, v, 12);
59 MC(qpel, v, 16);
60 MC(qpel, v, 24);
61 MC(qpel, v, 32);
62 MC(qpel, v, 48);
63 MC(qpel, v, 64);
64 
65 MC(qpel, hv, 4);
66 MC(qpel, hv, 8);
67 MC(qpel, hv, 12);
68 MC(qpel, hv, 16);
69 MC(qpel, hv, 24);
70 MC(qpel, hv, 32);
71 MC(qpel, hv, 48);
72 MC(qpel, hv, 64);
73 
74 MC(epel, h, 32);
75 
76 MC(epel, v, 16);
77 MC(epel, v, 24);
78 MC(epel, v, 32);
79 
80 MC(epel, hv, 8);
81 MC(epel, hv, 12);
82 MC(epel, hv, 16);
83 MC(epel, hv, 24);
84 MC(epel, hv, 32);
85 
86 #undef MC
87 
88 #define BI_MC(PEL, DIR, WIDTH) \
89 void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \
90  ptrdiff_t dst_stride, \
91  const uint8_t *src, \
92  ptrdiff_t src_stride, \
93  const int16_t *src_16bit, \
94  int height, \
95  intptr_t mx, \
96  intptr_t my, \
97  int width)
98 
99 BI_MC(pel, pixels, 4);
100 BI_MC(pel, pixels, 6);
101 BI_MC(pel, pixels, 8);
102 BI_MC(pel, pixels, 12);
103 BI_MC(pel, pixels, 16);
104 BI_MC(pel, pixels, 24);
105 BI_MC(pel, pixels, 32);
106 BI_MC(pel, pixels, 48);
107 BI_MC(pel, pixels, 64);
108 
109 BI_MC(qpel, h, 16);
110 BI_MC(qpel, h, 24);
111 BI_MC(qpel, h, 32);
112 BI_MC(qpel, h, 48);
113 BI_MC(qpel, h, 64);
114 
115 BI_MC(qpel, v, 8);
116 BI_MC(qpel, v, 16);
117 BI_MC(qpel, v, 24);
118 BI_MC(qpel, v, 32);
119 BI_MC(qpel, v, 48);
120 BI_MC(qpel, v, 64);
121 
122 BI_MC(qpel, hv, 8);
123 BI_MC(qpel, hv, 16);
124 BI_MC(qpel, hv, 24);
125 BI_MC(qpel, hv, 32);
126 BI_MC(qpel, hv, 48);
127 BI_MC(qpel, hv, 64);
128 
129 BI_MC(epel, h, 24);
130 BI_MC(epel, h, 32);
131 
132 BI_MC(epel, v, 12);
133 BI_MC(epel, v, 16);
134 BI_MC(epel, v, 24);
135 BI_MC(epel, v, 32);
136 
137 BI_MC(epel, hv, 6);
138 BI_MC(epel, hv, 8);
139 BI_MC(epel, hv, 16);
140 BI_MC(epel, hv, 24);
141 BI_MC(epel, hv, 32);
142 
143 #undef BI_MC
144 
145 #define UNI_MC(PEL, DIR, WIDTH) \
146 void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \
147  ptrdiff_t dst_stride, \
148  const uint8_t *src, \
149  ptrdiff_t src_stride, \
150  int height, \
151  intptr_t mx, \
152  intptr_t my, \
153  int width)
154 
155 UNI_MC(qpel, h, 64);
156 
157 UNI_MC(qpel, v, 24);
158 UNI_MC(qpel, v, 32);
159 UNI_MC(qpel, v, 48);
160 UNI_MC(qpel, v, 64);
161 
162 UNI_MC(qpel, hv, 8);
163 UNI_MC(qpel, hv, 16);
164 UNI_MC(qpel, hv, 24);
165 UNI_MC(qpel, hv, 32);
166 UNI_MC(qpel, hv, 48);
167 UNI_MC(qpel, hv, 64);
168 
169 UNI_MC(epel, v, 24);
170 UNI_MC(epel, v, 32);
171 
172 UNI_MC(epel, hv, 8);
173 UNI_MC(epel, hv, 12);
174 UNI_MC(epel, hv, 16);
175 UNI_MC(epel, hv, 24);
176 UNI_MC(epel, hv, 32);
177 
178 #undef UNI_MC
179 
180 #define UNI_W_MC(PEL, DIR, WIDTH) \
181 void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##WIDTH##_8_lsx(uint8_t *dst, \
182  ptrdiff_t \
183  dst_stride, \
184  const uint8_t *src, \
185  ptrdiff_t \
186  src_stride, \
187  int height, \
188  int denom, \
189  int weight, \
190  int offset, \
191  intptr_t mx, \
192  intptr_t my, \
193  int width)
194 
195 UNI_W_MC(qpel, hv, 8);
196 UNI_W_MC(qpel, hv, 16);
197 UNI_W_MC(qpel, hv, 24);
198 UNI_W_MC(qpel, hv, 32);
199 UNI_W_MC(qpel, hv, 48);
200 UNI_W_MC(qpel, hv, 64);
201 
202 #undef UNI_W_MC
203 
204 void ff_hevc_loop_filter_luma_h_8_lsx(uint8_t *src, ptrdiff_t stride,
205  int32_t beta, const int32_t *tc,
206  const uint8_t *p_is_pcm, const uint8_t *q_is_pcm);
207 
208 void ff_hevc_loop_filter_luma_v_8_lsx(uint8_t *src, ptrdiff_t stride,
209  int32_t beta, const int32_t *tc,
210  const uint8_t *p_is_pcm, const uint8_t *q_is_pcm);
211 
212 void ff_hevc_loop_filter_chroma_h_8_lsx(uint8_t *src, ptrdiff_t stride,
213  const int32_t *tc, const uint8_t *p_is_pcm,
214  const uint8_t *q_is_pcm);
215 
216 void ff_hevc_loop_filter_chroma_v_8_lsx(uint8_t *src, ptrdiff_t stride,
217  const int32_t *tc, const uint8_t *p_is_pcm,
218  const uint8_t *q_is_pcm);
219 
220 void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, const uint8_t *src,
221  ptrdiff_t stride_dst,
222  const int16_t *sao_offset_val,
223  int eo, int width, int height);
224 
225 void ff_hevc_idct_4x4_lsx(int16_t *coeffs, int col_limit);
226 void ff_hevc_idct_8x8_lsx(int16_t *coeffs, int col_limit);
227 void ff_hevc_idct_16x16_lsx(int16_t *coeffs, int col_limit);
228 void ff_hevc_idct_32x32_lsx(int16_t *coeffs, int col_limit);
229 
230 #endif // #ifndef AVCODEC_LOONGARCH_HEVCDSP_LSX_H
ff_hevc_loop_filter_chroma_v_8_lsx
void ff_hevc_loop_filter_chroma_v_8_lsx(uint8_t *src, ptrdiff_t stride, const int32_t *tc, const uint8_t *p_is_pcm, const uint8_t *q_is_pcm)
Definition: hevc_lpf_sao_lsx.c:917
ff_hevc_idct_8x8_lsx
void ff_hevc_idct_8x8_lsx(int16_t *coeffs, int col_limit)
Definition: hevc_idct_lsx.c:360
ff_hevc_sao_edge_filter_8_lsx
void ff_hevc_sao_edge_filter_8_lsx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride_dst, const int16_t *sao_offset_val, int eo, int width, int height)
Definition: hevc_lpf_sao_lsx.c:2367
ff_hevc_idct_16x16_lsx
void ff_hevc_idct_16x16_lsx(int16_t *coeffs, int col_limit)
Definition: hevc_idct_lsx.c:386
MC
#define MC(PEL, DIR, WIDTH)
Definition: hevcdsp_lsx.h:28
width
#define width
hevcdsp.h
height
#define height
BI_MC
#define BI_MC(PEL, DIR, WIDTH)
Definition: hevcdsp_lsx.h:88
stride
#define stride
Definition: h264pred_template.c:537
ff_hevc_loop_filter_chroma_h_8_lsx
void ff_hevc_loop_filter_chroma_h_8_lsx(uint8_t *src, ptrdiff_t stride, const int32_t *tc, const uint8_t *p_is_pcm, const uint8_t *q_is_pcm)
Definition: hevc_lpf_sao_lsx.c:863
ff_hevc_loop_filter_luma_h_8_lsx
void ff_hevc_loop_filter_luma_h_8_lsx(uint8_t *src, ptrdiff_t stride, int32_t beta, const int32_t *tc, const uint8_t *p_is_pcm, const uint8_t *q_is_pcm)
Definition: hevc_lpf_sao_lsx.c:26
ff_hevc_idct_32x32_lsx
void ff_hevc_idct_32x32_lsx(int16_t *coeffs, int col_limit)
Definition: hevc_idct_lsx.c:811
ff_hevc_idct_4x4_lsx
void ff_hevc_idct_4x4_lsx(int16_t *coeffs, int col_limit)
Definition: hevc_idct_lsx.c:330
tc
#define tc
Definition: regdef.h:69
ff_hevc_loop_filter_luma_v_8_lsx
void ff_hevc_loop_filter_luma_v_8_lsx(uint8_t *src, ptrdiff_t stride, int32_t beta, const int32_t *tc, const uint8_t *p_is_pcm, const uint8_t *q_is_pcm)
Definition: hevc_lpf_sao_lsx.c:438
UNI_MC
#define UNI_MC(PEL, DIR, WIDTH)
Definition: hevcdsp_lsx.h:145
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
UNI_W_MC
#define UNI_W_MC(PEL, DIR, WIDTH)
Definition: hevcdsp_lsx.h:180
int32_t
int32_t
Definition: audioconvert.c:56
h
h
Definition: vp9dsp_template.c:2038