[FFmpeg-devel] Disable MSA for big-endian mips cpu

Submitted by shivraj.patil@imgtec.com on May 26, 2017, 10:38 a.m.

Details

Message ID 1495795135-2871-1-git-send-email-shivraj.patil@imgtec.com
State New
Headers show

Commit Message

shivraj.patil@imgtec.com May 26, 2017, 10:38 a.m.
From: Shivraj Patil <shivraj.patil@imgtec.com>

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
---
 libavcodec/mips/Makefile                    |    2 ++
 libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
 libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
 libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
 libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
 libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
 libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
 libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
 libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
 libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
 libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
 libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
 libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
 libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
 libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
 libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
 libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
 libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
 18 files changed, 70 insertions(+), 68 deletions(-)

Comments

Ronald S. Bultje May 26, 2017, 11:55 a.m.
Hi,

On Fri, May 26, 2017 at 6:38 AM, <shivraj.patil@imgtec.com> wrote:

> From: Shivraj Patil <shivraj.patil@imgtec.com>
>
> Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> ---
>  libavcodec/mips/Makefile                    |    2 ++
>  libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
>  libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
>  libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
>  libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
>  libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
>  libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
>  libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
>  libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
>  libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
>  libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
>  libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
>  18 files changed, 70 insertions(+), 68 deletions(-)


Is this on top of the configure patch? I'm a little confused. It seems the
configure patch would be much simpler, no?

Ronald
shivraj.patil@imgtec.com May 26, 2017, 1:16 p.m.
Is this on top of the configure patch?
Shivraj: No, this is complete new patch.

I'm a little confused. It seems the configure patch would be much simpler, no?
Shivraj: This patch is according to michael’s suggestion.


From: Ronald S. Bultje [mailto:rsbultje@gmail.com]

Sent: 26 May 2017 17:26
To: FFmpeg development discussions and patches
Cc: Shivraj Patil
Subject: Re: [FFmpeg-devel] [PATCH] Disable MSA for big-endian mips cpu

Hi,

On Fri, May 26, 2017 at 6:38 AM, <shivraj.patil@imgtec.com<mailto:shivraj.patil@imgtec.com>> wrote:
From: Shivraj Patil <shivraj.patil@imgtec.com<mailto:shivraj.patil@imgtec.com>>


Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com<mailto:shivraj.patil@imgtec.com>>

---
 libavcodec/mips/Makefile                    |    2 ++
 libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
 libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
 libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
 libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
 libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
 libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
 libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
 libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
 libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
 libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
 libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
 libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
 libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
 libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
 libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
 libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
 libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
 18 files changed, 70 insertions(+), 68 deletions(-)

Ronald
Michael Niedermayer May 26, 2017, 1:40 p.m.
On Fri, May 26, 2017 at 04:08:55PM +0530, shivraj.patil@imgtec.com wrote:
> From: Shivraj Patil <shivraj.patil@imgtec.com>
> 
> Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> ---
>  libavcodec/mips/Makefile                    |    2 ++
>  libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
>  libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
>  libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
>  libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
>  libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
>  libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
>  libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
>  libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
>  libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
>  libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
>  libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
>  libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
>  18 files changed, 70 insertions(+), 68 deletions(-)

Why does none of this code work on big endian mips ?

Is it difficult to make it work ?

Is it certain that the "disabled" code does not work on
big endian mips ?

Is it known that the reason for it not working is the endianness or
could it be a unrelated issue that makes it work on neither endianness?

[...]
Michael Niedermayer May 26, 2017, 1:42 p.m.
On Fri, May 26, 2017 at 03:40:20PM +0200, Michael Niedermayer wrote:
> On Fri, May 26, 2017 at 04:08:55PM +0530, shivraj.patil@imgtec.com wrote:
> > From: Shivraj Patil <shivraj.patil@imgtec.com>
> > 
> > Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> > ---
> >  libavcodec/mips/Makefile                    |    2 ++
> >  libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
> >  libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
> >  libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
> >  libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
> >  libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
> >  libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
> >  libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
> >  libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
> >  libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
> >  libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
> >  libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
> >  18 files changed, 70 insertions(+), 68 deletions(-)
> 
> Why does none of this code work on big endian mips ?
> 
> Is it difficult to make it work ?
> 
> Is it certain that the "disabled" code does not work on
> big endian mips ?
> 
> Is it known that the reason for it not working is the endianness or
> could it be a unrelated issue that makes it work on neither endianness?

