Commit b3b41753 authored by reutelhuber's avatar reutelhuber
Browse files

attempt at implementing an adaptive TCX reconfig based on number of active objects

parent f01485ea
Loading
Loading
Loading
Loading

lib_com/ivas_stat_com.h

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -81,6 +81,10 @@ typedef struct
    int16_t ism_md_inc_diff_cnt; /* counter of continuous frames where MD are transmitted in inactive segments when MD significantly changes */
    float last_true_radius;      /* last true Q radius value */

#ifdef ISM_ADAP_TCX_RECONFIG
    float bits_nom_fac;
#endif

} ISM_METADATA_FRAME, *ISM_METADATA_HANDLE;


+3 −1
Original line number Diff line number Diff line
@@ -151,13 +151,15 @@
#endif

#define FIX_383_CLEAN_UP                                /* Dlb : Clean up of unused functions */
// #define FIX_532_ISM_MD_INACTIVE                         /* VA: issue 532: improve MD coding in ISM inactive frames */
#define FIX_532_ISM_MD_INACTIVE                         /* VA: issue 532: improve MD coding in ISM inactive frames */
#define FIX_547_NAN_IGF_DEC                             /* FhG: issue 547: fix possible nan in IGF decoder */

#define FIX_529_BWD_ISSUE                               /* VA: issue 529: fix Bandwidth Detector not working reliably for Music and Generic Audio */

#define IGF_TUNING_96                                   /* FhG: Issue 546: slight tuning of IGF config used in 96 kbps stereo, 128 kbps SBA and others */

#define ISM_ADAP_TCX_RECONFIG

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */

lib_dec/ivas_dec.c

100644 → 100755
+22 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#endif
#include "wmc_auto.h"

#ifdef ISM_ADAP_TCX_RECONFIG
#define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM inactive frames */
#endif


/*--------------------------------------------------------------------------*
 * ivas_dec()
@@ -68,6 +72,10 @@ ivas_error ivas_dec(
    ivas_error error;
    float *p_output[MAX_OUTPUT_CHANNELS];

#ifdef ISM_ADAP_TCX_RECONFIG
    int16_t num_active_ISMs = 0;
#endif

    error = IVAS_ERR_OK;

    push_wmops( "ivas_dec" );
@@ -179,6 +187,20 @@ ivas_error ivas_dec(
            }
        }

#ifdef ISM_ADAP_TCX_RECONFIG
        for ( n = 0; n < st_ivas->nchan_transport; n++ )
        {
            SCE_DEC_HANDLE hSCE = st_ivas->hSCE[n];
            st = hSCE->hCoreCoder[0];

            if ( st->total_brate > BRATE_ISM_INACTIVE )
            {
                num_active_ISMs++;
            }
        }
        st_ivas->hIsmMetaData[0]->bits_nom_fac = ((float)st_ivas->nchan_transport) / num_active_ISMs;
#endif

        for ( n = 0; n < st_ivas->nchan_transport; n++ )
        {
            if ( ( error = ivas_sce_dec( st_ivas, n, &output[n], output_frame, nb_bits_metadata[n] ) ) != IVAS_ERR_OK )
+1 −1
Original line number Diff line number Diff line
@@ -542,7 +542,7 @@ ivas_error ivas_ism_metadata_dec(
            if ( ism_mode == ISM_MODE_DISC )
            {
#ifdef FIX_532_ISM_MD_INACTIVE
                if ( ism_imp[ch] == ISM_NO_META )
                if ( ism_imp[ch] == ISM_NO_META && total_brate[ch] < ACELP_8k00 )
#else
                if ( hIsmMeta[ch]->ism_metadata_flag == 0 && localVAD[ch] == 0 && ism_metadata_flag_global )
#endif
+11 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#endif
#include "wmc_auto.h"

#ifdef ISM_ADAP_TCX_RECONFIG
#define BRATE_ISM_INACTIVE 2450 /* CoreCoder bitrate in ISM inactive frames */
#endif


/*--------------------------------------------------------------------------*
 * ivas_sce_dec()
@@ -168,6 +172,13 @@ ivas_error ivas_sce_dec(
    else
    {
        st->bits_frame_nominal = (int16_t) ( ( hSCE->element_brate / FRAMES_PER_SEC ) - ISM_NB_BITS_METADATA_NOMINAL );
#ifdef ISM_ADAP_TCX_RECONFIG
        /*st->bits_frame_nominal = (int16_t)(st->total_brate / FRAMES_PER_SEC);*/
        if ( st->total_brate > BRATE_ISM_INACTIVE )
        {
            st->bits_frame_nominal = (int16_t)(st->bits_frame_nominal * st_ivas->hIsmMetaData[0]->bits_nom_fac);
        }
#endif
    }

    /* set "total_brate" */
Loading