OLD | NEW |
1 /* Copyright (c) 2007-2008 CSIRO | 1 /* Copyright (c) 2007-2008 CSIRO |
2 Copyright (c) 2007-2009 Xiph.Org Foundation | 2 Copyright (c) 2007-2009 Xiph.Org Foundation |
3 Copyright (c) 2008-2012 Gregory Maxwell | 3 Copyright (c) 2008-2012 Gregory Maxwell |
4 Written by Jean-Marc Valin and Gregory Maxwell */ | 4 Written by Jean-Marc Valin and Gregory Maxwell */ |
5 /* | 5 /* |
6 Redistribution and use in source and binary forms, with or without | 6 Redistribution and use in source and binary forms, with or without |
7 modification, are permitted provided that the following conditions | 7 modification, are permitted provided that the following conditions |
8 are met: | 8 are met: |
9 | 9 |
10 - Redistributions of source code must retain the above copyright | 10 - Redistributions of source code must retain the above copyright |
(...skipping 29 matching lines...) Expand all Loading... |
40 #ifdef __cplusplus | 40 #ifdef __cplusplus |
41 extern "C" { | 41 extern "C" { |
42 #endif | 42 #endif |
43 | 43 |
44 #ifdef CUSTOM_MODES | 44 #ifdef CUSTOM_MODES |
45 # define OPUS_CUSTOM_EXPORT OPUS_EXPORT | 45 # define OPUS_CUSTOM_EXPORT OPUS_EXPORT |
46 # define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT | 46 # define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT |
47 #else | 47 #else |
48 # define OPUS_CUSTOM_EXPORT | 48 # define OPUS_CUSTOM_EXPORT |
49 # ifdef OPUS_BUILD | 49 # ifdef OPUS_BUILD |
50 # define OPUS_CUSTOM_EXPORT_STATIC static inline | 50 # define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE |
51 # else | 51 # else |
52 # define OPUS_CUSTOM_EXPORT_STATIC | 52 # define OPUS_CUSTOM_EXPORT_STATIC |
53 # endif | 53 # endif |
54 #endif | 54 #endif |
55 | 55 |
56 /** @defgroup opus_custom Opus Custom | 56 /** @defgroup opus_custom Opus Custom |
57 * @{ | 57 * @{ |
58 * Opus Custom is an optional part of the Opus specification and | 58 * Opus Custom is an optional part of the Opus specification and |
59 * reference implementation which uses a distinct API from the regular | 59 * reference implementation which uses a distinct API from the regular |
60 * API and supports frame sizes that are not normally supported.\ Use | 60 * API and supports frame sizes that are not normally supported.\ Use |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 /** Gets the size of an OpusCustomEncoder structure. | 133 /** Gets the size of an OpusCustomEncoder structure. |
134 * @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration | 134 * @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration |
135 * @param [in] channels <tt>int</tt>: Number of channels | 135 * @param [in] channels <tt>int</tt>: Number of channels |
136 * @returns size | 136 * @returns size |
137 */ | 137 */ |
138 OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
ze( | 138 OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
ze( |
139 const OpusCustomMode *mode, | 139 const OpusCustomMode *mode, |
140 int channels | 140 int channels |
141 ) OPUS_ARG_NONNULL(1); | 141 ) OPUS_ARG_NONNULL(1); |
142 | 142 |
| 143 # ifdef CUSTOM_MODES |
143 /** Initializes a previously allocated encoder state | 144 /** Initializes a previously allocated encoder state |
144 * The memory pointed to by st must be the size returned by opus_custom_encoder
_get_size. | 145 * The memory pointed to by st must be the size returned by opus_custom_encoder
_get_size. |
145 * This is intended for applications which use their own allocator instead of m
alloc. | 146 * This is intended for applications which use their own allocator instead of m
alloc. |
146 * @see opus_custom_encoder_create(),opus_custom_encoder_get_size() | 147 * @see opus_custom_encoder_create(),opus_custom_encoder_get_size() |
147 * To reset a previously initialized state use the OPUS_RESET_STATE CTL. | 148 * To reset a previously initialized state use the OPUS_RESET_STATE CTL. |
148 * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state | 149 * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state |
149 * @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information abo
ut the characteristics of | 150 * @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information abo
ut the characteristics of |
150 * the stream (must be the same characteristics as used for the | 151 * the stream (must be the same characteristics as used for the |
151 * decoder) | 152 * decoder) |
152 * @param [in] channels <tt>int</tt>: Number of channels | 153 * @param [in] channels <tt>int</tt>: Number of channels |
153 * @return OPUS_OK Success or @ref opus_errorcodes | 154 * @return OPUS_OK Success or @ref opus_errorcodes |
154 */ | 155 */ |
155 OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init( | 156 OPUS_CUSTOM_EXPORT int opus_custom_encoder_init( |
156 OpusCustomEncoder *st, | 157 OpusCustomEncoder *st, |
157 const OpusCustomMode *mode, | 158 const OpusCustomMode *mode, |
158 int channels | 159 int channels |
159 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); | 160 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); |
160 | 161 # endif |
161 #endif | 162 #endif |
162 | 163 |
163 | 164 |
164 /** Creates a new encoder state. Each stream needs its own encoder | 165 /** Creates a new encoder state. Each stream needs its own encoder |
165 * state (can't be shared across simultaneous streams). | 166 * state (can't be shared across simultaneous streams). |
166 * @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information abou
t the characteristics of | 167 * @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information abou
t the characteristics of |
167 * the stream (must be the same characteristics as used for the | 168 * the stream (must be the same characteristics as used for the |
168 * decoder) | 169 * decoder) |
169 * @param [in] channels <tt>int</tt>: Number of channels | 170 * @param [in] channels <tt>int</tt>: Number of channels |
170 * @param [out] error <tt>int*</tt>: Returns an error code | 171 * @param [out] error <tt>int*</tt>: Returns an error code |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 */ | 333 */ |
333 OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT
st, int request, ...) OPUS_ARG_NONNULL(1); | 334 OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT
st, int request, ...) OPUS_ARG_NONNULL(1); |
334 | 335 |
335 /**@}*/ | 336 /**@}*/ |
336 | 337 |
337 #ifdef __cplusplus | 338 #ifdef __cplusplus |
338 } | 339 } |
339 #endif | 340 #endif |
340 | 341 |
341 #endif /* OPUS_CUSTOM_H */ | 342 #endif /* OPUS_CUSTOM_H */ |
OLD | NEW |