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 }
ff_vc1_v_loop_filter16_mmi
void ff_vc1_v_loop_filter16_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1574
ff_vc1_h_loop_filter8_mmi
void ff_vc1_h_loop_filter8_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1569
have_mmi
#define have_mmi(flags)
Definition: cpu.h:25
ff_vc1_inv_trans_8x4_msa
void ff_vc1_inv_trans_8x4_msa(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_msa.c:231
vc1dsp.h
VC1DSPContext::vc1_h_loop_filter8
void(* vc1_h_loop_filter8)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:52
ff_vc1_inv_trans_8x8_msa
void ff_vc1_inv_trans_8x8_msa(int16_t block[64])
Definition: vc1dsp_msa.c:28
VC1DSPContext::vc1_inv_trans_4x4
void(* vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:40
VC1DSPContext::avg_no_rnd_vc1_chroma_pixels_tab
h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:64
ff_vc1_inv_trans_8x4_mmi
void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
VC1DSPContext::vc1_h_overlap
void(* vc1_h_overlap)(uint8_t *src, int stride)
Definition: vc1dsp.h:46
VC1DSPContext::vc1_inv_trans_8x8_dc
void(* vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:41
ff_vc1dsp_init_mips
av_cold void ff_vc1dsp_init_mips(VC1DSPContext *dsp)
Definition: vc1dsp_init_mips.c:31
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:98
VC1DSPContext::put_no_rnd_vc1_chroma_pixels_tab
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:63
VC1DSPContext::vc1_inv_trans_4x4_dc
void(* vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:44
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:50
vc1dsp_mips.h
ff_vc1_inv_trans_8x4_dc_mmi
void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:418
VC1DSPContext::vc1_inv_trans_8x4_dc
void(* vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:42
av_cold
#define av_cold
Definition: attributes.h:90
ff_vc1_inv_trans_8x8_dc_mmi
void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:126
VC1DSPContext::vc1_v_loop_filter16
void(* vc1_v_loop_filter16)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:53
have_msa
#define have_msa(flags)
Definition: cpu.h:26
VC1DSPContext::vc1_v_overlap
void(* vc1_v_overlap)(uint8_t *src, int stride)
Definition: vc1dsp.h:45
VC1DSPContext::vc1_h_loop_filter4
void(* vc1_h_loop_filter4)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:50
VC1DSPContext::vc1_inv_trans_8x4
void(* vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:38
ff_vc1_inv_trans_8x8_mmi
void ff_vc1_inv_trans_8x8_mmi(int16_t block[64])
ff_vc1_h_loop_filter4_mmi
void ff_vc1_h_loop_filter4_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1559
ff_vc1_h_loop_filter16_mmi
void ff_vc1_h_loop_filter16_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1579
VC1DSPContext::vc1_h_loop_filter16
void(* vc1_h_loop_filter16)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:54
ff_put_no_rnd_vc1_chroma_mc8_mmi
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:2237
VC1DSPContext::vc1_inv_trans_4x8_dc
void(* vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:43
VC1DSPContext::vc1_h_s_overlap
void(* vc1_h_s_overlap)(int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
Definition: vc1dsp.h:48
ff_vc1_v_s_overlap_mmi
void ff_vc1_v_s_overlap_mmi(int16_t *top, int16_t *bottom)
Definition: vc1dsp_mmi.c:1454
VC1DSPContext::vc1_v_loop_filter4
void(* vc1_v_loop_filter4)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:49
ff_vc1_v_loop_filter8_mmi
void ff_vc1_v_loop_filter8_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1564
ff_vc1_inv_trans_4x4_mmi
void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:1174
ff_vc1_inv_trans_4x8_msa
void ff_vc1_inv_trans_4x8_msa(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_msa.c:140
attributes.h
VC1DSPContext::vc1_inv_trans_8x8
void(* vc1_inv_trans_8x8)(int16_t *b)
Definition: vc1dsp.h:37
FN_ASSIGN
#define FN_ASSIGN(OP, X, Y, INSN)
Definition: vc1dsp_init_mips.c:27
ff_avg_no_rnd_vc1_chroma_mc4_mmi
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:2406
ff_vc1_inv_trans_4x4_dc_mmi
void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:1124
ff_vc1_inv_trans_4x8_mmi
void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
VC1DSPContext
Definition: vc1dsp.h:35
ff_vc1_v_loop_filter4_mmi
void ff_vc1_v_loop_filter4_mmi(uint8_t *src, int stride, int pq)
Definition: vc1dsp_mmi.c:1554
ff_vc1_h_overlap_mmi
void ff_vc1_h_overlap_mmi(uint8_t *src, int stride)
Definition: vc1dsp_mmi.c:1378
VC1DSPContext::vc1_v_loop_filter8
void(* vc1_v_loop_filter8)(uint8_t *src, int stride, int pq)
Definition: vc1dsp.h:51
ff_vc1_inv_trans_4x8_dc_mmi
void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
Definition: vc1dsp_mmi.c:869
ff_vc1_v_overlap_mmi
void ff_vc1_v_overlap_mmi(uint8_t *src, int stride)
Definition: vc1dsp_mmi.c:1431
cpu.h
ff_vc1_h_s_overlap_mmi
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:1401
VC1DSPContext::vc1_inv_trans_4x8
void(* vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:39
VC1DSPContext::vc1_v_s_overlap
void(* vc1_v_s_overlap)(int16_t *top, int16_t *bottom)
Definition: vc1dsp.h:47
ff_put_no_rnd_vc1_chroma_mc4_mmi
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:2293
ff_avg_no_rnd_vc1_chroma_mc8_mmi
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:2347