[FFmpeg-cvslog] swr: update calling code to support mixed packed planar SIMD

Michael Niedermayer git at videolan.org
Sat May 5 19:07:16 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat May  5 18:31:04 2012 +0200| [fec3700dcd8c7cba7b85c5ce6f9c5f3092c1bc17] | committer: Michael Niedermayer

swr: update calling code to support mixed packed planar SIMD

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fec3700dcd8c7cba7b85c5ce6f9c5f3092c1bc17
---

 libswresample/audioconvert.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c
index 04e33c5..81bd6d3 100644
--- a/libswresample/audioconvert.c
+++ b/libswresample/audioconvert.c
@@ -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;
     }



More information about the ffmpeg-cvslog mailing list