Corrects many places where int was used where opus_int32 was needed.
This commit is contained in:
parent
bafbd08db1
commit
64a3541aa9
10 changed files with 85 additions and 87 deletions
|
@ -61,7 +61,7 @@ struct OpusEncoder {
|
|||
int signal_type;
|
||||
int user_bandwidth;
|
||||
int voice_ratio;
|
||||
int Fs;
|
||||
opus_int32 Fs;
|
||||
int use_vbr;
|
||||
int vbr_constraint;
|
||||
int bitrate_bps;
|
||||
|
@ -80,19 +80,19 @@ struct OpusEncoder {
|
|||
int first;
|
||||
opus_val16 delay_buffer[MAX_ENCODER_BUFFER*2];
|
||||
|
||||
int rangeFinal;
|
||||
opus_uint32 rangeFinal;
|
||||
};
|
||||
|
||||
/* Transition tables for the voice and audio modes. First column is the
|
||||
middle (memoriless) threshold. The second column is the hysteresis
|
||||
(difference with the middle) */
|
||||
static const int voice_bandwidth_thresholds[10] = {
|
||||
static const opus_int32 voice_bandwidth_thresholds[10] = {
|
||||
11000, 1000, /* NB<->MB */
|
||||
14000, 1000, /* MB<->WB */
|
||||
21000, 2000, /* WB<->SWB */
|
||||
29000, 2000, /* SWB<->FB */
|
||||
};
|
||||
static const int audio_bandwidth_thresholds[10] = {
|
||||
static const opus_int32 audio_bandwidth_thresholds[10] = {
|
||||
30000, 0, /* MB not allowed */
|
||||
20000, 2000, /* MB<->WB */
|
||||
26000, 2000, /* WB<->SWB */
|
||||
|
@ -112,7 +112,7 @@ int opus_encoder_get_size(int channels)
|
|||
return align(sizeof(OpusEncoder))+silkEncSizeBytes+celtEncSizeBytes;
|
||||
}
|
||||
|
||||
int opus_encoder_init(OpusEncoder* st, int Fs, int channels, int application)
|
||||
int opus_encoder_init(OpusEncoder* st, opus_int32 Fs, int channels, int application)
|
||||
{
|
||||
void *silk_enc;
|
||||
CELTEncoder *celt_enc;
|
||||
|
@ -306,7 +306,7 @@ static void hp_cutoff(const opus_val16 *in, opus_int32 cutoff_Hz, opus_val16 *ou
|
|||
#endif
|
||||
}
|
||||
|
||||
OpusEncoder *opus_encoder_create(int Fs, int channels, int mode, int *error)
|
||||
OpusEncoder *opus_encoder_create(opus_int32 Fs, int channels, int mode, int *error)
|
||||
{
|
||||
int ret;
|
||||
OpusEncoder *st = (OpusEncoder *)opus_alloc(opus_encoder_get_size(channels));
|
||||
|
@ -491,7 +491,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
|
|||
/* Automatic (rate-dependent) bandwidth selection */
|
||||
if (st->mode == MODE_CELT_ONLY || st->first || st->silk_mode.allowBandwidthSwitch)
|
||||
{
|
||||
const int *bandwidth_thresholds;
|
||||
const opus_int32 *bandwidth_thresholds;
|
||||
int bandwidth = OPUS_BANDWIDTH_FULLBAND;
|
||||
|
||||
bandwidth_thresholds = st->mode == MODE_CELT_ONLY ? audio_bandwidth_thresholds : voice_bandwidth_thresholds;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue