Making CELT_GET_MODE "private"
This commit is contained in:
parent
ff96b165fe
commit
c3086a98f4
3 changed files with 46 additions and 38 deletions
|
@ -1751,14 +1751,6 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
|
||||||
va_start(ap, request);
|
va_start(ap, request);
|
||||||
switch (request)
|
switch (request)
|
||||||
{
|
{
|
||||||
case CELT_GET_MODE_REQUEST:
|
|
||||||
{
|
|
||||||
const CELTMode ** value = va_arg(ap, const CELTMode**);
|
|
||||||
if (value==0)
|
|
||||||
goto bad_arg;
|
|
||||||
*value=st->mode;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CELT_SET_COMPLEXITY_REQUEST:
|
case CELT_SET_COMPLEXITY_REQUEST:
|
||||||
{
|
{
|
||||||
int value = va_arg(ap, celt_int32);
|
int value = va_arg(ap, celt_int32);
|
||||||
|
@ -1821,12 +1813,6 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
|
||||||
st->stream_channels = value;
|
st->stream_channels = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CELT_SET_SIGNALLING_REQUEST:
|
|
||||||
{
|
|
||||||
celt_int32 value = va_arg(ap, celt_int32);
|
|
||||||
st->signalling = value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CELT_RESET_STATE:
|
case CELT_RESET_STATE:
|
||||||
{
|
{
|
||||||
CELT_MEMSET((char*)&st->ENCODER_RESET_START, 0,
|
CELT_MEMSET((char*)&st->ENCODER_RESET_START, 0,
|
||||||
|
@ -1844,6 +1830,22 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
|
||||||
st->clip = value;
|
st->clip = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef OPUS_BUILD
|
||||||
|
case CELT_SET_SIGNALLING_REQUEST:
|
||||||
|
{
|
||||||
|
celt_int32 value = va_arg(ap, celt_int32);
|
||||||
|
st->signalling = value;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CELT_GET_MODE_REQUEST:
|
||||||
|
{
|
||||||
|
const CELTMode ** value = va_arg(ap, const CELTMode**);
|
||||||
|
if (value==0)
|
||||||
|
goto bad_arg;
|
||||||
|
*value=st->mode;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
goto bad_request;
|
goto bad_request;
|
||||||
}
|
}
|
||||||
|
@ -2701,14 +2703,6 @@ int celt_decoder_ctl(CELTDecoder * restrict st, int request, ...)
|
||||||
va_start(ap, request);
|
va_start(ap, request);
|
||||||
switch (request)
|
switch (request)
|
||||||
{
|
{
|
||||||
case CELT_GET_MODE_REQUEST:
|
|
||||||
{
|
|
||||||
const CELTMode ** value = va_arg(ap, const CELTMode**);
|
|
||||||
if (value==0)
|
|
||||||
goto bad_arg;
|
|
||||||
*value=st->mode;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CELT_SET_START_BAND_REQUEST:
|
case CELT_SET_START_BAND_REQUEST:
|
||||||
{
|
{
|
||||||
celt_int32 value = va_arg(ap, celt_int32);
|
celt_int32 value = va_arg(ap, celt_int32);
|
||||||
|
@ -2733,12 +2727,6 @@ int celt_decoder_ctl(CELTDecoder * restrict st, int request, ...)
|
||||||
st->stream_channels = value;
|
st->stream_channels = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CELT_SET_SIGNALLING_REQUEST:
|
|
||||||
{
|
|
||||||
celt_int32 value = va_arg(ap, celt_int32);
|
|
||||||
st->signalling = value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CELT_GET_AND_CLEAR_ERROR_REQUEST:
|
case CELT_GET_AND_CLEAR_ERROR_REQUEST:
|
||||||
{
|
{
|
||||||
int *value = va_arg(ap, int*);
|
int *value = va_arg(ap, int*);
|
||||||
|
@ -2763,6 +2751,22 @@ int celt_decoder_ctl(CELTDecoder * restrict st, int request, ...)
|
||||||
((char*)&st->DECODER_RESET_START - (char*)st));
|
((char*)&st->DECODER_RESET_START - (char*)st));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef OPUS_BUILD
|
||||||
|
case CELT_GET_MODE_REQUEST:
|
||||||
|
{
|
||||||
|
const CELTMode ** value = va_arg(ap, const CELTMode**);
|
||||||
|
if (value==0)
|
||||||
|
goto bad_arg;
|
||||||
|
*value=st->mode;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CELT_SET_SIGNALLING_REQUEST:
|
||||||
|
{
|
||||||
|
celt_int32 value = va_arg(ap, celt_int32);
|
||||||
|
st->signalling = value;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
goto bad_request;
|
goto bad_request;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _celt_check_int(x) (((void)((x) == (celt_int32)0)), (celt_int32)(x))
|
#define _celt_check_int(x) (((void)((x) == (celt_int32)0)), (celt_int32)(x))
|
||||||
#define _celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (CELTMode**)(ptr)))
|
#define _celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (const CELTMode**)(ptr)))
|
||||||
#define _celt_check_int_ptr(ptr) ((ptr) + ((ptr) - (int*)(ptr)))
|
#define _celt_check_int_ptr(ptr) ((ptr) + ((ptr) - (int*)(ptr)))
|
||||||
|
|
||||||
/* Error codes */
|
/* Error codes */
|
||||||
|
@ -71,10 +71,8 @@ extern "C" {
|
||||||
/** Memory allocation has failed */
|
/** Memory allocation has failed */
|
||||||
#define CELT_ALLOC_FAIL -7
|
#define CELT_ALLOC_FAIL -7
|
||||||
|
|
||||||
/* Requests */
|
|
||||||
#define CELT_GET_MODE_REQUEST 1
|
/* Encoder/decoder Requests */
|
||||||
/** Get the CELTMode used by an encoder or decoder */
|
|
||||||
#define CELT_GET_MODE(x) CELT_GET_MODE_REQUEST, _celt_check_mode_ptr_ptr(x)
|
|
||||||
|
|
||||||
#define CELT_SET_COMPLEXITY_REQUEST 2
|
#define CELT_SET_COMPLEXITY_REQUEST 2
|
||||||
/** Controls the complexity from 0-10 (int) */
|
/** Controls the complexity from 0-10 (int) */
|
||||||
|
@ -92,8 +90,8 @@ extern "C" {
|
||||||
/** Set the target VBR rate in bits per second(int); 0=CBR (default) */
|
/** Set the target VBR rate in bits per second(int); 0=CBR (default) */
|
||||||
#define CELT_SET_BITRATE(x) CELT_SET_BITRATE_REQUEST, _celt_check_int(x)
|
#define CELT_SET_BITRATE(x) CELT_SET_BITRATE_REQUEST, _celt_check_int(x)
|
||||||
|
|
||||||
/** Reset the encoder/decoder memories to zero*/
|
|
||||||
#define CELT_RESET_STATE_REQUEST 8
|
#define CELT_RESET_STATE_REQUEST 8
|
||||||
|
/** Reset the encoder/decoder memories to zero*/
|
||||||
#define CELT_RESET_STATE CELT_RESET_STATE_REQUEST
|
#define CELT_RESET_STATE CELT_RESET_STATE_REQUEST
|
||||||
|
|
||||||
#define CELT_SET_VBR_CONSTRAINT_REQUEST 10
|
#define CELT_SET_VBR_CONSTRAINT_REQUEST 10
|
||||||
|
@ -111,6 +109,9 @@ extern "C" {
|
||||||
#define CELT_GET_LOOKAHEAD_REQUEST 17
|
#define CELT_GET_LOOKAHEAD_REQUEST 17
|
||||||
#define CELT_GET_LOOKAHEAD(x) CELT_GET_LOOKAHEAD_REQUEST, _celt_check_int_ptr(x)
|
#define CELT_GET_LOOKAHEAD(x) CELT_GET_LOOKAHEAD_REQUEST, _celt_check_int_ptr(x)
|
||||||
|
|
||||||
|
#define CELT_SET_CHANNELS_REQUEST 18
|
||||||
|
#define CELT_SET_CHANNELS(x) CELT_SET_CHANNELS_REQUEST, _celt_check_int(x)
|
||||||
|
|
||||||
/* Internal */
|
/* Internal */
|
||||||
#define CELT_SET_START_BAND_REQUEST 10000
|
#define CELT_SET_START_BAND_REQUEST 10000
|
||||||
#define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, _celt_check_int(x)
|
#define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, _celt_check_int(x)
|
||||||
|
@ -118,11 +119,7 @@ extern "C" {
|
||||||
#define CELT_SET_END_BAND_REQUEST 10001
|
#define CELT_SET_END_BAND_REQUEST 10001
|
||||||
#define CELT_SET_END_BAND(x) CELT_SET_END_BAND_REQUEST, _celt_check_int(x)
|
#define CELT_SET_END_BAND(x) CELT_SET_END_BAND_REQUEST, _celt_check_int(x)
|
||||||
|
|
||||||
#define CELT_SET_CHANNELS_REQUEST 10002
|
|
||||||
#define CELT_SET_CHANNELS(x) CELT_SET_CHANNELS_REQUEST, _celt_check_int(x)
|
|
||||||
|
|
||||||
#define CELT_SET_SIGNALLING_REQUEST 10003
|
|
||||||
#define CELT_SET_SIGNALLING(x) CELT_SET_SIGNALLING_REQUEST, _celt_check_int(x)
|
|
||||||
|
|
||||||
/** Contains the state of an encoder. One encoder state is needed
|
/** Contains the state of an encoder. One encoder state is needed
|
||||||
for each stream. It is initialised once at the beginning of the
|
for each stream. It is initialised once at the beginning of the
|
||||||
|
|
|
@ -100,6 +100,13 @@ struct CELTMode {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPUS_BUILD
|
#ifdef OPUS_BUILD
|
||||||
|
#define CELT_SET_SIGNALLING_REQUEST 10003
|
||||||
|
#define CELT_SET_SIGNALLING(x) CELT_SET_SIGNALLING_REQUEST, _celt_check_int(x)
|
||||||
|
|
||||||
|
#define CELT_GET_MODE_REQUEST 10004
|
||||||
|
/** Get the CELTMode used by an encoder or decoder */
|
||||||
|
#define CELT_GET_MODE(x) CELT_GET_MODE_REQUEST, _celt_check_mode_ptr_ptr(x)
|
||||||
|
|
||||||
/* Prototypes for _ec versions of the encoder/decoder calls (not public) */
|
/* Prototypes for _ec versions of the encoder/decoder calls (not public) */
|
||||||
int celt_encode_with_ec(CELTEncoder * restrict st, const celt_int16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
|
int celt_encode_with_ec(CELTEncoder * restrict st, const celt_int16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
|
||||||
int celt_encode_with_ec_float(CELTEncoder * restrict st, const float * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
|
int celt_encode_with_ec_float(CELTEncoder * restrict st, const float * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue