swr: update calling code to support mixed packed planar SIMD

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-05-05 18:31:04 +02:00
parent e8dd7928c8
commit fec3700dcd
1 changed files with 10 additions and 6 deletions

View File

@ -154,15 +154,19 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
//FIXME optimize common cases
if(ctx->simd_f && !ctx->ch_map){
int planes = out->planar ? out->ch_count : 1;
off = len/16 * 16;
av_assert1(out->planar == in->planar);
av_assert1(off>=0);
if(off>0)
for(ch=0; ch<planes; ch++){
ctx->simd_f(out->ch+ch, in->ch+ch, off * (out->planar ? 1 :out->ch_count));
}
av_assert1(off<=len);
if(off>0){
if(out->planar == in->planar){
int planes = out->planar ? out->ch_count : 1;
for(ch=0; ch<planes; ch++){
ctx->simd_f(out->ch+ch, in->ch+ch, off * (out->planar ? 1 :out->ch_count));
}
}else{
ctx->simd_f(out->ch, in->ch, off);
}
}
if(off == len)
return 0;
}