summaryrefslogtreecommitdiffstats
path: root/libavcodec/mips/hevcdsp_init_mips.c
diff options
context:
space:
mode:
authorShiyou Yin <yinshiyou-hf@loongson.cn>2019-01-18 14:42:20 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-20 00:44:02 +0100
commit32421602dfb18c58a9563b748c199955fc158abc (patch)
treea1dcf860769dd3cd137c782a5786129a8ac2128e /libavcodec/mips/hevcdsp_init_mips.c
parent32fb83e4318845a7f44f7bed02d5963b9e81804e (diff)
downloadffmpeg-streaming-32421602dfb18c58a9563b748c199955fc158abc.zip
ffmpeg-streaming-32421602dfb18c58a9563b748c199955fc158abc.tar.gz
avcodec/mips: [loongson] optimize put_hevc_pel_bi_pixels_8 with mmi.
Optimize put_hevc_pel_bi_pixels_8 with mmi in the case width=8/16/24/32/48/64. This optimization improved HEVC decoding performance 2%(1.77x to 1.81x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mips/hevcdsp_init_mips.c')
-rw-r--r--libavcodec/mips/hevcdsp_init_mips.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/mips/hevcdsp_init_mips.c b/libavcodec/mips/hevcdsp_init_mips.c
index 776d13e..41c9001 100644
--- a/libavcodec/mips/hevcdsp_init_mips.c
+++ b/libavcodec/mips/hevcdsp_init_mips.c
@@ -20,6 +20,26 @@
#include "libavcodec/mips/hevcdsp_mips.h"
+#if HAVE_MMI
+static av_cold void hevc_dsp_init_mmi(HEVCDSPContext *c,
+ const int bit_depth)
+{
+ if (8 == bit_depth) {
+ c->put_hevc_qpel_bi[3][0][0] = ff_hevc_put_hevc_pel_bi_pixels8_8_mmi;
+ c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_pel_bi_pixels16_8_mmi;
+ c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_pel_bi_pixels24_8_mmi;
+ c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_pel_bi_pixels32_8_mmi;
+ c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_pel_bi_pixels48_8_mmi;
+ c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_pel_bi_pixels64_8_mmi;
+
+ c->put_hevc_epel_bi[3][0][0] = ff_hevc_put_hevc_pel_bi_pixels8_8_mmi;
+ c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_pel_bi_pixels16_8_mmi;
+ c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_pel_bi_pixels24_8_mmi;
+ c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_pel_bi_pixels32_8_mmi;
+ }
+}
+#endif // #if HAVE_MMI
+
#if HAVE_MSA
static av_cold void hevc_dsp_init_msa(HEVCDSPContext *c,
const int bit_depth)
@@ -448,6 +468,9 @@ static av_cold void hevc_dsp_init_msa(HEVCDSPContext *c,
void ff_hevc_dsp_init_mips(HEVCDSPContext *c, const int bit_depth)
{
+#if HAVE_MMI
+ hevc_dsp_init_mmi(c, bit_depth);
+#endif // #if HAVE_MMI
#if HAVE_MSA
hevc_dsp_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
OpenPOWER on IntegriCloud