From 78b1a1e7bc52401e9c44a3dc65f4eef57381c721 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 21 Feb 2023 09:34:40 +0100 Subject: [PATCH] fix MSVC build when DEBUG_MODE_INFO is activated --- lib_debug/debug.c | 1 + lib_debug/snr.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib_debug/debug.c b/lib_debug/debug.c index 4b2a682591..85e48e8bae 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -45,6 +45,7 @@ #endif #endif #endif +#include "cnst.h" #include #include #include diff --git a/lib_debug/snr.c b/lib_debug/snr.c index e9fad1c344..f6e6fa9d52 100644 --- a/lib_debug/snr.c +++ b/lib_debug/snr.c @@ -84,9 +84,26 @@ static float mem_synth_snr[MAX_INPUT_CHANNELS][M]; here we do not want to include prot.h due to its dependencies *--------------------------------------------------------------------*/ +static void set_f( + float y[], /* i/o: Vector to set */ + const float a, /* i : Value to set the vector to */ + const int16_t N /* i : Lenght of the vector */ +) +{ + int16_t i; + + for ( i = 0; i < N; i++ ) + { + y[i] = a; + } + + return; +} + + static float sum2_f( - const float *vec, /* i : input vector */ - const int16_t lvec /* i : length of input vector */ + const float *vec, /* i : input vector */ + const int16_t lvec /* i : length of input vector */ ) { int16_t i; @@ -379,7 +396,7 @@ void snr_celp( noise2 = sum2_f( &noise[i], L_subfr ) + 0.001f; if ( signal2 < noise2 ) signal2 = noise2; - subframe_snr = 10.0f * (float) log10( signal2 / noise2 ); + subframe_snr = 10.0f * log10f( signal2 / noise2 ); if ( L_frame == L_FRAME ) { -- GitLab