swr: update calling code to support mixed packed planar SIMD
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 5 May 2012 16:31:04 +0000 (18:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 5 May 2012 16:32:34 +0000 (18:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/audioconvert.c

index 04e33c5..81bd6d3 100644 (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;
     }