Potential porting bug in map_params_dirac_to_stereo
# Basic info <!--- Add commit SHA used to reproduce --> - Float reference: - Encoder (float): - Decoder (float): 2a32cceaf0d7ce3482cb05e5c12951e95a8a552a - Fixed point: - Encoder (fixed): - Decoder (fixed): a8ff39cd03d151fa6c9a57b1d85de40c806f3772 # Bug description This took a bit of looking but it seems that there is indexing bug done in porting for shift step. See below: Float ```c /* Clamp values here. [-1, 1] is the allowed range, but due to precision issues they can be slightly off which can cause problems later. */ side_gain[b] *= sqrtf( 1.f - diffuseness[b] ); side_gain[b] = max( min( side_gain[b], 1 ), -1 ); side_gain[b + STEREO_DFT_BAND_MAX] *= sqrtf( 1.f - diffuseness[b] ); side_gain[b + STEREO_DFT_BAND_MAX] = max( min( side_gain[b + STEREO_DFT_BAND_MAX], 1 ), -1 ); ``` BASOP ```c /* Clamp values here. [-1, 1] is the allowed range, but due to precision issues they can be slightly off which can cause problems later. */ /* In Q31, this clamping happens implicitly */ q_sqrt = 0; move16(); side_gain[b] = Mpy_32_32( side_gain[b], Sqrt32( L_sub( MAX_32, diffuseness[b] ), &q_sqrt ) ); /*Q31 - q_sqrt*/ move32(); IF( q_sqrt ) { side_gain[b] = L_shl( side_gain[b], q_sqrt ); /*Q31*/ q_sqrt = 0; move16(); } side_gain[b + STEREO_DFT_BAND_MAX] = Mpy_32_32( side_gain[b + STEREO_DFT_BAND_MAX], Sqrt32( L_sub( MAX_32, diffuseness[b] ), &q_sqrt ) ); /*Q31 - q_sqrt*/ move32(); IF( q_sqrt ) { BUG HERE --> side_gain[b + STEREO_DFT_BAND_MAX] = L_shl( side_gain[b], q_sqrt ); /*Q31*/ q_sqrt = 0; move16(); } ``` I am pretty sure that the assignment should be done from `side_gain[b + STEREO_DFT_BAND_MAX]` if I understand this correctly. <!--- Below are labels that will be added but are not shown in description. This is a template to help fill them. Add further information to the first row and remove and add labels as necessary. -->
issue