diff mbox

[FFmpeg-devel,4/7] avcodec/mips: loongson set xvid as default idct algorithm

Message ID 34c661e2.8e23.157ada3e9e7.Coremail.ipfootball@126.com
State Changes Requested
Headers show

Commit Message

周晓勇 Oct. 10, 2016, 8:09 a.m. UTC
From e4d648fd34601cbe23a54af5d9489537896c6478 Mon Sep 17 00:00:00 2001
From: Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
Date: Mon, 10 Oct 2016 14:42:58 +0800
Subject: [PATCH 4/7] avcodec/mips: loongson set xvid as default idct algorithm


---
 libavcodec/mips/idctdsp_init_mips.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Dec. 13, 2016, 12:41 a.m. UTC | #1
On Mon, Oct 10, 2016 at 04:09:43PM +0800, 周晓勇 wrote:
> From e4d648fd34601cbe23a54af5d9489537896c6478 Mon Sep 17 00:00:00 2001
> From: Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
> Date: Mon, 10 Oct 2016 14:42:58 +0800
> Subject: [PATCH 4/7] avcodec/mips: loongson set xvid as default idct algorithm
> 
> 
> ---
>  libavcodec/mips/idctdsp_init_mips.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/libavcodec/mips/idctdsp_init_mips.c b/libavcodec/mips/idctdsp_init_mips.c
> index 8c26bca..7beb1f6 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,
> @@ -49,7 +50,9 @@ static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
>          (avctx->bits_per_raw_sample != 10) &&
>          (avctx->bits_per_raw_sample != 12) &&
>          (avctx->idct_algo == FF_IDCT_AUTO)) {
> -                c->idct = ff_simple_idct_mmi;
> +                c->idct_put = ff_xvid_idct_put_mmi;
> +                c->idct_add = ff_xvid_idct_add_mmi;
> +                c->idct = ff_xvid_idct_mmi;
>                  c->perm_type = FF_IDCT_PERM_NONE;
>      }

This would affect encoders and some generated files would decode with
artifacts

[...]
diff mbox

Patch

diff --git a/libavcodec/mips/idctdsp_init_mips.c b/libavcodec/mips/idctdsp_init_mips.c
index 8c26bca..7beb1f6 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,
@@ -49,7 +50,9 @@  static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
         (avctx->bits_per_raw_sample != 10) &&
         (avctx->bits_per_raw_sample != 12) &&
         (avctx->idct_algo == FF_IDCT_AUTO)) {
-                c->idct = ff_simple_idct_mmi;
+                c->idct_put = ff_xvid_idct_put_mmi;
+                c->idct_add = ff_xvid_idct_add_mmi;
+                c->idct = ff_xvid_idct_mmi;
                 c->perm_type = FF_IDCT_PERM_NONE;
     }