Update header copyright dates, update copyright assignemnt
[platform/upstream/libvorbis.git] / lib / codec_internal.h
1 /********************************************************************
2  *                                                                  *
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.        *
7  *                                                                  *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
9  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
10  *                                                                  *
11  ********************************************************************
12
13  function: libvorbis codec headers
14  last mod: $Id: codec_internal.h,v 1.5 2001/02/02 03:51:56 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_CODECI_H_
19 #define _V_CODECI_H_
20
21 #include "envelope.h"
22 #include "codebook.h"
23 #include "psy.h"
24 #include "bitbuffer.h"
25
26 typedef struct vorbis_block_internal{
27   float  **pcmdelay;  /* this is a pointer into local storage */ 
28   float  ampmax;
29 } vorbis_block_internal;
30
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;
36
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 */
42   codebook               *fullbooks;
43
44   /* backend lookups are tied to the mode, not the backend or naked mapping */
45   int                     modebits;
46   vorbis_look_mapping   **mode;
47
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;
55
56   float ampmax;
57
58 } backend_lookup_state;
59
60 /* mode ************************************************************/
61 typedef struct {
62   int blockflag;
63   int windowtype;
64   int transformtype;
65   int mapping;
66 } vorbis_info_mode;
67
68 typedef void vorbis_info_time;
69 typedef void vorbis_info_floor;
70 typedef void vorbis_info_residue;
71 typedef void vorbis_info_mapping;
72
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
76    etc).  
77 *********************************************************************/
78
79 typedef struct codec_setup_info {
80
81   /* Vorbis supports only short and long blocks, but allows the
82      encoder to choose the sizes */
83
84   long blocksizes[2];
85
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 */
90
91   int        modes;
92   int        maps;
93   int        times;
94   int        floors;
95   int        residues;
96   int        books;
97   int        psys;     /* encode only */
98
99   vorbis_info_mode    *mode_param[64];
100   int                  map_type[64];
101   vorbis_info_mapping *map_param[64];
102   int                  time_type[64];
103   vorbis_info_time    *time_param[64];
104   int                  floor_type[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 */
110   
111   /* for block long/sort tuning; encode only */
112   int       envelopesa;
113   float     preecho_thresh;
114   float     postecho_thresh;
115   float     preecho_minenergy;
116
117   float     ampmax_att_per_sec;
118
119   /* delay caching... how many samples to keep around prior to our
120      current block to aid in analysis? */
121   int       delaycache;
122
123 } codec_setup_info;
124
125 #endif