Skip to content
Commits on Source (17)
...@@ -282,7 +282,7 @@ build-codec-sanitizers-linux: ...@@ -282,7 +282,7 @@ build-codec-sanitizers-linux:
- *print-common-info - *print-common-info
- bash ci/build_codec_sanitizers_linux.sh - bash ci/build_codec_sanitizers_linux.sh
build-codec-windows-cmake: .build-codec-windows-cmake:
extends: extends:
- .build-job-windows-with-check-for-warnings - .build-job-windows-with-check-for-warnings
- .rules-basis - .rules-basis
...@@ -295,7 +295,7 @@ build-codec-windows-cmake: ...@@ -295,7 +295,7 @@ build-codec-windows-cmake:
- ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
- ("exit $LASTEXITCODE") | Invoke-Expression - ("exit $LASTEXITCODE") | Invoke-Expression
build-codec-windows-msbuild: .build-codec-windows-msbuild:
extends: extends:
- .build-job-windows-with-check-for-warnings - .build-job-windows-with-check-for-warnings
- .rules-basis - .rules-basis
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
#define BETA_ISM_LOW_IMP 0.6f #define BETA_ISM_LOW_IMP 0.6f
#define BETA_ISM_MEDIUM_IMP 0.8f #define BETA_ISM_MEDIUM_IMP 0.8f
#ifdef FIX_562_ISM2_64KBPS
#define MAX_BRATE_TCX_32k 48000
#endif
/*-------------------------------------------------------------------* /*-------------------------------------------------------------------*
* bitbudget_to_brate() * bitbudget_to_brate()
...@@ -346,6 +350,23 @@ ivas_error ivas_ism_config( ...@@ -346,6 +350,23 @@ ivas_error ivas_ism_config(
bits_CoreCoder[ch] = tmp; bits_CoreCoder[ch] = tmp;
} }
#ifdef FIX_562_ISM2_64KBPS
/* limitaton to avoid too high bitrate in one active TCX channel */
if ( element_brate[0] >= SCE_CORE_16k_LOW_LIMIT && element_brate[0] <= IVAS_32k )
{
diff = 0;
limit_high = MAX_BRATE_TCX_32k / FRAMES_PER_SEC;
for ( ch = 0; ch < n_ISms; ch++ )
{
tmp = (int16_t) min( bits_CoreCoder[ch], limit_high );
diff += bits_CoreCoder[ch] - tmp;
bits_CoreCoder[ch] = tmp;
}
}
#endif
if ( diff > 0 ) if ( diff > 0 )
{ {
ch = 0; ch = 0;
......
...@@ -168,6 +168,13 @@ ...@@ -168,6 +168,13 @@
#define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ #define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */
#define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */ #define FIX_564 /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */
#define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */ #define FIX_566_2DIR_MASA_384K /* Nokia: Issued 566: Bugfix in 384k MASA metadata encoding of second direction */
#define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */
#define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */
#define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */
/* ################## End DEVELOPMENT switches ######################### */ /* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */ /* clang-format on */
......
...@@ -331,8 +331,11 @@ void FEC_exc_estim( ...@@ -331,8 +331,11 @@ void FEC_exc_estim(
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* Replicate the last spectrum in case the last good frame was coded by GSC * Replicate the last spectrum in case the last good frame was coded by GSC
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
#ifndef FIX_565_SBA_BURST_IN_FEC
if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB )
#else
if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB )
#endif
{ {
/* Replication of the last spectrum, with a slight downscaling of its dynamic */ /* Replication of the last spectrum, with a slight downscaling of its dynamic */
st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag; st->GSC_noisy_speech = st->Last_GSC_noisy_speech_flag;
...@@ -404,8 +407,11 @@ void FEC_exc_estim( ...@@ -404,8 +407,11 @@ void FEC_exc_estim(
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* Total excitation * Total excitation
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
#ifndef FIX_565_SBA_BURST_IN_FEC
if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB ) if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= ACELP_24k40 && !st->Opt_AMR_WB )
#else
if ( ( st->last_coder_type == AUDIO || st->last_good == INACTIVE_CLAS ) && st->total_brate <= MAX_GSC_INACTIVE_BRATE && !st->Opt_AMR_WB )
#endif
{ {
/* For GSC - the excitation is already computed */ /* For GSC - the excitation is already computed */
mvr2r( exc, exc2, st->L_frame ); mvr2r( exc, exc2, st->L_frame );
......
...@@ -542,7 +542,12 @@ ivas_error ivas_ism_metadata_dec( ...@@ -542,7 +542,12 @@ ivas_error ivas_ism_metadata_dec(
if ( ism_mode == ISM_MODE_DISC ) if ( ism_mode == ISM_MODE_DISC )
{ {
#ifdef FIX_532_ISM_MD_INACTIVE #ifdef FIX_532_ISM_MD_INACTIVE
#ifdef FIX_562_ISM2_64KBPS
if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) ||
( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) )
#else
if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 ) if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 )
#endif
#else #else
if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global ) if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global )
#endif #endif
......
...@@ -189,11 +189,17 @@ ivas_error ivas_sce_dec( ...@@ -189,11 +189,17 @@ ivas_error ivas_sce_dec(
{ {
st->total_brate = ivas_total_brate; st->total_brate = ivas_total_brate;
} }
#ifndef FIX_565_SBA_BURST_IN_FEC
else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */ else if ( st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */
{ {
st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC; st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC;
} }
#else
else if ( !st_ivas->bfi && st_ivas->ivas_format != ISM_FORMAT ) /* note: in ISMs, total_brate[] is set in ivas_ism_config() */
{
st->total_brate = hSCE->element_brate - nb_bits_metadata * FRAMES_PER_SEC;
}
#endif
/*----------------------------------------------------------------* /*----------------------------------------------------------------*
* Core codec configuration * Core codec configuration
*----------------------------------------------------------------*/ *----------------------------------------------------------------*/
......
...@@ -340,8 +340,12 @@ ivas_error ivas_spar_dec( ...@@ -340,8 +340,12 @@ ivas_error ivas_spar_dec(
st0->bit_stream = bstr_meta; st0->bit_stream = bstr_meta;
st0->next_bit_pos = 0; st0->next_bit_pos = 0;
st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 ); st0->bits_frame = min( MAX_BITS_METADATA, last_bit_pos + 1 );
#ifdef FIX_565_SBA_BURST_IN_FEC
if ( !st0->bfi )
#endif
{
st0->total_brate = hDecoderConfig->ivas_total_brate; /* to avoid BER detect */ st0->total_brate = hDecoderConfig->ivas_total_brate; /* to avoid BER detect */
}
ivas_spar_dec_MD( st_ivas, st0 ); ivas_spar_dec_MD( st_ivas, st0 );
*nb_bits_read = st0->next_bit_pos + nb_bits_read_orig; *nb_bits_read = st0->next_bit_pos + nb_bits_read_orig;
......
...@@ -367,7 +367,11 @@ ivas_error ivas_core_enc( ...@@ -367,7 +367,11 @@ ivas_error ivas_core_enc(
} }
/* SWB TBE encoder */ /* SWB TBE encoder */
#ifdef FIX_559_EXTL_IGF_MISMATCH
if ( st->extl == SWB_TBE || st->extl == FB_TBE )
#else
if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->igf && st->core == ACELP_CORE && st->extl != WB_TBE ) ) if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->igf && st->core == ACELP_CORE && st->extl != WB_TBE ) )
#endif
{ {
if ( st->core_brate != FRAME_NO_DATA && st->core_brate != SID_2k40 ) if ( st->core_brate != FRAME_NO_DATA && st->core_brate != SID_2k40 )
{ {
......
...@@ -288,6 +288,13 @@ ivas_error pre_proc_ivas( ...@@ -288,6 +288,13 @@ ivas_error pre_proc_ivas(
else if ( element_brate != last_element_brate ) else if ( element_brate != last_element_brate )
{ {
SetModeIndex( st, st->bits_frame_nominal * FRAMES_PER_SEC, element_mode, MCT_flag ); SetModeIndex( st, st->bits_frame_nominal * FRAMES_PER_SEC, element_mode, MCT_flag );
#ifdef FIX_559_EXTL_IGF_MISMATCH
if ( st->extl != -1 && st->extl != IGF_BWE && st->igf == 1 )
{
st->igf = 0;
}
#endif
} }
......
...@@ -636,7 +636,12 @@ ivas_error ivas_ism_metadata_enc( ...@@ -636,7 +636,12 @@ ivas_error ivas_ism_metadata_enc(
if ( ism_mode == ISM_MODE_DISC ) if ( ism_mode == ISM_MODE_DISC )
{ {
#ifdef FIX_532_ISM_MD_INACTIVE #ifdef FIX_532_ISM_MD_INACTIVE
#ifdef FIX_562_ISM2_64KBPS
if ( ism_imp[ch] == ISM_NO_META && ( ( total_brate[ch] < ACELP_8k00 && element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) ||
( total_brate[ch] <= ACELP_16k_LOW_LIMIT && element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) ) )
#else
if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 ) if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 )
#endif
#else #else
if ( hIsmMeta[ch]->ism_metadata_flag == 0 && vad_flag[ch] == 0 && ism_metadata_flag_global ) if ( hIsmMeta[ch]->ism_metadata_flag == 0 && vad_flag[ch] == 0 && ism_metadata_flag_global )
#endif #endif
......