1/*
2 * Copyright (c) 2021 Loongson Technology Corporation Limited
3 * Contributed by Shiyou Yin <yinshiyou-hf@loongson.cn>
4 *                Xiwei  Gu  <guxiwei-hf@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_H264DSP_LASX_H
24#define AVCODEC_LOONGARCH_H264DSP_LASX_H
25
26#include "libavcodec/h264dec.h"
27
28void ff_h264_h_lpf_luma_8_lasx(uint8_t *src, ptrdiff_t stride,
29                               int alpha, int beta, int8_t *tc0);
30void ff_h264_v_lpf_luma_8_lasx(uint8_t *src, ptrdiff_t stride,
31                               int alpha, int beta, int8_t *tc0);
32void ff_h264_h_lpf_luma_intra_8_lasx(uint8_t *src, ptrdiff_t stride,
33                                     int alpha, int beta);
34void ff_h264_v_lpf_luma_intra_8_lasx(uint8_t *src, ptrdiff_t stride,
35                                     int alpha, int beta);
36void ff_h264_h_lpf_chroma_8_lasx(uint8_t *src, ptrdiff_t stride,
37                                 int alpha, int beta, int8_t *tc0);
38void ff_h264_v_lpf_chroma_8_lasx(uint8_t *src, ptrdiff_t stride,
39                                 int alpha, int beta, int8_t *tc0);
40void ff_h264_h_lpf_chroma_intra_8_lasx(uint8_t *src, ptrdiff_t stride,
41                                       int alpha, int beta);
42void ff_h264_v_lpf_chroma_intra_8_lasx(uint8_t *src, ptrdiff_t stride,
43                                       int alpha, int beta);
44void ff_biweight_h264_pixels16_8_lasx(uint8_t *dst, uint8_t *src,
45                                      ptrdiff_t stride, int height,
46                                      int log2_denom, int weight_dst,
47                                      int weight_src, int offset_in);
48void ff_biweight_h264_pixels8_8_lasx(uint8_t *dst, uint8_t *src,
49                                     ptrdiff_t stride, int height,
50                                     int log2_denom, int weight_dst,
51                                     int weight_src, int offset);
52void ff_biweight_h264_pixels4_8_lasx(uint8_t *dst, uint8_t *src,
53                                     ptrdiff_t stride, int height,
54                                     int log2_denom, int weight_dst,
55                                     int weight_src, int offset);
56void ff_weight_h264_pixels16_8_lasx(uint8_t *src, ptrdiff_t stride,
57                                    int height, int log2_denom,
58                                    int weight_src, int offset_in);
59void ff_weight_h264_pixels8_8_lasx(uint8_t *src, ptrdiff_t stride,
60                                   int height, int log2_denom,
61                                   int weight_src, int offset);
62void ff_weight_h264_pixels4_8_lasx(uint8_t *src, ptrdiff_t stride,
63                                   int height, int log2_denom,
64                                   int weight_src, int offset);
65void ff_h264_add_pixels4_8_lasx(uint8_t *_dst, int16_t *_src, int stride);
66
67void ff_h264_add_pixels8_8_lasx(uint8_t *_dst, int16_t *_src, int stride);
68void ff_h264_idct_add_lasx(uint8_t *dst, int16_t *src, int32_t dst_stride);
69void ff_h264_idct8_addblk_lasx(uint8_t *dst, int16_t *src, int32_t dst_stride);
70void ff_h264_idct4x4_addblk_dc_lasx(uint8_t *dst, int16_t *src,
71                                    int32_t dst_stride);
72void ff_h264_idct8_dc_addblk_lasx(uint8_t *dst, int16_t *src,
73                                  int32_t dst_stride);
74void ff_h264_idct_add16_lasx(uint8_t *dst, const int32_t *blk_offset,
75                             int16_t *block, int32_t dst_stride,
76                             const uint8_t nzc[15 * 8]);
77void ff_h264_idct8_add4_lasx(uint8_t *dst, const int32_t *blk_offset,
78                             int16_t *block, int32_t dst_stride,
79                             const uint8_t nzc[15 * 8]);
80void ff_h264_idct_add8_lasx(uint8_t **dst, const int32_t *blk_offset,
81                            int16_t *block, int32_t dst_stride,
82                            const uint8_t nzc[15 * 8]);
83void ff_h264_idct_add8_422_lasx(uint8_t **dst, const int32_t *blk_offset,
84                                int16_t *block, int32_t dst_stride,
85                                const uint8_t nzc[15 * 8]);
86void ff_h264_idct_add16_intra_lasx(uint8_t *dst, const int32_t *blk_offset,
87                                   int16_t *block, int32_t dst_stride,
88                                   const uint8_t nzc[15 * 8]);
89void ff_h264_deq_idct_luma_dc_lasx(int16_t *dst, int16_t *src,
90                                   int32_t de_qval);
91
92void ff_h264_loop_filter_strength_lasx(int16_t bS[2][4][4], uint8_t nnz[40],
93                                       int8_t ref[2][40], int16_t mv[2][40][2],
94                                       int bidir, int edges, int step,
95                                       int mask_mv0, int mask_mv1, int field);
96
97#endif  // #ifndef AVCODEC_LOONGARCH_H264DSP_LASX_H
98