private int decodeSpectrum(float[] output){
  int subbandVlcIndex[]=new int[32];
  int sfIndex[]=new int[32];
  int mantissas[]=new int[128];
  int numSubbands=br.read(5);
  int codingMode=br.read(1);
  for (int i=0; i <= numSubbands; i++) {
    subbandVlcIndex[i]=br.read(3);
  }
  for (int i=0; i <= numSubbands; i++) {
    if (subbandVlcIndex[i] != 0) {
      sfIndex[i]=br.read(6);
    }
  }
  int i;
  for (i=0; i <= numSubbands; i++) {
    int first=subband_tab[i];
    int last=subband_tab[i + 1];
    int subbandSize=last - first;
    if (subbandVlcIndex[i] != 0) {
      readQuantSpectralCoeffs(subbandVlcIndex[i],codingMode,mantissas,subbandSize);
      float scaleFactor=ff_atrac_sf_table[sfIndex[i]] * inv_max_quant[subbandVlcIndex[i]];
      for (int j=0; first < last; first++, j++) {
        output[first]=mantissas[j] * scaleFactor;
      }
    }
 else {
      Arrays.fill(output,first,first + subbandSize,0f);
    }
  }
  Arrays.fill(output,subband_tab[i],SAMPLES_PER_FRAME,0f);
  return numSubbands;
}

private int decodeSpectrum ( float [ ] output ) { int subbandVlcIndex [ ] = new int [ 32 ] ; int sfIndex [ ] = new int [ 32 ] ; int mantissas [ ] = new int [ 128 ] ; int numSubbands = br . read ( 5 ) ; int codingMode = br . read ( 1 ) ; for ( int i = 0 ; i <= numSubbands ; i ++ ) { subbandVlcIndex [ i ] = br . read ( 3 ) ; } for ( int i = 0 ; i <= numSubbands ; i ++ ) { if ( subbandVlcIndex [ i ] != 0 ) { sfIndex [ i ] = br . read ( 6 ) ; } } int i ; for ( i = 0 ; i <= numSubbands ; i ++ ) { int first = subband_tab [ i ] ; int last = subband_tab [ i + 1 ] ; int subbandSize = last - first ; if ( subbandVlcIndex [ i ] != 0 ) { readQuantSpectralCoeffs ( subbandVlcIndex [ i ] , codingMode , mantissas , subbandSize ) ; float scaleFactor = ff_atrac_sf_table [ sfIndex [ i ] ] * inv_max_quant [ subbandVlcIndex [ i ] ] ; for ( int j = 0 ; first < last ; first ++ , j ++ ) { output [ first ] = mantissas [ j ] * scaleFactor ; } } else { Arrays . fill ( output , first , first + subbandSize , 0f ) ; } } Arrays . fill ( output , subband_tab [ i ] , SAMPLES_PER_FRAME , 0f ) ; return numSubbands ; }
restore the quantized band spectrum coefficients
