Fixing some opus_int vs opus_int32 mismatches

Reported by Mark Warner.
This commit is contained in:
Jean-Marc Valin 2016-10-04 22:07:52 -04:00
parent ae5f5cc1c5
commit 386883179a
No known key found for this signature in database
GPG key ID: 5E5DD9A36F9189C8
7 changed files with 15 additions and 12 deletions

View file

@ -103,8 +103,8 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0
VARDECL( opus_int16, C );
VARDECL( opus_int32, xcorr32 );
const opus_int16 *target_ptr, *basis_ptr;
opus_int32 cross_corr, normalizer, energy, shift, energy_basis, energy_target;
opus_int d_srch[ PE_D_SRCH_LENGTH ], Cmax, length_d_srch, length_d_comp;
opus_int32 cross_corr, normalizer, energy, energy_basis, energy_target;
opus_int d_srch[ PE_D_SRCH_LENGTH ], Cmax, length_d_srch, length_d_comp, shift;
VARDECL( opus_int16, d_comp );
opus_int32 sum, threshold, lag_counter;
opus_int CBimax, CBimax_new, CBimax_old, lag, start_lag, end_lag, lag_new;

View file

@ -52,7 +52,8 @@ void silk_quant_LTP_gains(
const opus_uint8 *cbk_gain_ptr_Q7;
const opus_int32 *XX_Q17_ptr, *xX_Q17_ptr;
opus_int32 res_nrg_Q15_subfr, res_nrg_Q15, rate_dist_Q7_subfr, rate_dist_Q7, min_rate_dist_Q7;
opus_int32 sum_log_gain_tmp_Q7, best_sum_log_gain_Q7, max_gain_Q7, gain_Q7;
opus_int32 sum_log_gain_tmp_Q7, best_sum_log_gain_Q7, max_gain_Q7;
opus_int gain_Q7;
/***************************************************/
/* iterate over different codebooks with different */

View file

@ -891,7 +891,7 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...)
break;
case OPUS_GET_LAST_PACKET_DURATION_REQUEST:
{
opus_uint32 *value = va_arg(ap, opus_uint32*);
opus_int32 *value = va_arg(ap, opus_int32*);
if (!value)
{
goto bad_arg;

View file

@ -765,7 +765,7 @@ int main(int argc, char *argv[])
}
tot_samples += nb_encoded;
} else {
int output_samples;
opus_int32 output_samples;
lost = len[toggle]==0 || (packet_loss_perc>0 && rand()%100 < packet_loss_perc);
if (lost)
opus_decoder_ctl(dec, OPUS_GET_LAST_PACKET_DURATION(&output_samples));

View file

@ -237,7 +237,8 @@ static int opus_multistream_decode_native(
for (s=0;s<st->layout.nb_streams;s++)
{
OpusDecoder *dec;
int packet_offset, ret;
opus_int32 packet_offset;
int ret;
dec = (OpusDecoder*)ptr;
ptr += (s < st->layout.nb_coupled_streams) ? align(coupled_size) : align(mono_size);

View file

@ -104,7 +104,7 @@ int test_decoder_code0(int no_fuzz)
int factor=48000/fsv[t>>1];
for(fec=0;fec<2;fec++)
{
int dur;
opus_int32 dur;
/*Test PLC on a fresh decoder*/
out_samples = opus_decode(dec[t], 0, 0, outbuf, 120/factor, fec);
if(out_samples!=120/factor)test_failed();
@ -160,7 +160,7 @@ int test_decoder_code0(int no_fuzz)
/*Count code 0 tests*/
for(i=0;i<64;i++)
{
int dur;
opus_int32 dur;
int j,expected[5*2];
packet[0]=i<<2;
packet[1]=255;
@ -314,7 +314,7 @@ int test_decoder_code0(int no_fuzz)
if(opus_decode(decbak, 0, 0, outbuf, MAX_FRAME_SAMP, 0)<20)test_failed();
for(t=0;t<5*2;t++)
{
int dur;
opus_int32 dur;
out_samples = opus_decode(dec[t], packet, plen+1, outbuf, MAX_FRAME_SAMP, 0);
if(out_samples!=expected[t])test_failed();
if(t==0)dec_final_range2=dec_final_range1;

View file

@ -265,8 +265,8 @@ int run_test1(int no_fuzz)
static const char *mstrings[3] = {" LP","Hybrid"," MDCT"};
unsigned char mapping[256] = {0,1,255};
unsigned char db62[36];
opus_int32 i;
int rc,j,err;
opus_int32 i,j;
int rc,err;
OpusEncoder *enc;
OpusMSEncoder *MSenc;
OpusDecoder *dec;
@ -482,7 +482,8 @@ int run_test1(int no_fuzz)
if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_BITRATE(rate))!=OPUS_OK)test_failed();
count=i=0;
do {
int pred,len,out_samples,frame_size,loss;
int len,out_samples,frame_size,loss;
opus_int32 pred;
if(opus_multistream_encoder_ctl(MSenc, OPUS_GET_PREDICTION_DISABLED(&pred))!=OPUS_OK)test_failed();
if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_PREDICTION_DISABLED((int)(fast_rand()&15)<(pred?11:4)))!=OPUS_OK)test_failed();
frame_size=frame[j];