[x264-devel] [PATCH] Implementation of predict_16x16_p() in AltiVec

Guillaume POIRIER poirierg at gmail.com
Sat Dec 8 11:03:29 CET 2007


Hello,

On Dec 8, 2007 9:47 AM, Noboru Asai <noboru.asai at gmail.com> wrote:
> Hi,
>
> 2007/12/8, Guillaume Poirier <gpoirier at mplayerhq.hu>:
> > Hello,
> >
> > The attached patch adds the AliVec implementation predict_16x16_p().
> >
> > Comments, benchmarks and feedbacks are welcome.
>
> please apply the following patch.
>
> --- a/common/ppc/predict.c
> +++ b/common/ppc/predict.c
> @@ -20,6 +20,10 @@
>   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
>
> *****************************************************************************/
>
>  +#ifdef SYS_LINUX
> +#include <altivec.h>
> +#endif
> +
>  #include "common/common.h"
>  #include "common/clip1.h"
>  #include "predict.h"
> @@ -49,13 +53,13 @@ static void predict_16x16_p_altivec( uint8_t *src )
>      b_u.s[0]   = b;
>      c_u.s[0]   = c;
>
> -    vec_s16_t val5_v = vec_splat_s16(5);
> +    vec_u16_t val5_v = vec_splat_u16(5);
>      vec_s16_t i00_v, b_v, c_v;
>      i00_v = vec_splat(i00_u.v, 0);
>       b_v = vec_splat(b_u.v, 0);
>      c_v = vec_splat(c_u.v, 0);
>      vec_s16_t induc_v  = (vec_s16_t) CV(0,  1,  2,  3,  4,  5,  6,  7);
> -    vec_s16_t b8_v = vec_sl(b_v, vec_splat_s16(3));
> +    vec_s16_t b8_v = vec_sl(b_v, vec_splat_u16(3));
>      vec_s32_t mule_b_v = vec_mule(induc_v, b_v);
>      vec_s32_t mulo_b_v = vec_mulo(induc_v, b_v);
>      vec_s16_t mul_b_induc0_v = vec_pack(vec_mergeh(mule_b_v, mulo_b_v),
> vec_mergel(mule_b_v, mulo_b_v));
>

Ah, thanks a lot. Indeed, my patch didn't work neither with GCC3, nor on Linux.

Final (hopefully) patch attached.

Guillaume
-- 
A soldier will fight long and hard for a bit of colored ribbon.
 -- Napoleon Bonaparte
-------------- next part --------------
A non-text attachment was scrubbed...
Name: predict_16x16_p_altivec.4.diff
Type: application/octet-stream
Size: 6580 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20071208/a8e5e01d/attachment.obj 


More information about the x264-devel mailing list