Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
compress_params.h
Go to the documentation of this file.
1 /*
2  * compress_params.h - codec types and parameters for compressed data
3  * streaming interface
4  *
5  * Copyright (C) 2011 Intel Corporation
6  * Authors: Pierre-Louis Bossart <[email protected]>
7  * Vinod Koul <[email protected]>
8  *
9  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; version 2 of the License.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23  *
24  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25  *
26  * The definitions in this file are derived from the OpenMAX AL version 1.1
27  * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
28  *
29  * Copyright (c) 2007-2010 The Khronos Group Inc.
30  *
31  * Permission is hereby granted, free of charge, to any person obtaining
32  * a copy of this software and/or associated documentation files (the
33  * "Materials "), to deal in the Materials without restriction, including
34  * without limitation the rights to use, copy, modify, merge, publish,
35  * distribute, sublicense, and/or sell copies of the Materials, and to
36  * permit persons to whom the Materials are furnished to do so, subject to
37  * the following conditions:
38  *
39  * The above copyright notice and this permission notice shall be included
40  * in all copies or substantial portions of the Materials.
41  *
42  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
43  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
49  *
50  */
51 #ifndef __SND_COMPRESS_PARAMS_H
52 #define __SND_COMPRESS_PARAMS_H
53 
54 #include <linux/types.h>
55 
56 /* AUDIO CODECS SUPPORTED */
57 #define MAX_NUM_CODECS 32
58 #define MAX_NUM_CODEC_DESCRIPTORS 32
59 #define MAX_NUM_BITRATES 32
60 
61 /* Codecs are listed linearly to allow for extensibility */
62 #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
63 #define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
64 #define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
65 #define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
66 #define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
67 #define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
68 #define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
69 #define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
70 #define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
71 #define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
72 #define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
73 #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
74 #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
75 #define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729
76 
77 /*
78  * Profile and modes are listed with bit masks. This allows for a
79  * more compact representation of fields that will not evolve
80  * (in contrast to the list of codecs)
81  */
82 
83 #define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
84 
85 /* MP3 modes are only useful for encoders */
86 #define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
87 #define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
88 #define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
89 #define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
90 
91 #define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
92 
93 /* AMR modes are only useful for encoders */
94 #define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
95 #define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
96 #define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
97 
98 #define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
99 #define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
100 #define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
101 #define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
102 #define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
103 #define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
104 #define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
105 
106 #define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
107 
108 /* AMRWB modes are only useful for encoders */
109 #define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
110 #define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
111 #define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
112 
113 #define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
114 
115 #define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
116 
117 /* AAC modes are required for encoders and decoders */
118 #define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
119 #define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
120 #define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
121 #define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
122 #define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
123 #define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
124 #define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
125 #define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
126 #define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
127 #define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
128 
129 /* AAC formats are required for encoders and decoders */
130 #define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
131 #define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
132 #define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
133 #define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
134 #define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
135 #define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
136 #define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
137 
138 #define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
139 #define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
140 #define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
141 #define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
142 
143 #define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
144 #define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
145 #define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
146 #define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
147 #define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
148 #define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
149 #define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
150 #define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
151 
152 #define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
153 /*
154  * Some implementations strip the ASF header and only send ASF packets
155  * to the DSP
156  */
157 #define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
158 
159 #define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
160 
161 #define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
162 #define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
163 #define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
164 #define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
165 
166 #define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
167 
168 #define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
169 
170 #define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
171 
172 /*
173  * Define quality levels for FLAC encoders, from LEVEL0 (fast)
174  * to LEVEL8 (best)
175  */
176 #define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
177 #define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
178 #define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
179 #define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
180 #define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
181 #define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
182 #define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
183 #define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
184 #define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
185 
186 #define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
187 #define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
188 
189 /* IEC61937 payloads without CUVP and preambles */
190 #define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
191 /* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
192 #define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
193 
194 /*
195  * IEC modes are mandatory for decoders. Format autodetection
196  * will only happen on the DSP side with mode 0. The PCM mode should
197  * not be used, the PCM codec should be used instead.
198  */
199 #define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
200 #define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
201 #define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
202 #define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
203 #define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
204 #define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
205 #define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
206 #define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
207 #define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
208 #define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
209 #define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
210 #define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
211 #define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
212 #define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
213 #define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
214 #define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
215 #define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
216 #define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
217 #define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
218 
219 #define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
220 
221 #define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
222 #define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
223 #define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
224 
225 #define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
226 
227 #define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
228 #define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
229 
230 /* <FIXME: multichannel encoders aren't supported for now. Would need
231  an additional definition of channel arrangement> */
232 
233 /* VBR/CBR definitions */
234 #define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
235 #define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
236 
237 /* Encoder options */
238 
239 struct snd_enc_wma {
240  __u32 super_block_align; /* WMA Type-specific data */
241 };
242 
243 
270 };
271 
272 
282 struct snd_enc_real {
286 };
287 
307 struct snd_enc_flac {
310 };
311 
313  __u32 bw; /* encoder bandwidth */
315 };
316 
318  struct snd_enc_wma wma;
323 };
324 
358 };
359 
384 struct snd_codec {
398 };
399 
400 #endif