OSBA EXT output wrong for FOA/HOA2 inputs
The OSBA EXT output is wrong: the number of output channels is always 16 (HOA3 channels) + ISM channels regardless of the ambisonics order at the codec input. Thus e.g. OSBA FOA input that is outputted to EXT should have 4 (FOA channels) + ISM channels.
I think that the current (wrong) logic comes from days when the ambisonics order was not always part of the OSBA bitstream and was not corrected later after #1061 (closed) was solved.
Note that TS26.253 mentions the following:
If EXT output is configured a. SBA is rendered to HOA3 (see clauses 6.4.6.5.3 or 6.4.6.5.4) b. Object audio channels are copied from the transport-channel buffer to the output buffer
which is, however, not correct in my view as well. I believe (and see also discussion at https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/wikis/Meetings/Reports/2024-04-09%20Technical%20Matters) that EXT output corresponds to the so-called pass-through operation which outputs the same number of channels and metadata as were inputted to the codec. So I think that the TS text should be corrected too.
From the first look into the source code, at least the following logic is wrong in ivas_init_dec, line 943:
else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
{
hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); // should be FOA/HOA2/HOA3 depending on the decoded st_ivas->sba_order parameter
hDecoderConfig->nchan_out += st_ivas->nchan_ism;
}
and line 984:
if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
{
st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; // should be FOA/HOA2/HOA3
st_ivas->intern_config = IVAS_AUDIO_CONFIG_HOA3; // should be FOA/HOA2/HOA3
st_ivas->hOutSetup.output_config = IVAS_AUDIO_CONFIG_HOA3; // should be FOA/HOA2/HOA3
st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); // should be FOA/HOA2/HOA3
}