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/attributes.h"
22 #include "libavcodec/vc1dsp.h"
23 #include "vc1dsp_mips.h"
24 #include "config.h"
25 
26 #define FN_ASSIGN(OP, X, Y, INSN) \
27  dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##INSN; \
28  dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##_16##INSN
29 
30 #if HAVE_MMI
31 static av_cold void vc1dsp_init_mmi(VC1DSPContext *dsp)
32 {
33 #if _MIPS_SIM != _ABIO32
37 #endif
43 
48 
55 
56  FN_ASSIGN(put_, 0, 0, _mmi);
57  FN_ASSIGN(put_, 0, 1, _mmi);
58  FN_ASSIGN(put_, 0, 2, _mmi);
59  FN_ASSIGN(put_, 0, 3, _mmi);
60 
61  FN_ASSIGN(put_, 1, 0, _mmi);
62  //FN_ASSIGN(put_, 1, 1, _mmi);//FIXME
63  //FN_ASSIGN(put_, 1, 2, _mmi);//FIXME
64  //FN_ASSIGN(put_, 1, 3, _mmi);//FIXME
65 
66  FN_ASSIGN(put_, 2, 0, _mmi);
67  //FN_ASSIGN(put_, 2, 1, _mmi);//FIXME
68  //FN_ASSIGN(put_, 2, 2, _mmi);//FIXME
69  //FN_ASSIGN(put_, 2, 3, _mmi);//FIXME
70 
71  FN_ASSIGN(put_, 3, 0, _mmi);
72  //FN_ASSIGN(put_, 3, 1, _mmi);//FIXME
73  //FN_ASSIGN(put_, 3, 2, _mmi);//FIXME
74  //FN_ASSIGN(put_, 3, 3, _mmi);//FIXME
75 
76  FN_ASSIGN(avg_, 0, 0, _mmi);
77  FN_ASSIGN(avg_, 0, 1, _mmi);
78  FN_ASSIGN(avg_, 0, 2, _mmi);
79  FN_ASSIGN(avg_, 0, 3, _mmi);
80 
81  FN_ASSIGN(avg_, 1, 0, _mmi);
82  //FN_ASSIGN(avg_, 1, 1, _mmi);//FIXME
83  //FN_ASSIGN(avg_, 1, 2, _mmi);//FIXME
84  //FN_ASSIGN(avg_, 1, 3, _mmi);//FIXME
85 
86  FN_ASSIGN(avg_, 2, 0, _mmi);
87  //FN_ASSIGN(avg_, 2, 1, _mmi);//FIXME
88  //FN_ASSIGN(avg_, 2, 2, _mmi);//FIXME
89  //FN_ASSIGN(avg_, 2, 3, _mmi);//FIXME
90 
91  FN_ASSIGN(avg_, 3, 0, _mmi);
92  //FN_ASSIGN(avg_, 3, 1, _mmi);//FIXME
93  //FN_ASSIGN(avg_, 3, 2, _mmi);//FIXME
94  //FN_ASSIGN(avg_, 3, 3, _mmi);//FIXME
95 
100 }
101 #endif /* HAVE_MMI */
102 
103 #if HAVE_MSA
104 static av_cold void vc1dsp_init_msa(VC1DSPContext *dsp)
105 {
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 #endif /* HAVE_MSA */
121 
123 {
124 #if HAVE_MMI
125  vc1dsp_init_mmi(dsp);
126 #endif /* HAVE_MMI */
127 #if HAVE_MSA
128  vc1dsp_init_msa(dsp);
129 #endif /* HAVE_MSA */
130 }
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
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:82
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
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
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
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