[MPlayer-cvslog] CVS: main/libaf af_comp.c, 1.4, 1.5 af_equalizer.c, 1.4, 1.5 af_export.c, 1.3, 1.4 af_extrastereo.c, 1.3, 1.4 af_format.c, 1.16, 1.17 af_format.h, 1.3, 1.4 af_gate.c, 1.4, 1.5 af_mp.h, 1.4, 1.5 Makefile, 1.19, 1.20 af_hrtf.c, 1.2, 1.3 af_lavcresample.c, 1.5, 1.6 af_pan.c, 1.4, 1.5 af_resample.c, 1.21, 1.22 af_sub.c, 1.2, 1.3 af_surround.c, 1.4, 1.5 af_sweep.c, 1.2, 1.3 af_volnorm.c, 1.3, 1.4 af_volume.c, 1.13, 1.14 config.h, 1.2, 1.3 af_mp.c, 1.7, NONE

Alex Beregszaszi syncmail at mplayerhq.hu
Mon Dec 27 18:30:17 CET 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv24154/libaf

Modified Files:
	af_comp.c af_equalizer.c af_export.c af_extrastereo.c 
	af_format.c af_format.h af_gate.c af_mp.h Makefile af_hrtf.c 
	af_lavcresample.c af_pan.c af_resample.c af_sub.c 
	af_surround.c af_sweep.c af_volnorm.c af_volume.c config.h 
Removed Files:
	af_mp.c 
Log Message:
removing AFMT_ dependancy

Index: af_comp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_comp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_comp.c	10 Oct 2004 14:20:42 -0000	1.4
+++ af_comp.c	27 Dec 2004 17:30:13 -0000	1.5
@@ -44,7 +44,7 @@
     
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
-    af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
 
     // Time constant set to 0.1s

Index: af_equalizer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_equalizer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_equalizer.c	10 Oct 2004 14:20:42 -0000	1.4
+++ af_equalizer.c	27 Dec 2004 17:30:13 -0000	1.5
@@ -87,7 +87,7 @@
     
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
-    af->data->format = AF_FORMAT_NE | AF_FORMAT_F;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
     
     // Calculate number of active filters
