Commit 120067b1 authored by vaclav's avatar vaclav
Browse files

adopt logic simplification; under FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY

parent 84f8f5d5
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -188,7 +188,11 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs );
#else
static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs );
#endif
#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
@@ -2389,7 +2393,11 @@ static ivas_error decodeG192(
                /* Load HRTF binary file data */
                if ( arg.hrtfReaderEnabled )
                {
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -3300,7 +3308,11 @@ static ivas_error decodeVoIP(
                /* Load HRTF binary file data */
                if ( arg.hrtfReaderEnabled )
                {
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -3700,6 +3712,9 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec(
static ivas_error IVAS_DEC_LoadHrtfFromFile(
    IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary,
    IVAS_DEC_HANDLE hIvasDec,
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
    const IVAS_AUDIO_CONFIG OutputConfig,
#endif
    const int32_t output_Fs )
{
    ivas_error error;
@@ -3804,7 +3819,11 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile(
            }

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, OutputConfig, hHrtfBinary->fastConv_set_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->fastConv_set_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#endif
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->room_reverb_flag, hHrtfBinary->intern_audio_config, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#endif
+4 −0
Original line number Diff line number Diff line
@@ -946,7 +946,11 @@ int main(
            }

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, IVAS_AUDIO_CONFIG_EXTERNAL, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, IVAS_AUDIO_CONFIG_EXTERNAL, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
+2 −0
Original line number Diff line number Diff line
@@ -1499,6 +1499,7 @@ typedef enum

#define BINAURAL_COHERENCE_DIFFERENCE_BINS      9                           /* Number of bins for direction-dependent diffuse-field binaural coherence */

#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
typedef enum 
{
    BINAURAL_INPUT_AUDIO_CONFIG_INVALID,
@@ -1510,6 +1511,7 @@ typedef enum

} BINAURAL_INPUT_AUDIO_CONFIG;

#endif
#define HEADROT_ORDER                           3
#define HEADROT_SHMAT_DIM                       ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) )
#define HEADROT_SHMAT_DIM2                      ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM )
+5 −1
Original line number Diff line number Diff line
@@ -5136,9 +5136,13 @@ void ivas_init_binaural_hrtf(

ivas_error ivas_allocate_binaural_hrtf(
    HRTFS_FASTCONV *HrtfFastConv,                               /* i/o: FASTCONV HRTF structure                         */
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY
    const int16_t n_channels,                                   /* i : number of input channels                         */
#else
    const AUDIO_CONFIG input_config,                            /* i  : input audio configuration                       */
    const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config,         /* i  : binaural input audio config                     */
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                   */
#endif
    const int16_t allocate_init_flag                            /* i  : Memory allocation flag                          */
);

+1 −0
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@
#define FIX_1209_SID_SIGNALING                          /* VA: issue 1209: remove dead code in IVAS SID signaling */
#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM            /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */
#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_2          /* removal of multiplied code */
#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM_SIMPLIFY

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

Loading