Commit e1f2318f authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into ci/check-for-regressions-in-mr-pipelines

parents e234feb5 3f246845
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -154,6 +154,10 @@
#define FIX_802_1137_1137_GSC_IVAS_FXFLT_DECODING   /* VA: ISSUES 802 and 1137 Made sure that float and fixed point GCS bit allocation is the same during IVAS modes  */
#define FIX_810_PREVENT_UNECESSARY_SAT_IN_TC        /* VA : Prevent an unnecessary saturation that can happen in TC, have a minimal impact on most cases. Significant improvement for the last segment of LTV when TC is triggered */
#define FIX_826_PRECISION_LOST_AND_COMPL            /* VA : Fix lost of precision that leads to unnecessary high noise floor and to some framing artifacts */ 
#ifdef  FIX_826_PRECISION_LOST_AND_COMPL            
#define FIX_833_CORRECTION_to_826                   /* VA : fix indexing error introduced in 826 */
#endif

/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+3 −3
Original line number Diff line number Diff line
@@ -5964,7 +5964,7 @@ void TonalMDCTConceal_Apply(
void TonalMDCTConceal_Apply_ivas_fx(
    TonalMDCTConcealPtr hTonalMDCTConc,  /*IN */
    Word32 *mdctSpectrum,                /*IN/OUT*/
    Word16 *mdctSpectrum_exp,           /*IN */
    Word16 mdctSpectrum_exp[L_FRAME48k], /*IN */
    const PsychoacousticParameters *psychParamsCurrent );

/* Conceals the lost frame using the FD signal previously stored using
+14 −23
Original line number Diff line number Diff line
@@ -4911,42 +4911,33 @@ void decoder_tcx_noiseshaping_igf_fx(
        set32_fx( x_fx + L_spec, 0, sub( L_frameTCX, L_spec ) );
    }

    Word16 prev_x_e, curr_x_e;
    prev_x_e = *x_e;
    move16();

    /* PLC: [TCX: Tonal Concealment] */
    test();
    test();
    IF( bfi && st->tonal_mdct_plc_active && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
    {
        TonalMDCTConceal_Apply_ivas_fx( st->hTonalMDCTConc, x_fx, x_e, st->hTcxCfg->psychParamsCurrent );
        Word16 tmp_x_fx_exp[L_FRAME48k], temp = -MAX_16, i;
        move16();

        set16_fx( tmp_x_fx_exp, *x_e, L_frameTCX );
        TonalMDCTConceal_Apply_ivas_fx( st->hTonalMDCTConc, x_fx, tmp_x_fx_exp, st->hTcxCfg->psychParamsCurrent );

        /* If exponent has been updated after TonalMDCTConceal_Apply, then shift the spectrum to common exponent. */
        curr_x_e = *x_e;
        move16();
        IF( NE_16( curr_x_e, prev_x_e ) )
        {
            *x_e = s_max( curr_x_e, prev_x_e );
        FOR( i = 0; i < L_frameTCX; i++ )
        {
                Word16 n_idx = st->hTonalMDCTConc->pTCI->numIndexes;
                Word16 l_idx = st->hTonalMDCTConc->pTCI->lowerIndex[0];
                Word16 u_idx = st->hTonalMDCTConc->pTCI->upperIndex[n_idx - 1];
                test();
                IF( GE_16( i, l_idx ) && LE_16( i, u_idx ) )
                {
                    x_fx[i] = L_shr( x_fx[i], sub( *x_e, curr_x_e ) );
                    move32();
            temp = s_max( temp, tmp_x_fx_exp[i] );
        }
                ELSE

        {
                    x_fx[i] = L_shr( x_fx[i], sub( *x_e, prev_x_e ) );
            *x_e = temp;
            move16();
            FOR( i = 0; i < L_frameTCX; i++ )
            {
                x_fx[i] = L_shr( x_fx[i], sub( temp, tmp_x_fx_exp[i] ) );
                move32();
            }
        }
    }
    }

    test();
    IF( st->hTonalMDCTConc != NULL && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
+14 −30
Original line number Diff line number Diff line
@@ -2654,45 +2654,29 @@ void ivas_mdct_core_tns_ns_fx(

        IF( ( bfi != 0 ) && ( st->tonal_mdct_plc_active != 0 ) )
        {
            Word16 q_x, q_x_old;
            FOR( Word16 i = 0; i < FDNS_NPTS; i++ )
            Word16 tmp_x_fx_exp[L_FRAME48k], temp = -MAX_16, i;
            move16();
            FOR( i = 0; i < FDNS_NPTS; i++ )
            {
                st->hTonalMDCTConc->secondLastBlockData.scaleFactors_max_e = s_max( st->hTonalMDCTConc->secondLastBlockData.scaleFactors_max_e, st->hTonalMDCTConc->secondLastBlockData.scaleFactors_exp[i] );
            }
            q_x_old = sub( 31, x_e[ch][0] );
            TonalMDCTConceal_Apply_ivas_fx( st->hTonalMDCTConc, x_fx[ch][0], &x_e[ch][0], st->hTcxCfg->psychParamsCurrent );
            q_x = sub( 31, x_e[ch][0] );
            // Fix to float
            IF( LT_16( q_x_old, q_x ) )
            {
                x_e[ch][0] = sub( 31, q_x_old );
                move16();
                FOR( Word16 i = 0; i < st->hTonalMDCTConc->pTCI->numIndexes; i++ )
                {
                    FOR( Word16 l = st->hTonalMDCTConc->pTCI->lowerIndex[i]; l <= st->hTonalMDCTConc->pTCI->upperIndex[i]; l++ )

            set16_fx( tmp_x_fx_exp, x_e[ch][0], L_FRAME48k );
            TonalMDCTConceal_Apply_ivas_fx( st->hTonalMDCTConc, x_fx[ch][0], tmp_x_fx_exp, st->hTcxCfg->psychParamsCurrent );

            FOR( i = 0; i < L_FRAME48k; i++ )
            {
                        x_fx[ch][0][l] = L_shr( x_fx[ch][0][l], sub( q_x, q_x_old ) );
                        move32();
                    }
                temp = s_max( temp, tmp_x_fx_exp[i] );
            }
            }
            ELSE

            {
                x_e[ch][0] = sub( 31, q_x );
                x_e[ch][0] = temp;
                move16();
                FOR( Word16 i = 0; i < st->hTonalMDCTConc->pTCI->numIndexes; i++ )
                {
                    FOR( Word16 l = 0; l < st->hTonalMDCTConc->pTCI->lowerIndex[i]; l++ )
                FOR( i = 0; i < L_FRAME48k; i++ )
                {
                        x_fx[ch][0][l] = L_shr( x_fx[ch][0][l], sub( q_x_old, q_x ) );
                    x_fx[ch][0][i] = L_shr( x_fx[ch][0][i], sub( temp, tmp_x_fx_exp[i] ) );
                    move32();
                }
                    FOR( Word16 l = st->hTonalMDCTConc->pTCI->upperIndex[i] + 1; l < L_spec[ch]; l++ )
                    {
                        x_fx[ch][0][l] = L_shr( x_fx[ch][0][l], sub( q_x_old, q_x ) );
                        move32();
                    }
                }
            }
        }

+2 −2
Original line number Diff line number Diff line
@@ -2145,13 +2145,13 @@ void stereo_icBWE_decproc_fx(
#endif
                }

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
#if !defined FIX_826_PRECISION_LOST_AND_COMPL || defined FIX_833_CORRECTION_to_826
                FOR( i = 0; j < dftOvlLen; i++ )
#else
                FOR( i = 0; i < dftOvlLen; i++ )
#endif
                {
#ifndef FIX_826_PRECISION_LOST_AND_COMPL
#if !defined FIX_826_PRECISION_LOST_AND_COMPL || defined FIX_833_CORRECTION_to_826
                    Word16 tmp_mul = mult0( STEREO_DFT32MS_STEP, ( sub( dftOvlLen, add( 1, j ) ) ) );
                    hStereoICBWE->memTransitionHB_fx[0][memOffset + i] = Mpy_32_16_1( outputHB[0][output_frame - i - 1], win_dft_fx[tmp_mul] );
                    move32();
Loading