Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ #define FIX_I106_TDREND_5MS /* Issue 106: 5 ms update rate in TD object renderer */ #define ALIGN_SID_SIZE /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */ #define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */ #define FIX_CONTROLLABLE_SID_UPDATE_RATE /* Issue 117: fix controllable SID update rate mechanism */ Loading lib_enc/fd_cng_enc.c +11 −20 Original line number Diff line number Diff line Loading @@ -902,6 +902,12 @@ void stereoFdCngCoherence( sts[0]->core_brate = SID_2k40; sts[1]->core_brate = SID_2k40; } #ifdef FIX_CONTROLLABLE_SID_UPDATE_RATE /* synchronize SID counters */ sts[0]->hDtxEnc->cnt_SID = min( sts[0]->hDtxEnc->cnt_SID, sts[1]->hDtxEnc->cnt_SID ); sts[1]->hDtxEnc->cnt_SID = sts[0]->hDtxEnc->cnt_SID; #endif } pt_fftL = fft_buff[0]; Loading Loading @@ -1002,11 +1008,7 @@ void FdCngEncodeMDCTStereoSID( convertToMS( N, ms_ptr[0], ms_ptr[1], 0.5f ); } side_energy = 0.0f; for ( p = 0; p < N; p++ ) { side_energy += ms_ptr[1][p] * ms_ptr[1][p]; } side_energy = sum2_f( ms_ptr[1], N ); /* do not transmit side shape if initial noise shapes are very similar */ if ( side_energy <= 0.1f ) Loading Loading @@ -1186,18 +1188,11 @@ void FdCngEncodeDiracMDCTStereoSID( /* M/S transform on log envelopes */ convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); E[0] = 0.0f; for ( p = 0; p < NPART; p++ ) { E[0] += ms_ptr[0][p]; } E[0] = sum_f( ms_ptr[0], NPART ); /* Quantize M noise shape */ /* Normalize MSVW input */ gain[0] = 0.f; for ( p = N_GAIN_MIN; p < N_GAIN_MAX; p++ ) { gain[0] += ms_ptr[0][p]; } gain[0] = sum_f( ms_ptr[0] + N_GAIN_MIN, N_GAIN_MAX - N_GAIN_MIN ); gain[0] /= (float) ( N_GAIN_MAX - N_GAIN_MIN ); for ( p = 0; p < N[0]; p++ ) Loading @@ -1213,11 +1208,7 @@ void FdCngEncodeDiracMDCTStereoSID( set_zero( ms_ptr[1], NPART ); /* compute M gain */ gain[0] = 0.f; for ( p = 0; p < NPART; p++ ) { gain[0] += ms_ptr[0][p]; } gain[0] = sum_f( ms_ptr[0], NPART ); gain[0] = ( E[0] - gain[0] ) / (float) N[0]; apply_scale( &gain[0], sts[0]->hFdCngEnc->hFdCngCom->CngBandwidth, sts[0]->hDtxEnc->last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO ); Loading Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ #define FIX_I106_TDREND_5MS /* Issue 106: 5 ms update rate in TD object renderer */ #define ALIGN_SID_SIZE /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */ #define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */ #define FIX_CONTROLLABLE_SID_UPDATE_RATE /* Issue 117: fix controllable SID update rate mechanism */ Loading
lib_enc/fd_cng_enc.c +11 −20 Original line number Diff line number Diff line Loading @@ -902,6 +902,12 @@ void stereoFdCngCoherence( sts[0]->core_brate = SID_2k40; sts[1]->core_brate = SID_2k40; } #ifdef FIX_CONTROLLABLE_SID_UPDATE_RATE /* synchronize SID counters */ sts[0]->hDtxEnc->cnt_SID = min( sts[0]->hDtxEnc->cnt_SID, sts[1]->hDtxEnc->cnt_SID ); sts[1]->hDtxEnc->cnt_SID = sts[0]->hDtxEnc->cnt_SID; #endif } pt_fftL = fft_buff[0]; Loading Loading @@ -1002,11 +1008,7 @@ void FdCngEncodeMDCTStereoSID( convertToMS( N, ms_ptr[0], ms_ptr[1], 0.5f ); } side_energy = 0.0f; for ( p = 0; p < N; p++ ) { side_energy += ms_ptr[1][p] * ms_ptr[1][p]; } side_energy = sum2_f( ms_ptr[1], N ); /* do not transmit side shape if initial noise shapes are very similar */ if ( side_energy <= 0.1f ) Loading Loading @@ -1186,18 +1188,11 @@ void FdCngEncodeDiracMDCTStereoSID( /* M/S transform on log envelopes */ convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); E[0] = 0.0f; for ( p = 0; p < NPART; p++ ) { E[0] += ms_ptr[0][p]; } E[0] = sum_f( ms_ptr[0], NPART ); /* Quantize M noise shape */ /* Normalize MSVW input */ gain[0] = 0.f; for ( p = N_GAIN_MIN; p < N_GAIN_MAX; p++ ) { gain[0] += ms_ptr[0][p]; } gain[0] = sum_f( ms_ptr[0] + N_GAIN_MIN, N_GAIN_MAX - N_GAIN_MIN ); gain[0] /= (float) ( N_GAIN_MAX - N_GAIN_MIN ); for ( p = 0; p < N[0]; p++ ) Loading @@ -1213,11 +1208,7 @@ void FdCngEncodeDiracMDCTStereoSID( set_zero( ms_ptr[1], NPART ); /* compute M gain */ gain[0] = 0.f; for ( p = 0; p < NPART; p++ ) { gain[0] += ms_ptr[0][p]; } gain[0] = sum_f( ms_ptr[0], NPART ); gain[0] = ( E[0] - gain[0] ) / (float) N[0]; apply_scale( &gain[0], sts[0]->hFdCngEnc->hFdCngCom->CngBandwidth, sts[0]->hDtxEnc->last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO ); Loading