diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 31afa283449b2d989289b984a0168150dba04bb1..eefdca3c1347cb4ac3d6da190cfb30c525d2305f 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5203,6 +5203,9 @@ void ivas_ism_renderer_close( void ivas_ism_render_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + const RENDERER_TYPE renderer_type, /* i : active renderer type */ +#endif float *output_f[], /* i/o: core-coder transport channels/object output */ const int16_t n_samples_to_render /* i : output frame length per channel */ ); diff --git a/lib_com/options.h b/lib_com/options.h index ab26334e390d8244669f3360ca8e3496fe101b3e..89c4b32ac05a3b9e7fec8de18b0992848c9d364f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -146,7 +146,6 @@ /* ################### Start FIXES switches ########################### */ - #define NON_BE_FIX_807_MASA_DTX_BRSW /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */ #define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */ #define FIX_828_PORT_1152_FROM_FLT_REPO /* FhG: fix for issue 828 - fix uninitialized value used in BASOP */ @@ -193,6 +192,7 @@ #define FIX_1024_REMOVE_PARAMMC_MIXING_MAT /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */ #define FIX_1023_REMOVE_PARAMMC_DEC /* VA: issue 1023: remove unused function ivas_param_mc_dec() */ #define NONBE_FIX_1034_DRY_MASA_RATIOS /* Nokia: Fix issue 1034, use of wrong numDir state. */ +#define NONBE_FIX_1021_ISM_BRIR_RS_FLUSH /* FhG: issue #1021: fix ISM with JBM and RS renderer flushing*/ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 1c12fcdaa9eb6747ffa85dbb39ac82979d95242e..870629aa9cfaacfe3e3a1234f13f1b3d8b2afd58 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -140,7 +140,10 @@ void ivas_ism_renderer_close( *-------------------------------------------------------------------------*/ void ivas_ism_render_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + const RENDERER_TYPE renderer_type, /* i : active renderer type */ +#endif float *output_f[], /* i/o: core-coder transport channels/object output */ const int16_t n_samples_to_render /* i : output frame length per channel */ ) @@ -168,17 +171,20 @@ void ivas_ism_render_sf( slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf]; last_sf++; } - #ifdef DEBUGGING assert( slots_to_render == 0 ); assert( last_sf <= st_ivas->hTcBuffer->nb_subframes ); #endif +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + num_objects = st_ivas->nchan_ism; +#else num_objects = st_ivas->nchan_transport; if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { num_objects = st_ivas->nchan_ism; } +#endif nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; @@ -283,7 +289,11 @@ void ivas_ism_render_sf( n_samples_rendered_loop += n_samples_in_subframe; /* update rendered subframe and slots info for all cases apart from a following crend call, the update will then happen in the crend call*/ +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + if ( renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) +#else if ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) +#endif { st_ivas->hTcBuffer->subframes_rendered += 1; st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 03225fb895168c1a434331f2579a7d961ccae3ae..77fdb9dc837dd23b345ce7bd0d7a3e76ee36b2f0 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1057,7 +1057,11 @@ ivas_error ivas_jbm_dec_render( if ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); +#else ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); +#endif } else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ) { @@ -1177,7 +1181,11 @@ ivas_error ivas_jbm_dec_render( } /* render objects */ +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); +#else ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered ); +#endif /* add already rendered SBA part */ for ( n = 0; n < nchan_out; n++ ) @@ -1546,7 +1554,11 @@ ivas_error ivas_jbm_dec_flush_renderer( /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */ set_f( st_ivas->hIsmRendererData->interpolator, 1.0f, hTcBuffer->n_samples_granularity ); +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + ivas_ism_render_sf( st_ivas, renderer_type_old, p_output, hTcBuffer->n_samples_granularity ); +#else ivas_ism_render_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ); +#endif if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 0c19a6f0672cb07a70261982ddea24baa810912e..60c2c8f8ea65148d4247cddd435aa6b08005b016 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -283,7 +283,11 @@ ivas_error ivas_osba_render_sf( if ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) { +#ifdef NONBE_FIX_1021_ISM_BRIR_RS_FLUSH + ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output_ism, *nSamplesRendered ); +#else ivas_ism_render_sf( st_ivas, p_output_ism, *nSamplesRendered ); +#endif } for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ )