1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
6 * THIS SOURCE. 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.5 2001/02/02 03:51:56 xiphmont Exp $
16 ********************************************************************/
24 #include "bitbuffer.h"
26 typedef struct vorbis_block_internal{
27 float **pcmdelay; /* this is a pointer into local storage */
29 } vorbis_block_internal;
31 typedef void vorbis_look_time;
32 typedef void vorbis_look_mapping;
33 typedef void vorbis_look_floor;
34 typedef void vorbis_look_residue;
35 typedef void vorbis_look_transform;
37 typedef struct backend_lookup_state {
38 /* local lookup storage */
39 envelope_lookup *ve; /* envelope lookup */
40 float **window[2][2][2]; /* block, leadin, leadout, type */
41 vorbis_look_transform **transform[2]; /* block, type */
44 /* backend lookups are tied to the mode, not the backend or naked mapping */
46 vorbis_look_mapping **mode;
48 /* local storage, only used on the encoding side. This way the
49 application does not need to worry about freeing some packets'
50 memory and not others'; packet storage is always tracked.
51 Cleared next call to a _dsp_ function */
52 unsigned char *header;
53 unsigned char *header1;
54 unsigned char *header2;
58 } backend_lookup_state;
60 /* mode ************************************************************/
68 typedef void vorbis_info_time;
69 typedef void vorbis_info_floor;
70 typedef void vorbis_info_residue;
71 typedef void vorbis_info_mapping;
73 /* vorbis_info contains all the setup information specific to the
74 specific compression/decompression mode in progress (eg,
75 psychoacoustic settings, channel setup, options, codebook
77 *********************************************************************/
79 typedef struct codec_setup_info {
81 /* Vorbis supports only short and long blocks, but allows the
82 encoder to choose the sizes */
86 /* modes are the primary means of supporting on-the-fly different
87 blocksizes, different channel mappings (LR or mid-side),
88 different residue backends, etc. Each mode consists of a
89 blocksize flag and a mapping (along with the mapping setup */
97 int psys; /* encode only */
99 vorbis_info_mode *mode_param[64];
101 vorbis_info_mapping *map_param[64];
103 vorbis_info_time *time_param[64];
105 vorbis_info_floor *floor_param[64];
106 int residue_type[64];
107 vorbis_info_residue *residue_param[64];
108 static_codebook *book_param[256];
109 vorbis_info_psy *psy_param[64]; /* encode only */
111 /* for block long/sort tuning; encode only */
113 float preecho_thresh;
114 float postecho_thresh;
115 float preecho_minenergy;
117 float ampmax_att_per_sec;
119 /* delay caching... how many samples to keep around prior to our
120 current block to aid in analysis? */