[Mplayer-cvslog] CVS: main/libaf af_format.c,1.15,1.16
Alex Beregszaszi
syncmail at mplayerhq.hu
Mon Oct 4 21:02:17 CEST 2004
CVS change done by Alex Beregszaszi
Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv3916
Modified Files:
af_format.c
Log Message:
better 24bit conversion, due introducing INT24_MAX
Index: af_format.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- af_format.c 18 May 2004 19:13:15 -0000 1.15
+++ af_format.c 4 Oct 2004 19:02:14 -0000 1.16
@@ -21,6 +21,11 @@
#define lrintf(x) ((int)(x))
#endif
+#ifndef INT24_MAX
+#define INT24_MIN (-16777215-1)
+#define INT24_MAX (16777215)
+#endif
+
/* Functions used by play to convert the input audio to the correct
format */
@@ -419,7 +424,7 @@
break;
case(3):
for(i=0;i<len;i++)
- store24bit(out, i, (uint32_t)(INT_MAX+(int32_t)load24bit(in, i)));
+ store24bit(out, i, (uint32_t)(INT24_MAX+(int32_t)load24bit(in, i)));
break;
case(4):
for(i=0;i<len;i++)
@@ -442,7 +447,7 @@
break;
case(3):
for(i=0;i<len;i++)
- store24bit(out, i, (int32_t)(INT_MIN+(uint32_t)load24bit(in, i)));
+ store24bit(out, i, (int32_t)(INT24_MIN+(uint32_t)load24bit(in, i)));
break;
case(4):
for(i=0;i<len;i++)
@@ -536,7 +541,7 @@
break;
case(3):
for(i=0;i<len;i++)
- store24bit(out, i, (int32_t)lrintf(INT_MAX*((float*)in)[i]));
+ store24bit(out, i, (int32_t)lrintf(INT24_MAX*((float*)in)[i]));
break;
case(4):
for(i=0;i<len;i++)
@@ -559,7 +564,7 @@
break;
case(3):
for(i=0;i<len;i++)
- ((float*)out)[i]=(1.0/INT_MAX)*((float)((int32_t)load24bit(in, i)));
+ ((float*)out)[i]=(1.0/INT24_MAX)*((float)((int32_t)load24bit(in, i)));
break;
case(4):
for(i=0;i<len;i++)
More information about the MPlayer-cvslog
mailing list