1
/* $Id: silk.h 4264 2012-09-24 06:58:16Z nanang $ */
3
* Copyright (C) 2012-2012 Teluu Inc. (http://www.teluu.com)
4
* Contributed by Regis Montoya (aka r3gis - www.r3gis.fr)
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_CODEC_SILK_H__
21
#define __PJMEDIA_CODEC_SILK_H__
28
#include <pjmedia-codec/types.h>
31
* @defgroup PJMED_SILK SILK Codec Family
32
* @ingroup PJMEDIA_CODEC_CODECS
33
* @brief Implementation of SILK codecs (narrow/medium/wide/superwide-band).
36
* This section describes functions to initialize and register SILK 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
* The SILK codec uses multiple bit rates, and supports super wideband
41
* (24 kHz sampling rate), wideband (16 kHz sampling rate), medium (12kHz
42
* sampling rate), and narrowband (telephone quality, 8 kHz sampling rate).
44
* By default, the SILK codec factory registers two SILK codecs:
45
* "SILK/8000" narrowband codec and "SILK/16000" wideband codec. This behavior
46
* can be changed by specifying #pjmedia_codec_silk_options flags during
50
* \section codec_setting Codec Settings
52
* \subsection general_setting General Settings
54
* General codec settings for this codec such as VAD and PLC can be
55
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
56
* Please see the documentation of #pjmedia_codec_param for more info.
58
* \subsection specific_setting Codec Specific Settings
60
* The following settings are applicable for this codec.
62
* \subsubsection quality_vs_complexity Quality vs Complexity
64
* The SILK codec quality versus computational complexity and bandwidth
65
* requirement can be adjusted by modifying the quality and complexity
66
* setting, by calling #pjmedia_codec_silk_set_config().
68
* The default setting of quality is specified in
69
* #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY. And the default setting of
70
* complexity is specified in #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY.
75
typedef struct pjmedia_codec_silk_setting
77
pj_bool_t enabled; /**< Enable/disable. */
78
int quality; /**< Encoding quality, or use -1 for default
79
(@see PJMEDIA_CODEC_SILK_DEFAULT_QUALITY). */
80
int complexity; /**< Encoding complexity, or use -1 for default
81
(@see PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY)*/
82
} pjmedia_codec_silk_setting;
86
* Initialize and register SILK codec factory to pjmedia endpoint. By default,
87
* only narrowband (8kHz sampling rate) and wideband (16kHz sampling rate)
88
* will be enabled. Quality and complexity for those sampling rate modes
89
* will be set to the default values (see #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY
90
* and #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY), application may modify these
91
* settings via #pjmedia_codec_silk_set_config().
93
* @param endpt The pjmedia endpoint.
95
* @return PJ_SUCCESS on success.
97
PJ_DECL(pj_status_t) pjmedia_codec_silk_init(pjmedia_endpt *endpt);
101
* Change the configuration setting of the SILK codec for the specified
104
* @param clock_rate PCM sampling rate, in Hz, valid values are 8000,
105
* 12000, 16000 and 24000.
106
* @param opt The setting to be applied for the specified
109
* @return PJ_SUCCESS on success.
111
PJ_DECL(pj_status_t) pjmedia_codec_silk_set_config(
113
const pjmedia_codec_silk_setting *opt);
117
* Unregister SILK codec factory from pjmedia endpoint and deinitialize
118
* the SILK codec library.
120
* @return PJ_SUCCESS on success.
122
PJ_DECL(pj_status_t) pjmedia_codec_silk_deinit(void);
132
#endif /* __PJMEDIA_CODEC_SILK_H__ */