Commit fea60c4b authored by vaclav's avatar vaclav
Browse files

harmonize use of FD CNG init function

parent 44cfaeb2
Loading
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -58,7 +58,13 @@ ivas_error createFdCngCom_fx(
 *
 *-------------------------------------------------------------------*/

void ivas_initFdCngCom_fx( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale )
#ifdef FIX_2245_INIT_FD_CNG_EVS
void initFdCngCom(
#else
void ivas_initFdCngCom_fx( 
#endif
    HANDLE_FD_CNG_COM hFdCngCom, 
    Word16 scale )
{
    /* Calculate CLDFB scaling factor */
    /* shl(i_mult2(scale, scale), 3) does not fit in 16 bit */
@@ -172,7 +178,7 @@ void ivas_initFdCngCom_fx( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale )
    return;
}


#ifndef FIX_2245_INIT_FD_CNG_EVS
void initFdCngCom( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale )
{
    /* Calculate CLDFB scaling factor */
@@ -277,7 +283,7 @@ void initFdCngCom( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale )

    return;
}

#endif
/*-------------------------------------------------------------------
 * deleteFdCngCom()
 *
+2 −1
Original line number Diff line number Diff line
@@ -1990,6 +1990,7 @@ ivas_error stereo_memory_dec_fx(
    const Word16 nchan_transport                                /* i  : number of transport channels            */
);

#ifndef FIX_2245_INIT_FD_CNG_EVS
void initFdCngDec_ivas_fx(
    DEC_CORE_HANDLE st,                                         /* i/o: decoder state structure                 */
    Word16 scale 
@@ -1998,7 +1999,7 @@ void initFdCngDec_ivas_fx(
void ivas_initFdCngCom_fx( 
    HANDLE_FD_CNG_COM hFdCngCom, Word16 scale 
);

#endif
Word16 set_ACELP_flag_IVAS(
    const Word16 element_mode,                                  /* i  : element mode                            */
    const Word32 element_brate,                                 /* i  : element bitrate                         */
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_2245_INIT_FD_CNG_EVS                        /* Dolby: Issue 2245: initialize FD CNG with EVS-type of init function */
#define FIX_2245_INIT_FD_CNG_EVS                        /* Dolby/VA: Issue 2245: initialize FD CNG with EVS-type of init function */


/* #################### End BE switches ################################## */
+14 −0
Original line number Diff line number Diff line
@@ -81,16 +81,27 @@ ivas_error createFdCngDec_fx( HANDLE_FD_CNG_DEC *hFdCngDec )
    return error;
}

#ifdef FIX_2245_INIT_FD_CNG_EVS
void initFdCngDec_fx(
    DEC_CORE_HANDLE st, /* i/o: decoder state structure     */
    const Word16 scale  /* i  : Q factor                    */
)
#else
void initFdCngDec_ivas_fx(
    DEC_CORE_HANDLE st, /* i/o: decoder state structure     */
    Word16 scale /*Q15*/ )
#endif
{
    /* Initialize common */
    HANDLE_FD_CNG_DEC hFdCngDec;

    hFdCngDec = st->hFdCngDec;

#ifdef FIX_2245_INIT_FD_CNG_EVS
    initFdCngCom( hFdCngDec->hFdCngCom, scale );
#else
    ivas_initFdCngCom_fx( hFdCngDec->hFdCngCom, scale );
#endif
    set16_fx( hFdCngDec->olapBufferAna, 0, FFTLEN );
    hFdCngDec->hFdCngCom->olapBufferAna = hFdCngDec->olapBufferAna;
    set16_fx( hFdCngDec->olapBufferSynth2, 0, FFTLEN );
@@ -196,9 +207,11 @@ void initFdCngDec_ivas_fx(
    move16();
    Copy( st->lsp_old_fx, st->lspCNG_fx, M ); /*Q15*/
    hFdCngDec->hFdCngCom->sid_frame_counter = 0;

    return;
}

#ifndef FIX_2245_INIT_FD_CNG_EVS
void initFdCngDec_fx(
    DEC_CORE_HANDLE st, /* i/o: decoder state structure     */
    const Word16 scale /*Q15*/ )
@@ -287,6 +300,7 @@ void initFdCngDec_fx(

    return;
}
#endif
/*
   configureFdCngDec_fx

+3 −10
Original line number Diff line number Diff line
@@ -929,16 +929,9 @@ ivas_error init_decoder_fx(

        /* Init FD-CNG */
#ifdef FIX_2245_INIT_FD_CNG_EVS
        if ( EQ_16( st_fx->element_mode, EVS_MONO ) )
        {
        initFdCngDec_fx( st_fx, st_fx->cldfbSyn->scale );
        }
        else
        {
#endif
#else
        initFdCngDec_ivas_fx( st_fx, st_fx->cldfbSyn->scale );
#ifdef FIX_2245_INIT_FD_CNG_EVS
        }
#endif
    }
    ELSE
Loading