diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-02-20 23:55:28 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-03-07 23:56:00 +0100 |
commit | a8cdb7b95a7fb7f39eb06c0e4bc0af632b85ba47 (patch) | |
tree | fba95a34fed8b12608e13e05d44f47e6828432cb | |
parent | 1ea3b657d635f1f8bec544e74f6af652731fe236 (diff) | |
download | ffmpeg-a8cdb7b95a7fb7f39eb06c0e4bc0af632b85ba47.tar.gz |
swr: special case for empty channels in rematrix.
Speed += 10% overall for pan=stereo:FL=FL+FR from wav to null.
-rw-r--r-- | libswresample/rematrix.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index da817e1455..e588fe973e 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -280,6 +280,9 @@ int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mus for(out_i=0; out_i<out->ch_count; out_i++){ switch(s->matrix_ch[out_i][0]){ + case 0: + memset(out->ch[out_i], 0, len * (s->int_sample_fmt == AV_SAMPLE_FMT_FLT ? sizeof(float) : sizeof(int16_t))); + break; case 1: in_i= s->matrix_ch[out_i][1]; if(mustcopy || s->matrix[out_i][in_i]!=1.0){ |