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.17 2003/08/18 05:34:01 xiphmont Exp $
16 ********************************************************************/
24 #define BLOCKTYPE_IMPULSE 0
25 #define BLOCKTYPE_PADDING 1
26 #define BLOCKTYPE_TRANSITION 0
27 #define BLOCKTYPE_LONG 1
29 #define PACKETBLOBS 15
31 typedef struct vorbis_block_internal{
32 float **pcmdelay; /* this is a pointer into local storage */
36 ogg_uint32_t packetblob_markers[PACKETBLOBS];
37 } vorbis_block_internal;
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_floor;
52 typedef void vorbis_info_residue;
53 typedef void vorbis_info_mapping;
58 typedef struct private_state {
59 /* local lookup storage */
60 envelope_lookup *ve; /* envelope lookup */
62 vorbis_look_transform **transform[2]; /* block, type */
63 drft_lookup fft_look[2];
66 vorbis_look_floor **flr;
67 vorbis_look_residue **residue;
69 vorbis_look_psy_global *psy_g_look;
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 ogg_int64_t sample_count;
84 /* codec_setup_info contains all the setup information specific to the
85 specific compression/decompression mode in progress (eg,
86 psychoacoustic settings, channel setup, options, codebook
88 *********************************************************************/
90 #include "highlevel.h"
91 typedef struct codec_setup_info {
93 /* Vorbis supports only short and long blocks, but allows the
94 encoder to choose the sizes */
98 /* modes are the primary means of supporting on-the-fly different
99 blocksizes, different channel mappings (LR or M/A),
100 different residue backends, etc. Each mode consists of a
101 blocksize flag and a mapping (along with the mapping setup */
108 int psys; /* encode only */
110 vorbis_info_mode *mode_param[64];
112 vorbis_info_mapping *map_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];
120 vorbis_info_psy *psy_param[4]; /* encode only */
121 vorbis_info_psy_global psy_g_param;
123 bitrate_manager_info bi;
124 highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a
125 highly redundant structure, but
126 improves clarity of program flow. */
127 int halfrate_flag; /* painless downsample for decode */
130 extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
131 extern void _vp_global_free(vorbis_look_psy_global *look);