Commit 65f9e433 authored by multrus's avatar multrus
Browse files

various smaller fixes and clarifications

parent c3b74ea2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7314,8 +7314,11 @@ void prep_tbe_exc_fx(
    {
        Word16 shift = 4;
#ifdef FIX_2010_PREP_TBE_EXC
        /* mul 2025-09-14
           TODO: check, which impact this has on EVS mono - for now, keep EVS modes BE
        /* multrus 2025-09-15
           TODO:
           - leave shift = 4, since this is legacy code from EVS;
           - check with vaillancourt, whether we really have a different scaling of code_preQ_fx[] for IVAS
           - if the different scalings are confirmed, this condition could be simplified
        */
        IF( NE_16( element_mode, EVS_MONO ) )
        {
+1 −1
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ void decoder_acelp_fx(
            {
#ifdef FIX_2010_PREP_TBE_EXC
                prep_tbe_exc_fx( st->L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, st->voice_fac, &voice_factors[idx], bwe_exc,
                                 gain_preQ, code_preQ, Q9, st->Q_exc, T0, T0_frac, st->coder_type, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, 0 );
                                 gain_preQ, code_preQ, Q10, st->Q_exc, T0, T0_frac, st->coder_type, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, 0 );
#else
                prep_tbe_exc_fx( st->L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, st->voice_fac, &voice_factors[idx], bwe_exc,
                                 gain_preQ, code_preQ, st->Q_exc, T0, T0_frac, st->coder_type, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, 0 );
+21 −1
Original line number Diff line number Diff line
@@ -100,6 +100,10 @@ ivas_error decod_gen_voic_fx(
    Word16 pf_temp[MAXLAG_WI];
    Word16 pf_n2[MAXLAG_WI];
    MUSIC_POSTFILT_HANDLE hMusicPF;
#ifdef FIX_2010_PREP_TBE_EXC
    Word16 Q_code_preQ;
#endif

    gain_pit_fx = 0;
    gain_code_fx = 0;
    norm_gain_code_fx = 0;
@@ -323,8 +327,24 @@ ivas_error decod_gen_voic_fx(
        }

#ifdef FIX_2010_PREP_TBE_EXC
        /*
          2025-09-15 multrus:
          TODO:
          check with vaillancourt
          - where this difference between EVS and IVAS comes from
          - where Q_code_preQ could be derived
          - whether any of the above calculations need to be adjusted
         */
        Q_code_preQ = Q6;
        move16();
        if ( EQ_16( st_fx->element_mode, EVS_MONO ) )
        {
            Q_code_preQ = Q10;
            move16();
        }

        prep_tbe_exc_fx( L_frame, L_SUBFR, i_subfr_fx, gain_pit_fx, gain_code_fx, code_fx, voice_fac_fx,
                         &voice_factors_fx[idx], bwe_exc_fx, gain_preQ_fx, code_preQ_fx, Q6,
                         &voice_factors_fx[idx], bwe_exc_fx, gain_preQ_fx, code_preQ_fx, Q_code_preQ,
                         st_fx->Q_exc, T0_fx, T0_frac_fx, st_fx->coder_type, st_fx->core_brate,
                         st_fx->element_mode, st_fx->idchan, st_fx->hBWE_TD != NULL, st_fx->tdm_LRTD_flag );
#else
+20 −1
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ void decod_tran_fx(
    Word16 gain_code16;
    Word32 L_tmp;
    Word16 tmp16, tmp1_fx, tmp_fx;
#ifdef FIX_2010_PREP_TBE_EXC
    Word16 Q_code_preQ;
#endif
    GSC_DEC_HANDLE hGSCDec;
    hGSCDec = st_fx->hGSCDec;
    MUSIC_POSTFILT_HANDLE hMusicPF;
@@ -255,8 +258,24 @@ void decod_tran_fx(
        }

#ifdef FIX_2010_PREP_TBE_EXC
        /*
          2025-09-15 multrus:
          TODO:
          check with vaillancourt
          - where this difference between EVS and IVAS comes from
          - where Q_code_preQ could be derived
          - whether any of the above calculations need to be adjusted
         */
        Q_code_preQ = Q6;
        move16();
        if ( EQ_16( st_fx->element_mode, EVS_MONO ) )
        {
            Q_code_preQ = Q10;
            move16();
        }

        prep_tbe_exc_fx( L_frame_fx, L_SUBFR, i_subfr, gain_pit_fx, gain_code_fx, code_fx, voice_fac_fx,
                         &voice_factors_fx[tmp_idx_2], bwe_exc_fx, gain_preQ_fx, code_preQ_fx, Q10,
                         &voice_factors_fx[tmp_idx_2], bwe_exc_fx, gain_preQ_fx, code_preQ_fx, Q_code_preQ,
                         st_fx->Q_exc, T0, T0_frac, st_fx->coder_type, st_fx->core_brate,
                         st_fx->element_mode, st_fx->idchan, st_fx->hBWE_TD != NULL, st_fx->tdm_LRTD_flag );
#else
+1 −1
Original line number Diff line number Diff line
@@ -368,7 +368,7 @@ Word16 coder_acelp_fx( /* o : SEGSNR for CL decision *
        {
#ifdef FIX_2010_PREP_TBE_EXC
            prep_tbe_exc_fx( L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR],
                             bwe_exc, gain_preQ, code_preQ, Q9, Q_new, T0, T0_frac, st->coder_type, st->core_brate,
                             bwe_exc, gain_preQ, code_preQ, Q10, Q_new, T0, T0_frac, st->coder_type, st->core_brate,
                             st->element_mode, st->idchan, st->hBWE_TD != NULL, st->tdm_LRTD_flag );
#else
            prep_tbe_exc_fx( L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR],
Loading