1
/* $Id: ipp_codecs.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_CODECS_IPP_H__
21
#define __PJMEDIA_CODECS_IPP_H__
24
* @file pjmedia-codec/ipp_codecs.h
25
* @brief IPP codecs wrapper.
28
#include <pjmedia-codec/types.h>
31
* @defgroup PJMED_IPP_CODEC IPP Codecs
32
* @ingroup PJMEDIA_CODEC_CODECS
33
* @brief Implementation of IPP codecs
36
* This section describes functions to initialize and register IPP codec
37
* factory to the codec manager. After the codec factory has been registered,
38
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
40
* This codec factory contains various codecs, i.e: G.729, G.723.1, G.726,
41
* G.728, G.722.1, AMR, and AMR-WB.
44
* \section pjmedia_codec_ipp_g729 IPP G.729
46
* IPP G.729 is compliant with ITU-T G.729 and Annexes A, B, C, C+, D,
47
* E, I specifications. However, currently the pjmedia implementation is
48
* using Annexes A and B only.
50
* IPP G.729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
51
* frame length 10ms, and resulting in bitrate 8000bps (annexes D and E
52
* introduce bitrates 6400bps and 11800bps).
54
* \subsection codec_setting Codec Settings
56
* General codec settings for this codec such as VAD and PLC can be
57
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
58
* Please see the documentation of #pjmedia_codec_param for more info.
60
* Note that G.729 VAD status should be signalled in SDP, see more
63
* \subsubsection annexb Annex B
65
* The capability of VAD/DTX is specified in Annex B.
67
* By default, Annex B is enabled. This default setting of Annex B can
68
* be modified using #pjmedia_codec_mgr_set_default_param().
70
* In #pjmedia_codec_param, Annex B is configured via VAD setting and
71
* format parameter "annexb" in the SDP "a=fmtp" attribute in
72
* decoding fmtp field. Valid values are "yes" and "no",
73
* the implementation default is "yes". When this parameter is omitted
74
* in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
76
* Here is an example of modifying default setting of Annex B to
77
* be disabled using #pjmedia_codec_mgr_set_default_param():
79
pjmedia_codec_param param;
81
pjmedia_codec_mgr_get_default_param(.., ¶m);
84
param.setting.vad = 0;
85
// Set SDP format parameter
86
param.setting.dec_fmtp.cnt = 1;
87
param.setting.dec_fmtp.param[0].name = pj_str("annexb");
88
param.setting.dec_fmtp.param[0].val = pj_str("no");
90
pjmedia_codec_mgr_set_default_param(.., ¶m);
94
* The difference of Annex B status in SDP offer/answer may be considered as
95
* incompatible codec in SDP negotiation.
98
* \section pjmedia_codec_ipp_g7231 IPP G.723.1
100
* IPP G.723.1 speech codec is compliant with ITU-T G.723.1 and Annex A
103
* IPP G.723.1 supports 16-bit PCM audio signal with sampling rate 8000Hz,
104
* frame length 30ms, and resulting in bitrates 5300bps and 6300bps.
106
* By default, pjmedia implementation uses encoding bitrate of 6300bps.
107
* The bitrate is signalled in-band in G.723.1 frames and interoperable.
109
* \subsection codec_setting Codec Settings
111
* General codec settings for this codec such as VAD and PLC can be
112
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
113
* Please see the documentation of #pjmedia_codec_param for more info.
116
* \section pjmedia_codec_ipp_g726 IPP G.726
118
* IPP G.726 is compliant with ITU-T G.726 and G.726 Annex A specifications.
120
* IPP G.726 supports 16-bit PCM audio signal with sampling rate 8000Hz,
121
* 10ms frame length and producing 16kbps, 24kbps, 32kbps, 48kbps bitrates.
122
* The bitrate is specified explicitly in its encoding name, i.e: G726-16,
123
* G726-24, G726-32, G726-48.
125
* \subsection codec_setting Codec Settings
127
* General codec settings for this codec such as VAD and PLC can be
128
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
129
* Please see the documentation of #pjmedia_codec_param for more info.
132
* \section pjmedia_codec_ipp_g728 IPP G.728
134
* IPP G.728 is compliant with ITU-T G.728 with I, G, H Appendixes
135
* specifications for Low-Delay CELP coder.
137
* IPP G.728 supports 16-bit PCM audio signal with sampling rate 8000Hz,
138
* 20ms frame length and producing 9.6kbps, 12.8kbps, and 16kbps bitrates.
140
* The pjmedia implementation currently uses 16kbps bitrate only.
142
* \subsection codec_setting Codec Settings
144
* General codec settings for this codec such as VAD and PLC can be
145
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
146
* Please see the documentation of #pjmedia_codec_param for more info.
149
* \section pjmedia_codec_ipp_g7221 IPP G.722.1
151
* The pjmedia implementation of IPP G.722.1 supports 16-bit PCM audio
152
* signal with sampling rate 16000Hz, 20ms frame length and producing
153
* 16kbps, 24kbps, and 32kbps bitrates.
155
* \subsection codec_setting Codec Settings
157
* General codec settings for this codec such as VAD and PLC can be
158
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
159
* Please see the documentation of #pjmedia_codec_param for more info.
161
* \subsubsection bitrate Bitrate
163
* The codec implementation supports only standard bitrates, i.e:
164
* 24kbps and 32kbps. Both are enabled by default.
167
* There is a flaw in the codec manager as currently it could not
168
* differentiate G.722.1 codecs by bitrates, hence invoking
169
* #pjmedia_codec_mgr_set_default_param() may only affect a G.722.1 codec
170
* with the highest priority (or first index found in codec enumeration
171
* when they have same priority) and invoking
172
* #pjmedia_codec_mgr_set_codec_priority() will set priority of all G.722.1
173
* codecs with sampling rate as specified.
176
* \section pjmedia_codec_ipp_amr IPP AMR
178
* The IPP AMR is compliant with GSM06.90-94 specifications for GSM Adaptive
181
* IPP AMR supports 16-bit PCM audio signal with sampling rate 8000Hz,
182
* 20ms frame length and producing various bitrates that ranges from 4.75kbps
185
* \subsection codec_setting Codec Settings
187
* General codec settings for this codec such as VAD and PLC can be
188
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
189
* Please see the documentation of #pjmedia_codec_param for more info.
191
* \subsubsection bitrate Bitrate
193
* By default, encoding bitrate is 7400bps. This default setting can be
194
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
195
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
196
* #pjmedia_codec_param. Valid bitrates could be seen in
197
* #pjmedia_codec_amrnb_bitrates.
199
* \subsubsection payload_format Payload Format
201
* There are two AMR payload format types, bandwidth-efficient and
202
* octet-aligned. Default setting is using octet-aligned. This default payload
203
* format can be modified using #pjmedia_codec_mgr_set_default_param().
205
* In #pjmedia_codec_param, payload format can be set by specifying SDP
206
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
207
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
208
* and "1" (for octet-aligned mode).
210
* \subsubsection mode_set Mode-Set
212
* Mode-set is used for restricting AMR modes in decoding direction.
214
* By default, no mode-set restriction applied. This default setting can be
215
* be modified using #pjmedia_codec_mgr_set_default_param().
217
* In #pjmedia_codec_param, mode-set could be specified via format parameters
218
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
219
* value is a comma separated list of modes from the set 0 - 7, e.g:
220
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
222
* Here is an example of modifying AMR default codec param:
224
pjmedia_codec_param param;
226
pjmedia_codec_mgr_get_default_param(.., ¶m);
228
// set default encoding bitrate to the highest 12.2kbps
229
param.info.avg_bps = 12200;
231
// restrict decoding bitrate to 10.2kbps and 12.2kbps only
232
param.setting.dec_fmtp.param[0].name = pj_str("mode-set");
233
param.setting.dec_fmtp.param[0].val = pj_str("6,7");
235
// also set to use bandwidth-efficient payload format
236
param.setting.dec_fmtp.param[1].name = pj_str("octet-align");
237
param.setting.dec_fmtp.param[1].val = pj_str("0");
239
param.setting.dec_fmtp.cnt = 2;
241
pjmedia_codec_mgr_set_default_param(.., ¶m);
245
* \section pjmedia_codec_ipp_amrwb IPP AMR-WB
247
* The IPP AMR-WB is compliant with 3GPP TS 26.190-192, 194, 201
248
* specifications for Adaptive Multi-Rate WideBand codec.
250
* IPP AMR-WB supports 16-bit PCM audio signal with sampling rate 16000Hz,
251
* 20ms frame length and producing various bitrates. Valid bitrates could be
252
* seen in #pjmedia_codec_amrwb_bitrates. The pjmedia implementation default
253
* bitrate is 15850bps.
255
* \subsection codec_setting Codec Settings
257
* General codec settings for this codec such as VAD and PLC can be
258
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
259
* Please see the documentation of #pjmedia_codec_param for more info.
261
* \subsubsection bitrate Bitrate
263
* By default, encoding bitrate is 15850bps. This default setting can be
264
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
265
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
266
* #pjmedia_codec_param.
268
* \subsubsection payload_format Payload Format
270
* There are two AMR payload format types, bandwidth-efficient and
271
* octet-aligned. Default setting is using octet-aligned. This default payload
272
* format can be modified using #pjmedia_codec_mgr_set_default_param().
274
* In #pjmedia_codec_param, payload format can be set by specifying SDP
275
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
276
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
277
* and "1" (for octet-aligned mode).
279
* \subsubsection mode_set Mode-Set
281
* Mode-set is used for restricting AMR modes in decoding direction.
283
* By default, no mode-set restriction applied. This default setting can be
284
* be modified using #pjmedia_codec_mgr_set_default_param().
286
* In #pjmedia_codec_param, mode-set could be specified via format parameters
287
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
288
* value is a comma separated list of modes from the set 0 - 7, e.g:
289
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
296
* Initialize and register IPP codecs factory to pjmedia endpoint.
298
* @param endpt The pjmedia endpoint.
300
* @return PJ_SUCCESS on success.
302
PJ_DECL(pj_status_t) pjmedia_codec_ipp_init( pjmedia_endpt *endpt );
306
* Unregister IPP codecs factory from pjmedia endpoint and deinitialize
307
* the IPP codecs library.
309
* @return PJ_SUCCESS on success.
311
PJ_DECL(pj_status_t) pjmedia_codec_ipp_deinit(void);
321
#endif /* __PJMEDIA_CODECS_IPP_H__ */