Commit decd9f65 authored by norvell's avatar norvell
Browse files

Add NONBE_1377_REND_DIRATT_CONF to address Issue 1377: Error in directivity...

Add NONBE_1377_REND_DIRATT_CONF to address Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend
parent 3fd189ab
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#define NONBE_FIX_1143_MASA_BRSW                        /* Nok: Fix for issue 1143: MSAN use of uninitialized value in masa decoding to binaural with dtx bitrate switching and 5 % FER */
#define NONBE_FIX_1220_OMASA_JBM_EXT_USAN               /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */
#define NONBE_FIX_1376_MDCT_CONCEALMENT                 /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */
#define NONBE_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */

/* #################### End BASOP porting switches ############################ */

+20 −1
Original line number Diff line number Diff line
@@ -518,13 +518,16 @@ ivas_error TDREND_Update_object_positions(
    const ISM_METADATA_HANDLE *hIsmMetaData            /* i  : Input metadata for ISM objects   */
)
{
#ifndef NONBE_1377_REND_DIRATT_CONF
    TDREND_DirAtten_t *DirAtten_p;
#endif
    int16_t nS;
    float Pos[3];
    float Dir[3];
    ivas_error error;

#ifndef NONBE_1377_REND_DIRATT_CONF
    DirAtten_p = hBinRendererTd->DirAtten_p;
#endif

    /* For each source, write the frame data to the source object*/
    for ( nS = 0; nS < num_src; nS++ )
@@ -541,10 +544,12 @@ ivas_error TDREND_Update_object_positions(
                return error;
            }

#ifndef NONBE_1377_REND_DIRATT_CONF
            if ( ( error = TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif

            if ( hIsmMetaData[nS]->non_diegetic_flag )
            {
@@ -654,13 +659,22 @@ ivas_error ivas_td_binaural_open_ext(
    AUDIO_CONFIG inConfig,
    RENDER_CONFIG_DATA *hRendCfg, /* i  : Renderer configuration */
    LSSETUP_CUSTOM_STRUCT *customLsInput,
#ifdef NONBE_1377_REND_DIRATT_CONF
    const int32_t outFs,       /* i: output sampling rate */
    const IVAS_REND_InputId id /* i: ISM ID */
)
#else
    const int32_t outFs )
#endif
{
    int16_t nchan_transport;
    AUDIO_CONFIG transport_config;
    IVAS_FORMAT ivas_format;
    IVAS_OUTPUT_SETUP hTransSetup;
    ivas_error error;
#ifdef NONBE_1377_REND_DIRATT_CONF
    int16_t ism_number;
#endif

    float *distAtt = NULL;
    float *directivity = NULL;
@@ -691,7 +705,12 @@ ivas_error ivas_td_binaural_open_ext(

    if ( NULL != hRendCfg )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        ism_number = id & 0x00FF; /* Exctract ISM number from ID */
        directivity = hRendCfg->directivity + 3 * ism_number;
#else
        directivity = hRendCfg->directivity;
#endif
        distAtt = hRendCfg->distAtt;
    }

+5 −0
Original line number Diff line number Diff line
@@ -641,7 +641,12 @@ ivas_error ivas_td_binaural_open_ext(
    const AUDIO_CONFIG inConfig,
    RENDER_CONFIG_DATA *hRendCfg,                               /* i  : Renderer configuration                  */
    LSSETUP_CUSTOM_STRUCT *customLsInput,
#ifdef NONBE_1377_REND_DIRATT_CONF
    const int32_t outFs,                                        /* i: output sampling rate                      */
    const IVAS_REND_InputId id                                  /* i: ISM ID                                    */
#else
    const int32_t output_Fs 
#endif
);

void ivas_td_binaural_close(
+20 −0
Original line number Diff line number Diff line
@@ -1326,7 +1326,11 @@ static ivas_error setRendInputActiveIsm(

    if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -1334,7 +1338,11 @@ static ivas_error setRendInputActiveIsm(
        /* Open TD renderer wrappers */
        for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
        {
#ifdef NONBE_1377_REND_DIRATT_CONF
            if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -1352,7 +1360,11 @@ static ivas_error setRendInputActiveIsm(
    }
    else
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -2107,7 +2119,11 @@ static ivas_error initMcBinauralRendering(

    if ( useTDRend && inputMc->tdRendWrapper.hBinRendererTd == NULL )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -2117,7 +2133,11 @@ static ivas_error initMcBinauralRendering(
            /* Open TD renderer wrappers */
            for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i )
            {
#ifdef NONBE_1377_REND_DIRATT_CONF
                if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }