huffyuv: ppc: Enable the altivec code for LE as well

Message ID 20161001193045.12303-1-lu_zero@gentoo.org
State Committed
Commit b015872c0d0823e70776e98b865509ec1287e2f6
Headers show

Commit Message

Luca Barbato Oct. 1, 2016, 7:30 p.m.
Confirmed to work by checkasm.
---
 libavcodec/ppc/huffyuvdsp_altivec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Vittorio Giovara Oct. 1, 2016, 9:07 p.m. | #1
On Sat, Oct 1, 2016 at 3:30 PM, Luca Barbato <lu_zero@gentoo.org> wrote:
> Confirmed to work by checkasm.
> ---
>  libavcodec/ppc/huffyuvdsp_altivec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/ppc/huffyuvdsp_altivec.c b/libavcodec/ppc/huffyuvdsp_altivec.c
> index 337328a..7c34a67 100644
> --- a/libavcodec/ppc/huffyuvdsp_altivec.c
> +++ b/libavcodec/ppc/huffyuvdsp_altivec.c
> @@ -32,7 +32,7 @@
>  #include "libavutil/ppc/util_altivec.h"
>  #include "libavcodec/huffyuvdsp.h"
>
> -#if HAVE_ALTIVEC && HAVE_BIGENDIAN
> +#if HAVE_ALTIVEC
>  static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
>  {
>      register int i;
> @@ -49,14 +49,14 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
>      for (; i < w; i++)
>          dst[i] = src[i];
>  }
> -#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
> +#endif /* HAVE_ALTIVEC */
>
>  av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c)
>  {
> -#if HAVE_ALTIVEC && HAVE_BIGENDIAN
> +#if HAVE_ALTIVEC
>      if (!PPC_ALTIVEC(av_get_cpu_flags()))
>          return;
>
>      c->add_bytes = add_bytes_altivec;
> -#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
> +#endif /* HAVE_ALTIVEC */
>  }
> --

Maybe mention the hash that broke the optimization?
Ok either way.
Diego Biurrun Oct. 2, 2016, 10:07 a.m. | #2
On Sat, Oct 01, 2016 at 09:30:45PM +0200, Luca Barbato wrote:
> Confirmed to work by checkasm.
> ---
>  libavcodec/ppc/huffyuvdsp_altivec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

s/LE/little-endian/

probably OK otherwise

Diego

Patch

diff --git a/libavcodec/ppc/huffyuvdsp_altivec.c b/libavcodec/ppc/huffyuvdsp_altivec.c
index 337328a..7c34a67 100644
--- a/libavcodec/ppc/huffyuvdsp_altivec.c
+++ b/libavcodec/ppc/huffyuvdsp_altivec.c
@@ -32,7 +32,7 @@ 
 #include "libavutil/ppc/util_altivec.h"
 #include "libavcodec/huffyuvdsp.h"
 
-#if HAVE_ALTIVEC && HAVE_BIGENDIAN
+#if HAVE_ALTIVEC
 static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
 {
     register int i;
@@ -49,14 +49,14 @@  static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w)
     for (; i < w; i++)
         dst[i] = src[i];
 }
-#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
+#endif /* HAVE_ALTIVEC */
 
 av_cold void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c)
 {
-#if HAVE_ALTIVEC && HAVE_BIGENDIAN
+#if HAVE_ALTIVEC
     if (!PPC_ALTIVEC(av_get_cpu_flags()))
         return;
 
     c->add_bytes = add_bytes_altivec;
-#endif /* HAVE_ALTIVEC && HAVE_BIGENDIAN */
+#endif /* HAVE_ALTIVEC */
 }