maintenance: prevent division by 0
This commit is contained in:
parent
c111c12ff1
commit
eb67697d81
3 changed files with 12 additions and 6 deletions
2
3rdparty/iaxclient/lib/libspeex/testenc.c
vendored
2
3rdparty/iaxclient/lib/libspeex/testenc.c
vendored
|
@ -125,10 +125,12 @@ int main(int argc, char **argv)
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
|
|
||||||
snr = 10 * log10( sigpow / errpow );
|
snr = 10 * log10( sigpow / errpow );
|
||||||
|
if (snr_frames > 0)
|
||||||
seg_snr /= snr_frames;
|
seg_snr /= snr_frames;
|
||||||
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
||||||
|
|
||||||
#ifdef FIXED_DEBUG
|
#ifdef FIXED_DEBUG
|
||||||
|
if (snr_frames > 0)
|
||||||
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -125,10 +125,12 @@ int main(int argc, char **argv)
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
|
|
||||||
snr = 10 * log10( sigpow / errpow );
|
snr = 10 * log10( sigpow / errpow );
|
||||||
|
if (snr_frames > 0)
|
||||||
seg_snr /= snr_frames;
|
seg_snr /= snr_frames;
|
||||||
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
||||||
|
|
||||||
#ifdef FIXED_DEBUG
|
#ifdef FIXED_DEBUG
|
||||||
|
if (snr_frames > 0)
|
||||||
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
2
3rdparty/iaxclient/lib/libspeex/testenc_wb.c
vendored
2
3rdparty/iaxclient/lib/libspeex/testenc_wb.c
vendored
|
@ -130,10 +130,12 @@ int main(int argc, char **argv)
|
||||||
fclose(fout);
|
fclose(fout);
|
||||||
|
|
||||||
snr = 10 * log10( sigpow / errpow );
|
snr = 10 * log10( sigpow / errpow );
|
||||||
|
if (snr_frames > 0)
|
||||||
seg_snr /= snr_frames;
|
seg_snr /= snr_frames;
|
||||||
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
fprintf(stderr,"SNR = %f\nsegmental SNR = %f\n",snr, seg_snr);
|
||||||
|
|
||||||
#ifdef FIXED_DEBUG
|
#ifdef FIXED_DEBUG
|
||||||
|
if (snr_frames > 0)
|
||||||
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
printf ("Total: %f MIPS\n", (float)(1e-6*50*spx_mips/snr_frames));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue