Commit c5bf085f authored by PLAINSI's avatar PLAINSI
Browse files

Merge branch 'main' into dlb_mc_160kbps

parents 8c43b714 3f97bd3d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -164,6 +164,9 @@ typedef struct ivas_param_ism_data_structure

    int16_t flag_noisy_speech;
    int16_t noisy_speech_buffer[PARAM_ISM_HYS_BUF_SIZE];
#ifdef FIX_440_PARAM_ISM_DIR_NOISE
    int16_t flag_equal_energy;
#endif

} PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE;

+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@
#define FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING         /* Eri: Fix incorrect use of stack variable used for channel aware config file */
#define COMBINED_FORMAT_SIGNALING                       /* VA: Introduce a signaling bit for combined format coding */


#define FIX_440_PARAM_ISM_DIR_NOISE                     /* FhG: Issue 440: Fix directional background noise becoming diffuse in ParamISM */

#define MC_PARAMUPMIX_MODE                              /* Dlb: Contribution 39: Multichannel Parametric Upmix */

+70 −0
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ static void ivas_param_ism_compute_obj_parameters(
    int16_t i, b, m, br, mr;
    int16_t brange_start, brange_end, mrange_start, mrange_end, time_merge_fac;
    float power_ratios_m[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS];
#ifdef FIX_440_PARAM_ISM_DIR_NOISE
    float ref_power_local_frame[MAX_NUM_OBJECTS];
    float tmp_ratio;

    set_f( ref_power_local_frame, 0, MAX_NUM_OBJECTS );
#endif

    assert( nchan_ism == 3 || nchan_ism == 4 );

@@ -90,6 +96,10 @@ static void ivas_param_ism_compute_obj_parameters(
                        ref_power_local[i] += reference_power_obj[i][mr][br];
                    }
                }
#ifdef FIX_440_PARAM_ISM_DIR_NOISE
                /* Sum up T/F tiles per object */
                ref_power_local_frame[i] += ref_power_local[i];
#endif
            }

            /* find two dominant objects and derive object indices for current T/F tile */
@@ -145,6 +155,28 @@ static void ivas_param_ism_compute_obj_parameters(
        }
    }

#ifdef FIX_440_PARAM_ISM_DIR_NOISE
    /* Check if objects have roughly equal power by comparing reference power of first object against all others*/
    hParamIsm->flag_equal_energy = 1;
    for ( i = 1; i < nchan_ism; i++ )
    {
        if ( ref_power_local_frame[i] != 0.0f )
        {
            tmp_ratio = ref_power_local_frame[0] / ref_power_local_frame[i];

            if ( ( tmp_ratio > 0.975f ) && ( tmp_ratio < 1.025f ) )
            {
                hParamIsm->flag_equal_energy &= 1;
            }
            else
            {
                hParamIsm->flag_equal_energy &= 0;
                break;
            }
        }
    }
#endif

    return;
}

@@ -426,6 +458,7 @@ void ivas_param_ism_compute_noisy_speech_flag(
        st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i + 1];
    }

#ifndef FIX_440_PARAM_ISM_DIR_NOISE
    /* For the current frame, make a decision based on some core-coder flags */
    if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr )
    {
@@ -454,7 +487,44 @@ void ivas_param_ism_compute_noisy_speech_flag(
    {
        st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i];
    }
#else
    /* Set flag_noisy_speech to 0 for cases where object energies are not roughly equal */
    if ( !st_ivas->hDirAC->hParamIsm->flag_equal_energy )
    {
        st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0;
        st_ivas->hDirAC->hParamIsm->flag_noisy_speech = 0;
    }
    else
    {
        /* For the current frame, make a decision based on some core-coder flags */
        if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr )
        {
#ifdef FIX_422
            if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag )
#else
            if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag && st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag )
#endif
            {
                st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0;
            }
            else
            {
                st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 1;
            }
        }
        else
        {
            st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0;
        }

        /* Do a decision based on hysteresis */
        st_ivas->hDirAC->hParamIsm->flag_noisy_speech = 1;
        for ( i = 0; i < PARAM_ISM_HYS_BUF_SIZE; i++ )
        {
            st_ivas->hDirAC->hParamIsm->flag_noisy_speech = st_ivas->hDirAC->hParamIsm->flag_noisy_speech && st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i];
        }
    }
#endif

    return;
}
+2 −1
Original line number Diff line number Diff line
@@ -187,8 +187,9 @@ class IvasModeAnalyzer(IvasModeCollector):
        all_log_files = os.listdir(log_dir)
        for mode in self.flat_mode_list:
            for f in all_log_files:
                search_string = re.escape("_{}".format(mode))
                if (
                    re.search("_{}".format(mode), f)
                    re.search(search_string, f)
                    and os.path.splitext(f)[1] == LOG_FILE_EXT
                ):
                    # this is a log file belonging to the ivas_format