1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: libvorbis backend and mapping structures; needed for
15 last mod: $Id: backends.h,v 1.6 2001/02/26 03:50:41 xiphmont Exp $
17 ********************************************************************/
19 /* this is exposed up here because we need it for static modes.
20 Lookups for each backend aren't exposed because there's no reason
23 #ifndef _vorbis_backend_h_
24 #define _vorbis_backend_h_
26 #include "codec_internal.h"
28 /* this would all be simpler/shorter with templates, but.... */
29 /* Transform backend generic *************************************/
31 /* only mdct right now. Flesh it out more if we ever transcend mdct
32 in the transform domain */
34 /* Time backend generic ******************************************/
36 void (*pack) (vorbis_info_time *,oggpack_buffer *);
37 vorbis_info_time *(*unpack)(vorbis_info *,oggpack_buffer *);
38 vorbis_look_time *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
40 vorbis_info_time *(*copy_info)(vorbis_info_time *);
42 void (*free_info) (vorbis_info_time *);
43 void (*free_look) (vorbis_look_time *);
44 int (*forward) (struct vorbis_block *,vorbis_look_time *,
46 int (*inverse) (struct vorbis_block *,vorbis_look_time *,
54 /* Floor backend generic *****************************************/
56 void (*pack) (vorbis_info_floor *,oggpack_buffer *);
57 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
58 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
60 vorbis_info_floor *(*copy_info)(vorbis_info_floor *);
61 void (*free_info) (vorbis_info_floor *);
62 void (*free_look) (vorbis_look_floor *);
63 int (*forward) (struct vorbis_block *,vorbis_look_floor *,
65 int (*inverse) (struct vorbis_block *,vorbis_look_floor *,
77 int numbooks; /* <= 16 */
80 float lessthan; /* encode-only config setting hacks for libvorbis */
81 float greaterthan; /* encode-only config setting hacks for libvorbis */
85 /* Residue backend generic *****************************************/
87 void (*pack) (vorbis_info_residue *,oggpack_buffer *);
88 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
89 vorbis_look_residue *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
90 vorbis_info_residue *);
91 vorbis_info_residue *(*copy_info)(vorbis_info_residue *);
92 void (*free_info) (vorbis_info_residue *);
93 void (*free_look) (vorbis_look_residue *);
94 int (*forward) (struct vorbis_block *,vorbis_look_residue *,
96 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
98 } vorbis_func_residue;
100 typedef struct vorbis_info_residue0{
101 /* block-partitioned VQ coded straight residue */
105 /* first stage (lossless partitioning) */
106 int grouping; /* group n vectors per partition */
107 int partitions; /* possible codebooks for a partition */
108 int groupbook; /* huffbook for partitioning */
109 int secondstages[64]; /* expanded out to pointers in lookup */
110 int booklist[256]; /* list of second stage books */
112 /* encode-only heuristic settings */
113 float entmax[64]; /* book entropy threshholds*/
114 float ampmax[64]; /* book amp threshholds*/
115 int subgrp[64]; /* book heuristic subgroup size */
116 int blimit[64]; /* subgroup position limits */
118 } vorbis_info_residue0;
120 /* Mapping backend generic *****************************************/
122 void (*pack) (vorbis_info *,vorbis_info_mapping *,
124 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
125 vorbis_look_mapping *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
126 vorbis_info_mapping *);
127 vorbis_info_mapping *(*copy_info)(vorbis_info_mapping *);
128 void (*free_info) (vorbis_info_mapping *);
129 void (*free_look) (vorbis_look_mapping *);
130 int (*forward) (struct vorbis_block *vb,vorbis_look_mapping *);
131 int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *);
132 } vorbis_func_mapping;
134 typedef struct vorbis_info_mapping0{
135 int submaps; /* <= 16 */
136 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
138 int timesubmap[16]; /* [mux] */
139 int floorsubmap[16]; /* [mux] submap to floors */
140 int residuesubmap[16]; /* [mux] submap to residue */
141 int psysubmap[16]; /* [mux]; encode only */
142 } vorbis_info_mapping0;