Skip to content

FD CNG encoder handle initialization

When working on !80 (merged), there was observed that the initialization of the FD CNG encoder handle is probably not done optimally.

First, configureFdCngEnc() is called within init_encoder() with parameter st->total_brate.

Then, in pre_proc_front_ivas():

    if ( st->hFdCngEnc != NULL && ( last_element_brate != element_brate || st->last_bwidth != st->bwidth ) )
    {
        configureFdCngEnc( st->hFdCngEnc, max( st->input_bwidth, WB ), st->bits_frame_nominal * FRAMES_PER_SEC );
        if ( hCPE != NULL )
        {
            st->hFdCngEnc->hFdCngCom->CngBitrate = hCPE->element_brate - 1;
        }
    }

configureFdCngEnc() is called with parameter st->bits_frame_nominal * FRAMES_PER_SEC but only when there is a change of element_brate or bwidth. Shouldn't configureFdCngEnc() be called here also in the first frame?