Commit 311dd59f authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch 'float-1500-wrong-and-unstable-spatial-image-at-the-beginning-of-active-speech-for-ism1-with-dtx' into 'main'

[non-BE] [allow-regression] Resolve "Wrong and unstable spatial image at the beginning of active speech for ISM1 with DTX"

See merge request !2741
parents a807096e 2e264743
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ########################### */

+14 −10
Original line number Diff line number Diff line
@@ -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();