Commit 7897b35e authored by multrus's avatar multrus
Browse files

Merge branch 'basop-2491-decoding-MDCT-stereo-64-kbps-with-JBM-introduces-click' into 'main'

Resolve: "Decoding MDCT Stereo 64 kbps with JBM introduces click"

See merge request !2909
parents 41d59e73 047daf99
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#define FIX_2488_PREVENT_NEG_PITCH                      /* VA: Fix for 2488, use saturation to prevent possible wrap-around, thus negative pitch values */
#define FIX_1547_ISMDTX_HANDLE                          /* VA: float issue 1547: fix use of 'hISMDTX' handle */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_BASOP_2491_MDCT_JBM_CLICK                   /* FhG: BASOP #2491: Fix Q_synth after TCX concealment (using ACELP concealment) */

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

+4 −0
Original line number Diff line number Diff line
@@ -941,6 +941,9 @@ void con_tcx_fx(
    }
    ELSE
    {
#ifdef FIX_BASOP_2491_MDCT_JBM_CLICK
        tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/
#else
        IF( NE_16( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
        {
            if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) )
@@ -953,6 +956,7 @@ void con_tcx_fx(
        {
            tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/
        }
#endif
        st->Q_syn_factor = 0;
        move16();
        st->Q_syn = Q_syn;
+11 −0
Original line number Diff line number Diff line
@@ -766,7 +766,18 @@ ivas_error ivas_core_dec_fx(
         *---------------------------------------------------------------------*/

        /*core_switching_post_dec*/
#ifdef FIX_BASOP_2491_MDCT_JBM_CLICK
        IF( EQ_16( sts[n]->element_mode, IVAS_CPE_MDCT ) && GT_32( sts[n]->core_brate, SID_2k40 ) ) // In this case, st->Q_syn_factor was already applied earlier in ivas_mdct_core_reconstruct_fx()
        {
            Q_synth = sub( 15, e_sig[0] );
        }
        ELSE
        {
            Q_synth = add( sub( 15, e_sig[0] ), st->Q_syn_factor );
        }
#else
        Q_synth = add( sub( 15, e_sig[0] ), st->Q_syn_factor );
#endif

        IF( st->cldfbSyn != NULL )
        {
+1 −1
Original line number Diff line number Diff line
@@ -1306,7 +1306,7 @@ typedef struct Decoder_State
    Word16 Q_syn;
    Word16 Q_syn2;
    Word16 Q_syn_cng;
    Word16 Q_syn_factor; // This q_factor is used to avoid using fix Q0 for synth[] at the output of con_tcx_ivas_fx() and ivas_core_dec_fx(). For con_tcx_ivas_fx, it is used for two consecutive TCX concealment processes and It cannot be greater than 0.
    Word16 Q_syn_factor; // This q_factor is used to avoid using fix Q0 for synth[] at the output of con_tcx_fx() and ivas_core_dec_fx(). For con_tcx_fx, it is used for two consecutive TCX concealment processes and It cannot be greater than 0.
    Word16 prev_Q_syn;
    Word16 prev_Q_bwe_exc;