[FFmpeg-devel] [PATCH v5 4/6] libavcodec: Enable runtime detection for MIPS MMI & MSA

Shiyou Yin yinshiyou-hf at loongson.cn
Thu Jul 16 14:21:05 EEST 2020


>-----Original Message-----
>From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
>Jiaxun Yang
>Sent: Thursday, July 2, 2020 11:46 PM
>To: ffmpeg-devel at ffmpeg.org
>Cc: Jiaxun Yang
>Subject: [FFmpeg-devel] [PATCH v5 4/6] libavcodec: Enable runtime detection for MIPS MMI & MSA
>
>Apply optimized functions according to cpuflags.
>MSA is usually put after MMI as it's generally faster than MMI.
>
>Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
>--

>diff --git a/libavcodec/mips/wmv2dsp_mips.h b/libavcodec/mips/wmv2dsp_mips.h
>index 22894c505d..f7313460fb 100644
>--- a/libavcodec/mips/wmv2dsp_mips.h
>+++ b/libavcodec/mips/wmv2dsp_mips.h
>@@ -23,7 +23,7 @@
>
> #include "libavcodec/wmv2dsp.h"
>
>-void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block);
>-void ff_wmv2_idct_put_mmi(uint8_t *dest, int line_size, int16_t *block);
>+void ff_wmv2_idct_add_mmi(uint8_t *dest, long int line_size, int16_t *block);
>+void ff_wmv2_idct_put_mmi(uint8_t *dest, long int line_size, int16_t *block);
>

Type of line_size should be ptrdiff_t.

> #endif /* AVCODEC_MIPS_WMV2DSP_MIPS_H */
>diff --git a/libavcodec/mips/wmv2dsp_mmi.c b/libavcodec/mips/wmv2dsp_mmi.c
>index 1f6ccb299b..8796ebe195 100644
>--- a/libavcodec/mips/wmv2dsp_mmi.c
>+++ b/libavcodec/mips/wmv2dsp_mmi.c
>@@ -95,7 +95,7 @@ static void wmv2_idct_col_mmi(short * b)
>     b[56] = (a0 + a2 - a1 - a5 + 8192) >> 14;
> }
>
>-void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block)
>+void ff_wmv2_idct_add_mmi(uint8_t *dest, long int line_size, int16_t *block)
> {
>     int i;
>     double ftmp[11];
>@@ -212,7 +212,7 @@ void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block)
>     );
> }
>
>-void ff_wmv2_idct_put_mmi(uint8_t *dest, int line_size, int16_t *block)
>+void ff_wmv2_idct_put_mmi(uint8_t *dest, long int line_size, int16_t *block)

Type of line_size in this two functions should be ptrdiff_t.

> {
>     int i;
>     double ftmp[8];




More information about the ffmpeg-devel mailing list