[FFmpeg-cvslog] swr: use 64bit index/len for x86_64 mix

Michael Niedermayer git at videolan.org
Sun Oct 28 02:14:49 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 28 02:09:08 2012 +0200| [d23e8f53ad01fde6d0dd96644c2a594f8dd7537e] | committer: Michael Niedermayer

swr: use 64bit index/len for x86_64 mix

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

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

 libswresample/rematrix_template.c   |   10 +++++-----
 libswresample/swresample_internal.h |   13 ++++++++++---
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/libswresample/rematrix_template.c b/libswresample/rematrix_template.c
index 627bf1f..61d3fe9 100644
--- a/libswresample/rematrix_template.c
+++ b/libswresample/rematrix_template.c
@@ -18,9 +18,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-typedef void (RENAME(mix_any_func_type))(SAMPLE **out, const SAMPLE **in1, COEFF *coeffp, int len);
+typedef void (RENAME(mix_any_func_type))(SAMPLE **out, const SAMPLE **in1, COEFF *coeffp, integer len);
 
-static void RENAME(sum2)(SAMPLE *out, const SAMPLE *in1, const SAMPLE *in2, COEFF *coeffp, int index1, int index2, int len){
+static void RENAME(sum2)(SAMPLE *out, const SAMPLE *in1, const SAMPLE *in2, COEFF *coeffp, integer index1, integer index2, integer len){
     int i;
     COEFF coeff1 = coeffp[index1];
     COEFF coeff2 = coeffp[index2];
@@ -29,14 +29,14 @@ static void RENAME(sum2)(SAMPLE *out, const SAMPLE *in1, const SAMPLE *in2, COEF
         out[i] = R(coeff1*in1[i] + coeff2*in2[i]);
 }
 
-static void RENAME(copy)(SAMPLE *out, const SAMPLE *in, COEFF *coeffp, int index, int len){
+static void RENAME(copy)(SAMPLE *out, const SAMPLE *in, COEFF *coeffp, integer index, integer len){
     int i;
     COEFF coeff = coeffp[index];
     for(i=0; i<len; i++)
         out[i] = R(coeff*in[i]);
 }
 
-static void RENAME(mix6to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, int len){
+static void RENAME(mix6to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, integer len){
     int i;
 
     for(i=0; i<len; i++) {
@@ -46,7 +46,7 @@ static void RENAME(mix6to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, int
     }
 }
 
-static void RENAME(mix8to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, int len){
+static void RENAME(mix8to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, integer len){
     int i;
 
     for(i=0; i<len; i++) {
diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h
index ab17602..38b18d9 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -23,13 +23,20 @@
 
 #include "swresample.h"
 #include "libavutil/audioconvert.h"
+#include "config.h"
 
 #define SQRT3_2      1.22474487139158904909  /* sqrt(3/2) */
 
-typedef void (mix_1_1_func_type)(void *out, const void *in, void *coeffp, int index, int len);
-typedef void (mix_2_1_func_type)(void *out, const void *in1, const void *in2, void *coeffp, int index1, int index2, int len);
+#if ARCH_X86_64
+typedef int64_t integer;
+#else
+typedef int integer;
+#endif
+
+typedef void (mix_1_1_func_type)(void *out, const void *in, void *coeffp, integer index, integer len);
+typedef void (mix_2_1_func_type)(void *out, const void *in1, const void *in2, void *coeffp, integer index1, integer index2, integer len);
 
-typedef void (mix_any_func_type)(uint8_t **out, const uint8_t **in1, void *coeffp, int len);
+typedef void (mix_any_func_type)(uint8_t **out, const uint8_t **in1, void *coeffp, integer len);
 
 typedef struct AudioData{
     uint8_t *ch[SWR_CH_MAX];    ///< samples buffer per channel



More information about the ffmpeg-cvslog mailing list