Commit 79fd098b 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 b58457fd
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@
#define NONBE_FIX_1261_MASA_EXT_META_JBM                /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */
#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_1377_REND_DIRATT_CONF                     /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */

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

+17 −2
Original line number Diff line number Diff line
@@ -604,13 +604,16 @@ ivas_error TDREND_Update_object_positions_fx(
    const ISM_METADATA_HANDLE *hIsmMetaData            /* i  : Input metadata for ISM objects   */
)
{
#ifndef NONBE_1377_REND_DIRATT_CONF
    TDREND_DirAtten_t *DirAtten_p;
#endif
    Word16 nS;
    Word32 Pos_fx[3]; // Q25
    Word32 Dir_fx[3]; // Q30
    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++ )
@@ -635,11 +638,12 @@ ivas_error TDREND_Update_object_positions_fx(
            {
                return error;
            }

#ifndef NONBE_1377_REND_DIRATT_CONF
            IF( NE_32( ( error = TDREND_MIX_SRC_SetDirAtten_fx( hBinRendererTd, nS, DirAtten_p ) ), IVAS_ERR_OK ) )
            {
                return error;
            }
#endif

            IF( hIsmMetaData[nS]->non_diegetic_flag )
            {
@@ -790,6 +794,9 @@ ivas_error ivas_td_binaural_open_ext_fx(
    RENDER_CONFIG_DATA *hRendCfg, /* i  : Renderer configuration */
    LSSETUP_CUSTOM_STRUCT *customLsInput,
    const Word32 outFs,
#ifdef NONBE_1377_REND_DIRATT_CONF
    const IVAS_REND_InputId id, /* i: ISM ID */
#endif
    Word16 *SrcInd,
    Word16 *num_src )
{
@@ -798,6 +805,9 @@ ivas_error ivas_td_binaural_open_ext_fx(
    IVAS_FORMAT ivas_format;
    IVAS_OUTPUT_SETUP hTransSetup;
    ivas_error error;
#ifdef NONBE_1377_REND_DIRATT_CONF
    Word16 ism_number;
#endif
    Word32 *distAtt_fx = NULL;
    Word16 *directivity_fx = NULL;

@@ -839,7 +849,12 @@ ivas_error ivas_td_binaural_open_ext_fx(

    if ( NULL != hRendCfg )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        ism_number = s_and( (Word16) 0xFF, id );                    /* Exctract ISM number from ID */
        directivity_fx = hRendCfg->directivity_fx + 3 * ism_number; /* Address calculation -- no BASOPs */
#else
        directivity_fx = hRendCfg->directivity_fx;
#endif
        distAtt_fx = hRendCfg->distAtt_fx;
    }

+3 −0
Original line number Diff line number Diff line
@@ -687,6 +687,9 @@ ivas_error ivas_td_binaural_open_ext_fx(
    RENDER_CONFIG_DATA *hRendCfg,                               /* i  : Renderer configuration                  */
    LSSETUP_CUSTOM_STRUCT *customLsInput,
    const Word32 output_Fs,
#ifdef NONBE_1377_REND_DIRATT_CONF
    const IVAS_REND_InputId id,                                 /* i  : ISM ID                                  */
#endif
    Word16 *SrcInd,
    Word16 *num_src
);
+20 −0
Original line number Diff line number Diff line
@@ -1493,7 +1493,11 @@ static ivas_error setRendInputActiveIsm(
    test();
    IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#else
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }
@@ -1526,7 +1530,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#else
            IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#endif
            {
                return error;
            }
@@ -1560,7 +1568,11 @@ static ivas_error setRendInputActiveIsm(
    }
    ELSE
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#else
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }
@@ -2512,7 +2524,11 @@ static ivas_error initMcBinauralRendering(
    {
        Word16 SrcInd[MAX_NUM_TDREND_CHANNELS];
        Word16 num_src;
#ifdef NONBE_1377_REND_DIRATT_CONF
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#else
        IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }
@@ -2548,7 +2564,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#else
                IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) )
#endif
                {
                    return error;
                }