1 /********************************************************************
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. *
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/ *
12 ********************************************************************
14 function: libvorbis backend and mapping structures; needed for
16 last mod: $Id: backends.h,v 1.6 2000/02/12 08:33:01 xiphmont Exp $
18 ********************************************************************/
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
24 #ifndef _vorbis_time_backend_h_
25 #define _vorbis_time_backend_h_
27 /* this would all be simpler/shorter with templates, but.... */
28 /* Transform backend generic *************************************/
30 /* only mdct right now. Flesh it out more if we ever transcend mdct
31 in the transform domain */
33 /* Time backend generic ******************************************/
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 *,
39 void (*free_info) (vorbis_info_time *);
40 void (*free_look) (vorbis_look_time *);
41 int (*forward) (struct vorbis_block *,vorbis_look_time *,
43 int (*inverse) (struct vorbis_block *,vorbis_look_time *,
51 /* Floor backend generic *****************************************/
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 *,
57 void (*free_info) (vorbis_info_floor *);
58 void (*free_look) (vorbis_look_floor *);
59 int (*forward) (struct vorbis_block *,vorbis_look_floor *,
61 int (*inverse) (struct vorbis_block *,vorbis_look_floor *,
73 int stages; /* <= 16 */
77 /* Residue backend generic *****************************************/
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 *,
87 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
89 } vorbis_func_residue;
91 typedef struct vorbis_info_residue0{
92 /* block-partitioned VQ coded straight residue */
96 /* first stage (lossless partitioning) */
97 int grouping; /* group n vectors */
98 int partitions; /* partition entries (per group) */
99 int groupspercode; /* groups per codeword */
100 int groupbook; /* huffbook for partitioning */
101 int secondstages[64]; /* expanded out to pointers in lookup */
102 int booklist[256]; /* list of second stage books */
104 } vorbis_info_residue0;
106 /* Mapping backend generic *****************************************/
108 void (*pack) (vorbis_info *,vorbis_info_mapping *,
110 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
111 vorbis_look_mapping *(*look) (vorbis_info *,vorbis_info_mode *,
112 vorbis_info_mapping *);
113 void (*free_info) (vorbis_info_mapping *);
114 void (*free_look) (vorbis_look_mapping *);
115 int (*forward) (struct vorbis_block *vb,vorbis_look_mapping *);
116 int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *);
117 } vorbis_func_mapping;
119 typedef struct vorbis_info_mapping0{
120 int submaps; /* <= 16 */
121 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
123 int timesubmap[16]; /* [mux] */
124 int floorsubmap[16]; /* [mux] submap to floors */
125 int residuesubmap[16]; /* [mux] submap to residue */
126 int psysubmap[16]; /* [mux]; encode only */
127 } vorbis_info_mapping0;