Skip to content

Double precision arithmetic in MCT

There are used double precision mathematical functions in MCT:

  • lib_dec/ivas_mct_dec.c(435): hMCT->bitsChannelPairIndex = max( 1, (int16_t) ( floor( ( log( hMCT->nchan_out_woLFE * ( hMCT->nchan_out_woLFE - 1 ) / 2 - 1 ) / log( 2. ) ) ) + 1 ) );
  • lib_dec/ivas_mct_dec.c(596): hMCT->bitsChannelPairIndex = max( 1, (int16_t) ( floor( ( log( hMCT->nchan_out_woLFE * ( hMCT->nchan_out_woLFE - 1 ) / 2 - 1 ) / log( 2. ) ) ) + 1 ) );
  • lib_enc/ivas_mct_enc.c(74): hMCT->bitsChannelPairIndex = max( 1, (int16_t) ( floor( ( log( hMCT->nchan_out_woLFE * ( hMCT->nchan_out_woLFE - 1 ) / 2 - 1 ) / log( 2. ) ) ) + 1 ) );

Consider to use a single precision counterparts logf() and floorf(). Also, 1/ **log**( 2. ) might be replaced by INV_LOG_2.

Edited by multrus