Commit e579181d authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '157-higfenc-handle-in-sba' into 'main'

allocate hIGFEnc handle only when needed

See merge request !1029
parents d2236273 0a65a26a
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@
#define FIX_712_713_SPLIT_REND_MASA_MC                 /*Dlb : Fix for issue 712 and 713*/
#endif

#define IGF_MEMORY_ALLOC_OPT                            /* FhG: Issue 157: allocate IGF encoder structure only when needed */
#define FIX_732_PLANAR_SBA_OSBA                         /* Dlb : issue 732: fix for crash in planar mode in OSBA format*/

#define FIX_708_DPID_COMMAND_LINE                       /* issue 708: sanity checks for '-dpid' command-line */
+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