Commit 2c6f9d22 authored by vaclav's avatar vaclav Committed by Manuel Jander
Browse files

cleanup of switches

parent 099bd0ec
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -258,9 +258,7 @@ typedef enum
/* format signaling in SID frames */
#define SID_FORMAT_NBITS                        3                           /* Bit 0 | Bit 1 | Bit 2 */
                                                                            /*-------|-------|------ */
#ifdef FIX_1384_MSAN_ivas_spar_dec_open
#define SID_FORMAT_NONE                         (-0x1)                      /*    n/a|    n/a|    n/a*/
#endif
#define SID_DFT_STEREO                          0x0                         /*      0|      0|     0 */
#define SID_MDCT_STEREO                         0x1                         /*      1|      0|     0 */
#define SID_ISM                                 0x2                         /*      0|      1|     0 */
+0 −11
Original line number Diff line number Diff line
@@ -5901,9 +5901,7 @@ void non_linearity_ivas_fx(
    Word16 nframes;
    Word32 prev_scale;
    Word16 length_half;
#ifdef NONBE_1328_FIX_NON_LINEARITY
    Word16 sc_factor;
#endif

    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
@@ -5964,15 +5962,10 @@ void non_linearity_ivas_fx(
        move32(); /* Q31; 0.67 in Q31 */
    }

#ifdef NONBE_1328_FIX_NON_LINEARITY
    sc_factor = s_max( sub( 13, norm_s( add( j, 1 ) ) ), 0 ); /* Adapt the scaling factor allowed depending of max position  */
    sc_factor = s_max( sc_factor, 1 );                        /* Note: The sc_factor is the log2 of the sc_factor in the float code to simplify condition below */
    test();
    IF( prev_scale <= 0 || GT_32( L_shr( prev_scale, sub( sc_factor, 1 ) /*Q30 -> Q31*/ ), scale /*Q31*/ ) ) /* Since the sc_factor is the log2 of sc_factor in float, we apply it using L_shr */
#else
    test();
    IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ) /*Q30 -> Q31*/, scale /*Q31*/ ) )
#endif
    {
        scale_step = 16384;
        move16();                       /* Q14 */
@@ -6045,16 +6038,12 @@ void non_linearity_ivas_fx(
        move32(); /* Q31; 0.67 in Q31 */
    }

#ifdef NONBE_1328_FIX_NON_LINEARITY
    /* if ( element_mode > EVS_MONO ) */                                          /* element mode is not needed because the function is duplicated for IVAS */
    sc_factor = s_max( sub( 12, norm_s( add( sub( j, length_half ), 1 ) ) ), 0 ); /* allowed intra frame jump is smaller */
    sc_factor = s_max( sc_factor, 1 );                                            /* Note: The sc_factor is the log2 of the sc_factor in the float code to simplify condition below */

    test();
    IF( prev_scale <= 0 || GT_32( L_shr( prev_scale, sub( sc_factor, 1 ) /*Q30 -> Q31*/ ), scale /*Q31*/ ) ) /* Since the sc_factor is the log2 of sc_factor in float, we apply it using L_shr */
#else
    IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ), scale ) )
