1/*
2 * Copyright (c) 2021 Loongson Technology Corporation Limited
3 * Contributed by Hao Chen <chenhao@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_VC1DSP_LOONGARCH_H
23#define AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H
24
25#include "libavcodec/vc1dsp.h"
26#include "libavutil/avassert.h"
27
28void ff_vc1_inv_trans_8x8_lasx(int16_t block[64]);
29void ff_vc1_inv_trans_8x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
30void ff_vc1_inv_trans_8x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
31void ff_vc1_inv_trans_8x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
32void ff_vc1_inv_trans_4x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
33void ff_vc1_inv_trans_4x8_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *blokc);
34void ff_vc1_inv_trans_4x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
35void ff_vc1_inv_trans_4x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
36
37#define FF_PUT_VC1_MSPEL_MC_LASX(hmode, vmode)                                \
38void ff_put_vc1_mspel_mc ## hmode ## vmode ## _lasx(uint8_t *dst,             \
39                                                  const uint8_t *src,         \
40                                                  ptrdiff_t stride, int rnd); \
41void ff_put_vc1_mspel_mc ## hmode ## vmode ## _16_lasx(uint8_t *dst,          \
42                                                  const uint8_t *src,         \
43                                                  ptrdiff_t stride, int rnd);
44
45FF_PUT_VC1_MSPEL_MC_LASX(1, 1);
46FF_PUT_VC1_MSPEL_MC_LASX(1, 2);
47FF_PUT_VC1_MSPEL_MC_LASX(1, 3);
48
49FF_PUT_VC1_MSPEL_MC_LASX(2, 1);
50FF_PUT_VC1_MSPEL_MC_LASX(2, 2);
51FF_PUT_VC1_MSPEL_MC_LASX(2, 3);
52
53FF_PUT_VC1_MSPEL_MC_LASX(3, 1);
54FF_PUT_VC1_MSPEL_MC_LASX(3, 2);
55FF_PUT_VC1_MSPEL_MC_LASX(3, 3);
56
57#define FF_PUT_VC1_MSPEL_MC_V_LASX(vmode)                                 \
58void ff_put_vc1_mspel_mc0 ## vmode ## _16_lasx(uint8_t *dst,              \
59                                               const uint8_t *src,        \
60                                               ptrdiff_t stride, int rnd);
61
62FF_PUT_VC1_MSPEL_MC_V_LASX(1);
63FF_PUT_VC1_MSPEL_MC_V_LASX(2);
64FF_PUT_VC1_MSPEL_MC_V_LASX(3);
65
66#define FF_PUT_VC1_MSPEL_MC_H_LASX(hmode)                                 \
67void ff_put_vc1_mspel_mc ## hmode ## 0_16_lasx(uint8_t *dst,              \
68                                               const uint8_t *src,        \
69                                               ptrdiff_t stride, int rnd);
70
71FF_PUT_VC1_MSPEL_MC_H_LASX(1);
72FF_PUT_VC1_MSPEL_MC_H_LASX(2);
73FF_PUT_VC1_MSPEL_MC_H_LASX(3);
74
75void ff_put_no_rnd_vc1_chroma_mc8_lasx(uint8_t *dst /* align 8 */,
76                                       uint8_t *src /* align 1 */,
77                                       ptrdiff_t stride, int h, int x, int y);
78
79#endif /* AVCODEC_LOONGARCH_VC1DSP_LOONGARCH_H */
80