Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,7 @@ #define NONBE_SVD_OPTIMIZATION #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ #define NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* FhG: Fix assert being hit in JBM code during rate switching */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading lib_dec/ivas_ism_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,25 @@ static ivas_error ivas_ism_bitrate_switching_dec( mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv render what still fits in the new granularity */ tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } #endif if ( st_ivas->ism_mode != last_ism_mode ) { /* EFAP handle */ Loading Loading @@ -295,7 +314,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; #ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); #endif if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { Loading lib_dec/ivas_masa_dec.c +19 −0 Original line number Diff line number Diff line Loading @@ -1509,6 +1509,25 @@ ivas_error ivas_masa_dec_reconfigure( tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; } } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { if ( n_samples_granularity > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } } #endif } else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) { Loading lib_dec/ivas_mct_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,25 @@ static ivas_error ivas_mc_dec_reconfig( } } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } #endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ) ); Loading Loading @@ -1303,7 +1322,9 @@ static ivas_error ivas_mc_dec_reconfig( tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; #ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); #endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { Loading lib_dec/ivas_sba_dec.c +22 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,27 @@ ivas_error ivas_sba_dec_reconfigure( /* determine new granularity */ granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* flush renderer on granularity change form 5ms to 1.25ms, again only possible for binaural rendering */ if ( granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } /* make sure the changed number of slots in the last subframe is not lost in the following steps */ if ( st_ivas->hSpatParamRendCom != NULL ) { st_ivas->hSpatParamRendCom->subframe_nbslots[st_ivas->hSpatParamRendCom->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } #else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { /* make sure the changed number of slots in the last subframe is not lost in the following steps */ Loading @@ -182,6 +203,7 @@ ivas_error ivas_sba_dec_reconfigure( } st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } #endif } /* save old */ Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,7 @@ #define NONBE_SVD_OPTIMIZATION #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ #define NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* FhG: Fix assert being hit in JBM code during rate switching */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading
lib_dec/ivas_ism_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,25 @@ static ivas_error ivas_ism_bitrate_switching_dec( mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv render what still fits in the new granularity */ tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } #endif if ( st_ivas->ism_mode != last_ism_mode ) { /* EFAP handle */ Loading Loading @@ -295,7 +314,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; #ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); #endif if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { Loading
lib_dec/ivas_masa_dec.c +19 −0 Original line number Diff line number Diff line Loading @@ -1509,6 +1509,25 @@ ivas_error ivas_masa_dec_reconfigure( tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS; } } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { if ( n_samples_granularity > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { if ( n_samples_granularity < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } } #endif } else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) { Loading
lib_dec/ivas_mct_dec.c +21 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,25 @@ static ivas_error ivas_mc_dec_reconfig( } } #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* JBM: when granularity goes down (e.g. MCT with CREND -> ParamMC with binaural fastconv render what still fits in the new granularity */ tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } #endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ) ); Loading Loading @@ -1303,7 +1322,9 @@ static ivas_error ivas_mc_dec_reconfig( tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_allocate_new = tc_nchan_tc_new; tc_nchan_full_new = tc_nchan_tc_new; #ifndef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs ); #endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { Loading
lib_dec/ivas_sba_dec.c +22 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,27 @@ ivas_error ivas_sba_dec_reconfigure( /* determine new granularity */ granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), st_ivas->hDecoderConfig->output_Fs ); #ifdef NONBE_1321_JBM_ASSERT_BITRATE_SWITCHING /* flush renderer on granularity change form 5ms to 1.25ms, again only possible for binaural rendering */ if ( granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { /* flush already done in IVAS_DEC_ReadFormat() */ } else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { return error; } /* make sure the changed number of slots in the last subframe is not lost in the following steps */ if ( st_ivas->hSpatParamRendCom != NULL ) { st_ivas->hSpatParamRendCom->subframe_nbslots[st_ivas->hSpatParamRendCom->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } #else if ( granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) { /* make sure the changed number of slots in the last subframe is not lost in the following steps */ Loading @@ -182,6 +203,7 @@ ivas_error ivas_sba_dec_reconfigure( } st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->nb_subframes - 1] = st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1]; } #endif } /* save old */ Loading