[Non-BE] Add FIX_1461_CNG_BW_SWITCHING to address BW switching in Stereo CNG
- Related issues: #1461 (closed)
- Requested reviewers: @kiene, @janssontoftg
Reason why this change is needed
- During inactive periods (SID or NO_DATA_FRAME), the bandwidth is kept the same. This is inherited from EVS (see https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/blob/main/lib_enc/dtx.c#L420). The stereo parameters are however computed before the VAD is run, using the max_bwidth which may be input from the encoder. This means the bandwidth for the stereo parameters may be lower than the bandwidth decided in dtx.c. In this case, old parameters could be used for the higher bands, or just the parameters from the initialization in case the decoding starts with a SID frame.
- The Stereo CNG did not account for that the number of bands may have changed since the parameters were derived, if a lower max_bwidth was input and it was forced back to a higher (previous) bandwidth during an inactive period. The updates for the full resolution used in active frames did not include the full bandwidth, which led to incorrect update of the side gain for these bands. This triggered an assert in the side gain quantizer, where the side gain exceeded the range of [-1,1].
Description of the change
- The last value of the side gain and prediction gain are replicated for the higher bands in the stereo parameter analysis. In case a higher bandwidth is forced, the value of the last band will be used.
- The number of bands is updated before changing to the lower resolution for the Stereo CNG. This ensures that the correct number of bands is used in the updates of the parameters for the active coding full resolution.
Affected operating points
- Non-BE for Stereo DTX with bandwidth switching or where the bandwidth detector may indicate a lower bandwidth during an inactive period.
Edited by norvell