and i forgot the CC, so repling with CC (sorry)

[...]
shivraj.patil@imgtec.com May 26, 2017, 1:56 p.m.
The current upstreamed code has been written and tested for Little Endian systems.
We do have plans to add the Big Endian support in near future, but till that time, need to disable all to avoid its usage and failures.

-----Original Message-----
From: Michael Niedermayer [mailto:michael@niedermayer.cc] 
Sent: 26 May 2017 19:13
To: FFmpeg development discussions and patches
Cc: Shivraj Patil
Subject: Re: [FFmpeg-devel] [PATCH] Disable MSA for big-endian mips cpu

On Fri, May 26, 2017 at 03:40:20PM +0200, Michael Niedermayer wrote:
> On Fri, May 26, 2017 at 04:08:55PM +0530, shivraj.patil@imgtec.com wrote:
> > From: Shivraj Patil <shivraj.patil@imgtec.com>
> > 
> > Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
> > ---
> >  libavcodec/mips/Makefile                    |    2 ++
> >  libavcodec/mips/blockdsp_init_mips.c        |    8 ++++----
> >  libavcodec/mips/h263dsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/h264chroma_init_mips.c      |    8 ++++----
> >  libavcodec/mips/h264dsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/h264pred_init_mips.c        |    8 ++++----
> >  libavcodec/mips/h264qpel_init_mips.c        |    8 ++++----
> >  libavcodec/mips/hevcdsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/hevcpred_init_mips.c        |    8 ++++----
> >  libavcodec/mips/hpeldsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/idctdsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/me_cmp_init_mips.c          |    8 ++++----
> >  libavcodec/mips/mpegvideo_init_mips.c       |    8 ++++----
> >  libavcodec/mips/mpegvideoencdsp_init_mips.c |    8 ++++----
> >  libavcodec/mips/pixblockdsp_init_mips.c     |    8 ++++----
> >  libavcodec/mips/qpeldsp_init_mips.c         |    8 ++++----
> >  libavcodec/mips/vp8dsp_init_mips.c          |    8 ++++----
> >  libavcodec/mips/vp9dsp_init_mips.c          |    8 ++++----
> >  18 files changed, 70 insertions(+), 68 deletions(-)
> 
> Why does none of this code work on big endian mips ?
> 
> Is it difficult to make it work ?
> 
> Is it certain that the "disabled" code does not work on big endian 
> mips ?
> 
> Is it known that the reason for it not working is the endianness or 
> could it be a unrelated issue that makes it work on neither endianness?

and i forgot the CC, so repling with CC (sorry)

[...]
Michael Niedermayer May 29, 2017, 9:44 p.m.
Hi

On Fri, May 26, 2017 at 01:56:00PM +0000, Shivraj Patil wrote:
> 
> The current upstreamed code has been written and tested for Little Endian systems.
> We do have plans to add the Big Endian support in near future, but till that time, need to disable all to avoid its usage and failures.

ok, please add above or something similar to the commit message

also if you prefer the configure patch, i think its ok, if its
temporary.

About adding support for both endians
When you add support for that, make sure its cleanly implemented.

Duplicating every function one for little and one for big endian
for example will with >80% probability be rejected by someone



thanks

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
index 797df09..563700f 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -38,6 +38,7 @@  OBJS-$(CONFIG_ME_CMP)                     += mips/me_cmp_init_mips.o
 OBJS-$(CONFIG_MPEG4_DECODER)              += mips/xvididct_init_mips.o
 OBJS-$(CONFIG_VC1DSP)                     += mips/vc1dsp_init_mips.o
 OBJS-$(CONFIG_WMV2DSP)                    += mips/wmv2dsp_init_mips.o
