Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
3870ddb6
Commit
3870ddb6
authored
13 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Only export the CELT calls when CUSTOM_MODES is defined
parent
6cd4e2cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcelt/opus_custom.h
+22
-16
22 additions, 16 deletions
libcelt/opus_custom.h
with
22 additions
and
16 deletions
libcelt/opus_custom.h
+
22
−
16
View file @
3870ddb6
...
...
@@ -42,6 +42,12 @@
extern
"C"
{
#endif
#ifdef CUSTOM_MODES
#define OPUS_CUSTOM_EXPORT OPUS_EXPORT
#else
#define OPUS_CUSTOM_EXPORT
#endif
/** Contains the state of an encoder. One encoder state is needed
for each stream. It is initialised once at the beginning of the
stream. Do *not* re-initialise the state for every frame.
...
...
@@ -73,19 +79,19 @@ typedef struct CELTMode CELTMode;
@param error Returned error code (if NULL, no error will be returned)
@return A newly created mode
*/
OPUS_EXPORT
CELTMode
*
opus_custom_mode_create
(
opus_int32
Fs
,
int
frame_size
,
int
*
error
);
OPUS_
CUSTOM_
EXPORT
CELTMode
*
opus_custom_mode_create
(
opus_int32
Fs
,
int
frame_size
,
int
*
error
);
/** Destroys a mode struct. Only call this after all encoders and
decoders using this mode are destroyed as well.
@param mode Mode to be destroyed
*/
OPUS_EXPORT
void
opus_custom_mode_destroy
(
CELTMode
*
mode
);
OPUS_
CUSTOM_
EXPORT
void
opus_custom_mode_destroy
(
CELTMode
*
mode
);
/* Encoder */
OPUS_EXPORT
int
opus_custom_encoder_get_size
(
const
CELTMode
*
mode
,
int
channels
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_encoder_get_size
(
const
CELTMode
*
mode
,
int
channels
);
/** Creates a new encoder state. Each stream needs its own encoder
state (can't be shared across simultaneous streams).
...
...
@@ -96,14 +102,14 @@ OPUS_EXPORT int opus_custom_encoder_get_size(const CELTMode *mode, int channels)
@param error Returns an error code
@return Newly created encoder state.
*/
OPUS_EXPORT
CELTEncoder
*
opus_custom_encoder_create
(
const
CELTMode
*
mode
,
int
channels
,
int
*
error
);
OPUS_
CUSTOM_
EXPORT
CELTEncoder
*
opus_custom_encoder_create
(
const
CELTMode
*
mode
,
int
channels
,
int
*
error
);
OPUS_EXPORT
int
opus_custom_encoder_init
(
CELTEncoder
*
st
,
const
CELTMode
*
mode
,
int
channels
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_encoder_init
(
CELTEncoder
*
st
,
const
CELTMode
*
mode
,
int
channels
);
/** Destroys a an encoder state.
@param st Encoder state to be destroyed
*/
OPUS_EXPORT
void
opus_custom_encoder_destroy
(
CELTEncoder
*
st
);
OPUS_
CUSTOM_
EXPORT
void
opus_custom_encoder_destroy
(
CELTEncoder
*
st
);
/** Encodes a frame of audio.
@param st Encoder state
...
...
@@ -123,7 +129,7 @@ OPUS_EXPORT void opus_custom_encoder_destroy(CELTEncoder *st);
* the length returned be somehow transmitted to the decoder. Otherwise, no
* decoding is possible.
*/
OPUS_EXPORT
int
opus_custom_encode_float
(
CELTEncoder
*
st
,
const
float
*
pcm
,
int
frame_size
,
unsigned
char
*
compressed
,
int
maxCompressedBytes
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_encode_float
(
CELTEncoder
*
st
,
const
float
*
pcm
,
int
frame_size
,
unsigned
char
*
compressed
,
int
maxCompressedBytes
);
/** Encodes a frame of audio.
@param st Encoder state
...
...
@@ -139,7 +145,7 @@ OPUS_EXPORT int opus_custom_encode_float(CELTEncoder *st, const float *pcm, int
* the length returned be somehow transmitted to the decoder. Otherwise, no
* decoding is possible.
*/
OPUS_EXPORT
int
opus_custom_encode
(
CELTEncoder
*
st
,
const
opus_int16
*
pcm
,
int
frame_size
,
unsigned
char
*
compressed
,
int
maxCompressedBytes
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_encode
(
CELTEncoder
*
st
,
const
opus_int16
*
pcm
,
int
frame_size
,
unsigned
char
*
compressed
,
int
maxCompressedBytes
);
/** Query and set encoder parameters
@param st Encoder state
...
...
@@ -147,13 +153,13 @@ OPUS_EXPORT int opus_custom_encode(CELTEncoder *st, const opus_int16 *pcm, int f
@param value Pointer to a 32-bit int value
@return Error code
*/
OPUS_EXPORT
int
opus_custom_encoder_ctl
(
CELTEncoder
*
restrict
st
,
int
request
,
...);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_encoder_ctl
(
CELTEncoder
*
restrict
st
,
int
request
,
...);
/* Decoder */
OPUS_EXPORT
int
opus_custom_decoder_get_size
(
const
CELTMode
*
mode
,
int
channels
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_decoder_get_size
(
const
CELTMode
*
mode
,
int
channels
);
/** Creates a new decoder state. Each stream needs its own decoder state (can't
be shared across simultaneous streams).
...
...
@@ -163,14 +169,14 @@ OPUS_EXPORT int opus_custom_decoder_get_size(const CELTMode *mode, int channels)
@param error Returns an error code
@return Newly created decoder state.
*/
OPUS_EXPORT
CELTDecoder
*
opus_custom_decoder_create
(
const
CELTMode
*
mode
,
int
channels
,
int
*
error
);
OPUS_
CUSTOM_
EXPORT
CELTDecoder
*
opus_custom_decoder_create
(
const
CELTMode
*
mode
,
int
channels
,
int
*
error
);
OPUS_EXPORT
int
opus_custom_decoder_init
(
CELTDecoder
*
st
,
const
CELTMode
*
mode
,
int
channels
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_decoder_init
(
CELTDecoder
*
st
,
const
CELTMode
*
mode
,
int
channels
);
/** Destroys a a decoder state.
@param st Decoder state to be destroyed
*/
OPUS_EXPORT
void
opus_custom_decoder_destroy
(
CELTDecoder
*
st
);
OPUS_
CUSTOM_
EXPORT
void
opus_custom_decoder_destroy
(
CELTDecoder
*
st
);
/** Decodes a frame of audio.
@param st Decoder state
...
...
@@ -181,7 +187,7 @@ OPUS_EXPORT void opus_custom_decoder_destroy(CELTDecoder *st);
returned here in float format.
@return Error code.
*/
OPUS_EXPORT
int
opus_custom_decode_float
(
CELTDecoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
float
*
pcm
,
int
frame_size
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_decode_float
(
CELTDecoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
float
*
pcm
,
int
frame_size
);
/** Decodes a frame of audio.
@param st Decoder state
...
...
@@ -192,7 +198,7 @@ OPUS_EXPORT int opus_custom_decode_float(CELTDecoder *st, const unsigned char *d
returned here in 16-bit PCM format (native endian).
@return Error code.
*/
OPUS_EXPORT
int
opus_custom_decode
(
CELTDecoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
opus_int16
*
pcm
,
int
frame_size
);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_decode
(
CELTDecoder
*
st
,
const
unsigned
char
*
data
,
int
len
,
opus_int16
*
pcm
,
int
frame_size
);
/** Query and set decoder parameters
@param st Decoder state
...
...
@@ -200,7 +206,7 @@ OPUS_EXPORT int opus_custom_decode(CELTDecoder *st, const unsigned char *data, i
@param value Pointer to a 32-bit int value
@return Error code
*/
OPUS_EXPORT
int
opus_custom_decoder_ctl
(
CELTDecoder
*
restrict
st
,
int
request
,
...);
OPUS_
CUSTOM_
EXPORT
int
opus_custom_decoder_ctl
(
CELTDecoder
*
restrict
st
,
int
request
,
...);
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment