Inconvenient Q3 format used in function WB_BWE_gain_pred_fx
The decoder enters function WB_BWE_gain_pred_fx and both, previous and current envelopes (WB_fenv) are computed into format Q3 (16-bit). Thus, the operational range is limited to 32768>>3=4096. Some of the very first energies in this testcase are in the range of 1200. This value beomes multiplied by factor 1.5 into the range 1800. Later, this value is multiplied by 3 (value 5400) and this overflows. The results deviate from the float.
Proposal: Option A) Use Q2 and double the range Option B) The multiplication with factor 3 is only used temporarily in a comparison. It can be replaced by multiplying the other comparison operand with 1/3. Option C) Change (3 * WB_fenc[0]) * WB_fenc[0] into (WB_fenc[0] * WB_fenc[0]) * 3
The current version (on x86) uses saturation in i_mult_sat, but the outcome is not the wanted. We detected this issue, because of issue #1771 (closed).
Testcase command line: IVAS_cod -stereo 32000 16 testv/stvST16c.wav bitstream.192 IVAS_dec STEREO 16 bitstream.192 output.wav