Incorrect TNS grouping and TNS5 interleaving in Stereo MDCT core when output_fs != input_fs
Basic info
- Commit SHA: 287f69b7
Bug description
TNS in the stereo TCX core can be applied before or after SNS. When it is applied before and the output sampling rate of the decoder is different from the input sampling rate of the encoder, the TNS function already ungroups the spectrum for the length of the output frame, but SNS is still applied on the internal fs frame length. Also, in the subsequent TNS call, the spectrum is de-interleaved with the wrong frame length again. This causes the output signal to be unsmooth, see screenshot below:
This issue occurs only very seldom and may not always be audible as the present transient may mask the discontinuities in the signal. This bug, however, was found to be more problematic in fixed-point and caused this issue there: sa4/audio/ivas-basop#1805 (closed).
Ways to reproduce
IVAS_cod -masa 2 ltv48_MASA2TC.met -max_band swb 64000 16 ltv16_MASA2TC.wav test_0284.bs
IVAS_dec EXT 48 test_0284.bs 0284_ltv16_MASA2TC.wav_64k_16-48___EXT.wav
The issue happens at 0:57.12 seconds.