Commit ca6e9ba7 authored by vaclav's avatar vaclav
Browse files

Merge branch 'basop-2297-wrong-scaling-factor-before-the-sba-decoder-for-output_fs-32' into 'main'

[non-BE] Fix scaling factor before the SBA decoder for output_Fs=32

Closes #2297

See merge request !2679
parents 2075549a d905752b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@
#define FIX_1381_BWD                                    /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */
#define FIX_2285_CODE_DECODER_INIT_BW                   /* VA: basop issue 2285: fix core-decoder initialization bandwidth */
#define FIX_2306_MISSING_UPDATE_LOWRATE_PITCH_GAIN      /* Dolby: Fix missing update of low-rate pitch gain in the S/M classifier */
#define FIX_2297_SBA_SCALING_32KHZ                      /* VA: basop issue 2297: Fix scaling factor before the SBA decoder for output_Fs = 32 or 16 */

/* ##################### End NON-BE switches ########################### */

+12 −0
Original line number Diff line number Diff line
@@ -372,7 +372,11 @@ ivas_error ivas_dec_fx(
                move16();
                FOR( i = 0; i < 2; i++ )
                {
#ifdef FIX_2297_SBA_SCALING_32KHZ
                    s = s_min( s, L_norm_arr( p_output_fx[i], output_frame ) - 11 ) /* Guard bits */; // L_frame should be used instead of L_FRAME48k */
#else
                    s = s_min( s, L_norm_arr( p_output_fx[i], L_FRAME48k ) - 11 ) /* Guard bits */; // L_frame should be used instead of L_FRAME48k */
#endif
                }
                FOR( i = 0; i < 2; i++ )
                {
@@ -904,7 +908,11 @@ ivas_error ivas_dec_fx(
                move16();
                FOR( i = 0; i < 2; i++ )
                {
#ifdef FIX_2297_SBA_SCALING_32KHZ
                    s = s_min( s, L_norm_arr( p_output_fx[sba_ch_idx + i], output_frame ) - 11 /* Guard bits */ );
#else
                    s = s_min( s, L_norm_arr( p_output_fx[sba_ch_idx + i], L_FRAME48k ) - 11 /* Guard bits */ );
#endif
                }
                FOR( i = 0; i < 2; i++ )
                {
@@ -1343,7 +1351,11 @@ ivas_error ivas_dec_fx(
                move16();
                FOR( i = 0; i < 2; i++ )
                {
#ifdef FIX_2297_SBA_SCALING_32KHZ
                    s = s_min( s, L_norm_arr( p_output_fx[i], output_frame ) - 11 /* Guard bits */ );
#else
                    s = s_min( s, L_norm_arr( p_output_fx[i], L_FRAME48k ) - 11 /* Guard bits */ );
#endif
                }
                FOR( i = 0; i < 2; i++ )
                {