summaryrefslogtreecommitdiff
path: root/libavcodec/mips/idctdsp_init_mips.c
diff options
context:
space:
mode:
authorShiyou Yin <yinshiyou-hf@loongson.cn>2018-08-31 21:41:49 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-09-02 03:37:32 +0200
commitdf13b75aa18633f95761b34775ab5e6797d92c57 (patch)
treebdc8df903143764ab4fc756e628fd1b265720320 /libavcodec/mips/idctdsp_init_mips.c
parent1124df0397372c4d1dd798dc2cfb7d4e0f2bb890 (diff)
avcodec/mips: [loongson] reoptimize simple idct with mmi.
Performance of mpeg4 decoding improved about 23%(from 128fps to 158fps, tested on loongson 3A3000). Reoptimized following functions with mmi. 1. ff_simple_idct_put_8_mmi 2. ff_simple_idct_add_8_mmi 3. ff_simple_idct_8_mmi Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mips/idctdsp_init_mips.c')
-rw-r--r--libavcodec/mips/idctdsp_init_mips.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/mips/idctdsp_init_mips.c b/libavcodec/mips/idctdsp_init_mips.c
index 8c26bca538..bb33b55419 100644
--- a/libavcodec/mips/idctdsp_init_mips.c
+++ b/libavcodec/mips/idctdsp_init_mips.c
@@ -20,6 +20,7 @@
*/
#include "idctdsp_mips.h"
+#include "xvididct_mips.h"
#if HAVE_MSA
static av_cold void idctdsp_init_msa(IDCTDSPContext *c, AVCodecContext *avctx,
@@ -48,8 +49,10 @@ static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
(avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) &&
- (avctx->idct_algo == FF_IDCT_AUTO)) {
- c->idct = ff_simple_idct_mmi;
+ ((avctx->idct_algo == FF_IDCT_AUTO) || (avctx->idct_algo == FF_IDCT_SIMPLE))) {
+ c->idct_put = ff_simple_idct_put_8_mmi;
+ c->idct_add = ff_simple_idct_add_8_mmi;
+ c->idct = ff_simple_idct_8_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}