Commit 30e54d80 authored by reutelhuber's avatar reutelhuber
Browse files

fix further WB crashes for SBA

parent 18d2eba7
Loading
Loading
Loading
Loading
Loading
+31 −31
Original line number Diff line number Diff line
@@ -750,17 +750,13 @@ ivas_error init_encoder(
     *-----------------------------------------------------------------*/

#ifdef IGF_MEMORY_ALLOC_OPT
    igf_brate = st->total_brate;
    switch ( st->element_mode )
    {
        case IVAS_SCE:
            if ( st_ivas->hEncoderConfig->ivas_format == ISM_FORMAT )
    if ( st->element_mode == IVAS_SCE && st_ivas->hEncoderConfig->ivas_format == ISM_FORMAT )
    {
        igf_brate = st->total_brate - ISM_NB_BITS_METADATA_NOMINAL * FRAMES_PER_SEC;
    }
            break;
        case IVAS_CPE_DFT:
            /* use nominal bitrates for DFT Stereo, same as in stereo_dft_config() */
    else if ( st->element_mode == IVAS_CPE_DFT || ( st->element_mode == IVAS_SCE && ( st_ivas->hEncoderConfig->ivas_format == SBA_FORMAT || st_ivas->hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) ) )
    {
        /* use nominal bitrates for DFT Stereo and (O)SBA, same as in stereo_dft_config()/ivas_spar_config() */
        if ( element_brate == IVAS_13k2 )
        {
            igf_brate = ACELP_9k60;
@@ -777,10 +773,14 @@ ivas_error init_encoder(
        {
            igf_brate = ACELP_24k40;
        }
            break;
        case IVAS_CPE_MDCT:
    }
    else if ( st->element_mode == IVAS_CPE_MDCT )
    {
        igf_brate = element_brate;
            break;
    }
    else
    {
        igf_brate = st->total_brate;
    }

    if ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO )