Commit 0ff3b887 authored by multrus's avatar multrus
Browse files

[cleanup] accept HARMONIZE_2567_init_functions

parent 8c790d24
Loading
Loading
Loading
Loading
+0 −161
Original line number Diff line number Diff line
@@ -825,11 +825,7 @@ Word16 getTcxLpcShapedAri(
 * Initialization of TCX
 *-----------------------------------------------------------------------*/

#ifdef HARMONIZE_2567_init_functions
void init_tcx_cfg_fx(
#else
void init_tcx_cfg_ivas_fx(
#endif
    TCX_CONFIG_HANDLE hTcxCfg,
    const Word32 total_brate,     /*Q0*/
    const Word32 sr_core,         /*Q0*/
@@ -845,12 +841,8 @@ void init_tcx_cfg_ivas_fx(
    const Word16 infoIGFStopFreq, /*Q0*/
    const Word16 element_mode,    /*Q0*/
    const Word16 ini_frame,       /*Q0*/
#ifdef HARMONIZE_2567_init_functions
    const Word16 MCT_flag, /*Q0*/
    const Word16 fscaleFB /*Q0*/ )
#else
    const Word16 MCT_flag /*Q0*/ )
#endif
{
    Word16 i;
    Word16 mdctWindowLength;
@@ -868,11 +860,7 @@ void init_tcx_cfg_ivas_fx(
    hTcxCfg->tcx_mdct_window_length_old = hTcxCfg->tcx_mdct_window_length; /*Q0*/
    move16();
    mdctWindowLength = getMdctWindowLength_fx( fscale ); /*Q0*/
#ifdef HARMONIZE_2567_init_functions
    mdctWindowLengthFB = getMdctWindowLength_fx( fscaleFB ); /*Q0*/ /* this replaces (int16_t) ( mdctWindowLength * input_Fs / sr_core ) as used in float */
#else
    mdctWindowLengthFB = (Word16) ( mdctWindowLength * input_Fs / sr_core );
#endif

    init_tcx_window_cfg_fx( hTcxCfg, sr_core, input_Fs, L_frame, L_frameTCX, mdctWindowLength, mdctWindowLengthFB, element_mode );
    /* SQ deadzone & memory quantization*/
@@ -1093,152 +1081,3 @@ void init_tcx_window_cfg_fx(
    return;
}
#ifndef HARMONIZE_2567_init_functions
void init_tcx_cfg_fx(
    TCX_CONFIG_HANDLE hTcxCfg,
    const Word32 total_brate,     /*Q0*/
    const Word32 sr_core,         /*Q0*/
    const Word32 input_Fs,        /*Q0*/
    const Word16 L_frame,         /*Q0*/
    const Word16 bwidth,          /*Q0*/
    const Word16 L_frameTCX,      /*Q0*/
    const Word16 fscale,          /*Q0*/
    const Word16 preemph_fac,     /*Q15*/
    const Word16 tcxonly,         /*Q0*/
    const Word16 rf_mode,         /*Q0*/
    const Word16 igf,             /*Q0*/
    const Word16 infoIGFStopFreq, /*Q0*/
    const Word16 element_mode,    /*Q0*/
    const Word16 ini_frame,       /*Q0*/
    const Word16 MCT_flag,        /*Q0*/
    const Word16 fscaleFB /*Q0*/ )
{
    Word16 i;
    Word16 mdctWindowLength;
    Word16 mdctWindowLengthFB;
    Word16 na_scale_bwidth;

    hTcxCfg->preemph_fac = preemph_fac;
    move16();

    hTcxCfg->tcx5Size = shr( L_frame, 2 );      /* Always 5 ms Q0*/
    hTcxCfg->tcx5SizeFB = shr( L_frameTCX, 2 ); /* Always 5 ms Q0*/
    move16();
    move16();

    hTcxCfg->tcx_mdct_window_length_old = hTcxCfg->tcx_mdct_window_length; /*Q0*/
    move16();
    mdctWindowLength = getMdctWindowLength_fx( fscale );     /*Q0*/
    mdctWindowLengthFB = getMdctWindowLength_fx( fscaleFB ); /*Q0*/
    init_tcx_window_cfg_fx( hTcxCfg, sr_core, input_Fs, L_frame, L_frameTCX, mdctWindowLength, mdctWindowLengthFB, element_mode );
    /* SQ deadzone & memory quantization*/
    hTcxCfg->sq_rounding = 12288 /*0.375f Q15*/; /*deadzone of 1.25->rounding=1-1.25/2 (No deadzone=0.5)*/
    move16();

    /* TCX rate loop */
    hTcxCfg->tcxRateLoopOpt = 0;
    move16();

    if ( tcxonly != 0 )
    {
        hTcxCfg->tcxRateLoopOpt = 2;
        move16();
    }
    if ( EQ_16( element_mode, IVAS_CPE_MDCT ) )
    {
        hTcxCfg->tcxRateLoopOpt = 3;
        move16();
    }
    hTcxCfg->bandwidth = getTcxBandwidth( bwidth ); /*Q15*/
    move16();

    /* set number of coded lines */
    hTcxCfg->tcx_coded_lines = getNumTcxCodedLines( bwidth ); /*Q0*/
    move16();

    /* TNS in TCX */
    hTcxCfg->pCurrentTnsConfig = NULL;
    hTcxCfg->fIsTNSAllowed = getTnsAllowed( total_brate, igf, element_mode ); /*Q0*/
    move16();

    IF( hTcxCfg->fIsTNSAllowed )
    {
        InitTnsConfigs_fx( bwidth, hTcxCfg->tcx_coded_lines, hTcxCfg->tnsConfig, infoIGFStopFreq, total_brate, element_mode, MCT_flag );

        SetAllowTnsOnWhite( hTcxCfg->tnsConfig, (Word8) EQ_16( element_mode, IVAS_CPE_MDCT ) );
    }

    IF( ini_frame == 0 )
    {
        hTcxCfg->tcx_curr_overlap_mode = hTcxCfg->tcx_last_overlap_mode = ALDO_WINDOW;
        hTcxCfg->last_aldo = 1;
        move16();
        move16();
        move16();
    }

    /* Context HM*/
    hTcxCfg->ctx_hm = getCtxHm( element_mode, total_brate, rf_mode ); /*Q0*/
    move16();

    /* Residual Coding*/
    hTcxCfg->resq = getResq( total_brate ); /*Q0*/
    move16();
    test();
    if ( hTcxCfg->resq && !tcxonly )
    {
        hTcxCfg->tcxRateLoopOpt = 1;
        move16();
    }

    /*Set bandwidth scale*/
    IF( EQ_16( bwidth, NB ) )
    {
        na_scale_bwidth = NB;
    }
    ELSE IF( LE_32( sr_core, INT_FS_16k ) )
    {
        na_scale_bwidth = WB;
    }
    ELSE
    {
        na_scale_bwidth = SWB;
    }
    move16();
    hTcxCfg->na_scale = 32767 /*1.0f Q15*/;
    move16();

    test();
    IF( LT_16( na_scale_bwidth, SWB ) && !tcxonly )
    {
        FOR( i = 0; i < SIZE_SCALE_TABLE_TCX; i++ )
        {
            test();
            test();
            IF( ( EQ_16( na_scale_bwidth, scaleTcxTable[i].bwmode ) ) &&
                ( GE_32( total_brate, scaleTcxTable[i].bitrateFrom ) ) &&
                ( LT_32( total_brate, scaleTcxTable[i].bitrateTo ) ) )
            {
                if ( rf_mode )
                {
                    i = sub( i, 1 );
                }
                hTcxCfg->na_scale = scaleTcxTable[i].scale; /*Q15*/
                move16();
                BREAK;
            }
        }
    }

    IF( tcxonly )
    {
        InitPsychLPC_fx( sr_core, L_frame, hTcxCfg );
    }
    ELSE
    {
        hTcxCfg->psychParamsCurrent = NULL;
    }

    return;
}
#endif
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARMONIZE_2567_init_functions                   /* FhG: harmonize derivates for evs/ivas regarding functions init_acelp*(),init_tcx_cfg*(), init_tcx*(), init_coder_ace_plus*(), init_core_sig_ana*() and init_modes*() */
#define HARMONIZE_2607_GetFilterParameters              /* FhG: Harmonize GetFilterParameters with its ivas derivate */
#define HAMRONIZE_2606_ENC_PRM                          /* FhG: Harmonize enc_prm_fx(), to match floating-point code */
#define HARMONIZE_2604_decoder_tcx_post                 /* FhG: Harmonize decoder_tcx_post with its ivas derivate */
+0 −44
Original line number Diff line number Diff line
@@ -3794,14 +3794,6 @@ void tcx_get_gain(
    Word16 *en_y_e  /* o: energy of y exponent (optional) */
);

#ifndef HARMONIZE_2567_init_functions
void init_TCX_config(
    TCX_CONFIG_HANDLE hTcxCfg,
    Word16 L_frame,
    Word16 fscale,
    Word16 L_frameTCX,
    Word16 fscaleFB );
#endif

void resetTecDec_Fx(
    TEC_DEC_HANDLE hTecDec );
@@ -5723,26 +5715,6 @@ void init_tcx_window_cfg_fx(
    const Word16 element_mode        /* i  : mode of CPE/SCE          */
);

#ifndef HARMONIZE_2567_init_functions
void init_tcx_cfg_fx(
    TCX_CONFIG_HANDLE hTcxCfg,
    const Word32 total_brate,
    const Word32 sr_core,
    const Word32 input_Fs,
    const Word16 L_frame,
    const Word16 bwidth,
    const Word16 L_frameTCX,
    const Word16 fscale,
    const Word16 preemph_fac, /*Q15*/
    const Word16 tcxonly,
    const Word16 rf_mode,
    const Word16 igf,
    const Word16 infoIGFStopFreq,
    const Word16 element_mode,
    const Word16 ini_frame,
    const Word16 MCT_flag /* i  : hMCT handle allocated (1) or not (0)  */,
    const Word16 fscaleFB );
#endif

void syn_output_fx(
    const Word16 codec_mode,   /* i  : MODE1 or MODE2                       */
@@ -9525,20 +9497,12 @@ void writeTCXparam_fx(
    const Word16 target_bitsTCX10[2],
    const Word16 pre_past_flag );

#ifdef HARMONIZE_2567_init_functions
void init_coder_ace_plus_fx(
    Encoder_State *st,             /* i  : Encoder state                          */
    const Word32 last_total_brate, /* i  : last total bitrate                     */
    const Word32 igf_brate,        /* i  : IGF configuration bitrate           */
    const Word16 shift,
    const Word16 MCT_flag /* i  : hMCT handle allocated (1) or not (0)   */
#else
void init_coder_ace_plus_ivas_fx(
    Encoder_State *st,             /* i  : Encoder state                          */
    const Word32 last_total_brate, /* i  : last total bitrate                     */
    const Word32 igf_brate,        /* i  : IGF configuration bitrate           */
    const Word16 MCT_flag          /* i  : hMCT handle allocated (1) or not (0)   */
#endif
);

void core_coder_reconfig_ivas_fx(
@@ -9561,11 +9525,7 @@ void SetModeIndex_fx(
    const Word16 shift
);

#ifdef HARMONIZE_2567_init_functions
void init_tcx_cfg_fx(
#else
void init_tcx_cfg_ivas_fx(
#endif
    TCX_CONFIG_HANDLE hTcxCfg,
    const Word32 total_brate,     /*Q0*/
    const Word32 sr_core,         /*Q0*/
@@ -9581,12 +9541,8 @@ void init_tcx_cfg_ivas_fx(
    const Word16 infoIGFStopFreq, /*Q0*/
    const Word16 element_mode,    /*Q0*/
    const Word16 ini_frame,       /*Q0*/
#ifdef HARMONIZE_2567_init_functions
    const Word16 MCT_flag, /*Q0*/
    const Word16 fscaleFB /*Q0*/ );
#else
    const Word16 MCT_flag /*Q0*/ );
#endif

Word16 msvq_stage1_dct_search_fx(
    const Word32 *u_fx,                       /* i  : target                                        exp : u_e */
+0 −52
Original line number Diff line number Diff line
@@ -2157,55 +2157,3 @@ void tcx_get_gain(
}

#ifndef HARMONIZE_2567_init_functions
void init_TCX_config(
    TCX_CONFIG_HANDLE hTcxCfg,
    Word16 L_frame,    /*Q0*/
    Word16 fscale,     /*Q0*/
    Word16 L_frameTCX, /*Q0*/
    Word16 fscaleFB /*Q0*/ )
{
    /* Initialize the TCX MDCT windows */
    hTcxCfg->tcx_mdct_window_length = extract_l( L_shr( L_mult0( L_LOOK_12k8, fscale ), LD_FSCALE_DENOM ) ); /*Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_delay = hTcxCfg->tcx_mdct_window_length; /*Q0*/
    move16();

    hTcxCfg->tcx_mdct_window_half_length = extract_l( L_shr( L_mult0( L_LOOK_12k8 - NS2SA( 12800, 5000000L ), fscale ), LD_FSCALE_DENOM ) );
    move16();
    hTcxCfg->tcx_mdct_window_min_length = shr( L_frame, 4 ); /* 1.25ms Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_trans_length = shr( L_frame, 4 ); /* 1.25ms Q0*/
    move16();
    hTcxCfg->tcx5Size = shr( L_frame, 2 ); /* 5ms Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_lengthFB = extract_l( L_shr( L_mult0( L_LOOK_12k8, fscaleFB ), LD_FSCALE_DENOM ) ); /*Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_delayFB = hTcxCfg->tcx_mdct_window_lengthFB; /*Q0*/
    move16();

    hTcxCfg->tcx_mdct_window_half_lengthFB = extract_l( L_shr( L_mult0( L_LOOK_12k8 - NS2SA( 12800, 5000000L ), fscaleFB ), LD_FSCALE_DENOM ) ); /*Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_min_lengthFB = shr( L_frameTCX, 4 ); /* 1.25ms Q0*/
    move16();
    hTcxCfg->tcx_mdct_window_trans_lengthFB = shr( L_frameTCX, 4 ); /* 1.25ms Q0*/
    move16();
    hTcxCfg->tcx5SizeFB = shr( L_frameTCX, 2 ); /* 5ms Q0*/
    move16();
    mdct_window_sine( hTcxCfg->tcx_mdct_window, hTcxCfg->tcx_mdct_window_length );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_half, hTcxCfg->tcx_mdct_window_half_length );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_minimum, hTcxCfg->tcx_mdct_window_min_length );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_trans, hTcxCfg->tcx_mdct_window_trans_length );

    mdct_window_sine( hTcxCfg->tcx_mdct_windowFB, hTcxCfg->tcx_mdct_window_lengthFB );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_halfFB, hTcxCfg->tcx_mdct_window_half_lengthFB );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_minimumFB, hTcxCfg->tcx_mdct_window_min_lengthFB );
    mdct_window_sine( hTcxCfg->tcx_mdct_window_transFB, hTcxCfg->tcx_mdct_window_trans_lengthFB );

    /*ALDO windows for MODE2*/
    mdct_window_aldo( hTcxCfg->tcx_aldo_window_1, hTcxCfg->tcx_aldo_window_1_trunc, hTcxCfg->tcx_aldo_window_2, L_frame );
    mdct_window_aldo( hTcxCfg->tcx_aldo_window_1_FB, hTcxCfg->tcx_aldo_window_1_FB_trunc, hTcxCfg->tcx_aldo_window_2_FB, L_frameTCX );

    return;
}
#endif
+46 −987

File changed.

Preview size limit exceeded, changes collapsed.

Loading