Commit a6fa09b5 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch '798-osba-decoder-crashes-with-output-format-mc-5_1-7_1-5_1_2-and-5_1_4' into 'main'

[non BE] Resolve "OSBA decoder crashes with output format MC 5_1, 7_1, 5_1_2, and 5_1_4"

See merge request !1081
parents 58b0db81 8a94c59c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@
#define NONBE_FIX_778_TNS_UNFIED_STEREO_MSAN                  /* FhG: Issue 778: MSAN error due to uninitialized TNS configuration */
#define NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ                 /* VA: issue 797:  fix of crash when the separated object is inactive and the MASA metadata is using very few bits */

#define NONBE_FIX_798_OSBA_MC_DEC_CRASH

/* ##################### End NON-BE switches ########################### */

+4 −0
Original line number Diff line number Diff line
@@ -2215,7 +2215,11 @@ ivas_error ivas_init_decoder(

    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
#else
        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas ); n++ )
#endif
        {
            /* note: these are intra-frame heap memories */
            if ( ( st_ivas->p_output_f[n] = (float *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( float ) ) ) == NULL )
+8 −0
Original line number Diff line number Diff line
@@ -81,7 +81,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    st_ivas->ism_mode = last_ism_mode;
    ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
    st_ivas->ism_mode = ism_mode;
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#else
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas );
#endif

    if ( ( error = ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->nchan_ism, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ) != IVAS_ERR_OK )
    {
@@ -354,7 +358,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(

    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#else
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas );
#endif

        if ( nchan_out_buff > nchan_out_buff_old )
        {
+4 −0
Original line number Diff line number Diff line
@@ -483,7 +483,11 @@ void ivas_mc_paramupmix_dec(
        }
    }

#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
    for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); ch++ )
#else
    for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas ); ch++ )
#endif
    {
        set_f( output_f[ch], 0.0f, output_frame );
    }
+9 −0
Original line number Diff line number Diff line
@@ -180,7 +180,12 @@ ivas_error ivas_omasa_dec_config(
    ivas_format_orig = st_ivas->ivas_format;
    st_ivas->ivas_format = st_ivas->last_ivas_format;
    ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses_old, &numCldfbSyntheses_old );
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#else
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas );
#endif

    st_ivas->ivas_format = ivas_format_orig;

    nSCE_old = st_ivas->nSCE;
@@ -413,7 +418,11 @@ ivas_error ivas_omasa_dec_config(

        if ( !st_ivas->hDecoderConfig->Opt_5ms )
        {
#ifdef NONBE_FIX_798_OSBA_MC_DEC_CRASH
            nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#else
            nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas );
#endif

            if ( nchan_out_buff > nchan_out_buff_old )
            {
Loading