[Mplayer-cvslog] CVS: main/libaf af_resample.c,1.2,1.3

Anders Johansson anders at mplayerhq.hu
Wed Oct 2 12:47:33 CEST 2002


Update of /cvsroot/mplayer/main/libaf
In directory mail:/var/tmp.root/cvs-serv10488

Modified Files:
	af_resample.c 
Log Message:
Changing to 32 bit aritmetics for counters

Index: af_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_resample.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af_resample.c	1 Oct 2002 12:53:30 -0000	1.2
+++ af_resample.c	2 Oct 2002 10:47:18 -0000	1.3
@@ -68,11 +68,11 @@
 {
   int16_t*  	w;	// Current filter weights
   int16_t** 	xq; 	// Circular buffers
-  int16_t	xi; 	// Index for circular buffers
-  int16_t	wi;	// Index for w
-  uint16_t	i; 	// Number of new samples to put in x queue
-  uint16_t  	dn;     // Down sampling factor
-  uint16_t	up;	// Up sampling factor 
+  uint32_t	xi; 	// Index for circular buffers
+  uint32_t	wi;	// Index for w
+  uint32_t	i; 	// Number of new samples to put in x queue
+  uint32_t  	dn;     // Down sampling factor
+  uint32_t	up;	// Up sampling factor 
 } af_resample_t;
 
 // Euclids algorithm for calculating Greatest Common Divisor GCD(a,b)
@@ -93,17 +93,17 @@
 
 static int upsample(af_data_t* c,af_data_t* l, af_resample_t* s)
 {
-  uint16_t		ci    = l->nch; 	// Index for channels
-  uint16_t		len   = 0; 		// Number of input samples
-  uint16_t		nch   = l->nch;   	// Number of channels
-  uint16_t		inc   = s->up/s->dn; 
-  uint16_t		level = s->up%s->dn; 
-  uint16_t		up    = s->up;
-  uint16_t		dn    = s->dn;
+  uint32_t		ci    = l->nch; 	// Index for channels
+  uint32_t		len   = 0; 		// Number of input samples
+  uint32_t		nch   = l->nch;   	// Number of channels
+  uint32_t		inc   = s->up/s->dn; 
+  uint32_t		level = s->up%s->dn; 
+  uint32_t		up    = s->up;
+  uint32_t		dn    = s->dn;
 
   register int16_t*	w     = s->w;
-  register uint16_t	wi    = 0;
-  register uint16_t	xi    = 0; 
+  register uint32_t	wi    = 0;
+  register uint32_t	xi    = 0; 
 
   // Index current channel
   while(ci--){
@@ -115,7 +115,7 @@
     wi = s->wi; xi = s->xi;
 
     while(in < end){
-      register uint16_t	i = inc;
+      register uint32_t	i = inc;
       if(wi<level) i++;
 
       ADDQUE(xi,x,in);
@@ -137,17 +137,17 @@
 
 static int downsample(af_data_t* c,af_data_t* l, af_resample_t* s)
 {
-  uint16_t		ci    = l->nch; 	// Index for channels
-  uint16_t		len   = 0; 		// Number of output samples
-  uint16_t		nch   = l->nch;   	// Number of channels
-  uint16_t		inc   = s->dn/s->up; 
-  uint16_t		level = s->dn%s->up; 
-  uint16_t		up    = s->up;
-  uint16_t		dn    = s->dn;
-
-  register uint16_t	i     = 0;
-  register uint16_t	wi    = 0;
-  register uint16_t	xi    = 0;
+  uint32_t		ci    = l->nch; 	// Index for channels
+  uint32_t		len   = 0; 		// Number of output samples
+  uint32_t		nch   = l->nch;   	// Number of channels
+  uint32_t		inc   = s->dn/s->up; 
+  uint32_t		level = s->dn%s->up; 
+  uint32_t		up    = s->up;
+  uint32_t		dn    = s->dn;
+
+  register uint32_t	i     = 0;
+  register uint32_t	wi    = 0;
+  register uint32_t	xi    = 0;
   
   // Index current channel
   while(ci--){




More information about the MPlayer-cvslog mailing list