# HG changeset patch # User lu_zero # Date 1219525350 0 # Node ID e1876d3200eedb544fd289b3dd708c151b1f385d # Parent adcd246127ebdb7d280dc4c4c66fabf1745592c3 Introduce float_to_int16_one_altivec diff -r adcd246127eb -r e1876d3200ee ppc/float_altivec.c --- a/ppc/float_altivec.c Sat Aug 23 15:49:58 2008 +0000 +++ b/ppc/float_altivec.c Sat Aug 23 21:02:30 2008 +0000 @@ -149,6 +149,17 @@ ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step); } + +static vector signed short +float_to_int16_one_altivec(const float *src) +{ + vector float s0 = vec_ld(0, src); + vector float s1 = vec_ld(16, src); + vector signed int t0 = vec_cts(s0, 0); + vector signed int t1 = vec_cts(s1, 0); + return vec_packs(t0,t1); +} + void float_to_int16_altivec(int16_t *dst, const float *src, int len) { int i; @@ -158,13 +169,9 @@ vector unsigned char align; if(((long)dst)&15) //FIXME for(i=0; i