Commit 3160591f authored by eichenseer's avatar eichenseer
Browse files

Merge remote-tracking branch 'origin/main' into fhg/fix-ism-dtx-infinite-cng-on-silence

parents 9bef567d 45be697e
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@
#define FIX_549_PARAM_ISM_BIN_GAIN                      /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */
#define FIX_618_STEREO_SW_DIV_BY_ZERO                   /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */
#define FIX_625_IDX_OOB                                 /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */
#define FIX_613_DIRAC_NULL_PTR_USAN                     /* Nokia: Issue #613: USAN in DirAC decoder setup */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

+0 −6
Original line number Diff line number Diff line
@@ -312,12 +312,6 @@ void stereo_icBWE_dec(
    specMapping = hStereoICBWE->prevSpecMapping;
    gsMapping = hStereoICBWE->prevgsMapping;

#ifdef QC_DBG_ICBWE
    dbgwrite( &hStereoICBWE->refChanIndx_bwe, 2, 1, 1, "refChanIndx_bwe_dec.pcm" );
    dbgwrite( &specMapping, 4, 1, 1, "spMapping_dec.pcm" );
    dbgwrite( &gsMapping, 4, 1, 1, "gsMapping_dec.pcm" );
#endif

    if ( ( st->extl == SWB_TBE || st->extl == FB_TBE ) && st->flag_ACELP16k == 1 )
    {
        mvr2r( voice_factors, nlMixFac, NB_SUBFR16k );
+6 −1
Original line number Diff line number Diff line
@@ -3255,12 +3255,15 @@ static int16_t encode_ratio_ism_subframe(
{
    int16_t b, b_signif;
    int16_t diff_idx[MAX_NUM_OBJECTS];
    int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb, bits_pos0;
    int16_t nbits, nbits0, nbits1, GR_order, GR_order_sb;
    int16_t differential_subframe;
    int16_t ratio_ism_idx_ref[MAX_NUM_OBJECTS];
    int16_t bits_index;
    int16_t nbits00, nbits11;
    int16_t idx_sep_obj_local;
#ifdef DEBUGGING
    int16_t bits_pos0;
#endif

    idx_sep_obj_local = idx_separated_obj;
    if ( idx_separated_obj > -1 )
@@ -3274,7 +3277,9 @@ static int16_t encode_ratio_ism_subframe(
    nbits0 = 0;
    nbits1 = 0;

#ifdef DEBUGGING
    bits_pos0 = hMetaData->nb_bits_tot;
#endif
    differential_subframe = 1; /* the differences are taken with respect to previous subframe */

    /* first subframe */
+10 −9
Original line number Diff line number Diff line
@@ -1063,11 +1063,11 @@ void stereo_dft_enc_compute_itd(
        hStereoClassif->unclr_fv[E_sum_xcorr] = sum_xcorr;
        hStereoClassif->xtalk_fv[E_sum_xcorr] = sum_xcorr;

#ifdef DEBUG_STEREO_CLF
        dbgwrite( &hStereoClassif->unclr_fv[E_cohSNR], sizeof( float ), 1, 1, "res/cohSNR.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_es_em], sizeof( float ), 1, 1, "res/es_em.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_d_prodL_prodR], sizeof( float ), 1, 1, "res/d_prodL_prodR.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_sum_xcorr], sizeof( float ), 1, 1, "res/sum_xcorr.x" );
#if defined( DEBUG_MODE_DFT ) || defined( DEBUG_MODE_TD )
        dbgwrite( &hStereoClassif->unclr_fv[E_cohSNR], sizeof( float ), 1, 1, "res/stereo_clf_cohSNR.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_es_em], sizeof( float ), 1, 1, "res/stereo_clf_es_em.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_d_prodL_prodR], sizeof( float ), 1, 1, "res/stereo_clf_d_prodL_prodR.x" );
        dbgwrite( &hStereoClassif->unclr_fv[E_sum_xcorr], sizeof( float ), 1, 1, "res/stereo_clf_sum_xcorr.x" );
#endif
    }

@@ -1117,12 +1117,12 @@ void stereo_dft_enc_compute_itd(
    hStereoClassif->unclr_fv[E_xcorr_itd_value] = total_max;
    hStereoClassif->xtalk_fv[E_xcorr_itd_value] = total_max;

#ifdef DEBUG_STEREO_CLF
#if defined( DEBUG_MODE_DFT ) || defined( DEBUG_MODE_TD )
    {
        int16_t stmp = index - STEREO_DFT_ITD_MAX_ANA;
        dbgwrite( &stmp, sizeof( int16_t ), 1, 1, "res/raw_itd.x" );
    }
    dbgwrite( &hStereoClassif->unclr_fv[E_xcorr_itd_value], sizeof( float ), 1, 1, "res/xcorr_itd_value.x" );
    dbgwrite( &hStereoClassif->unclr_fv[E_xcorr_itd_value], sizeof( float ), 1, 1, "res/stereo_clf_raw_itd.x" );
#endif

#ifdef DEBUG_MODE_DFT
@@ -1347,9 +1347,10 @@ void stereo_dft_enc_compute_itd(
    /* collect UNCLR classifier parameters */
    hStereoClassif->unclr_fv[E_ITD] = hItd->itd[k_offset];

#ifdef DEBUG_STEREO_CLF
    dbgwrite( &hItd->itd[k_offset], sizeof( float ), 1, 1, "res/ITD.x" );
#if defined( DEBUG_MODE_DFT ) || defined( DEBUG_MODE_TD )
    dbgwrite( &hItd->itd[k_offset], sizeof( float ), 1, 1, "res/stereo_clf_ITD.x" );
#endif

    /* limit ITD range for MDCT stereo even more */
    if ( hCPE->element_mode == IVAS_CPE_MDCT && fabsf( hItd->itd[k_offset] ) > ITD_MAX_MDCT )
    {
+2 −47
Original line number Diff line number Diff line
@@ -92,9 +92,6 @@ static int16_t ic_bwe_enc_specMapping(
    float temp, temp0, temp1, temp2, temp3, alpha;
    float a, b, c;
    float u, u1, u2;
#ifdef QC_DBG_ICBWE
    float T_achieved;
#endif

    alpha = 0.5f;
    /* Calculate rxx(1)/rxx(0) of the non ref target */
@@ -165,23 +162,9 @@ static int16_t ic_bwe_enc_specMapping(
    /* Quantize spec. mapping **/
    idx = (int16_t) usquant( u, specMapping, -0.6f, 0.2f, 1 << STEREO_ICBWE_SPBITS );

#ifdef QC_DBG_ICBWE
    dbgwrite( &specMapping, 4, 1, 1, "spMapping_enc.pcm" );
#endif

    /* ic bwe spec mapping */
    /* IC-BWE spec mapping */
    deemph( shb_synth_nonref, *specMapping, L_FRAME16k, memShbSpecMapping );

#ifdef QC_DBG_ICBWE
    temp1 = dotp( shb_synth_nonref, shb_synth_nonref + 1, L_FRAME16k - 1 );
    temp0 = dotp( shb_synth_nonref, shb_synth_nonref, L_FRAME16k - 1 );
    T_achieved = ( temp0 != 0 ) ? ( temp1 / temp0 ) : ( 0 );

    dbgwrite( &T_desired, 4, 1, 1, "T_nonref_target.pcm" );
    dbgwrite( &Txx1, 4, 1, 1, "T_nonref_synth.pcm" );
    dbgwrite( &T_achieved, 4, 1, 1, "T_nonref_achieved.pcm" );
#endif

    return idx;
}

@@ -237,12 +220,6 @@ static int16_t ic_bwe_enc_gsMapping(

    *gsMapping = powf( 10, *gsMapping );

#ifdef QC_DBG_ICBWE
    dbgwrite( &relG_targ, 4, 1, 1, "relG_targ_enc.pcm" );
    dbgwrite( gsMapping, 4, 1, 1, "gsMapping_enc.pcm" );
    dbgwrite( &frame, sizeof( int32_t ), 1, 1, "frame_gsMapping_bwe.pcm" );
#endif

    return idx;
}

@@ -287,12 +264,6 @@ static void icbwe_dft_stereo_param(
    sum_nrg_R = sum_f( hStereoICBWE->mem_nrg_R, 2 );
    sum_nrg_DMX = sum_f( hStereoICBWE->mem_nrg_DMX, 2 );

#ifdef QC_DBG_ICBWE
    dbgwrite( &nrg_L, 4, 1, 1, "nrg_L.pcm" );
    dbgwrite( &nrg_R, 4, 1, 1, "nrg_R.pcm" );
    dbgwrite( &nrg_DMX, 4, 1, 1, "nrg_DMX.pcm" );
#endif

    /* refChanIndex_bwe refinement */
    if ( ( sum_nrg_R < 0.64f * sum_nrg_L && hStereoICBWE->refChanIndx_bwe == hStereoICBWE->prev_refChanIndx_bwe ) || sum_nrg_R < 0.36f * sum_nrg_L )
    {
@@ -582,9 +553,6 @@ void stereo_icBWE_enc(
        {
            spIndx = 3;
            hStereoICBWE->prevSpecMapping = 0;
#ifdef QC_DBG_ICBWE
            dbgwrite( &( hStereoICBWE->prevSpecMapping ), 4, 1, 1, "spMapping_enc.pcm" );
#endif
        }

        push_indice( hBstr, IND_STEREO_ICBWE_REF, hStereoICBWE->refChanIndx_bwe, STEREO_ICBWE_REFBITS );
@@ -604,14 +572,7 @@ void stereo_icBWE_enc(
        push_indice( hBstr, IND_STEREO_ICBWE_GS, gsIndx, STEREO_ICBWE_GSBITS );
    }

#ifdef QC_DBG_ICBWE
    dbgwrite( &hStereoICBWE->refChanIndx_bwe, 2, 1, 1, "refChanIndx_bwe_enc.pcm" );
    dbgwrite( &hStereoICBWE->prevSpecMapping, 4, 1, 1, "spMapping_enc.pcm" );
    dbgwrite( &gDes, 4, 1, 1, "relG_targ_enc.pcm" );
    dbgwrite( &hStereoICBWE->prevgsMapping, 4, 1, 1, "gsMapping_enc.pcm" );
#endif

    /* IC BWE Updates */
    /* IC-BWE updates */
    hStereoICBWE->prev_refChanIndx_bwe = hStereoICBWE->refChanIndx_bwe;

    return;
@@ -862,11 +823,5 @@ void stereo_icBWE_preproc(

    mvr2r( tempSHB, shb_speech_nonref, L_FRAME16k );

#ifdef QC_DBG_ICBWE
    dbgwrite( &refChanIndx_bwe, 2, 1, 1, "refChanIndx_bwe.pcm" );
    dbgwrite( &frame, sizeof( int32_t ), 1, 1, "frame_refChanIndx_bwe.pcm" );
    /*dbgwrite(hStereoICBWE->shb_speech_nonref, sizeof(float), L_FRAME16k, 1, "shb_speech_nonref.pcm");*/
#endif

    return;
}
Loading