Commit b6b20319 authored by vaclav's avatar vaclav
Browse files

updates within NONBE_FIX_839_MC_RS_CHANNEL_ALLOC: introduce function...

updates within NONBE_FIX_839_MC_RS_CHANNEL_ALLOC: introduce function ivas_output_buff_dec() and simplify call of ivas_get_nchan_buffers_dec()
parent c2090f01
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -294,6 +294,14 @@ ivas_error ivas_init_decoder(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
ivas_error ivas_output_buff_dec(
    float *p_output_f[],                                        /* i/o: output audio buffers                    */
    const int16_t nchan_out_buff_old,                           /* i  : previous frame number of output channels*/
    const int16_t nchan_out_buff                                /* i  : number of output channels               */   
);
#endif

ivas_error stereo_dmx_evs_init_encoder(
    STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS,                   /* o  : Stereo downmix for EVS encoder handle   */
    const int32_t input_Fs                                      /* i  : input sampling rate                     */
+17 −0
Original line number Diff line number Diff line
@@ -67,7 +67,11 @@ static ivas_error ivas_ism_bitrate_switching_dec(
    int16_t tc_nchan_tc_new;
    int16_t tc_nchan_allocate_new;
    int16_t tc_granularity_new;
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    int16_t nchan_out_buff, nchan_out_buff_old;
#else
    int16_t ch, nchan_out_buff, nchan_out_buff_old;
#endif
    AUDIO_CONFIG intern_config_old;
    IVAS_OUTPUT_SETUP hIntSetupOld;
    RENDERER_TYPE renderer_type_old;
@@ -81,7 +85,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_839_MC_RS_CHANNEL_ALLOC
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#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 )
    {
@@ -331,6 +339,14 @@ static ivas_error ivas_ism_bitrate_switching_dec(

    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );

        if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );

        if ( nchan_out_buff > nchan_out_buff_old )
@@ -352,6 +368,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(
                st_ivas->p_output_f[ch] = NULL;
            }
        }
#endif
    }

    /*-----------------------------------------------------------------*
+4 −0
Original line number Diff line number Diff line
@@ -443,7 +443,11 @@ void ivas_mc_paramupmix_dec(
        }
    }

#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    for ( ch = first_empty_channel; ch < ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); ch++ )
#else
    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++ )
#endif
    {
        set_f( output_f[ch], 0.0f, output_frame );
    }
+14 −5
Original line number Diff line number Diff line
@@ -732,16 +732,15 @@ static ivas_error ivas_mc_dec_reconfig(
    AUDIO_CONFIG intern_config_old;
    IVAS_OUTPUT_SETUP hIntSetupOld;
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    int16_t nchan_out_buf_old;
    int16_t nchan_out_buff_old, nchan_out_buff;
#endif
    error = IVAS_ERR_OK;

    error = IVAS_ERR_OK;
    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
    nchan_transport_old = st_ivas->nchan_transport;
#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 );
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#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 */

    /* we have to temporally set the current mc_mode back to the previous one to make sure the following call to
@@ -1391,12 +1390,21 @@ static ivas_error ivas_mc_dec_reconfig(
        }
    }

#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
    /*-----------------------------------------------------------------*
     * floating-point output audio buffers
     *-----------------------------------------------------------------*/
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC

    if ( !st_ivas->hDecoderConfig->Opt_5ms )
    {
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
        nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );

        if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        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 );

@@ -1419,6 +1427,7 @@ static ivas_error ivas_mc_dec_reconfig(
                st_ivas->p_output_f[ch] = NULL;
            }
        }
#endif
    }
#endif

+13 −0
Original line number Diff line number Diff line
@@ -180,7 +180,11 @@ 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_839_MC_RS_CHANNEL_ALLOC
    nchan_out_buff_old = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );
#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;

@@ -414,6 +418,14 @@ ivas_error ivas_omasa_dec_config(

        if ( !st_ivas->hDecoderConfig->Opt_5ms )
        {
#ifdef NONBE_FIX_839_MC_RS_CHANNEL_ALLOC
            nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 );

            if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );

            if ( nchan_out_buff > nchan_out_buff_old )
@@ -435,6 +447,7 @@ ivas_error ivas_omasa_dec_config(
                    st_ivas->p_output_f[k] = NULL;
                }
            }
#endif
        }
    }

Loading