• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
28 void ff_vc1_inv_trans_8x8_lasx(int16_t block[64]);
29 void ff_vc1_inv_trans_8x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
30 void ff_vc1_inv_trans_8x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
31 void ff_vc1_inv_trans_8x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
32 void ff_vc1_inv_trans_4x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
33 void ff_vc1_inv_trans_4x8_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *blokc);
34 void ff_vc1_inv_trans_4x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
35 void 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)                                \
38 void ff_put_vc1_mspel_mc ## hmode ## vmode ## _lasx(uint8_t *dst,             \
39                                                   const uint8_t *src,         \
40                                                   ptrdiff_t stride, int rnd); \
41 void ff_put_vc1_mspel_mc ## hmode ## vmode ## _16_lasx(uint8_t *dst,          \
42                                                   const uint8_t *src,         \
43                                                   ptrdiff_t stride, int rnd);
44 
45 FF_PUT_VC1_MSPEL_MC_LASX(1, 1);
46 FF_PUT_VC1_MSPEL_MC_LASX(1, 2);
47 FF_PUT_VC1_MSPEL_MC_LASX(1, 3);
48 
49 FF_PUT_VC1_MSPEL_MC_LASX(2, 1);
50 FF_PUT_VC1_MSPEL_MC_LASX(2, 2);
51 FF_PUT_VC1_MSPEL_MC_LASX(2, 3);
52 
53 FF_PUT_VC1_MSPEL_MC_LASX(3, 1);
54 FF_PUT_VC1_MSPEL_MC_LASX(3, 2);
55 FF_PUT_VC1_MSPEL_MC_LASX(3, 3);
56 
57 #define FF_PUT_VC1_MSPEL_MC_V_LASX(vmode)                                 \
58 void ff_put_vc1_mspel_mc0 ## vmode ## _16_lasx(uint8_t *dst,              \
59                                                const uint8_t *src,        \
60                                                ptrdiff_t stride, int rnd);
61 
62 FF_PUT_VC1_MSPEL_MC_V_LASX(1);
63 FF_PUT_VC1_MSPEL_MC_V_LASX(2);
64 FF_PUT_VC1_MSPEL_MC_V_LASX(3);
65 
66 #define FF_PUT_VC1_MSPEL_MC_H_LASX(hmode)                                 \
67 void ff_put_vc1_mspel_mc ## hmode ## 0_16_lasx(uint8_t *dst,              \
68                                                const uint8_t *src,        \
69                                                ptrdiff_t stride, int rnd);
70 
71 FF_PUT_VC1_MSPEL_MC_H_LASX(1);
72 FF_PUT_VC1_MSPEL_MC_H_LASX(2);
73 FF_PUT_VC1_MSPEL_MC_H_LASX(3);
74 
75 void 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