diff options
author | Pavel Koshevoy <pkoshevoy@gmail.com> | 2012-10-07 21:13:28 -0600 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 05:40:26 +0200 |
commit | 9425dc3dba0bd1209aa7a788ea8f3c194fc7c7c5 (patch) | |
tree | 9252ea7afeb9b1d03a5c1026dfee485a5d5e0538 /libavcodec | |
parent | f464b02d2214009344c2b5975e3ca2feb3c3ba38 (diff) | |
download | ffmpeg-9425dc3dba0bd1209aa7a788ea8f3c194fc7c7c5.tar.gz |
Fix build failure on osx 10.5.8 ppc
Second parameter to vec_splat must be a literal, not a variable
value. Therefore the second nested for-loop in
float_to_int16_stride_altivec had to be unrolled.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ppc/fmtconvert_altivec.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libavcodec/ppc/fmtconvert_altivec.c b/libavcodec/ppc/fmtconvert_altivec.c index 7eff9f04d1..bad3b45b1b 100644 --- a/libavcodec/ppc/fmtconvert_altivec.c +++ b/libavcodec/ppc/fmtconvert_altivec.c @@ -86,16 +86,27 @@ static void float_to_int16_altivec(int16_t *dst, const float *src, long len) static void float_to_int16_stride_altivec(int16_t *dst, const float *src, long len, int stride) { - int i, j; + int i; vector signed short d, s; for (i = 0; i < len - 7; i += 8) { d = float_to_int16_one_altivec(src + i); - for (j = 0; j < 8; j++) { - s = vec_splat(d, j); - vec_ste(s, 0, dst); - dst += stride; - } + +#define ASSIGN_S_VEC_SPLAT_D(j) \ + s = vec_splat(d, j); \ + vec_ste(s, 0, dst); \ + dst += stride + + ASSIGN_S_VEC_SPLAT_D(0); + ASSIGN_S_VEC_SPLAT_D(1); + ASSIGN_S_VEC_SPLAT_D(2); + ASSIGN_S_VEC_SPLAT_D(3); + ASSIGN_S_VEC_SPLAT_D(4); + ASSIGN_S_VEC_SPLAT_D(5); + ASSIGN_S_VEC_SPLAT_D(6); + ASSIGN_S_VEC_SPLAT_D(7); + +#undef ASSIGN_S_VEC_SPLAT_D } } |