Skip to content

One bit systematic error between BASOP and float decoder MASA EXT output of energy ratios

Basic info

Bug description

There seems to be some kind of systematic difference in the metadata output in MASA EXT output mode. Namely, the directToTotal-ratio values and diffuseToTotal-ratio values in the final extOutMeta-structure may have difference of one quite often. With low directToTotal-ratio values, this is not so audible but this does generate unnecessary difference in metadata output.

I am not sure how the difference come to be but it is probably limited to function pair create_masa_ext_out_meta_fx and create_masa_ext_out_meta. It might be this part

IF( EQ_32( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], ONE_IN_Q30 ) )
{
    hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf]--;
}
UWord8 tmp = (UWord8) L_shr( hQMetaData->q_direction[dir].band_data[b_old].energy_ratio_fx[sf], Q30 - 8 ); // Q8
move16();
extOutMeta->directToTotalRatio[dir][sf][b_new] = tmp; // Q8
move16();

When considering how much this affects, the result is that significantly more frames are affected than are not.

Ways to reproduce

Happens with many operating points but, for example, this is easy for testing as the difference is present already in second frame.

IVAS_cod -masa 1 ltv48_MASA1TC.met -max_band wb 13200 32 ltv32_MASA1TC.wav test_0103.bs
IVAS_dec EXT 48 test_0103.bs 0103_ltv32_MASA1TC.wav_13k2_32-48___EXT.wav