[FFmpeg-cvslog] Fix build failure on osx 10.5.8 ppc
Pavel Koshevoy
git at videolan.org
Mon Oct 8 05:45:16 CEST 2012
ffmpeg | branch: master | Pavel Koshevoy <pkoshevoy at gmail.com> | Sun Oct 7 21:13:28 2012 -0600| [9425dc3dba0bd1209aa7a788ea8f3c194fc7c7c5] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9425dc3dba0bd1209aa7a788ea8f3c194fc7c7c5
---
libavcodec/ppc/fmtconvert_altivec.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/libavcodec/ppc/fmtconvert_altivec.c b/libavcodec/ppc/fmtconvert_altivec.c
index 7eff9f0..bad3b45 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
}
}
More information about the ffmpeg-cvslog
mailing list