Commit fa258146 authored by reutelhuber's avatar reutelhuber
Browse files

allocate hIGFEnc only when needed at the encoder

parent 8bef1c48
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#define FIX_718_JBM_MD_UDPATE                           /* Fhg: fix issue #718, wrong setting of the update flag in the TD obj renderer in the JBM path */
#define FIX_719_CRASH_IN_CLEANUP                        /* VA: issue 719: fix Decoder crash after call to goto to cleanup */

#define IGF_MEMORY_ALLOC_OPT

/* ################## End BE DEVELOPMENT switches ######################### */

lib_com/prot.h

100644 → 100755
+16 −0
Original line number Diff line number Diff line
@@ -2272,6 +2272,10 @@ ivas_error init_encoder(
    const int16_t interval_SID,      /* i  : interval for SID update                */
    const int16_t vad_only_flag,     /* i  : flag to indicate front-VAD structure   */
    const ISM_MODE ism_mode          /* i  : ISM mode                               */
#ifdef IGF_MEMORY_ALLOC_OPT
    ,
    const int32_t element_brate
#endif
);

void LPDmem_enc_init(
@@ -9869,6 +9873,18 @@ void IGFEncResetTCX10BitCounter(
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i  : instance handle of IGF Encoder */
);

#ifdef IGF_MEMORY_ALLOC_OPT
ivas_error IGF_Reconfig(
    IGF_ENC_INSTANCE_HANDLE *hIGFEnc,/* i/o: instance handle of IGF Encoder  */
    const int16_t igf,               /* i  : IGF on/off                      */
    const int16_t reset,             /* i  : reset flag                      */
    const int32_t brate,             /* i  : bitrate for configuration       */
    const int16_t bwidth,            /* i  : signal bandwidth                */
    const int16_t element_mode,      /* i  : IVAS element mode               */
    const int16_t rf_mode            /* i  : flag to signal the RF mode      */
);
#endif

void IGFEncSetMode(
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i  : instance handle of IGF Encoder */
    const int32_t total_brate,             /* i  : encoder total bitrate          */

lib_enc/cod_tcx.c

100644 → 100755
+19 −0
Original line number Diff line number Diff line
@@ -1197,16 +1197,35 @@ void QuantizeTCXSpectrum(
    {
        noiseFillingBorder = st->hIGFEnc->infoStartLine;
    }
#ifndef IGF_MEMORY_ALLOC_OPT
    else
    {
        st->hIGFEnc->infoStopLine = noiseFillingBorder;
    }
#endif
    *pnoiseFillingBorder = noiseFillingBorder;

#ifdef IGF_MEMORY_ALLOC_OPT
    if ( st->igf )
    {
        for ( i = st->hIGFEnc->infoStopLine; i < max( L_frame, L_frameTCX ); i++ )
        {
            spectrum[i] = 0.0f;
        }
    }
    else
    {
        for ( i = noiseFillingBorder; i < max( L_frame, L_frameTCX ); i++ )
        {
            spectrum[i] = 0.0f;
        }
    }
#else
    for ( i = st->hIGFEnc->infoStopLine; i < max( L_frame, L_frameTCX ); i++ )
    {
        spectrum[i] = 0.0f;
    }
#endif

    /*-----------------------------------------------------------*
     * Quantization                                              *

lib_enc/core_enc_init.c

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.

lib_enc/core_enc_switch.c

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.

Loading