diff --git a/lib_com/options.h b/lib_com/options.h index 989143e5c6a61219c9a7b6e44aba6c68f691762f..ac93b9407aa8c4bbf00dfd3f41206a6fe3bfb7b4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,7 @@ #define MC_JBM /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */ #define FIX_265_MC_BRATE_SWITCHING /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */ #define FIX_ANGLE_WRAPPING /* Issue 244: Problems with angle wrapping*/ +#define FIX_245_RANGE_CODER_VOIP_MSAN /* Issue 245: fix use-of-uninitialized-value in range coder in VoIP mode */ #define FIX_272_COV /* Issue 272: Cleanup for code coverage related to calls to ivas_binaural_cldfb() */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 818433ab5840e79243c295c5bf33ac21117b5893..5b7e5f9046f57ad45be15ffb5d832cc812466074 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -541,7 +541,11 @@ ivas_error IVAS_DEC_EnableVoIP( #define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ +#ifdef FIX_245_RANGE_CODER_VOIP_MSAN + hIvasDec->hVoIP->bs_conversion_buf = malloc( sizeof( uint16_t ) * ( MAX_BITS_PER_FRAME + 4 * 8 ) ); +#else hIvasDec->hVoIP->bs_conversion_buf = malloc( sizeof( uint16_t ) * MAX_BITS_PER_FRAME + 4 * 8 ); +#endif #undef WMC_TOOL_SKIP if ( hIvasDec->hVoIP->bs_conversion_buf == NULL ) @@ -1265,6 +1269,14 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ byte <<= 1; } + +#ifdef FIX_245_RANGE_CODER_VOIP_MSAN + /* Add 4 padding bytes required by core coder */ + for ( i = 0; i < 4 * 8; ++i ) + { + serial[num_bits + i] = 0; + } +#endif #undef WMC_TOOL_SKIP } #endif diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index a998eefe2c6e82afb8f496eca9fc4bdb13b7d818..136a3c1e84c3182ec4856c767fec8af40805843d 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -933,3 +933,8 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -sba 3 80000 32 testv/stv3OA32c.pcm bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP HOA3 32 netsimoutput testv/stv3OA32c.pcm_SBA_80000_32-32_HOA3_JBM5.tst + +// Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out, 7_1_4 out, JBM Prof 5 +../IVAS_cod -mc 5_1 384000 48 testv/stv51MC48c.pcm bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP 7_1_4 48 netsimoutput testv/stv51MC48c.pcm_MC51_384000_48-48_7_1_4_JBM5.tst \ No newline at end of file