Loading lib_dec/acelp_core_dec_ivas_fx.c +17 −17 Original line number Diff line number Diff line Loading @@ -193,12 +193,12 @@ ivas_error acelp_core_dec_ivas_fx( #endif ApplyFdCng_ivas_fx( NULL, 0, NULL, 0, NULL, NULL, NULL, st, 0, 0 ); IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) { Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } ELSE { Loading Loading @@ -696,7 +696,7 @@ ivas_error acelp_core_dec_ivas_fx( move32(); } #endif Word16 new_sidNoiseEstExp = 31 - Q4; /* Word16 new_sidNoiseEstExp = 31 - Q4; move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) ); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) ); Loading @@ -706,16 +706,16 @@ ivas_error acelp_core_dec_ivas_fx( move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp - new_cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = new_cngNoiseLevelExp; move16(); move16();*/ ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) { Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } IF( !read_sid_info ) Loading Loading @@ -1546,18 +1546,18 @@ ivas_error acelp_core_dec_ivas_fx( { /*Noise estimate*/ Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4 move16(); //Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) ); //st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4 //move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4 move16(); //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); //st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4 //move16(); /*==========================================================*/ ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); /*==========================================================*/ IF( st->hFdCngDec->partNoiseShape_exp < 0 ) /*IF( st->hFdCngDec->partNoiseShape_exp < 0 ) { Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, st->hFdCngDec->partNoiseShape_exp ); st->hFdCngDec->partNoiseShape_exp = 0; Loading @@ -1568,7 +1568,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } IF( !st->cna_dirac_flag ) Loading Loading @@ -1654,7 +1654,7 @@ ivas_error acelp_core_dec_ivas_fx( IF( ( st->idchan == 0 ) && ( EQ_16( nchan_out, 2 ) || ( st->core_brate != FRAME_NO_DATA && NE_32( st->core_brate, SID_2k40 ) ) ) ) { ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); IF( st->hFdCngDec->partNoiseShape_exp < 0 ) /*IF( st->hFdCngDec->partNoiseShape_exp < 0 ) { Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, -st->hFdCngDec->partNoiseShape_exp ); st->hFdCngDec->partNoiseShape_exp = 0; Loading @@ -1671,7 +1671,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } } } Loading lib_dec/fd_cng_dec_fx.c +124 −30 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <assert.h> #include <math.h> #include "typedef.h" #include <stdint.h> #include "options.h" Loading Loading @@ -1383,16 +1384,24 @@ Word16 ApplyFdCng_ivas_fx( IF( NE_16( s2, -( WORD32_BITS - 1 ) ) ) { s = sub( *cngNoiseLevel_exp, add( hFdCngDec->bandNoiseShape_exp, s2 ) ); Word16 e_shift=0; if (s > 0) { Word16 q_norm = L_norm_arr(&cngNoiseLevel[j], sub(FFTCLDFBLEN, j)); if (GT_16(s, q_norm)) { scale_sig32(cngNoiseLevel, j, sub(q_norm, s)); e_shift = sub(s, q_norm); } } FOR( ; k < hFdCngCom->npart; k++ ) { FOR( ; j <= hFdCngCom->part[k]; j++ ) { cngNoiseLevel[j] = L_shl( cngNoiseLevel[j], s ); cngNoiseLevel[j] = L_shl( cngNoiseLevel[j], sub( s, e_shift ) ); move32(); } } *cngNoiseLevel_exp = add( hFdCngDec->bandNoiseShape_exp, s2 ); *cngNoiseLevel_exp = add( add( hFdCngDec->bandNoiseShape_exp, s2 ), e_shift ); move16(); } } Loading Loading @@ -2410,14 +2419,15 @@ void perform_noise_estimation_dec_ivas_fx( Word32 temp, ftemp, delta, L_tmp; Word16 e_temp, wght, periodog_exp; Word32 enr, enr_tot, enr_tot0; Word16 enr_ratio, alpha; Word16 enr_e, enr_ratio, alpha; Word32 *msPeriodog; Word32 *msNoiseEst; Word32 *reIter; Word32 rescale_fac = 0; Word64 W_tmp; Word16 tmp_s, tmp_q, min_q = 31; Word16 exp_flag = 0; Word16 q_shift; // Word16 exp_flag = 0; #ifdef IVAS_CODE_CNG PMT( "lots of code related to IVAS needs to be done " ) #endif Loading Loading @@ -2639,7 +2649,7 @@ void perform_noise_estimation_dec_ivas_fx( enr_tot0 = L_add_sat( L_shr( sum32_fx( msNoiseEst, npart ), sub( hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp ) ), 1 ); } test(); /*test(); IF( !( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) ) { IF( GT_16( hFdCngDec->hFdCngCom->periodog_exp, hFdCngDec->msPeriodog_ST_exp ) ) Loading @@ -2652,23 +2662,38 @@ void perform_noise_estimation_dec_ivas_fx( exp_flag = 0; move16(); } } }*/ /* update short-term periodogram on larger partitions */ q_shift = sub( hFdCngDec->hFdCngCom->periodog_exp, hFdCngDec->msPeriodog_ST_exp ); FOR( p = CNA_ACT_DN_LARGE_PARTITION; p < npart; p++ ) { test(); IF( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) { /* core Fs has changed or last frame was SID/NO_DATA -> re-initialize short-term periodogram */ if ( msPeriodog[p] == 0 ) { hFdCngDec->msPeriodog_ST_fx[p] = 0; move32(); } else if ( LE_16( q_shift, norm_l( msPeriodog[p] ) ) && msPeriodog[p] ) { hFdCngDec->msPeriodog_ST_fx[p] = L_shl( msPeriodog[p], q_shift ); move32(); } else { scale_sig32( hFdCngDec->msPeriodog_ST_fx, NPART_SHAPING, negate( q_shift ) ); hFdCngDec->msPeriodog_ST_fx[p] = msPeriodog[p]; move32(); hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); } } ELSE { temp = msPeriodog[p]; /*temp = msPeriodog[p]; move32(); IF( exp_flag ) { Loading @@ -2678,16 +2703,36 @@ void perform_noise_estimation_dec_ivas_fx( ELSE { temp = L_shr( temp, sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); } }*/ #ifdef IVAS_ENH32_CADENCE_CHANGES hFdCngDec->msPeriodog_ST_fx[p] = Madd_32_16( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), temp, sub( MAX_16, ST_PERIODOG_FACT_Q15 ) ); if ( msPeriodog[p] == 0 ) { temp = 0; move32(); } else if ( LE_16( q_shift, norm_l( msPeriodog[p] ) ) && msPeriodog[p] ) { temp = L_shr( msPeriodog[p], sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); move32(); } else { scale_sig32( hFdCngDec->msPeriodog_ST_fx, NPART_SHAPING, negate( q_shift ) ); hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); temp = msPeriodog[p]; move32(); } // temp = L_shr(msPeriodog[p], sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); hFdCngDec->msPeriodog_ST_fx[p] = Madd_32_16( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), temp, MAX_16 - ST_PERIODOG_FACT_Q15 ); #else hFdCngDec->msPeriodog_ST_fx[p] = L_add( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), Mpy_32_16_1( temp, sub( MAX_16, ST_PERIODOG_FACT_Q15 ) ) ); #endif move32(); } } test(); // printf( "\n%f ", (float) hFdCngDec->msPeriodog_ST_fx[0] / pow( 2, 31 - hFdCngDec->msPeriodog_ST_exp ) ); /*test(); IF( !( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) ) { IF( exp_flag ) Loading @@ -2695,7 +2740,7 @@ void perform_noise_estimation_dec_ivas_fx( hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); } } }*/ /* core Fs has changed -> partitions have changed -> re-calculate long-term periodogram */ /* part L_FRAME16k L_FRAME */ Loading Loading @@ -2755,30 +2800,39 @@ void perform_noise_estimation_dec_ivas_fx( IF( NE_16( hFdCngDec->first_cna_noise_update_cnt, 0 ) ) { alpha = Inv16( add( hFdCngDec->first_cna_noise_update_cnt, 1 ), &e ); IF( LT_16( e, 0 ) ) { alpha = shr( alpha, negate( e ) ); // Q15 alpha = shl_sat( alpha, e ); // Q15 IF (LT_16(hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp)) { scale_sig32(hFdCngDec->msPeriodog, NPART_SHAPING, sub(hFdCngDec->msPeriodog_exp,hFdCngDec->msNoiseEst_exp)); hFdCngDec->msPeriodog_exp=hFdCngDec->msNoiseEst_exp; } ELSE IF (GT_16(hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp)) { scale_sig32(msNoiseEst, NPART_SHAPING, sub(hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp)); hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; } FOR( p = 0; p < npart; p++ ) { temp = msPeriodog[p]; move32(); temp = L_shr( temp, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); //temp = L_shr( temp, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); #ifdef IVAS_ENH32_CADENCE_CHANGES msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], sub( shl_sat( 1, sub( 15, e ) ), alpha ) ), temp, alpha ); msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], sub( MAX_16, alpha ) ), temp, alpha ); #else msNoiseEst[p] = L_add( Mpy_32_16_1( msNoiseEst[p], sub( shl_sat( 1, sub( 15, e ) ), alpha ) ), Mpy_32_16_1( temp, alpha ) ); msNoiseEst[p] = L_add( Mpy_32_16_1( msNoiseEst[p], sub( MAX_16, alpha ) ), Mpy_32_16_1( temp, alpha ) ); #endif move32(); } } ELSE { FOR( p = 0; p < npart; p++ ) Copy32( msPeriodog, msNoiseEst, npart ); scale_sig32( &msNoiseEst[npart], sub( NPART_SHAPING, npart ), sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; /*FOR( p = 0; p < npart; p++ ) { msNoiseEst[p] = L_shr( msPeriodog[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); move32(); } hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; }*/ } /* check, if we reached the required number of first CNA noise update frames */ Loading Loading @@ -2863,7 +2917,7 @@ void perform_noise_estimation_dec_ivas_fx( /* energy significantly decreases in one of the larger partitions during active frames -> downward update */ FOR( p = CNA_ACT_DN_LARGE_PARTITION; p < npart; p++ ) { L_tmp = L_shr( hFdCngDec->msPeriodog_ST_fx[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_ST_exp ) ); L_tmp = L_shr_sat( hFdCngDec->msPeriodog_ST_fx[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_ST_exp ) ); IF( LT_32( L_tmp, msNoiseEst[p] ) ) { #ifdef IVAS_ENH32_CADENCE_CHANGES Loading Loading @@ -2893,13 +2947,17 @@ void perform_noise_estimation_dec_ivas_fx( { Word16 i_e = 15; move16(); /*enr = msPeriodog[p]; move32();*/ enr = msPeriodog[p]; move32(); temp = L_shr( enr, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); enr_e = hFdCngDec->msPeriodog_exp; move16(); alpha = 31130; // 0.95f in Q15 move16(); /* bandwidth increased -> do fast re-initilization */ test(); test(); IF( GT_16( hFdCngDec->ms_cnt_bw_up, 0 ) && GT_16( p, 55 ) ) { alpha = Inv16( add( hFdCngDec->ms_cnt_bw_up, 1 ), &i_e ); Loading @@ -2908,16 +2966,27 @@ void perform_noise_estimation_dec_ivas_fx( alpha = shr( alpha, negate( i_e ) ); // Q15 } } ELSE IF( LT_32( temp, *ptr_per ) && EQ_16( part[p], 1 ) ) ELSE IF( ( BASOP_Util_Cmp_Mant32Exp( enr, enr_e, *ptr_per, hFdCngDec->msNoiseEst_exp ) < 0 ) && EQ_16( part[p], 1 ) ) { /* faster downward update for single-bin partitions */ alpha = 26214; // 0.8f in Q15 move16(); } ELSE IF( GT_32( temp, L_shl( ( *ptr_per ), 1 ) ) ) ELSE IF( BASOP_Util_Cmp_Mant32Exp( enr, enr_e, *ptr_per, add( hFdCngDec->msNoiseEst_exp, 1 ) ) > 0 ) { /* prevent abrupt upward updates */ temp = L_shl( ( *ptr_per ), 1 ); test(); if ( (norm_l( *ptr_per ) == 0) && *ptr_per) { enr = *ptr_per; scale_sig32( msNoiseEst, NPART_SHAPING, -1 ); hFdCngDec->msNoiseEst_exp = add( hFdCngDec->msNoiseEst_exp, 1 ); } else { enr = L_shl( *ptr_per, 1 ); } enr_e = hFdCngDec->msNoiseEst_exp; } /* IIR smoothing */ Loading @@ -2938,9 +3007,27 @@ void perform_noise_estimation_dec_ivas_fx( move32(); } #ifdef IVAS_ENH32_CADENCE_CHANGES *ptr_per = Madd_32_16( ( *ptr_per ), temp, sub( MAX_16, alpha ) ); q_shift = sub( enr_e, hFdCngDec->msNoiseEst_exp ); tmp_q = norm_l( enr ); if ( enr == 0 ) { } else if ( LE_16( q_shift, tmp_q ) && enr ) { enr = L_shl( enr, q_shift ); move32(); } else { enr_e = sub( enr_e, tmp_q ); enr = L_shl( enr, tmp_q ); scale_sig32( msNoiseEst, NPART_SHAPING, sub( tmp_q, q_shift ) ); hFdCngDec->msNoiseEst_exp = sub( hFdCngDec->msNoiseEst_exp, sub( tmp_q, q_shift ) ); move16(); } *ptr_per = Madd_32_16( ( *ptr_per ), enr, sub( MAX_16, alpha ) ); #else *ptr_per = L_add( ( *ptr_per ), Mpy_32_16_1( temp, sub( MAX_16, alpha ) ) ); *ptr_per = L_add( ( *ptr_per ), Mpy_32_16_1( enr, sub( MAX_16, alpha ) ) ); #endif ptr_per++; } Loading @@ -2951,6 +3038,13 @@ void perform_noise_estimation_dec_ivas_fx( } } } Word32 max_l; maximum_l(msNoiseEst, NPART_SHAPING, &max_l); if (max_l) { q_shift = sub(norm_l(max_l), 2); scale_sig32(msNoiseEst, NPART_SHAPING, q_shift); hFdCngDec->msNoiseEst_exp = sub(hFdCngDec->msNoiseEst_exp, q_shift); } Copy32( msNoiseEst, hFdCngDec->msPsd_fx, npart ); hFdCngDec->msPsd_exp_fft = hFdCngDec->msNoiseEst_exp; Loading lib_dec/ivas_core_dec.c +6 −6 Original line number Diff line number Diff line Loading @@ -531,8 +531,8 @@ ivas_error ivas_core_dec_fx( IF( st->hFdCngDec != NULL ) { Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); st->hFdCngDec->msNoiseEst_exp = 27; //Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); //st->hFdCngDec->msNoiseEst_exp = 27; move16(); Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, add( M, 1 ), sub( norm_s( sub( st->hFdCngDec->hFdCngCom->A_cng[0], 1 ) ), 3 ) ); Loading Loading @@ -613,8 +613,8 @@ ivas_error ivas_core_dec_fx( /* TCX decoder */ Scale_sig( st->hPFstat->mem_stp, L_SUBFR, -Qsyn_temp ); Scale_sig( st->hPFstat->mem_pf_in, L_SUBFR, -Qsyn_temp ); Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); st->hFdCngDec->msNoiseEst_exp = 27; //Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); //st->hFdCngDec->msNoiseEst_exp = 27; move16(); Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, -st->hHQ_core->Q_old_wtda_LB ); Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, -st->hHQ_core->Q_old_wtda ); Loading Loading @@ -822,8 +822,8 @@ ivas_error ivas_core_dec_fx( { IF( NE_16( sts[n]->last_core_bfi, ACELP_CORE ) ) { Scale_sig32( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 27 ) ); sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; //Scale_sig32( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 27 ) ); //sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; move16(); TonalMdctConceal_whiten_noise_shape_ivas_fx( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); Loading lib_dec/ivas_cpe_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -814,6 +814,10 @@ ivas_error ivas_cpe_dec_fx( } } } //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->msNoiseEst[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->msNoiseEst_exp ) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->smoothed_psd_fx[2] / pow( 2, hCPE->hCoreCoder[0]->hFdCngDec->q_smoothed_psd) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->sidNoiseEst[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->sidNoiseEstExp) ); /*----------------------------------------------------------------* * Update parameters for stereo CNA Loading lib_dec/ivas_stereo_cng_dec.c +76 −37 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib_dec/acelp_core_dec_ivas_fx.c +17 −17 Original line number Diff line number Diff line Loading @@ -193,12 +193,12 @@ ivas_error acelp_core_dec_ivas_fx( #endif ApplyFdCng_ivas_fx( NULL, 0, NULL, 0, NULL, NULL, NULL, st, 0, 0 ); IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) { Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } ELSE { Loading Loading @@ -696,7 +696,7 @@ ivas_error acelp_core_dec_ivas_fx( move32(); } #endif Word16 new_sidNoiseEstExp = 31 - Q4; /* Word16 new_sidNoiseEstExp = 31 - Q4; move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) ); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, new_sidNoiseEstExp ) ); Loading @@ -706,16 +706,16 @@ ivas_error acelp_core_dec_ivas_fx( move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp - new_cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = new_cngNoiseLevelExp; move16(); move16();*/ ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) /*IF( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp < 0 ) { Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } IF( !read_sid_info ) Loading Loading @@ -1546,18 +1546,18 @@ ivas_error acelp_core_dec_ivas_fx( { /*Noise estimate*/ Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4 move16(); //Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( st->hFdCngDec->hFdCngCom->cngNoiseLevelExp, Q27 ) ); //st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 31 - Q4; // Q4 //move16(); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4 move16(); //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); //Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( st->hFdCngDec->hFdCngCom->sidNoiseEstExp, Q27 ) ); //st->hFdCngDec->hFdCngCom->sidNoiseEstExp = 31 - Q4; // Q4 //move16(); /*==========================================================*/ ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); /*==========================================================*/ IF( st->hFdCngDec->partNoiseShape_exp < 0 ) /*IF( st->hFdCngDec->partNoiseShape_exp < 0 ) { Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, st->hFdCngDec->partNoiseShape_exp ); st->hFdCngDec->partNoiseShape_exp = 0; Loading @@ -1568,7 +1568,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } IF( !st->cna_dirac_flag ) Loading Loading @@ -1654,7 +1654,7 @@ ivas_error acelp_core_dec_ivas_fx( IF( ( st->idchan == 0 ) && ( EQ_16( nchan_out, 2 ) || ( st->core_brate != FRAME_NO_DATA && NE_32( st->core_brate, SID_2k40 ) ) ) ) { ApplyFdCng_ivas_fx( psyn_fx, st->Q_syn, NULL, 0, realBuffer_fx, imagBuffer_fx, NULL, st, 0, ( st->coder_type == AUDIO && !st->GSC_noisy_speech ) ); IF( st->hFdCngDec->partNoiseShape_exp < 0 ) /*IF( st->hFdCngDec->partNoiseShape_exp < 0 ) { Scale_sig32( st->hFdCngDec->partNoiseShape, NPART, -st->hFdCngDec->partNoiseShape_exp ); st->hFdCngDec->partNoiseShape_exp = 0; Loading @@ -1671,7 +1671,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32( st->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, st->hFdCngDec->hFdCngCom->cngNoiseLevelExp ); st->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 0; move16(); } }*/ } } } Loading
lib_dec/fd_cng_dec_fx.c +124 −30 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <assert.h> #include <math.h> #include "typedef.h" #include <stdint.h> #include "options.h" Loading Loading @@ -1383,16 +1384,24 @@ Word16 ApplyFdCng_ivas_fx( IF( NE_16( s2, -( WORD32_BITS - 1 ) ) ) { s = sub( *cngNoiseLevel_exp, add( hFdCngDec->bandNoiseShape_exp, s2 ) ); Word16 e_shift=0; if (s > 0) { Word16 q_norm = L_norm_arr(&cngNoiseLevel[j], sub(FFTCLDFBLEN, j)); if (GT_16(s, q_norm)) { scale_sig32(cngNoiseLevel, j, sub(q_norm, s)); e_shift = sub(s, q_norm); } } FOR( ; k < hFdCngCom->npart; k++ ) { FOR( ; j <= hFdCngCom->part[k]; j++ ) { cngNoiseLevel[j] = L_shl( cngNoiseLevel[j], s ); cngNoiseLevel[j] = L_shl( cngNoiseLevel[j], sub( s, e_shift ) ); move32(); } } *cngNoiseLevel_exp = add( hFdCngDec->bandNoiseShape_exp, s2 ); *cngNoiseLevel_exp = add( add( hFdCngDec->bandNoiseShape_exp, s2 ), e_shift ); move16(); } } Loading Loading @@ -2410,14 +2419,15 @@ void perform_noise_estimation_dec_ivas_fx( Word32 temp, ftemp, delta, L_tmp; Word16 e_temp, wght, periodog_exp; Word32 enr, enr_tot, enr_tot0; Word16 enr_ratio, alpha; Word16 enr_e, enr_ratio, alpha; Word32 *msPeriodog; Word32 *msNoiseEst; Word32 *reIter; Word32 rescale_fac = 0; Word64 W_tmp; Word16 tmp_s, tmp_q, min_q = 31; Word16 exp_flag = 0; Word16 q_shift; // Word16 exp_flag = 0; #ifdef IVAS_CODE_CNG PMT( "lots of code related to IVAS needs to be done " ) #endif Loading Loading @@ -2639,7 +2649,7 @@ void perform_noise_estimation_dec_ivas_fx( enr_tot0 = L_add_sat( L_shr( sum32_fx( msNoiseEst, npart ), sub( hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp ) ), 1 ); } test(); /*test(); IF( !( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) ) { IF( GT_16( hFdCngDec->hFdCngCom->periodog_exp, hFdCngDec->msPeriodog_ST_exp ) ) Loading @@ -2652,23 +2662,38 @@ void perform_noise_estimation_dec_ivas_fx( exp_flag = 0; move16(); } } }*/ /* update short-term periodogram on larger partitions */ q_shift = sub( hFdCngDec->hFdCngCom->periodog_exp, hFdCngDec->msPeriodog_ST_exp ); FOR( p = CNA_ACT_DN_LARGE_PARTITION; p < npart; p++ ) { test(); IF( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) { /* core Fs has changed or last frame was SID/NO_DATA -> re-initialize short-term periodogram */ if ( msPeriodog[p] == 0 ) { hFdCngDec->msPeriodog_ST_fx[p] = 0; move32(); } else if ( LE_16( q_shift, norm_l( msPeriodog[p] ) ) && msPeriodog[p] ) { hFdCngDec->msPeriodog_ST_fx[p] = L_shl( msPeriodog[p], q_shift ); move32(); } else { scale_sig32( hFdCngDec->msPeriodog_ST_fx, NPART_SHAPING, negate( q_shift ) ); hFdCngDec->msPeriodog_ST_fx[p] = msPeriodog[p]; move32(); hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); } } ELSE { temp = msPeriodog[p]; /*temp = msPeriodog[p]; move32(); IF( exp_flag ) { Loading @@ -2678,16 +2703,36 @@ void perform_noise_estimation_dec_ivas_fx( ELSE { temp = L_shr( temp, sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); } }*/ #ifdef IVAS_ENH32_CADENCE_CHANGES hFdCngDec->msPeriodog_ST_fx[p] = Madd_32_16( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), temp, sub( MAX_16, ST_PERIODOG_FACT_Q15 ) ); if ( msPeriodog[p] == 0 ) { temp = 0; move32(); } else if ( LE_16( q_shift, norm_l( msPeriodog[p] ) ) && msPeriodog[p] ) { temp = L_shr( msPeriodog[p], sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); move32(); } else { scale_sig32( hFdCngDec->msPeriodog_ST_fx, NPART_SHAPING, negate( q_shift ) ); hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); temp = msPeriodog[p]; move32(); } // temp = L_shr(msPeriodog[p], sub( hFdCngDec->msPeriodog_ST_exp, hFdCngDec->hFdCngCom->periodog_exp ) ); hFdCngDec->msPeriodog_ST_fx[p] = Madd_32_16( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), temp, MAX_16 - ST_PERIODOG_FACT_Q15 ); #else hFdCngDec->msPeriodog_ST_fx[p] = L_add( Mpy_32_16_1( hFdCngDec->msPeriodog_ST_fx[p], ST_PERIODOG_FACT_Q15 ), Mpy_32_16_1( temp, sub( MAX_16, ST_PERIODOG_FACT_Q15 ) ) ); #endif move32(); } } test(); // printf( "\n%f ", (float) hFdCngDec->msPeriodog_ST_fx[0] / pow( 2, 31 - hFdCngDec->msPeriodog_ST_exp ) ); /*test(); IF( !( NE_16( L_frame, last_L_frame ) || LE_32( last_core_brate, SID_2k40 ) ) ) { IF( exp_flag ) Loading @@ -2695,7 +2740,7 @@ void perform_noise_estimation_dec_ivas_fx( hFdCngDec->msPeriodog_ST_exp = hFdCngDec->hFdCngCom->periodog_exp; move16(); } } }*/ /* core Fs has changed -> partitions have changed -> re-calculate long-term periodogram */ /* part L_FRAME16k L_FRAME */ Loading Loading @@ -2755,30 +2800,39 @@ void perform_noise_estimation_dec_ivas_fx( IF( NE_16( hFdCngDec->first_cna_noise_update_cnt, 0 ) ) { alpha = Inv16( add( hFdCngDec->first_cna_noise_update_cnt, 1 ), &e ); IF( LT_16( e, 0 ) ) { alpha = shr( alpha, negate( e ) ); // Q15 alpha = shl_sat( alpha, e ); // Q15 IF (LT_16(hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp)) { scale_sig32(hFdCngDec->msPeriodog, NPART_SHAPING, sub(hFdCngDec->msPeriodog_exp,hFdCngDec->msNoiseEst_exp)); hFdCngDec->msPeriodog_exp=hFdCngDec->msNoiseEst_exp; } ELSE IF (GT_16(hFdCngDec->msPeriodog_exp, hFdCngDec->msNoiseEst_exp)) { scale_sig32(msNoiseEst, NPART_SHAPING, sub(hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp)); hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; } FOR( p = 0; p < npart; p++ ) { temp = msPeriodog[p]; move32(); temp = L_shr( temp, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); //temp = L_shr( temp, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); #ifdef IVAS_ENH32_CADENCE_CHANGES msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], sub( shl_sat( 1, sub( 15, e ) ), alpha ) ), temp, alpha ); msNoiseEst[p] = Madd_32_16( Mpy_32_16_1( msNoiseEst[p], sub( MAX_16, alpha ) ), temp, alpha ); #else msNoiseEst[p] = L_add( Mpy_32_16_1( msNoiseEst[p], sub( shl_sat( 1, sub( 15, e ) ), alpha ) ), Mpy_32_16_1( temp, alpha ) ); msNoiseEst[p] = L_add( Mpy_32_16_1( msNoiseEst[p], sub( MAX_16, alpha ) ), Mpy_32_16_1( temp, alpha ) ); #endif move32(); } } ELSE { FOR( p = 0; p < npart; p++ ) Copy32( msPeriodog, msNoiseEst, npart ); scale_sig32( &msNoiseEst[npart], sub( NPART_SHAPING, npart ), sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; /*FOR( p = 0; p < npart; p++ ) { msNoiseEst[p] = L_shr( msPeriodog[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); move32(); } hFdCngDec->msNoiseEst_exp = hFdCngDec->msPeriodog_exp; }*/ } /* check, if we reached the required number of first CNA noise update frames */ Loading Loading @@ -2863,7 +2917,7 @@ void perform_noise_estimation_dec_ivas_fx( /* energy significantly decreases in one of the larger partitions during active frames -> downward update */ FOR( p = CNA_ACT_DN_LARGE_PARTITION; p < npart; p++ ) { L_tmp = L_shr( hFdCngDec->msPeriodog_ST_fx[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_ST_exp ) ); L_tmp = L_shr_sat( hFdCngDec->msPeriodog_ST_fx[p], sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_ST_exp ) ); IF( LT_32( L_tmp, msNoiseEst[p] ) ) { #ifdef IVAS_ENH32_CADENCE_CHANGES Loading Loading @@ -2893,13 +2947,17 @@ void perform_noise_estimation_dec_ivas_fx( { Word16 i_e = 15; move16(); /*enr = msPeriodog[p]; move32();*/ enr = msPeriodog[p]; move32(); temp = L_shr( enr, sub( hFdCngDec->msNoiseEst_exp, hFdCngDec->msPeriodog_exp ) ); enr_e = hFdCngDec->msPeriodog_exp; move16(); alpha = 31130; // 0.95f in Q15 move16(); /* bandwidth increased -> do fast re-initilization */ test(); test(); IF( GT_16( hFdCngDec->ms_cnt_bw_up, 0 ) && GT_16( p, 55 ) ) { alpha = Inv16( add( hFdCngDec->ms_cnt_bw_up, 1 ), &i_e ); Loading @@ -2908,16 +2966,27 @@ void perform_noise_estimation_dec_ivas_fx( alpha = shr( alpha, negate( i_e ) ); // Q15 } } ELSE IF( LT_32( temp, *ptr_per ) && EQ_16( part[p], 1 ) ) ELSE IF( ( BASOP_Util_Cmp_Mant32Exp( enr, enr_e, *ptr_per, hFdCngDec->msNoiseEst_exp ) < 0 ) && EQ_16( part[p], 1 ) ) { /* faster downward update for single-bin partitions */ alpha = 26214; // 0.8f in Q15 move16(); } ELSE IF( GT_32( temp, L_shl( ( *ptr_per ), 1 ) ) ) ELSE IF( BASOP_Util_Cmp_Mant32Exp( enr, enr_e, *ptr_per, add( hFdCngDec->msNoiseEst_exp, 1 ) ) > 0 ) { /* prevent abrupt upward updates */ temp = L_shl( ( *ptr_per ), 1 ); test(); if ( (norm_l( *ptr_per ) == 0) && *ptr_per) { enr = *ptr_per; scale_sig32( msNoiseEst, NPART_SHAPING, -1 ); hFdCngDec->msNoiseEst_exp = add( hFdCngDec->msNoiseEst_exp, 1 ); } else { enr = L_shl( *ptr_per, 1 ); } enr_e = hFdCngDec->msNoiseEst_exp; } /* IIR smoothing */ Loading @@ -2938,9 +3007,27 @@ void perform_noise_estimation_dec_ivas_fx( move32(); } #ifdef IVAS_ENH32_CADENCE_CHANGES *ptr_per = Madd_32_16( ( *ptr_per ), temp, sub( MAX_16, alpha ) ); q_shift = sub( enr_e, hFdCngDec->msNoiseEst_exp ); tmp_q = norm_l( enr ); if ( enr == 0 ) { } else if ( LE_16( q_shift, tmp_q ) && enr ) { enr = L_shl( enr, q_shift ); move32(); } else { enr_e = sub( enr_e, tmp_q ); enr = L_shl( enr, tmp_q ); scale_sig32( msNoiseEst, NPART_SHAPING, sub( tmp_q, q_shift ) ); hFdCngDec->msNoiseEst_exp = sub( hFdCngDec->msNoiseEst_exp, sub( tmp_q, q_shift ) ); move16(); } *ptr_per = Madd_32_16( ( *ptr_per ), enr, sub( MAX_16, alpha ) ); #else *ptr_per = L_add( ( *ptr_per ), Mpy_32_16_1( temp, sub( MAX_16, alpha ) ) ); *ptr_per = L_add( ( *ptr_per ), Mpy_32_16_1( enr, sub( MAX_16, alpha ) ) ); #endif ptr_per++; } Loading @@ -2951,6 +3038,13 @@ void perform_noise_estimation_dec_ivas_fx( } } } Word32 max_l; maximum_l(msNoiseEst, NPART_SHAPING, &max_l); if (max_l) { q_shift = sub(norm_l(max_l), 2); scale_sig32(msNoiseEst, NPART_SHAPING, q_shift); hFdCngDec->msNoiseEst_exp = sub(hFdCngDec->msNoiseEst_exp, q_shift); } Copy32( msNoiseEst, hFdCngDec->msPsd_fx, npart ); hFdCngDec->msPsd_exp_fft = hFdCngDec->msNoiseEst_exp; Loading
lib_dec/ivas_core_dec.c +6 −6 Original line number Diff line number Diff line Loading @@ -531,8 +531,8 @@ ivas_error ivas_core_dec_fx( IF( st->hFdCngDec != NULL ) { Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); st->hFdCngDec->msNoiseEst_exp = 27; //Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); //st->hFdCngDec->msNoiseEst_exp = 27; move16(); Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, add( M, 1 ), sub( norm_s( sub( st->hFdCngDec->hFdCngCom->A_cng[0], 1 ) ), 3 ) ); Loading Loading @@ -613,8 +613,8 @@ ivas_error ivas_core_dec_fx( /* TCX decoder */ Scale_sig( st->hPFstat->mem_stp, L_SUBFR, -Qsyn_temp ); Scale_sig( st->hPFstat->mem_pf_in, L_SUBFR, -Qsyn_temp ); Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); st->hFdCngDec->msNoiseEst_exp = 27; //Scale_sig32( st->hFdCngDec->msNoiseEst, NPART_SHAPING, sub( st->hFdCngDec->msNoiseEst_exp, 27 ) ); //st->hFdCngDec->msNoiseEst_exp = 27; move16(); Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, -st->hHQ_core->Q_old_wtda_LB ); Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, -st->hHQ_core->Q_old_wtda ); Loading Loading @@ -822,8 +822,8 @@ ivas_error ivas_core_dec_fx( { IF( NE_16( sts[n]->last_core_bfi, ACELP_CORE ) ) { Scale_sig32( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 27 ) ); sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; //Scale_sig32( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, sub( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 27 ) ); //sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; move16(); TonalMdctConceal_whiten_noise_shape_ivas_fx( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); Loading
lib_dec/ivas_cpe_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -814,6 +814,10 @@ ivas_error ivas_cpe_dec_fx( } } } //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->msNoiseEst[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->msNoiseEst_exp ) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->smoothed_psd_fx[2] / pow( 2, hCPE->hCoreCoder[0]->hFdCngDec->q_smoothed_psd) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp) ); //printf( "\n%f ", (float) hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->sidNoiseEst[0] / pow( 2, 31 - hCPE->hCoreCoder[0]->hFdCngDec->hFdCngCom->sidNoiseEstExp) ); /*----------------------------------------------------------------* * Update parameters for stereo CNA Loading
lib_dec/ivas_stereo_cng_dec.c +76 −37 File changed.Preview size limit exceeded, changes collapsed. Show changes