diff mp3lib/layer3.c @ 29263:0f1b5b68af32

whitespace cosmetics: Remove all trailing whitespace.
author diego
date Wed, 13 May 2009 02:58:57 +0000
parents cc27f3667e28
children 347d152a5cfa
line wrap: on
line diff
--- a/mp3lib/layer3.c	Tue May 12 19:25:35 2009 +0000
+++ b/mp3lib/layer3.c	Wed May 13 02:58:57 2009 +0000
@@ -4,16 +4,16 @@
  * $Id$
  */
 
-/* 
- * Mpeg Layer-3 audio decoder 
+/*
+ * Mpeg Layer-3 audio decoder
  * --------------------------
  * copyright (c) 1995-1999 by Michael Hipp.
  * All rights reserved. See also 'README'
  *
- * Optimize-TODO: put short bands into the band-field without the stride 
+ * Optimize-TODO: put short bands into the band-field without the stride
  *                of 3 reals
  * Length-optimze: unify long and short band code where it is possible
- */ 
+ */
 
 #if 0
 #define L3_DEBUG 1
@@ -53,7 +53,7 @@
 static int longLimit[9][23];
 static int shortLimit[9][14];
 
-static const 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},
@@ -331,11 +331,11 @@
 
    static const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } };
    const int *tab = tabs[lsf];
-   
+
    si->main_data_begin = getbits(tab[1]);
    if (stereo == 1)
      si->private_bits = getbits_fast(tab[2]);
-   else 
+   else
      si->private_bits = getbits_fast(tab[3]);
 
    if(!lsf) {
@@ -383,8 +383,8 @@
              fprintf(stderr,"Blocktype == 0 and window-switching == 1 not allowed.\n");
            return 0;
          }
-      
-         /* region_count/start parameters are implicit in this case. */       
+
+         /* region_count/start parameters are implicit in this case. */
          if(!lsf || gr_info->block_type == 2)
            gr_info->region1start = 36>>1;
          else {
@@ -474,7 +474,7 @@
           numbits += num0 * 6;
         }
         else {
-          scf += 6; 
+          scf += 6;
         }
 
         if(!(scfsi & 0x4)) {
@@ -492,7 +492,7 @@
           numbits += num1 * 5;
         }
         else {
-          scf += 5; 
+          scf += 5;
         }
 
         if(!(scfsi & 0x1)) {
@@ -523,7 +523,7 @@
    { { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0} ,
      {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} } ,
    { { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0} ,
-     { 6,15,12,0 } , { 6,12, 9,6 } , {  6,18,9,0} } }; 
+     { 6,15,12,0 } , { 6,12, 9,6 } , {  6,18,9,0} } };
 
   if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */
     slen = i_slen2[gr_info->scalefac_compress>>1];
@@ -532,7 +532,7 @@
 
   gr_info->preflag = (slen>>15) & 0x1;
 
-  n = 0;  
+  n = 0;
   if( gr_info->block_type == 2 ) {
     n++;
     if(gr_info->mixed_block_flag) n++;
@@ -551,7 +551,7 @@
       for(j=0;j<(int)(pnt[i]);j++) *scf++ = 0;
     }
   }
-  
+
   n = (n << 1) + 1;
   for(i=0;i<n;i++) *scf++ = 0;
 
@@ -596,10 +596,10 @@
     int region1  = gr_info->region1start;
     int region2  = gr_info->region2start;
 
-    l3 = ((576>>1)-bv)>>1;   
+    l3 = ((576>>1)-bv)>>1;
 /*
- * we may lose the 'odd' bit here !! 
- * check this later again 
+ * we may lose the 'odd' bit here !!
+ * check this later again
  */
     if(bv <= region1) {
       l[0] = bv; l[1] = l[2] = 0;
@@ -614,10 +614,10 @@
       }
     }
   }
