]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/resample.c
snow altivec is broken
[ffmpeg] / libavcodec / resample.c
index 043e812c8fa8b159897bec713fd589fc483168b7..76521a75e0fb7672b4101f85a68c70dc617a1683 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sample rate convertion for both audio and video
+ * samplerate conversion for both audio and video
  * Copyright (c) 2000 Fabrice Bellard.
  *
  * This file is part of FFmpeg.
@@ -21,7 +21,7 @@
 
 /**
  * @file resample.c
- * Sample rate convertion for both audio and video.
+ * samplerate conversion for both audio and video
  */
 
 #include "avcodec.h"
@@ -161,7 +161,8 @@ ReSampleContext *audio_resample_init(int output_channels, int input_channels,
     if(s->filter_channels>2)
       s->filter_channels = 2;
 
-    s->resample_context= av_resample_init(output_rate, input_rate, 16, 10, 0, 1.0);
+#define TAPS 16
+    s->resample_context= av_resample_init(output_rate, input_rate, TAPS, 10, 0, 0.8);
 
     return s;
 }
@@ -190,7 +191,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
     }
 
     /* make some zoom to avoid round pb */
-    lenout= (int)(nb_samples * s->ratio) + 16;
+    lenout= (int)(4*nb_samples * s->ratio) + 16;
     bufout[0]= (short*) av_malloc( lenout * sizeof(short) );
     bufout[1]= (short*) av_malloc( lenout * sizeof(short) );