diff --git a/lib_com/options.h b/lib_com/options.h index 1728371c0f27457127646da8b070dad074c03299..ac21bc2a368a8d923ee5951f93fbd5124afa0d77 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,8 @@ #define FIX_431_PARAMMC_PLC_INTERPOLATOR /* FhG: Issue 431: fix missing interpolator reset for ParamMC PCL */ #define FIX_391_SBA /* Dlb: Fix for issue 391 for SBA */ +#define FIX_425_MASA_BRSW_RENDERER /* Nokia: Issue 425: renderer not reconfigure in MASA bitrate switching */ + #define EUALER2QUAT_FIX /*Dlb :fix for issue 430 issue in euler2quat, sign of quat y is inverted*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 2c87109f6e3c28b8e70a1039b85b2deff55458f3..32bfcb960d596e40bc20adf8432dcab43992c704 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1091,6 +1091,26 @@ ivas_error ivas_masa_dec_reconfigure( ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old ); #endif +#ifdef FIX_425_MASA_BRSW_RENDERER + /* renderer might have changed, reselect */ + ivas_renderer_select( st_ivas ); + + if ( st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->hDirAC == NULL ) + { + /* init a new DirAC dec */ + if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) + { + return error; + } + } + else if ( st_ivas->renderer_type == RENDERER_DISABLE && st_ivas->hDirAC != NULL ) + { + /* close unnecessary DirAC dec */ + ivas_dirac_dec_close( &( st_ivas->hDirAC ) ); + } + /* possible reconfigure is done later */ +#endif + /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles *-----------------------------------------------------------------*/ @@ -1147,7 +1167,13 @@ ivas_error ivas_masa_dec_reconfigure( } } } - +#ifdef FIX_425_MASA_BRSW_RENDERER + if ( st_ivas->hDiracDecBin != NULL ) + { + /* regularization factor is bitrate-dependent */ + st_ivas->hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); + } +#endif #ifdef FIX_417_TD_DECORR_BRATE_SW /*-----------------------------------------------------------------* * TD Decorrelator