FFmpeg
vc1dsp_init_mips.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/mips/cpu.h"
22 #include "libavutil/attributes.h"
23 #include "libavcodec/vc1dsp.h"
24 #include "vc1dsp_mips.h"
25 #include "config.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 
32 {
34 
35  if (have_mmi(cpu_flags)) {
36  #if _MIPS_SIM != _ABIO32
40 #endif
46 
51 
58 
59  FN_ASSIGN(put_, 0, 0, _mmi);
60  FN_ASSIGN(put_, 0, 1, _mmi);
61  FN_ASSIGN(put_, 0, 2, _mmi);
62  FN_ASSIGN(put_, 0, 3, _mmi);
63 
64  FN_ASSIGN(put_, 1, 0, _mmi);
65  //FN_ASSIGN(put_, 1, 1, _mmi);//FIXME
66  //FN_ASSIGN(put_, 1, 2, _mmi);//FIXME
67  //FN_ASSIGN(put_, 1, 3, _mmi);//FIXME
68 
69  FN_ASSIGN(put_, 2, 0, _mmi);
70  //FN_ASSIGN(put_, 2, 1, _mmi);//FIXME
71  //FN_ASSIGN(put_, 2, 2, _mmi);//FIXME
72  //FN_ASSIGN(put_, 2, 3, _mmi);//FIXME
73 
74  FN_ASSIGN(put_, 3, 0, _mmi);
75  //FN_ASSIGN(put_, 3, 1, _mmi);//FIXME
76  //FN_ASSIGN(put_, 3, 2, _mmi);//FIXME
77  //FN_ASSIGN(put_, 3, 3, _mmi);//FIXME
78 
79  FN_ASSIGN(avg_, 0, 0, _mmi);
80  FN_ASSIGN(avg_, 0, 1, _mmi);
81  FN_ASSIGN(avg_, 0, 2, _mmi);
82  FN_ASSIGN(avg_, 0, 3, _mmi);
83 
84  FN_ASSIGN(avg_, 1, 0, _mmi);
85  //FN_ASSIGN(avg_, 1, 1, _mmi);//FIXME
86  //FN_ASSIGN(avg_, 1, 2, _mmi);//FIXME
87  //FN_ASSIGN(avg_, 1, 3, _mmi);//FIXME
88 
89  FN_ASSIGN(avg_, 2, 0, _mmi);
90  //FN_ASSIGN(avg_, 2, 1, _mmi);//FIXME
91  //FN_ASSIGN(avg_, 2, 2, _mmi);//FIXME
92  //FN_ASSIGN(avg_, 2, 3, _mmi);//FIXME
93 
94  FN_ASSIGN(avg_, 3, 0, _mmi);
95  //FN_ASSIGN(avg_, 3, 1, _mmi);//FIXME
96  //FN_ASSIGN(avg_, 3, 2, _mmi);//FIXME
97  //FN_ASSIGN(avg_, 3, 3, _mmi);//FIXME
98 
103  }
104 
105  if (have_msa(cpu_flags)) {
109 
110  FN_ASSIGN(put_, 1, 1, _msa);
111  FN_ASSIGN(put_, 1, 2, _msa);
112  FN_ASSIGN(put_, 1, 3, _msa);
113  FN_ASSIGN(put_, 2, 1, _msa);
114  FN_ASSIGN(put_, 2, 2, _msa);
115  FN_ASSIGN(put_, 2, 3, _msa);
116  FN_ASSIGN(put_, 3, 1, _msa);
117  FN_ASSIGN(put_, 3, 2, _msa);
118  FN_ASSIGN(put_, 3, 3, _msa);
119  }
120 }
VC-1 and WMV3 decoder.
void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
void ff_avg_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
Definition: vc1dsp_mmi.c:2350
void ff_put_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
Definition: vc1dsp_mmi.c:2297
void(* vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:38
void(* vc1_v_loop_filter16)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:53
void ff_vc1_h_loop_filter8_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1568
void(* vc1_v_overlap)(uint8_t *src, int stride)
Definition: vc1dsp.h:45
void(* vc1_h_loop_filter16)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:54
void ff_vc1_inv_trans_8x8_msa(int16_t block[64])
Definition: vc1dsp_msa.c:28
static atomic_int cpu_flags
Definition: cpu.c:50
void(* vc1_h_s_overlap)(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
Definition: vc1dsp.h:48
void(* vc1_v_loop_filter4)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:49
Macro definitions for various function/variable attributes.
void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:123
void ff_vc1_inv_trans_8x4_msa(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_msa.c:231
#define av_cold
Definition: attributes.h:88
void(* vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:43
void(* vc1_inv_trans_8x8)(int16_t *b)
Definition: vc1dsp.h:37
av_cold void ff_vc1dsp_init_mips(VC1DSPContext *dsp)
void ff_vc1_h_loop_filter16_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1578
void(* vc1_h_loop_filter8)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:52
void(* vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:40
void ff_put_no_rnd_vc1_chroma_mc8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
Definition: vc1dsp_mmi.c:2242
void ff_vc1_v_s_overlap_mmi(int16_t *top, int16_t *bottom)
Definition: vc1dsp_mmi.c:1453
void ff_vc1_inv_trans_8x8_mmi(int16_t block[64])
void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:416
void ff_vc1_v_loop_filter8_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1563
void(* vc1_v_loop_filter8)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:51
#define have_mmi(flags)
Definition: cpu.h:25
void(* vc1_h_overlap)(uint8_t *src, int stride)
Definition: vc1dsp.h:46
void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:1171
#define FN_ASSIGN(OP, X, Y, INSN)
void(* vc1_v_s_overlap)(int16_t *top, int16_t *bottom)
Definition: vc1dsp.h:47
void(* vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:41
void ff_avg_no_rnd_vc1_chroma_mc4_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
Definition: vc1dsp_mmi.c:2408
h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:64
void ff_vc1_h_loop_filter4_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1558
void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:867
void(* vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:39
void(* vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:42
void ff_vc1_v_loop_filter4_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1553
void ff_vc1_v_overlap_mmi(uint8_t *src, int stride)
Definition: vc1dsp_mmi.c:1430
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:95
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:63
void(* vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:44
void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:1123
void ff_vc1_inv_trans_4x8_msa(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_msa.c:140
#define have_msa(flags)
Definition: cpu.h:26
void ff_vc1_h_overlap_mmi(uint8_t *src, int stride)
Definition: vc1dsp_mmi.c:1377
void(* vc1_h_loop_filter4)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:50
void ff_vc1_v_loop_filter16_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1573
void ff_vc1_h_s_overlap_mmi(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
Definition: vc1dsp_mmi.c:1400