From d4a62614e7ed0f52e565c5361e67636c4fa8fa71 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 30 Jun 2023 09:02:32 +0300 Subject: [PATCH 1/3] Fixes issue 585 by correcting condition --- lib_com/ivas_prot.h | 4 ++++ lib_com/options.h | 1 + lib_dec/ivas_dec.c | 4 ++++ lib_dec/ivas_jbm_dec.c | 4 ++++ lib_dec/ivas_masa_dec.c | 10 +++++++++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 9bc253776d..f39e5a4aa5 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5121,6 +5121,10 @@ void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ const int16_t output_frame /* i : output frame length per channel */ +#ifdef FIX_585_MASA_2TC_DTX_EXT + , + const int16_t nchan_remapped /* i : number of transports used in core */ +#endif ); diff --git a/lib_com/options.h b/lib_com/options.h index e4d3a06b58..81f53ae13c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,6 +161,7 @@ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ +#define FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 439a90fb2c..6ba9a31bb1 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -390,7 +390,11 @@ ivas_error ivas_dec( if ( st_ivas->ivas_format == MASA_FORMAT ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); +#else ivas_masa_prerender( st_ivas, output, output_frame ); +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index ff28af051a..9c0fc76955 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -292,7 +292,11 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); +#else ivas_masa_prerender( st_ivas, output, output_frame ); +#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 0576fe8121..57b628b5f8 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -565,10 +565,18 @@ static ivas_error ivas_masa_dec_config( void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ - const int16_t output_frame /* i : output frame length per channel */ + const int16_t output_frame /* i : output frame length per channel */ +#ifdef FIX_585_MASA_2TC_DTX_EXT + , + const int16_t nchan_remapped /* i : number of transports used in core */ +#endif ) { +#ifdef FIX_585_MASA_2TC_DTX_EXT + if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && nchan_remapped == 1 ) +#else if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) +#endif { if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) { -- GitLab From 27b490a31ea94e3e53d29b6ef51cf1987e3e6217 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Fri, 30 Jun 2023 09:18:51 +0300 Subject: [PATCH 2/3] Apply clang format --- lib_dec/ivas_masa_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 57b628b5f8..1ad0a36427 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -565,7 +565,7 @@ static ivas_error ivas_masa_dec_config( void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ - const int16_t output_frame /* i : output frame length per channel */ + const int16_t output_frame /* i : output frame length per channel */ #ifdef FIX_585_MASA_2TC_DTX_EXT , const int16_t nchan_remapped /* i : number of transports used in core */ -- GitLab From 044dd2d36077f8cd0f29844cfa0e98101ee7799f Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Thu, 13 Jul 2023 16:36:19 +0200 Subject: [PATCH 3/3] renamed switch from FIX_585_MASA_2TC_DTX_EXT to CR_FIX_585_MASA_2TC_DTX_EXT since the behaviour in selection test operation points will be changed --- lib_com/ivas_prot.h | 2 +- lib_com/options.h | 2 +- lib_dec/ivas_dec.c | 2 +- lib_dec/ivas_jbm_dec.c | 2 +- lib_dec/ivas_masa_dec.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index f39e5a4aa5..37373dbd75 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5121,7 +5121,7 @@ void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ const int16_t output_frame /* i : output frame length per channel */ -#ifdef FIX_585_MASA_2TC_DTX_EXT +#ifdef CR_FIX_585_MASA_2TC_DTX_EXT , const int16_t nchan_remapped /* i : number of transports used in core */ #endif diff --git a/lib_com/options.h b/lib_com/options.h index 0e0ef4307d..8dbe846c07 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,11 +170,11 @@ /* ################## End BE DEVELOPMENT switches ######################### */ -#define FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ /* #################### Start NON-BE CR switches ########################## */ /* any switch which is non-be wrt operation points tested in selection */ /* all switches in this category should start with "CR_" */ +#define CR_FIX_585_MASA_2TC_DTX_EXT /* Nokia: issue 585: fixes transition artifacts in MASA 2TC DTX by applying correct condition */ /* ##################### End NON-BE CR switches ########################### */ diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 6ba9a31bb1..a5d4abd6aa 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -390,7 +390,7 @@ ivas_error ivas_dec( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef FIX_585_MASA_2TC_DTX_EXT +#ifdef CR_FIX_585_MASA_2TC_DTX_EXT ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); #else ivas_masa_prerender( st_ivas, output, output_frame ); diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9c0fc76955..1c0e1af518 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -292,7 +292,7 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef FIX_585_MASA_2TC_DTX_EXT +#ifdef CR_FIX_585_MASA_2TC_DTX_EXT ivas_masa_prerender( st_ivas, output, output_frame, nchan_remapped ); #else ivas_masa_prerender( st_ivas, output, output_frame ); diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 1ad0a36427..d44d81d54e 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -566,13 +566,13 @@ void ivas_masa_prerender( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float output[][L_FRAME48k], /* i/o: synthesized core-coder transport channels */ const int16_t output_frame /* i : output frame length per channel */ -#ifdef FIX_585_MASA_2TC_DTX_EXT +#ifdef CR_FIX_585_MASA_2TC_DTX_EXT , const int16_t nchan_remapped /* i : number of transports used in core */ #endif ) { -#ifdef FIX_585_MASA_2TC_DTX_EXT +#ifdef CR_FIX_585_MASA_2TC_DTX_EXT if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && nchan_remapped == 1 ) #else if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) -- GitLab