Commit 33f37dd4 authored by multrus's avatar multrus
Browse files

merge from main

parents a8bbfad7 f268b61b
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1165,7 +1165,12 @@ static Word16 ivas_calculate_abs_fr_fx(

    FOR( i = 0; i < frame_len; i++ )
    {
#ifdef FIX_BASOP_2642_INCORRECT_IF_THRESHOLD
        test();
        if ( LT_32( ppFilterbank_FRs_s_fx[i], 419430 ) )
#else
        if ( ppFilterbank_FRs_s_fx[i] < 0 )
#endif
        {
            ppFilterbank_FRs_s_fx[i] = 419430; // 0.1 in Q22
            move32();
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@
#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_2502_GENERATE_COMFORT_NOISE_DEC       /* FhG: harmonize generate_comfort_noise_dec_fx() and generate_comfort_noise_dec_ivas_fx() */
#define FIX_BASOP_2650_DEC_PRM_TCX                      /* FhG: Simplify calculation of st->bits_frame_core in dec_prm_tcx(), align function name to float */
#define FIX_2648_IVAS_ISM_DEC_DIGEST_TC                 /* FhG: improvements on ivas_ism_dec_digest_tc_fx() */
#define BE_FIX_BASOP_2543_MISMATCH_REND_OPEN_FX_FL      /* FhG: Aligns implementation of split rendering init loops in IVAS_REND_Open between float and BASOP */

/* #################### End BE switches ################################## */
@@ -98,6 +100,7 @@
#define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH          /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */
#define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP           /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */
#define FIX_BASOP_2635_EFAP_ADD_VERTEX_ELE_ROUND        /* FhG: BASOP #2635: round |elevation| with anint_fx before the 90deg subtraction in add_vertex_fx */
#define FIX_BASOP_2642_INCORRECT_IF_THRESHOLD           /* Dolby: BASOP #2642: incorrect threshold 0.0 used instead of 0.1 in if condition */
#define FIX_BASOP_2639_INCORRECT_ARRAY_INDEX            /* Dolby: BASOP #2639: incorrect array index in ivas_spar_unquant_dtx_indicies */
#define FIX_BASOP_2640_MASA_STEREO_TYPE_ASSERT          /* Nokia: BASOP issue 2640: Fix assert by saturating shift when exponent difference is very large. */
#define FIX_2636_OMASA_INTERFORMAT_BRATE                /* VA: basop issue 2636: Correct condition in function ivas_interformat_brate_fx() */
+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
+36 −18
Original line number Diff line number Diff line
@@ -43,8 +43,12 @@
 * Local prototypes
 *-------------------------------------------------------------*/

#ifdef FIX_BASOP_2650_DEC_PRM_TCX
static void dec_prm_tcx_fx( Decoder_State *st, Word16 param[], Word16 param_lpc[], Word16 *total_nbbits, const Word16 last_element_mode, Word16 *bitsRead );
#else
static void dec_prm_tcx_ivas_fx( Decoder_State *st, Word16 param[], Word16 param_lpc[], Word16 *total_nbbits, const Word16 last_element_mode, Word16 *bitsRead );
static void stereo_tcx_dec_mode_switch_reconf_ivas_fx( Decoder_State *st, const Word16 MCT_flag, const Word16 last_element_mode, Word16 *Q_syn_Overl_TDAC, Word16 *Q_fer_samples, Word16 *Q_syn_Overl, Word16 *Q_syn_Overl_TDACFB, Word16 *Q_syn_OverlFB, Word16 *Q_old_out, Word16 *Q_old_outLB, Word16 *Q_old_Aq_12_8 );
#endif
static void stereo_tcx_dec_mode_switch_reconf_fx( Decoder_State *st, const Word16 MCT_flag, const Word16 last_element_mode, Word16 *Q_syn_Overl_TDAC, Word16 *Q_fer_samples, Word16 *Q_syn_Overl, Word16 *Q_syn_Overl_TDACFB, Word16 *Q_syn_OverlFB, Word16 *Q_old_out, Word16 *Q_old_outLB, Word16 *Q_old_Aq_12_8 );


/*-------------------------------------------------------------*
@@ -167,7 +171,7 @@ void stereo_tcx_init_dec_fx(

        Word16 Q_old_Aq_12_8 = 12;
        move16();
        stereo_tcx_dec_mode_switch_reconf_ivas_fx( st, MCT_flag, last_element_mode,
        stereo_tcx_dec_mode_switch_reconf_fx( st, MCT_flag, last_element_mode,
                                              &st->hTcxDec->Q_syn_Overl_TDAC,
                                              &st->hHQ_core->Q_fer_samples,
                                              &st->hTcxDec->Q_syn_Overl,
@@ -311,7 +315,11 @@ void stereo_tcx_core_dec_fx(
        move16();

        move16();
#ifdef FIX_BASOP_2650_DEC_PRM_TCX
        dec_prm_tcx_fx( st, param, param_lpc, &total_nbbits, last_element_mode, &bitsRead );
#else
        dec_prm_tcx_ivas_fx( st, param, param_lpc, &total_nbbits, last_element_mode, &bitsRead );
#endif
    }
    ELSE
    {
@@ -893,7 +901,7 @@ void stereo_tcx_core_dec_fx(
}


static void stereo_tcx_dec_mode_switch_reconf_ivas_fx(
static void stereo_tcx_dec_mode_switch_reconf_fx(
    Decoder_State *st,              /* i/o: decoder state structure                   */
    const Word16 MCT_flag,          /* i  : hMCT handle allocated (1) or not (0)    Q0*/
    const Word16 last_element_mode, /* i  : element mode of previous frame          Q0*/
@@ -936,7 +944,12 @@ static void stereo_tcx_dec_mode_switch_reconf_ivas_fx(

    return;
}

#ifdef FIX_BASOP_2650_DEC_PRM_TCX
static void dec_prm_tcx_fx(
#else
static void dec_prm_tcx_ivas_fx(
#endif
    Decoder_State *st,              /* i/o: decoder memory state                */
    Word16 param[],                 /* o  : decoded parameters                Q0*/
    Word16 param_lpc[],             /* o  : LPC parameters                    Q0*/
@@ -958,8 +971,13 @@ static void dec_prm_tcx_ivas_fx(
    hm_cfg.indexBuffer = indexBuffer;
    IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) )
    {
#ifdef FIX_BASOP_2650_DEC_PRM_TCX
        st->bits_frame_core = extract_l( L_sub( Mpy_32_32_r( st->total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ), st->next_bit_pos ) ); /* Q0 */
        assert( st->bits_frame_core == (int16_t) ( ( st->total_brate / FRAMES_PER_SEC ) - st->next_bit_pos ) );
#else
        // The value of 1/ FRAMES_PER_SEC shifted left by 19 because taking Q as 15 led to precision loss
        st->bits_frame_core = extract_l( L_sub( L_shr( Mpy_32_16_1( st->total_brate, 10486 ), 4 ), st->next_bit_pos ) ); /* Q0 */
#endif
        move16();
    }
    start_bit_pos = st->next_bit_pos; /* Q0 */
@@ -1004,7 +1022,7 @@ static void dec_prm_tcx_ivas_fx(
        {
            Word16 Q_old_Aq_12_8 = Q12;
            move16();
            stereo_tcx_dec_mode_switch_reconf_ivas_fx( st, 0, last_element_mode, &st->hTcxDec->Q_syn_Overl_TDAC,
            stereo_tcx_dec_mode_switch_reconf_fx( st, 0, last_element_mode, &st->hTcxDec->Q_syn_Overl_TDAC,
                                                  &st->hHQ_core->Q_fer_samples,
                                                  &st->hTcxDec->Q_syn_Overl,
                                                  &st->hTcxDec->Q_syn_Overl_TDACFB,
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static void sync_tcx_mode_fx(
    test();
    test();
    IF( GT_32( prevAccNrg0, Mpy_32_16_1( prevAccNrg1, 1311 /*1/25 in Q15*/ ) ) && GT_32( prevAccNrg1, Mpy_32_16_1( prevAccNrg0, 1311 /*1/25 in Q15*/ ) )      /* 14 dB */
        && GT_32( lastAccNrg0, Mpy_32_16_1( lastAccNrg1, 2048 /*1/12 in Q15*/ ) ) && GT_32( lastAccNrg1, Mpy_32_16_1( lastAccNrg0, 2048 /*1/12 in Q15*/ ) ) ) /* 12 dB */
        && GT_32( lastAccNrg0, Mpy_32_16_1( lastAccNrg1, 2048 /*1/16 in Q15*/ ) ) && GT_32( lastAccNrg1, Mpy_32_16_1( lastAccNrg0, 2048 /*1/16 in Q15*/ ) ) ) /* 12 dB */
    {
        st[0]->hTcxEnc->tcxMode = st[1]->hTcxEnc->tcxMode = s_max( st[0]->hTcxEnc->tcxMode, st[1]->hTcxEnc->tcxMode ); /* synchronize TCX mode of both channels */
        move16();