Commit aaa0a523 authored by emerit's avatar emerit
Browse files

Merge branch...

Merge branch 'basop_2201_hrtf_file_reader-crend-differs-between-basop-ivas-main-and-ivas-float-update_basop' into 'main'

basop_hrtf_file_reader-crend-differs-between-basop-ivas-main-and-ivas-float-update

See merge request !2626
parents 95636897 2e4c869e
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */

#define FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND /* OR : Fix issue basop 2201 hrtf_file_reader crend differs between basop ivas-main and ivas-float-update */

/* #################### End BE switches ################################## */

@@ -97,7 +97,6 @@
#define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH         /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */
#define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */


/* ##################### End NON-BE switches ########################### */

/* ################## End MAINTENANCE switches ######################### */
+9 −1
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ ivas_error ivas_Crend_hrtf_init_fx(
            hHrtf->pIndex_frequency_max[i][j] = NULL;
            hHrtf->pOut_to_bin_re_fx[i][j] = NULL;
            hHrtf->pOut_to_bin_im_fx[i][j] = NULL;
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
            hHrtf->pOut_to_bin_re_dyn_fx[i][j] = NULL;
            hHrtf->pOut_to_bin_im_dyn_fx[i][j] = NULL;
            hHrtf->pIndex_frequency_max_dyn_fx[i][j] = NULL;
#endif
        }
    }

@@ -102,9 +107,12 @@ ivas_error ivas_Crend_hrtf_init_fx(
        hHrtf->num_iterations_diffuse[j] = 0;
        move16();
        hHrtf->pIndex_frequency_max_diffuse[j] = NULL;

        hHrtf->pOut_to_bin_diffuse_re_fx[j] = NULL;
        hHrtf->pOut_to_bin_diffuse_im_fx[j] = NULL;
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
        hHrtf->pOut_to_bin_diffuse_re_dyn_fx[j] = NULL;
        hHrtf->pOut_to_bin_diffuse_im_dyn_fx[j] = NULL;
#endif
    }

    hHrtf->init_from_rom = 1;
+61 −1
Original line number Diff line number Diff line
@@ -179,8 +179,13 @@ static ivas_error read_and_check_hrtf_binary_file_header(
static ivas_error check_hrtf_binary_header(
    ivas_hrtfs_header_t *hrtf_header )
{
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
    if ( hrtf_header == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }
#endif
    /* Check the renderer type */

    if ( ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) &&
         ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) &&
         ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC ) &&
@@ -787,7 +792,11 @@ static ivas_error load_reverb_from_binary(
            if ( hrtf_header.frequency != sampleRate )
            {
                free( hrtf_data );
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
#else
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" );
#endif
            }
        }
    }
@@ -954,7 +963,11 @@ static ivas_error TDREND_MIX_LoadHRTF(
            if ( hrtf_header.frequency != sampleRate )
            {
                free( hrtf_data );
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
#else
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" );
#endif
            }
        }
    }
@@ -1723,7 +1736,11 @@ ivas_error load_fastconv_HRTF_from_binary(
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
#else
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" );
#endif
            }

            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
@@ -1823,7 +1840,11 @@ ivas_error load_parambin_HRTF_from_binary(
            if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */
            {
                free( hrtf_data );
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
#else
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" );
#endif
            }

            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
@@ -1943,7 +1964,11 @@ ivas_error load_Crend_HRTF_from_binary(
            if ( hrtf_header.frequency != sampleRate )
            {
                free( hrtf_data );
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
                return IVAS_ERR_INVALID_HRTF_SAMPLING_RATE;
#else
                return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF invalid sampling rate" );
#endif
            }

            if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size )
@@ -2035,6 +2060,7 @@ void destroy_crend_hrtf(
}


#ifndef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
/*---------------------------------------------------------------------*
 * destroy_hrtf_statistics()
 *
@@ -2065,6 +2091,7 @@ void destroy_hrtf_statistics(

    return;
}
#endif

/*---------------------------------------------------------------------*
 * destroy_fastconv_hrtf()
@@ -2100,3 +2127,36 @@ void destroy_parambin_hrtf(

    return;
}

#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
/*---------------------------------------------------------------------*
 * destroy_hrtf_statistics()
 *
 * Destroy the HRTF statistics set.
 *---------------------------------------------------------------------*/

void destroy_hrtf_statistics(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
)
{
    if ( ( hHrtfStatistics != NULL ) && ( *hHrtfStatistics != NULL ) && ( ( *hHrtfStatistics )->fromROM == FALSE ) )
    {
        if ( ( *hHrtfStatistics )->average_energy_l_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->average_energy_l_dyn );
        }
        if ( ( *hHrtfStatistics )->average_energy_r_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->average_energy_r_dyn );
        }
        if ( ( *hHrtfStatistics )->inter_aural_coherence_dyn != NULL )
        {
            free( ( *hHrtfStatistics )->inter_aural_coherence_dyn );
        }
    }

    ivas_HRTF_statistics_close_fx( hHrtfStatistics );

    return;
}
#endif
+27 −7
Original line number Diff line number Diff line
@@ -118,13 +118,17 @@ ivas_error load_reverb_binary(
);

/*---------------------------------------------------------------------*
 * create_SetOfHRTF_from_binary()
 * load_Crend_HRTF_from_binary()
 *
 * Create the HRTF data set from the binary file
 * Create the Crend HRTF data set from the binary file
 *---------------------------------------------------------------------*/

ivas_error load_Crend_HRTF_from_binary(
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
    IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle                   */
#else
    IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: Set of HRTF CRend handle            */
#endif
    const hrtfFileReader *hrtfReader,           /* i  : pointer to hrtfFileReader handle    */
    const IVAS_AUDIO_CONFIG OutputConfig,       /* i  : output audio configuration          */
    const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i  : HRTF set audio config.              */
@@ -134,11 +138,15 @@ ivas_error load_Crend_HRTF_from_binary(
/*---------------------------------------------------------------------*
 * destroy_crend_hrtf()
 *
 * Destroy the HRTF data set.
 * Destroy the Crend HRTF data set
 *---------------------------------------------------------------------*/

void destroy_crend_hrtf(
#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
    IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* i/o: Crend HRTF handle                 */
#else
    IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle              */
#endif
);

/*---------------------------------------------------------------------*
@@ -174,7 +182,7 @@ ivas_error load_parambin_HRTF_from_binary(
    IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin, /* i/o: Parambin HRTF handle             */
    const hrtfFileReader *hrtfReader             /* i  : pointer to hrtfFileReader handle */
);

#ifndef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
/*---------------------------------------------------------------------*
 * destroy_hrtf_statistics()
 *
@@ -184,7 +192,7 @@ ivas_error load_parambin_HRTF_from_binary(
void destroy_hrtf_statistics(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
);

#endif
/*---------------------------------------------------------------------*
 * destroy_parambin_hrtf()
 *
@@ -205,4 +213,16 @@ void destroy_td_hrtf(
    IVAS_DEC_HRTF_TD_HANDLE *hHRTF /* i/o: TD rend. HRTF handle */
);

#ifdef FIX_BASOP_2201_HARMONIZE_HRTF_FILE_READER_CREND
/*---------------------------------------------------------------------*
 * destroy_hrtf_statistics()
 *
 * free memory allocated for HRTF statistics binary data
 *---------------------------------------------------------------------*/

void destroy_hrtf_statistics(
    IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics /* i/o: HRTF statistics handle  */
);
#endif

#endif /* IVAS_HRTF_FILE_READER_H */