ivas_decode_masaism_metadata decision logic change due to precision difference
Commands for testing:
OMASA 2Dir2TC 3ISM at 80 kbps, 32kHz in, 16kHz out, 5.1.4 out
IVAS_cod_ref -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met 80000 32 testv/ltv32_OMASA_3ISM_2TC.wav bit
IVAS_dec 5_1_4 16 bit testv/ltv32_OMASA_3ISM_2TC.wav_5_1_4_80000_32-16.tst
In the function ivas_decode_masaism_metadata
for frame 581 in above test case, it was observed that a slight precision loss leads to incorrect azimuth computation, which in turn causes a high MLD. In the FOR loop, when obj = 2
, the code enters the else block for the condition (azimuth * hMasaIsmData->q_azimuth_old[obj] > 0)
. Here, delta_phi
is calculated, and the azimuth is then evaluated based on this.
For the if condition (azimuth - hMasaIsmData->q_azimuth_old[obj] > delta_phi)
, the left-hand side (LHS) is evaluated as 25.7142868 and the right-hand side (RHS) as 25.7142849 in float code. However, in the Fixed scenario, the LHS and RHS are both evaluated as 107847680 in Q22. Since LHS equals RHS, the code enters the else block taking different path as compared with float code.
Any suggestions to handle the comparison would be helpful.