diff mbox series

[FFmpeg-devel,1/2] avcodec/mips: [loongson] Fixed mmi optimization

Message ID 1599114592-21832-1-git-send-email-yinshiyou-hf@loongson.cn
State Accepted
Commit a4f7b09536c1d4b643992c03fa7105d2229da28e
Headers show
Series [FFmpeg-devel,1/2] avcodec/mips: [loongson] Fixed mmi optimization
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Shiyou Yin Sept. 3, 2020, 6:29 a.m. UTC
From: gxw <guxiwei-hf@loongson.cn>

Test case fate-checkasm-h264pred failed in latest community code.
This patch fixed the bug.

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
---
 libavcodec/mips/h264pred_mmi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Shiyou Yin Sept. 10, 2020, 11:05 a.m. UTC | #1
>-----Original Message-----
>From: ffmpeg-devel-bounces@ffmpeg.org [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of
>Shiyou Yin
>Sent: Thursday, September 3, 2020 2:30 PM
>To: ffmpeg-devel@ffmpeg.org
>Cc: gxw
>Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/mips: [loongson] Fixed mmi optimization
>
>From: gxw <guxiwei-hf@loongson.cn>
>
>Test case fate-checkasm-h264pred failed in latest community code.
>This patch fixed the bug.
>
>Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
>---
> libavcodec/mips/h264pred_mmi.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
>diff --git a/libavcodec/mips/h264pred_mmi.c b/libavcodec/mips/h264pred_mmi.c
>index f4fe091..0209c2e 100644
>--- a/libavcodec/mips/h264pred_mmi.c
>+++ b/libavcodec/mips/h264pred_mmi.c
>@@ -178,7 +178,9 @@ void ff_pred8x8l_top_dc_8_mmi(uint8_t *src, int has_topleft,
>
>         "1:                                                             \n\t"
>         "bnez       %[has_topright],            2f                      \n\t"
>-        "pinsrh_3   %[ftmp2],   %[ftmp2],       %[ftmp4]                \n\t"
>+        "dli        %[tmp0],    0xa4                                    \n\t"
>+        "mtc1       %[tmp0],    %[ftmp1]                                \n\t"
>+        "pshufh     %[ftmp2],   %[ftmp2],       %[ftmp1]                \n\t"
>
>         "2:                                                             \n\t"
>         "dli        %[tmp0],    0x02                                    \n\t"
>@@ -370,7 +372,9 @@ void ff_pred8x8l_vertical_8_mmi(uint8_t *src, int has_topleft,
>
>         "1:                                                             \n\t"
>         "bnez       %[has_topright],            2f                      \n\t"
>-        "pinsrh_3   %[ftmp11],  %[ftmp11],      %[ftmp9]                \n\t"
>+        "dli        %[tmp0],    0xa4                                    \n\t"
>+        "mtc1       %[tmp0],    %[ftmp1]                                \n\t"
>+        "pshufh     %[ftmp11],  %[ftmp11],      %[ftmp1]                \n\t"
>
>         "2:                                                             \n\t"
>         "dli        %[tmp0],    0x02                                    \n\t"
>--
>2.1.0
>

Ping.
Michael Niedermayer Sept. 10, 2020, 7:13 p.m. UTC | #2
On Thu, Sep 03, 2020 at 02:29:51PM +0800, Shiyou Yin wrote:
> From: gxw <guxiwei-hf@loongson.cn>
> 
> Test case fate-checkasm-h264pred failed in latest community code.
> This patch fixed the bug.

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/mips/h264pred_mmi.c b/libavcodec/mips/h264pred_mmi.c
index f4fe091..0209c2e 100644
--- a/libavcodec/mips/h264pred_mmi.c
+++ b/libavcodec/mips/h264pred_mmi.c
@@ -178,7 +178,9 @@  void ff_pred8x8l_top_dc_8_mmi(uint8_t *src, int has_topleft,
 
         "1:                                                             \n\t"
         "bnez       %[has_topright],            2f                      \n\t"
-        "pinsrh_3   %[ftmp2],   %[ftmp2],       %[ftmp4]                \n\t"
+        "dli        %[tmp0],    0xa4                                    \n\t"
+        "mtc1       %[tmp0],    %[ftmp1]                                \n\t"
+        "pshufh     %[ftmp2],   %[ftmp2],       %[ftmp1]                \n\t"
 
         "2:                                                             \n\t"
         "dli        %[tmp0],    0x02                                    \n\t"
@@ -370,7 +372,9 @@  void ff_pred8x8l_vertical_8_mmi(uint8_t *src, int has_topleft,
 
         "1:                                                             \n\t"
         "bnez       %[has_topright],            2f                      \n\t"
-        "pinsrh_3   %[ftmp11],  %[ftmp11],      %[ftmp9]                \n\t"
+        "dli        %[tmp0],    0xa4                                    \n\t"
+        "mtc1       %[tmp0],    %[ftmp1]                                \n\t"
+        "pshufh     %[ftmp11],  %[ftmp11],      %[ftmp1]                \n\t"
 
         "2:                                                             \n\t"
         "dli        %[tmp0],    0x02                                    \n\t"