Several versions of single precision log2 , and single precision rounding function round_f(float) function(s) in use
There is a minor confusion with different C-float implementations of single precision log2f(), which may cause issues(different SNR performance), when preparing fixed point code for the function.
Here are the existing variants in the IVAS c-code:
- log2(double) math.h
- log2f(float) math.h
- log2_f(float x) ; return (float) ( log( x ) / log( 2.0f ) ); /* note double precision log, followed by truncation to float) */
- log_base2(double x) ; return log( x ) * INV_LOG_2; * INV_LOG_2 = 1.442695040888963f */
- log_base_2( x ) ; ( (double) log( (double) ( x ) ) * 1.4426950408889634074f )
Variants for the rounding operation, MACRO round_f() vs. roundf and round()
- roundf(float) from math.h
- #define round_f( x ) ( ( ( x ) > 0 ) ? (int32_t) ( ( x ) + 0.5f ) : ( -(int32_t) ( ( -x ) + 0.5f ) ) )
It would be preferable to have the single precision log2f/roundf 's aligned, unless it breaks BE with EVS-MONO. , all of them are after the #1030 (closed) WMCtool update counted correctly by the WMC-tool (see issue #1030 (closed) , MR !1458 (merged))