Commit 874d1940 authored by vaclav's avatar vaclav
Browse files

ISM_FB - 1ISM 32 kbps: change SWB to FB coding

ISM_25k6_HZ_CORE - 1ISM 48 kbps: change ACELP/TCX 16 kHz core to TCX only 25.6 kHz core
parent ae9a8e48
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -166,6 +166,10 @@ int16_t getTcxonly(
    const int16_t element_mode, /* i  : IVAS element mode                   */
    const int32_t total_brate,  /* i  : total bitrate                       */
    const int16_t MCT_flag      /* i  : hMCT handle allocated (1) or not (0)*/
#ifdef ISM_25k6_HZ_CORE
    ,
    const int16_t is_ism_format
#endif
)
{
    int16_t tcxonly = 0;
@@ -179,6 +183,24 @@ int16_t getTcxonly(
            }
            break;
        case IVAS_SCE:
#ifdef ISM_25k6_HZ_CORE
            if ( is_ism_format )
            {
                if ( total_brate > MAX_ACELP_BRATE_ISM )
                {
                    tcxonly = 1;
                }
            }
            else
            {
                if ( total_brate > MAX_ACELP_BRATE )
                {
                    tcxonly = 1;
                }
            }
            break;

#endif
        case IVAS_CPE_DFT:
        case IVAS_CPE_TD:
            if ( total_brate > MAX_ACELP_BRATE )
@@ -341,6 +363,10 @@ int32_t getCoreSamplerateMode2(
    const int16_t bwidth,        /* i  : audio bandwidth                */
    const int16_t flag_ACELP16k, /* i  : ACELP@16kHz flag               */
    const int16_t rf_mode        /* i  : flag to signal the RF mode     */
#ifdef ISM_25k6_HZ_CORE
    ,
    const IVAS_FORMAT is_ism_format
#endif
)
{
    int32_t sr_core = 0;
@@ -361,10 +387,25 @@ int32_t getCoreSamplerateMode2(
    {
        sr_core = INT_FS_16k;
    }
#ifdef ISM_25k6_HZ_CORE
    else if ( ( bwidth == SWB || bwidth == FB ) && total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && !is_ism_format )
    {
        sr_core = INT_FS_16k;
    }
    else if ( ( bwidth == SWB || bwidth == FB ) && total_brate <= MAX_ACELP_BRATE_ISM && element_mode == IVAS_SCE && is_ism_format )
    {
        sr_core = INT_FS_16k;
    }
    else if ( ( bwidth == SWB || bwidth == FB ) && total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE && is_ism_format )
    {
        sr_core = 25600;
    }
#else
    else if ( ( bwidth == SWB && total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE ) || ( bwidth == FB && total_brate <= MAX_ACELP_BRATE && element_mode == IVAS_SCE ) )
    {
        sr_core = INT_FS_16k;
    }
#endif
    else if ( ( ( bwidth == SWB || bwidth == FB ) && element_mode == EVS_MONO && total_brate <= HQ_64k ) || ( element_mode > IVAS_SCE && ( ( bwidth == SWB && total_brate <= IVAS_96k ) || ( bwidth == FB && total_brate <= IVAS_96k ) ) ) )
    {
        sr_core = 25600;
+6 −0
Original line number Diff line number Diff line
@@ -290,6 +290,9 @@ typedef enum
#define MAX_VOICED_BRATE                        ACELP_13k20                 /* max. per channel bitrate where VOICED is supported               */
#define MIN_TC_BRATE                            6450                        /* min. per channel bitrate where TRANSITION is supported           */
#define MAX_ACELP_BRATE                         48000                       /* max. per channel bitrate where ACELP core is supported           */
#ifdef ISM_25k6_HZ_CORE
#define MAX_ACELP_BRATE_ISM                     40000                       /* max. per channel bitrate where ACELP core is supported in ISM format         */
#endif

#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 */
@@ -317,6 +320,9 @@ typedef enum
#define MIN_BRATE_SWB_SCE                       ACELP_9k60                  /* min. SCE bitrate where SWB is supported */
#define MIN_BRATE_SWB_STEREO                    IVAS_13k2                   /* min. stereo bitrate where SWB is supported */
#define MIN_BRATE_FB_STEREO                     IVAS_32k                    /* min. SCE and stereo bitrate where FB is supported */
#ifdef ISM_FB
#define MIN_BRATE_FB_STEREO_ISM                 24000                       /* min. SCE bitrate where FB is supported in ISM format */
#endif

#define MIN_TDM_BRATE_WB_TBE_1k05               12000                       /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */
#define MIN_BRATE_WB_TBE_1k05                   9650                        /* min. per channel bitrate where WB TBE @1.05 kbps is supported (0.35kbs at lower bitrates) */
+7 −0
Original line number Diff line number Diff line
@@ -203,6 +203,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const int32_t ivas_total_brate                             /* i  : IVAS total bitrate                         */
#ifdef ISM_FB
    ,const ISM_MODE ism_mode
#endif
);

ivas_error pre_proc_ivas(
@@ -584,6 +587,10 @@ void ivas_signaling_enc(
    const int32_t element_brate,                                /* i  : element bitrate                         */
    const int16_t tdm_SM_flag,                                  /* i  : channel combination scheme flag in TD stereo */
    const int16_t tdm_Pitch_reuse_flag                          /* i  : primary channel pitch reuse flag in TD stereo*/
#ifdef ISM_FB
    ,
    const ISM_MODE ism_mode
#endif
);

void ivas_decision_matrix_dec(
+5 −2
Original line number Diff line number Diff line
@@ -222,8 +222,11 @@



#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
#define ISM_16_KHZ_CORE   // 1ISM 16.4 kbps: change starting bitrate of core-coder with 16kHz internal sampling rate from 17 kbps to 15.9 kbps
#define ISM_FB            // 1ISM 32 kbps: change SWB to FB coding
#define ISM_25k6_HZ_CORE  // 1ISM 48 kbps: change ACELP/TCX 16 kHz core to TCX only 25.6 kHz core



/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+12 −0
Original line number Diff line number Diff line
@@ -3834,6 +3834,10 @@ void set_bw(
    const int32_t element_brate, /* i  : element bitrate                             */
    Encoder_State *st,           /* i/o: Encoder State                               */
    const int16_t codec_mode     /* i  : codec mode                                  */
#ifdef ISM_FB
    ,
    const ISM_MODE ism_mode
#endif
);

float gaus_encode(
@@ -9712,6 +9716,10 @@ int16_t getTcxonly(
    const int16_t element_mode, /* i  : IVAS element mode                   */
    const int32_t total_brate,  /* i  : total bitrate                       */
    const int16_t MCT_flag      /* i  : hMCT handle allocated (1) or not (0)*/
#ifdef ISM_25k6_HZ_CORE
    ,
    const int16_t is_ism_format
#endif
);

int16_t getTnsAllowed(
@@ -9749,6 +9757,10 @@ int32_t getCoreSamplerateMode2(
    const int16_t bwidth,        /* i  : audio bandwidth                */
    const int16_t flag_ACELP16k, /* i  : ACELP@16kHz flag               */
    const int16_t rf_mode        /* i  : flag to signal the RF mode     */
#ifdef ISM_25k6_HZ_CORE
    ,
    const IVAS_FORMAT is_ism_format
#endif
);

float getTcxBandwidth(
Loading