@@ -173,7 +173,7 @@
     float* 	end = in + c->len/4; // Block loop end
 
     while(in < end){
-      register uint32_t	k  = 0;		// Frequency band index
+      register int	k  = 0;		// Frequency band index
       register float 	yt = *in; 	// Current input sample
       in+=nch;
       

Index: af_export.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_export.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_export.c	28 Nov 2003 20:43:00 -0000	1.3
+++ af_export.c	27 Dec 2004 17:30:13 -0000	1.4
@@ -72,7 +72,7 @@
     // Accept only int16_t as input format (which sucks)
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
-    af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_S16_NE;
     af->data->bps    = 2;
 	
     // If buffer length isn't set, set it to the default value
@@ -163,7 +163,6 @@
 */
 static void uninit( struct af_instance_s* af )
 {
-  int i;
   if (af->data){
     free(af->data);
     af->data = NULL;

Index: af_extrastereo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_extrastereo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_extrastereo.c	22 Dec 2004 00:12:00 -0000	1.3
+++ af_extrastereo.c	27 Dec 2004 17:30:13 -0000	1.4
@@ -37,7 +37,7 @@
     
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = 2;
-    af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_S16_NE;
     af->data->bps    = 2;
 
     return af_test_output(af,(af_data_t*)arg);

Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- af_format.c	20 Nov 2004 10:32:52 -0000	1.16
+++ af_format.c	27 Dec 2004 17:30:13 -0000	1.17
@@ -43,7 +43,7 @@
 static void int2float(void* in, void* out, int len, int bps);
 
 // Convert from string to format
-static int str2fmt(char* str)
+int af_str2fmt(char* str)
 {
   int format=0;
   // Scan for endianess
@@ -87,16 +87,34 @@
   return format;
 }
 
+inline int af_fmt2bits(int format)
+{
+    return (format & AF_FORMAT_BITS_MASK)+8;
+//    return (((format & AF_FORMAT_BITS_MASK)>>3)+1) * 8;
+#if 0
+    switch(format & AF_FORMAT_BITS_MASK)
+    {
+	case AF_FORMAT_8BIT: return 8;
+	case AF_FORMAT_16BIT: return 16;
+	case AF_FORMAT_24BIT: return 24;
+	case AF_FORMAT_32BIT: return 32;
+	case AF_FORMAT_48BIT: return 48;
+    }
+#endif
+    return -1;
+}
+
 /* Convert format to str input str is a buffer for the 
    converted string, size is the size of the buffer */
-char* fmt2str(int format, char* str, size_t size)
+char* af_fmt2str(int format, char* str, int size)
 {
   int i=0;
-  // Print endinaness
+
+  // Endianess
   if(AF_FORMAT_LE == (format & AF_FORMAT_END_MASK))
-    i+=snprintf(str,size,"little endian ");
+    i+=snprintf(str,size-i,"little endian ");
   else
-    i+=snprintf(str,size,"big endian ");
+    i+=snprintf(str,size-i,"big endian ");
   
   if(format & AF_FORMAT_SPECIAL_MASK){
     switch(format & AF_FORMAT_SPECIAL_MASK){
@@ -108,12 +126,17 @@
       i+=snprintf(&str[i],size-i,"MPEG 2 "); break;
     case(AF_FORMAT_AC3): 
       i+=snprintf(&str[i],size-i,"AC3 "); break;
+    default:
+      printf("Unknown special\n");
     }
   }
   else{
+    // Bits
+    i+=snprintf(&str[i],size-i,"%d-bit ", af_fmt2bits(format));
+
     // Point
     if(AF_FORMAT_F == (format & AF_FORMAT_POINT_MASK))
-      i+=snprintf(&str[i],size,"float ");
+      i+=snprintf(&str[i],size-i,"float ");
     else{
       // Sign
       if(AF_FORMAT_US == (format & AF_FORMAT_SIGN_MASK))
@@ -121,7 +144,7 @@
       else
 	i+=snprintf(&str[i],size-i,"signed ");
 
-      i+=snprintf(&str[i],size,"int ");
+      i+=snprintf(&str[i],size-i,"int ");
     }
   }
   return str;
@@ -148,7 +171,7 @@
   case(AF_FORMAT_MPEG2): 
   case(AF_FORMAT_AC3):
     af_msg(AF_MSG_ERROR,"[format] Sample format %s not yet supported \n",
-	 fmt2str(format,buf,255)); 
+	 af_fmt2str(format,buf,255)); 
     return AF_ERROR;
   }
   return AF_OK;
@@ -173,9 +196,9 @@
        (AF_OK != check_format(af->data->format)))
       return AF_ERROR;
 
-    af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %ibit %sto %ibit %s \n",
-	   ((af_data_t*)arg)->bps*8,fmt2str(((af_data_t*)arg)->format,buf1,255),
-	   af->data->bps*8,fmt2str(af->data->format,buf2,255));
+    af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %sto %s \n",
+	   af_fmt2str(((af_data_t*)arg)->format,buf1,255),
+	   af_fmt2str(af->data->format,buf2,255));
 
     af->data->rate = ((af_data_t*)arg)->rate;
     af->data->nch  = ((af_data_t*)arg)->nch;
@@ -190,7 +213,7 @@
     str[0] = '\0';
     sscanf((char*)arg,"%i:%s",&bps,str);
     // Convert string to format
