diff options
author | gxw <guxiwei-hf@loongson.cn> | 2019-10-21 15:56:47 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-30 18:09:00 +0100 |
commit | 648b422e171d5eab18f6c6fd346e4050d717b936 (patch) | |
tree | 838a0d9c88253b2f5c436e49d6b750fb17cd175e /libavcodec/mips/vc1dsp_init_mips.c | |
parent | af70c94c63cc0ccf6a8078e87c81d061b8765889 (diff) |
avcodec/mips: msa optimizations for vc1dsp
Performance of WMV3 decoding has speed up from 3.66x to 5.23x tested on 3A4000.
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mips/vc1dsp_init_mips.c')
-rw-r--r-- | libavcodec/mips/vc1dsp_init_mips.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/libavcodec/mips/vc1dsp_init_mips.c b/libavcodec/mips/vc1dsp_init_mips.c index 4adc9e1d4e..c0007ff650 100644 --- a/libavcodec/mips/vc1dsp_init_mips.c +++ b/libavcodec/mips/vc1dsp_init_mips.c @@ -23,6 +23,10 @@ #include "vc1dsp_mips.h" #include "config.h" +#define FN_ASSIGN(OP, X, Y, INSN) \ + dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##INSN; \ + dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##_16##INSN + #if HAVE_MMI static av_cold void vc1dsp_init_mmi(VC1DSPContext *dsp) { @@ -49,10 +53,6 @@ static av_cold void vc1dsp_init_mmi(VC1DSPContext *dsp) dsp->vc1_v_loop_filter16 = ff_vc1_v_loop_filter16_mmi; dsp->vc1_h_loop_filter16 = ff_vc1_h_loop_filter16_mmi; -#define FN_ASSIGN(OP, X, Y, INSN) \ - dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##INSN; \ - dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##_16##INSN - FN_ASSIGN(put_, 0, 0, _mmi); FN_ASSIGN(put_, 0, 1, _mmi); FN_ASSIGN(put_, 0, 2, _mmi); @@ -100,9 +100,31 @@ static av_cold void vc1dsp_init_mmi(VC1DSPContext *dsp) } #endif /* HAVE_MMI */ +#if HAVE_MSA +static av_cold void vc1dsp_init_msa(VC1DSPContext *dsp) +{ + dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_msa; + dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_msa; + dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_msa; + + FN_ASSIGN(put_, 1, 1, _msa); + FN_ASSIGN(put_, 1, 2, _msa); + FN_ASSIGN(put_, 1, 3, _msa); + FN_ASSIGN(put_, 2, 1, _msa); + FN_ASSIGN(put_, 2, 2, _msa); + FN_ASSIGN(put_, 2, 3, _msa); + FN_ASSIGN(put_, 3, 1, _msa); + FN_ASSIGN(put_, 3, 2, _msa); + FN_ASSIGN(put_, 3, 3, _msa); +} +#endif /* HAVE_MSA */ + av_cold void ff_vc1dsp_init_mips(VC1DSPContext *dsp) { #if HAVE_MMI vc1dsp_init_mmi(dsp); #endif /* HAVE_MMI */ +#if HAVE_MSA + vc1dsp_init_msa(dsp); +#endif /* HAVE_MSA */ } |