Commit 4c0ab9cf authored by multrus's avatar multrus
Browse files

BE improvements on ivas_ism_dec_digest_tc_fx()

parent 1f18fedc
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@
#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 FIX_2648_IVAS_ISM_DEC_DIGEST_TC                 /* FhG: improvements on ivas_ism_dec_digest_tc_fx() */

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

+22 −1
Original line number Diff line number Diff line
@@ -947,13 +947,26 @@ void ivas_ism_dec_digest_tc_fx(
        ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) )
    {
        Word16 i;
#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC
        Word16 output_frame;
#endif

        /* we have a full frame interpolator, adapt it */
        /* for BE testing */
#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC
        output_frame = extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) );
        IF( EQ_16( output_frame, st_ivas->hTcBuffer->n_samples_available ) )
#else
        i = extract_l( Mpy_32_32_r( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) );
        IF( EQ_16( i, st_ivas->hTcBuffer->n_samples_available ) )
#endif
        {
#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC
            Word16 interpolator_length = output_frame;
            move16();
#else
            Word16 interpolator_length = i;
#endif

            test();
            test();
@@ -985,7 +998,11 @@ void ivas_ism_dec_digest_tc_fx(
        }
        ELSE
        {
#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC
            ivas_dec_get_adapted_linear_interpolator_fx( output_frame, st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator_fx );
#else
            ivas_dec_get_adapted_linear_interpolator_fx( extract_l( Mpy_32_32( st_ivas->hDecoderConfig->output_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator_fx );
#endif
            move16();
        }

@@ -1001,13 +1018,17 @@ void ivas_ism_dec_digest_tc_fx(
            {
                Word16 gains_fx[CPE_CHANNELS];

#ifdef FIX_2648_IVAS_ISM_DEC_DIGEST_TC
                ivas_ism_get_stereo_gains_fx( extract_l( L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ) ), extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ) ), &gains_fx[0], &gains_fx[1] ); // gains_fx[]: Q15
#else
                ivas_ism_get_stereo_gains_fx( (Word16) L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ), (Word16) L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ), &gains_fx[0], &gains_fx[1] );
#endif

                st_ivas->hIsmRendererData->gains_fx[i][0] = L_shr( L_deposit_h( gains_fx[0] ), 1 ); // Q31 -> Q30
                move32();
                st_ivas->hIsmRendererData->gains_fx[i][1] = L_shr( L_deposit_h( gains_fx[1] ), 1 ); // Q31 -> Q30
                move32();
                // TODO: Align Q values

                IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) )
                {
                    v_multc_fx( st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_gain_fx, st_ivas->hIsmRendererData->gains_fx[i], CPE_CHANNELS ); // Q30, Q29 --> Q28