Commit b5c3ae14 authored by Manuel Jander's avatar Manuel Jander
Browse files

Merge remote-tracking branch 'origin' into...

Merge remote-tracking branch 'origin' into 1379-increase-accuracy-of-azimuth-and-elevation-angles-in-masa-metadata-with-dirac-rendering
parents 8a32828a 63bb612b
Loading
Loading
Loading
Loading
Loading
+91 −90
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@
//#define HARM_SCE_INIT
#define DIV32_OPT_NEWTON                               /* FhG: faster 32 by 32 bit division */ 
#define	MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE /* FhG: reduce WMOPS of Cy calculation in ivas_param_mc_param_est_enc_fx() by using 64 Bit addition. Obsoletes IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE. */
#define FIX_1379_MASA_ANGLE_ROUND
#define FIX_1481_HARDCODE_DIV                          /* FhG: hardcode division results in stereo_dmx_evs_init_encoder_fx() */

#define TEST_HR

#endif
+29 −2
Original line number Diff line number Diff line
@@ -2550,7 +2550,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
    DECODER_TC_BUFFER_HANDLE hTcBuffer;
    Word32 output_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES];
    Word32 *p_output_fx[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS];
    Word16 nchan_in, nchan_out;
    Word16 nchan_in, nchan_out, gd_bits, n_chan_inp, i, shift;
    IF( !st_ivas->hDecoderConfig->Opt_tsm )
    {
        return IVAS_ERR_OK;
@@ -2637,17 +2637,44 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
                    /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */
                    set16_fx( st_ivas->hIsmRendererData->interpolator_fx, 32767, hTcBuffer->n_samples_granularity ); // 32767=1.0f in Q15

                    ivas_ism_render_sf_fx( st_ivas, p_output_fx, *nSamplesRendered );
                    ivas_ism_render_sf_fx( st_ivas, p_output_fx, hTcBuffer->n_samples_granularity );

                    st_ivas->hCrendWrapper->p_io_qfactor = &st_ivas->hCrendWrapper->io_qfactor;
                    *st_ivas->hCrendWrapper->p_io_qfactor = 11;
                    move16();

                    shift = MAX_16;
                    move16();
                    n_chan_inp = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe );

                    FOR( i = 0; i < n_chan_inp; i++ )
                    {
                        shift = s_min( shift, L_norm_arr( p_output_fx[i], hTcBuffer->n_samples_granularity ) );
                    }

                    gd_bits = sub( find_guarded_bits_fx( imult1616( hTcBuffer->subframe_nbslots[0], hTcBuffer->n_samples_granularity ) ), shift );

                    *st_ivas->hCrendWrapper->p_io_qfactor = sub( *st_ivas->hCrendWrapper->p_io_qfactor, gd_bits );
                    move16();

                    FOR( i = 0; i < n_chan_inp; i++ )
                    {
                        scale_sig32( p_output_fx[i], hTcBuffer->n_samples_granularity, sub( *st_ivas->hCrendWrapper->p_io_qfactor, Q11 ) ); // Q(*st_ivas->hCrendWrapper->p_io_qfactor)
                    }

                    IF( NE_32( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL,
                                                                         NULL, NULL, st_ivas->hTcBuffer, p_output_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ),
                               IVAS_ERR_OK ) )
                    {
                        return error;
                    }

                    FOR( i = 0; i < n_chan_inp; i++ )
                    {
                        scale_sig32( p_output_fx[i], hTcBuffer->n_samples_granularity, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q(11)
                    }
                    *st_ivas->hCrendWrapper->p_io_qfactor = Q11;
                    move16();
                }
            }
            ELSE
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ void find_tilt_ivas_fx(
    {
        hp_bckr = L_deposit_l( 1 );
    }
    Ltmp = BASOP_Util_Divide3232_Scale_cadence( lp_bckr, hp_bckr, &e_tmp );
    Ltmp = BASOP_Util_Divide3232_Scale_newton( lp_bckr, hp_bckr, &e_tmp );
    Ltmp = Mpy_32_16_r( Ltmp, 3277 /* 0.1f in Q15 */ );
    Ltmp = L_shr_sat( Ltmp, sub( 15, e_tmp ) );
    *bckr_tilt_lt = L_add_sat( Mpy_32_16_r( *bckr_tilt_lt, 29491 /* 0.9f in Q15 */ ), Ltmp ); // Q16
+3 −3
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ static Word16 hf_spectrum_sparseness_fx(
            Word16 l_shift = W_norm( inv_rms_fx );
            inv_rms32_fx = W_extract_h( W_shl( inv_rms_fx, l_shift ) );                                     // Q15+l_shift-32
            Word16 q_rms = sub( add( Q15, l_shift ), 32 );                                                  // q_rms
            inv_rms32_div_fx = BASOP_Util_Divide3232_Scale_cadence( inv_rms32_fx, L_SPEC_HB, &inv_rms32_e ); /* Q31-inv_rms32_e */
            inv_rms32_div_fx = BASOP_Util_Divide3232_Scale_newton( inv_rms32_fx, L_SPEC_HB, &inv_rms32_e ); /* Q31-inv_rms32_e */
            inv_rms32_e = sub( 31, add( sub( Q31, inv_rms32_e ), q_rms ) );
            // inv_rms = 1.0f / (float) sqrtf( inv_rms / L_SPEC_HB );
            inv_rms32_fx = ISqrt32( inv_rms32_div_fx, &inv_rms32_e ); /* Q31-inv_rms32_e */
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ static Word16 ivas_spar_get_activeW_flag_fx(
    }
    ELSE
    {
        L_tmp = BASOP_Util_Divide3232_Scale_cadence( hCovEnc->bb_var_lt_fx[0], side_ch_var, &exp_diff );       // (Q31 - exp_diff)
        L_tmp = BASOP_Util_Divide3232_Scale_newton( hCovEnc->bb_var_lt_fx[0], side_ch_var, &exp_diff );        // (Q31 - exp_diff)
        en_ratio = L_shl_sat( L_tmp, exp_diff );                                                               // Q31
        IF( LT_32( en_ratio, Mpy_32_32( IVAS_SPAR_DYN_ACTIVEW_THRESH_FX, IVAS_SPAR_DYN_ACTIVEW_THRESH_FX ) ) ) // LHS Q31 :: RHS Q31
        {
Loading