Logo Search packages:      
Sourcecode: libjlayer-java version File versions  Download package

javazoom::jl::decoder::LayerIIIDecoder::LayerIIIDecoder ( Bitstream  stream0,
Header  header0,
SynthesisFilter  filtera,
SynthesisFilter  filterb,
Obuffer  buffer0,
int  which_ch0 
) [inline]

Constructor.

Definition at line 84 of file LayerIIIDecoder.java.

References javazoom::jl::decoder::Header::mode(), javazoom::jl::decoder::Header::sample_frequency(), and javazoom::jl::decoder::Header::version().

      {
        huffcodetab.inithuff();
            is_1d = new int[SBLIMIT*SSLIMIT+4];
            ro = new float[2][SBLIMIT][SSLIMIT];
            lr = new float[2][SBLIMIT][SSLIMIT];
            out_1d = new float[SBLIMIT*SSLIMIT];
            prevblck = new float[2][SBLIMIT*SSLIMIT];
            k = new float[2][SBLIMIT*SSLIMIT];
            nonzero = new int[2];

        //III_scalefact_t
        III_scalefac_t = new temporaire2[2];
        III_scalefac_t[0] = new temporaire2();
        III_scalefac_t[1] = new temporaire2();
        scalefac = III_scalefac_t;
        // L3TABLE INIT

            sfBandIndex = new SBI[9];     // SZD: MPEG2.5 +3 indices
            int[] l0 = {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576};
            int[] s0 = {0,4,8,12,18,24,32,42,56,74,100,132,174,192};
            int[] l1 = {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576};
            int[] s1 = {0,4,8,12,18,26,36,48,62,80,104,136,180,192};
            int[] l2 = {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576};
            int[] s2 = {0,4,8,12,18,26,36,48,62,80,104,134,174,192};

            int[] l3 = {0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576};
            int[] s3 = {0,4,8,12,16,22,30,40,52,66,84,106,136,192};
            int[] l4 = {0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576};
            int[] s4 = {0,4,8,12,16,22,28,38,50,64,80,100,126,192};
            int[] l5 = {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576};
            int[] s5 = {0,4,8,12,16,22,30,42,58,78,104,138,180,192};
            // SZD: MPEG2.5
            int[] l6 = {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576};
            int[] s6 = {0,4,8,12,18,26,36,48,62,80,104,134,174,192};
            int[] l7 = {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576};
            int[] s7 = {0,4,8,12,18,26,36,48,62,80,104,134,174,192};
            int[] l8 = {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576};
            int[] s8 = {0,8,16,24,36,52,72,96,124,160,162,164,166,192};

            sfBandIndex[0]= new SBI(l0,s0);
            sfBandIndex[1]= new SBI(l1,s1);
            sfBandIndex[2]= new SBI(l2,s2);

            sfBandIndex[3]= new SBI(l3,s3);
            sfBandIndex[4]= new SBI(l4,s4);
            sfBandIndex[5]= new SBI(l5,s5);
            //SZD: MPEG2.5
            sfBandIndex[6]= new SBI(l6,s6);
            sfBandIndex[7]= new SBI(l7,s7);
            sfBandIndex[8]= new SBI(l8,s8);
            // END OF L3TABLE INIT

            if(reorder_table == null) {   // SZD: generate LUT
                  reorder_table = new int[9][];
                  for(int i = 0; i < 9; i++)
                        reorder_table[i] = reorder(sfBandIndex[i].s);
            }

            // Sftable
            int[] ll0 = {0, 6, 11, 16, 21};
            int[] ss0 = {0, 6, 12};
            sftable = new Sftable(ll0,ss0);
            // END OF Sftable

        // scalefac_buffer
            scalefac_buffer = new int[54];
            // END OF scalefac_buffer

            stream         = stream0;
            header         = header0;
            filter1        = filtera;
            filter2        = filterb;
            buffer         = buffer0;
            which_channels = which_ch0;

            frame_start = 0;
            channels    = (header.mode() == Header.SINGLE_CHANNEL) ? 1 : 2;
            max_gr      = (header.version() == Header.MPEG1) ? 2 : 1;

            sfreq       =  header.sample_frequency() +
                       ((header.version() == Header.MPEG1) ? 3 :
                       (header.version() == Header.MPEG25_LSF) ? 6 : 0);      // SZD

            if (channels == 2)
            {
              switch (which_channels)
              {
            case OutputChannels.LEFT_CHANNEL:
                 case OutputChannels.DOWNMIX_CHANNELS:
                 first_channel = last_channel = 0;
                 break;

                 case OutputChannels.RIGHT_CHANNEL:
                 first_channel = last_channel = 1;
                 break;

                 case OutputChannels.BOTH_CHANNELS:
                    default:
                 first_channel  = 0;
                 last_channel   = 1;
                 break;
           }
         }
         else
         {
          first_channel = last_channel = 0;
         }

        for(int ch=0;ch<2;ch++)
           for (int j=0; j<576; j++)
                  prevblck[ch][j] = 0.0f;

        nonzero[0] = nonzero[1] = 576;

        br = new BitReserve();
        si = new III_side_info_t();
      }


Generated by  Doxygen 1.6.0   Back to index