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-2000 *
9 * by Monty <monty@xiph.org> and the XIPHOPHORUS Company *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 function: libvorbis codec headers
15 last mod: $Id: codec_internal.h,v 1.4 2001/01/22 01:38:24 xiphmont Exp $
17 ********************************************************************/
25 #include "bitbuffer.h"
27 typedef struct vorbis_block_internal{
28 float **pcmdelay; /* this is a pointer into local storage */
30 } vorbis_block_internal;
32 typedef void vorbis_look_time;
33 typedef void vorbis_look_mapping;
34 typedef void vorbis_look_floor;
35 typedef void vorbis_look_residue;
36 typedef void vorbis_look_transform;
38 typedef struct backend_lookup_state {
39 /* local lookup storage */
40 envelope_lookup *ve; /* envelope lookup */
41 float **window[2][2][2]; /* block, leadin, leadout, type */
42 vorbis_look_transform **transform[2]; /* block, type */
45 /* backend lookups are tied to the mode, not the backend or naked mapping */
47 vorbis_look_mapping **mode;
49 /* local storage, only used on the encoding side. This way the
50 application does not need to worry about freeing some packets'
51 memory and not others'; packet storage is always tracked.
52 Cleared next call to a _dsp_ function */
53 unsigned char *header;
54 unsigned char *header1;
55 unsigned char *header2;
59 } backend_lookup_state;
61 /* mode ************************************************************/
69 typedef void vorbis_info_time;
70 typedef void vorbis_info_floor;
71 typedef void vorbis_info_residue;
72 typedef void vorbis_info_mapping;
74 /* vorbis_info contains all the setup information specific to the
75 specific compression/decompression mode in progress (eg,
76 psychoacoustic settings, channel setup, options, codebook
78 *********************************************************************/
80 typedef struct codec_setup_info {
82 /* Vorbis supports only short and long blocks, but allows the
83 encoder to choose the sizes */
87 /* modes are the primary means of supporting on-the-fly different
88 blocksizes, different channel mappings (LR or mid-side),
89 different residue backends, etc. Each mode consists of a
90 blocksize flag and a mapping (along with the mapping setup */
98 int psys; /* encode only */
100 vorbis_info_mode *mode_param[64];
102 vorbis_info_mapping *map_param[64];
104 vorbis_info_time *time_param[64];
106 vorbis_info_floor *floor_param[64];
107 int residue_type[64];
108 vorbis_info_residue *residue_param[64];
109 static_codebook *book_param[256];
110 vorbis_info_psy *psy_param[64]; /* encode only */
112 /* for block long/sort tuning; encode only */
114 float preecho_thresh;
115 float postecho_thresh;
116 float preecho_minenergy;
118 float ampmax_att_per_sec;
120 /* delay caching... how many samples to keep around prior to our
121 current block to aid in analysis? */