examples/SFExamples/oggvorbiscodec94/src/libvorbis/lib/codec_internal.h

00001 /********************************************************************
00002  *                                                                  *
00003  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
00004  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
00005  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
00006  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
00007  *                                                                  *
00008  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
00009  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
00010  *                                                                  *
00011  ********************************************************************
00012 
00013  function: libvorbis codec headers
00014  last mod: $Id: codec_internal.h 7187 2004-07-20 07:24:27Z xiphmont $
00015 
00016  ********************************************************************/
00017 
00018 #ifndef _V_CODECI_H_
00019 #define _V_CODECI_H_
00020 
00021 #include "envelope.h"
00022 #include "codebook.h"
00023 
00024 #define BLOCKTYPE_IMPULSE    0
00025 #define BLOCKTYPE_PADDING    1
00026 #define BLOCKTYPE_TRANSITION 0 
00027 #define BLOCKTYPE_LONG       1
00028 
00029 #define PACKETBLOBS 15
00030 
00031 typedef struct vorbis_block_internal{
00032   float  **pcmdelay;  /* this is a pointer into local storage */ 
00033   float  ampmax;
00034   int    blocktype;
00035 
00036   oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed; 
00037                                               blob [PACKETBLOBS/2] points to
00038                                               the oggpack_buffer in the 
00039                                               main vorbis_block */
00040 } vorbis_block_internal;
00041 
00042 typedef void vorbis_look_floor;
00043 typedef void vorbis_look_residue;
00044 typedef void vorbis_look_transform;
00045 
00046 /* mode ************************************************************/
00047 typedef struct {
00048   int blockflag;
00049   int windowtype;
00050   int transformtype;
00051   int mapping;
00052 } vorbis_info_mode;
00053 
00054 typedef void vorbis_info_floor;
00055 typedef void vorbis_info_residue;
00056 typedef void vorbis_info_mapping;
00057 
00058 #include "psy.h"
00059 #include "bitrate.h"
00060 
00061 typedef struct private_state {
00062   /* local lookup storage */
00063   envelope_lookup        *ve; /* envelope lookup */    
00064   int                     window[2];
00065   vorbis_look_transform **transform[2];    /* block, type */
00066   drft_lookup             fft_look[2];
00067 
00068   int                     modebits;
00069   vorbis_look_floor     **flr;
00070   vorbis_look_residue   **residue;
00071   vorbis_look_psy        *psy;
00072   vorbis_look_psy_global *psy_g_look;
00073 
00074   /* local storage, only used on the encoding side.  This way the
00075      application does not need to worry about freeing some packets'
00076      memory and not others'; packet storage is always tracked.
00077      Cleared next call to a _dsp_ function */
00078   unsigned char *header;
00079   unsigned char *header1;
00080   unsigned char *header2;
00081 
00082   bitrate_manager_state bms;
00083 
00084   ogg_int64_t sample_count;
00085 } private_state;
00086 
00087 /* codec_setup_info contains all the setup information specific to the
00088    specific compression/decompression mode in progress (eg,
00089    psychoacoustic settings, channel setup, options, codebook
00090    etc).  
00091 *********************************************************************/
00092 
00093 #include "highlevel.h"
00094 typedef struct codec_setup_info {
00095 
00096   /* Vorbis supports only short and long blocks, but allows the
00097      encoder to choose the sizes */
00098 
00099   long blocksizes[2];
00100 
00101   /* modes are the primary means of supporting on-the-fly different
00102      blocksizes, different channel mappings (LR or M/A),
00103      different residue backends, etc.  Each mode consists of a
00104      blocksize flag and a mapping (along with the mapping setup */
00105 
00106   int        modes;
00107   int        maps;
00108   int        floors;
00109   int        residues;
00110   int        books;
00111   int        psys;     /* encode only */
00112 
00113   vorbis_info_mode       *mode_param[64];
00114   int                     map_type[64];
00115   vorbis_info_mapping    *map_param[64];
00116   int                     floor_type[64];
00117   vorbis_info_floor      *floor_param[64];
00118   int                     residue_type[64];
00119   vorbis_info_residue    *residue_param[64];
00120   static_codebook        *book_param[256];
00121   codebook               *fullbooks;
00122 
00123   vorbis_info_psy        *psy_param[4]; /* encode only */
00124   vorbis_info_psy_global psy_g_param;
00125 
00126   bitrate_manager_info   bi;
00127   highlevel_encode_setup hi; /* used only by vorbisenc.c.  It's a
00128                                 highly redundant structure, but
00129                                 improves clarity of program flow. */
00130   int         halfrate_flag; /* painless downsample for decode */  
00131 } codec_setup_info;
00132 
00133 extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
00134 extern void _vp_global_free(vorbis_look_psy_global *look);
00135 
00136 #endif
00137 

Generated by  doxygen 1.6.2