Commit e1a07bb6 authored by vaclav's avatar vaclav
Browse files

Merge branch '540-change-internal-sampling-rate-for-ism-at-48-kbps' into 'main'

[non-BE] change internal sampling rate for 1ISM 48 kbps

See merge request !730
parents 146c6fb4 8ba8f700
Loading
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 /* i  : flag indicating 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;
+3 −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 */
+3 −0
Original line number Diff line number Diff line
@@ -178,6 +178,9 @@
#define EXTERNAL_ORIENTATIONS                           /* Nokia: Contribution 41: (external) orientation information handling */

#define MASA_PREREND                                    /* Nokia: Contribution 42: Support for IVAS_rend to merge MASA + other format to MASA */
#define ISM_25k6_HZ_CORE                                /* VA: issue 540: 1ISM 48 kbps - change ACELP/TCX 16 kHz core to TCX only 25.6 kHz core */



#define FIX_528_ISM_MD_FILE_TOO_SHORT                   /* VA: issue 528: ISM Metadata file too short  */

+8 −0
Original line number Diff line number Diff line
@@ -9766,6 +9766,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(
@@ -9803,6 +9807,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 /* i  : flag indicating ISM format     */
#endif
);

float getTcxBandwidth(
+13 −2
Original line number Diff line number Diff line
@@ -73,7 +73,13 @@ void open_decoder_LPD(
    {
        st->fscale_old = st->fscale;
    }
    st->sr_core = getCoreSamplerateMode2( st->element_mode, total_brate, bwidth, st->flag_ACELP16k, st->rf_flag );

    st->sr_core = getCoreSamplerateMode2( st->element_mode, total_brate, bwidth, st->flag_ACELP16k, st->rf_flag
#ifdef ISM_25k6_HZ_CORE
                                          ,
                                          st->is_ism_format
#endif
    );
    st->fscale = sr2fscale( st->sr_core );
    fscaleFB = sr2fscale( st->output_Fs );

@@ -92,7 +98,12 @@ void open_decoder_LPD(
        }
    }

    st->tcxonly = getTcxonly( st->element_mode, total_brate, MCT_flag );
    st->tcxonly = getTcxonly( st->element_mode, total_brate, MCT_flag
#ifdef ISM_25k6_HZ_CORE
                              ,
                              st->is_ism_format
#endif
    );

    /* the TD TCX PLC in MODE1 still runs with 80ms subframes */
    if ( ( st->element_mode == EVS_MONO && st->L_frame == L_FRAME16k && total_brate <= ACELP_32k ) || ( st->element_mode > EVS_MONO && st->L_frame == L_FRAME16k && total_brate <= MAX_ACELP_BRATE ) || ( st->tcxonly && ( st->sr_core == 32000 || st->sr_core == 16000 ) ) )
Loading