[FFmpeg-devel] armeb fix for mpegaudio

Måns Rullgård mans
Fri Aug 1 02:16:25 CEST 2008


matthieu castet <castet.matthieu at free.fr> writes:

> Hi,
>
> this patch fix mp2 regression test on arm big endian.
>
> Matthieu
>
> PS : as Mans said dct is broken as you can see with the video
> regression failure.
>
> PS2 : test were done with qemu-armeb
> Index: libavcodec/armv4l/mathops.h
> ===================================================================
> --- libavcodec/armv4l/mathops.h	(r?vision 14493)
> +++ libavcodec/armv4l/mathops.h	(copie de travail)
> @@ -22,6 +22,14 @@
>  #ifndef FFMPEG_ARMV4L_MATHOPS_H
>  #define FFMPEG_ARMV4L_MATHOPS_H
>  
> +#ifdef WORDS_BIGENDIAN
> +#define LOW_WORD 1
> +#define HIGH_WORD 0
> +#else
> +#define LOW_WORD 0
> +#define HIGH_WORD 1
> +#endif
> +

I can imagine those being useful in other places.  Perhaps defining
them in a more central location would be worthwhile.

>  #ifdef FRAC_BITS
>  #   define MULL(a, b) \
>          ({  int lo, hi;\
> @@ -52,7 +60,7 @@
>  {
>      union { uint64_t x; unsigned hl[2]; } x;
>      asm ("smull %0, %1, %2, %3"
> -         : "=r"(x.hl[0]), "=r"(x.hl[1]) : "r"(a), "r"(b));
> +         : "=r"(x.hl[LOW_WORD]), "=r"(x.hl[HIGH_WORD]) : "r"(a), "r"(b));
>      return x.x;
>  }
>  #define MUL64 MUL64
> @@ -61,7 +69,7 @@
>  {
>      union { uint64_t x; unsigned hl[2]; } x = { d };
>      asm ("smlal %0, %1, %2, %3"
> -         : "+r"(x.hl[0]), "+r"(x.hl[1]) : "r"(a), "r"(b));
> +         : "+r"(x.hl[LOW_WORD]), "+r"(x.hl[HIGH_WORD]) : "r"(a), "r"(b));
>      return x.x;
>  }
>  #define MAC64(d, a, b) ((d) = MAC64(d, a, b))

This looks OK.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list