Commit cad82d5a authored by bayers's avatar bayers
Browse files

reduce to fix only the missing channel realloc in MC RS

parent 43e9f83b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@
#define NONBE_FIX_730_DPID_NOT_SET_CORRECTLY                  /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */
#define NONBE_FIX_825_SBA_JBM_MONO_STEREO_OUTPUT              /* FhG: issue #825: Resolve "JBM SBA: AGC and PCA run twice for MONO and STEREO output"   */
#define NONBE_FIX_808_JBM_PARAMUPMIX_RS                       /* FhG: Issue 808: fix JBM MC rate switching */
#define NONBE_FIX_834_839_HEAP_CHANNEL_COUNT                  /* FhG: Issues #834, #839: problems with reallocation of the channels on the heap */
#define NONBE_FIX_839_MC_RS_CHANNEL_ALLOC                     /* FhG: Issues #839: problems with reallocation of the channels on the heap in case of MC RS */
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+0 −6
Original line number Diff line number Diff line
@@ -2247,9 +2247,6 @@ ivas_error ivas_init_decoder(
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point output audio buffer!\n" ) );
            }
        }
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
        st_ivas->n_output_buffer_channels = n;
#endif
    }
    else
    {
@@ -2514,9 +2511,6 @@ void ivas_initialize_handles_dec(
    {
        st_ivas->p_output_f[i] = NULL;
    }
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
    st_ivas->n_output_buffer_channels = 0;
#endif

    return;
}
+1 −7
Original line number Diff line number Diff line
@@ -81,11 +81,7 @@ 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_834_839_HEAP_CHANNEL_COUNT
    nchan_out_buff_old = st_ivas->n_output_buffer_channels;
#else
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#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 )
    {
@@ -336,9 +332,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
        st_ivas->n_output_buffer_channels = nchan_out_buff;
#endif

        if ( nchan_out_buff > nchan_out_buff_old )
        {
            for ( ch = nchan_out_buff_old; ch < nchan_out_buff; ch++ )
+4 −5
Original line number Diff line number Diff line
@@ -739,15 +739,15 @@ static ivas_error ivas_mc_dec_reconfig(
    int16_t tc_granularity_new;
    AUDIO_CONFIG intern_config_old;
    IVAS_OUTPUT_SETUP hIntSetupOld;
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    int16_t nchan_out_buf_old;
#endif
    error = IVAS_ERR_OK;

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
    nchan_transport_old = st_ivas->nchan_transport;
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
    nchan_out_buf_old = st_ivas->n_output_buffer_channels;
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    nchan_out_buf_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#endif

    last_mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ), st_ivas->hDecoderConfig->last_ivas_total_brate ); /* NB: this assumes that LS config remains the same between frames */
@@ -1398,13 +1398,12 @@ static ivas_error ivas_mc_dec_reconfig(
    /*-----------------------------------------------------------------*
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
        int16_t nchan_out_buff, ch;
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );

        st_ivas->n_output_buffer_channels = nchan_out_buff;
        if ( nchan_out_buff > nchan_out_buf_old )
        {
            for ( ch = nchan_out_buf_old; ch < nchan_out_buff; ch++ )
+1 −7
Original line number Diff line number Diff line
@@ -180,11 +180,7 @@ 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_834_839_HEAP_CHANNEL_COUNT
    nchan_out_buff_old = st_ivas->n_output_buffer_channels;
#else
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#endif

    st_ivas->ivas_format = ivas_format_orig;

@@ -419,9 +415,7 @@ ivas_error ivas_omasa_dec_config(
        if ( !st_ivas->hDecoderConfig->Opt_5ms )
        {
            nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
#ifdef NONBE_FIX_834_839_HEAP_CHANNEL_COUNT
            st_ivas->n_output_buffer_channels = nchan_out_buff;
#endif

            if ( nchan_out_buff > nchan_out_buff_old )
            {
                for ( k = nchan_out_buff_old; k < nchan_out_buff; k++ )
Loading