5030de5c063d06a5582688f382732cdb51d96657
[platform/upstream/libvorbis.git] / include / vorbis / backends.h
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5  * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
6  * PLEASE READ THESE TERMS DISTRIBUTING.                            *
7  *                                                                  *
8  * THE OggSQUISH 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 backend and mapping structures; needed for 
15            static mode headers
16  last mod: $Id: backends.h,v 1.5 2000/02/09 22:04:09 xiphmont Exp $
17
18  ********************************************************************/
19
20 /* this is exposed up here because we need it for static modes.
21    Lookups for each backend aren't exposed because there's no reason
22    to do so */
23
24 #ifndef _vorbis_time_backend_h_
25 #define _vorbis_time_backend_h_
26
27 /* this would all be simpler/shorter with templates, but.... */
28 /* Transform backend generic *************************************/
29
30 /* only mdct right now.  Flesh it out more if we ever transcend mdct
31    in the transform domain */
32
33 /* Time backend generic ******************************************/
34 typedef struct{
35   void              (*pack)  (vorbis_info_time *,oggpack_buffer *);
36   vorbis_info_time *(*unpack)(vorbis_info *,oggpack_buffer *);
37   vorbis_look_time *(*look)  (vorbis_info *,vorbis_info_mode *,
38                               vorbis_info_time *);
39   void (*free_info) (vorbis_info_time *);
40   void (*free_look) (vorbis_look_time *);
41   int  (*forward)   (struct vorbis_block *,vorbis_look_time *,
42                      double *,double *);
43   int  (*inverse)   (struct vorbis_block *,vorbis_look_time *,
44                      double *,double *);
45 } vorbis_func_time;
46
47 typedef struct{
48   int dummy;
49 } vorbis_info_time0;
50
51 /* Floor backend generic *****************************************/
52 typedef struct{
53   void               (*pack)  (vorbis_info_floor *,oggpack_buffer *);
54   vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
55   vorbis_look_floor *(*look)  (vorbis_info *,vorbis_info_mode *,
56                                vorbis_info_floor *);
57   void (*free_info) (vorbis_info_floor *);
58   void (*free_look) (vorbis_look_floor *);
59   int  (*forward)   (struct vorbis_block *,vorbis_look_floor *,
60                      double *,double *);
61   int  (*inverse)   (struct vorbis_block *,vorbis_look_floor *,
62                      double *);
63 } vorbis_func_floor;
64
65 typedef struct{
66   int   order;
67   long  rate;
68   long  barkmap;
69
70   int   ampbits;
71   int   ampdB;
72
73   int   stages; /* <= 16 */
74   int   books[16];
75 } vorbis_info_floor0;
76
77 /* Residue backend generic *****************************************/
78 typedef struct{
79   void                 (*pack)  (vorbis_info_residue *,oggpack_buffer *);
80   vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
81   vorbis_look_residue *(*look)  (vorbis_info *,vorbis_info_mode *,
82                                  vorbis_info_residue *);
83   void (*free_info)    (vorbis_info_residue *);
84   void (*free_look)    (vorbis_look_residue *);
85   int  (*forward)      (struct vorbis_block *,vorbis_look_residue *,
86                         double **,int **,int);
87   int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
88                         double **,int);
89 } vorbis_func_residue;
90
91 typedef struct vorbis_info_residue0{
92 /* block-partitioned VQ coded straight residue */
93   long  begin;
94   long  end;
95
96   /* way unfinished, just so you know while poking around CVS ;-) */
97
98 } vorbis_info_residue0;
99
100 /* Mapping backend generic *****************************************/
101 typedef struct{
102   void                 (*pack)  (vorbis_info *,vorbis_info_mapping *,
103                                  oggpack_buffer *);
104   vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
105   vorbis_look_mapping *(*look)  (vorbis_info *,vorbis_info_mode *,
106                                  vorbis_info_mapping *);
107   void (*free_info)    (vorbis_info_mapping *);
108   void (*free_look)    (vorbis_look_mapping *);
109   int  (*forward)      (struct vorbis_block *vb,vorbis_look_mapping *);
110   int  (*inverse)      (struct vorbis_block *vb,vorbis_look_mapping *);
111 } vorbis_func_mapping;
112
113 typedef struct vorbis_info_mapping0{
114   int   submaps;  /* <= 16 */
115   int   chmuxlist[256];   /* up to 256 channels in a Vorbis stream */
116   
117   int   timesubmap[16];    /* [mux] */
118   int   floorsubmap[16];   /* [mux] submap to floors */
119   int   residuesubmap[16]; /* [mux] submap to residue */
120   int   psysubmap[16];     /* [mux]; encode only */
121 } vorbis_info_mapping0;
122
123 #endif
124
125
126
127
128