Commit 5f300f7a authored by multrus's avatar multrus
Browse files

[cleanup] accept TUNE_360_OBJECT_WITH_NOISE

parent 94bbfb7d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -143,7 +143,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
/*#define SBA_HPF_TUNING_DEC*/

#define TUNE_360_OBJECT_WITH_NOISE                      /* VA: issue 360: consider objects being speech+noise for active speech coding */
#define FIX_350_MASA_DELAY_COMP                         /* Nokia: Issue 350: MASA audio/meta delay compensation */
#define FIX_372_LIB_REND_VALIDATE_IO                    /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */
#define FIX_376_SBA_ROTATE                              /*DLB: Fix for issue 376*/
+0 −63
Original line number Diff line number Diff line
@@ -196,11 +196,7 @@ ivas_error ivas_ism_metadata_enc(
)
{
#ifdef TD5
#ifdef TUNE_360_OBJECT_WITH_NOISE
    int16_t i, ch, nb_bits_start = 0;
#else
    int16_t i, ch, nb_bits_start = 0, diff;
#endif
    int16_t idx_azimuth_abs = 0, flag_abs_azimuth[MAX_NUM_OBJECTS];
    int16_t idx_elevation_abs = 0, flag_abs_elevation[MAX_NUM_OBJECTS];
    int16_t flag_abs_azimuth_orientation[MAX_NUM_OBJECTS];
@@ -274,7 +270,6 @@ ivas_error ivas_ism_metadata_enc(
        else if ( ism_mode == ISM_MODE_DISC )
        {
#ifdef TD5
#ifdef TUNE_360_OBJECT_WITH_NOISE
#ifdef DISCRETE_ISM_DTX_CNG
            hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10;
#else
@@ -285,44 +280,7 @@ ivas_error ivas_ism_metadata_enc(
            }
#endif
#else
            if ( hIsmMeta[ch]->ism_metadata_flag )
            {
                /* at highest bitrates (with TCX core only) metadata are sent also for inactive frames */
                if ( localVAD[ch] == 0 && !( hSCE[ch]->hCoreCoder[0]->tcxonly ) )
                {
                    /* send metadata even in inactive segments when noise is audible and metadata are changing */
                    diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) );
                    diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->angle[0].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) );
                    if ( ism_total_brate >= ISM_EXTENDED_METADATA_BRATE && ism_extended_metadata_flag )
                    {
                        diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->yaw - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) ) );
                        diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->pitch - ism_dequant_meta( hIsmMeta[ch]->angle[1].last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) );
                    }
                    if ( !( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 ) )
                    {
                        hIsmMeta[ch]->ism_metadata_flag = 0;
                    }
                }
            }
#endif
#else
#ifdef TUNE_360_OBJECT_WITH_NOISE
            hIsmMeta[ch]->ism_metadata_flag = localVAD[ch] || hSCE[ch]->hCoreCoder[0]->lp_noise > 10;
#else
            hIsmMeta[ch]->ism_metadata_flag = localVAD[ch];

            if ( hIsmMeta[ch]->ism_metadata_flag == 0 )
            {
                /* send metadata even in inactive segments when noise is audible and metadata are changing */
                diff = (int16_t) fabsf( hIsmMeta[ch]->azimuth - ism_dequant_meta( hIsmMeta[ch]->last_azimuth_idx, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ) );
                diff = max( diff, (int16_t) fabsf( hIsmMeta[ch]->elevation - ism_dequant_meta( hIsmMeta[ch]->last_elevation_idx, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ) ) );

                if ( hSCE[ch]->hCoreCoder[0]->lp_noise > 15 && diff >= 10 )
                {
                    hIsmMeta[ch]->ism_metadata_flag = 1;
                }
            }
#endif

            if ( hSCE[ch]->hCoreCoder[0]->tcxonly )
            {
@@ -339,27 +297,6 @@ ivas_error ivas_ism_metadata_enc(

    rate_ism_importance( nchan_transport, hIsmMeta, hSCE, ism_imp );

#ifndef TUNE_360_OBJECT_WITH_NOISE
    /* relax the importance decision in "stereo" coding for noisy audio */
    if ( ism_mode == ISM_MODE_DISC && nchan_ism == 2 )
    {
        float diff_F;

        if ( hIsmMeta[0]->ism_metadata_flag ^ hIsmMeta[1]->ism_metadata_flag )
        {
            for ( ch = 0; ch < nchan_ism; ch++ )
            {
                diff_F = hSCE[ch]->hCoreCoder[0]->lp_speech - hSCE[ch]->hCoreCoder[0]->lp_noise;

                if ( hIsmMeta[ch]->ism_metadata_flag == 0 && diff_F < 25.0f )
                {
                    hIsmMeta[ch]->ism_metadata_flag = 1;
                    ism_imp[ch] = ISM_LOW_IMP;
                }
            }
        }
    }
#endif

    /*----------------------------------------------------------------*
     * Write ISM common signaling