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/ *
11 ********************************************************************
13 function: libvorbis codec headers
14 last mod: $Id: codec_internal.h,v 1.12 2001/12/20 01:00:26 segher 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 */
62 float **window[2][2][2]; /* block, leadin, leadout, type */
63 vorbis_look_transform **transform[2]; /* block, type */
65 vorbis_look_psy_global *psy_g_look;
67 /* backend lookups are tied to the mode, not the backend or naked mapping */
69 vorbis_look_mapping **mode;
71 /* local storage, only used on the encoding side. This way the
72 application does not need to worry about freeing some packets'
73 memory and not others'; packet storage is always tracked.
74 Cleared next call to a _dsp_ function */
75 unsigned char *header;
76 unsigned char *header1;
77 unsigned char *header2;
79 bitrate_manager_state bms;
81 } backend_lookup_state;
83 /* high level configuration information for setting things up
84 step-by-step with the detaile vorbis_encode_ctl interface */
86 typedef struct highlevel_block {
87 double tone_mask_quality;
88 double tone_peaklimit_quality;
90 double noise_bias_quality;
91 double noise_compand_quality;
97 typedef struct highlevel_encode_setup {
98 double base_quality; /* these have to be tracked by the ctl */
99 double base_quality_short; /* interface so that the right books get */
100 double base_quality_long; /* chosen... */
107 int stereo_backfill_p;
108 int residue_backfill_p;
111 double stereo_point_kHz[2];
112 double lowpass_kHz[2];
114 double ath_floating_dB;
115 double ath_absolute_dB;
117 double amplitude_track_dBpersec;
118 double trigger_quality;
120 highlevel_block blocktype[4]; /* impulse, padding, trans, long */
122 } highlevel_encode_setup;
124 /* codec_setup_info contains all the setup information specific to the
125 specific compression/decompression mode in progress (eg,
126 psychoacoustic settings, channel setup, options, codebook
128 *********************************************************************/
130 typedef struct codec_setup_info {
132 /* Vorbis supports only short and long blocks, but allows the
133 encoder to choose the sizes */
137 /* modes are the primary means of supporting on-the-fly different
138 blocksizes, different channel mappings (LR or M/A),
139 different residue backends, etc. Each mode consists of a
140 blocksize flag and a mapping (along with the mapping setup */
148 int psys; /* encode only */
150 vorbis_info_mode *mode_param[64];
152 vorbis_info_mapping *map_param[64];
154 vorbis_info_time *time_param[64];
156 vorbis_info_floor *floor_param[64];
157 int residue_type[64];
158 vorbis_info_residue *residue_param[64];
159 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);