Loading apps/isar_post_rend.c +21 −0 Original line number Diff line number Diff line Loading @@ -992,6 +992,9 @@ int main( while ( 1 ) { #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST int16_t bfi = 0; #endif int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; Loading @@ -1000,7 +1003,11 @@ int main( { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi ); #else error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ); #endif if ( error_tmp != IVAS_ERR_OK ) { if ( error_tmp == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -1067,19 +1074,33 @@ int main( /* Read from split renderer bfi file if specified */ if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame ) { #ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST int16_t bfi; #endif if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #endif } #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST if ( splitBinNeedsNewFrame ) { if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } } #endif for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { Loading lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ #define FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE /* Dolby/FhG: fix for issue 2026: Saturation in SWB TBE re-scaling function preventing StereoDownmix complexity job to complete */ #define FIX_2021_BANDWIDTH_EXTENSION_PROBLEM /* FhG: increase cldfb buffer precision*/ #define FIX_2083_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/ #define FIX_2085_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */ /* #################### Start BASOP porting switches ############################ */ Loading Loading @@ -154,8 +155,11 @@ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ #define FIX_1179_USAN_PHASEECU /* Eri: issue 1179: better handling of 16 bit wrap around for very long(>200ms) FER-bursts */ #define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ #define NONBE_1293_CRASH_FIRST_FRAME_LOST /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ // object-editing feature porting Loading lib_dec/ivas_init_dec_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -690,7 +690,12 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 1; move16(); } /* this should be non-zero if original input format was MASA_ISM_FORMAT */ #ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH st_ivas->ism_mode = ISM_MODE_NONE; move16(); #endif st_ivas->nchan_ism = add( st_ivas->bit_stream[sub( k, 3 )], shl( st_ivas->bit_stream[sub( k, 2 )], 1 ) ); IF( GT_16( st_ivas->nchan_ism, 0 ) ) Loading Loading @@ -1008,6 +1013,17 @@ ivas_error ivas_dec_setup( } } #ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH test(); IF( GT_16( st_ivas->ini_frame, 0 ) && EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { st_ivas->nchan_ism = 0; move16(); st_ivas->ism_mode = ISM_MODE_NONE; move16(); } #endif IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; Loading lib_dec/ivas_jbm_dec_fx.c +99 −72 Original line number Diff line number Diff line Loading @@ -2979,14 +2979,29 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( #endif } } ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ){ #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN IF( EQ_32( ism_mode_old, ISM_SBA_MODE_DISC ) ){ #endif Word32 * tc_local_fx[MAX_TRANSPORT_CHANNELS]; Word16 last_spar_md_idx; Word16 last_dirac_md_idx; UWord16 nSamplesAvailableNext; #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; Word32 ivas_total_brate; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; renderer_type_orig = st_ivas->renderer_type; ism_mode_orig = st_ivas->ism_mode; /* to render flushed samples, use configuration from the last received frame */ move32(); st_ivas->ism_mode = ism_mode_old; st_ivas->renderer_type = renderer_type_old; st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #endif last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1]; last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1]; Loading @@ -2996,7 +3011,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( /* copy from ISM delay buffer to the correct place in TCs */ FOR( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN tc_local_fx[ch_idx] = &st_ivas->hTcBuffer->tc_fx[ch_idx][hTcBuffer->n_samples_rendered]; #else tc_local_fx[ch_idx] = &st_ivas->hTcBuffer->tc_fx[ch_idx + 2][hTcBuffer->n_samples_rendered]; #endif Copy32( st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], tc_local_fx[ch_idx], st_ivas->hSbaIsmData->delayBuffer_size ); } Loading Loading @@ -3032,12 +3051,19 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( return error; } #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* restore original configuration */ st_ivas->ism_mode = ism_mode_orig; st_ivas->renderer_type = renderer_type_orig; st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; } #endif } ELSE { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" ); } hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity; } Loading Loading @@ -3065,6 +3091,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ivas_syn_output_fx( p_output_fx, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, data ); return IVAS_ERR_OK; } Loading lib_dec/ivas_masa_dec_fx.c +2 −1 Original line number Diff line number Diff line Loading @@ -1976,6 +1976,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ivas_masa_set_elements_fx( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); #ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { IF( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) Loading @@ -1988,7 +1989,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( st_ivas->ism_mode = ISM_MODE_NONE; move16(); } #endif { Word16 tc_nchan_to_allocate; Word16 tc_nchan_transport; Loading Loading
apps/isar_post_rend.c +21 −0 Original line number Diff line number Diff line Loading @@ -992,6 +992,9 @@ int main( while ( 1 ) { #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST int16_t bfi = 0; #endif int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; Loading @@ -1000,7 +1003,11 @@ int main( { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi ); #else error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten ); #endif if ( error_tmp != IVAS_ERR_OK ) { if ( error_tmp == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -1067,19 +1074,33 @@ int main( /* Read from split renderer bfi file if specified */ if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame ) { #ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST int16_t bfi; #endif if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #endif } #ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST if ( splitBinNeedsNewFrame ) { if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } } #endif for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { Loading
lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ #define FIX_2602_NONBE_SAT_IN_SWB_TBE_SCALE /* Dolby/FhG: fix for issue 2026: Saturation in SWB TBE re-scaling function preventing StereoDownmix complexity job to complete */ #define FIX_2021_BANDWIDTH_EXTENSION_PROBLEM /* FhG: increase cldfb buffer precision*/ #define FIX_2083_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in makeCustomLsSetup()*/ #define FIX_2085_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in ivas_dirac_config_fx() */ /* #################### Start BASOP porting switches ############################ */ Loading Loading @@ -154,8 +155,11 @@ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ #define FIX_1179_USAN_PHASEECU /* Eri: issue 1179: better handling of 16 bit wrap around for very long(>200ms) FER-bursts */ #define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ #define NONBE_1293_CRASH_FIRST_FRAME_LOST /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */ #define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ #define NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ // object-editing feature porting Loading
lib_dec/ivas_init_dec_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -690,7 +690,12 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 1; move16(); } /* this should be non-zero if original input format was MASA_ISM_FORMAT */ #ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH st_ivas->ism_mode = ISM_MODE_NONE; move16(); #endif st_ivas->nchan_ism = add( st_ivas->bit_stream[sub( k, 3 )], shl( st_ivas->bit_stream[sub( k, 2 )], 1 ) ); IF( GT_16( st_ivas->nchan_ism, 0 ) ) Loading Loading @@ -1008,6 +1013,17 @@ ivas_error ivas_dec_setup( } } #ifdef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH test(); IF( GT_16( st_ivas->ini_frame, 0 ) && EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { st_ivas->nchan_ism = 0; move16(); st_ivas->ism_mode = ISM_MODE_NONE; move16(); } #endif IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { ISM_MODE last_ism_mode = st_ivas->ism_mode; Loading
lib_dec/ivas_jbm_dec_fx.c +99 −72 Original line number Diff line number Diff line Loading @@ -2979,14 +2979,29 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( #endif } } ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) { ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ){ #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN IF( EQ_32( ism_mode_old, ISM_SBA_MODE_DISC ) ){ #endif Word32 * tc_local_fx[MAX_TRANSPORT_CHANNELS]; Word16 last_spar_md_idx; Word16 last_dirac_md_idx; UWord16 nSamplesAvailableNext; #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN ISM_MODE ism_mode_orig; RENDERER_TYPE renderer_type_orig; Word32 ivas_total_brate; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; renderer_type_orig = st_ivas->renderer_type; ism_mode_orig = st_ivas->ism_mode; /* to render flushed samples, use configuration from the last received frame */ move32(); st_ivas->ism_mode = ism_mode_old; st_ivas->renderer_type = renderer_type_old; st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate; #endif last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1]; last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1]; Loading @@ -2996,7 +3011,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( /* copy from ISM delay buffer to the correct place in TCs */ FOR( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN tc_local_fx[ch_idx] = &st_ivas->hTcBuffer->tc_fx[ch_idx][hTcBuffer->n_samples_rendered]; #else tc_local_fx[ch_idx] = &st_ivas->hTcBuffer->tc_fx[ch_idx + 2][hTcBuffer->n_samples_rendered]; #endif Copy32( st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], tc_local_fx[ch_idx], st_ivas->hSbaIsmData->delayBuffer_size ); } Loading Loading @@ -3032,12 +3051,19 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( return error; } #ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* restore original configuration */ st_ivas->ism_mode = ism_mode_orig; st_ivas->renderer_type = renderer_type_orig; st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate; } #endif } ELSE { return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" ); } hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity; } Loading Loading @@ -3065,6 +3091,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ivas_syn_output_fx( p_output_fx, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, data ); return IVAS_ERR_OK; } Loading
lib_dec/ivas_masa_dec_fx.c +2 −1 Original line number Diff line number Diff line Loading @@ -1976,6 +1976,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( ivas_masa_set_elements_fx( ivas_total_brate, st_ivas->mc_mode, st_ivas->nchan_transport, st_ivas->hQMetaData, &tmp, &tmp, &tmp, st_ivas->ivas_format, st_ivas->ism_mode, ism_total_brate ); #ifndef NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { IF( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) Loading @@ -1988,7 +1989,7 @@ ivas_error ivas_masa_dec_reconfigure_fx( st_ivas->ism_mode = ISM_MODE_NONE; move16(); } #endif { Word16 tc_nchan_to_allocate; Word16 tc_nchan_transport; Loading