diff --git a/apps/decoder.c b/apps/decoder.c index 8e1b074998abd59a1ef482932fbc59fcc850dcc3..197f90b8d0d5152c152906f96d46aadbd60ddfda 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1767,7 +1767,6 @@ static ivas_error decodeG192( } } - /* Write current frame */ if ( decodedGoodFrame ) { @@ -1853,6 +1852,7 @@ static ivas_error decodeG192( *------------------------------------------------------------------------------------------*/ memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); + if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 5557a88606fc789954b3637e793bc0e101f4b89b..518a28aba7891a99013151f77d36ebfdcb544980 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -69,10 +69,17 @@ int32_t get_delay( { delay = IVAS_ENC_DELAY_NS; +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT ) + { + delay = 0; /* All delay is compensated in the decoder with MASA/ISM */ + } +#else if ( ivas_format == MASA_FORMAT ) { delay = 0; /* All delay is compensated in the decoder with MASA */ } +#endif } if ( ivas_format == SBA_FORMAT ) @@ -104,11 +111,17 @@ int32_t get_delay( delay += IVAS_FB_DEC_DELAY_NS; } - +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT ) + { + delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with ISM/MASA */ + } +#else if ( ivas_format == MASA_FORMAT ) { delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */ } +#endif } } diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 56d9c21aa7d95ef44c682e1a99186f25a0321e5f..d7239087d9ae121b5e521dcc679fac7bf210e2d2 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -58,12 +58,15 @@ typedef struct { int16_t ism_metadata_flag; /* flag whether metadata are coded in particular frame of particular object */ int16_t last_ism_metadata_flag; /* last frame ism_metadata_flag */ - int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ - float azimuth; /* azimuth value read from the input metadata file */ - float elevation; /* azimuth value read from the input metadata file */ - float radius; - float yaw; /* azimuth orientation value read from the input metadata file */ - float pitch; /* elevation orientation value read from the input metadata file */ + + float azimuth; /* azimuth value read from the input metadata file */ + float elevation; /* elevation value read from the input metadata file */ + float radius; /* radius value read from the input metadata file */ + float yaw; /* yaw value read from the input metadata file */ + float pitch; /* pitch value read from the input metadata file */ + + int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */ + ISM_METADATA_ANGLE position_angle; /* Angle structs for azimuth and elevation */ ISM_METADATA_ANGLE orientation_angle; /* Angle structs for yaw and pitch */ int16_t last_radius_idx; /* last frame index of coded radius */ diff --git a/lib_com/options.h b/lib_com/options.h index 9e494df9ab06c2c24854724dd6ca6b122de16f4c..889585ab2f53d6b32754e613d66914c1369a86bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -148,8 +148,44 @@ /*#define FIX_XXX_JBM_FIFO_BUFFER */ /* FhG: prevent wraparound of a length identifier in cause of large frames and many channels*/ #define HR_METADATA /* Nok: Contribution #45: encode directional MASA metadata with more bits at 384k and 512k */ + +#define SBA_TD_RESIDUAL /* Dlb : Issue 426: SBA encoder complexity optimization */ + +#define FIX_357_DTX_32K /* Eri: issue 357 - Forced LP-CNG at 32k */ +#define FIX_435_ISM_MERGE_BUG /* Eri: Merge bug fix for ISM NULL metadata and tcx_only cases */ +#define FIX_355_REFACTOR_PARAMBIN_TO_5MS /* Nokia: Fixes issue 355 by refactoring parametric binauralizer code to 5 ms mode */ +#define FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING /* Eri: Fix incorrect use of stack variable used for channel aware config file */ +#define COMBINED_FORMAT_SIGNALING /* VA: Introduce a signaling bit for combined format coding */ + +#define FIX_356_ISM_METADATA_SYNC /* Eri: issue 356: Metadata out-of-synch for -no_delay_comp */ + +#define FIX_446_STEREO_DMX_CRASH /* FhG: fix discrepancy with EVS code that could cause crashes in rare cases */ + +#define FIX_386_CORECODER_RECONFIG_2 /* VA: Issue 386: Resolve remaining ToDo comments in CoreCoder reconfig. */ + #define FIX_439_OTR_PARAMS /* Philips: Issue 439: orientation tracking parameter aspects. */ + +#define FIX_440_PARAM_ISM_DIR_NOISE /* FhG: Issue 440: Fix directional background noise becoming diffuse in ParamISM */ + +#define LBR_SBA_DIRAC_FIX /* DLB: Bug fix for DirAC at low bitrates */ + +#define FIX_445_SNS_BUGFIXES /* FhG: bug fix for spectral tilt in SNS computation + necessary update of codebooks and converison to fixedpoint-compatible tables */ +#define FIX_447_PARAMBIN_MASA_REGU_FAC /* Nokia: Issue 447: Fix issue by adjusting regularization factor minimum value. */ +#define FIX_441_SBA_PARAMBIN_GAINS /* Nokia: Fix issue 441 by changing gains in SBA path of parametric binauralizer */ + +#define MC_PARAMUPMIX_MODE /* Dlb: Contribution 39: Multichannel Parametric Upmix */ +#define FIX_469_BRSWITCH_PUPMIX /* Dlb: Fix issue 469 for Param Upmix bitrate switching */ + +#define HODIRAC /* FhG: Contribution 32: Sector-based HO-DirAC method for SBA at high bitrates */ +#define DIRAC_ALLOC_HARM /* VA: harmonize DirAC parameters allocation/deallocation */ + + +#define COMPLEXITY_LEVEL_INDICATION + +#define FIX_439_OTR_PARAMS /* Philips: Issue 439: orientation tracking parameter aspects. */ + #define ARITH_HUFF_CODER_CHANGES /* DLB: Optimization of metadata memory for Huffman and arithmetic coders */ + #define FIX_463_TD_RENDERER_DIRECTIVITY_RESET /* Eri: Remove unintentional reset of directivity pattern */ #define FIX_642 /* FhG: Fix for issue 642, buggy DoA-array access in DirAC head rotation*/ #define FIX_443_FD_CNG_INIT /* FhG: correct bitrate value for FD-CNG init */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 873c75938a8866752dc2bb2a01ba7998a9f6e475..081b33e55c13a9b84e0816f75e3a6fb2ebc56986 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -75,12 +75,22 @@ ivas_error ivas_td_binaural_renderer( const int16_t output_frame /* i : output frame length */ ) { +#ifdef FIX_356_ISM_METADATA_SYNC + int16_t ism_md_subframe_update = 2; + return ivas_td_binaural_renderer_unwrap( + st_ivas->hReverb, + st_ivas->transport_config, + st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, + st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, + ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, ism_md_subframe_update, output, output_frame ); +#else return ivas_td_binaural_renderer_unwrap( st_ivas->hReverb, st_ivas->transport_config, st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, output, output_frame ); +#endif } #ifdef JBM_TSM_ON_TCS @@ -102,6 +112,9 @@ void ObjRenderIVASSubframe( float *output_f_local[BINAURAL_CHANNELS]; float *tc_local[MAX_TRANSPORT_CHANNELS]; int16_t ch, slot_size, slots_to_render, output_frame; +#ifdef FIX_356_ISM_METADATA_SYNC + int16_t ism_md_subframe_update_jbm = 0; /* Number of subframes to delay metadata to sync with audio */ +#endif for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { p_reverb_signal[ch] = reverb_signal[ch]; @@ -129,8 +142,13 @@ void ObjRenderIVASSubframe( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { output_frame = st_ivas->hTcBuffer->subframe_nbslots[subframe_idx] * st_ivas->hTcBuffer->n_samples_granularity; + /* Update object position(s) */ +#ifdef FIX_356_ISM_METADATA_SYNC + TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData ); +#else TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, tc_local ); +#endif /* Update the listener's location/orientation */ TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, @@ -144,8 +162,11 @@ void ObjRenderIVASSubframe( } /* Render subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm ); +#else TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ); - +#endif if ( st_ivas->hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */ { if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 5c75fdec01bfc505b657ed48cc829eeb893c1a04..07166b8ddbf7a72dc273592592bdbb77e98dbf1c 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1580,6 +1580,14 @@ ivas_error IVAS_DEC_GetDelay( nSamples[2] = (int16_t) roundf( (float) st_ivas->binaural_latency_ns * hDecoderConfig->output_Fs / 1000000000.f ); nSamples[0] = nSamples[1] + nSamples[2]; +#ifdef FIX_356_ISM_METADATA_SYNC + if ( st_ivas->ivas_format == ISM_FORMAT ) + { + /* note: in ISM, all delay is compensated at the decoder by default, so subtract the encoder delay for print-out */ + nSamples[1] -= NS2SA( hDecoderConfig->output_Fs, IVAS_ENC_DELAY_NS ); + } +#endif + *timeScale = hDecoderConfig->output_Fs; return IVAS_ERR_OK; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index f4063edc48001f134d5a482b894084fe3c9a31ef..3d929e78c7dc4ee6c4f3f85bd3cc160e95db113c 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -263,6 +263,9 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + const int16_t ism_md_subframe_update, /* i: Number of subframes to delay ism metadata to sync with audio */ +#endif #ifdef JBM_TSM_ON_TCS float *output[], /* i/o: SCE channels / Binaural synthesis */ #else @@ -287,11 +290,33 @@ ivas_error ivas_td_binaural_renderer_unwrap( subframe_length = output_frame / MAX_PARAM_SPATIAL_SUBFRAMES; +#ifdef FIX_356_ISM_METADATA_SYNC + int16_t c_indx, nS; + c_indx = 0; + + for ( nS = 0; nS < num_src; nS++ ) + { + if ( !( ivas_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ + { + hBinRendererTd->Sources[c_indx]->InputFrame_p = output[nS]; + hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE; + c_indx++; + } + } +#else /* Update object position(s) */ TDREND_Update_object_positions( hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, output ); +#endif for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { +#ifdef FIX_356_ISM_METADATA_SYNC + if ( subframe_idx == ism_md_subframe_update ) + { + /* Update object position(s) */ + TDREND_Update_object_positions( hBinRendererTd, num_src, ivas_format, hIsmMetaData ); + } +#endif /* Update the listener's location/orientation */ TDREND_Update_listener_orientation( hBinRendererTd, Opt_Headrotation, ( Quaternions != NULL ) ? &Quaternions[subframe_idx] : NULL, ( Pos != NULL ) ? &Pos[subframe_idx] : NULL ); @@ -308,7 +333,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) +#else if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -341,6 +370,10 @@ ivas_error TDREND_GetMix( #endif const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + , + const int16_t ism_md_subframe_update /* Number of subframes to delay ism metadata to sync with audio */ +#endif ) { int16_t i; @@ -354,6 +387,11 @@ ivas_error TDREND_GetMix( int16_t intp_count; float pan_left, pan_right; +#ifdef FIX_356_ISM_METADATA_SYNC + int16_t subframe_update_flag; + subframe_update_flag = subframe_idx == ism_md_subframe_update; +#endif + error = IVAS_ERR_OK; /* Clear the output buffer to accumulate rendered sources */ @@ -377,7 +415,13 @@ ivas_error TDREND_GetMix( if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_idx ); + Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, +#ifdef FIX_356_ISM_METADATA_SYNC + subframe_update_flag +#else + subframe_idx +#endif + ); } /* Render source if needed */ @@ -438,13 +482,18 @@ static void TDREND_Clear_Update_flags( void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ const int16_t num_src, /* i : number of sources to render */ - const int16_t lfe_idx, /* i : Input LFE index */ - const IVAS_FORMAT in_format, /* i : Format of input sources */ - const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ +#ifndef FIX_356_ISM_METADATA_SYNC + const int16_t lfe_idx, /* i : Input LFE index */ +#endif + const IVAS_FORMAT in_format, /* i : Format of input sources */ + const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ +#ifndef FIX_356_ISM_METADATA_SYNC + , #ifdef JBM_TSM_ON_TCS float *output[] #else - float output[][L_FRAME48k] /* i/o: SCE/MC channels */ + float output[][L_FRAME48k] /* i/o: SCE/MC channels */ +#endif #endif ) { @@ -452,29 +501,35 @@ void TDREND_Update_object_positions( int16_t nS; float Pos[3]; float Dir[3]; +#ifndef FIX_356_ISM_METADATA_SYNC int16_t c_indx; +#endif DirAtten_p = hBinRendererTd->DirAtten_p; /* For each source, write the frame data to the source object*/ +#ifndef FIX_356_ISM_METADATA_SYNC c_indx = 0; +#endif for ( nS = 0; nS < num_src; nS++ ) { +#ifndef FIX_356_ISM_METADATA_SYNC if ( !( in_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ { hBinRendererTd->Sources[c_indx]->InputFrame_p = output[nS]; hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE; c_indx++; } - +#endif if ( in_format == ISM_FORMAT ) { - /* Update the source positions */ /* Source position and direction */ angles_to_vec( hIsmMetaData[nS]->radius, hIsmMetaData[nS]->azimuth, hIsmMetaData[nS]->elevation, Pos ); angles_to_vec( 1.0f, hIsmMetaData[nS]->yaw, hIsmMetaData[nS]->pitch, Dir ); + #ifndef FIX_463_TD_RENDERER_DIRECTIVITY_RESET + /* Source directivity info */ DirAtten_p->ConeInnerAngle = 360.0f; DirAtten_p->ConeOuterAngle = 360.0f; @@ -635,6 +690,9 @@ ivas_error ivas_td_binaural_renderer_ext( IVAS_REND_AudioConfigType inConfigType; AUDIO_CONFIG transport_config; ivas_error error; +#ifdef FIX_356_ISM_METADATA_SYNC + int16_t ism_md_subframe_update_ext = 0; +#endif #ifdef JBM_TSM_ON_TCS float *p_output[MAX_OUTPUT_CHANNELS]; int16_t ch; @@ -683,14 +741,25 @@ ivas_error ivas_td_binaural_renderer_ext( } #ifdef JBM_TSM_ON_TCS +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, + ( headRotData != NULL ) ? headRotData->headPositions : NULL, + ( headRotData != NULL ) ? headRotData->Pos : NULL, ism_md_subframe_update_ext, p_output, output_frame ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, ( headRotData != NULL ) ? headRotData->headPositions : NULL, ( headRotData != NULL ) ? headRotData->Pos : NULL, p_output, output_frame ) ) != IVAS_ERR_OK ) +#endif +#else +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, + ( headRotData != NULL ) ? headRotData->headPositions : NULL, + ( headRotData != NULL ) ? headRotData->Pos : NULL, ism_md_subframe_update, output, output_frame ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_renderer_unwrap( hReverb, transport_config, pTDRend->hBinRendererTd, num_src, lfe_idx, ivas_format, hIsmMetaData, headRotData->headRotEnabled, ( headRotData != NULL ) ? headRotData->headPositions : NULL, ( headRotData != NULL ) ? headRotData->Pos : NULL, output, output_frame ) ) != IVAS_ERR_OK ) - +#endif #endif { return error; diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 0d307ea442316cb100b799c6532517a7edf8b0b0..146827357200dd85373647ae21dc102bea6d5b6f 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -219,7 +219,6 @@ static void TDREND_SRC_REND_Init( /* Internal state */ SrcRend_p->InputAvailable = FALSE; SrcRend_p->PlayStatus = TDREND_PLAYSTATUS_INITIAL; - /* SrcGain */ for ( nC = 0; nC < SPAT_BIN_MAX_INPUT_CHANNELS; nC++ ) { @@ -260,7 +259,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *itd, /* o: ITD value */ float *Gain, /* o: Gain value */ TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + const int16_t subframe_update_flag +#else + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#endif ) { TDREND_MIX_Listener_t *Listener_p; @@ -354,7 +357,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( azim_delta = ( azim_delta > 180.0f ) ? ( azim_delta - 360 ) : ( ( azim_delta < -180.0f ) ? ( azim_delta + 360 ) : ( azim_delta ) ); /* map to -180:180 range */ *intp_count = min( MAX_INTERPOLATION_STEPS, max( (int16_t) ( fabsf( azim_delta ) * MAX_ANGULAR_STEP_INV ), (int16_t) ( fabsf( elev_delta ) * MAX_ANGULAR_STEP_INV ) ) ); +#ifdef FIX_356_ISM_METADATA_SYNC + if ( ( *intp_count > 0 ) && subframe_update_flag ) +#else if ( ( *intp_count > 0 ) && subframe_idx == 0 ) +#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index f8c730bd14fb8be1e19774c20c109473f0659b9a..bcd56aa643e64c9e317545842f0efaa4cd0e75ef 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -236,6 +236,9 @@ ivas_error ivas_td_binaural_renderer_unwrap( const int16_t Opt_Headrotation, /* i : Head rotation flag */ const IVAS_QUATERNION *Quaternions, /* i : Head tracking data per subframe */ const IVAS_VECTOR3 *Pos, /* i : Listener position data per subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + const int16_t ism_md_subframe_update, +#endif #ifdef JBM_TSM_ON_TCS float *output[], /* i/o: SCE channels / Binaural synthesis */ #else @@ -289,6 +292,10 @@ ivas_error TDREND_GetMix( #endif const int16_t subframe_length, /* i/o: subframe length */ const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#ifdef FIX_356_ISM_METADATA_SYNC + , + const int16_t ism_md_subframe_update /* Number of subframes to delay metadata to sync with audio */ +#endif ); void TDREND_Update_listener_orientation( @@ -301,14 +308,19 @@ void TDREND_Update_listener_orientation( void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ const int16_t num_src, /* i : number of sources to render */ +#ifndef FIX_356_ISM_METADATA_SYNC const int16_t lfe_idx, /* i : Input LFE index */ +#endif const IVAS_FORMAT in_format, /* i : Format of input sources */ - const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ + const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ +#ifndef FIX_356_ISM_METADATA_SYNC + , #ifdef JBM_TSM_ON_TCS float *output[] /* i/o: SCE/MC channels */ #else float output[][L_FRAME48k] /* i/o: SCE/MC channels */ #endif +#endif ); void BSplineModelEvalDealloc( @@ -379,7 +391,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *itd, /* o: ITD value */ float *Gain, /* o: Gain value */ TDREND_SRC_t *Src_p, +#ifdef FIX_356_ISM_METADATA_SYNC + const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ +#else const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#endif ); ivas_error TDREND_SRC_Alloc( diff --git a/lib_util/audio_file_writer.c b/lib_util/audio_file_writer.c index 81084dbd95b686d52477327b948ada136225f42f..0ed64d02c59f8a5b3a19c74c9e4986895ad6c5f1 100644 --- a/lib_util/audio_file_writer.c +++ b/lib_util/audio_file_writer.c @@ -151,7 +151,6 @@ ivas_error AudioFileWriter_write( uint32_t numSamples ) { ivas_error error = IVAS_ERR_OK; - if ( self->rawFile ) { if ( fwrite( samples, sizeof( int16_t ), numSamples, self->rawFile ) != numSamples )