Commit 608f1fab authored by multrus's avatar multrus
Browse files

Merge branch '1947-fix-decoder-high-mld-for-stereo-to-mono' into 'main'

[allow-regression] Resolve "Decoder: High MLD for Stereo at 24.4 kbps to Mono"

Closes #1947

See merge request !2505
parents a4a10562 c490bb50
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@
#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO          /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */
#define FIX_2015_PREMPH_SAT_ALT                              /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor, allows preemphis to get 1 more bit headroom */
#define FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE       /* Nokia: Fixes float  to fx conversion in decoder app with object edit file interface */

#define FIX_1947_DEC_HIGH_MLD_FOR_STEREO2MONO                /* FhG: Make Q-factor of synth_16_fx and output_16_fx dynamic to prevent overflow in HQ_CORE mode */
/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+8 −2
Original line number Diff line number Diff line
@@ -643,8 +643,14 @@ ivas_error ivas_core_dec_fx(
            ivas_hq_core_dec_fx( st, synth_16_fx[n], &Q_synth, output_frame, NORMAL_HQ_CORE, core_switching_flag[n], output_16_fx[n], &Q_output );

            Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_output ) ); // Q11
#ifdef FIX_1947_DEC_HIGH_MLD_FOR_STEREO2MONO
            st->Q_syn_factor = s_min( 0, s_min( Q_synth, Q_output ) );
            Scale_sig( synth_16_fx[n], output_frame, sub( st->Q_syn_factor, Q_synth ) ); // st->Q_syn_factor
            Scale_sig( output_16_fx[n], L_FRAME48k, sub( st->Q_syn_factor, Q_output ) ); // st->Q_syn_factor
#else
            Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) );                       // Q0
            Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) );                       // Q0
#endif
        }

        /*---------------------------------------------------------------------*