diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-06-09 12:12:04 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-06-09 12:12:04 +0000 |
commit | fbf7cf91621cee937d8a5e87e7afcd1e0fd7c9f1 (patch) | |
tree | 1f97d16ae464e02f07d2d048463d06a450d04a12 /libmpeg2 | |
parent | cfbb824f064c8c97c07126f27b5c19b3d6ad6c3c (diff) |
libmpeg2-altivec patch by Magnus Damm <damm@opensource.se>:
Updated to version 1.12 from sourceforge
The old version crashed my gcc-3.2.2 (after allocating 1 Gig memory)
because of unfriendly altivec code, the new file is better.
The new file ditches the old assembly version
and it must be built with correct altivec-flags
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10272 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpeg2')
-rw-r--r-- | libmpeg2/motion_comp_altivec.c | 1132 |
1 files changed, 61 insertions, 1071 deletions
diff --git a/libmpeg2/motion_comp_altivec.c b/libmpeg2/motion_comp_altivec.c index 998e2720ff..f5d884e6e4 100644 --- a/libmpeg2/motion_comp_altivec.c +++ b/libmpeg2/motion_comp_altivec.c @@ -1,6 +1,6 @@ /* * motion_comp_altivec.c - * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org> + * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org> * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. @@ -21,1064 +21,52 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __ALTIVEC__ - #include "config.h" #ifdef ARCH_PPC +#ifdef HAVE_ALTIVEC_H +#include <altivec.h> +#endif #include <inttypes.h> #include "mpeg2.h" #include "mpeg2_internal.h" -/* - * The asm code is generated with: - * - * gcc-2.95 -fvec -D__ALTIVEC__ -O9 -fomit-frame-pointer -mregnames -S - * motion_comp_altivec.c - * - * sed 's/.L/._L/g' motion_comp_altivec.s | - * awk '{args=""; len=split ($2, arg, ","); - * for (i=1; i<=len; i++) { a=arg[i]; if (i<len) a=a","; - * args = args sprintf ("%-6s", a) } - * printf ("\t\"\t%-16s%-24s\\n\"\n", $1, args) }' | - * unexpand -a - */ - -static void MC_put_o_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " srawi %r6, %r6, 1 \n" - " li %r9, 15 \n" - " addi %r6, %r6, -1 \n" - " lvsl %v12, 0, %r4 \n" - " mtctr %r6 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " add %r0, %r5, %r5 \n" - " vperm %v13, %v1, %v0, %v12 \n" - " add %r4, %r4, %r5 \n" - "._L6: \n" - " li %r9, 15 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " stvx %v13, 0, %r3 \n" - " vperm %v13, %v1, %v0, %v12 \n" - " add %r4, %r4, %r5 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " stvx %v13, %r5, %r3 \n" - " vperm %v13, %v1, %v0, %v12 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r0 \n" - " bdnz ._L6 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v1, 0, %r4 \n" - " stvx %v13, 0, %r3 \n" - " vperm %v13, %v1, %v0, %v12 \n" - " stvx %v13, %r5, %r3 \n" - ); -} - -static void MC_put_o_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v12, 0, %r4 \n" - " lvsl %v1, %r5, %r4 \n" - " vmrghb %v12, %v12, %v12 \n" - " srawi %r6, %r6, 1 \n" - " li %r9, 7 \n" - " vmrghb %v1, %v1, %v1 \n" - " addi %r6, %r6, -1 \n" - " vpkuhum %v10, %v12, %v12 \n" - " lvx %v13, 0, %r4 \n" - " mtctr %r6 \n" - " vpkuhum %v11, %v1, %v1 \n" - " lvx %v0, %r9, %r4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v12, %v13, %v0, %v10 \n" - "._L11: \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " stvewx %v12, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v1, %v13, %v0, %v11 \n" - " stvewx %v12, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " add %r3, %r3, %r5 \n" - " stvewx %v1, 0, %r3 \n" - " vperm %v12, %v13, %v0, %v10 \n" - " li %r9, 4 \n" - " stvewx %v1, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r5 \n" - " bdnz ._L11 \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " stvewx %v12, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v1, %v13, %v0, %v11 \n" - " stvewx %v12, %r9, %r3 \n" - " add %r3, %r3, %r5 \n" - " stvewx %v1, 0, %r3 \n" - " stvewx %v1, %r9, %r3 \n" - ); -} +typedef vector signed char vector_s8_t; +typedef vector unsigned char vector_u8_t; +typedef vector signed short vector_s16_t; +typedef vector unsigned short vector_u16_t; +typedef vector signed int vector_s32_t; +typedef vector unsigned int vector_u32_t; -static void MC_put_x_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v11, 0, %r4 \n" - " vspltisb %v0, 1 \n" - " li %r9, 16 \n" - " lvx %v12, 0, %r4 \n" - " vaddubm %v10, %v11, %v0 \n" - " lvx %v13, %r9, %r4 \n" - " srawi %r6, %r6, 1 \n" - " addi %r6, %r6, -1 \n" - " vperm %v1, %v12, %v13, %v10 \n" - " vperm %v0, %v12, %v13, %v11 \n" - " mtctr %r6 \n" - " add %r0, %r5, %r5 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v0, %v1 \n" - "._L16: \n" - " li %r9, 16 \n" - " lvx %v12, 0, %r4 \n" - " lvx %v13, %r9, %r4 \n" - " stvx %v0, 0, %r3 \n" - " vperm %v1, %v12, %v13, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v0, %v12, %v13, %v11 \n" - " lvx %v12, 0, %r4 \n" - " lvx %v13, %r9, %r4 \n" - " vavgub %v0, %v0, %v1 \n" - " stvx %v0, %r5, %r3 \n" - " vperm %v1, %v12, %v13, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v0, %v12, %v13, %v11 \n" - " add %r3, %r3, %r0 \n" - " vavgub %v0, %v0, %v1 \n" - " bdnz ._L16 \n" - " lvx %v13, %r9, %r4 \n" - " lvx %v12, 0, %r4 \n" - " stvx %v0, 0, %r3 \n" - " vperm %v1, %v12, %v13, %v10 \n" - " vperm %v0, %v12, %v13, %v11 \n" - " vavgub %v0, %v0, %v1 \n" - " stvx %v0, %r5, %r3 \n" - ); -} +#ifndef COFFEE_BREAK /* Workarounds for gcc suckage */ -static void MC_put_x_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) +static inline vector_u8_t my_vec_ld (int const A, const uint8_t * const B) { - asm (" \n" - " lvsl %v0, 0, %r4 \n" - " vspltisb %v13, 1 \n" - " lvsl %v10, %r5, %r4 \n" - " vmrghb %v0, %v0, %v0 \n" - " li %r9, 8 \n" - " lvx %v11, 0, %r4 \n" - " vmrghb %v10, %v10, %v10 \n" - " vpkuhum %v8, %v0, %v0 \n" - " lvx %v12, %r9, %r4 \n" - " srawi %r6, %r6, 1 \n" - " vpkuhum %v9, %v10, %v10 \n" - " vaddubm %v7, %v8, %v13 \n" - " addi %r6, %r6, -1 \n" - " vperm %v1, %v11, %v12, %v8 \n" - " mtctr %r6 \n" - " vaddubm %v13, %v9, %v13 \n" - " add %r4, %r4, %r5 \n" - " vperm %v0, %v11, %v12, %v7 \n" - " vavgub %v0, %v1, %v0 \n" - "._L21: \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " stvewx %v0, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v1, %v11, %v12, %v13 \n" - " stvewx %v0, %r9, %r3 \n" - " vperm %v0, %v11, %v12, %v9 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " vavgub %v10, %v0, %v1 \n" - " lvx %v11, 0, %r4 \n" - " add %r3, %r3, %r5 \n" - " stvewx %v10, 0, %r3 \n" - " vperm %v1, %v11, %v12, %v7 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " li %r9, 4 \n" - " stvewx %v10, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v0, %v1 \n" - " add %r3, %r3, %r5 \n" - " bdnz ._L21 \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " stvewx %v0, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v1, %v11, %v12, %v13 \n" - " stvewx %v0, %r9, %r3 \n" - " vperm %v0, %v11, %v12, %v9 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v10, %v0, %v1 \n" - " stvewx %v10, 0, %r3 \n" - " stvewx %v10, %r9, %r3 \n" - ); + return vec_ld (A, (uint8_t *)B); } +#undef vec_ld +#define vec_ld my_vec_ld -static void MC_put_y_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) +static inline vector_u8_t my_vec_and (vector_u8_t const A, vector_u8_t const B) { - asm (" \n" - " li %r9, 15 \n" - " lvsl %v10, 0, %r4 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r9, %r4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v12, %v13, %v1, %v10 \n" - " srawi %r6, %r6, 1 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r9, %r4 \n" - " addi %r6, %r6, -1 \n" - " vperm %v11, %v13, %v1, %v10 \n" - " mtctr %r6 \n" - " add %r0, %r5, %r5 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v12, %v11 \n" - "._L26: \n" - " li %r9, 15 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r9, %r4 \n" - " stvx %v0, 0, %r3 \n" - " vperm %v12, %v13, %v1, %v10 \n" - " add %r4, %r4, %r5 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r9, %r4 \n" - " vavgub %v0, %v12, %v11 \n" - " stvx %v0, %r5, %r3 \n" - " vperm %v11, %v13, %v1, %v10 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r0 \n" - " vavgub %v0, %v12, %v11 \n" - " bdnz ._L26 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " stvx %v0, 0, %r3 \n" - " vperm %v12, %v13, %v1, %v10 \n" - " vavgub %v0, %v12, %v11 \n" - " stvx %v0, %r5, %r3 \n" - ); + return vec_and (A, B); } +#undef vec_and +#define vec_and my_vec_and -static void MC_put_y_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) +static inline vector_u8_t my_vec_avg (vector_u8_t const A, vector_u8_t const B) { - asm (" \n" - " lvsl %v13, 0, %r4 \n" - " lvsl %v11, %r5, %r4 \n" - " vmrghb %v13, %v13, %v13 \n" - " li %r9, 7 \n" - " lvx %v12, 0, %r4 \n" - " vmrghb %v11, %v11, %v11 \n" - " lvx %v1, %r9, %r4 \n" - " vpkuhum %v9, %v13, %v13 \n" - " add %r4, %r4, %r5 \n" - " vpkuhum %v10, %v11, %v11 \n" - " vperm %v13, %v12, %v1, %v9 \n" - " srawi %r6, %r6, 1 \n" - " lvx %v12, 0, %r4 \n" - " lvx %v1, %r9, %r4 \n" - " addi %r6, %r6, -1 \n" - " vperm %v11, %v12, %v1, %v10 \n" - " mtctr %r6 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v13, %v11 \n" - "._L31: \n" - " li %r9, 7 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v12, 0, %r4 \n" - " stvewx %v0, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v13, %v12, %v1, %v9 \n" - " stvewx %v0, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v13, %v11 \n" - " li %r9, 7 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v12, 0, %r4 \n" - " add %r3, %r3, %r5 \n" - " stvewx %v0, 0, %r3 \n" - " vperm %v11, %v12, %v1, %v10 \n" - " li %r9, 4 \n" - " stvewx %v0, %r9, %r3 \n" - " vavgub %v0, %v13, %v11 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r5 \n" - " bdnz ._L31 \n" - " li %r9, 7 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v12, 0, %r4 \n" - " stvewx %v0, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v13, %v12, %v1, %v9 \n" - " stvewx %v0, %r9, %r3 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v0, %v13, %v11 \n" - " stvewx %v0, 0, %r3 \n" - " stvewx %v0, %r9, %r3 \n" - ); + return vec_avg (A, B); } +#undef vec_avg +#define vec_avg my_vec_avg -static void MC_put_xy_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v5, 0, %r4 \n" - " vspltisb %v3, 1 \n" - " li %r9, 16 \n" - " lvx %v1, 0, %r4 \n" - " vaddubm %v4, %v5, %v3 \n" - " lvx %v0, %r9, %r4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v1, %v0, %v4 \n" - " srawi %r6, %r6, 1 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " addi %r6, %r6, -1 \n" - " lvx %v1, 0, %r4 \n" - " mtctr %r6 \n" - " lvx %v0, %r9, %r4 \n" - " vavgub %v9, %v11, %v10 \n" - " vxor %v8, %v11, %v10 \n" - " add %r0, %r5, %r5 \n" - " vperm %v10, %v1, %v0, %v4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " vxor %v6, %v11, %v10 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v0, %v8, %v6 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v0, %v3, %v0 \n" - " vavgub %v1, %v9, %v7 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v13, %v1, %v0 \n" - "._L36: \n" - " li %r9, 16 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " stvx %v13, 0, %r3 \n" - " vperm %v10, %v1, %v0, %v4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " vavgub %v9, %v11, %v10 \n" - " vxor %v8, %v11, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v1, %v0, %v4 \n" - " vavgub %v12, %v9, %v7 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " vor %v13, %v8, %v6 \n" - " vxor %v0, %v9, %v7 \n" - " vxor %v6, %v11, %v10 \n" - " vand %v13, %v3, %v13 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v1, %v8, %v6 \n" - " vand %v13, %v13, %v0 \n" - " vxor %v0, %v9, %v7 \n" - " vand %v1, %v3, %v1 \n" - " vsububm %v13, %v12, %v13 \n" - " vand %v1, %v1, %v0 \n" - " stvx %v13, %r5, %r3 \n" - " vavgub %v0, %v9, %v7 \n" - " add %r3, %r3, %r0 \n" - " vsububm %v13, %v0, %v1 \n" - " bdnz ._L36 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v1, 0, %r4 \n" - " stvx %v13, 0, %r3 \n" - " vperm %v10, %v1, %v0, %v4 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " vxor %v8, %v11, %v10 \n" - " vavgub %v9, %v11, %v10 \n" - " vor %v0, %v8, %v6 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v0, %v3, %v0 \n" - " vavgub %v1, %v9, %v7 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v13, %v1, %v0 \n" - " stvx %v13, %r5, %r3 \n" - ); -} - -static void MC_put_xy_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v4, 0, %r4 \n" - " vspltisb %v3, 1 \n" - " lvsl %v5, %r5, %r4 \n" - " vmrghb %v4, %v4, %v4 \n" - " li %r9, 8 \n" - " vmrghb %v5, %v5, %v5 \n" - " lvx %v1, 0, %r4 \n" - " vpkuhum %v4, %v4, %v4 \n" - " lvx %v0, %r9, %r4 \n" - " vpkuhum %v5, %v5, %v5 \n" - " add %r4, %r4, %r5 \n" - " vaddubm %v2, %v4, %v3 \n" - " vperm %v11, %v1, %v0, %v4 \n" - " srawi %r6, %r6, 1 \n" - " vaddubm %v19, %v5, %v3 \n" - " addi %r6, %r6, -1 \n" - " vperm %v10, %v1, %v0, %v2 \n" - " mtctr %r6 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r9, %r4 \n" - " vavgub %v9, %v11, %v10 \n" - " vxor %v8, %v11, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v1, %v0, %v19 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " vxor %v6, %v11, %v10 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v0, %v8, %v6 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v0, %v3, %v0 \n" - " vavgub %v1, %v9, %v7 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v13, %v1, %v0 \n" - "._L41: \n" - " li %r9, 8 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v1, 0, %r4 \n" - " stvewx %v13, 0, %r3 \n" - " li %r9, 4 \n" - " vperm %v10, %v1, %v0, %v2 \n" - " stvewx %v13, %r9, %r3 \n" - " vperm %v11, %v1, %v0, %v4 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 8 \n" - " vavgub %v9, %v11, %v10 \n" - " lvx %v0, %r9, %r4 \n" - " vxor %v8, %v11, %v10 \n" - " lvx %v1, 0, %r4 \n" - " vavgub %v12, %v9, %v7 \n" - " vor %v13, %v8, %v6 \n" - " add %r3, %r3, %r5 \n" - " vperm %v10, %v1, %v0, %v19 \n" - " li %r9, 4 \n" - " vperm %v11, %v1, %v0, %v5 \n" - " vand %v13, %v3, %v13 \n" - " add %r4, %r4, %r5 \n" - " vxor %v0, %v9, %v7 \n" - " vxor %v6, %v11, %v10 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v1, %v8, %v6 \n" - " vand %v13, %v13, %v0 \n" - " vxor %v0, %v9, %v7 \n" - " vand %v1, %v3, %v1 \n" - " vsububm %v13, %v12, %v13 \n" - " vand %v1, %v1, %v0 \n" - " stvewx %v13, 0, %r3 \n" - " vavgub %v0, %v9, %v7 \n" - " stvewx %v13, %r9, %r3 \n" - " add %r3, %r3, %r5 \n" - " vsububm %v13, %v0, %v1 \n" - " bdnz ._L41 \n" - " li %r9, 8 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v1, 0, %r4 \n" - " stvewx %v13, 0, %r3 \n" - " vperm %v10, %v1, %v0, %v2 \n" - " li %r9, 4 \n" - " vperm %v11, %v1, %v0, %v4 \n" - " stvewx %v13, %r9, %r3 \n" - " add %r3, %r3, %r5 \n" - " vxor %v8, %v11, %v10 \n" - " vavgub %v9, %v11, %v10 \n" - " vor %v0, %v8, %v6 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v0, %v3, %v0 \n" - " vavgub %v1, %v9, %v7 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v13, %v1, %v0 \n" - " stvewx %v13, 0, %r3 \n" - " stvewx %v13, %r9, %r3 \n" - ); -} - -static void MC_avg_o_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " li %r9, 15 \n" - " lvx %v0, %r9, %r4 \n" - " lvsl %v11, 0, %r4 \n" - " lvx %v1, 0, %r4 \n" - " srawi %r6, %r6, 1 \n" - " addi %r6, %r6, -1 \n" - " vperm %v0, %v1, %v0, %v11 \n" - " lvx %v13, 0, %r3 \n" - " mtctr %r6 \n" - " add %r9, %r5, %r5 \n" - " vavgub %v12, %v13, %v0 \n" - " add %r4, %r4, %r5 \n" - "._L46: \n" - " li %r11, 15 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r11, %r4 \n" - " lvx %v13, %r5, %r3 \n" - " vperm %v0, %v1, %v0, %v11 \n" - " stvx %v12, 0, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v12, %v13, %v0 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v0, %r11, %r4 \n" - " lvx %v13, %r9, %r3 \n" - " vperm %v0, %v1, %v0, %v11 \n" - " stvx %v12, %r5, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v12, %v13, %v0 \n" - " add %r3, %r3, %r9 \n" - " bdnz ._L46 \n" - " lvx %v0, %r11, %r4 \n" - " lvx %v1, 0, %r4 \n" - " lvx %v13, %r5, %r3 \n" - " vperm %v0, %v1, %v0, %v11 \n" - " stvx %v12, 0, %r3 \n" - " vavgub %v12, %v13, %v0 \n" - " stvx %v12, %r5, %r3 \n" - ); -} - -static void MC_avg_o_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v12, 0, %r4 \n" - " li %r9, 7 \n" - " vmrghb %v12, %v12, %v12 \n" - " lvsl %v1, %r5, %r4 \n" - " lvx %v13, 0, %r4 \n" - " vpkuhum %v9, %v12, %v12 \n" - " lvx %v0, %r9, %r4 \n" - " srawi %r6, %r6, 1 \n" - " vmrghb %v1, %v1, %v1 \n" - " addi %r6, %r6, -1 \n" - " vperm %v0, %v13, %v0, %v9 \n" - " lvx %v11, 0, %r3 \n" - " mtctr %r6 \n" - " vpkuhum %v10, %v1, %v1 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v12, %v11, %v0 \n" - "._L51: \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v11, %r5, %r3 \n" - " stvewx %v12, 0, %r3 \n" - " vperm %v0, %v13, %v0, %v10 \n" - " li %r9, 4 \n" - " stvewx %v12, %r9, %r3 \n" - " vavgub %v1, %v11, %v0 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " add %r3, %r3, %r5 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v11, %r5, %r3 \n" - " stvewx %v1, 0, %r3 \n" - " vperm %v0, %v13, %v0, %v9 \n" - " li %r9, 4 \n" - " stvewx %v1, %r9, %r3 \n" - " vavgub %v12, %v11, %v0 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r5 \n" - " bdnz ._L51 \n" - " li %r9, 7 \n" - " lvx %v0, %r9, %r4 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v11, %r5, %r3 \n" - " stvewx %v12, 0, %r3 \n" - " vperm %v0, %v13, %v0, %v10 \n" - " li %r9, 4 \n" - " stvewx %v12, %r9, %r3 \n" - " vavgub %v1, %v11, %v0 \n" - " add %r3, %r3, %r5 \n" - " stvewx %v1, 0, %r3 \n" - " stvewx %v1, %r9, %r3 \n" - ); -} - -static void MC_avg_x_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v8, 0, %r4 \n" - " vspltisb %v0, 1 \n" - " li %r9, 16 \n" - " lvx %v12, %r9, %r4 \n" - " vaddubm %v7, %v8, %v0 \n" - " lvx %v11, 0, %r4 \n" - " srawi %r6, %r6, 1 \n" - " vperm %v1, %v11, %v12, %v7 \n" - " addi %r6, %r6, -1 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " lvx %v9, 0, %r3 \n" - " mtctr %r6 \n" - " add %r9, %r5, %r5 \n" - " vavgub %v0, %v0, %v1 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v10, %v9, %v0 \n" - "._L56: \n" - " li %r11, 16 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v12, %r11, %r4 \n" - " lvx %v9, %r5, %r3 \n" - " stvx %v10, 0, %r3 \n" - " vperm %v0, %v11, %v12, %v7 \n" - " add %r4, %r4, %r5 \n" - " vperm %v1, %v11, %v12, %v8 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v12, %r11, %r4 \n" - " vavgub %v1, %v1, %v0 \n" - " add %r4, %r4, %r5 \n" - " vperm %v13, %v11, %v12, %v7 \n" - " vavgub %v10, %v9, %v1 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " lvx %v9, %r9, %r3 \n" - " stvx %v10, %r5, %r3 \n" - " vavgub %v0, %v0, %v13 \n" - " add %r3, %r3, %r9 \n" - " vavgub %v10, %v9, %v0 \n" - " bdnz ._L56 \n" - " lvx %v12, %r11, %r4 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v9, %r5, %r3 \n" - " vperm %v1, %v11, %v12, %v7 \n" - " stvx %v10, 0, %r3 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " vavgub %v0, %v0, %v1 \n" - " vavgub %v10, %v9, %v0 \n" - " stvx %v10, %r5, %r3 \n" - ); -} - -static void MC_avg_x_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v10, 0, %r4 \n" - " vspltisb %v13, 1 \n" - " li %r9, 8 \n" - " vmrghb %v10, %v10, %v10 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v12, %r9, %r4 \n" - " vpkuhum %v7, %v10, %v10 \n" - " srawi %r6, %r6, 1 \n" - " lvsl %v10, %r5, %r4 \n" - " vaddubm %v6, %v7, %v13 \n" - " vperm %v0, %v11, %v12, %v7 \n" - " addi %r6, %r6, -1 \n" - " vmrghb %v10, %v10, %v10 \n" - " lvx %v9, 0, %r3 \n" - " mtctr %r6 \n" - " vperm %v1, %v11, %v12, %v6 \n" - " add %r4, %r4, %r5 \n" - " vpkuhum %v8, %v10, %v10 \n" - " vavgub %v0, %v0, %v1 \n" - " vaddubm %v13, %v8, %v13 \n" - " vavgub %v10, %v9, %v0 \n" - "._L61: \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v9, %r5, %r3 \n" - " stvewx %v10, 0, %r3 \n" - " vperm %v1, %v11, %v12, %v13 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " li %r9, 4 \n" - " stvewx %v10, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v0, %v1 \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " vavgub %v10, %v9, %v0 \n" - " lvx %v11, 0, %r4 \n" - " add %r3, %r3, %r5 \n" - " vperm %v1, %v11, %v12, %v6 \n" - " lvx %v9, %r5, %r3 \n" - " vperm %v0, %v11, %v12, %v7 \n" - " stvewx %v10, 0, %r3 \n" - " li %r9, 4 \n" - " vavgub %v0, %v0, %v1 \n" - " stvewx %v10, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v10, %v9, %v0 \n" - " bdnz ._L61 \n" - " li %r9, 8 \n" - " lvx %v12, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v9, %r5, %r3 \n" - " vperm %v1, %v11, %v12, %v13 \n" - " stvewx %v10, 0, %r3 \n" - " vperm %v0, %v11, %v12, %v8 \n" - " li %r9, 4 \n" - " stvewx %v10, %r9, %r3 \n" - " vavgub %v0, %v0, %v1 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v10, %v9, %v0 \n" - " stvewx %v10, 0, %r3 \n" - " stvewx %v10, %r9, %r3 \n" - ); -} - -static void MC_avg_y_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " li %r9, 15 \n" - " lvx %v1, %r9, %r4 \n" - " lvsl %v9, 0, %r4 \n" - " lvx %v13, 0, %r4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v11, %v13, %v1, %v9 \n" - " li %r11, 15 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " srawi %r6, %r6, 1 \n" - " vperm %v10, %v13, %v1, %v9 \n" - " addi %r6, %r6, -1 \n" - " lvx %v12, 0, %r3 \n" - " mtctr %r6 \n" - " vavgub %v0, %v11, %v10 \n" - " add %r9, %r5, %r5 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v12, %v0 \n" - "._L66: \n" - " li %r11, 15 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " lvx %v12, %r5, %r3 \n" - " vperm %v11, %v13, %v1, %v9 \n" - " stvx %v0, 0, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v11, %v10 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " vavgub %v0, %v12, %v0 \n" - " add %r4, %r4, %r5 \n" - " lvx %v12, %r9, %r3 \n" - " vperm %v10, %v13, %v1, %v9 \n" - " stvx %v0, %r5, %r3 \n" - " vavgub %v0, %v11, %v10 \n" - " add %r3, %r3, %r9 \n" - " vavgub %v0, %v12, %v0 \n" - " bdnz ._L66 \n" - " lvx %v1, %r11, %r4 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v12, %r5, %r3 \n" - " vperm %v11, %v13, %v1, %v9 \n" - " stvx %v0, 0, %r3 \n" - " vavgub %v0, %v11, %v10 \n" - " vavgub %v0, %v12, %v0 \n" - " stvx %v0, %r5, %r3 \n" - ); -} - -static void MC_avg_y_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v12, 0, %r4 \n" - " lvsl %v9, %r5, %r4 \n" - " vmrghb %v12, %v12, %v12 \n" - " li %r9, 7 \n" - " lvx %v11, 0, %r4 \n" - " vmrghb %v9, %v9, %v9 \n" - " lvx %v13, %r9, %r4 \n" - " vpkuhum %v7, %v12, %v12 \n" - " add %r4, %r4, %r5 \n" - " vpkuhum %v8, %v9, %v9 \n" - " vperm %v12, %v11, %v13, %v7 \n" - " srawi %r6, %r6, 1 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v13, %r9, %r4 \n" - " addi %r6, %r6, -1 \n" - " vperm %v9, %v11, %v13, %v8 \n" - " lvx %v10, 0, %r3 \n" - " mtctr %r6 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v0, %v12, %v9 \n" - " vavgub %v1, %v10, %v0 \n" - "._L71: \n" - " li %r9, 7 \n" - " lvx %v13, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v10, %r5, %r3 \n" - " stvewx %v1, 0, %r3 \n" - " vperm %v12, %v11, %v13, %v7 \n" - " li %r9, 4 \n" - " stvewx %v1, %r9, %r3 \n" - " vavgub %v0, %v12, %v9 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 7 \n" - " vavgub %v1, %v10, %v0 \n" - " lvx %v13, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " add %r3, %r3, %r5 \n" - " vperm %v9, %v11, %v13, %v8 \n" - " lvx %v10, %r5, %r3 \n" - " stvewx %v1, 0, %r3 \n" - " vavgub %v0, %v12, %v9 \n" - " li %r9, 4 \n" - " stvewx %v1, %r9, %r3 \n" - " add %r4, %r4, %r5 \n" - " vavgub %v1, %v10, %v0 \n" - " add %r3, %r3, %r5 \n" - " bdnz ._L71 \n" - " li %r9, 7 \n" - " lvx %v13, %r9, %r4 \n" - " lvx %v11, 0, %r4 \n" - " lvx %v10, %r5, %r3 \n" - " vperm %v12, %v11, %v13, %v7 \n" - " stvewx %v1, 0, %r3 \n" - " li %r9, 4 \n" - " vavgub %v0, %v12, %v9 \n" - " stvewx %v1, %r9, %r3 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v1, %v10, %v0 \n" - " stvewx %v1, 0, %r3 \n" - " stvewx %v1, %r9, %r3 \n" - ); -} - -static void MC_avg_xy_16_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v4, 0, %r4 \n" - " vspltisb %v2, 1 \n" - " li %r9, 16 \n" - " lvx %v1, %r9, %r4 \n" - " vaddubm %v3, %v4, %v2 \n" - " lvx %v13, 0, %r4 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v13, %v1, %v3 \n" - " li %r11, 16 \n" - " vperm %v11, %v13, %v1, %v4 \n" - " srawi %r6, %r6, 1 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " vavgub %v9, %v11, %v10 \n" - " vxor %v8, %v11, %v10 \n" - " addi %r6, %r6, -1 \n" - " vperm %v10, %v13, %v1, %v3 \n" - " lvx %v6, 0, %r3 \n" - " mtctr %r6 \n" - " vperm %v11, %v13, %v1, %v4 \n" - " add %r9, %r5, %r5 \n" - " add %r4, %r4, %r5 \n" - " vxor %v5, %v11, %v10 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v1, %v8, %v5 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v1, %v2, %v1 \n" - " vavgub %v0, %v9, %v7 \n" - " vand %v1, %v1, %v13 \n" - " vsububm %v0, %v0, %v1 \n" - " vavgub %v12, %v6, %v0 \n" - "._L76: \n" - " li %r11, 16 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " lvx %v6, %r5, %r3 \n" - " stvx %v12, 0, %r3 \n" - " vperm %v10, %v13, %v1, %v3 \n" - " vperm %v11, %v13, %v1, %v4 \n" - " add %r4, %r4, %r5 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v1, %r11, %r4 \n" - " vavgub %v9, %v11, %v10 \n" - " vxor %v8, %v11, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v13, %v1, %v3 \n" - " vavgub %v12, %v9, %v7 \n" - " vperm %v11, %v13, %v1, %v4 \n" - " vor %v0, %v8, %v5 \n" - " vxor %v13, %v9, %v7 \n" - " vxor %v5, %v11, %v10 \n" - " vand %v0, %v2, %v0 \n" - " vavgub %v7, %v11, %v10 \n" - " vor %v1, %v8, %v5 \n" - " vand %v0, %v0, %v13 \n" - " vand %v1, %v2, %v1 \n" - " vxor %v13, %v9, %v7 \n" - " vsububm %v12, %v12, %v0 \n" - " vand %v1, %v1, %v13 \n" - " vavgub %v0, %v9, %v7 \n" - " vavgub %v12, %v6, %v12 \n" - " lvx %v6, %r9, %r3 \n" - " vsububm %v0, %v0, %v1 \n" - " stvx %v12, %r5, %r3 \n" - " vavgub %v12, %v6, %v0 \n" - " add %r3, %r3, %r9 \n" - " bdnz ._L76 \n" - " lvx %v1, %r11, %r4 \n" - " lvx %v13, 0, %r4 \n" - " lvx %v6, %r5, %r3 \n" - " vperm %v10, %v13, %v1, %v3 \n" - " stvx %v12, 0, %r3 \n" - " vperm %v11, %v13, %v1, %v4 \n" - " vxor %v8, %v11, %v10 \n" - " vavgub %v9, %v11, %v10 \n" - " vor %v0, %v8, %v5 \n" - " vxor %v13, %v9, %v7 \n" - " vand %v0, %v2, %v0 \n" - " vavgub %v1, %v9, %v7 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v1, %v1, %v0 \n" - " vavgub %v12, %v6, %v1 \n" - " stvx %v12, %r5, %r3 \n" - ); -} - -static void MC_avg_xy_8_altivec (uint8_t * dest, const uint8_t * ref, - int stride, int height) -{ - asm (" \n" - " lvsl %v2, 0, %r4 \n" - " vspltisb %v19, 1 \n" - " lvsl %v3, %r5, %r4 \n" - " vmrghb %v2, %v2, %v2 \n" - " li %r9, 8 \n" - " vmrghb %v3, %v3, %v3 \n" - " lvx %v9, 0, %r4 \n" - " vpkuhum %v2, %v2, %v2 \n" - " lvx %v1, %r9, %r4 \n" - " vpkuhum %v3, %v3, %v3 \n" - " add %r4, %r4, %r5 \n" - " vaddubm %v18, %v2, %v19 \n" - " vperm %v11, %v9, %v1, %v2 \n" - " srawi %r6, %r6, 1 \n" - " vaddubm %v17, %v3, %v19 \n" - " addi %r6, %r6, -1 \n" - " vperm %v10, %v9, %v1, %v18 \n" - " lvx %v4, 0, %r3 \n" - " mtctr %r6 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v9, 0, %r4 \n" - " vavgub %v8, %v11, %v10 \n" - " vxor %v7, %v11, %v10 \n" - " add %r4, %r4, %r5 \n" - " vperm %v10, %v9, %v1, %v17 \n" - " vperm %v11, %v9, %v1, %v3 \n" - " vxor %v5, %v11, %v10 \n" - " vavgub %v6, %v11, %v10 \n" - " vor %v1, %v7, %v5 \n" - " vxor %v13, %v8, %v6 \n" - " vand %v1, %v19, %v1 \n" - " vavgub %v0, %v8, %v6 \n" - " vand %v1, %v1, %v13 \n" - " vsububm %v0, %v0, %v1 \n" - " vavgub %v13, %v4, %v0 \n" - "._L81: \n" - " li %r9, 8 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v9, 0, %r4 \n" - " lvx %v4, %r5, %r3 \n" - " stvewx %v13, 0, %r3 \n" - " vperm %v10, %v9, %v1, %v18 \n" - " vperm %v11, %v9, %v1, %v2 \n" - " li %r9, 4 \n" - " stvewx %v13, %r9, %r3 \n" - " vxor %v7, %v11, %v10 \n" - " add %r4, %r4, %r5 \n" - " li %r9, 8 \n" - " vavgub %v8, %v11, %v10 \n" - " lvx %v1, %r9, %r4 \n" - " vor %v0, %v7, %v5 \n" - " lvx %v9, 0, %r4 \n" - " vxor %v12, %v8, %v6 \n" - " vand %v0, %v19, %v0 \n" - " add %r3, %r3, %r5 \n" - " vperm %v10, %v9, %v1, %v17 \n" - " vavgub %v13, %v8, %v6 \n" - " li %r9, 4 \n" - " vperm %v11, %v9, %v1, %v3 \n" - " vand %v0, %v0, %v12 \n" - " add %r4, %r4, %r5 \n" - " vxor %v5, %v11, %v10 \n" - " vavgub %v6, %v11, %v10 \n" - " vor %v1, %v7, %v5 \n" - " vsububm %v13, %v13, %v0 \n" - " vxor %v0, %v8, %v6 \n" - " vand %v1, %v19, %v1 \n" - " vavgub %v13, %v4, %v13 \n" - " vand %v1, %v1, %v0 \n" - " lvx %v4, %r5, %r3 \n" - " vavgub %v0, %v8, %v6 \n" - " stvewx %v13, 0, %r3 \n" - " stvewx %v13, %r9, %r3 \n" - " vsububm %v0, %v0, %v1 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v13, %v4, %v0 \n" - " bdnz ._L81 \n" - " li %r9, 8 \n" - " lvx %v1, %r9, %r4 \n" - " lvx %v9, 0, %r4 \n" - " lvx %v4, %r5, %r3 \n" - " vperm %v10, %v9, %v1, %v18 \n" - " stvewx %v13, 0, %r3 \n" - " vperm %v11, %v9, %v1, %v2 \n" - " li %r9, 4 \n" - " stvewx %v13, %r9, %r3 \n" - " vxor %v7, %v11, %v10 \n" - " add %r3, %r3, %r5 \n" - " vavgub %v8, %v11, %v10 \n" - " vor %v0, %v7, %v5 \n" - " vxor %v13, %v8, %v6 \n" - " vand %v0, %v19, %v0 \n" - " vavgub %v1, %v8, %v6 \n" - " vand %v0, %v0, %v13 \n" - " vsububm %v1, %v1, %v0 \n" - " vavgub %v13, %v4, %v1 \n" - " stvewx %v13, 0, %r3 \n" - " stvewx %v13, %r9, %r3 \n" - ); -} - -MPEG2_MC_EXTERN (altivec) - -#endif /* ARCH_PPC */ - -#else /* __ALTIVEC__ */ - -#define vector_s16_t vector signed short -#define vector_u16_t vector unsigned short -#define vector_s8_t vector signed char -#define vector_u8_t vector unsigned char -#define vector_s32_t vector signed int -#define vector_u32_t vector unsigned int +#endif -void MC_put_o_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_o_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm, ref0, ref1, tmp; @@ -1113,8 +101,8 @@ void MC_put_o_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_put_o_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_o_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0, perm1, tmp0, tmp1, ref0, ref1; @@ -1160,8 +148,8 @@ void MC_put_o_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); } -void MC_put_x_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_x_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t permA, permB, ref0, ref1, tmp; @@ -1201,8 +189,8 @@ void MC_put_x_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_put_x_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_x_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0A, perm0B, perm1A, perm1B, ones, tmp0, tmp1, ref0, ref1; @@ -1255,8 +243,8 @@ void MC_put_x_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); } -void MC_put_y_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_y_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm, ref0, ref1, tmp0, tmp1, tmp; @@ -1299,8 +287,8 @@ void MC_put_y_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_put_y_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_y_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0, perm1, tmp0, tmp1, tmp, ref0, ref1; @@ -1354,8 +342,8 @@ void MC_put_y_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); } -void MC_put_xy_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_xy_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t permA, permB, ref0, ref1, A, B, avg0, avg1, xor0, xor1, tmp; vector_u8_t ones; @@ -1425,8 +413,8 @@ void MC_put_xy_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_put_xy_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0A, perm0B, perm1A, perm1B, ref0, ref1, A, B; vector_u8_t avg0, avg1, xor0, xor1, tmp, ones; @@ -1509,8 +497,8 @@ void MC_put_xy_8_altivec (unsigned char * dest, const unsigned char * ref, } #if 0 -void MC_put_xy_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_put_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t permA, permB, ref0, ref1, A, B, C, D, tmp, zero, ones; vector_u16_t splat2, temp; @@ -1548,8 +536,8 @@ void MC_put_xy_8_altivec (unsigned char * dest, const unsigned char * ref, } #endif -void MC_avg_o_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_o_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm, ref0, ref1, tmp, prev; @@ -1588,8 +576,8 @@ void MC_avg_o_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_avg_o_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_o_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0, perm1, tmp0, tmp1, ref0, ref1, prev; @@ -1639,8 +627,8 @@ void MC_avg_o_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); } -void MC_avg_x_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_x_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t permA, permB, ref0, ref1, tmp, prev; @@ -1684,8 +672,8 @@ void MC_avg_x_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_avg_x_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_x_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0A, perm0B, perm1A, perm1B, ones, tmp0, tmp1, ref0, ref1; vector_u8_t prev; @@ -1743,8 +731,8 @@ void MC_avg_x_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); } -void MC_avg_y_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_y_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm, ref0, ref1, tmp0, tmp1, tmp, prev; @@ -1791,8 +779,8 @@ void MC_avg_y_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_avg_y_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_y_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0, perm1, tmp0, tmp1, tmp, ref0, ref1, prev; @@ -1850,8 +838,8 @@ void MC_avg_y_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); } -void MC_avg_xy_16_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_xy_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t permA, permB, ref0, ref1, A, B, avg0, avg1, xor0, xor1, tmp; vector_u8_t ones, prev; @@ -1927,8 +915,8 @@ void MC_avg_xy_16_altivec (unsigned char * dest, const unsigned char * ref, vec_st (tmp, stride, dest); } -void MC_avg_xy_8_altivec (unsigned char * dest, const unsigned char * ref, - const int stride, int height) +static void MC_avg_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) { vector_u8_t perm0A, perm0B, perm1A, perm1B, ref0, ref1, A, B; vector_u8_t avg0, avg1, xor0, xor1, tmp, ones, prev; @@ -2016,4 +1004,6 @@ void MC_avg_xy_8_altivec (unsigned char * dest, const unsigned char * ref, vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); } -#endif /* __ALTIVEC__ */ +MPEG2_MC_EXTERN (altivec) + +#endif |