- 
+
   if(gr_info->block_type == 2) {
     /*
-     * decoding with short or mixed mode BandIndex table 
+     * decoding with short or mixed mode BandIndex table
      */
     int i,max[4];
     int step=0,lwin=3,cb=0;
@@ -759,7 +759,7 @@
           if(part2remain+num <= 0) {
             break;
           }
-          if(mask < 0) 
+          if(mask < 0)
             *xrpnt = -v;
           else
             *xrpnt = v;
@@ -922,7 +922,7 @@
             mc = *m++;
             cb = *m++;
 #ifdef CUT_HF
-            if(cb == 21) { 
+            if(cb == 21) {
               fprintf(stderr,"c");
               v = 0.0;
             }
@@ -958,7 +958,7 @@
   bitindex -= num; wordpointer += (bitindex>>3); bitindex &= 0x7;
   num = 0;
 
-  while(xrpnt < &xr[SBLIMIT][0]) 
+  while(xrpnt < &xr[SBLIMIT][0])
     *xrpnt++ = 0.0;
 
   while( part2remain > 16 ) {
@@ -977,7 +977,7 @@
 
 
 
-/* 
+/*
  * III_stereo: calculate real channel values for Joint-I-Stereo-mode
  */
 static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac,
@@ -989,10 +989,10 @@
       const real *tab1,*tab2;
 
       int tab;
-      static const real *tabs[3][2][2] = { 
+      static const real *tabs[3][2][2] = {
          { { tan1_1,tan2_1 }     , { tan1_2,tan2_2 } },
          { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } } ,
-         { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } } 
+         { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } }
       };
 
       tab = lsf + (gr_info->scalefac_compress & lsf);
@@ -1032,7 +1032,7 @@
              do_l = 0;
 
            for(;sfb<12;sfb++) {
-             is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ 
+             is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
              if(is_p != 7) {
                real t1,t2;
                sb  = bi->shortDiff[sfb];
@@ -1047,7 +1047,7 @@
            }
 
 #if 1
-/* in the original: copy 10 to 11 , here: copy 11 to 12 
+/* in the original: copy 10 to 11 , here: copy 11 to 12
 maybe still wrong??? (copy 12 to 13?) */
            is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
            sb   = bi->shortDiff[12];
@@ -1060,7 +1060,7 @@
            if(is_p != 7) {
              real t1,t2;
              t1 = tab1[is_p]; t2 = tab2[is_p];
-             for ( ; sb > 0; sb--,idx+=3 ) {  
+             for ( ; sb > 0; sb--,idx+=3 ) {
                real v = xr[0][idx];
                xr[0][idx] = REAL_MUL(v, t1);
                xr[1][idx] = REAL_MUL(v, t2);
@@ -1069,7 +1069,7 @@
          } /* end for(lwin; .. ; . ) */
 
 /* also check l-part, if ALL bands in the three windows are 'empty'
- * and mode = mixed_mode 
+ * and mode = mixed_mode
  */
          if (do_l) {
            int sfb = gr_info->maxbandl;
@@ -1087,17 +1087,17 @@
                  xr[1][idx] = REAL_MUL(v, t2);
                }
              }
-             else 
+             else
                idx += sb;
            }
-         }     
-      } 
+         }
+      }
       else { /* ((gr_info->block_type != 2)) */
        int sfb = gr_info->maxbandl;
        int is_p,idx = bi->longIdx[sfb];
 
 /* hmm ... maybe the maxbandl stuff for i-stereo is buggy? */
-       if(sfb <= 21) { 
+       if(sfb <= 21) {
         for ( ; sfb<21; sfb++) {
           int sb = bi->longDiff[sfb];
           is_p = scalefac[sfb]; /* scale: 0-15 */
@@ -1117,7 +1117,7 @@
         is_p = scalefac[20];
         if(is_p != 7) {  /* copy l-band 20 to l-band 21 */
           int sb;
-          real t1 = tab1[is_p],t2 = tab2[is_p]; 
+          real t1 = tab1[is_p],t2 = tab2[is_p];
 
           for ( sb = bi->longDiff[21]; sb > 0; sb--,idx++ ) {
             real v = xr[0][idx];
@@ -1133,9 +1133,9 @@
    int sblim;
 
    if(gr_info->block_type == 2) {
-      if(!gr_info->mixed_block_flag) 
+      if(!gr_info->mixed_block_flag)
         return;
-      sblim = 1; 
+      sblim = 1;
    }
    else {
      sblim = gr_info->maxb-1;
@@ -1159,7 +1159,7 @@
          *xr1++ = (bd * (*cs++) ) + (bu * (*ca++) );
        }
      }
-     
+
   }
 }
 
@@ -1172,9 +1172,9 @@
 /*
  * III_hybrid
  */
- 
+
 static dct36_func_t dct36_func;
-  
+
 static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT],real tsOut[SSLIMIT][SBLIMIT],
    int ch,struct gr_info_s *gr_info)
 {
@@ -1199,7 +1199,7 @@
      (*dct36_func)(fsIn[1],rawout1+18,rawout2+18,win1[0],tspnt+1);
      rawout1 += 36; rawout2 += 36; tspnt += 2;
    }
- 
+
    bt = gr_info->block_type;
    if(bt == 2) {
      for (; sb<gr_info->maxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36) {
@@ -1255,7 +1255,7 @@
 
   if(!III_get_side_info(&sideinfo,stereo,ms_stereo,sfreq,single,fr->lsf))
     return -1;
-  
+
   set_pointer(sideinfo.main_data_begin);
 
   granules = (fr->lsf) ? 1 : 2;
@@ -1275,9 +1275,9 @@
 
     if(stereo == 2) {
       struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]);
-      
+
       int part2bits;
-      if(fr->lsf) 
+      if(fr->lsf)
         part2bits = III_get_scale_factors_2(scalefacs[1],gr_info,i_stereo);
       else
         part2bits = III_get_scale_factors_1(scalefacs[1],gr_info);
@@ -1302,7 +1302,7 @@
         III_i_stereo(hybridIn,scalefacs[1],gr_info,sfreq,ms_stereo,fr->lsf);
 
       if(ms_stereo || i_stereo || (single == 3) ) {
-        if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb) 
+        if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb)
           sideinfo.ch[0].gr[gr].maxb = gr_info->maxb;
         else
           gr_info->maxb = sideinfo.ch[0].gr[gr].maxb;
@@ -1313,7 +1313,7 @@
           register int i;
           register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
           for(i=0;i<SSLIMIT*gr_info->maxb;i++,in0++)
-            *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ 
+            *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */
           break; }
         case 1: {
           register int i;
@@ -1340,7 +1340,7 @@
 		    clip += (fr->synth)(hybridOut[1][ss],1,pcm_sample,&pcm_point);
       }
     }
-    
+
   }
 
   return clip;