Commit 531cf2a5 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Pulled in changes for float fix for issue 791 and svd threshold updated in float code

parent 7618cbdd
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ ivas_error ivas_core_enc(
    const int16_t flag_16k_smc                                   /* i  : flag to indicate if the OL SMC is run at 16 kHz */
);
#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_core_dec(
ivas_error ivas_core_dec_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    SCE_DEC_HANDLE hSCE,                                        /* i/o: SCE decoder structure                   */
    CPE_DEC_HANDLE hCPE,                                        /* i/o: CPE decoder structure                   */
+166 −163
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@

#define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */

#define NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES /* FhG: issue 1133: skip de-whitening of bg noise shape after frameloss period if the first good frame is an SID */
#define NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID /* FhG: issue 1133: in TCX PLC, don't scale hHQ_core->old_out after applying fade to noise in burst frame error */

/* ##################### End NON-BE switches ########################### */
#define FIX_740_HQ_CORE_OVA // Proposed fix to solve overlap and add issue for HQ_CORE
#define FIX_746  // proposed fix to solve low bit-rate frame boundaries issues 
+25 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
 * Principal IVAS core decoder routine, where number of core channels is 1 or 2
 *-------------------------------------------------------------------*/
#ifdef IVAS_FLOAT_FIXED
ivas_error ivas_core_dec(
ivas_error ivas_core_dec_fx(
    Decoder_Struct *st_ivas,                         /* i/o: IVAS decoder structure             */
    SCE_DEC_HANDLE hSCE,                             /* i/o: SCE decoder structure              */
    CPE_DEC_HANDLE hCPE,                             /* i/o: CPE decoder structure              */
@@ -279,7 +279,12 @@ ivas_error ivas_core_dec(
        test();
        test();
        test();
        test();
#ifdef NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID
        IF( !st->bfi && st->prev_bfi && GT_32( st->total_brate, SID_2k40 ) && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && st->hTcxDec != NULL )
#else
        IF( !st->bfi && st->prev_bfi && ( EQ_16( st->last_core_bfi, TCX_20_CORE ) || EQ_16( st->last_core_bfi, TCX_10_CORE ) ) && st->hTcxDec != NULL )
#endif
        {
            conceal_eof_gain32 = L_shl( L_deposit_l( st->hTcxDec->conceal_eof_gain ), 1 );

@@ -795,10 +800,18 @@ ivas_error ivas_core_dec(
                sts[1]->hHQ_core->Q_old_wtda = sub( 15, sts[1]->hHQ_core->exp_old_out );
            }
        }

        test();
        test();
#ifdef NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES
        /* On first good active frame after frameloss undo the whitening of the bg noise shape */
        IF( GT_32( sts[0]->core_brate, SID_2k40 ) && sts[0]->bfi == 0 && EQ_16( sts[0]->prev_bfi, 1 ) )
        {
#else
        IF( sts[0]->bfi == 0 && EQ_16( sts[0]->prev_bfi, 1 ) )
        {
            /* On first good frame after frameloss undo the whitening of the bg noise shape */
#endif
            FOR( n = 0; n < n_channels; ++n )
            {
                IF( NE_16( sts[n]->last_core_bfi, ACELP_CORE ) )
@@ -1754,7 +1767,11 @@ ivas_error ivas_core_dec(
            st->flagGuidedAcelp = 0;
        }

#ifdef NONBE_MDCT_ST_PLC_DO_NOT_SCALE_OLD_OUT_IF_FIRST_GOOD_IS_SID
        if ( !st->bfi && st->prev_bfi && st->total_brate > SID_2k40 && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL )
#else
        if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL )
#endif
        {
            v_multc( st->hHQ_core->old_out, st->hTcxDec->conceal_eof_gain_float * st->last_concealed_gain_syn_deemph_float, st->hHQ_core->old_out, st->hTcxDec->L_frameTCX );
            v_multc( st->hHQ_core->old_outLB, st->hTcxDec->conceal_eof_gain_float * st->last_concealed_gain_syn_deemph_float, st->hHQ_core->old_outLB, st->L_frame );
@@ -1968,9 +1985,16 @@ ivas_error ivas_core_dec(
            updateBuffersForDmxMdctStereo( hCPE, output_frame, output, synth );
        }

#ifdef NONBE_MDCT_ST_DTX_SKIP_DEWHITENING_OF_NOISE_SHAPES_ON_SID_FRAMES

        /* On first good active frame after frameloss undo the whitening of the bg noise shape */
        if ( sts[0]->core_brate > SID_2k40 && sts[0]->bfi == 0 && sts[0]->prev_bfi == 1 )
        {
#else
        if ( sts[0]->bfi == 0 && sts[0]->prev_bfi == 1 )
        {
            /* On first good frame after frameloss undo the whitening of the bg noise shape */
#endif
            for ( n = 0; n < n_channels; ++n )
            {
                if ( sts[n]->last_core_bfi != ACELP_CORE )
+2 −2
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ ivas_error ivas_cpe_dec_fx(
    test();
    IF( NE_16( hCPE->element_mode, IVAS_CPE_DFT ) || ( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hCPE->hStereoDft->hConfig->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) )
    {
        IF( NE_32( ( error = ivas_core_dec( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, NULL, st_ivas->sba_dirac_stereo_flag ) ), IVAS_ERR_OK ) )
        IF( NE_32( ( error = ivas_core_dec_fx( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, NULL, st_ivas->sba_dirac_stereo_flag ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
@@ -611,7 +611,7 @@ ivas_error ivas_cpe_dec_fx(
        set32_fx( DFT_fx[1], 0, STEREO_DFT_BUF_MAX );

        /* core decoder */
        IF( NE_32( ( error = ivas_core_dec( NULL, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, DFT_fx, 0 ) ), IVAS_ERR_OK ) )
        IF( NE_32( ( error = ivas_core_dec_fx( NULL, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, DFT_fx, 0 ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ ivas_error ivas_sce_dec_fx(

    set32_fx( output[0], 0, L_FRAME48k );

    IF( NE_32( ( error = ivas_core_dec( st_ivas, hSCE, NULL, NULL, 1, output, outputHB, NULL, st_ivas->sba_dirac_stereo_flag ) ), IVAS_ERR_OK ) )
    IF( NE_32( ( error = ivas_core_dec_fx( st_ivas, hSCE, NULL, NULL, 1, output, outputHB, NULL, st_ivas->sba_dirac_stereo_flag ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
Loading