+ifndef HAVE_BIGENDIAN
 MSA-OBJS-$(CONFIG_HEVC_DECODER)           += mips/hevcdsp_msa.o            \
                                              mips/hevc_mc_uni_msa.o        \
                                              mips/hevc_mc_uniw_msa.o       \
@@ -68,6 +69,7 @@  MSA-OBJS-$(CONFIG_IDCTDSP)                += mips/idctdsp_msa.o           \
 MSA-OBJS-$(CONFIG_MPEGVIDEO)              += mips/mpegvideo_msa.o
 MSA-OBJS-$(CONFIG_MPEGVIDEOENC)           += mips/mpegvideoencdsp_msa.o
 MSA-OBJS-$(CONFIG_ME_CMP)                 += mips/me_cmp_msa.o
+endif
 MMI-OBJS                                  += mips/constants.o
 MMI-OBJS-$(CONFIG_H264DSP)                += mips/h264dsp_mmi.o
 MMI-OBJS-$(CONFIG_H264CHROMA)             += mips/h264chroma_mmi.o
diff --git a/libavcodec/mips/blockdsp_init_mips.c b/libavcodec/mips/blockdsp_init_mips.c
index 30ae95f..8243f8b 100644
--- a/libavcodec/mips/blockdsp_init_mips.c
+++ b/libavcodec/mips/blockdsp_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "blockdsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void blockdsp_init_msa(BlockDSPContext *c)
 {
     c->clear_block = ff_clear_block_msa;
@@ -30,7 +30,7 @@  static av_cold void blockdsp_init_msa(BlockDSPContext *c)
     c->fill_block_tab[0] = ff_fill_block16_msa;
     c->fill_block_tab[1] = ff_fill_block8_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void blockdsp_init_mmi(BlockDSPContext *c)
@@ -45,9 +45,9 @@  static av_cold void blockdsp_init_mmi(BlockDSPContext *c)
 
 void ff_blockdsp_init_mips(BlockDSPContext *c)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     blockdsp_init_msa(c);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     blockdsp_init_mmi(c);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/h263dsp_init_mips.c b/libavcodec/mips/h263dsp_init_mips.c
index 09bd937..7c5d228 100644
--- a/libavcodec/mips/h263dsp_init_mips.c
+++ b/libavcodec/mips/h263dsp_init_mips.c
@@ -20,17 +20,17 @@ 
 
 #include "h263dsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void h263dsp_init_msa(H263DSPContext *c)
 {
     c->h263_h_loop_filter = ff_h263_h_loop_filter_msa;
     c->h263_v_loop_filter = ff_h263_v_loop_filter_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 av_cold void ff_h263dsp_init_mips(H263DSPContext *c)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     h263dsp_init_msa(c);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/h264chroma_init_mips.c b/libavcodec/mips/h264chroma_init_mips.c
index 122148d..4cb04d4 100644
--- a/libavcodec/mips/h264chroma_init_mips.c
+++ b/libavcodec/mips/h264chroma_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "h264chroma_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth)
 {
     const int high_bit_depth = bit_depth > 8;
@@ -36,7 +36,7 @@  static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth)
         c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_msa;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
@@ -54,9 +54,9 @@  static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
 
 av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     h264chroma_init_msa(c, bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     h264chroma_init_mmi(c, bit_depth);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/h264dsp_init_mips.c b/libavcodec/mips/h264dsp_init_mips.c
index 1fe7f84..7a1fe41 100644
--- a/libavcodec/mips/h264dsp_init_mips.c
+++ b/libavcodec/mips/h264dsp_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "h264dsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void h264dsp_init_msa(H264DSPContext *c,
                                      const int bit_depth,
                                      const int chroma_format_idc)
@@ -79,7 +79,7 @@  static av_cold void h264dsp_init_msa(H264DSPContext *c,
         c->h264_luma_dc_dequant_idct = ff_h264_deq_idct_luma_dc_msa;
     }  // if (8 == bit_depth)
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
@@ -138,9 +138,9 @@  static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
 av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
                                   const int chroma_format_idc)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     h264dsp_init_msa(c, bit_depth, chroma_format_idc);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/h264pred_init_mips.c b/libavcodec/mips/h264pred_init_mips.c
index c33d8f7..a416d23 100644
--- a/libavcodec/mips/h264pred_init_mips.c
+++ b/libavcodec/mips/h264pred_init_mips.c
@@ -23,7 +23,7 @@ 
 #include "h264dsp_mips.h"
 #include "h264pred_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void h264_pred_init_msa(H264PredContext *h, int codec_id,
                                        const int bit_depth,
                                        const int chroma_format_idc)
