EXT output in format switching
This is a follow up to !2554 (comment 113266).
Currently, the format switching with EXT output does not work due to two fundamental issues that need to be fixed:
- The size of output data buffer is not constant (it is the case for all other output configurations). This size is computed and allocation of this buffer is done before the actual decoding starts in decodeVoIP() resp. decodeG192().
- The size of the output data buffer always correspond to the maximum number of channels, i.e. 20.
- The problem is later: The parameter
nOutChannelsis not updated and always corresponds to the first received frame information. A fix might be straightforward: callIVAS_DEC_GetNumOutputChannels()fromrestartDecoder(). - Then another issue is that
IVAS_DEC_GetDelay()should be likely called from-
restartDecoder()as well and the consequences should be verified. Alternatively, we might ignore it similarly as it is done in case of bitrate switching between modes with different decoder+renderer delay.
-
- To what file(s) the output metadata should be written? Currently, it does not work because the parameter
bsFormatis not up to date when the formatswitchinghappens.
- A solution might be to write out the metadata to individual files and update
bsFormatby:- calling
IVAS_DEC_GetFormat()fromrestartDecoder(). - open so-far-unopened MD output files
- calling
- once switching back to an IVAS format that was already received before (e.g. ISM -> SBA -> ISM), then MD could be appended to a particular file and there are more options:
- either without any intermediate writing, or
- writing zeroed metadata to a particular MD file when a different format is outputted
- or new metadata file can be opened with a unique filename
- In other words, using the example of ISM -> SBA -> ISM, the question is what to do with MD files during decoding SBA.
Comments are welcome. @multrus, @doehla , @pihlajakuja, @pajunen.