Skip to content
Commits on Source (17)
......@@ -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 )
{
......
......@@ -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
......
......@@ -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 ############################ */
......
......@@ -3187,8 +3187,7 @@ void swb_tbe_enc_ivas_fx(
}
/* this is needed as the E_LPC_lev_dur function outputs lpc in Q14 */
Word16 tmp_shift = sub( norm_s( lpc_shb_fx[0] ), 2 );
scale_sig( lpc_shb_fx, LPC_SHB_ORDER + 1, tmp_shift );
scale_sig( lpc_shb_fx, LPC_SHB_ORDER + 1, sub( norm_s( lpc_shb_fx[0] ), 2 ) );
/* Expand bandwidth of the LP coeffs */
test();
......
......@@ -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();
......
......@@ -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;
}
......
......@@ -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 Word16 object_id, /* i : Object ID */
#endif
Word16 *SrcInd,
Word16 *num_src
);
......
......@@ -147,6 +147,12 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout(
const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for input */
);
#ifdef NONBE_1377_REND_DIRATT_CONF
ivas_error IVAS_REND_SetObjectIDs(
IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */
);
#endif
ivas_error IVAS_REND_SetInputGain_fx(
IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */
const IVAS_REND_InputId inputId, /* i : ID of the input */
......
......@@ -131,6 +131,9 @@ typedef struct
Word32 nonDiegeticPanGain_fx; /* Q31 */
OMASA_ANA_HANDLE hOMasa;
UWord16 total_num_objects;
#ifdef NONBE_1377_REND_DIRATT_CONF
Word16 object_id;
#endif
Word32 ism_metadata_delay_ms_fx; /* Q0 */
} input_ism;
......@@ -1493,7 +1496,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, inputIsm->object_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 +1533,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, inputIsm->object_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 +1571,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, inputIsm->object_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 +2527,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 +2567,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;
}
......@@ -4176,6 +4199,34 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout(
return IVAS_ERR_OK;
}
#ifdef NONBE_1377_REND_DIRATT_CONF
/*-------------------------------------------------------------------*
* IVAS_REND_SetObjectIDs()
*
*
*-------------------------------------------------------------------*/
ivas_error IVAS_REND_SetObjectIDs(
IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */
)
{
int16_t i;
/* Validate function arguments */
if ( hIvasRend == NULL )
{
return IVAS_ERR_UNEXPECTED_NULL_POINTER;
}
for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ )
{
hIvasRend->inputsIsm[i].object_id = i;
}
return IVAS_ERR_OK;
}
#endif
/*-------------------------------------------------------------------*
* IVAS_REND_SetInputGain()
*
......