Commit 3510aa1b authored by emerit's avatar emerit
Browse files

on going

parent 2342ece0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ cleanup:
        dealloc_HRTF_binary( hHrtfTD );
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
        IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
        destroy_SetOfHRTF( hSetOfHRTF );
        destroy_SetOfHRTF( &hSetOfHRTF );
#endif
    }

+25 −12
Original line number Diff line number Diff line
@@ -486,8 +486,13 @@ static ivas_error ivas_binRenderer_convModuleOpen(
        for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ )
        {
            /* set the memories to zero */
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            set16_zero_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
            set16_zero_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
#else
            set_zero_fx( hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
            set_zero_fx( hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx], hBinRenConvModule->numTapsArray[bandIdx] );
#endif
        }
    }

@@ -669,63 +674,63 @@ static ivas_error ivas_binaural_hrtf_open_fx(
        test();
        IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( renderer_type, RENDERER_BINAURAL_FASTCONV ) )
        {
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HRIR_latency_s_fx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->ntaps = BINAURAL_NTAPS;
            move16();
            move16();
#else
            HrtfFastConv->FASTCONV_HRIR_latency_s_fx = FASTCONV_HRIR_latency_s_fx;
            move32();
            move16();
#endif
        }
        if ( EQ_32( input_config, IVAS_AUDIO_CONFIG_HOA2 ) )
        {
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HOA2_latency_s_fx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA;
            move16();
            move16();
#else
            HrtfFastConv->FASTCONV_HOA2_latency_s_fx = FASTCONV_HOA2_latency_s_fx;
            move32();
            move16();
#endif
        }
        if ( EQ_32( input_config, IVAS_AUDIO_CONFIG_HOA3 ) )
        {
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_HOA3_latency_s_fx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA;
            move16();
            move16();
#else
            HrtfFastConv->FASTCONV_HOA3_latency_s_fx = FASTCONV_HOA3_latency_s_fx;
            move32();
            move16();
#endif
        }
        if ( EQ_32( input_config, IVAS_AUDIO_CONFIG_FOA ) )
        {
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_FOA_latency_s_fx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA;
            move16();
            move16();
#else
            HrtfFastConv->FASTCONV_FOA_latency_s_fx = FASTCONV_FOA_latency_s_fx;
            move32();
            move16();
#endif
        }
        test();
        IF( EQ_32( input_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) )
        {
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->FASTCONV_latency_s_fx = FASTCONV_BRIR_latency_s_fx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
            HrtfFastConv->ntaps = BINAURAL_NTAPS_MAX;
            move16();
            move16();
#else
            HrtfFastConv->FASTCONV_BRIR_latency_s_fx = FASTCONV_BRIR_latency_s_fx;
            move32();
            move16();
#endif
        }

@@ -818,8 +823,8 @@ static ivas_error ivas_binaural_hrtf_open_fx(
            }
        }
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
        mvs2s( fastconvReverberationTimes, HrtfFastConv->fastconvReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX );
        mvs2s( fastconvReverberationEneCorrections, HrtfFastConv->fastconvReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX );
        mvs2s( fastconvReverberationTimes_fx, HrtfFastConv->fastconvReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX );
        mvs2s( fastconvReverberationEneCorrections_fx, HrtfFastConv->fastconvReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX );
#else
        Copy32( fastconvReverberationTimes_fx, HrtfFastConv->fastconvReverberationTimes_fx, CLDFB_NO_CHANNELS_MAX );
        Copy32( fastconvReverberationEneCorrections_fx, HrtfFastConv->fastconvReverberationEneCorrections_fx, CLDFB_NO_CHANNELS_MAX );
@@ -1083,7 +1088,11 @@ ivas_error ivas_binRenderer_open_fx(
        }

        hBinRenderer->hoa_dec_mtx = st_ivas->hoa_dec_mtx;
#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
        st_ivas->binaural_latency_ns = L_shr_r( Mult_32_32( st_ivas->hHrtfFastConv->FASTCONV_latency_s_fx, 1000000000 ), st_ivas->hHrtfFastConv->factor_Q_latency_s_fx );
#else
        st_ivas->binaural_latency_ns = L_shr_r( Mult_32_32( st_ivas->hHrtfFastConv->FASTCONV_latency_s_fx, 1000000000 ), 31 );
