Commit 819251db authored by vaclav's avatar vaclav
Browse files

remove duplicates of Transient detector handles + editorial improvements to...

remove duplicates of Transient detector handles + editorial improvements to match closer the FLP framework
parent cb50e441
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3152,9 +3152,9 @@ void stereo_tcx_core_enc(
Word16 transient_analysis_ivas_fx(
    TRAN_DET_HANDLE hTranDet,  /* i  : handle transient detection       */
    const Word16 cor_map_LT[], /* i  : LT correlation map  Q_cor_map = Qx */
    Word16 Q_cor_map,
    const Word16 Q_cor_map,
    const Word16 multi_harm_limit, /* i  : multi harmonic threshold Q_multi_harm_limit = Qx */
    Word16 Q_multi_harm_limit );
    const Word16 Q_multi_harm_limit );

void set_transient_stereo_fx(
    CPE_ENC_HANDLE hCPE,  /* i  : CPE structure                           */
+2 −2
Original line number Diff line number Diff line
@@ -693,7 +693,7 @@ void core_encode_openloop_fx(
            test();
            test();
            IF( rf_PLC_Mode == 0 && hRF->rf_gain_tcx[1] != 0 &&
                ( ( st->transientDetection.transientDetector.bIsAttackPresent != 0 && LT_16( hRF->rf_gain_tcx[0], mult_r( hRF->rf_gain_tcx[1], 31785 /*0.97f Q15*/ ) ) ) ||
                ( ( st->hTranDet->transientDetector.bIsAttackPresent != 0 && LT_16( hRF->rf_gain_tcx[0], mult_r( hRF->rf_gain_tcx[1], 31785 /*0.97f Q15*/ ) ) ) ||
                  LT_16( hRF->rf_gain_tcx[0], mult_r( hRF->rf_gain_tcx[1], 29491 /*0.90f Q15*/ ) ) ) )
            {
                TD_mode = 0;
@@ -884,7 +884,7 @@ void core_acelp_tcx20_switching_fx(
                       st->pit_fr2,
                       st->pit_max,
                       st->pit_res_max,
                       &st->transientDetection,
                       st->hTranDet,
                       0,
                       A_q_tcx,
                       M );
+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ void core_signal_analysis_high_bitrate_fx(
                           &hTcxEnc->tcxltp_pitch_int, &hTcxEnc->tcxltp_pitch_fr, &hTcxEnc->tcxltp_gain,
                           &hTcxEnc->tcxltp_pitch_int_past, &hTcxEnc->tcxltp_pitch_fr_past, &hTcxEnc->tcxltp_gain_past,
                           &hTcxEnc->tcxltp_norm_corr_past, st->last_core, st->pit_min, st->pit_fr1,
                           st->pit_fr2, st->pit_max, st->pit_res_max, &st->transientDetection,
                           st->pit_fr2, st->pit_max, st->pit_res_max, st->hTranDet,
                           tmp8, NULL, M );
    }
    ELSE
@@ -130,7 +130,7 @@ void core_signal_analysis_high_bitrate_fx(
                           &hTcxEnc->tcxltp_pitch_int, &hTcxEnc->tcxltp_pitch_fr, &hTcxEnc->tcxltp_gain,
                           &hTcxEnc->tcxltp_pitch_int_past, &hTcxEnc->tcxltp_pitch_fr_past, &hTcxEnc->tcxltp_gain_past,
                           &hTcxEnc->tcxltp_norm_corr_past, st->last_core, st->pit_min, st->pit_fr1,
                           st->pit_fr2, st->pit_max, st->pit_res_max, &st->transientDetection,
                           st->pit_fr2, st->pit_max, st->pit_res_max, st->hTranDet,
                           tmp8, NULL, M );
    }

+1 −1
Original line number Diff line number Diff line
@@ -1752,7 +1752,7 @@ void IGFEncApplyMono_fx( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in
                   pPowerSpectrumParameterWhitening, /* i: MDCT^2 + MDST^2 spectrum, or estimate     */
                   PowerSpectrum_e,                  /* i: exponent of powerSpectrum                 */
                   igfGridIdx,                       /* i: IGF grid index                            */
                   ( st->transientDetection.transientDetector.bIsAttackPresent == 1 ),
                   ( st->hTranDet->transientDetector.bIsAttackPresent == 1 ),
                   last_core_acelp ); /* i: last frame was acelp indicator            */

    pPowerSpectrumParameter = NULL;
+9 −5
Original line number Diff line number Diff line
@@ -882,10 +882,15 @@ ivas_error init_encoder_fx(
    st_fx->totalNoise_increase_len = 0;
    move16();
    init_coder_ace_plus_fx( st_fx, st_fx->last_total_brate, 0, -10 /*hack*/ );

    IF( ( st_fx->hTranDet = (TRAN_DET_HANDLE) malloc( sizeof( TRAN_DET_DATA ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) );
    }
    // PMT("Transient detector init needs review, handle hTranDet is missing")
    InitTransientDetection_fx( extract_l( Mult_32_16( st_fx->input_Fs, 0x0290 ) ),
                               NS2SA_FX2( st_fx->input_Fs, DELAY_FIR_RESAMPL_NS ),
                               &st_fx->transientDetection );
                               st_fx->hTranDet, 0 );

    st_fx->Q_syn2 = 0;
    move16();
@@ -2144,9 +2149,8 @@ ivas_error init_encoder_ivas_fx(
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) );
    }
    Word16 temp;
    Word16 frame_length = BASOP_Util_Divide3232_Scale( st->input_Fs, FRAMES_PER_SEC, &temp );
    frame_length = shr( frame_length, sub( 15, temp ) );

    Word16 frame_length = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) );

    IF( GT_16( st->element_mode, EVS_MONO ) )
    {
@@ -2156,7 +2160,7 @@ ivas_error init_encoder_ivas_fx(
    {
        InitTransientDetection_fx( extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ),
                                   NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ),
                                   &st->transientDetection );
                                   st->hTranDet, 0 );
    }

    /*-----------------------------------------------------------------*
Loading