@@ -94,7 +94,7 @@  static av_cold void h264_pred_init_msa(H264PredContext *h, int codec_id,
         h->pred16x16[DC_128_PRED8x8] = ff_h264_intra_pred_dc_128_16x16_msa;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void h264_pred_init_mmi(H264PredContext *h, int codec_id,
@@ -146,9 +146,9 @@  av_cold void ff_h264_pred_init_mips(H264PredContext *h, int codec_id,
                                     int bit_depth,
                                     const int chroma_format_idc)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     h264_pred_init_msa(h, codec_id, bit_depth, chroma_format_idc);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     h264_pred_init_mmi(h, codec_id, bit_depth, chroma_format_idc);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/h264qpel_init_mips.c b/libavcodec/mips/h264qpel_init_mips.c
index 92219f8..bb1f1ad 100644
--- a/libavcodec/mips/h264qpel_init_mips.c
+++ b/libavcodec/mips/h264qpel_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "h264dsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void h264qpel_init_msa(H264QpelContext *c, int bit_depth)
 {
     if (8 == bit_depth) {
@@ -127,7 +127,7 @@  static av_cold void h264qpel_init_msa(H264QpelContext *c, int bit_depth)
         c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_msa;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void h264qpel_init_mmi(H264QpelContext *c, int bit_depth)
@@ -240,9 +240,9 @@  static av_cold void h264qpel_init_mmi(H264QpelContext *c, int bit_depth)
 
 av_cold void ff_h264qpel_init_mips(H264QpelContext *c, int bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     h264qpel_init_msa(c, bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     h264qpel_init_mmi(c, bit_depth);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/hevcdsp_init_mips.c b/libavcodec/mips/hevcdsp_init_mips.c
index 776d13e..f6bd3de 100644
--- a/libavcodec/mips/hevcdsp_init_mips.c
+++ b/libavcodec/mips/hevcdsp_init_mips.c
@@ -20,7 +20,7 @@ 
 
 #include "libavcodec/mips/hevcdsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void hevc_dsp_init_msa(HEVCDSPContext *c,
                                       const int bit_depth)
 {
@@ -444,11 +444,11 @@  static av_cold void hevc_dsp_init_msa(HEVCDSPContext *c,
         c->transform_4x4_luma = ff_hevc_idct_luma_4x4_msa;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 void ff_hevc_dsp_init_mips(HEVCDSPContext *c, const int bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     hevc_dsp_init_msa(c, bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/hevcpred_init_mips.c b/libavcodec/mips/hevcpred_init_mips.c
index e987698..123c3cd 100644
--- a/libavcodec/mips/hevcpred_init_mips.c
+++ b/libavcodec/mips/hevcpred_init_mips.c
@@ -22,7 +22,7 @@ 
 #include "libavutil/attributes.h"
 #include "libavcodec/mips/hevcpred_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void hevc_pred_init_msa(HEVCPredContext *c, const int bit_depth)
 {
     if (8 == bit_depth) {
@@ -39,11 +39,11 @@  static av_cold void hevc_pred_init_msa(HEVCPredContext *c, const int bit_depth)
         c->pred_angular[3] = ff_pred_intra_pred_angular_3_msa;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 void ff_hevc_pred_init_mips(HEVCPredContext *c, const int bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     hevc_pred_init_msa(c, bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/hpeldsp_init_mips.c b/libavcodec/mips/hpeldsp_init_mips.c
index 363a045..1de5dd2 100644
--- a/libavcodec/mips/hpeldsp_init_mips.c
+++ b/libavcodec/mips/hpeldsp_init_mips.c
@@ -22,7 +22,7 @@ 
 #include "../hpeldsp.h"
 #include "libavcodec/mips/hpeldsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static void ff_hpeldsp_init_msa(HpelDSPContext *c, int flags)
 {
     c->put_pixels_tab[0][0] = ff_put_pixels16_msa;
@@ -64,7 +64,7 @@  static void ff_hpeldsp_init_msa(HpelDSPContext *c, int flags)
     c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_msa;
     c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static void ff_hpeldsp_init_mmi(HpelDSPContext *c, int flags)
@@ -113,9 +113,9 @@  static void ff_hpeldsp_init_mmi(HpelDSPContext *c, int flags)
 
 void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     ff_hpeldsp_init_msa(c, flags);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     ff_hpeldsp_init_mmi(c, flags);
 #endif  // #if HAVE_MMI
diff --git a/libavcodec/mips/idctdsp_init_mips.c b/libavcodec/mips/idctdsp_init_mips.c
index 8c26bca..f94cd99 100644
--- a/libavcodec/mips/idctdsp_init_mips.c
+++ b/libavcodec/mips/idctdsp_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "idctdsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void idctdsp_init_msa(IDCTDSPContext *c, AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
@@ -39,7 +39,7 @@  static av_cold void idctdsp_init_msa(IDCTDSPContext *c, AVCodecContext *avctx,
     c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_msa;
     c->add_pixels_clamped = ff_add_pixels_clamped_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
@@ -62,9 +62,9 @@  static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
 av_cold void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
                           unsigned high_bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     idctdsp_init_msa(c, avctx, high_bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     idctdsp_init_mmi(c, avctx, high_bit_depth);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/me_cmp_init_mips.c b/libavcodec/mips/me_cmp_init_mips.c
index 219a0dc..083b559 100644
--- a/libavcodec/mips/me_cmp_init_mips.c
+++ b/libavcodec/mips/me_cmp_init_mips.c
@@ -20,7 +20,7 @@ 
 
 #include "me_cmp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void me_cmp_msa(MECmpContext *c, AVCodecContext *avctx)
 {
 #if BIT_DEPTH == 8
@@ -46,11 +46,11 @@  static av_cold void me_cmp_msa(MECmpContext *c, AVCodecContext *avctx)
     c->sse[2] = ff_sse4_msa;
 #endif
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 av_cold void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     me_cmp_msa(c, avctx);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/mpegvideo_init_mips.c b/libavcodec/mips/mpegvideo_init_mips.c
index 1918da5..21a3b6f 100644
--- a/libavcodec/mips/mpegvideo_init_mips.c
+++ b/libavcodec/mips/mpegvideo_init_mips.c
@@ -21,7 +21,7 @@ 
 #include "h263dsp_mips.h"
 #include "mpegvideo_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void dct_unquantize_init_msa(MpegEncContext *s)
 {
     s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_msa;
@@ -29,7 +29,7 @@  static av_cold void dct_unquantize_init_msa(MpegEncContext *s)
     if (!s->q_scale_type)
         s->dct_unquantize_mpeg2_inter = ff_dct_unquantize_mpeg2_inter_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void dct_unquantize_init_mmi(MpegEncContext *s)
@@ -49,9 +49,9 @@  static av_cold void dct_unquantize_init_mmi(MpegEncContext *s)
 
 av_cold void ff_mpv_common_init_mips(MpegEncContext *s)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     dct_unquantize_init_msa(s);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     dct_unquantize_init_mmi(s);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/mpegvideoencdsp_init_mips.c b/libavcodec/mips/mpegvideoencdsp_init_mips.c
index 9bfe94e..f5a6000 100644
--- a/libavcodec/mips/mpegvideoencdsp_init_mips.c
+++ b/libavcodec/mips/mpegvideoencdsp_init_mips.c
@@ -21,7 +21,7 @@ 
 #include "libavcodec/bit_depth_template.c"
 #include "h263dsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void mpegvideoencdsp_init_msa(MpegvideoEncDSPContext *c,
                                              AVCodecContext *avctx)
 {
@@ -29,12 +29,12 @@  static av_cold void mpegvideoencdsp_init_msa(MpegvideoEncDSPContext *c,
     c->pix_sum = ff_pix_sum_msa;
 #endif
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c,
                                           AVCodecContext *avctx)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     mpegvideoencdsp_init_msa(c, avctx);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/pixblockdsp_init_mips.c b/libavcodec/mips/pixblockdsp_init_mips.c
index 1b3741e..1e8f712 100644
--- a/libavcodec/mips/pixblockdsp_init_mips.c
+++ b/libavcodec/mips/pixblockdsp_init_mips.c
@@ -21,7 +21,7 @@ 
 
 #include "pixblockdsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
                                          AVCodecContext *avctx,
                                          unsigned high_bit_depth)
@@ -43,7 +43,7 @@  static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
         break;
     }
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void pixblockdsp_init_mmi(PixblockDSPContext *c,
@@ -60,9 +60,9 @@  static av_cold void pixblockdsp_init_mmi(PixblockDSPContext *c,
 void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
                               unsigned high_bit_depth)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     pixblockdsp_init_msa(c, avctx, high_bit_depth);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     pixblockdsp_init_mmi(c, avctx, high_bit_depth);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/qpeldsp_init_mips.c b/libavcodec/mips/qpeldsp_init_mips.c
index 140e8f8..f7ea1cd 100644
--- a/libavcodec/mips/qpeldsp_init_mips.c
+++ b/libavcodec/mips/qpeldsp_init_mips.c
@@ -20,7 +20,7 @@ 
 
 #include "qpeldsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void qpeldsp_init_msa(QpelDSPContext *c)
 {
     c->put_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
@@ -157,11 +157,11 @@  static av_cold void qpeldsp_init_msa(QpelDSPContext *c)
     c->avg_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa;
     c->avg_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 void ff_qpeldsp_init_mips(QpelDSPContext *c)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     qpeldsp_init_msa(c);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }
diff --git a/libavcodec/mips/vp8dsp_init_mips.c b/libavcodec/mips/vp8dsp_init_mips.c
index 3fc5f8e..85d45f1 100644
--- a/libavcodec/mips/vp8dsp_init_mips.c
+++ b/libavcodec/mips/vp8dsp_init_mips.c
@@ -71,7 +71,7 @@ 
     dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] =  \
         ff_put_vp8_pixels##SIZE##_msa;
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void vp8dsp_init_msa(VP8DSPContext *dsp)
 {
     dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_msa;
@@ -104,7 +104,7 @@  static av_cold void vp8dsp_init_msa(VP8DSPContext *dsp)
     dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_msa;
     dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_msa;
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 #if HAVE_MMI
 static av_cold void vp8dsp_init_mmi(VP8DSPContext *dsp)
@@ -193,9 +193,9 @@  static av_cold void vp8dsp_init_mmi(VP8DSPContext *dsp)
 
 av_cold void ff_vp8dsp_init_mips(VP8DSPContext *dsp)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     vp8dsp_init_msa(dsp);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 #if HAVE_MMI
     vp8dsp_init_mmi(dsp);
 #endif /* HAVE_MMI */
diff --git a/libavcodec/mips/vp9dsp_init_mips.c b/libavcodec/mips/vp9dsp_init_mips.c
index c8a4890..a876878 100644
--- a/libavcodec/mips/vp9dsp_init_mips.c
+++ b/libavcodec/mips/vp9dsp_init_mips.c
@@ -23,7 +23,7 @@ 
 #include "libavcodec/vp9dsp.h"
 #include "vp9dsp_mips.h"
 
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
 static av_cold void vp9dsp_intrapred_init_msa(VP9DSPContext *dsp, int bpp)
 {
     if (bpp == 8) {
@@ -166,11 +166,11 @@  static av_cold void vp9dsp_init_msa(VP9DSPContext *dsp, int bpp)
     vp9dsp_mc_init_msa(dsp, bpp);
     vp9dsp_loopfilter_init_msa(dsp, bpp);
 }
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 
 av_cold void ff_vp9dsp_init_mips(VP9DSPContext *dsp, int bpp)
 {
-#if HAVE_MSA
+#if HAVE_MSA && !HAVE_BIGENDIAN
     vp9dsp_init_msa(dsp, bpp);
-#endif  // #if HAVE_MSA
+#endif  // #if HAVE_MSA && !HAVE_BIGENDIAN
 }