changeset 12131:d155623271e3

fix symbol clashes when linking with libmp3lame including mp3 decoder, man, mp3lib is so much bloated
author alex
date Tue, 06 Apr 2004 01:06:21 +0000
parents 2ef24558b732
children 1975bcc1d015
files mp3lib/dct64.c mp3lib/dct64_altivec.c mp3lib/dct64_i386.c mp3lib/l2tables.h mp3lib/layer2.c mp3lib/layer3.c mp3lib/mpg123.h mp3lib/sr1.c mp3lib/tabinit.c
diffstat 9 files changed, 38 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/mp3lib/dct64.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/dct64.c	Tue Apr 06 01:06:21 2004 +0000
@@ -11,7 +11,7 @@
 {
 
  {
-  register real *costab = pnts[0];
+  register real *costab = mp3lib_pnts[0];
 
   b1[0x00] = samples[0x00] + samples[0x1F];
   b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0];
@@ -64,7 +64,7 @@
 
 
  {
-  register real *costab = pnts[1];
+  register real *costab = mp3lib_pnts[1];
 
   b2[0x00] = b1[0x00] + b1[0x0F];
   b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0];
@@ -102,7 +102,7 @@
  }
 
  {
-  register real *costab = pnts[2];
+  register real *costab = mp3lib_pnts[2];
 
   b1[0x00] = b2[0x00] + b2[0x07];
   b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0];
