Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / media / libvorbis / lib / backends.h
blob670b0b902ebda71b6800fba725032e8f57077b2c
1 /********************************************************************
2 * *
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. *
7 * *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
9 * by the Xiph.Org Foundation https://xiph.org/ *
10 * *
11 ********************************************************************
13 function: libvorbis backend and mapping structures; needed for
14 static mode headers
16 ********************************************************************/
18 /* this is exposed up here because we need it for static modes.
19 Lookups for each backend aren't exposed because there's no reason
20 to do so */
22 #ifndef _vorbis_backend_h_
23 #define _vorbis_backend_h_
25 #include "codec_internal.h"
27 /* this would all be simpler/shorter with templates, but.... */
28 /* Floor backend generic *****************************************/
29 typedef struct{
30 void (*pack) (vorbis_info_floor *,oggpack_buffer *);
31 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
32 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *);
33 void (*free_info) (vorbis_info_floor *);
34 void (*free_look) (vorbis_look_floor *);
35 void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
36 int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
37 void *buffer,float *);
38 } vorbis_func_floor;
40 typedef struct{
41 int order;
42 long rate;
43 long barkmap;
45 int ampbits;
46 int ampdB;
48 int numbooks; /* <= 16 */
49 int books[16];
51 float lessthan; /* encode-only config setting hacks for libvorbis */
52 float greaterthan; /* encode-only config setting hacks for libvorbis */
54 } vorbis_info_floor0;
57 #define VIF_POSIT 63
58 #define VIF_CLASS 16
59 #define VIF_PARTS 31
60 typedef struct{
61 int partitions; /* 0 to 31 */
62 int partitionclass[VIF_PARTS]; /* 0 to 15 */
64 int class_dim[VIF_CLASS]; /* 1 to 8 */
65 int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
66 int class_book[VIF_CLASS]; /* subs ^ dim entries */
67 int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
70 int mult; /* 1 2 3 or 4 */
71 int postlist[VIF_POSIT+2]; /* first two implicit */
74 /* encode side analysis parameters */
75 float maxover;
76 float maxunder;
77 float maxerr;
79 float twofitweight;
80 float twofitatten;
82 int n;
84 } vorbis_info_floor1;
86 /* Residue backend generic *****************************************/
87 typedef struct{
88 void (*pack) (vorbis_info_residue *,oggpack_buffer *);
89 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
90 vorbis_look_residue *(*look) (vorbis_dsp_state *,
91 vorbis_info_residue *);
92 void (*free_info) (vorbis_info_residue *);
93 void (*free_look) (vorbis_look_residue *);
94 long **(*class) (struct vorbis_block *,vorbis_look_residue *,
95 int **,int *,int);
96 int (*forward) (oggpack_buffer *,struct vorbis_block *,
97 vorbis_look_residue *,
98 int **,int *,int,long **,int);
99 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
100 float **,int *,int);
101 } vorbis_func_residue;
103 typedef struct vorbis_info_residue0{
104 /* block-partitioned VQ coded straight residue */
105 long begin;
106 long end;
108 /* first stage (lossless partitioning) */
109 int grouping; /* group n vectors per partition */
110 int partitions; /* possible codebooks for a partition */
111 int partvals; /* partitions ^ groupbook dim */
112 int groupbook; /* huffbook for partitioning */
113 int secondstages[64]; /* expanded out to pointers in lookup */
114 int booklist[512]; /* list of second stage books */
116 const int classmetric1[64];
117 const int classmetric2[64];
118 } vorbis_info_residue0;
120 /* Mapping backend generic *****************************************/
121 typedef struct{
122 void (*pack) (vorbis_info *,vorbis_info_mapping *,
123 oggpack_buffer *);
124 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
125 void (*free_info) (vorbis_info_mapping *);
126 int (*forward) (struct vorbis_block *vb);
127 int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *);
128 } vorbis_func_mapping;
130 typedef struct vorbis_info_mapping0{
131 int submaps; /* <= 16 */
132 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
134 int floorsubmap[16]; /* [mux] submap to floors */
135 int residuesubmap[16]; /* [mux] submap to residue */
137 int coupling_steps;
138 int coupling_mag[256];
139 int coupling_ang[256];
141 } vorbis_info_mapping0;
143 #endif