Loading lib_com/ivas_prot_fx.h +5 −0 Original line number Diff line number Diff line Loading @@ -1138,4 +1138,9 @@ void FdCngDecodeDiracMDCTStereoSID_fx( CPE_DEC_HANDLE hCPE /* i/o: CPE decoder state structure */ ); //tonalMDCTconcealment.c void TonalMdctConceal_whiten_noise_shape_ivas_fx( Decoder_State *st, const Word16 L_frame, const TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE whitening_mode ); #endif lib_com/prot_fx1.h +4 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ Word32 sum16_32_fx( /* o : sum of all vector elements const Word16 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ); Word32 sum32_sat( /* o : sum of all vector elements Qx*/ const Word32 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ); Word32 var_fx_32( /* o: variance of vector Qx+16*/ const Word16 *x, /* i: input vector Qx*/ const Word16 Qx, Loading lib_com/tools_fx.c +17 −0 Original line number Diff line number Diff line Loading @@ -1118,6 +1118,23 @@ Word32 sum16_32_fx( /* o : sum of all vector elements Qx*/ return tmp; } Word32 sum32_sat( /* o : sum of all vector elements Qx*/ const Word32 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ) { Word16 i; Word32 tmp; tmp = 0; move16(); FOR( i = 0; i < lvec; i++ ) { tmp = L_add_sat( tmp, vec[i] ); /*Qx */ } return tmp; } Word32 var_fx_32( /* o: variance of vector Qx+16*/ const Word16 *x, /* i: input vector Qx*/ const Word16 Qx, Loading lib_dec/fd_cng_dec.c +22 −2 Original line number Diff line number Diff line Loading @@ -515,7 +515,27 @@ void ApplyFdCng_flt( { if ( st->element_mode == IVAS_CPE_MDCT && st->core != ACELP_CORE ) { #ifdef IVAS_FLOAT_FIXED hFdCngCom->cngNoiseLevelExp = 28; for ( int p = 0; p < hFdCngCom->stopFFTbin - hFdCngCom->startBand; p++ ) { hFdCngCom->cngNoiseLevel[p] = (Word32) (cngNoiseLevel_flt[p] * ( 1u << ( 31 - hFdCngCom->cngNoiseLevelExp ) ) ); } TonalMdctConceal_whiten_noise_shape_ivas_fx( st, L_frame, ON_FIRST_LOST_FRAME ); for (int p = 0; p < hFdCngCom->stopFFTbin - hFdCngCom->startBand; p++) { cngNoiseLevel_flt[p] = (float)hFdCngCom->cngNoiseLevel[p] / (1u << (31 - hFdCngCom->cngNoiseLevelExp)); } for ( int p = 0; p < FDNS_NPTS; p++ ) { st->hTonalMDCTConc->scaleFactorsBackground_flt[p] = (float) st->hTonalMDCTConc->scaleFactorsBackground_fx[p] / ONE_IN_Q16; } #else TonalMdctConceal_whiten_noise_shape_ivas(st, L_frame, ON_FIRST_LOST_FRAME); #endif // IVAS_FLOAT_FIXED } else if ( st->element_mode != IVAS_CPE_MDCT || st->core == ACELP_CORE ) { Loading Loading @@ -1224,7 +1244,7 @@ void generate_comfort_noise_dec_flt( SynthesisSTFT_flt( fftBuffer, timeDomainOutput, hFdCngCom->olapBufferSynth_flt, hFdCngCom->olapWinSyn_flt, tcx_transition, hFdCngCom, st->element_mode, nchan_out ); #else Word32 fftBuffer_fx[FFTLEN], timeDomainBuffer_fx[L_FRAME16k]; Word16 exp = Q15; Word16 exp = Q14; for ( i = 0; i < hFdCngCom->fftlen; i++ ) { fftBuffer_fx[i] = float_to_fix( fftBuffer[i], exp ); Loading lib_dec/ivas_core_dec.c +23 −0 Original line number Diff line number Diff line Loading @@ -591,7 +591,30 @@ ivas_error ivas_core_dec( { if ( sts[n]->last_core_bfi != ACELP_CORE ) { #ifdef IVAS_FLOAT_FIXED sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; for ( int p = 0; p < sts[n]->hFdCngDec->hFdCngCom->stopFFTbin - sts[n]->hFdCngDec->hFdCngCom->startBand; p++ ) { sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel[p] = (Word32) ( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] * ( 1u << ( 31 - sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ) ); } for (int p = 0; p < FDNS_NPTS; p++) { sts[n]->hTonalMDCTConc->scaleFactorsBackground_fx[p] = (Word32)(sts[n]->hTonalMDCTConc->scaleFactorsBackground_flt[p] * ONE_IN_Q16); } TonalMdctConceal_whiten_noise_shape_ivas_fx( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); for ( int p = 0; p < sts[n]->hFdCngDec->hFdCngCom->stopFFTbin - sts[n]->hFdCngDec->hFdCngCom->startBand; p++ ) { sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = (float) sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel[p] / ( 1u << ( 31 - sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ); } for ( int p = 0; p < FDNS_NPTS; p++ ) { sts[n]->hTonalMDCTConc->scaleFactorsBackground_flt[p] = (float) sts[n]->hTonalMDCTConc->scaleFactorsBackground_fx[p] / ONE_IN_Q16; } #else TonalMdctConceal_whiten_noise_shape_ivas( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); #endif // IVAS_FLOAT_FIXED } } } Loading Loading
lib_com/ivas_prot_fx.h +5 −0 Original line number Diff line number Diff line Loading @@ -1138,4 +1138,9 @@ void FdCngDecodeDiracMDCTStereoSID_fx( CPE_DEC_HANDLE hCPE /* i/o: CPE decoder state structure */ ); //tonalMDCTconcealment.c void TonalMdctConceal_whiten_noise_shape_ivas_fx( Decoder_State *st, const Word16 L_frame, const TONALMDCTCONC_NOISE_SHAPE_WHITENING_MODE whitening_mode ); #endif
lib_com/prot_fx1.h +4 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,10 @@ Word32 sum16_32_fx( /* o : sum of all vector elements const Word16 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ); Word32 sum32_sat( /* o : sum of all vector elements Qx*/ const Word32 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ); Word32 var_fx_32( /* o: variance of vector Qx+16*/ const Word16 *x, /* i: input vector Qx*/ const Word16 Qx, Loading
lib_com/tools_fx.c +17 −0 Original line number Diff line number Diff line Loading @@ -1118,6 +1118,23 @@ Word32 sum16_32_fx( /* o : sum of all vector elements Qx*/ return tmp; } Word32 sum32_sat( /* o : sum of all vector elements Qx*/ const Word32 *vec, /* i : input vector Qx*/ const Word16 lvec /* i : length of input vector */ ) { Word16 i; Word32 tmp; tmp = 0; move16(); FOR( i = 0; i < lvec; i++ ) { tmp = L_add_sat( tmp, vec[i] ); /*Qx */ } return tmp; } Word32 var_fx_32( /* o: variance of vector Qx+16*/ const Word16 *x, /* i: input vector Qx*/ const Word16 Qx, Loading
lib_dec/fd_cng_dec.c +22 −2 Original line number Diff line number Diff line Loading @@ -515,7 +515,27 @@ void ApplyFdCng_flt( { if ( st->element_mode == IVAS_CPE_MDCT && st->core != ACELP_CORE ) { #ifdef IVAS_FLOAT_FIXED hFdCngCom->cngNoiseLevelExp = 28; for ( int p = 0; p < hFdCngCom->stopFFTbin - hFdCngCom->startBand; p++ ) { hFdCngCom->cngNoiseLevel[p] = (Word32) (cngNoiseLevel_flt[p] * ( 1u << ( 31 - hFdCngCom->cngNoiseLevelExp ) ) ); } TonalMdctConceal_whiten_noise_shape_ivas_fx( st, L_frame, ON_FIRST_LOST_FRAME ); for (int p = 0; p < hFdCngCom->stopFFTbin - hFdCngCom->startBand; p++) { cngNoiseLevel_flt[p] = (float)hFdCngCom->cngNoiseLevel[p] / (1u << (31 - hFdCngCom->cngNoiseLevelExp)); } for ( int p = 0; p < FDNS_NPTS; p++ ) { st->hTonalMDCTConc->scaleFactorsBackground_flt[p] = (float) st->hTonalMDCTConc->scaleFactorsBackground_fx[p] / ONE_IN_Q16; } #else TonalMdctConceal_whiten_noise_shape_ivas(st, L_frame, ON_FIRST_LOST_FRAME); #endif // IVAS_FLOAT_FIXED } else if ( st->element_mode != IVAS_CPE_MDCT || st->core == ACELP_CORE ) { Loading Loading @@ -1224,7 +1244,7 @@ void generate_comfort_noise_dec_flt( SynthesisSTFT_flt( fftBuffer, timeDomainOutput, hFdCngCom->olapBufferSynth_flt, hFdCngCom->olapWinSyn_flt, tcx_transition, hFdCngCom, st->element_mode, nchan_out ); #else Word32 fftBuffer_fx[FFTLEN], timeDomainBuffer_fx[L_FRAME16k]; Word16 exp = Q15; Word16 exp = Q14; for ( i = 0; i < hFdCngCom->fftlen; i++ ) { fftBuffer_fx[i] = float_to_fix( fftBuffer[i], exp ); Loading
lib_dec/ivas_core_dec.c +23 −0 Original line number Diff line number Diff line Loading @@ -591,7 +591,30 @@ ivas_error ivas_core_dec( { if ( sts[n]->last_core_bfi != ACELP_CORE ) { #ifdef IVAS_FLOAT_FIXED sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = 27; for ( int p = 0; p < sts[n]->hFdCngDec->hFdCngCom->stopFFTbin - sts[n]->hFdCngDec->hFdCngCom->startBand; p++ ) { sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel[p] = (Word32) ( sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] * ( 1u << ( 31 - sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ) ); } for (int p = 0; p < FDNS_NPTS; p++) { sts[n]->hTonalMDCTConc->scaleFactorsBackground_fx[p] = (Word32)(sts[n]->hTonalMDCTConc->scaleFactorsBackground_flt[p] * ONE_IN_Q16); } TonalMdctConceal_whiten_noise_shape_ivas_fx( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); for ( int p = 0; p < sts[n]->hFdCngDec->hFdCngCom->stopFFTbin - sts[n]->hFdCngDec->hFdCngCom->startBand; p++ ) { sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel_flt[p] = (float) sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevel[p] / ( 1u << ( 31 - sts[n]->hFdCngDec->hFdCngCom->cngNoiseLevelExp ) ); } for ( int p = 0; p < FDNS_NPTS; p++ ) { sts[n]->hTonalMDCTConc->scaleFactorsBackground_flt[p] = (float) sts[n]->hTonalMDCTConc->scaleFactorsBackground_fx[p] / ONE_IN_Q16; } #else TonalMdctConceal_whiten_noise_shape_ivas( sts[n], L_FRAME16k, ON_FIRST_GOOD_FRAME ); #endif // IVAS_FLOAT_FIXED } } } Loading