Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-codec/ipp_codecs.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __PJMEDIA_CODECS_IPP_H__
20 #define __PJMEDIA_CODECS_IPP_H__
21
22 /**
23 * @file pjmedia-codec/ipp_codecs.h
24 * @brief IPP codecs wrapper.
25 */
26
27 #include <pjmedia-codec/types.h>
28
29 /**
30 * @defgroup PJMED_IPP_CODEC IPP Codecs
31 * @ingroup PJMEDIA_CODEC_CODECS
32 * @brief Implementation of IPP codecs
33 * @{
34 *
35 * This section describes functions to initialize and register IPP codec
36 * factory to the codec manager. After the codec factory has been registered,
37 * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
38 *
39 * This codec factory contains various codecs, i.e: G.729, G.723.1, G.726,
40 * G.728, G.722.1, AMR, and AMR-WB.
41 *
42 *
43 * \section pjmedia_codec_ipp_g729 IPP G.729
44 *
45 * IPP G.729 is compliant with ITU-T G.729 and Annexes A, B, C, C+, D,
46 * E, I specifications. However, currently the pjmedia implementation is
47 * using Annexes A and B only.
48 *
49 * IPP G.729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
50 * frame length 10ms, and resulting in bitrate 8000bps (annexes D and E
51 * introduce bitrates 6400bps and 11800bps).
52 *
53 * \subsection ipp_g729_codec_setting Codec Settings
54 *
55 * General codec settings for this codec such as VAD and PLC can be
56 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
57 * Please see the documentation of #pjmedia_codec_param for more info.
58 *
59 * Note that G.729 VAD status should be signalled in SDP, see more
60 * description below.
61 *
62 * \subsubsection ipp_g729_annexb Annex B
63 *
64 * The capability of VAD/DTX is specified in Annex B.
65 *
66 * By default, Annex B is enabled. This default setting of Annex B can
67 * be modified using #pjmedia_codec_mgr_set_default_param().
68 *
69 * In #pjmedia_codec_param, Annex B is configured via VAD setting and
70 * format parameter "annexb" in the SDP "a=fmtp" attribute in
71 * decoding fmtp field. Valid values are "yes" and "no",
72 * the implementation default is "yes". When this parameter is omitted
73 * in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
74 *
75 * Here is an example of modifying default setting of Annex B to
76 * be disabled using #pjmedia_codec_mgr_set_default_param():
77 \code
78 pjmedia_codec_param param;
79
80 pjmedia_codec_mgr_get_default_param(.., &param);
81 ...
82 // Set VAD
83 param.setting.vad = 0;
84 // Set SDP format parameter
85 param.setting.dec_fmtp.cnt = 1;
86 param.setting.dec_fmtp.param[0].name = pj_str("annexb");
87 param.setting.dec_fmtp.param[0].val = pj_str("no");
88 ...
89 pjmedia_codec_mgr_set_default_param(.., &param);
90 \endcode
91 *
92 * \note
93 * The difference of Annex B status in SDP offer/answer may be considered as
94 * incompatible codec in SDP negotiation.
95 *
96 *
97 * \section pjmedia_codec_ipp_g7231 IPP G.723.1
98 *
99 * IPP G.723.1 speech codec is compliant with ITU-T G.723.1 and Annex A
100 * specifications.
101 *
102 * IPP G.723.1 supports 16-bit PCM audio signal with sampling rate 8000Hz,
103 * frame length 30ms, and resulting in bitrates 5300bps and 6300bps.
104 *
105 * By default, pjmedia implementation uses encoding bitrate of 6300bps.
106 * The bitrate is signalled in-band in G.723.1 frames and interoperable.
107 *
108 * \subsection ipp_g723_codec_setting Codec Settings
109 *
110 * General codec settings for this codec such as VAD and PLC can be
111 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
112 * Please see the documentation of #pjmedia_codec_param for more info.
113 *
114 *
115 * \section pjmedia_codec_ipp_g726 IPP G.726
116 *
117 * IPP G.726 is compliant with ITU-T G.726 and G.726 Annex A specifications.
118 *
119 * IPP G.726 supports 16-bit PCM audio signal with sampling rate 8000Hz,
120 * 10ms frame length and producing 16kbps, 24kbps, 32kbps, 48kbps bitrates.
121 * The bitrate is specified explicitly in its encoding name, i.e: G726-16,
122 * G726-24, G726-32, G726-48.
123 *
124 * \subsection ipp_g726_codec_setting Codec Settings
125 *
126 * General codec settings for this codec such as VAD and PLC can be
127 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
128 * Please see the documentation of #pjmedia_codec_param for more info.
129 *
130 *
131 * \section pjmedia_codec_ipp_g728 IPP G.728
132 *
133 * IPP G.728 is compliant with ITU-T G.728 with I, G, H Appendixes
134 * specifications for Low-Delay CELP coder.
135 *
136 * IPP G.728 supports 16-bit PCM audio signal with sampling rate 8000Hz,
137 * 20ms frame length and producing 9.6kbps, 12.8kbps, and 16kbps bitrates.
138 *
139 * The pjmedia implementation currently uses 16kbps bitrate only.
140 *
141 * \subsection ipp_g728_codec_setting Codec Settings
142 *
143 * General codec settings for this codec such as VAD and PLC can be
144 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
145 * Please see the documentation of #pjmedia_codec_param for more info.
146 *
147 *
148 * \section pjmedia_codec_ipp_g7221 IPP G.722.1
149 *
150 * The pjmedia implementation of IPP G.722.1 supports 16-bit PCM audio
151 * signal with sampling rate 16000Hz, 20ms frame length and producing
152 * 16kbps, 24kbps, and 32kbps bitrates.
153 *
154 * \subsection ipp_g7221_codec_setting Codec Settings
155 *
156 * General codec settings for this codec such as VAD and PLC can be
157 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
158 * Please see the documentation of #pjmedia_codec_param for more info.
159 *
160 * \subsubsection ipp_g7221_bitrate Bitrate
161 *
162 * The codec implementation supports only standard bitrates, i.e:
163 * 24kbps and 32kbps. Both are enabled by default.
164 *
165 * \remark
166 * There is a flaw in the codec manager as currently it could not
167 * differentiate G.722.1 codecs by bitrates, hence invoking
168 * #pjmedia_codec_mgr_set_default_param() may only affect a G.722.1 codec
169 * with the highest priority (or first index found in codec enumeration
170 * when they have same priority) and invoking
171 * #pjmedia_codec_mgr_set_codec_priority() will set priority of all G.722.1
172 * codecs with sampling rate as specified.
173 *
174 *
175 * \section pjmedia_codec_ipp_amr IPP AMR
176 *
177 * The IPP AMR is compliant with GSM06.90-94 specifications for GSM Adaptive
178 * Multi-Rate codec.
179 *
180 * IPP AMR supports 16-bit PCM audio signal with sampling rate 8000Hz,
181 * 20ms frame length and producing various bitrates that ranges from 4.75kbps
182 * to 12.2kbps.
183 *
184 * \subsection ipp_amr_codec_setting Codec Settings
185 *
186 * General codec settings for this codec such as VAD and PLC can be
187 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
188 * Please see the documentation of #pjmedia_codec_param for more info.
189 *
190 * \subsubsection ipp_amr_bitrate Bitrate
191 *
192 * By default, encoding bitrate is 7400bps. This default setting can be
193 * modified using #pjmedia_codec_mgr_set_default_param() by specifying
194 * prefered AMR bitrate in field <tt>info::avg_bps</tt> of
195 * #pjmedia_codec_param. Valid bitrates could be seen in
196 * #pjmedia_codec_amrnb_bitrates.
197 *
198 * \subsubsection ipp_amr_payload_format Payload Format
199 *
200 * There are two AMR payload format types, bandwidth-efficient and
201 * octet-aligned. Default setting is using octet-aligned. This default payload
202 * format can be modified using #pjmedia_codec_mgr_set_default_param().
203 *
204 * In #pjmedia_codec_param, payload format can be set by specifying SDP
205 * format parameters "octet-align" in the SDP "a=fmtp" attribute for
206 * decoding direction. Valid values are "0" (for bandwidth efficient mode)
207 * and "1" (for octet-aligned mode).
208 *
209 * \subsubsection ipp_amr_mode_set Mode-Set
210 *
211 * Mode-set is used for restricting AMR modes in decoding direction.
212 *
213 * By default, no mode-set restriction applied. This default setting can be
214 * be modified using #pjmedia_codec_mgr_set_default_param().
215 *
216 * In #pjmedia_codec_param, mode-set could be specified via format parameters
217 * "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
218 * value is a comma separated list of modes from the set 0 - 7, e.g:
219 * "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
220 *
221 * Here is an example of modifying AMR default codec param:
222 \code
223 pjmedia_codec_param param;
224
225 pjmedia_codec_mgr_get_default_param(.., &param);
226 ...
227 // set default encoding bitrate to the highest 12.2kbps
228 param.info.avg_bps = 12200;
229
230 // restrict decoding bitrate to 10.2kbps and 12.2kbps only
231 param.setting.dec_fmtp.param[0].name = pj_str("mode-set");
232 param.setting.dec_fmtp.param[0].val = pj_str("6,7");
233
234 // also set to use bandwidth-efficient payload format
235 param.setting.dec_fmtp.param[1].name = pj_str("octet-align");
236 param.setting.dec_fmtp.param[1].val = pj_str("0");
237
238 param.setting.dec_fmtp.cnt = 2;
239 ...
240 pjmedia_codec_mgr_set_default_param(.., &param);
241 \endcode
242 *
243 *
244 * \section pjmedia_codec_ipp_amrwb IPP AMR-WB
245 *
246 * The IPP AMR-WB is compliant with 3GPP TS 26.190-192, 194, 201
247 * specifications for Adaptive Multi-Rate WideBand codec.
248 *
249 * IPP AMR-WB supports 16-bit PCM audio signal with sampling rate 16000Hz,
250 * 20ms frame length and producing various bitrates. Valid bitrates could be
251 * seen in #pjmedia_codec_amrwb_bitrates. The pjmedia implementation default
252 * bitrate is 15850bps.
253 *
254 * \subsection ipp_amrwb_codec_setting Codec Settings
255 *
256 * General codec settings for this codec such as VAD and PLC can be
257 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
258 * Please see the documentation of #pjmedia_codec_param for more info.
259 *
260 * \subsubsection ipp_amrwb_bitrate Bitrate
261 *
262 * By default, encoding bitrate is 15850bps. This default setting can be
263 * modified using #pjmedia_codec_mgr_set_default_param() by specifying
264 * prefered AMR bitrate in field <tt>info::avg_bps</tt> of
265 * #pjmedia_codec_param.
266 *
267 * \subsubsection ipp_amrwb_payload_format Payload Format
268 *
269 * There are two AMR payload format types, bandwidth-efficient and
270 * octet-aligned. Default setting is using octet-aligned. This default payload
271 * format can be modified using #pjmedia_codec_mgr_set_default_param().
272 *
273 * In #pjmedia_codec_param, payload format can be set by specifying SDP
274 * format parameters "octet-align" in the SDP "a=fmtp" attribute for
275 * decoding direction. Valid values are "0" (for bandwidth efficient mode)
276 * and "1" (for octet-aligned mode).
277 *
278 * \subsubsection ipp_amrwb_mode_set Mode-Set
279 *
280 * Mode-set is used for restricting AMR modes in decoding direction.
281 *
282 * By default, no mode-set restriction applied. This default setting can be
283 * be modified using #pjmedia_codec_mgr_set_default_param().
284 *
285 * In #pjmedia_codec_param, mode-set could be specified via format parameters
286 * "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
287 * value is a comma separated list of modes from the set 0 - 7, e.g:
288 * "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
289 */
290
291 PJ_BEGIN_DECL
292
293
294 /**
295 * Initialize and register IPP codecs factory to pjmedia endpoint.
296 *
297 * @param endpt The pjmedia endpoint.
298 *
299 * @return PJ_SUCCESS on success.
300 */
301 PJ_DECL(pj_status_t) pjmedia_codec_ipp_init( pjmedia_endpt *endpt );
302
303
304 /**
305 * Unregister IPP codecs factory from pjmedia endpoint and deinitialize
306 * the IPP codecs library.
307 *
308 * @return PJ_SUCCESS on success.
309 */
310 PJ_DECL(pj_status_t) pjmedia_codec_ipp_deinit(void);
311
312
313 PJ_END_DECL
314
315
316 /**
317 * @}
318 */
319
320 #endif /* __PJMEDIA_CODECS_IPP_H__ */
321