rev |
line source |
nuclear@0
|
1 /********************************************************************
|
nuclear@0
|
2 * *
|
nuclear@0
|
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
nuclear@0
|
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
nuclear@0
|
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
nuclear@0
|
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
nuclear@0
|
7 * *
|
nuclear@0
|
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
|
nuclear@0
|
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
|
nuclear@0
|
10 * *
|
nuclear@0
|
11 ********************************************************************
|
nuclear@0
|
12
|
nuclear@0
|
13 function: libvorbis backend and mapping structures; needed for
|
nuclear@0
|
14 static mode headers
|
nuclear@0
|
15 last mod: $Id: backends.h 16962 2010-03-11 07:30:34Z xiphmont $
|
nuclear@0
|
16
|
nuclear@0
|
17 ********************************************************************/
|
nuclear@0
|
18
|
nuclear@0
|
19 /* this is exposed up here because we need it for static modes.
|
nuclear@0
|
20 Lookups for each backend aren't exposed because there's no reason
|
nuclear@0
|
21 to do so */
|
nuclear@0
|
22
|
nuclear@0
|
23 #ifndef _vorbis_backend_h_
|
nuclear@0
|
24 #define _vorbis_backend_h_
|
nuclear@0
|
25
|
nuclear@0
|
26 #include "codec_internal.h"
|
nuclear@0
|
27
|
nuclear@0
|
28 /* this would all be simpler/shorter with templates, but.... */
|
nuclear@0
|
29 /* Floor backend generic *****************************************/
|
nuclear@0
|
30 typedef struct{
|
nuclear@0
|
31 void (*pack) (vorbis_info_floor *,oggpack_buffer *);
|
nuclear@0
|
32 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
|
nuclear@0
|
33 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *);
|
nuclear@0
|
34 void (*free_info) (vorbis_info_floor *);
|
nuclear@0
|
35 void (*free_look) (vorbis_look_floor *);
|
nuclear@0
|
36 void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
|
nuclear@0
|
37 int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
|
nuclear@0
|
38 void *buffer,float *);
|
nuclear@0
|
39 } vorbis_func_floor;
|
nuclear@0
|
40
|
nuclear@0
|
41 typedef struct{
|
nuclear@0
|
42 int order;
|
nuclear@0
|
43 long rate;
|
nuclear@0
|
44 long barkmap;
|
nuclear@0
|
45
|
nuclear@0
|
46 int ampbits;
|
nuclear@0
|
47 int ampdB;
|
nuclear@0
|
48
|
nuclear@0
|
49 int numbooks; /* <= 16 */
|
nuclear@0
|
50 int books[16];
|
nuclear@0
|
51
|
nuclear@0
|
52 float lessthan; /* encode-only config setting hacks for libvorbis */
|
nuclear@0
|
53 float greaterthan; /* encode-only config setting hacks for libvorbis */
|
nuclear@0
|
54
|
nuclear@0
|
55 } vorbis_info_floor0;
|
nuclear@0
|
56
|
nuclear@0
|
57
|
nuclear@0
|
58 #define VIF_POSIT 63
|
nuclear@0
|
59 #define VIF_CLASS 16
|
nuclear@0
|
60 #define VIF_PARTS 31
|
nuclear@0
|
61 typedef struct{
|
nuclear@0
|
62 int partitions; /* 0 to 31 */
|
nuclear@0
|
63 int partitionclass[VIF_PARTS]; /* 0 to 15 */
|
nuclear@0
|
64
|
nuclear@0
|
65 int class_dim[VIF_CLASS]; /* 1 to 8 */
|
nuclear@0
|
66 int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
|
nuclear@0
|
67 int class_book[VIF_CLASS]; /* subs ^ dim entries */
|
nuclear@0
|
68 int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
|
nuclear@0
|
69
|
nuclear@0
|
70
|
nuclear@0
|
71 int mult; /* 1 2 3 or 4 */
|
nuclear@0
|
72 int postlist[VIF_POSIT+2]; /* first two implicit */
|
nuclear@0
|
73
|
nuclear@0
|
74
|
nuclear@0
|
75 /* encode side analysis parameters */
|
nuclear@0
|
76 float maxover;
|
nuclear@0
|
77 float maxunder;
|
nuclear@0
|
78 float maxerr;
|
nuclear@0
|
79
|
nuclear@0
|
80 float twofitweight;
|
nuclear@0
|
81 float twofitatten;
|
nuclear@0
|
82
|
nuclear@0
|
83 int n;
|
nuclear@0
|
84
|
nuclear@0
|
85 } vorbis_info_floor1;
|
nuclear@0
|
86
|
nuclear@0
|
87 /* Residue backend generic *****************************************/
|
nuclear@0
|
88 typedef struct{
|
nuclear@0
|
89 void (*pack) (vorbis_info_residue *,oggpack_buffer *);
|
nuclear@0
|
90 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
|
nuclear@0
|
91 vorbis_look_residue *(*look) (vorbis_dsp_state *,
|
nuclear@0
|
92 vorbis_info_residue *);
|
nuclear@0
|
93 void (*free_info) (vorbis_info_residue *);
|
nuclear@0
|
94 void (*free_look) (vorbis_look_residue *);
|
nuclear@0
|
95 long **(*class) (struct vorbis_block *,vorbis_look_residue *,
|
nuclear@0
|
96 int **,int *,int);
|
nuclear@0
|
97 int (*forward) (oggpack_buffer *,struct vorbis_block *,
|
nuclear@0
|
98 vorbis_look_residue *,
|
nuclear@0
|
99 int **,int *,int,long **,int);
|
nuclear@0
|
100 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
|
nuclear@0
|
101 float **,int *,int);
|
nuclear@0
|
102 } vorbis_func_residue;
|
nuclear@0
|
103
|
nuclear@0
|
104 typedef struct vorbis_info_residue0{
|
nuclear@0
|
105 /* block-partitioned VQ coded straight residue */
|
nuclear@0
|
106 long begin;
|
nuclear@0
|
107 long end;
|
nuclear@0
|
108
|
nuclear@0
|
109 /* first stage (lossless partitioning) */
|
nuclear@0
|
110 int grouping; /* group n vectors per partition */
|
nuclear@0
|
111 int partitions; /* possible codebooks for a partition */
|
nuclear@0
|
112 int partvals; /* partitions ^ groupbook dim */
|
nuclear@0
|
113 int groupbook; /* huffbook for partitioning */
|
nuclear@0
|
114 int secondstages[64]; /* expanded out to pointers in lookup */
|
nuclear@0
|
115 int booklist[512]; /* list of second stage books */
|
nuclear@0
|
116
|
nuclear@0
|
117 const int classmetric1[64];
|
nuclear@0
|
118 const int classmetric2[64];
|
nuclear@0
|
119 } vorbis_info_residue0;
|
nuclear@0
|
120
|
nuclear@0
|
121 /* Mapping backend generic *****************************************/
|
nuclear@0
|
122 typedef struct{
|
nuclear@0
|
123 void (*pack) (vorbis_info *,vorbis_info_mapping *,
|
nuclear@0
|
124 oggpack_buffer *);
|
nuclear@0
|
125 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
|
nuclear@0
|
126 void (*free_info) (vorbis_info_mapping *);
|
nuclear@0
|
127 int (*forward) (struct vorbis_block *vb);
|
nuclear@0
|
128 int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *);
|
nuclear@0
|
129 } vorbis_func_mapping;
|
nuclear@0
|
130
|
nuclear@0
|
131 typedef struct vorbis_info_mapping0{
|
nuclear@0
|
132 int submaps; /* <= 16 */
|
nuclear@0
|
133 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
|
nuclear@0
|
134
|
nuclear@0
|
135 int floorsubmap[16]; /* [mux] submap to floors */
|
nuclear@0
|
136 int residuesubmap[16]; /* [mux] submap to residue */
|
nuclear@0
|
137
|
nuclear@0
|
138 int coupling_steps;
|
nuclear@0
|
139 int coupling_mag[256];
|
nuclear@0
|
140 int coupling_ang[256];
|
nuclear@0
|
141
|
nuclear@0
|
142 } vorbis_info_mapping0;
|
nuclear@0
|
143
|
nuclear@0
|
144 #endif
|