[non-BE][split-non-BE][allow regression] Resolve "[Regression2553] Artifact in HOA3, Bitrate Switching"
- Related issues:
- Requested reviewers:
Reason why this change is needed
- To remove/mitigate an encoder regression introduced by MR2553. The cause is that a link between Q_new and the scale of old exc/syn buffers was not considered for the calculation of Q_new.
- In cases where hLPDmem->mem_w0 is obtained from st->wspeech_enc[-1] the scale is wrong and needs to be corrected.
- A saturation issue inside transf_cdbk_enc_fx() was triggered which requires mitigation to avoid decoded output that could be easily off by a factor 2 on transients.
- The scale of st->mem_preemp_preQ_fx was not correct when Q_new changes from one frame to another.
Description of the change
- Use the values of hLPDmem->q_lpd_old_exc and hLPDmem->q_lpd_syn to limit Q_new, and remove another empirically determined "headroom" limit which is not required once the links between Q_new and other stored signals are identified and included in the calculation of Q_new. This removes the need to worsen the quality for audio frames were it is not needed and avoid saturations in an optimal way.
- Do the right scaling of hLPDmem->mem_w0 when is copied from st->wspeech_enc.
- Inside transf_cdbk_enc_fx() the scale of x_norm[] is changed locally to avoid saturation.
- st->mem_preemp_preQ_fx is adapted together with all similar state variables according to the difference of Q_new and st->prev_Q_new.
Affected operating points
- All modes were ACELP switches its internal sampling rate are potentially affected.
Closes #2518 (closed)
Edited by Manuel Jander