Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2012-11-08 18:42:27 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2012-11-08 18:42:27 +0400
commit6906210cb0083f6a23acf0d34ddf576be5074f25 (patch)
tree3c8bb233ec5c0fb368e1443c4c434d3d568b188e /include/opus_custom.h
parentae0e2ca89f81e608bd4c3839bf0cb62be3549e99 (diff)
Splits out the CELT encoder and decoder
Diffstat (limited to 'include/opus_custom.h')
-rw-r--r--include/opus_custom.h86
1 files changed, 49 insertions, 37 deletions
diff --git a/include/opus_custom.h b/include/opus_custom.h
index e7861d6f..8415a7b9 100644
--- a/include/opus_custom.h
+++ b/include/opus_custom.h
@@ -42,15 +42,15 @@ extern "C" {
#endif
#ifdef CUSTOM_MODES
-#define OPUS_CUSTOM_EXPORT OPUS_EXPORT
-#define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
+# define OPUS_CUSTOM_EXPORT OPUS_EXPORT
+# define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
#else
-#define OPUS_CUSTOM_EXPORT
-#ifdef CELT_C
-#define OPUS_CUSTOM_EXPORT_STATIC static inline
-#else
-#define OPUS_CUSTOM_EXPORT_STATIC
-#endif
+# define OPUS_CUSTOM_EXPORT
+# ifdef CELT_C
+# define OPUS_CUSTOM_EXPORT_STATIC static inline
+# else
+# define OPUS_CUSTOM_EXPORT_STATIC
+# endif
#endif
/** @defgroup opus_custom Opus Custom
@@ -126,6 +126,9 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *opus_custom_mode_crea
*/
OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
+
+#if defined(CELT_C) && defined(ENCODER)
+
/* Encoder */
/** Gets the size of an OpusCustomEncoder structure.
* @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
@@ -137,21 +140,6 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
int channels
) OPUS_ARG_NONNULL(1);
-/** Creates a new encoder state. Each stream needs its own encoder
- * state (can't be shared across simultaneous streams).
- * @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information about the characteristics of
- * the stream (must be the same characteristics as used for the
- * decoder)
- * @param [in] channels <tt>int</tt>: Number of channels
- * @param [out] error <tt>int*</tt>: Returns an error code
- * @return Newly created encoder state.
-*/
-OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create(
- const OpusCustomMode *mode,
- int channels,
- int *error
-) OPUS_ARG_NONNULL(1);
-
/** Initializes a previously allocated encoder state
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
@@ -170,6 +158,25 @@ OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
+#endif
+
+
+/** Creates a new encoder state. Each stream needs its own encoder
+ * state (can't be shared across simultaneous streams).
+ * @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information about the characteristics of
+ * the stream (must be the same characteristics as used for the
+ * decoder)
+ * @param [in] channels <tt>int</tt>: Number of channels
+ * @param [out] error <tt>int*</tt>: Returns an error code
+ * @return Newly created encoder state.
+*/
+OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create(
+ const OpusCustomMode *mode,
+ int channels,
+ int *error
+) OPUS_ARG_NONNULL(1);
+
+
/** Destroys a an encoder state.
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
*/
@@ -229,6 +236,8 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
*/
OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
+
+#if defined(CELT_C) && defined(DECODER)
/* Decoder */
/** Gets the size of an OpusCustomDecoder structure.
@@ -241,20 +250,6 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_decoder_get_si
int channels
) OPUS_ARG_NONNULL(1);
-/** Creates a new decoder state. Each stream needs its own decoder state (can't
- * be shared across simultaneous streams).
- * @param [in] mode <tt>OpusCustomMode</tt>: Contains all the information about the characteristics of the
- * stream (must be the same characteristics as used for the encoder)
- * @param [in] channels <tt>int</tt>: Number of channels
- * @param [out] error <tt>int*</tt>: Returns an error code
- * @return Newly created decoder state.
- */
-OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create(
- const OpusCustomMode *mode,
- int channels,
- int *error
-) OPUS_ARG_NONNULL(1);
-
/** Initializes a previously allocated decoder state
* The memory pointed to by st must be the size returned by opus_custom_decoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
@@ -273,6 +268,23 @@ OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
+#endif
+
+
+/** Creates a new decoder state. Each stream needs its own decoder state (can't
+ * be shared across simultaneous streams).
+ * @param [in] mode <tt>OpusCustomMode</tt>: Contains all the information about the characteristics of the
+ * stream (must be the same characteristics as used for the encoder)
+ * @param [in] channels <tt>int</tt>: Number of channels
+ * @param [out] error <tt>int*</tt>: Returns an error code
+ * @return Newly created decoder state.
+ */
+OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create(
+ const OpusCustomMode *mode,
+ int channels,
+ int *error
+) OPUS_ARG_NONNULL(1);
+
/** Destroys a an decoder state.
* @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
*/