[MPlayer-cvslog] r28865 - in trunk/mp3lib: decode_mmx.c layer3.c

reimar subversion at mplayerhq.hu
Sat Mar 7 10:08:03 CET 2009


Author: reimar
Date: Sat Mar  7 10:08:02 2009
New Revision: 28865

Log:
Make several constant mp3lib tables const

Modified:
   trunk/mp3lib/decode_mmx.c
   trunk/mp3lib/layer3.c

Modified: trunk/mp3lib/decode_mmx.c
==============================================================================
--- trunk/mp3lib/decode_mmx.c	Sat Mar  7 09:52:57 2009	(r28864)
+++ trunk/mp3lib/decode_mmx.c	Sat Mar  7 10:08:02 2009	(r28865)
@@ -12,9 +12,9 @@
 #define real float /* ugly - but only way */
 
 extern void (*dct64_MMX_func)(short*, short*, real*);
-static unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL;
-static unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL;
-unsigned int __attribute__((aligned(16))) costab_mmx[] =
+static const unsigned long long attribute_used __attribute__((aligned(8))) null_one = 0x0000ffff0000ffffULL;
+static const unsigned long long attribute_used __attribute__((aligned(8))) one_null = 0xffff0000ffff0000ULL;
+const unsigned int __attribute__((aligned(16))) costab_mmx[] =
 {
 	1056974725,
 	1057056395,
@@ -54,7 +54,7 @@ unsigned int __attribute__((aligned(16))
   make_decode_tables_MMX(32768), which had been implemented in (deleted since
   r23383) tabinit_MMX.c.
   */
-static short __attribute__((aligned(8))) mp3lib_decwins[] =
+static const short __attribute__((aligned(8))) mp3lib_decwins[] =
 {
 	     0,	     7,	    54,	   114,	   510,	  1288,	  1644,	  9372,
 	 18760,	 -9373,	  1644,	 -1289,	   510,	  -115,	    54,	    -8,
@@ -191,7 +191,7 @@ int synth_1to1_MMX(real *bandPtr, int ch
     static short buffs[2][2][0x110] __attribute__((aligned(8)));
     static int bo = 1;
     short *b0, (*buf)[0x110], *a, *b;
-    short* window;
+    const short* window;
     int bo1, i = 8;
 
     if (channel == 0) {

Modified: trunk/mp3lib/layer3.c
==============================================================================
--- trunk/mp3lib/layer3.c	Sat Mar  7 09:52:57 2009	(r28864)
+++ trunk/mp3lib/layer3.c	Sat Mar  7 10:08:02 2009	(r28865)
@@ -53,7 +53,7 @@ struct bandInfoStruct {
 static int longLimit[9][23];
 static int shortLimit[9][14];
 
-static struct bandInfoStruct bandInfo[9] = { 
+static const 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},
@@ -132,7 +132,7 @@ static void init_layer3(int down_sample_
 
   for (i=0;i<8;i++)
   {
-    static double Ci[8]={-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
+    static const double Ci[8]={-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
     double sq=sqrt(1.0+Ci[i]*Ci[i]);
     aa_cs[i] = 1.0/sq;
     aa_ca[i] = Ci[i]/sq;
@@ -180,7 +180,7 @@ static void init_layer3(int down_sample_
   }
 
   for(j=0;j<4;j++) {
-    static int len[4] = { 36,36,12,36 };
+    static const int len[4] = { 36,36,12,36 };
     for(i=0;i<len[j];i+=2)
       win1[j][i] = + win[j][i];
     for(i=1;i<len[j];i+=2)
@@ -213,10 +213,10 @@ static void init_layer3(int down_sample_
 
   for(j=0;j<9;j++)
   {
-   struct bandInfoStruct *bi = &bandInfo[j];
+   const struct bandInfoStruct *bi = &bandInfo[j];
    int *mp;
    int cb,lwin;
-   int *bdf;
+   const int *bdf;
 
    mp = map[j][0] = mapbuf0[j];
    bdf = bi->longDiff;
@@ -984,7 +984,7 @@ static void III_i_stereo(real xr_buf[2][
    struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf)
 {
       real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf;
-      struct bandInfoStruct *bi = &bandInfo[sfreq];
+      const struct bandInfoStruct *bi = &bandInfo[sfreq];
 
       const real *tab1,*tab2;
 



More information about the MPlayer-cvslog mailing list