diff --git a/lib_com/options.h b/lib_com/options.h index 388b0d2c43e29fb68913985399851438ef70c2b2..ce06089a06e20716117463869a8c3210db99d4f9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -114,6 +114,7 @@ #define FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT /* Dolby: Issue 2250: random vector generation in GenShapedSHBExcitation() */ #define FIX_2320_OOB_SCE_SWITCHING /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */ #define FIX_2302_LSF_CDBK_THRESHOLD /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision */ +#define FIX_1500_ISM_MD_DTX /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 4fe9e5767b9ba6c42614441ddb415d9d7ae7e1ef..063f089d097ae2e4ae1ff200122567b7e0c2687b 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -54,8 +54,8 @@ static Word16 decode_radius_fx( DEC_CORE_HANDLE st0, Word16 *last_radius_idx, Wo #define IVAS_ISM_DTX_HO_MAX 5 -#define CNG_MD_MAX_DIFF_AZIMUTH 5 -#define CNG_MD_MAX_DIFF_ELEVATION 5 +#define CNG_MD_MAX_DIFF_AZIMUTH_FX ( 5 << Q22 ) +#define CNG_MD_MAX_DIFF_ELEVATION_FX ( 5 << Q22 ) #define MAX_BITS_ISM_METADATA ( 2 * ISM_EXTENDED_METADATA_BITS + MAX_NUM_OBJECTS * ( 1 /*number of objects*/ + ISM_METADATA_MD_FLAG_BITS + 2 * ISM_METADATA_FLAG_BITS + ISM_METADATA_IS_NDP_BITS + 1 /*abs.flag*/ + ISM_AZIMUTH_NBITS + ISM_ELEVATION_NBITS + 1 /*abs.flag*/ + ISM_RADIUS_NBITS + 1 /*abs.flag*/ + ISM_AZIMUTH_NBITS + ISM_ELEVATION_NBITS ) + 10 /* margin */ ) /* max. bit-budget of ISM metadata */ @@ -95,20 +95,20 @@ static void ism_metadata_smooth_fx( } test(); - IF( GT_32( ism_total_brate, IVAS_SID_5k2 ) && GT_32( L_abs( diff_fx ), L_shl( IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_AZIMUTH, Q22 ) ) ) + IF( GT_32( ism_total_brate, IVAS_SID_5k2 ) && GT_32( L_abs( diff_fx ), IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_AZIMUTH_FX ) ) { /* skip the smoothing */ } - ELSE IF( GT_32( L_abs( diff_fx ), L_shl( CNG_MD_MAX_DIFF_AZIMUTH, Q22 ) ) ) + ELSE IF( GT_32( L_abs( diff_fx ), CNG_MD_MAX_DIFF_AZIMUTH_FX ) ) { Word32 temp; IF( ( diff_fx > 0 ) ) { - temp = L_shl( CNG_MD_MAX_DIFF_AZIMUTH, Q22 ); + temp = CNG_MD_MAX_DIFF_AZIMUTH_FX; } ELSE { - temp = L_negate( L_shl( CNG_MD_MAX_DIFF_AZIMUTH, Q22 ) ); + temp = L_negate( CNG_MD_MAX_DIFF_AZIMUTH_FX ); } hIsmMetaData->azimuth_fx = L_add( hIsmMetaData->last_azimuth_fx, temp ); move32(); @@ -129,20 +129,24 @@ static void ism_metadata_smooth_fx( diff_fx = L_sub( hIsmMetaData->last_true_elevation_fx, hIsmMetaData->last_elevation_fx ); test(); - IF( GT_32( ism_total_brate, IVAS_SID_5k2 ) && GT_32( diff_fx, L_shl( IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION, Q22 ) ) ) +#ifdef FIX_1500_ISM_MD_DTX + IF( GT_32( ism_total_brate, IVAS_SID_5k2 ) && GT_32( L_abs( diff_fx ), IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION_FX ) ) +#else + IF( GT_32( ism_total_brate, IVAS_SID_5k2 ) && GT_32( diff_fx, IVAS_ISM_DTX_HO_MAX * CNG_MD_MAX_DIFF_ELEVATION_FX ) ) +#endif { /* skip the smoothing */ } - ELSE IF( GT_32( L_abs( diff_fx ), L_shl( CNG_MD_MAX_DIFF_ELEVATION, Q22 ) ) ) + ELSE IF( GT_32( L_abs( diff_fx ), CNG_MD_MAX_DIFF_ELEVATION_FX ) ) { Word32 temp; IF( ( diff_fx > 0 ) ) { - temp = L_shl( CNG_MD_MAX_DIFF_ELEVATION, Q22 ); + temp = CNG_MD_MAX_DIFF_ELEVATION_FX; } ELSE { - temp = L_negate( L_shl( CNG_MD_MAX_DIFF_ELEVATION, Q22 ) ); + temp = L_negate( CNG_MD_MAX_DIFF_ELEVATION_FX ); } hIsmMetaData->elevation_fx = L_add( hIsmMetaData->last_elevation_fx, temp ); move32();