Commit c5040f95 authored by vaclav's avatar vaclav
Browse files

FIX_1563_FIX_STEREO_SW to encoder

parent d0ff8768
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2010,7 +2010,7 @@ void stereo_switching_dec_fx(
            sts[1]->hTcxDec->Q_old_syn_Overl = sts[0]->hTcxDec->Q_old_syn_Overl;
        }
#ifdef FIX_1563_FIX_STEREO_SW
        ELSE IF( hCPE->element_mode == IVAS_CPE_TD )
        ELSE IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) )
        {
            sts[1]->last_core = ACELP_CORE;
            move16();
+12 −4
Original line number Diff line number Diff line
@@ -515,15 +515,17 @@ ivas_error stereo_memory_enc_fx(
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxEnc\n" ) );
            }

            // st->hTcxEnc->spectrum[0] = st->hTcxEnc->spectrum_long;
            // st->hTcxEnc->spectrum[1] = st->hTcxEnc->spectrum_long + N_TCX10_MAX;
            st->hTcxEnc->spectrum_fx[0] = st->hTcxEnc->spectrum_long_fx;               /* Q31-st->hTcxEnc->spectrum_e[0] */
            st->hTcxEnc->spectrum_fx[1] = st->hTcxEnc->spectrum_long_fx + N_TCX10_MAX; /* Q31-st->hTcxEnc->spectrum_e[1] */
            st->hTcxEnc->spectrum_e[0] = st->hTcxEnc->spectrum_e[1] = 0;
            move16();
            move16();
#ifdef FIX_1563_FIX_STEREO_SW
            set_f( st->hTcxEnc->old_out_fx, 0, L_FRAME32k );
#else
            // set_f( st->hTcxEnc->old_out, 0, L_FRAME32k );
            // set_f( st->hTcxEnc->spectrum_long, 0, N_MAX );
#endif
            set32_fx( st->hTcxEnc->spectrum_long_fx, 0, N_MAX );
            st->hTcxEnc->spectrum_long_e = 0;
            st->hTcxEnc->tfm_mem_fx = 1610612736; /* 0.75 in Q31 */
@@ -557,7 +559,6 @@ ivas_error stereo_memory_enc_fx(
#ifdef DEBUGGING
            hCPE->hStereoMdct->mdct_stereo_mode_cmdl = SMDCT_MS_DECISION;
#endif

            initMdctStereoEncData_fx( hCPE->hStereoMdct, ivas_format, hCPE->element_mode, hCPE->element_brate, hCPE->hCoreCoder[0]->max_bwidth, 0, NULL, 1 );

            test();
@@ -630,6 +631,7 @@ ivas_error stereo_memory_enc_fx(
    return error;
}


/*-------------------------------------------------------------------*
 * Function stereo_switching_enc()
 *
@@ -673,7 +675,6 @@ void stereo_switching_enc_fx(
        Copy32( sts[1]->input32_fx + sub( extract_l( Mpy_32_32( sts[1]->input_Fs, 42949673 /* 1/50 in Q31*/ ) ), sts[1]->encoderLookahead_FB ), sts[1]->input32_fx - sts[1]->encoderLookahead_FB, sts[1]->encoderLookahead_FB ); /* sts[1]->q_inp32 */
    }


    /* TD/MDCT -> DFT stereo switching */
    test();
    IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && NE_16( hCPE->last_element_mode, IVAS_CPE_DFT ) )
@@ -937,6 +938,13 @@ void stereo_switching_enc_fx(
            sts[1]->last_bwidth = sts[0]->last_bwidth; /* Q0 */
            move16();
        }
#ifdef FIX_1563_FIX_STEREO_SW
        ELSE IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) )
        {
            sts[1]->last_core = ACELP_CORE;
            move16();
        }
#endif
    }
    ELSE IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && EQ_16( hCPE->last_element_mode, IVAS_CPE_MDCT ) )
    {