Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00035 #ifndef OPUS_CUSTOM_H
00036 #define OPUS_CUSTOM_H
00037
00038 #include "opus_defines.h"
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044 #ifdef CUSTOM_MODES
00045 # define OPUS_CUSTOM_EXPORT OPUS_EXPORT
00046 # define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
00047 #else
00048 # define OPUS_CUSTOM_EXPORT
00049 # ifdef OPUS_BUILD
00050 # define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE
00051 # else
00052 # define OPUS_CUSTOM_EXPORT_STATIC
00053 # endif
00054 #endif
00055
00095 typedef struct OpusCustomEncoder OpusCustomEncoder;
00096
00102 typedef struct OpusCustomDecoder OpusCustomDecoder;
00103
00110 typedef struct OpusCustomMode OpusCustomMode;
00111
00121 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error);
00122
00127 OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
00128
00129
00130 #if !defined(OPUS_BUILD) || defined(CELT_ENCODER_C)
00131
00132
00138 OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size(
00139 const OpusCustomMode *mode,
00140 int channels
00141 ) OPUS_ARG_NONNULL(1);
00142
00143 # ifdef CUSTOM_MODES
00144
00156 OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
00157 OpusCustomEncoder *st,
00158 const OpusCustomMode *mode,
00159 int channels
00160 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
00161 # endif
00162 #endif
00163
00164
00174 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create(
00175 const OpusCustomMode *mode,
00176 int channels,
00177 int *error
00178 ) OPUS_ARG_NONNULL(1);
00179
00180
00184 OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
00185
00203 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode_float(
00204 OpusCustomEncoder *st,
00205 const float *pcm,
00206 int frame_size,
00207 unsigned char *compressed,
00208 int maxCompressedBytes
00209 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00210
00224 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
00225 OpusCustomEncoder *st,
00226 const opus_int16 *pcm,
00227 int frame_size,
00228 unsigned char *compressed,
00229 int maxCompressedBytes
00230 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00231
00238 OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
00239
00240
00241 #if !defined(OPUS_BUILD) || defined(CELT_DECODER_C)
00242
00243
00249 OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_decoder_get_size(
00250 const OpusCustomMode *mode,
00251 int channels
00252 ) OPUS_ARG_NONNULL(1);
00253
00266 OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
00267 OpusCustomDecoder *st,
00268 const OpusCustomMode *mode,
00269 int channels
00270 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
00271
00272 #endif
00273
00274
00283 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create(
00284 const OpusCustomMode *mode,
00285 int channels,
00286 int *error
00287 ) OPUS_ARG_NONNULL(1);
00288
00292 OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
00293
00303 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode_float(
00304 OpusCustomDecoder *st,
00305 const unsigned char *data,
00306 int len,
00307 float *pcm,
00308 int frame_size
00309 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00310
00320 OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
00321 OpusCustomDecoder *st,
00322 const unsigned char *data,
00323 int len,
00324 opus_int16 *pcm,
00325 int frame_size
00326 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00327
00334 OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
00335
00338 #ifdef __cplusplus
00339 }
00340 #endif
00341
00342 #endif