Skip to content

ivas_cpe_enc_fx(): Wrong calculation of total_brate

Basic info

Related to #2344 (comment 107024)

  • Fixed point:
    • Encoder (fixed): 5e6b4954
    • Decoder (fixed): n/a

Bug description

The calculation of sts[n]->total_brate in ivas_cpe_enc_fx() is not working correctly (at least for some cases):

sts[n]->total_brate = L_shl( div_l( hCPE->element_brate, n_CoreChannels ), 1 );                                                      /* Q0 */

For example, for a total_brate of 384000, the expression returns 65534.

Ways to reproduce

Commandline from #2317:

IVAS_cod -dtx -masa 2 ltv48_MASA2TC.met scripts/switchPaths/sw_13k2_512k.bin 48 ltv48_MASA2TC.wav bit.192