Commit 35147c34 authored by vaillancour's avatar vaillancour
Browse files

prepare lib_dec and lib_enc for wmc_tools usage

parent 87afc44c
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,9 @@ void HQ_FEC_Mem_update_fx(
        move16();
        hHQ_core->old_is_transient[0] = is_transient;
        move16();

#ifdef ADD_IVAS_HQ_CODE_FEC
    }
#endif
        return;
    }
#endif
+2 −3
Original line number Diff line number Diff line
@@ -1261,11 +1261,10 @@ ivas_error acelp_core_dec_ivas_fx(
        FEC_lsf2lsp_interp( st, st->L_frame, Aq_fx, lsf_new_fx, lsp_new_fx );
#ifndef MSAN_FIX
        for ( int nsf = 0; nsf < NB_SUBFR16k; nsf++ )
        {
#else
        FOR( Word32 nsf = 0; nsf < st->nb_subfr; nsf++ )
        {
#endif
        {
                Scale_sig( Aq_fx + ( nsf * ( M + 1 ) ), M + 1, sub( norm_s( Aq_fx[imult3216( nsf, M + 1 )] ), Q2 ) );
            Aq_fx[imult3216( nsf, M + 1 )] = ONE_IN_Q12;
            move16();
+2 −4
Original line number Diff line number Diff line
@@ -805,12 +805,11 @@ ivas_error ivas_core_dec_fx(
#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 ) )
@@ -1988,12 +1987,11 @@ ivas_error ivas_core_dec(

        /* 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 )
+10 −2
Original line number Diff line number Diff line
@@ -1708,16 +1708,20 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512(
    {
        FOR( m = 0; m < hQMetaData->q_direction[0].cfg.nblocks; m++ )
        {
            hQMetaData->q_direction[0].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[0][b][m] );
            move32();
        }
    }
#else
    FOR( b = 0; b < MASA_MAXIMUM_CODING_SUBBANDS; b++ )
    {
        FOR( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ )
        {
#endif // MSAN_FIX
            hQMetaData->q_direction[0].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[0][b][m] );
            move32();
        }
    }
#endif // MSAN_FIX
    IF( EQ_32( hQMetaData->no_directions, 2 ) )
    {
#ifdef MSAN_FIX
@@ -1725,16 +1729,20 @@ Word16 ivas_qmetadata_dec_decode_hr_384_512(
        {
            FOR( m = 0; m < hQMetaData->q_direction[1].cfg.nblocks; m++ )
            {
                hQMetaData->q_direction[1].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[1][b][m] );
                move32();
            }
        }
#else
        FOR( b = 0; b < MASA_MAXIMUM_CODING_SUBBANDS; b++ )
        {
            FOR( m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES; m++ )
            {
#endif // MSAN_FIX
                hQMetaData->q_direction[1].band_data[b].energy_ratio_fx[m] = W_round64_L( W_nrg_ratio[1][b][m] );
                move32();
            }
        }
#endif // MSAN_FIX
    }
    /* Store status information for renderer use */
    hQMetaData->ec_flag = 0;
+7 −7
Original line number Diff line number Diff line
@@ -1685,25 +1685,25 @@ static Word8 logarithmic_search_fx( const apa_state_t *ps,
            /* update max corr */
            IF( LT_16( ps->scale, 100 ) ){
                /* shrinking: prefer greater synchpos for equal coeff */
                BASOP_SATURATE_WARNING_OFF_EVS
                BASOP_SATURATE_WARNING_OFF_EVS;
                    IF( GE_32( coeff, coeff_max ) ){
                        coeff_max = L_add( coeff, 0 );
            *synchpos = i;
            move16();
        }
        BASOP_SATURATE_WARNING_ON_EVS
                    BASOP_SATURATE_WARNING_ON_EVS;
    }
            ELSE
            {
                /* extending: prefer smaller synchpos for equal coeff */
        BASOP_SATURATE_WARNING_OFF_EVS
                BASOP_SATURATE_WARNING_OFF_EVS;
        IF( GT_32( coeff, coeff_max ) )
        {
            coeff_max = L_add( coeff, 0 );
            *synchpos = i;
            move16();
        }
        BASOP_SATURATE_WARNING_ON_EVS
        BASOP_SATURATE_WARNING_ON_EVS;
    }
}
/* backup old search range */
Loading