FFmpeg
Loading...
Searching...
No Matches
hevcdsp_lasx.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Loongson Technology Corporation Limited
3 * Contributed by jinbo <jinbo@loongson.cn>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef AVCODEC_LOONGARCH_HEVCDSP_LASX_H
23#define AVCODEC_LOONGARCH_HEVCDSP_LASX_H
24
25#include "libavcodec/hevc/dsp.h"
26
27#define PEL_UNI_W(PEL, DIR, WIDTH) \
28void ff_hevc_put_hevc_##PEL##_uni_w_##DIR##WIDTH##_8_lasx(uint8_t *dst, \
29 ptrdiff_t \
30 dst_stride, \
31 const uint8_t *src, \
32 ptrdiff_t \
33 src_stride, \
34 int height, \
35 int denom, \
36 int wx, \
37 int ox, \
38 intptr_t mx, \
39 intptr_t my, \
40 int width)
41
42PEL_UNI_W(pel, pixels, 6);
43PEL_UNI_W(pel, pixels, 8);
44PEL_UNI_W(pel, pixels, 12);
45PEL_UNI_W(pel, pixels, 16);
46PEL_UNI_W(pel, pixels, 24);
47PEL_UNI_W(pel, pixels, 32);
48PEL_UNI_W(pel, pixels, 48);
49PEL_UNI_W(pel, pixels, 64);
50
51PEL_UNI_W(qpel, v, 8);
52PEL_UNI_W(qpel, v, 12);
53PEL_UNI_W(qpel, v, 16);
54PEL_UNI_W(qpel, v, 24);
55PEL_UNI_W(qpel, v, 32);
56PEL_UNI_W(qpel, v, 48);
57PEL_UNI_W(qpel, v, 64);
58
59PEL_UNI_W(qpel, h, 4);
60PEL_UNI_W(qpel, h, 6);
61PEL_UNI_W(qpel, h, 8);
62PEL_UNI_W(qpel, h, 12);
63PEL_UNI_W(qpel, h, 16);
64PEL_UNI_W(qpel, h, 24);
65PEL_UNI_W(qpel, h, 32);
66PEL_UNI_W(qpel, h, 48);
67PEL_UNI_W(qpel, h, 64);
68
69PEL_UNI_W(epel, hv, 6);
70PEL_UNI_W(epel, hv, 8);
71PEL_UNI_W(epel, hv, 12);
72PEL_UNI_W(epel, hv, 16);
73PEL_UNI_W(epel, hv, 24);
74PEL_UNI_W(epel, hv, 32);
75PEL_UNI_W(epel, hv, 48);
76PEL_UNI_W(epel, hv, 64);
77
78PEL_UNI_W(epel, v, 6);
79PEL_UNI_W(epel, v, 8);
80PEL_UNI_W(epel, v, 12);
81PEL_UNI_W(epel, v, 16);
82PEL_UNI_W(epel, v, 24);
83PEL_UNI_W(epel, v, 32);
84PEL_UNI_W(epel, v, 48);
85PEL_UNI_W(epel, v, 64);
86
87PEL_UNI_W(epel, h, 6);
88PEL_UNI_W(epel, h, 8);
89PEL_UNI_W(epel, h, 12);
90PEL_UNI_W(epel, h, 16);
91PEL_UNI_W(epel, h, 24);
92PEL_UNI_W(epel, h, 32);
93PEL_UNI_W(epel, h, 48);
94PEL_UNI_W(epel, h, 64);
95
96#undef PEL_UNI_W
97
98#define UNI_MC(PEL, DIR, WIDTH) \
99void ff_hevc_put_hevc_uni_##PEL##_##DIR##WIDTH##_8_lasx(uint8_t *dst, \
100 ptrdiff_t dst_stride, \
101 const uint8_t *src, \
102 ptrdiff_t src_stride, \
103 int height, \
104 intptr_t mx, \
105 intptr_t my, \
106 int width)
107UNI_MC(qpel, h, 12);
108UNI_MC(qpel, h, 16);
109UNI_MC(qpel, h, 24);
110UNI_MC(qpel, h, 32);
111UNI_MC(qpel, h, 48);
112UNI_MC(qpel, h, 64);
113
114#undef UNI_MC
115
116#define BI_MC(PEL, DIR, WIDTH) \
117void ff_hevc_put_hevc_bi_##PEL##_##DIR##WIDTH##_8_lasx(uint8_t *dst, \
118 ptrdiff_t dst_stride, \
119 const uint8_t *src, \
120 ptrdiff_t src_stride, \
121 const int16_t *src_16bit, \
122 int height, \
123 intptr_t mx, \
124 intptr_t my, \
125 int width)
126BI_MC(epel, h, 12);
127BI_MC(epel, h, 16);
128BI_MC(epel, h, 32);
129BI_MC(epel, h, 48);
130BI_MC(epel, h, 64);
131
132#undef BI_MC
133
134void ff_hevc_idct_32x32_lasx(int16_t *coeffs, int col_limit);
135
136#endif // #ifndef AVCODEC_LOONGARCH_HEVCDSP_LASX_H
#define UNI_MC(PEL, DIR, WIDTH)
#define BI_MC(PEL, DIR, WIDTH)
#define PEL_UNI_W(PEL, DIR, WIDTH)
void ff_hevc_idct_32x32_lasx(int16_t *coeffs, int col_limit)