diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b950fe51e7bc4685c29c04b9b350e2852bb52dc8..2a09295cb3199381b63872de7ba93d911a4c591d 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -313,6 +313,9 @@ typedef enum #define MIN_BRATE_SWB_SCE ACELP_9k60 /* min. SCE bitrate where SWB is supported */ #define MIN_BRATE_SWB_STEREO IVAS_13k2 /* min. stereo bitrate where SWB is supported */ #define MIN_BRATE_FB_STEREO IVAS_32k /* min. SCE and stereo bitrate where FB is supported */ +#ifdef ISM_FB +#define MIN_BRATE_FB_ISM 24000 /* min. SCE bitrate where FB is supported in ISM format */ +#endif #define MIN_TDM_BRATE_WB_TBE_1k05 12000 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ #define MIN_BRATE_WB_TBE_1k05 9650 /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */ diff --git a/lib_com/options.h b/lib_com/options.h index b57e3c1db0178d9c3e1eab19d430e05455811d7a..7ac8448cf859d4c8c9bd5c73ea047e21be10c514 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,10 +159,10 @@ #define IGF_TUNING_96 /* FhG: Issue 546: slight tuning of IGF config used in 96 kbps stereo, 128 kbps SBA and others */ #define FIX_549_DMX_GAIN /* FhG: issue 549: ParamISM output too quiet */ - #define FIX_522_ISM_FIRST_SID /* VA: fix ISM decoder crash if first received frame is an SID */ - #define FIX_470_MASA_JBM_EXT /* Nokia: Issue 470, fix MASA EXT output with JBM */ +#define ISM_FB /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index e1472d2a37eccf0d692b0e33c2ff052b956ef7c5..f42f309ac9d366297aa17d8d94684e228eb639ad 100755 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -123,7 +123,12 @@ ivas_error ivas_sce_dec( /* only WB is supported */ st->bwidth = WB; } +#ifdef ISM_FB + else if ( ( hSCE->element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || + ( hSCE->element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) +#else else if ( hSCE->element_brate < MIN_BRATE_FB_STEREO ) +#endif { /* WB and SWB are supported */ st->bwidth = get_next_indice( st, 1 ) + WB; diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index 9c96a851f212f58afc37d5670a6b6b2b17e75ed0..4c4df2fe948af04f77735512fa872e4bc34d9e76 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -587,7 +587,12 @@ void set_bw( { st->bwidth = WB; } +#ifdef ISM_FB + else if ( st->bwidth > SWB && ( ( element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || + ( element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) ) +#else else if ( element_brate < MIN_BRATE_FB_STEREO && st->bwidth > SWB ) +#endif { st->bwidth = SWB; } diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 8f3a9de2f1c09830847f8db5e61a018cc73e59c6..65f16a4a28915bceb4f91693abc45c998fbde692 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -434,7 +434,12 @@ void ivas_signaling_enc( { /* only WB is supported */ } +#ifdef ISM_FB + else if ( ( element_brate < MIN_BRATE_FB_STEREO && !st->is_ism_format ) || + ( element_brate < MIN_BRATE_FB_ISM && st->is_ism_format ) ) +#else else if ( element_brate < MIN_BRATE_FB_STEREO ) +#endif { /* WB and SWB are supported */ ind = st->bwidth - WB; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index bb8eeadc5f32b8eec57c030fea48851a1a45559d..8316fd381dd15fb00df653430e4175e5a4739677 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1699,7 +1699,16 @@ static ivas_error printConfigInfo_enc( { if ( newBandwidthApi != hEncoderConfig->max_bwidth ) { - fprintf( stdout, "\nFB coding not supported below %.2f kbps. Switching to SWB.\n", MIN_BRATE_FB_STEREO / 1000.f ); +#ifdef ISM_FB + if ( hEncoderConfig->ivas_format == ISM_FORMAT ) + { + fprintf( stdout, "\nFB coding not supported below %.2f kbps for %i objects. Switching to SWB.\n", hEncoderConfig->nchan_ism * MIN_BRATE_FB_ISM / 1000.f, hEncoderConfig->nchan_ism ); + } + else +#endif + { + fprintf( stdout, "\nFB coding not supported below %.2f kbps. Switching to SWB.\n", MIN_BRATE_FB_STEREO / 1000.f ); + } } } @@ -1996,7 +2005,12 @@ static ivas_error sanitizeBandwidth( } else { +#ifdef ISM_FB + if ( max_bwidth_tmp == FB && ( ( hEncoderConfig->ivas_format != ISM_FORMAT && hEncoderConfig->ivas_total_brate < MIN_BRATE_FB_STEREO ) || + ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->ivas_total_brate / hEncoderConfig->nchan_ism < MIN_BRATE_FB_ISM ) ) ) +#else if ( max_bwidth_tmp == FB && hEncoderConfig->ivas_total_brate < MIN_BRATE_FB_STEREO ) +#endif { max_bwidth_tmp = SWB; }