Commit b0af6bd7 authored by emerit's avatar emerit
Browse files

building mac

parent 7db9ee9d
Loading
Loading
Loading
Loading
+143 −0
Original line number Diff line number Diff line
@@ -2701,6 +2701,149 @@ ivas_error IVAS_DEC_GetHrtfStatisticsHandle(
    return IVAS_ERR_OK;
}

#ifdef FIX_CREND_SIMPLIFY_CODE
/*---------------------------------------------------------------------*
 * IVAS_DEC_HRTF_binary_open( )
 *
 * Allocate HRTF binary handles
 *---------------------------------------------------------------------*/

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   */
)
{
    ivas_error error;
    Decoder_Struct *st_ivas;

    st_ivas = hIvasDec->st_ivas;

    test();
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    IF( st_ivas->hDecoderConfig->Opt_HRTF_binary )
    {
        /* TD binaural renderer */
        test();
        test();
        IF( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfTD == NULL )
        {
            IF( ( error = ivas_HRTF_binary_open_fx( &( st_ivas->hHrtfTD ) ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }

        /* Crend binaural renderer */
        test();
        test();
        IF( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfCrend == NULL )
        {
            IF( ( error = ivas_HRTF_CRend_binary_open_fx( &( st_ivas->hHrtfCrend ) ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }

        /* FastConv binaural renderer */
        test();
        test();
        IF( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfFastConv == NULL )
        {
            IF( ( error = ivas_HRTF_fastconv_binary_open_fx( &st_ivas->hHrtfFastConv ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }

        /* Parametric binaural renderer */
        test();
        test();
        IF( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_PARAMBIN || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfParambin == NULL )
        {
            IF( ( error = ivas_HRTF_parambin_binary_open_fx( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }

        test();
        test();
        test();
        IF( st_ivas->hHrtfStatistics == NULL && ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            IF( ( error = ivas_HRTF_statistics_binary_open( &st_ivas->hHrtfStatistics ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }

    return IVAS_ERR_OK;
}

/*---------------------------------------------------------------------*
 * IVAS_DEC_HRTF_binary_close( )
 *
 * Deallocate HRTF binary handles
 *---------------------------------------------------------------------*/

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  */
)
{
    Decoder_Struct *st_ivas;

    test();
    IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    st_ivas = hIvasDec->st_ivas;

    test();
    IF( st_ivas->hDecoderConfig->Opt_HRTF_binary && st_ivas->ini_frame > 0 )
    {
        test();
        IF( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_TDREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) )
        {
            ivas_HRTF_binary_close_fx( &st_ivas->hHrtfTD );
        }

        test();
        IF( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) )
        {
            /* CRend binaural renderer handle */
            ivas_HRTF_CRend_binary_close_fx( &st_ivas->hHrtfCrend );
        }

        test();
        IF( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) )
        {
            /* Fastconv HRTF memories */
            ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv );

            /* Fastconv HRTF filters */
            ivas_HRTF_fastconv_binary_close_fx( &st_ivas->hHrtfFastConv );
        }

        test();
        IF( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_PARAMBIN || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) )
        {

            /* Parametric binauralizer HRTF filters */
            ivas_HRTF_parambin_binary_close_fx( &st_ivas->hHrtfParambin );
        }
    }

    return IVAS_ERR_OK;
}
#endif

/*---------------------------------------------------------------------*
 * copyRendererConfigStruct( )
+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ static ivas_error ivas_rend_initCrend_fx(
                {
                    /* in case of HRTF handle reuse, swap the pointers for correct deallocation at the exit */
#define WMC_TOOL_SKIP
                    swap( hHrtf->pIndex_frequency_max[i][j], hHrtf->pIndex_frequency_max[tmp][j], const UWord16 * );
                    swap( hHrtf->pIndex_frequency_max[i][j], hHrtf->pIndex_frequency_max[tmp][j], const Word16 * );
                    MOVE( 3 );
                    swap( hHrtf->pOut_to_bin_re_fx[i][j], hHrtf->pOut_to_bin_re_fx[tmp][j], const Word16 * );
                    MOVE( 3 );
+24 −6
Original line number Diff line number Diff line
@@ -473,9 +473,15 @@ ivas_error ivas_HRTF_statistics_init(
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
            }
#ifdef FIX_CREND_SIMPLIFY_CODE
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_left_avg_power_48kHz_fx, HrtfStatistics->average_energy_l_dyn, LR_IAC_LENGTH_NR_FC, Q28 - defaultHRIR_Q_48kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_right_avg_power_48kHz_fx, HrtfStatistics->average_energy_r_dyn, LR_IAC_LENGTH_NR_FC, Q28 - defaultHRIR_Q_48kHz_fx ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_coherence_48kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, LR_IAC_LENGTH_NR_FC, Q26 - defaultHRIR_Q_48kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#else
            floatToFixed_arr32( defaultHRIR_left_avg_power_48kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC );        /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_right_avg_power_48kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC );       /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_coherence_48kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC );        /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#endif
            HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn;
            HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn;
            HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn;
@@ -496,9 +502,15 @@ ivas_error ivas_HRTF_statistics_init(
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
            }
#ifdef FIX_CREND_SIMPLIFY_CODE
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_left_avg_power_32kHz_fx, HrtfStatistics->average_energy_l_dyn, LR_IAC_LENGTH_NR_FC, Q28 - defaultHRIR_Q_32kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_right_avg_power_32kHz_fx, HrtfStatistics->average_energy_r_dyn, LR_IAC_LENGTH_NR_FC, Q28 - defaultHRIR_Q_32kHz_fx ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_coherence_32kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, LR_IAC_LENGTH_NR_FC, Q26 - defaultHRIR_Q_32kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#else
            floatToFixed_arr32( defaultHRIR_left_avg_power_32kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC );        /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_right_avg_power_32kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC );       /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_coherence_32kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC );        /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#endif
            HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn;
            HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn;
            HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn;
@@ -519,9 +531,15 @@ ivas_error ivas_HRTF_statistics_init(
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" );
            }
#ifdef FIX_CREND_SIMPLIFY_CODE
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, LR_IAC_LENGTH_NR_FC_16KHZ, Q28 - defaultHRIR_Q_16kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, LR_IAC_LENGTH_NR_FC_16KHZ, Q28 - defaultHRIR_Q_16kHz_fx ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            Copy_Scale_sig_16_32_no_sat( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, LR_IAC_LENGTH_NR_FC_16KHZ, Q26 - defaultHRIR_Q_16kHz_fx );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#else
            floatToFixed_arr32( defaultHRIR_left_avg_power_16kHz_fx, HrtfStatistics->average_energy_l_dyn, Q28, LR_IAC_LENGTH_NR_FC_16KHZ );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_right_avg_power_16kHz_fx, HrtfStatistics->average_energy_r_dyn, Q28, LR_IAC_LENGTH_NR_FC_16KHZ ); /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
            floatToFixed_arr32( defaultHRIR_coherence_16kHz_fx, HrtfStatistics->inter_aural_coherence_dyn, Q26, LR_IAC_LENGTH_NR_FC_16KHZ );  /* tables from which lr_energy_and_iac is updated has Q27 for i=2 */
#endif
            HrtfStatistics->average_energy_l = (const Word32 *) HrtfStatistics->average_energy_l_dyn;
            HrtfStatistics->average_energy_r = (const Word32 *) HrtfStatistics->average_energy_r_dyn;
            HrtfStatistics->inter_aural_coherence = (const Word32 *) HrtfStatistics->inter_aural_coherence_dyn;
+38 −0
Original line number Diff line number Diff line
@@ -10173,6 +10173,44 @@ const Word32 defaultHRIR_rom_ITD_elevBsShape_fx[28]/*Q30*/ = {
const Word32 defaultHRIR_rom_ITD_elevKSeq_fx[16] /*Q22*/ = {
-377487360, -327155712, -276824064, -226492416, -176160768, -125829120, -75497472, -25165824, 25165824, 75497472, 125829120, 176160768, 226492416, 276824064, 327155712, 377487360
};
#ifdef FIX_989_TD_REND_ROM
const int16_t defaultHRIR_rom_ITD_model_configuration[4] = {
18, /* elevDim3 */
41, /* azimDim3 */
3, /* elevSegSamples */
10, /* azimSegSamples */
};
const int16_t defaultHRIR_rom_ITD_elevBsLen[4] = {
4, 7, 10, 7,
};
const int16_t defaultHRIR_rom_ITD_elevBsStart[4] = {
0, 4, 11, 21,
};
const int16_t defaultHRIR_rom_ITD_azimBsLen[4] = {
11, 21, 31, 21,
};
const int16_t defaultHRIR_rom_ITD_azimBsStart[4] = {
0, 11, 32, 63,
};
#endif
const uint32_t defaultHRIR_rom_ITD_azimBsShape[84] = {
0x3f800000,0x3f3a9fbe,0x3f03126f,0x3eaf9db2,0x3e5d2f1b,0x3e000000,0x3d83126f,0x3cdd2f1b,0x3c03126f,0x3a83126f,0xa5800000,0x00000000,0x3e8374bc,0x3ede353f,0x3f0ad0e5,0x3f178d50,0x3f180000,0x3f0ed917,0x3efd9168,0x3ed4fdf4,0x3ea95810,0x3e800000,0x3e3a9fbe,0x3e03126f,0x3daf9db2,
0x3d5d2f1b,0x3d000000,0x3c83126f,0x3bdd2f1b,0x3b03126f,0x3983126f,0xa6000000,0x00000000,0x3c66bdc8,0x3d57b901,0x3de1cac1,0x3e39af72,0x3e855555,0x3eaf1aa0,0x3ed756b3,0x3efb38a9,0x3f0bf7cf,0x3f155555,0x3f18aec3,0x3f16872b,0x3f0fc3ed,0x3f054a69,0x3ef00000,0x3ed19423,0x3eb11bfd,
0x3e90624e,0x3e6263ab,0x3e2aaaab,0x3df8d4fe,0x3daec33e,0x3d6a2798,0x3d1374bc,0x3caaaaab,0x3c2ec33e,0x3b9374bc,0x3aaec33e,0x392ec33e,0xa6800000,0x00000000,0x392ec33e,0x3aaec33e,0x3b9374bc,0x3c2ec33e,0x3caaaaab,0x3d1374bc,0x3d6a2798,0x3daec33e,0x3df8d4fe,0x3e2aaaab,0x3e627984,
0x3e90b9af,0x3eb242e7,0x3ed44f30,0x3ef55555,0x3f09e60f,0x3f17152a,0x3f21735f,0x3f283c13,0x3f2aaaab,
};
const float defaultHRIR_rom_ITD_azimKSeq[19] = {
  0.000000f,  10.000000f,  20.000000f,  30.000000f,  40.000000f,  50.000000f,  60.000000f,  70.000000f,  80.000000f,  90.000000f, 100.000000f, 110.000000f, 120.000000f, 130.000000f, 140.000000f, 150.000000f, 160.000000f, 170.000000f, 180.000000f, 
};
const uint32_t defaultHRIR_rom_ITD_elevBsShape[28] = {
0x3f800000,0x3e97b426,0x3d17b426,0x00000000,0x00000000,0x3f1097b4,0x3f04bda1,0x3e800000,0x3d97b426,0x3c17b426,0x00000000,0x00000000,0x3e07e6b7,0x3eca4588,0x3f155555,0x3f0ca458,0x3ebc0ca4,0x3e2aaaab,0x3d4a4588,0x3bca4588,0x00000000,0x00000000,0x3bca4588,0x3d4a4588,0x3e2aaaab,
0x3ebda12f,0x3f12f685,0x3f2aaaab,
};
const float defaultHRIR_rom_ITD_elevKSeq[16] = {
-90.000000f, -78.000000f, -66.000000f, -54.000000f, -42.000000f, -30.000000f, -18.000000f,  -6.000000f,   6.000000f,  18.000000f,  30.000000f,  42.000000f,  54.000000f,  66.000000f,  78.000000f,  90.000000f, 
};
#undef WMC_TOOL_SKIP
/* clang-format on */
+10 −257

File changed.

Preview size limit exceeded, changes collapsed.

Loading