Commit 6e9a0fe6 authored by vaclav's avatar vaclav
Browse files

change starting bitrate of core-coder with 16kHz internal sampling rate from...

change starting bitrate of core-coder with 16kHz internal sampling rate from 17 kbps to 15.9 kbps; under ISM_16_KHZ_CORE
parent ff5b6f37
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1477,6 +1477,9 @@ static int16_t allocate_unused(

/*! r: ACELP16k flag */
int16_t set_ACELP_flag(
#ifdef ISM_16_KHZ_CORE
    const ISM_MODE ism_mode, /* i  : ISM mode                    */
#endif
    const int16_t element_mode,  /* i  : element mode                */
    const int32_t element_brate, /* i  : element bitrate             */
    const int32_t total_brate,   /* i  : total bitrate per channel   */
@@ -1515,6 +1518,12 @@ int16_t set_ACELP_flag(
    }
    else if ( element_mode == IVAS_SCE )
    {
#ifdef ISM_16_KHZ_CORE
        if ( ism_mode == ISM_MODE_DISC && element_brate >= SCE_CORE_16k_LOW_LIMIT_ISM )
        {
            return 1;
        }
#endif
        if ( element_brate >= SCE_CORE_16k_LOW_LIMIT )
        {
            return 1;
+7 −0
Original line number Diff line number Diff line
@@ -294,6 +294,9 @@ typedef enum
#define ACELP_12k8_HIGH_LIMIT                   24350                       /* max. per channel bitrate where the ACELP@12.8kHz is supported */
#define ACELP_16k_LOW_LIMIT                     13250                       /* min. per channel bitrate where the ACELP@16kHz is supported */
#define SCE_CORE_16k_LOW_LIMIT                  17000                       /* min. SCE bitrate where the ACELP@16kHz is supported; must be >= (ACELP_16k_LOW_LIMIT + SWB_TBE_1k6) */
#ifdef ISM_16_KHZ_CORE
#define SCE_CORE_16k_LOW_LIMIT_ISM              15900                       /* min. SCE bitrate where the ACELP@16kHz is supported; must be >= (ACELP_16k_LOW_LIMIT + SWB_TBE_1k6) */
#endif
#define MIN_BRATE_AVQ_EXC                       ACELP_29k00                 /* min. per channel bitrate where the AVQ excitation stage is supported */
#define MAX_BRATE_AVQ_EXC_TD                    40000                       /* max. per channel bitrate where the AVQ excitation stage in time domain is supported */

@@ -331,7 +334,11 @@ typedef enum
 * ISM Constants
 *----------------------------------------------------------------------------------*/

#ifdef ISM_16_KHZ_COREaa // VE: to be verified !!!!!
#define ISM_NB_BITS_METADATA_NOMINAL            ( ( SCE_CORE_16k_LOW_LIMIT_ISM - ACELP_16k_LOW_LIMIT ) / FRAMES_PER_SEC ) /* nominal number of metadata bits - used for configuration of Core-Coder modules */
#else
#define ISM_NB_BITS_METADATA_NOMINAL            ( ( SCE_CORE_16k_LOW_LIMIT - ACELP_16k_LOW_LIMIT ) / FRAMES_PER_SEC ) /* nominal number of metadata bits - used for configuration of Core-Coder modules */
#endif

#define ISM_METADATA_VAD_FLAG_BITS              1
#define ISM_METADATA_FLAG_BITS                  2
+26 −0
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ ivas_error ivas_ism_config(
    const int16_t nchan_transport,  /* i  : number of transport channels   */
    const int16_t nchan_ism,        /* i  : number of objects              */
    ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles           */
#ifdef ISM_16_KHZ_CORE
    const ISM_MODE ism_mode, /* i  : ISM mode                       */
#endif
#ifdef ISM_NON_DIEGETIC_PAN
    const int16_t ism_extended_metadata_flag, /* i  : extended metadata flag         */
#endif
@@ -109,12 +112,23 @@ ivas_error ivas_ism_config(
    int16_t tmp;
    int16_t ism_metadata_flag_global;
    int16_t n_ISms;
#ifdef ISM_16_KHZ_CORE
    int32_t sce_core_16k_limit;
#endif
    ivas_error error;

    error = IVAS_ERR_OK;

    n_ISms = nchan_transport;

#ifdef ISM_16_KHZ_CORE
    sce_core_16k_limit = SCE_CORE_16k_LOW_LIMIT_ISM;
    if ( ism_mode == ISM_MODE_PARAM || ism_extended_metadata_flag )
    {
        sce_core_16k_limit = SCE_CORE_16k_LOW_LIMIT;
    }
#endif

    /* initialization */
    ism_metadata_flag_global = 0;
    bits_side = 0;
@@ -221,9 +235,17 @@ ivas_error ivas_ism_config(
            {
                limit = MIN_BRATE_WB_BWE / FRMS_PER_SECOND;
            }
#ifdef ISM_16_KHZ_CORE
            else if ( element_brate[ch] >= sce_core_16k_limit ) /* replicate function set_ACELP_flag() -> it is not intended to switch the ACELP internal sampling rate within an object */
#else
            else if ( element_brate[ch] >= SCE_CORE_16k_LOW_LIMIT ) /* replicate function set_ACELP_flag() -> it is not intended to switch the ACELP internal sampling rate within an object */
#endif
            {
#ifdef ISM_16_KHZ_CORE
                /*limit = sce_core_16k_limit;*/
#else
                /*limit = SCE_CORE_16k_LOW_LIMIT;*/
#endif
                limit = ( ACELP_16k_LOW_LIMIT + SWB_TBE_1k6 ) / FRMS_PER_SECOND;
            }

@@ -275,7 +297,11 @@ ivas_error ivas_ism_config(
        for ( ch = 0; ch < n_ISms; ch++ )
        {
            limit_high = IVAS_512k / FRMS_PER_SECOND;
#ifdef ISM_16_KHZ_CORE
            if ( element_brate[ch] < sce_core_16k_limit ) /* replicate function set_ACELP_flag() -> it is not intended to switch the ACELP internal sampling rate within an object */
#else
            if ( element_brate[ch] < SCE_CORE_16k_LOW_LIMIT ) /* replicate function set_ACELP_flag() -> it is not intended to switch the ACELP internal sampling rate within an object */
#endif
            {
                limit_high = ACELP_12k8_HIGH_LIMIT / FRMS_PER_SECOND;
            }
+3 −0
Original line number Diff line number Diff line
@@ -867,6 +867,9 @@ ivas_error ivas_ism_config(
    const int16_t nchan_transport,                              /* i  : number of transport channels                */
    const int16_t nchan_ism,                                    /* i  : number of objects                           */
    ISM_METADATA_HANDLE hIsmMeta[],                             /* i/o: ISM metadata handles                        */
#ifdef ISM_16_KHZ_CORE
    const ISM_MODE ism_mode,                                    /* i  : ISM mode                                    */
#endif
#ifdef ISM_NON_DIEGETIC_PAN
    const int16_t ism_extended_metadata_flag,                   /* i  : extended metadata flag                      */
#endif
+4 −0
Original line number Diff line number Diff line
@@ -221,6 +221,10 @@
#define HYBRID_ITD_MAX                                 /* FhG: Improvement for DFT-stereo for cases with large ITDs */



#define ISM_16_KHZ_CORE   // change starting bitrate of core-coder with 16kHz internal sampling rate from 17 kbps to 15.9 kbps
                          // VE: 4ISM 64 kbps extend metadata cases might fail due to too high bitbudget for ext. MD + 4 x 16kHz core

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

Loading