@@ -142,8 +142,8 @@
  }
 
  {
-  register real const cos0 = pnts[3][0];
-  register real const cos1 = pnts[3][1];
+  register real const cos0 = mp3lib_pnts[3][0];
+  register real const cos1 = mp3lib_pnts[3][1];
 
   b2[0x00] = b1[0x00] + b1[0x03];
   b2[0x03] = (b1[0x00] - b1[0x03]) * cos0;
@@ -187,7 +187,7 @@
  }
 
  {
-  register real const cos0 = pnts[4][0];
+  register real const cos0 = mp3lib_pnts[4][0];
 
   b1[0x00] = b2[0x00] + b2[0x01];
   b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
--- a/mp3lib/dct64_altivec.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/dct64_altivec.c	Tue Apr 06 01:06:21 2004 +0000
@@ -79,7 +79,7 @@
 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
   
   {
-    register real *costab = pnts[0];
+    register real *costab = mp3lib_pnts[0];
 
     b1[0x00] = samples[0x00] + samples[0x1F];
     b1[0x01] = samples[0x01] + samples[0x1E];
@@ -116,7 +116,7 @@
 
   }
   {
-    register real *costab = pnts[1];
+    register real *costab = mp3lib_pnts[1];
 
     b2[0x00] = b1[0x00] + b1[0x0F];
     b2[0x01] = b1[0x01] + b1[0x0E];
@@ -154,7 +154,7 @@
   }
 
   {
-    register real *costab = pnts[2];
+    register real *costab = mp3lib_pnts[2];
 
     b1[0x00] = b2[0x00] + b2[0x07];
     b1[0x01] = b2[0x01] + b2[0x06];
@@ -207,7 +207,7 @@
       temp1, temp2;
 
     {
-      register real *costab = pnts[0];
+      register real *costab = mp3lib_pnts[0];
 
       register vector float
         samplesv1, samplesv2, samplesv3, samplesv4,
@@ -300,7 +300,7 @@
         b2v0, b2v1, b2v2, b2v3,
         b2v4, b2v5, b2v6, b2v7;
       {
-        register real *costab = pnts[1];
+        register real *costab = mp3lib_pnts[1];
         register vector float costabv1r, costabv2r, costabv1, costabv2, costabv3;
         register vector unsigned char costab_perm = vec_lvsl(0, costab);
 
@@ -343,7 +343,7 @@
       }
 
       {
-        register real *costab = pnts[2];
+        register real *costab = mp3lib_pnts[2];
 
     
         vector float costabv1r, costabv1, costabv2;
@@ -385,8 +385,8 @@
 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */
 
   {
-    register real const cos0 = pnts[3][0];
-    register real const cos1 = pnts[3][1];
+    register real const cos0 = mp3lib_pnts[3][0];
+    register real const cos1 = mp3lib_pnts[3][1];
 
     b2[0x00] = b1[0x00] + b1[0x03];
     b2[0x01] = b1[0x01] + b1[0x02];
@@ -423,7 +423,7 @@
   }
 
   {
-    register real const cos0 = pnts[4][0];
+    register real const cos0 = mp3lib_pnts[4][0];
 
     b1[0x00] = b2[0x00] + b2[0x01];
     b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
--- a/mp3lib/dct64_i386.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/dct64_i386.c	Tue Apr 06 01:06:21 2004 +0000
@@ -13,7 +13,7 @@
 {
 
         {
-                register real *costab = pnts[0];
+                register real *costab = mp3lib_pnts[0];
 
                 b1[0x00] = samples[0x00] + samples[0x1F];
                 b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0];
@@ -65,7 +65,7 @@
         }
 
         {
-                register real *costab = pnts[1];
+                register real *costab = mp3lib_pnts[1];
 
                 b2[0x00] = b1[0x00] + b1[0x0F];
                 b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0];
@@ -103,7 +103,7 @@
         }
 
         {
-                register real *costab = pnts[2];
+                register real *costab = mp3lib_pnts[2];
 
                 b1[0x00] = b2[0x00] + b2[0x07];
                 b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0];
@@ -143,8 +143,8 @@
         }
 
         {
-                register real const cos0 = pnts[3][0];
-                register real const cos1 = pnts[3][1];
+                register real const cos0 = mp3lib_pnts[3][0];
+                register real const cos1 = mp3lib_pnts[3][1];
 
                 b2[0x00] = b1[0x00] + b1[0x03];
                 b2[0x03] = (b1[0x00] - b1[0x03]) * cos0;
@@ -188,7 +188,7 @@
         }
 
         {
-                register real const cos0 = pnts[4][0];
+                register real const cos0 = mp3lib_pnts[4][0];
 
                 b1[0x00] = b2[0x00] + b2[0x01];
                 b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
--- a/mp3lib/l2tables.h	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/l2tables.h	Tue Apr 06 01:06:21 2004 +0000
@@ -5,7 +5,7 @@
  * Layer-3 huffman table is in huffman.h
  */
 
-struct al_table alloc_0[] = {
+static struct al_table alloc_0[] = {
 	{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
 	{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
 	{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
@@ -45,7 +45,7 @@
 	{2,0},{5,3},{7,5},{16,-32767},
 	{2,0},{5,3},{7,5},{16,-32767} };
 
-struct al_table alloc_1[] = {
+static struct al_table alloc_1[] = {
 	{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
 	{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
 	{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
@@ -88,7 +88,7 @@
 	{2,0},{5,3},{7,5},{16,-32767},
 	{2,0},{5,3},{7,5},{16,-32767} };
 
-struct al_table alloc_2[] = {
+static struct al_table alloc_2[] = {
 	{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
 	{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
 	{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
@@ -100,7 +100,7 @@
 	{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
 	{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
 
-struct al_table alloc_3[] = {
+static struct al_table alloc_3[] = {
 	{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
 	{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
 	{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
@@ -116,7 +116,7 @@
 	{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
 	{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
 
-struct al_table alloc_4[] = {
+static struct al_table alloc_4[] = {
 	{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
 		{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
 	{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
--- a/mp3lib/layer2.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/layer2.c	Tue Apr 06 01:06:21 2004 +0000
@@ -274,7 +274,7 @@
 }
 
 
-int do_layer2(struct frame *fr,int outmode)
+static int do_layer2(struct frame *fr,int outmode)
 {
   int clip=0;
   int i,j;
@@ -314,5 +314,3 @@
 
   return clip;
 }
-
-
--- a/mp3lib/layer3.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/layer3.c	Tue Apr 06 01:06:21 2004 +0000
@@ -44,10 +44,10 @@
   int shortDiff[13];
 };
 
-int longLimit[9][23];
-int shortLimit[9][14];
+static int longLimit[9][23];
+static int shortLimit[9][14];
 
-struct bandInfoStruct bandInfo[9] = { 
+static struct bandInfoStruct bandInfo[9] = { 
 
 /* MPEG 1.0 */
  { {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576},
@@ -110,7 +110,7 @@
 /*
  * init tables for layer-3
  */
-void init_layer3(int down_sample_sblimit)
+static void init_layer3(int down_sample_sblimit)
 {
   int i,j,k,l;
 
--- a/mp3lib/mpg123.h	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/mpg123.h	Tue Apr 06 01:06:21 2004 +0000
@@ -107,13 +107,8 @@
   } ch[2];
 };
 
-static long freqs[9];
 extern real mp3lib_decwin[(512+32)];
-extern real *pnts[];
-
-static int do_layer2(struct frame *fr,int single);
-static int do_layer3(struct frame *fr,int single);
-static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt);
+extern real *mp3lib_pnts[];
 
 extern int synth_1to1_pent( real *,int,short * );
 extern void make_decode_tables_MMX(long scaleval);
--- a/mp3lib/sr1.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/sr1.c	Tue Apr 06 01:06:21 2004 +0000
@@ -86,8 +86,8 @@
 static unsigned char *wordpointer;
 static int bitsleft;
 
-unsigned char *pcm_sample;   /* outbuffer address */
-int pcm_point = 0;           /* outbuffer offset */
+static unsigned char *pcm_sample;   /* outbuffer address */
+static int pcm_point = 0;           /* outbuffer offset */
 
 static struct frame fr;
 
@@ -372,7 +372,7 @@
   return frames;
 }
 
-int _has_mmx = 0;  // used by layer2.c, layer3.c to pre-scale coeffs
+static int _has_mmx = 0;  // used by layer2.c, layer3.c to pre-scale coeffs
 
 #include "layer2.c"
 #include "layer3.c"
--- a/mp3lib/tabinit.c	Tue Apr 06 00:25:47 2004 +0000
+++ b/mp3lib/tabinit.c	Tue Apr 06 01:06:21 2004 +0000
@@ -1,5 +1,5 @@
 real mp3lib_decwin[(512+32)], cos64[32], cos32[16], cos16[8], cos8[4], cos4[2];
-real *pnts[]={ cos64,cos32,cos16,cos8,cos4 };
+real *mp3lib_pnts[]={ cos64,cos32,cos16,cos8,cos4 };
 
 static long intwinbase[] = {
      0,    -1,    -1,    -1,    -1,    -1,    -1,    -2,    -2,    -2,
@@ -29,7 +29,7 @@
  64019, 65290, 66494, 67629, 68692, 69679, 70590, 71420, 72169, 72835,
  73415, 73908, 74313, 74630, 74856, 74992, 75038 };
 
-void make_decode_tables(long scaleval)
+static void make_decode_tables(long scaleval)
 {
   int i,j,k,kr,divv;
   real *table,*costab;
@@ -38,7 +38,7 @@
   for(i=0;i<5;i++)
   {
     kr=0x10>>i; divv=0x40>>i;
-    costab = pnts[i];
+    costab = mp3lib_pnts[i];
     for(k=0;k<kr;k++) costab[k] = 1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv));
   }