Crash at 24.4 kbps while decoding fine gain and preecho
in 6aad3441, there is a saturation in fine gain PVQ decoding causing a crash at 24.4 kbps for the following bitstream (created with the floating point encoder)
Once unzipped, the command line is: IVAS_DEC STEREO 32 stereo_24400_32.bit syn
The problem is located in low_rate_band_att_fx.c around line 343. A solution could be to use the _sat operator, but it would be good if someone having a better knowledge of this function can confirm that saturations are acceptable there (@norvell ?) :
#ifdef BASOP_NOGLOB
fg_pred[band] = round_fx_sat(L_shl_sat(L_tmp, sub(16, exp1))); /*12+exp1+16-exp1-16=12 */
#else
fg_pred[band] = round_fx(L_shl(L_tmp, sub(16, exp1))); /*12+exp1+16-exp1-16=12 */
#endif
In trans_inv_fx.c around ln 804, _sat operators could be needed as :
#ifdef BASOP_NOGLOB
tmp_fxL1 = L_add_sat( eshbmean2_fx, es_mdct_hb_fx[ind3] );
#else
tmp_fxL1 = L_add( eshbmean2_fx, es_mdct_hb_fx[ind3] );
#endif
With these 2 fixes, the bitstream goes through