Commit 7dae8ded authored by emerit's avatar emerit
Browse files

improve code

parent 7648db9d
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@
#define FIX_OLD_BINARY_FORMAT                           /* Orange: temporary to maintain bitexactness */
#define FIX_910_REMOVE_DUPLICATION_TD_REND              /* VA: issue 910: remove duplication of function ivas_td_binaural_renderer() */
#define FIX_940_DEBUGGING_VARIABLE                      /* Nokia: issue #940: remove debugging variable */
#define FIX_WARNING_RENDER_CONFIG

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

+6 −6
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ static ivas_error ivas_rend_initCrend(

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    if ( ( hSetOfHRTF == NULL ) ||
         ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ||
         ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ||
         ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) ||
         ( ( hSetOfHRTF->hHRTF_brir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) ||
         ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) ||
@@ -743,7 +743,7 @@ static ivas_error ivas_rend_initCrend(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
                if ( hSetOfHRTF->hHRTF_brir_combined == NULL )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" );
                    return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " );
                }
#endif
                hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s;
@@ -755,7 +755,7 @@ static ivas_error ivas_rend_initCrend(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
                if ( hSetOfHRTF->hHRTF_hrir_combined == NULL )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" );
                    return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" );
                }
#endif
                hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s;
@@ -843,7 +843,7 @@ static ivas_error ivas_rend_initCrend(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
                if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" );
                    return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" );
                }
#endif
                hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s;
@@ -875,7 +875,7 @@ static ivas_error ivas_rend_initCrend(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
                if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" );
                    return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" );
                }
#endif
                hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s;
@@ -907,7 +907,7 @@ static ivas_error ivas_rend_initCrend(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
                if ( hSetOfHRTF->hHRTF_hrir_foa == NULL )
                {
                    return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Invalid command wrong output format" );
                    return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" );
                }
#endif
                hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s;
+0 −4
Original line number Diff line number Diff line
@@ -437,10 +437,6 @@ ivas_error ivas_dirac_dec_binaural_copy_hrtfs(
        mvr2r( parametricReverberationEneCorrections, hrtfParambin->parametricReverberationEneCorrections, CLDFB_NO_CHANNELS_MAX );
        mvr2r( parametricEarlyPartEneCorrection, hrtfParambin->parametricEarlyPartEneCorrection, CLDFB_NO_CHANNELS_MAX );

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
        hrtfParambin->allocatedFromFile = 0;
#endif

        *hHrtfParambin = hrtfParambin;
    }

+2 −23
Original line number Diff line number Diff line
@@ -47,11 +47,6 @@
ivas_error ivas_HRTF_binary_open(
    TDREND_HRFILT_FiltSet_t **hHrtfTD )
{
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    uint32_t ind;
    char *pTmp;
#endif

    /* Allocate HR filter set for headphones configuration */
    *hHrtfTD = (TDREND_HRFILT_FiltSet_t *) malloc( sizeof( TDREND_HRFILT_FiltSet_t ) );
    if ( *hHrtfTD == NULL )
@@ -60,12 +55,7 @@ ivas_error ivas_HRTF_binary_open(
    }

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    pTmp = (char *) *hHrtfTD;

    for ( ind = 0; ind < sizeof( TDREND_HRFILT_FiltSet_t ); ind++ )
    {
        pTmp[ind] = 0;
    }
    set_c( (char *) ( *hHrtfTD ), 0, (int32_t) sizeof( TDREND_HRFILT_FiltSet_t ) );
#endif

    return IVAS_ERR_OK;
@@ -191,11 +181,6 @@ void ivas_HRTF_fastconv_binary_close(
ivas_error ivas_HRTF_parambin_binary_open(
    HRTFS_PARAMBIN **hHrtfParambin )
{
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    uint32_t ind;
    char *pTmp;
#endif

    *hHrtfParambin = (HRTFS_PARAMBIN *) malloc( sizeof( HRTFS_PARAMBIN ) );
    if ( *hHrtfParambin == NULL )
    {
@@ -203,13 +188,7 @@ ivas_error ivas_HRTF_parambin_binary_open(
    }

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    pTmp = (char *) *hHrtfParambin;

    for ( ind = 0; ind < sizeof( HRTFS_PARAMBIN ); ind++ )
    {
        pTmp[ind] = 0;
    }
    ( *hHrtfParambin )->allocatedFromFile = 1;
    set_c( (char *) ( *hHrtfParambin ), 0, (int32_t) sizeof( HRTFS_PARAMBIN ) );
#endif

    return IVAS_ERR_OK;
+0 −4
Original line number Diff line number Diff line
@@ -1332,10 +1332,6 @@ typedef struct ivas_hrtfs_parambin_struct
    float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX];
    float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX];

#ifdef NONBE_FIX_BINARY_BINAURAL_READING
    int16_t allocatedFromFile;
#endif

} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE;


Loading