[FFmpeg-devel] build failure on osx 10.5.8 ppc

Pavel Koshevoy pkoshevoy at gmail.com
Sun Oct 7 16:43:15 CEST 2012


Hi,

I see this build error on my antique iMac G4:

CC libavcodec/ppc/fmtconvert_altivec.o
/nfs/scratch/Developer/ffmpeg-git-src/libavcodec/ppc/fmtconvert_altivec.c: 
In function ‘float_to_int16_interleave_altivec’:
/nfs/scratch/Developer/ffmpeg-git-src/libavcodec/ppc/fmtconvert_altivec.c:96: 
error: argument 2 must be a 5-bit unsigned literal
make: *** [libavcodec/ppc/fmtconvert_altivec.o] Error 1


It seems to be complaining about vec_splat(d, j) -- second parameter 
can't be a variable?! I can't find where vec_splat is defined, but at 
least the compiler is stating that the second parameter has to be a 
literal. If that's the case then the second for-loop probably should be 
unrolled, like this perhaps:

static void float_to_int16_stride_altivec(int16_t *dst, const float *src,
long len, int stride)
{
int i;
vector signed short d, s;

for (i = 0; i < len - 7; i += 8) {
d = float_to_int16_one_altivec(src + i);

#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
}
}

With this change it compiles for me, but I am wondering whether this is 
the right fix. I can submit a patch.

Thank you,
Pavel.



More information about the ffmpeg-devel mailing list