From abe77d9241ed709e9988490e6adcc6c460aae7ad Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 25 Mar 2026 16:20:38 +0100 Subject: [PATCH] FIX_1547_ISMDTX_HANDLE --- lib_com/ivas_prot_fx.h | 4 ++++ lib_com/options.h | 1 + lib_dec/ivas_dec_fx.c | 8 ++++++++ lib_dec/ivas_ism_metadata_dec_fx.c | 31 +++++++++++++++++++++--------- lib_dec/ivas_ism_param_dec_fx.c | 27 +++++++++++++++++++++++--- lib_dec/ivas_omasa_dec_fx.c | 6 ++++++ lib_dec/ivas_osba_dec_fx.c | 6 ++++++ 7 files changed, 71 insertions(+), 12 deletions(-) diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 15af6dffe..f9dd86e4c 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -743,7 +743,11 @@ ivas_error ivas_ism_metadata_dec_fx( const Word16 bfi, /* i : bfi flag */ Word16 nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ +#ifdef FIX_1547_ISMDTX_HANDLE + ISM_DTX_DATA_DEC *hISMDTX, /* i/o: ISM DTX handle */ +#else ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ +#endif const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ Word16 *ism_extmeta_active, /* i/o: Extended metadata active in renderer */ Word16 *ism_extmeta_cnt, /* i/o: Number of change frames observed */ diff --git a/lib_com/options.h b/lib_com/options.h index 598299d16..2618a8190 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -97,6 +97,7 @@ #define FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT /* Eri: Basop issue 2486: IVAS BASOP used calculations with truncation, EVS BASOP used rounding. This aligns the use of a table lookup. */ #define FIX_1543_MID_LSF_BITS /* VA: float issue 1543: Resolve "MSAN: use-of-uninitialized-value in lib_enc/lsf_enc.c:262:5 for EVS encoder" */ #define FIX_2488_PREVENT_NEG_PITCH /* VA: Fix for 2488, use saturation to prevent possible wrap-around, thus negative pitch values */ +#define FIX_1547_ISMDTX_HANDLE /* VA: float issue 1547: fix use of 'hISMDTX' handle */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_dec_fx.c b/lib_dec/ivas_dec_fx.c index 19cedd9ef..4cb4ad146 100644 --- a/lib_dec/ivas_dec_fx.c +++ b/lib_dec/ivas_dec_fx.c @@ -129,7 +129,11 @@ ivas_error ivas_dec_fx( } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { +#ifdef FIX_1547_ISMDTX_HANDLE + IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->hISMDTX ), st_ivas->hParamIsmDec->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hParamIsmDec->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -138,7 +142,11 @@ ivas_error ivas_dec_fx( } ELSE /* ISM_MODE_DISC */ { +#ifdef FIX_1547_ISMDTX_HANDLE + IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->hISMDTX ), NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#endif { return error; } diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 542e25b67..53d7c4a6d 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -160,15 +160,19 @@ static void ism_metadata_smooth_fx( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_dec_fx( - const Word32 ism_total_brate, /* i : ISM total bitrate */ - const Word16 nchan_ism, /* i : number of ISM channels */ - Word16 *nchan_transport, /* o : number of transport channels */ - ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ - SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder handles */ - const Word16 bfi, /* i : bfi flag */ - Word16 nb_bits_metadata[], /* o : number of metadata bits */ - ISM_MODE ism_mode, /* i : ISM mode */ - ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ + const Word32 ism_total_brate, /* i : ISM total bitrate */ + const Word16 nchan_ism, /* i : number of ISM channels */ + Word16 *nchan_transport, /* o : number of transport channels */ + ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles */ + SCE_DEC_HANDLE hSCE[], /* i/o: SCE decoder handles */ + const Word16 bfi, /* i : bfi flag */ + Word16 nb_bits_metadata[], /* o : number of metadata bits */ + ISM_MODE ism_mode, /* i : ISM mode */ +#ifdef FIX_1547_ISMDTX_HANDLE + ISM_DTX_DATA_DEC *hISMDTX, /* i/o: ISM DTX handle */ +#else + ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ +#endif const PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i : Param ISM Config Handle */ Word16 *ism_extmeta_active, /* i/o: Extended metadata active in renderer */ Word16 *ism_extmeta_cnt, /* i/o: Number of change frames observed */ @@ -636,12 +640,21 @@ ivas_error ivas_ism_metadata_dec_fx( } } +#ifdef FIX_1547_ISMDTX_HANDLE + IF( LT_16( hISMDTX->ism_dtx_hangover_cnt, IVAS_ISM_DTX_HO_MAX ) ) + { + ism_metadata_smooth_fx( hIsmMeta, ism_total_brate, nchan_ism ); + hISMDTX->ism_dtx_hangover_cnt = add( hISMDTX->ism_dtx_hangover_cnt, 1 ); + move16(); + } +#else IF( LT_16( hISMDTX.ism_dtx_hangover_cnt, IVAS_ISM_DTX_HO_MAX ) ) { ism_metadata_smooth_fx( hIsmMeta, ism_total_brate, nchan_ism ); hISMDTX.ism_dtx_hangover_cnt = add( hISMDTX.ism_dtx_hangover_cnt, 1 ); move16(); } +#endif IF( EQ_32( ism_mode, ISM_SBA_MODE_DISC ) ) { diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index ca5bb4038..c9d241616 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -222,9 +222,13 @@ static void ivas_param_ism_collect_slot_fx( } static void ivas_param_ism_compute_mixing_matrix_fx( - const Word16 nchan_ism, /* i : number of ISM channels */ - PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ - ISM_DTX_DATA_DEC hISMDTX, /* i : ISM DTX handle */ + const Word16 nchan_ism, /* i : number of ISM channels */ + PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ +#ifdef FIX_1547_ISMDTX_HANDLE + const ISM_DTX_DATA_DEC *hISMDTX, /* i : ISM DTX handle */ +#else + ISM_DTX_DATA_DEC hISMDTX, /* i : ISM DTX handle */ +#endif Word32 direct_response_fx[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN], // Q30 const Word16 nchan_transport, const Word16 nchan_out_woLFE, @@ -251,7 +255,11 @@ static void ivas_param_ism_compute_mixing_matrix_fx( assert( nchan_transport == 2 ); test(); +#ifdef FIX_1547_ISMDTX_HANDLE + IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX->dtx_flag ) +#else IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) +#endif { num_wave = nchan_ism; move16(); @@ -278,7 +286,11 @@ static void ivas_param_ism_compute_mixing_matrix_fx( { set32_fx( cy_diag_tmp_fx[w], 0, nchan_out_woLFE ); test(); +#ifdef FIX_1547_ISMDTX_HANDLE + IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX->dtx_flag ) +#else IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) +#endif { dir_res_ptr_fx = direct_response_fx[w]; } @@ -326,7 +338,11 @@ static void ivas_param_ism_compute_mixing_matrix_fx( FOR( w = 0; w < num_wave; w++ ) { test(); +#ifdef FIX_1547_ISMDTX_HANDLE + IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX->dtx_flag ) +#else IF( hParamIsmDec->hParamIsm->flag_noisy_speech || hISMDTX.dtx_flag ) +#endif { // direct_power[w] = ( 1.0f / nchan_ism ) * ref_power[bin_idx]; SWITCH( nchan_ism ) @@ -1355,8 +1371,13 @@ void ivas_param_ism_dec_prepare_renderer_fx( } /* Compute mixing matrix */ +#ifdef FIX_1547_ISMDTX_HANDLE + ivas_param_ism_compute_mixing_matrix_fx( st_ivas->nchan_ism, hParamIsmDec, &( st_ivas->hISMDTX ), direct_response_fx, nchan_transport, nchan_out_woLFE, cx_diag_fx, exp_cx_diag, + hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_fx, hParamIsmDec->hParamIsmRendering->exp_mixing_matrix_lin_fx ); +#else ivas_param_ism_compute_mixing_matrix_fx( st_ivas->nchan_ism, hParamIsmDec, st_ivas->hISMDTX, direct_response_fx, nchan_transport, nchan_out_woLFE, cx_diag_fx, exp_cx_diag, hParamIsmDec->hParamIsmRendering->mixing_matrix_lin_fx, hParamIsmDec->hParamIsmRendering->exp_mixing_matrix_lin_fx ); +#endif return; } diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index c21477d9d..20505c0a6 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -985,9 +985,15 @@ ivas_error ivas_omasa_ism_metadata_dec_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) ) { /* decode ISM metadata */ +#ifdef FIX_1547_ISMDTX_HANDLE + IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ism_total_brate, *nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, + nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->hISMDTX ), NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), + IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ism_total_brate, *nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#endif { return error; } diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 590b120a4..c40914858 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -251,9 +251,15 @@ ivas_error ivas_osba_ism_metadata_dec_fx( move16(); /* decode ISM metadata */ +#ifdef FIX_1547_ISMDTX_HANDLE + IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ism_total_brate, *nchan_ism, &nchan_transport_ism, st_ivas->hIsmMetaData, NULL, st_ivas->bfi, + nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->hISMDTX ), NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hCPE[0]->hCoreCoder[0] ) ), + IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_ism_metadata_dec_fx( ism_total_brate, *nchan_ism, &nchan_transport_ism, st_ivas->hIsmMetaData, NULL, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hCPE[0]->hCoreCoder[0] ) ), IVAS_ERR_OK ) ) +#endif { return error; } -- GitLab