-    format = str2fmt(str);
+    format = af_str2fmt(str);
     
     // Automatic correction of errors
     switch(format & AF_FORMAT_SPECIAL_MASK){

Index: af_format.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_format.h	4 Oct 2004 19:11:05 -0000	1.3
+++ af_format.h	27 Dec 2004 17:30:13 -0000	1.4
@@ -1,6 +1,8 @@
 /* The sample format system used lin libaf is based on bitmasks. The
    format definition only refers to the storage format not the
    resolution. */
+#ifndef __af_format_h__
+#define __af_format_h__
 
 // Endianess
 #define AF_FORMAT_BE		(0<<0) // Big Endian
@@ -14,8 +16,8 @@
 #endif
 
 // Signed/unsigned
-#define AF_FORMAT_SI		(0<<1) // SIgned
-#define AF_FORMAT_US		(1<<1) // Un Signed
+#define AF_FORMAT_SI		(0<<1) // Signed
+#define AF_FORMAT_US		(1<<1) // Unsigned
 #define AF_FORMAT_SIGN_MASK	(1<<1)
 
 // Fixed or floating point
@@ -23,13 +25,63 @@
 #define AF_FORMAT_F		(1<<2) // Foating point
 #define AF_FORMAT_POINT_MASK	(1<<2)
 
+// Bits used
+#define AF_FORMAT_8BIT		(0<<3)
+#define AF_FORMAT_16BIT		(1<<3)
+#define AF_FORMAT_24BIT		(2<<3)
+#define AF_FORMAT_32BIT		(3<<3)
+#define AF_FORMAT_40BIT		(4<<3)
+#define AF_FORMAT_48BIT		(5<<3)
+#define AF_FORMAT_BITS_MASK	(7<<3)
+
 // Special flags refering to non pcm data
-#define AF_FORMAT_MU_LAW	(1<<3) // 
-#define AF_FORMAT_A_LAW		(2<<3) // 
-#define AF_FORMAT_MPEG2		(3<<3) // MPEG(2) audio
-#define AF_FORMAT_AC3		(4<<3) // Dolby Digital AC3
-#define AF_FORMAT_IMA_ADPCM	AF_FORMAT_LE|AF_FORMAT_SI // Same as 16 bit signed int 
-#define AF_FORMAT_SPECIAL_MASK	(7<<3)
+#define AF_FORMAT_MU_LAW	(1<<6)
+#define AF_FORMAT_A_LAW		(2<<6)
+#define AF_FORMAT_MPEG2		(3<<6) // MPEG(2) audio
+#define AF_FORMAT_AC3		(4<<6) // Dolby Digital AC3
+#define AF_FORMAT_IMA_ADPCM	(5<<6)
+#define AF_FORMAT_SPECIAL_MASK	(7<<6)
+
+// PREDEFINED formats
+
+#define AF_FORMAT_U8		(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_8BIT|AF_FORMAT_NE)
+#define AF_FORMAT_S8		(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_8BIT|AF_FORMAT_NE)
+#define AF_FORMAT_U16_LE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_16BIT|AF_FORMAT_LE)
+#define AF_FORMAT_U16_BE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_16BIT|AF_FORMAT_BE)
+#define AF_FORMAT_S16_LE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_16BIT|AF_FORMAT_LE)
+#define AF_FORMAT_S16_BE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_16BIT|AF_FORMAT_BE)
+#define AF_FORMAT_U24_LE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_24BIT|AF_FORMAT_LE)
+#define AF_FORMAT_U24_BE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_24BIT|AF_FORMAT_BE)
+#define AF_FORMAT_S24_LE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_24BIT|AF_FORMAT_LE)
+#define AF_FORMAT_S24_BE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_24BIT|AF_FORMAT_BE)
+#define AF_FORMAT_U32_LE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_32BIT|AF_FORMAT_LE)
+#define AF_FORMAT_U32_BE	(AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_32BIT|AF_FORMAT_BE)
+#define AF_FORMAT_S32_LE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_32BIT|AF_FORMAT_LE)
+#define AF_FORMAT_S32_BE	(AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_32BIT|AF_FORMAT_BE)
+
+#define AF_FORMAT_FLOAT_LE	(AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_LE)
+#define AF_FORMAT_FLOAT_BE	(AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_BE)
+
+#ifdef WORDS_BIGENDIAN
+#define AF_FORMAT_U16_NE AF_FORMAT_U16_BE
+#define AF_FORMAT_S16_NE AF_FORMAT_S16_BE
+#define AF_FORMAT_U24_NE AF_FORMAT_U24_BE
+#define AF_FORMAT_S24_NE AF_FORMAT_S24_BE
+#define AF_FORMAT_U32_NE AF_FORMAT_U32_BE
+#define AF_FORMAT_S32_NE AF_FORMAT_S32_BE
+#define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_BE
+#else
+#define AF_FORMAT_U16_NE AF_FORMAT_U16_LE
+#define AF_FORMAT_S16_NE AF_FORMAT_S16_LE
+#define AF_FORMAT_U24_NE AF_FORMAT_U24_LE
+#define AF_FORMAT_S24_NE AF_FORMAT_S24_LE
+#define AF_FORMAT_U32_NE AF_FORMAT_U32_LE
+#define AF_FORMAT_S32_NE AF_FORMAT_S32_LE
+#define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_LE
+#endif
 
-extern char* fmt2str(int format, char* str, size_t size);
+extern int af_str2fmt(char *str);
+extern int af_fmt2bits(int format);
+extern char* af_fmt2str(int format, char* str, int size);
 
+#endif /* __af_format_h__ */

Index: af_gate.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_gate.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_gate.c	10 Oct 2004 14:20:42 -0000	1.4
+++ af_gate.c	27 Dec 2004 17:30:13 -0000	1.5
@@ -42,7 +42,7 @@
     
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
-    af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
 
     // Time constant set to 0.1s

Index: af_mp.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_mp.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_mp.h	18 Jan 2003 17:31:22 -0000	1.4
+++ af_mp.h	27 Dec 2004 17:30:13 -0000	1.5
@@ -5,7 +5,6 @@
 #include "../config.h"
 #include "../mp_msg.h"
 #include "../cpudetect.h"
-#include "../libao2/afmt.h"
 
 /* Set the initialization type from mplayers cpudetect */
 #ifdef AF_INIT_TYPE
@@ -20,8 +19,4 @@
 #define af_msg(lev, args... ) \
   mp_msg(MSGT_AFILTER,(((lev)<0)?((lev)+3):(((lev)==0)?MSGL_INFO:((lev)+5))), ##args )
 
-/* Decodes the format from mplayer format to libaf format */
-extern int af_format_decode(int format);
-extern int af_format_encode(void* fmt);
-
 #endif /* __af_mp_h__ */

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/Makefile,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Makefile	23 Dec 2004 02:09:52 -0000	1.19
+++ Makefile	27 Dec 2004 17:30:13 -0000	1.20
@@ -2,7 +2,7 @@
 
 LIBNAME = libaf.a
 
-SRCS=af.c af_mp.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c \
+SRCS=af.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c \
 window.c filter.c af_volume.c af_equalizer.c af_tools.c af_comp.c af_gate.c \
 af_pan.c af_surround.c af_sub.c af_export.c af_volnorm.c af_extrastereo.c \
 af_lavcresample.c af_sweep.c af_hrtf.c $(OPTIONAL_SRCS)

Index: af_hrtf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_hrtf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af_hrtf.c	22 Dec 2004 00:12:00 -0000	1.2
+++ af_hrtf.c	27 Dec 2004 17:30:13 -0000	1.3
@@ -119,7 +119,7 @@
 	if(af->data->nch < 5) {
 	    af->data->nch = 5;
 	}
-	af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+	af->data->format = AF_FORMAT_S16_NE;
 	af->data->bps    = 2;
 	return af_test_output(af, (af_data_t*)arg);
     case AF_CONTROL_COMMAND_LINE:

Index: af_lavcresample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_lavcresample.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- af_lavcresample.c	22 Dec 2004 00:12:00 -0000	1.5
+++ af_lavcresample.c	27 Dec 2004 17:30:13 -0000	1.6
@@ -52,7 +52,7 @@
 
     af->data->nch    = data->nch;
     if (af->data->nch > CHANS) af->data->nch = CHANS;
-    af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_S16_NE;
     af->data->bps    = 2;
     g= ff_gcd(af->data->rate, data->rate);
     af->mul.n = af->data->rate/g;

Index: af_pan.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_pan.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_pan.c	10 Oct 2004 14:20:42 -0000	1.4
+++ af_pan.c	27 Dec 2004 17:30:13 -0000	1.5
@@ -37,7 +37,7 @@
     if(!arg) return AF_ERROR;
 
     af->data->rate   = ((af_data_t*)arg)->rate;
-    af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
     af->mul.n        = af->data->nch;
     af->mul.d	     = ((af_data_t*)arg)->nch;

Index: af_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_resample.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- af_resample.c	10 Oct 2004 14:20:42 -0000	1.21
+++ af_resample.c	27 Dec 2004 17:30:13 -0000	1.22
@@ -135,29 +135,28 @@
   // Make sure this filter isn't redundant 
   if((af->data->rate == data->rate) || (af->data->rate == 0))
     return AF_DETACH;
-
   /* If sloppy and small resampling difference (2%) */
   rd = abs((float)af->data->rate - (float)data->rate)/(float)data->rate;
   if((((s->setup & FREQ_MASK) == FREQ_SLOPPY) && (rd < 0.02) && 
-      (data->format != (AF_FORMAT_NE | AF_FORMAT_F))) || 
+      (data->format != (AF_FORMAT_FLOAT_NE))) || 
      ((s->setup & RSMP_MASK) == RSMP_LIN)){
     s->setup = (s->setup & ~RSMP_MASK) | RSMP_LIN;
-    af->data->format = AF_FORMAT_NE | AF_FORMAT_SI;
+    af->data->format = AF_FORMAT_S16_NE;
     af->data->bps    = 2;
     af_msg(AF_MSG_VERBOSE,"[resample] Using linear interpolation. \n");
   }
   else{
     /* If the input format is float or if float is explicitly selected
        use float, otherwise use int */
-    if((data->format == (AF_FORMAT_NE | AF_FORMAT_F)) || 
+    if((data->format == (AF_FORMAT_FLOAT_NE)) || 
        ((s->setup & RSMP_MASK) == RSMP_FLOAT)){
       s->setup = (s->setup & ~RSMP_MASK) | RSMP_FLOAT;
-      af->data->format = AF_FORMAT_NE | AF_FORMAT_F;
+      af->data->format = AF_FORMAT_FLOAT_NE;
       af->data->bps    = 4;
     }
     else{
       s->setup = (s->setup & ~RSMP_MASK) | RSMP_INT;
-      af->data->format = AF_FORMAT_NE | AF_FORMAT_SI;
+      af->data->format = AF_FORMAT_S16_NE;
       af->data->bps    = 2;
     }
     af_msg(AF_MSG_VERBOSE,"[resample] Using %s processing and %s frequecy"

Index: af_sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_sub.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af_sub.c	10 Oct 2004 14:20:42 -0000	1.2
+++ af_sub.c	27 Dec 2004 17:30:13 -0000	1.3
@@ -61,7 +61,7 @@
 
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = max(s->ch+1,((af_data_t*)arg)->nch);
-    af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
 
     // Design low-pass filter

Index: af_surround.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_surround.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af_surround.c	11 Jun 2004 15:16:26 -0000	1.4
+++ af_surround.c	27 Dec 2004 17:30:13 -0000	1.5
@@ -93,7 +93,7 @@
     float fc;
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch*2;
-    af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_FLOAT_NE;
     af->data->bps    = 4;
 
     if (af->data->nch != 4){

Index: af_sweep.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_sweep.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- af_sweep.c	22 Dec 2004 00:12:00 -0000	1.2
+++ af_sweep.c	27 Dec 2004 17:30:13 -0000	1.3
@@ -25,7 +25,7 @@
   switch(cmd){
   case AF_CONTROL_REINIT:
     af->data->nch    = data->nch;
-    af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    af->data->format = AF_FORMAT_S16_NE;
     af->data->bps    = 2;
     af->data->rate   = data->rate;
 

Index: af_volnorm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_volnorm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_volnorm.c	22 Dec 2004 00:12:00 -0000	1.3
+++ af_volnorm.c	27 Dec 2004 17:30:13 -0000	1.4
@@ -79,11 +79,11 @@
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
     
-    if(((af_data_t*)arg)->format == (AF_FORMAT_SI | AF_FORMAT_NE)){
-      af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    if(((af_data_t*)arg)->format == (AF_FORMAT_S16_NE)){
+      af->data->format = AF_FORMAT_S16_NE;
       af->data->bps    = 2;
     }else{
-      af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+      af->data->format = AF_FORMAT_FLOAT_NE;
       af->data->bps    = 4;
     }
     return af_test_output(af,(af_data_t*)arg);
@@ -288,14 +288,14 @@
 {
   af_volnorm_t *s = af->setup;
 
-  if(af->data->format == (AF_FORMAT_SI | AF_FORMAT_NE))
+  if(af->data->format == (AF_FORMAT_S16_NE))
   {
     if (s->method)
 	method2_int16(s, data);
     else
 	method1_int16(s, data);
   }
-  else if(af->data->format == (AF_FORMAT_F | AF_FORMAT_NE))
+  else if(af->data->format == (AF_FORMAT_FLOAT_NE))
   { 
     if (s->method)
 	method2_float(s, data);

Index: af_volume.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_volume.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- af_volume.c	30 Nov 2004 19:02:29 -0000	1.13
+++ af_volume.c	27 Dec 2004 17:30:13 -0000	1.14
@@ -60,8 +60,8 @@
     af->data->rate   = ((af_data_t*)arg)->rate;
     af->data->nch    = ((af_data_t*)arg)->nch;
     
-    if(s->fast && (((af_data_t*)arg)->format != (AF_FORMAT_F | AF_FORMAT_NE))){
-      af->data->format = AF_FORMAT_SI | AF_FORMAT_NE;
+    if(s->fast && (((af_data_t*)arg)->format != (AF_FORMAT_FLOAT_NE))){
+      af->data->format = AF_FORMAT_S16_NE;
       af->data->bps    = 2;
     }
     else{
@@ -70,7 +70,7 @@
       float t = 2.0-cos(x);
       s->time = 1.0 - (t - sqrt(t*t - 1));
       af_msg(AF_MSG_DEBUG0,"[volume] Forgetting factor = %0.5f\n",s->time);
-      af->data->format = AF_FORMAT_F | AF_FORMAT_NE;
+      af->data->format = AF_FORMAT_FLOAT_NE;
       af->data->bps    = 4;
     }
     return af_test_output(af,(af_data_t*)arg);
@@ -140,7 +140,7 @@
   register int  i   = 0;
 
   // Basic operation volume control only (used on slow machines)
-  if(af->data->format == (AF_FORMAT_SI | AF_FORMAT_NE)){
+  if(af->data->format == (AF_FORMAT_S16_NE)){
     int16_t*    a   = (int16_t*)c->audio;	// Audio data
     int         len = c->len/2;			// Number of samples
     for(ch = 0; ch < nch ; ch++){
@@ -154,7 +154,7 @@
     }
   }
   // Machine is fast and data is floating point
-  else if(af->data->format == (AF_FORMAT_F | AF_FORMAT_NE)){ 
+  else if(af->data->format == (AF_FORMAT_FLOAT_NE)){ 
     float*   	a   	= (float*)c->audio;	// Audio data
     int       	len 	= c->len/4;		// Number of samples
     for(ch = 0; ch < nch ; ch++){

Index: config.h
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/config.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- config.h	10 Oct 2004 14:20:42 -0000	1.2
+++ config.h	27 Dec 2004 17:30:13 -0000	1.3
@@ -8,6 +8,8 @@
 //=============================================================================
 */
 
+#include "../config.h" // WORDS_BIGENDIAN
+
 // Number of channels
 #ifndef AF_NCH
 #define AF_NCH 6

--- af_mp.c DELETED ---




More information about the MPlayer-cvslog mailing list