Skip to content

Render config reader fails to read combined config file

I created a render config file by combining some of the files from scripts/testv while working on the exhaustive BE test. File is here: https://forge.3gpp.org/rep/ivas-codec-pc/ivas-pc-testfiles/-/blob/knj/tmp-branch-with-shortened-files/render_config.cfg.

All of the files that I combined are valid (and are used in the selftest), but the combined file can not be read:

./IVAS_cod -ism 4 scripts/testv/stvISM1.csv scripts/testv/stvISM2.csv scripts/testv/stvISM3.csv scripts/testv/stvISM4.csv 128000 48 scripts/testv/stv4ISM48n.wav bit_ism4
./IVAS_dec -render_config render_config.cfg -dpid 0 0 0 0 BINAURAL_ROOM_REVERB 48 bit_ism4 out.wav

results in

==================================================================================================
 IVAS Codec Baseline
 
 Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,
 Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
==================================================================================================

Input bitstream file:   bit_ism4
Output synthesis file:  out.wav
        PARAM: DIRECTIVITYCOUNT -> 4
        PARAM: DIRECTIVITY -> [0.0,360.0,0.2512]
        PARAM: DIRECTIVITY -> [0.0,360.0,0.5]
        PARAM: DIRECTIVITY -> [15.0,345.0,0.701]
        PARAM: DIRECTIVITY -> [90.0,270.0,0.1]
        PARAM: FREQUENCYGRIDCOUNT -> 2
        PARAM: ACOUSTICENVIRONMENTCOUNT -> 3
        PARAM: METHOD -> INDIVIDUALFREQUENCIES
        PARAM: NRBANDS -> 31
        PARAM: FREQUENCIES -> [20.0,25.0,31.5,40.0,50.0,63.0,80.0,100.0,125.0,160.0,200.0,250.0,315.0,400.0,500.0,630.0,800.0,1000.0,1250.0,1600.0,2000.0,2500.0,3150.0,4000.0,5000.0,6300.0,8000.0,10000.0,12500.0,16000.0,20000.0]
        PARAM: METHOD -> INDIVIDUALFREQUENCIES
        PARAM: NRBANDS -> 24
        PARAM: FREQUENCIES -> [50.0,63.0,80.0,100.0,125.0,160.0,200.0,250.0,315.0,400.0,500.0,630.0,800.0,1000.0,1250.0,1600.0,2000.0,2500.0,3150.0,4000.0,5000.0,6300.0,8000.0,10000.0]
        PARAM: FREQUENCYGRIDINDEX -> 0
        PARAM: PREDELAY -> 0.1
        PARAM: RT60 -> [1.3622,1.4486,1.3168,1.5787,1.4766,1.3954,1.2889,1.3462,1.0759,1.0401,1.0970,1.0850,1.0910,1.0404,1.0499,1.0699,1.1028,1.1714,1.1027,1.0666,1.0550,1.0553,1.0521,1.0569,1.0421,0.97822,0.80487,0.75944,0.71945,0.61682,0.60031]
        PARAM: DSR -> [1.8811E-08,2.1428E-08,1.3972E-08,1.51E-08,1.287E-08,1.8747E-08,2.413E-08,3.9927E-08,8.9719E-08,1.902E-07,3.702E-07,6.1341E-07,7.1432E-07,6.5331E-07,4.6094E-07,5.4683E-07,7.0134E-07,6.856E-07,7.114E-07,6.9604E-07,5.2939E-07,5.699E-07,6.1773E-07,5.7488E-07,4.7748E-07,2.7213E-07,1.3681E-07,1.0941E-07,6.2001E-08,2.8483E-08,2.6267E-08]
        PARAM: FREQUENCYGRIDINDEX -> 1
        PARAM: PREDELAY -> 0.108
        PARAM: RT60 -> [0.87,0.66,0.47,0.41,0.32,0.37,0.28,0.30,0.29,0.29,0.28,0.30,0.31,0.34,0.34,0.34,0.34,0.33,0.32,0.29,0.28,0.24,0.24,0.2]
        PARAM: DSR -> [2.511887E-07,1E-07,1.2589251E-07,1E-07,5.01187E-08,5.01187E-08,7.9432844E-08,1E-07,6.309576E-08,5.01187E-08,7.9432844E-08,1E-07,5.01187E-08,1E-07,7.9432844E-08,6.309576E-08,7.9432844E-08,5.01187E-08,6.309576E-08,3.9810708E-08,3.9810708E-08,2.511887E-08,1.9952632E-08,1.2589251E-08]
        PARAM: EARLYREFLECTIONSSIZE -> [4.0,4.0,5.0]
        PARAM: ABSORPTIONCOEFFS -> [0.1,0.2,0.2,0.2,0.1,0.1]
        PARAM: LOWCOMPLEXITY -> TRUE
        PARAM: LISTENERORIGIN -> [-1,0.5,1.5]
        PARAM: FREQUENCYGRIDINDEX -> 1
        PARAM: PREDELAY -> 0.108
        PARAM: RT60 -> [0.87,0.66,0.47,0.41,0.32,0.37,0.28,0.30,0.29,0.29,0.28,0.30,0.31,0.34,0.34,0.34,0.34,0.33,0.32,0.29,0.28,0.24,0.24,0.2]
Invalid value RT60 in renderer configuration file.

Failed to read renderer configuration from file ../short-ltv/render_config.cfg

I debugged a little and I noticed that when reading this RT60 vector, in render_config_reader.c:2298:

if ( read_txt_vector( pValue, pRenderConfigReader->pFG[idx].nrBands, pRenderConfigReader->pAE[acIdx].pRT60 ) )

idx, which in my understanding should be the FrequencyGrid Index (?) has a value of 2, even though the index is 1 for this acoustic environment. This results in the expected length inside the function is 0 and the comparison with the length inferred from the file content causes the reader to abort. Maybe my file is simply malformed, but this seems fishy and might need to be looked at.