diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-10-05 05:07:52 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-10-05 07:09:00 +0300 |
commit | 386883179a68467ec35dd1c481100ad5915081f0 (patch) | |
tree | 66eec7a977ae7b38f997b94561b1e6084fa9fc67 | |
parent | ae5f5cc1c5d9919cc66efec2eea97f673228da44 (diff) |
Fixing some opus_int vs opus_int32 mismatches
Reported by Mark Warner.
-rw-r--r-- | silk/fixed/pitch_analysis_core_FIX.c | 4 | ||||
-rw-r--r-- | silk/quant_LTP_gains.c | 3 | ||||
-rw-r--r-- | src/opus_decoder.c | 2 | ||||
-rw-r--r-- | src/opus_demo.c | 2 | ||||
-rw-r--r-- | src/opus_multistream_decoder.c | 3 | ||||
-rw-r--r-- | tests/test_opus_decode.c | 6 | ||||
-rw-r--r-- | tests/test_opus_encode.c | 7 |
7 files changed, 15 insertions, 12 deletions
diff --git a/silk/fixed/pitch_analysis_core_FIX.c b/silk/fixed/pitch_analysis_core_FIX.c index 03ea28d0..8df109e6 100644 --- a/silk/fixed/pitch_analysis_core_FIX.c +++ b/silk/fixed/pitch_analysis_core_FIX.c @@ -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; diff --git a/silk/quant_LTP_gains.c b/silk/quant_LTP_gains.c index 19f555a9..d6b8eff8 100644 --- a/silk/quant_LTP_gains.c +++ b/silk/quant_LTP_gains.c @@ -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 */ diff --git a/src/opus_decoder.c b/src/opus_decoder.c index af46d82f..149ae7f2 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -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; diff --git a/src/opus_demo.c b/src/opus_demo.c index a330bb54..c8135c2e 100644 --- a/src/opus_demo.c +++ b/src/opus_demo.c @@ -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)); diff --git a/src/opus_multistream_decoder.c b/src/opus_multistream_decoder.c index 30cc54b2..e421726f 100644 --- a/src/opus_multistream_decoder.c +++ b/src/opus_multistream_decoder.c @@ -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); diff --git a/tests/test_opus_decode.c b/tests/test_opus_decode.c index 14a8eef5..e703682f 100644 --- a/tests/test_opus_decode.c +++ b/tests/test_opus_decode.c @@ -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; diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c index 4e7ccf7d..c49a2adf 100644 --- a/tests/test_opus_encode.c +++ b/tests/test_opus_encode.c @@ -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]; |