OSBA object-editing on uninitialized values
Running OSBA and applying object editing in the binaural rendering output config., e.g.
ivas_cod.exe -ism_sba 4 3 NULL NULL NULL NULL 512000 48 stvOSBA_4ISM_3OA48c.wav bit
ivas_dec.exe -obj_edit NULL binaural 48 bit syn.dec
reveals a risky operation in ivas_sba_dec_render()
function where the gain is edited:
if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
{
float gain = st_ivas->hSbaIsmData->gain_bed;
if ( gain != 1.0f && gain >= 0.0f )
{
for ( ch = 0; ch < nchan_out; ch++ )
{
int16_t i;
for ( i = 0; i < n_samples_sf; i++ )
{
output_f_local[ch][i] *= gain;
}
}
}
}
The editing is done in a loop over nchan_out = 16
in this configuration. However, only 11 channels were used in the preceding processing. The remaining 5 channels are just allocated and hold uninitialized values. Consequently, the multiplication with the gain comprises uninitialised values.
The root of this issue is in the wrong setting of the number of float buffers in st_ivas->p_float_f[]
done in the function ivas_get_nchan_buffers_dec()
and/or st_ivas->hTcBuffer->tc[]
done in the function ivas_jbm_dec_tc_buffer_open()
/ ivas_jbm_dec_tc_buffer_reconfigure()
.
Thus, I thoroughly revised the number of float buffers allocated in the decoder/renderer and encountered that even more configurations had an issue where more than necessary buffers (channels) are allocated. It is thus a general framework issue, not related only to OSBA.
I thus propose to correct all of them. At the same time, I propose a reduction of renderers' buffer lengths for which a subframe signal buffer length is needed, while a frame size is often currently defined for them.