Debian Codegraph @

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

raw symbols SCIP
1 /*
2 * Copyright (C) 2012-2012 Teluu Inc. (http://www.teluu.com)
3 * Contributed by Regis Montoya (aka r3gis - www.r3gis.fr)
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_CODEC_SILK_H__
20 #define __PJMEDIA_CODEC_SILK_H__
21
22 /**
23 * @file silk.h
24 * @brief SILK codec.
25 */
26
27 #include <pjmedia-codec/types.h>
28
29 /**
30 * @defgroup PJMED_SILK SILK Codec Family
31 * @ingroup PJMEDIA_CODEC_CODECS
32 * @brief Implementation of SILK codecs (narrow/medium/wide/superwide-band).
33 * @{
34 *
35 * This section describes functions to initialize and register SILK 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 * The SILK codec uses multiple bit rates, and supports super wideband
40 * (24 kHz sampling rate), wideband (16 kHz sampling rate), medium (12kHz
41 * sampling rate), and narrowband (telephone quality, 8 kHz sampling rate).
42 *
43 * \section silk_codec_setting Codec Settings
44 *
45 * \subsection silk_general_setting General Settings
46 *
47 * General codec settings for this codec such as VAD and PLC can be
48 * manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
49 * Please see the documentation of #pjmedia_codec_param for more info.
50 *
51 * \subsection silk_specific_setting Codec Specific Settings
52 *
53 * The following settings are applicable for this codec.
54 *
55 * \subsubsection silk_quality_vs_complexity Quality vs Complexity
56 *
57 * The SILK codec quality versus computational complexity and bandwidth
58 * requirement can be adjusted by modifying the quality and complexity
59 * setting, by calling #pjmedia_codec_silk_set_config().
60 *
61 * The default setting of quality is specified in
62 * #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY. And the default setting of
63 * complexity is specified in #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY.
64 */
65
66 PJ_BEGIN_DECL
67
68 typedef struct pjmedia_codec_silk_setting
69 {
70 pj_bool_t enabled; /**< Enable/disable. */
71 int quality; /**< Encoding quality, or use -1 for default
72 (@see PJMEDIA_CODEC_SILK_DEFAULT_QUALITY). */
73 int complexity; /**< Encoding complexity, or use -1 for default
74 (@see PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY)*/
75 } pjmedia_codec_silk_setting;
76
77
78 /**
79 * Initialize and register SILK codec factory to pjmedia endpoint. By default,
80 * only narrowband (8kHz sampling rate) and wideband (16kHz sampling rate)
81 * will be enabled. Quality and complexity for those sampling rate modes
82 * will be set to the default values (see #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY
83 * and #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY), application may modify these
84 * settings via #pjmedia_codec_silk_set_config().
85 *
86 * @param endpt The pjmedia endpoint.
87 *
88 * @return PJ_SUCCESS on success.
89 */
90 PJ_DECL(pj_status_t) pjmedia_codec_silk_init(pjmedia_endpt *endpt);
91
92
93 /**
94 * Change the configuration setting of the SILK codec for the specified
95 * clock rate.
96 *
97 * @param clock_rate PCM sampling rate, in Hz, valid values are 8000,
98 * 12000, 16000 and 24000.
99 * @param opt The setting to be applied for the specified
100 * clock rate.
101 *
102 * @return PJ_SUCCESS on success.
103 */
104 PJ_DECL(pj_status_t) pjmedia_codec_silk_set_config(
105 unsigned clock_rate,
106 const pjmedia_codec_silk_setting *opt);
107
108
109 /**
110 * Unregister SILK codec factory from pjmedia endpoint and deinitialize
111 * the SILK codec library.
112 *
113 * @return PJ_SUCCESS on success.
114 */
115 PJ_DECL(pj_status_t) pjmedia_codec_silk_deinit(void);
116
117
118 PJ_END_DECL
119
120
121 /**
122 * @}
123 */
124
125 #endif /* __PJMEDIA_CODEC_SILK_H__ */
126