beta 3 commit. Unless I missed something (give it 50/50 odds ;-)
[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-2000             *
9  * by Monty <monty@xiph.org> and the XIPHOPHORUS Company            *
10  * http://www.xiph.org/                                             *
11  *                                                                  *
12  ********************************************************************
13
14  function: libvorbis codec headers
15  last mod: $Id: codec_internal.h,v 1.3 2000/11/17 11:47:18 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_CODECI_H_
20 #define _V_CODECI_H_
21
22 #include "envelope.h"
23 #include "codebook.h"
24 #include "psy.h"
25 #include "bitbuffer.h"
26
27 typedef void vorbis_look_time;
28 typedef void vorbis_look_mapping;
29 typedef void vorbis_look_floor;
30 typedef void vorbis_look_residue;
31 typedef void vorbis_look_transform;
32
33 typedef struct backend_lookup_state {
34   /* local lookup storage */
35   envelope_lookup        *ve; /* envelope lookup */    
36   float                 **window[2][2][2]; /* block, leadin, leadout, type */
37   vorbis_look_transform **transform[2];    /* block, type */
38   codebook               *fullbooks;
39
40   /* backend lookups are tied to the mode, not the backend or naked mapping */
41   int                     modebits;
42   vorbis_look_mapping   **mode;
43
44   /* local storage, only used on the encoding side.  This way the
45      application does not need to worry about freeing some packets'
46      memory and not others'; packet storage is always tracked.
47      Cleared next call to a _dsp_ function */
48   unsigned char *header;
49   unsigned char *header1;
50   unsigned char *header2;
51
52 } backend_lookup_state;
53
54 /* mode ************************************************************/
55 typedef struct {
56   int blockflag;
57   int windowtype;
58   int transformtype;
59   int mapping;
60 } vorbis_info_mode;
61
62 typedef void vorbis_info_time;
63 typedef void vorbis_info_floor;
64 typedef void vorbis_info_residue;
65 typedef void vorbis_info_mapping;
66
67 /* vorbis_info contains all the setup information specific to the
68    specific compression/decompression mode in progress (eg,
69    psychoacoustic settings, channel setup, options, codebook
70    etc).  
71 *********************************************************************/
72
73 typedef struct codec_setup_info {
74
75   /* Vorbis supports only short and long blocks, but allows the
76      encoder to choose the sizes */
77
78   long blocksizes[2];
79
80   /* modes are the primary means of supporting on-the-fly different
81      blocksizes, different channel mappings (LR or mid-side),
82      different residue backends, etc.  Each mode consists of a
83      blocksize flag and a mapping (along with the mapping setup */
84
85   int        modes;
86   int        maps;
87   int        times;
88   int        floors;
89   int        residues;
90   int        books;
91   int        psys;     /* encode only */
92
93   vorbis_info_mode    *mode_param[64];
94   int                  map_type[64];
95   vorbis_info_mapping *map_param[64];
96   int                  time_type[64];
97   vorbis_info_time    *time_param[64];
98   int                  floor_type[64];
99   vorbis_info_floor   *floor_param[64];
100   int                  residue_type[64];
101   vorbis_info_residue *residue_param[64];
102   static_codebook     *book_param[256];
103   vorbis_info_psy     *psy_param[64]; /* encode only */
104   
105   /* for block long/sort tuning; encode only */
106   int        envelopesa;
107   float     preecho_thresh;
108   float     preecho_clamp;
109   float     preecho_minenergy;
110
111 } codec_setup_info;
112
113 #endif