home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Secrets / Secrets2.iso / Audio / WAV / MaplayP / _SETUP.1 / layer3.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-02  |  2.1 KB  |  85 lines

  1. /* layer3.h
  2.  
  3.    Declarations for the Layer III decoder object */
  4.  
  5. #ifndef LAYERIII_H
  6. #define LAYERIII_H
  7.  
  8. #include "all.h"
  9. #include "l3type.h"
  10. #include "ibitstr.h"
  11. #include "obuffer.h"
  12. #include "bit_res.h"
  13. #include "header.h"
  14. #include "synfilt.h"
  15.  
  16. #define SSLIMIT 18
  17. #define SBLIMIT 32
  18.  
  19. /* Size of the table of whole numbers raised to 4/3 power.
  20.    This may be adjusted for performance without any problems. */
  21. #define POW_TABLE_LIMIT 512
  22.  
  23. class LayerIII_Decoder {
  24.  
  25. public:
  26.  
  27.     LayerIII_Decoder(Ibitstream *stream0, Header *header0,
  28.                         SynthesisFilter *filtera, SynthesisFilter *filterb,
  29.                     Obuffer *buffer0, enum e_channels which_ch0);
  30.  
  31.    ~LayerIII_Decoder();
  32.  
  33.    // Notify decoder that a seek is being made
  34.    void seek_notify();
  35.  
  36.    // Decode one frame, filling the buffer with the output samples
  37.     void decode();
  38.  
  39. private:
  40.  
  41.     // private data
  42.  
  43.     int32 is[SBLIMIT][SSLIMIT];
  44.    real  ro[2][SBLIMIT][SSLIMIT];
  45.    real  lr[2][SBLIMIT][SSLIMIT];
  46.    real  re_hybridOut[SBLIMIT][SSLIMIT];
  47.    real  prevblck[2][SBLIMIT][SSLIMIT];
  48.    real  k[2][SBLIMIT*SSLIMIT];
  49.  
  50.     Ibitstream *stream;
  51.    Header *header;
  52.    SynthesisFilter *filter1, *filter2;
  53.    Obuffer *buffer;
  54.    enum e_channels which_channels;
  55.    Bit_Reserve *br;
  56.    III_side_info_t *si;
  57.    III_scalefac_t scalefac;
  58.  
  59.    uint32 max_gr;
  60.    int32  frame_start;
  61.    int32  part2_start;
  62.    uint32 channels;
  63.    uint32 first_channel;
  64.    uint32 last_channel;
  65.    uint32 sfreq;
  66.  
  67.    // private member functions
  68.  
  69.     bool get_side_info();
  70.     void get_scale_factors(uint32 ch, uint32 gr);
  71.    void get_LSF_scale_data(uint32 ch, uint32 gr);
  72.    void get_LSF_scale_factors(uint32 ch, uint32 gr);
  73.    void huffman_decode(uint32 ch, uint32 gr);
  74.    void i_stereo_k_values(uint32 is_pos, uint32 io_type, uint32 i);
  75.     void dequantize_sample(real xr[SBLIMIT][SSLIMIT], uint32 ch, uint32 gr);
  76.     void reorder(real xr[SBLIMIT][SSLIMIT], uint32 ch, uint32 gr);
  77.     void stereo(uint32 gr);
  78.     void antialias(uint32 ch, uint32 gr);
  79.     void hybrid(uint32 ch, uint32 gr);
  80.    void do_downmix();
  81.  
  82. };
  83.  
  84. #endif
  85.