Commit 9c6bf12a authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into 2004-encoder-crash-for-p-800-acr-1-stereo-in-swb_tbe_enc_ivas_fx

parents 6dfde5b6 0acd6276
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1278,6 +1278,9 @@ int main(
    {
        masaIds[i] = 0u;
    }
#ifdef NONBE_1377_REND_DIRATT_CONF
    IVAS_REND_SetObjectIDs( hIvasRend );
#endif

    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
    {
+0 −1
Original line number Diff line number Diff line
@@ -343,7 +343,6 @@ typedef struct _IVAS_RENDER_CONFIG
    Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
    float distAtt[3];
    Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */

} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

typedef struct
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@
#define FIX2007_BASSPSFILTER_OVERFLOW                        /* FhG: use saturing operator, to avoid overflow in bass_psfilter_fx() */
#define FIX_ISSUE_2004_LPC_SHB_SAT                           /* Dolby: Issue 2004: prevent saturation of the LPC SHB filter */

#define FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC                 /* FhG: Corrected the q_input in the input of generate_masking_noise_dirac_ivas_fx() */
/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
@@ -108,6 +109,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 ############################ */

+12 −1
Original line number Diff line number Diff line
@@ -817,7 +817,11 @@ static void ivas_dirac_dec_binaural_internal_fx(
                                                          slot,
                                                          st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && st_ivas->hSCE[0]->hCoreCoder[0]->flag_cna,
                                                          ( st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA || st_ivas->hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 ) && ( st_ivas->hSCE[0]->hCoreCoder[0]->cng_type == FD_CNG ) && st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag,
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                                                          st_ivas->hTcBuffer->q_tc_fx, &q_cldfb[2][slot] );
#else
                                                          11, &q_cldfb[2][slot] );
#endif

                    generate_masking_noise_dirac_ivas_fx( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom,
                                                          st_ivas->cldfbAnaDec[1], /*nothing will be analyzed, just get cnst*/
@@ -852,11 +856,18 @@ static void ivas_dirac_dec_binaural_internal_fx(
                    {
                        Cldfb_RealBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_RealBuffer_in_fx[0][slot][b], 23170 );
                        Cldfb_RealBuffer_in_fx[1][slot][b] = L_add( L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[1][slot][b], 1 ) ), Cldfb_RealBuffer_in_fx[0][slot][b] );
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                        Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) );
#else
                        Cldfb_RealBuffer_in_fx[0][slot][b] = L_add( Cldfb_RealBuffer_in_fx[0][slot][b], L_shr( Cldfb_RealBuffer_in_fx[2][slot][b], 1 ) );

#endif
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = Mpy_32_16_1( Cldfb_ImagBuffer_in_fx[0][slot][b], 23170 );
                        Cldfb_ImagBuffer_in_fx[1][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[1][slot][b], 1 ) );
#ifdef FIX_2009_HIGH_NOISE_FLOOR_FOR_FX_DEC
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], add( sub( q_cldfb[2][slot], q_input ), 6 ) ) );
#else
                        Cldfb_ImagBuffer_in_fx[0][slot][b] = L_add( Cldfb_ImagBuffer_in_fx[0][slot][b], L_shr( Cldfb_ImagBuffer_in_fx[2][slot][b], 1 ) );
#endif
                        move32();
                        move32();
                        move32();
+13 −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 Word16 object_id, /* i: Object ID */
#endif
    Word16 *SrcInd,
    Word16 *num_src )
{
@@ -839,7 +846,11 @@ ivas_error ivas_td_binaural_open_ext_fx(

    if ( NULL != hRendCfg )
    {
#ifdef NONBE_1377_REND_DIRATT_CONF
        directivity_fx = hRendCfg->directivity_fx + 3 * object_id; /* Address calculation -- no BASOPs */
#else
        directivity_fx = hRendCfg->directivity_fx;
#endif
        distAtt_fx = hRendCfg->distAtt_fx;
    }

Loading