#endif
    {
        scale_step = 16384;
        move16();                       /*Q14 */
+0 −2
Original line number Diff line number Diff line
@@ -4254,10 +4254,8 @@ void init_igf_dec(
    hIGFDec->flag_sparse = &hIGFDec->flag_sparseBuf[0];
    hIGFDec->infoTCXNoise_ptr = &hIGFDec->infoTCXNoise_evs[0];
    hIGFDec->virtualSpec_fx = &hIGFDec->virtualSpec[0];
#ifdef FIX_1385_INIT_IGF_STOP_FREQ
    hIGFDec->infoIGFStopFreq = 0;
    move16();
#endif

    return;
}
+0 −2
Original line number Diff line number Diff line
@@ -1589,10 +1589,8 @@ ivas_error ivas_init_decoder_front(
    move32();
    st_ivas->mc_mode = MC_MODE_NONE;
    move32();
#ifdef FIX_1384_MSAN_ivas_spar_dec_open
    st_ivas->sid_format = SID_FORMAT_NONE;
    move16();
#endif
    st_ivas->sba_dirac_stereo_flag = 0;
    move16();

+9 −104
Original line number Diff line number Diff line
@@ -349,23 +349,8 @@ void stereo_tcx_core_dec_fx(
        {
            Word16 tcx_lpc_cdk;

#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
            tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type );
            move16();
#else
            test();
            test();
            IF( bfi && st->use_partial_copy && EQ_16( st->rf_frame_type, RF_TCXFD ) )
            {
                tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC ); /* Q0 */
                move16();
            }
            ELSE
            {
                tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); /* Q0 */
                move16();
            }
#endif

            Copy( st->lsf_old_fx, &lsf_fx[0], M ); /* Q2.56 */
            Copy( st->lsp_old_fx, &lsp_fx[0], M ); /* Q15 */
@@ -490,14 +475,6 @@ void stereo_tcx_core_dec_fx(
        E_LPC_f_lsp_a_conversion( st->lsp_old_fx, st->old_Aq_12_8_fx, M );
    }

#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    test();
    if ( st->enablePlcWaveadjust && bfi )
    {
        st->hPlcInfo->nbLostCmpt = add( st->hPlcInfo->nbLostCmpt, 1 ); /* Q0 */
        move16();
    }
#endif
    /*--------------------------------------------------------------------------------*
     * TD-TCX concealment
     *--------------------------------------------------------------------------------*/
@@ -661,38 +638,6 @@ void stereo_tcx_core_dec_fx(
    test();
    IF( EQ_16( st->core, TCX_10_CORE ) || EQ_16( st->core, TCX_20_CORE ) )
    {
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
        test();
        test();
        IF( st->enablePlcWaveadjust ||                 /* bfi      */
            ( GE_32( st->last_total_brate, HQ_48k ) && /* recovery */
              EQ_16( st->last_codec_mode, MODE2 ) ) )
        {
            IF( st->hTonalMDCTConc->q_lastPcmOut != 0 )
            {
                Scale_sig( st->hTonalMDCTConc->secondLastPcmOut, shr( hTcxDec->L_frameTCX, 1 ), negate( st->hTonalMDCTConc->q_lastPcmOut ) );
                Scale_sig( st->hTonalMDCTConc->lastPcmOut, hTcxDec->L_frameTCX, negate( st->hTonalMDCTConc->q_lastPcmOut ) );
                st->hTonalMDCTConc->q_lastPcmOut = 0;
                move16();
            }
            /* waveform adjustment */
            concealment_signal_tuning_fx( st, bfi, synthFB_fx, st->last_core_bfi );

            test();
            test();
            test();
            IF( ( bfi || st->prev_bfi ) && st->hPlcInfo->Pitch_fx && EQ_16( st->hPlcInfo->concealment_method, TCX_NONTONAL ) )
            {
                lerp( synthFB_fx, synth_fx, st->L_frame, hTcxDec->L_frameTCX );

                if ( !bfi && st->prev_bfi )
                {
                    st->hPlcInfo->Pitch_fx = 0;
                    move16();
                }
            }
        }
#endif
        IF( !bfi && st->hTonalMDCTConc != NULL )
        {
#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE
@@ -867,13 +812,6 @@ void stereo_tcx_core_dec_fx(

    IF( !bfi )
    {
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
        if ( st->enablePlcWaveadjust )
        {
            st->hPlcInfo->nbLostCmpt = 0;
            move16();
        }
#endif
        IF( param[1 + NOISE_FILL_RANGES] != 0 )
        {
            Word32 tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/
@@ -1054,12 +992,7 @@ static void dec_prm_tcx_ivas_fx(
    getTCXMode_ivas_fx( st, st, 0 /* <- MCT_flag */ );

    /* last_core for error concealment */
#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
    IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
#else
    test();
    IF( !st->use_partial_copy && NE_16( st->element_mode, IVAS_CPE_MDCT ) )
#endif
    {
        st->last_core_from_bs = get_next_indice_fx( st, 1 ); /* Store decoder memory of last_core    Q0*/
        move16();
@@ -1104,10 +1037,6 @@ static void dec_prm_tcx_ivas_fx(
        }
    }

#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    IF( !st->use_partial_copy )
    {
#endif
    IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
    {
        getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st );
@@ -1120,9 +1049,6 @@ static void dec_prm_tcx_ivas_fx(
        st->dec_glr_idx = -1;
        move16();
    }
#ifndef FIX_1384_MSAN_stereo_tcx_core_enc
    }
#endif

    /*--------------------------------------------------------------------------------*
     * LPC parameters
@@ -1137,27 +1063,8 @@ static void dec_prm_tcx_ivas_fx(
     * TCX20/10 parameters
     *--------------------------------------------------------------------------------*/

#ifdef FIX_1384_MSAN_stereo_tcx_core_enc
    getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );

    IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) )
    {
        st->BER_detect = 1;
        move16();
        st->next_bit_pos = add( start_bit_pos, sub( *total_nbbits, bitsRead[0] ) ); /* Q0 */
        move16();
    }

    bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */
    move16();
#else
    IF( st->use_partial_copy == 0 )
    {
    getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 );
    }

    IF( !st->use_partial_copy )
    {
    IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) )
    {
        st->BER_detect = 1;
@@ -1168,8 +1075,6 @@ static void dec_prm_tcx_ivas_fx(

    bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */
    move16();
    }
#endif

    return;
}
Loading