FFmpeg
Loading...
Searching...
No Matches
vc1dsp_init_loongarch.c
Go to the documentation of this file.
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
24#include "libavcodec/vc1dsp.h"
25#include "vc1dsp_loongarch.h"
26
27#define FN_ASSIGN(OP, X, Y, INSN) \
28 dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##INSN; \
29 dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##_16##INSN
30
31#define FN_ASSIGN_V(OP, Y, INSN) \
32 dsp->OP##vc1_mspel_pixels_tab[0][4*Y] = ff_##OP##vc1_mspel_mc0##Y##_16##INSN
33
34#define FN_ASSIGN_H(OP, X, INSN) \
35 dsp->OP##vc1_mspel_pixels_tab[0][X] = ff_##OP##vc1_mspel_mc##X##0_16##INSN
36
38{
40
41 if (have_lasx(cpu_flags)) {
50 FN_ASSIGN(put_, 1, 1, _lasx);
51 FN_ASSIGN(put_, 1, 2, _lasx);
52 FN_ASSIGN(put_, 1, 3, _lasx);
53 FN_ASSIGN(put_, 2, 1, _lasx);
54 FN_ASSIGN(put_, 2, 2, _lasx);
55 FN_ASSIGN(put_, 2, 3, _lasx);
56 FN_ASSIGN(put_, 3, 1, _lasx);
57 FN_ASSIGN(put_, 3, 2, _lasx);
58 FN_ASSIGN(put_, 3, 3, _lasx);
59 FN_ASSIGN_V(put_, 1, _lasx);
60 FN_ASSIGN_V(put_, 2, _lasx);
61 FN_ASSIGN_V(put_, 3, _lasx);
62 FN_ASSIGN_H(put_, 1, _lasx);
63 FN_ASSIGN_H(put_, 2, _lasx);
64 FN_ASSIGN_H(put_, 3, _lasx);
66 }
67}
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
static atomic_int cpu_flags
Definition cpu.c:56
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition cpu.c:109
#define have_lasx(flags)
Definition cpu.h:29
void(* vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:44
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]
Definition vc1dsp.h:65
void(* vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:45
void(* vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:41
void(* vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:40
void(* vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:42
void(* vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:46
void(* vc1_inv_trans_8x8)(int16_t *b)
Definition vc1dsp.h:39
void(* vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition vc1dsp.h:43
VC-1 and WMV3 decoder.
#define FN_ASSIGN_H(OP, X, INSN)
av_cold void ff_vc1dsp_init_loongarch(VC1DSPContext *dsp)
#define FN_ASSIGN(OP, X, Y, INSN)
#define FN_ASSIGN_V(OP, Y, INSN)
void ff_vc1_inv_trans_4x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_vc1_inv_trans_8x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_vc1_inv_trans_4x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_vc1_inv_trans_8x8_lasx(int16_t block[64])
Definition vc1dsp_lasx.c:25
void ff_vc1_inv_trans_4x8_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_vc1_inv_trans_4x4_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_vc1_inv_trans_8x8_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)
void ff_put_no_rnd_vc1_chroma_mc8_lasx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y)
void ff_vc1_inv_trans_8x4_dc_lasx(uint8_t *dest, ptrdiff_t stride, int16_t *block)