#endif
        move32();
    }
    ELSE
@@ -1094,7 +1103,11 @@ ivas_error ivas_binRenderer_open_fx(
            return error;
        }

#ifdef FIX_1123_FASTCONV_PARAMBIN_16BIT_ROM
        st_ivas->binaural_latency_ns = L_shr_r( Mult_32_32( st_ivas->hHrtfFastConv->FASTCONV_latency_s_fx, 1000000000 ), st_ivas->hHrtfFastConv->factor_Q_latency_s_fx );
#else
        st_ivas->binaural_latency_ns = L_shr_r( Mult_32_32( st_ivas->hHrtfFastConv->FASTCONV_latency_s_fx, 1000000000 ), 31 );
#endif
    }

    /* Allocate memories needed for reverb module */
+5 −3
Original line number Diff line number Diff line
@@ -317,7 +317,11 @@ ivas_error IVAS_DEC_FeedCustomLsData(
);

/*! r: error code */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
ivas_error IVAS_DEC_GetHrtfTDrendHandle(
#else
ivas_error IVAS_DEC_GetHrtfHandle(
#endif
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    IVAS_DEC_HRTF_HANDLE **hHrtfTD              /* o  : HRTF handle                                                             */
@@ -361,7 +365,6 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
);
#endif

#ifdef FIX_POINT_HRTF_FILE_FORMAT
ivas_error IVAS_DEC_HRTF_binary_open(
    IVAS_DEC_HANDLE hIvasDec,                           /* i/o: IVAS decoder handle                                             */
    const IVAS_BIN_RENDERER_TYPE binaural_renderer      /* i  : binaural renderer type                                          */
@@ -371,7 +374,6 @@ ivas_error IVAS_DEC_HRTF_binary_close(
    IVAS_DEC_HANDLE hIvasDec,                           /* i/o: IVAS decoder handle                                             */
    const IVAS_BIN_RENDERER_TYPE binaural_renderer_old  /* i  : previous binaural renderer type                                 */
);
#endif

/*! r: error code*/
ivas_error IVAS_DEC_GetRenderConfig(
+7 −3
Original line number Diff line number Diff line
@@ -2261,7 +2261,11 @@ ivas_error IVAS_DEC_FeedCustomLsData(
 *
 *---------------------------------------------------------------------*/

#ifdef FIX_POINT_HRTF_FILE_FORMAT
ivas_error IVAS_DEC_GetHrtfTDrendHandle(
#else
ivas_error IVAS_DEC_GetHrtfHandle(
#endif
    IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle      */
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    IVAS_DEC_HRTF_HANDLE **hHrtfTD /* o  : HRTF handle              */
@@ -2298,7 +2302,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle(
#ifdef FIX_POINT_HRTF_FILE_FORMAT
    IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o  : Crend HRTF handle        */
#else
    IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o  : Set of HRTF handle       */
    IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* o  : Set of HRTF handle       */
#endif
)
{
@@ -2315,7 +2319,7 @@ ivas_error IVAS_DEC_GetHrtfCRendHandle(
        return IVAS_ERR_WRONG_PARAMS;
    }

    *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF;
    *hHrtfCrend = hIvasDec->st_ivas->hSetOfHRTF;
#endif

    return IVAS_ERR_OK;
@@ -2528,7 +2532,7 @@ ivas_error IVAS_DEC_HRTF_binary_close(
#ifdef FIX_POINT_HRTF_FILE_FORMAT
            ivas_HRTF_CRend_binary_close_fx( &st_ivas->hHrtfCrend );
#else
            ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF );
            ivas_HRTF_CRend_binary_close_fx( &st_ivas->hSetOfHRTF );
#endif
        }

+0 −6
Original line number Diff line number Diff line
@@ -50,12 +50,6 @@
#include "debug.h"
#endif

#ifndef FIX_POINT_HRTF_FILE_FORMAT
#include "control.h"
#define float_to_fix( n, factor ) ( round( n * ( 1 << factor ) ) )
#define fix_to_float( n, factor ) ( (float) n / ( 1 << factor ) )
#endif

/*-------------------------------------------------------------------------
 * ivas_hrtf_init()
 *
Loading