Commit dc15b13a authored by Jouni Paulus's avatar Jouni Paulus
Browse files

remove unnecessary cldfbAnaDec[1] reinstantiation under certain McMASA...

remove unnecessary cldfbAnaDec[1] reinstantiation under certain McMASA conditions as this is now handled by ivas_cldfb_dec_reconfig().
bugfix: McMASA reconfig needs to run renderer selection and internal config init extra since they depend from transport settings modified in the function.
parent 91c18871
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -66,6 +66,10 @@ ivas_error ivas_mcmasa_dec_reconfig(
    /* get new McMASA settings */
    ivas_mcmasa_setNumTransportChannels( &( st_ivas->nchan_transport ), &( st_ivas->element_mode_init ), ivas_total_brate );
    ivas_mcmasa_set_separate_channel_mode( &( st_ivas->hOutSetup.separateChannelEnabled ), &( st_ivas->hOutSetup.separateChannelIndex ), ivas_total_brate );
    /* transport channel settings may affect renderer */
    ivas_renderer_select( st_ivas );
    /* renderer change may affect internal config */
    ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config );
    ivas_mcmasa_set_separate_channel_mode( &( st_ivas->hIntSetup.separateChannelEnabled ), &( st_ivas->hIntSetup.separateChannelIndex ), ivas_total_brate );

    if ( ( error = ivas_masa_dec_open( st_ivas ) ) != IVAS_ERR_OK )
+0 −19
Original line number Diff line number Diff line
@@ -953,25 +953,6 @@ static ivas_error ivas_mc_dec_reconfig(
#ifdef MC_BITRATE_SWITCHING_CLDFB
    ivas_cldfb_dec_reconfig( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old );

    // !!! VE: what is the following block needed for?
    if ( ( last_mc_mode == MC_MODE_MCMASA ) && ( nchan_transport_old == 1 ) && ( ( renderer_type_old == RENDERER_BINAURAL_PARAMETRIC ) || ( renderer_type_old == RENDERER_BINAURAL_PARAMETRIC_ROOM ) || ( renderer_type_old == RENDERER_STEREO_PARAMETRIC ) ) )
    {
        int16_t numCldfbAnalyses, numCldfbSyntheses;

        ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses );

        /* cldfbAnaDec[1] might be modified by DirAC (ivas_dirac_dec_binaural_internal) -> re-instantiate it */
        if ( numCldfbAnalyses_old > 1 && numCldfbAnalyses > 1 )
        {
            deleteCldfb( &( st_ivas->cldfbAnaDec[1] ) );
            st_ivas->cldfbAnaDec[1] = NULL;

            if ( ( error = openCldfb( &( st_ivas->cldfbAnaDec[1] ), CLDFB_ANALYSIS, st_ivas->hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }
#else
    ivas_init_dec_get_num_cldfb_instances( st_ivas, &numCldfbAnalyses, &numCldfbSyntheses );