1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
10 ********************************************************************
12 function: libvorbis codec headers
13 last mod: $Id: codec_internal.h,v 1.10 2001/12/12 09:45:24 xiphmont Exp $
15 ********************************************************************/
23 #define BLOCKTYPE_IMPULSE 0
24 #define BLOCKTYPE_PADDING 1
25 #define BLOCKTYPE_TRANSITION 0
26 #define BLOCKTYPE_LONG 1
28 typedef struct vorbis_block_internal{
29 float **pcmdelay; /* this is a pointer into local storage */
33 ogg_uint32_t *packet_markers;
34 } vorbis_block_internal;
36 typedef void vorbis_look_time;
37 typedef void vorbis_look_mapping;
38 typedef void vorbis_look_floor;
39 typedef void vorbis_look_residue;
40 typedef void vorbis_look_transform;
42 /* mode ************************************************************/
50 typedef void vorbis_info_time;
51 typedef void vorbis_info_floor;
52 typedef void vorbis_info_residue;
53 typedef void vorbis_info_mapping;
58 typedef struct backend_lookup_state {
59 /* local lookup storage */
60 envelope_lookup *ve; /* envelope lookup */
61 float **window[2][2][2]; /* block, leadin, leadout, type */
62 vorbis_look_transform **transform[2]; /* block, type */
64 vorbis_look_psy_global *psy_g_look;
66 /* backend lookups are tied to the mode, not the backend or naked mapping */
68 vorbis_look_mapping **mode;
70 /* local storage, only used on the encoding side. This way the
71 application does not need to worry about freeing some packets'
72 memory and not others'; packet storage is always tracked.
73 Cleared next call to a _dsp_ function */
74 unsigned char *header;
75 unsigned char *header1;
76 unsigned char *header2;
78 bitrate_manager_state bms;
80 } backend_lookup_state;
82 /* vorbis_info contains all the setup information specific to the
83 specific compression/decompression mode in progress (eg,
84 psychoacoustic settings, channel setup, options, codebook
86 *********************************************************************/
88 typedef struct codec_setup_info {
90 /* Vorbis supports only short and long blocks, but allows the
91 encoder to choose the sizes */
95 /* modes are the primary means of supporting on-the-fly different
96 blocksizes, different channel mappings (LR or M/A),
97 different residue backends, etc. Each mode consists of a
98 blocksize flag and a mapping (along with the mapping setup */
106 int psys; /* encode only */
108 vorbis_info_mode *mode_param[64];
110 vorbis_info_mapping *map_param[64];
112 vorbis_info_time *time_param[64];
114 vorbis_info_floor *floor_param[64];
115 int residue_type[64];
116 vorbis_info_residue *residue_param[64];
117 static_codebook *book_param[256];
119 vorbis_info_psy *psy_param[64]; /* encode only */
120 vorbis_info_psy_global psy_g_param;
121 bitrate_manager_info bi;
123 int passlimit[32]; /* iteration limit per couple/quant pass */
127 extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
128 extern void _vp_global_free(vorbis_look_psy_global *look);