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.8 2001/03/26 23:27:43 xiphmont Exp $
15 ********************************************************************/
23 #include "bitbuffer.h"
25 typedef struct vorbis_block_internal{
26 float **pcmdelay; /* this is a pointer into local storage */
28 } vorbis_block_internal;
30 typedef void vorbis_look_time;
31 typedef void vorbis_look_mapping;
32 typedef void vorbis_look_floor;
33 typedef void vorbis_look_residue;
34 typedef void vorbis_look_transform;
36 typedef struct backend_lookup_state {
37 /* local lookup storage */
38 envelope_lookup *ve; /* envelope lookup */
39 float **window[2][2][2]; /* block, leadin, leadout, type */
40 vorbis_look_transform **transform[2]; /* block, type */
43 /* backend lookups are tied to the mode, not the backend or naked mapping */
45 vorbis_look_mapping **mode;
47 /* local storage, only used on the encoding side. This way the
48 application does not need to worry about freeing some packets'
49 memory and not others'; packet storage is always tracked.
50 Cleared next call to a _dsp_ function */
51 unsigned char *header;
52 unsigned char *header1;
53 unsigned char *header2;
57 } backend_lookup_state;
59 /* mode ************************************************************/
67 typedef void vorbis_info_time;
68 typedef void vorbis_info_floor;
69 typedef void vorbis_info_residue;
70 typedef void vorbis_info_mapping;
72 /* vorbis_info contains all the setup information specific to the
73 specific compression/decompression mode in progress (eg,
74 psychoacoustic settings, channel setup, options, codebook
76 *********************************************************************/
78 typedef struct codec_setup_info {
80 /* Vorbis supports only short and long blocks, but allows the
81 encoder to choose the sizes */
85 /* modes are the primary means of supporting on-the-fly different
86 blocksizes, different channel mappings (LR or mid-side),
87 different residue backends, etc. Each mode consists of a
88 blocksize flag and a mapping (along with the mapping setup */
96 int psys; /* encode only */
98 vorbis_info_mode *mode_param[64];
100 vorbis_info_mapping *map_param[64];
102 vorbis_info_time *time_param[64];
104 vorbis_info_floor *floor_param[64];
105 int residue_type[64];
106 vorbis_info_residue *residue_param[64];
107 static_codebook *book_param[256];
108 vorbis_info_psy *psy_param[64]; /* encode only */
110 /* for block long/sort tuning; encode only */
112 float preecho_thresh[4];
113 float postecho_thresh[4];
114 float preecho_minenergy;
116 float ampmax_att_per_sec;
118 /* delay caching... how many samples to keep around prior to our
119 current block to aid in analysis? */