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-2002 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: libvorbis codec headers
14 last mod: $Id: codec_internal.h,v 1.14 2002/01/22 11:59:00 xiphmont Exp $
16 ********************************************************************/
24 #define BLOCKTYPE_IMPULSE 0
25 #define BLOCKTYPE_PADDING 1
26 #define BLOCKTYPE_TRANSITION 0
27 #define BLOCKTYPE_LONG 1
29 typedef struct vorbis_block_internal{
30 float **pcmdelay; /* this is a pointer into local storage */
34 ogg_uint32_t *packet_markers;
35 } vorbis_block_internal;
37 typedef void vorbis_look_time;
38 typedef void vorbis_look_mapping;
39 typedef void vorbis_look_floor;
40 typedef void vorbis_look_residue;
41 typedef void vorbis_look_transform;
43 /* mode ************************************************************/
51 typedef void vorbis_info_time;
52 typedef void vorbis_info_floor;
53 typedef void vorbis_info_residue;
54 typedef void vorbis_info_mapping;
59 typedef struct backend_lookup_state {
60 /* local lookup storage */
61 envelope_lookup *ve; /* envelope lookup */
63 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 /* high level configuration information for setting things up
83 step-by-step with the detaile vorbis_encode_ctl interface */
85 typedef struct highlevel_block {
86 double tone_mask_quality;
87 double tone_peaklimit_quality;
89 double noise_bias_quality;
90 double noise_compand_quality;
96 typedef struct highlevel_encode_setup {
97 double base_quality; /* these have to be tracked by the ctl */
98 double base_quality_short; /* interface so that the right books get */
99 double base_quality_long; /* chosen... */
106 int stereo_backfill_p;
107 int residue_backfill_p;
110 double stereo_point_kHz[2];
111 double lowpass_kHz[2];
113 double ath_floating_dB;
114 double ath_absolute_dB;
116 double amplitude_track_dBpersec;
117 double trigger_quality;
119 highlevel_block blocktype[4]; /* impulse, padding, trans, long */
121 } highlevel_encode_setup;
123 /* codec_setup_info contains all the setup information specific to the
124 specific compression/decompression mode in progress (eg,
125 psychoacoustic settings, channel setup, options, codebook
127 *********************************************************************/
129 typedef struct codec_setup_info {
131 /* Vorbis supports only short and long blocks, but allows the
132 encoder to choose the sizes */
136 /* modes are the primary means of supporting on-the-fly different
137 blocksizes, different channel mappings (LR or M/A),
138 different residue backends, etc. Each mode consists of a
139 blocksize flag and a mapping (along with the mapping setup */
147 int psys; /* encode only */
149 vorbis_info_mode *mode_param[64];
151 vorbis_info_mapping *map_param[64];
153 vorbis_info_time *time_param[64];
155 vorbis_info_floor *floor_param[64];
156 int residue_type[64];
157 vorbis_info_residue *residue_param[64];
158 static_codebook *book_param[256];
161 vorbis_info_psy *psy_param[64]; /* encode only */
162 vorbis_info_psy_global psy_g_param;
164 bitrate_manager_info bi;
165 highlevel_encode_setup hi;
167 int passlimit[32]; /* iteration limit per couple/quant pass */
171 extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
172 extern void _vp_global_free(vorbis_look_psy_global *look);