Commit 38ab79b1 authored by vaclav's avatar vaclav
Browse files

HARM_CORE_SW, decoder step 2 (core_switching_pre_dec_fx)

parent 400ca96d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@
#define CLEANUP_ACELP_ENC                               /* VA: basop issue 2304: Remove duplicated code in excitation encoding in the ACELP core */
#define CLEANUP_VBR_CAM_ENC                             /* VA: basop issue 2299: Remove unused core-encoder VBR and CAM code */

#define HARM_CORE_SW
#define HARM_CORE_SW                                    /* VA: basop issue 2314: Remove duplicated code in the core switching */

/* #################### End BE switches ################################## */

+2 −2
Original line number Diff line number Diff line
@@ -7815,7 +7815,7 @@ void bw_switching_pre_proc_fx(
);
ivas_error core_switching_pre_dec_fx(
#ifdef HARM_CORE_SWaa
#ifdef HARM_CORE_SW
    Decoder_State *st,                /* i/o: decoder state structure      */
    const Word16 output_frame,        /* i  : frame length                 */
    const Word32 last_core_brate_st0, /* i  : channel 0 last core bitrate  */
@@ -10434,7 +10434,7 @@ void wtda_fx32(
    const Word16 L           /* i  : length                              */
);
#ifndef HARM_CORE_SWaa
#ifndef HARM_CORE_SW
ivas_error core_switching_pre_dec_ivas_fx(
    Decoder_State *st,                /* i/o: decoder state structure      */
    const Word16 output_frame,        /* i  : frame length                 */
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ ivas_error amr_wb_dec_fx(
    }

    /* Updates in case of EVS -> AMR-WB IO switching */
#ifdef HARM_CORE_SWaa
#ifdef HARM_CORE_SW
    IF( NE_32( ( error = core_switching_pre_dec_fx( st_fx, output_frame, -1, 1, EVS_MONO, EVS_MONO, -1, &tmp16, &tmp16 ) ), IVAS_ERR_OK ) )
#else
    IF( NE_32( ( error = core_switching_pre_dec_fx( st_fx, output_frame ) ), IVAS_ERR_OK ) )
+34 −11
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ void bw_switching_pre_proc_fx(
    return;
}

#ifndef HARM_CORE_SWaa
#ifndef HARM_CORE_SW
/*---------------------------------------------------------------------*
 * core_switching_pre_dec_fx()
 *
@@ -2217,7 +2217,7 @@ static void smoothTransitionDtxToTcx_fx(
 * Preprocessing/preparation for ACELP/HQ core switching
 *---------------------------------------------------------------------*/

#ifdef HARM_CORE_SWaa
#ifdef HARM_CORE_SW
ivas_error core_switching_pre_dec_fx(
#else
ivas_error core_switching_pre_dec_ivas_fx(
@@ -2228,7 +2228,7 @@ ivas_error core_switching_pre_dec_ivas_fx(
    const Word16 nchan_out,           /* i  : number of output channels    */
    const Word16 last_element_mode,   /* i  : last_element_mode            */
    const Word32 last_element_brate,  /* i  : last element bitrate         */
#ifdef HARM_CORE_SWaa
#ifdef HARM_CORE_SW
    const Word16 Q_old_synthFB,
#else
    Word16 Q_old_synthFB,
@@ -2324,11 +2324,7 @@ ivas_error core_switching_pre_dec_ivas_fx(
        move16();

        test();
#ifdef HARM_CORE_SWaa // !!!!!
        IF( GE_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL )
#else
        IF( GT_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL )
#endif
        {
            hf_synth_reset_fx( st->hBWE_zero );
#ifdef HARM_CORE_SW
@@ -2337,6 +2333,16 @@ ivas_error core_switching_pre_dec_ivas_fx(
            set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 );
        }

#ifdef HARM_CORE_SW // temp hack to keep EVS BE - see basop issue 2313
        IF( st->element_mode == EVS_MONO )
        {
            IF( st->output_Fs == 16000 && st->hBWE_zero != NULL )
            {
                hf_synth_reset_fx( st->hBWE_zero );
            }
        }

#endif
        IF( hBWE_FD != NULL )
        {
            set16_fx( hBWE_FD->old_syn_12k8_16k_fx, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_NS ) );
@@ -2571,6 +2577,10 @@ ivas_error core_switching_pre_dec_ivas_fx(
        ELSE
        {
            set16_fx( st->mem_syn_clas_estim_fx, 0, L_SYN_MEM_CLAS_ESTIM );
#ifdef HARM_CORE_SW
            st->classifier_Q_mem_syn = 0;
            move16();
#endif
        }
    }

@@ -2763,11 +2773,7 @@ ivas_error core_switching_pre_dec_ivas_fx(
        }

        test();
#ifdef HARM_CORE_SWaa // !!!!!
        IF( GE_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL )
#else
        IF( GT_32( st->output_Fs, 16000 ) && st->hBWE_zero != NULL )
#endif
        {
            hf_synth_reset_fx( st->hBWE_zero );
#ifdef HARM_CORE_SW
@@ -2776,6 +2782,16 @@ ivas_error core_switching_pre_dec_ivas_fx(
            set16_fx( st->hBWE_zero->mem_hp400_fx, 0, 6 );
        }

#ifdef HARM_CORE_SW // temp hack to keep EVS BE - see basop issue 2313
        IF( st->element_mode == EVS_MONO )
        {
            IF( st->output_Fs == 16000 && st->hBWE_zero != NULL )
            {
                hf_synth_reset_fx( st->hBWE_zero );
            }
        }

#endif
        IF( hBWE_FD != NULL )
        {
            set16_fx( hBWE_FD->old_syn_12k8_16k_fx, 0, NS2SA_FX2( 16000, DELAY_FD_BWE_ENC_NS ) );
@@ -2915,8 +2931,15 @@ ivas_error core_switching_pre_dec_ivas_fx(
        }
        ELSE
        {
#ifdef HARM_CORE_SW
            set16_fx( hHQ_core->old_out_fx, 0, output_frame );
            hHQ_core->Q_old_wtda_LB = 15;
            hHQ_core->Q_old_wtda = 15;
            move16();
#else
            set16_fx( hHQ_core->old_out_fx, 0, output_frame );
            set32_fx( hHQ_core->old_out_LB_fx32, 0, L_FRAME16k );
#endif
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ ivas_error evs_dec_fx(
         * Preprocessing (preparing) for ACELP/HQ core switching
         *---------------------------------------------------------------------*/

#ifdef HARM_CORE_SWaa
#ifdef HARM_CORE_SW
        IF( ( error = core_switching_pre_dec_fx( st_fx, output_frame, -1, 1, EVS_MONO, EVS_MONO, -1, &tmp16, &tmp16 ) ) != IVAS_ERR_OK )
#else
        IF( ( error = core_switching_pre_dec_fx( st_fx, output_frame ) ) != IVAS_ERR_OK )
Loading