Commit 8906317e authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept FIX_998_UNUSED_FUNCTION

parent 8a6654bb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@
/* #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF   */           /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */
#define FIX_1009_ISM_NONDIEGETIC_PANNING                /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan      */
#define NONBE_FIX_1012_1013_JBM_FLUSH_BUFFER                  /* FhG: issues #1012, 1013: JBM flush function uses wrong output buffer */
#define FIX_998_UNUSED_FUNCTION                         /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ 
#define NONBE_FIX_1014_1015_1016_OSBA_JBM_STEREO              /* FhG: issues #1014, #1015, #1016: fix tc buffer info update in the discrete ism renderer */
#define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING       /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */
#define NONBE_FIX_1006_PAST_DMX_NRG_ERROR               /* Eri/FhG: Issue 1006: Bug fix in ivas_stereo_dft_dec not replicated in ivas_stereo_dft_dec_dmx */
+0 −82
Original line number Diff line number Diff line
@@ -2752,42 +2752,6 @@ void ivas_dirac_dec_render_sf_fx(
        {
            masa_band_mapping = st_ivas->hMasa->data.band_mapping;
        }
#ifndef FIX_998_UNUSED_FUNCTION
        test();
        test();
        IF( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && EQ_16( st_ivas->hCombinedOrientationData->shd_rot_max_order, 1 ) )
        {
            ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hVBAPdata,
                                                             masa_band_mapping,
                                                             st_ivas->hMasaIsmData,
                                                             azimuth,
                                                             elevation,
                                                             md_idx,
                                                             surCohRatio_fx,
                                                             surCohRatio_q_fx,
                                                             st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                             p_Rmat_fx,
                                                             hodirac_flag );
        }
        ELSE
        {
            ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hVBAPdata,
                                                             masa_band_mapping,
                                                             st_ivas->hMasaIsmData,
                                                             azimuth,
                                                             elevation,
                                                             md_idx,
                                                             surCohRatio_fx,
                                                             surCohRatio_q_fx,
                                                             0,
                                                             NULL,
                                                             hodirac_flag );
        }
#else
        ivas_dirac_dec_compute_directional_responses_fx( hSpatParamRendCom,
                                                         hDirACRend,
                                                         st_ivas->hVBAPdata,
@@ -2800,7 +2764,6 @@ void ivas_dirac_dec_render_sf_fx(
                                                         surCohRatio_q_fx,
                                                         hodirac_flag );

#endif
    }

    test();
@@ -3316,50 +3279,6 @@ void ivas_dirac_dec_render_sf_fx(
            move16();
        }

#ifndef FIX_998_UNUSED_FUNCTION
        test();
        test();
        IF( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order > 0 )
        {
            ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                             DirAC_mem.reference_power_q,
                                                             p_onset_filter_fx,
                                                             azimuth,
                                                             elevation,
                                                             hSpatParamRendCom->diffuseness_vector_fx[md_idx],
                                                             hSpatParamRendCom->q_diffuseness_vector,
                                                             hSpatParamRendCom,
                                                             hDirACRend,
                                                             st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                             p_Rmat_fx,
                                                             st_ivas->hVBAPdata,
                                                             hDirACRend->hOutSetup,
                                                             nchan_transport,
                                                             md_idx,
                                                             hodirac_flag,
                                                             hDirAC->hConfig->dec_param_estim );
        }
        ELSE
        {
            ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                             DirAC_mem.reference_power_q,
                                                             p_onset_filter_fx,
                                                             azimuth,
                                                             elevation,
                                                             hSpatParamRendCom->diffuseness_vector_fx[md_idx],
                                                             hSpatParamRendCom->q_diffuseness_vector,
                                                             hSpatParamRendCom,
                                                             hDirACRend,
                                                             0,
                                                             0,
                                                             st_ivas->hVBAPdata,
                                                             hDirACRend->hOutSetup,
                                                             nchan_transport,
                                                             md_idx,
                                                             hodirac_flag,
                                                             hDirAC->hConfig->dec_param_estim );
        }
#else
        ivas_dirac_dec_output_synthesis_process_slot_fx( reference_power_fx,
                                                         DirAC_mem.reference_power_q,
                                                         p_onset_filter_fx,
@@ -3376,7 +3295,6 @@ void ivas_dirac_dec_render_sf_fx(
                                                         hodirac_flag,
                                                         hDirAC->hConfig->dec_param_estim );

#endif

        IF( hDirAC->hConfig->dec_param_estim )
        {
+0 −317
Original line number Diff line number Diff line
@@ -650,10 +650,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx(
    Word16 q_diffuseness,
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle         */
    DIRAC_REND_HANDLE hDirACRend,                         /* i/o: DirAC renderer handle                       */
#ifndef FIX_998_UNUSED_FUNCTION
    const Word16 sh_rot_max_order,
    const Word32 *p_Rmat, /* i  : rotation matrix             Q30*/
#endif
    const VBAP_HANDLE hVBAPdata,       /* i  : VBAP structure              */
    const IVAS_OUTPUT_SETUP hOutSetup, /* i  : output setup structure      */
    const Word16 nchan_transport,      /* i  : number of transport channels*/
@@ -707,10 +703,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx(
                                                         md_idx,
                                                         NULL,
                                                         0,
#ifndef FIX_998_UNUSED_FUNCTION
                                                         2,
                                                         p_Rmat,
#endif
                                                         hodirac_flag );
        {

@@ -781,10 +773,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx(
                                                         md_idx,
                                                         NULL,
                                                         0,
#ifndef FIX_998_UNUSED_FUNCTION
                                                         sh_rot_max_order,
                                                         p_Rmat,
#endif
                                                         hodirac_flag );

        {
@@ -2818,291 +2806,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx(
    return;
}

#ifndef FIX_998_UNUSED_FUNCTION

/*-------------------------------------------------------------------------
 * ivas_dirac_dec_get_response_split_order()
 *
 * calculate reponse, 1 degree resolution
 *------------------------------------------------------------------------*/

static void ivas_dirac_dec_get_response_split_order_fx(
    const Word16 azimuth,   /*q0*/
    const Word16 elevation, /*q0*/
    Word32 *response,       /*q_response*/
    const Word16 shd_rot_max_order,
    const Word32 *p_Rmat /* Q30 */,
    Word16 *q_response )
{
    Word16 index_azimuth, index_elevation;
    Word16 el, e, az;
    Word32 cos_1, cos_2, sin_1, cos_az[3];
    Word32 sin_az[3];
    Word32 f, c;
    Word16 l, m;
    Word16 b, b1, b_2, b1_2, a;
    Word32 dv_0, dv_1, dv_2, dv_r_0, dv_r_1, dv_r_2;
    Word32 w;
    Word16 tmp;
    Word32 temp;
    Word16 exp;

    push_wmops( "ivas_dirac_dec_get_response_split_order" );

    /* Corner case for handling crash in idiv1616 when numerator is 0 */
    IF( EQ_16( azimuth, -180 ) )
    {
        tmp = 0;
        move16();
    }
    ELSE
    {
        tmp = idiv1616( add( azimuth, 180 ), 360 );
    }
    index_azimuth = sub( add( azimuth, 180 ), i_mult( tmp, 360 ) ); // index_azimuth = (azimuth + 180) % 360
    index_elevation = add( elevation, 90 );

    IF( GT_16( index_elevation, 90 ) )
    {
        e = -ONE_IN_Q14; /*-1 in Q14*/
        move16();
        el = sub( 180, index_elevation );
    }
    ELSE
    {
        e = ONE_IN_Q14; /*1 in Q14*/
        move16();
        el = index_elevation;
        move16();
    }

    IF( GT_16( index_azimuth, 180 ) )
    {
        az = sub( 360, index_azimuth );
        f = -ONE_IN_Q30; /*-1 Q30*/
        move32();
    }
    ELSE
    {
        az = index_azimuth;
        move16();
        f = ONE_IN_Q30; /*1 Q30*/
        move32();
    }

    // dirac_gains_trg_term_int Q30
    cos_1 = L_shr( dirac_gains_trg_term_int[az][0], 1 );     // Q29
    cos_2 = L_shl( Mpy_32_32( cos_1, cos_1 ), 2 );           // Q29
    sin_1 = Mpy_32_32( f, dirac_gains_trg_term_int[az][1] ); // Q29

    cos_az[0] = cos_1; // Q29
    move32();
    cos_az[1] = L_shl( L_sub( Mpy_32_32( TWO_IN_Q29, cos_2 ), ONE_IN_Q27 ), 2 ); // Q29
    move32();
    cos_az[2] = L_sub( L_shl( Mpy_32_32( Mpy_32_32( TWO_IN_Q29, cos_1 ), cos_az[1] ), 4 ), cos_az[0] ); // Q29
    move32();

    sin_az[0] = sin_1; // Q29
    move32();
    sin_az[1] = L_shl( Mpy_32_32( Mpy_32_32( sin_1, TWO_IN_Q29 ), cos_1 ), 4 ); // Q29
    move32();
    sin_az[2] = L_shl( Mpy_32_32( sin_1, L_sub( Mpy_32_32( FOUR_IN_Q28, cos_2 ), ONE_IN_Q26 ) ), 5 ); // Q29
    move32();

    response[0] = ONE_IN_Q29;
    move32();

    FOR( l = 1; l <= shd_rot_max_order; l++ )
    {
        b_2 = i_mult( l, l );
        b1_2 = add( b_2, i_mult( 2, l ) );
        FOR( m = 0; m < l; m += 2 )
        {
            b = add( b_2, m );
            a = dirac_gains_P_idx[b];
            move16();

            c = Mpy_32_32( Mpy_32_32( SQRT2_FIXED, dirac_gains_norm_term_int[a] ), dirac_gains_Pnm_int[el][a] ); // Q25

            response[b] = L_shl( Mpy_32_32( c, sin_az[l - m - 1] ), 6 ); // Q29
            move32();

            b1 = sub( b1_2, m );
            response[b1] = L_shl( Mpy_32_32( c, cos_az[l - m - 1] ), 6 ); // Q29
            move32();
        }

        FOR( m = 1; m < l; m += 2 )
        {
            b = add( b_2, m );
            a = dirac_gains_P_idx[b];
            move16();

            c = Mpy_32_32( Mpy_32_32( SQRT2_FIXED, dirac_gains_norm_term_int[a] ), dirac_gains_Pnm_int[el][a] ); // Q25
            c = Mpy_32_16_1( c, e );                                                                             // Q24

            response[b] = L_shl( Mpy_32_32( c, sin_az[l - m - 1] ), 7 ); // Q29
            move32();

            b1 = sub( b1_2, m );
            response[b1] = L_shl( Mpy_32_32( c, cos_az[l - m - 1] ), 7 ); // Q29
            move32();
        }

        b = add( b_2, l );
        a = dirac_gains_P_idx[b];
        move16();

        c = L_shl( Mpy_32_32( dirac_gains_norm_term_int[a], dirac_gains_Pnm_int[el][a] ), 3 ); // Q29
        IF( EQ_16( l % 2, 1 ) )
        {
            c = L_shl( Mpy_32_16_1( c, e ), 1 ); // Q29
        }

        response[b] = c; // Q29
        move32();
    }

    /*Conversion spherical to cartesian coordinates*/
    w = L_negate( dirac_gains_trg_term_int[el][1] );                      // Q30
    dv_0 = Mpy_32_32( w, cos_1 );                                         // Q28
    dv_1 = Mpy_32_32( w, sin_1 );                                         // Q28
    dv_2 = L_shr( Mpy_32_16_1( dirac_gains_trg_term_int[el][0], e ), 1 ); // Q28

    /*Rotation mtx multiplication*/
    dv_r_0 = Madd_32_32( Madd_32_32( Mpy_32_32( L_shr( p_Rmat[0], Q1 ), dv_0 ), L_shr( p_Rmat[1], Q1 ), dv_1 ), L_shr( p_Rmat[2], Q1 ), dv_2 ); // Q26
    dv_r_1 = Madd_32_32( Madd_32_32( Mpy_32_32( L_shr( p_Rmat[3], Q1 ), dv_0 ), L_shr( p_Rmat[4], Q1 ), dv_1 ), L_shr( p_Rmat[5], Q1 ), dv_2 ); // Q26
    dv_r_2 = Madd_32_32( Madd_32_32( Mpy_32_32( L_shr( p_Rmat[6], Q1 ), dv_0 ), L_shr( p_Rmat[7], Q1 ), dv_1 ), L_shr( p_Rmat[8], Q1 ), dv_2 ); // Q26

    tmp = BASOP_util_atan2( dv_r_1, dv_r_0, 0 );            // Q13
    index_azimuth = shr( mult( tmp, _180_OVER_PI_Q9 ), 7 ); // Q0;
    IF( EQ_16( index_azimuth, -180 ) )
    {
        tmp = 0;
        move16();
    }
    ELSE
    {
        tmp = idiv1616( add( index_azimuth, 180 ), 360 );
    }
    index_azimuth = sub( add( index_azimuth, 180 ), i_mult( tmp, 360 ) ); // index_azimuth = (index_azimuth + 180) % 360

    temp = L_add( Mpy_32_32( dv_r_0, dv_r_0 ), Mpy_32_32( dv_r_1, dv_r_1 ) ); // Q21
    exp = sub( 31, Q21 );
    temp = Sqrt32( temp, &exp );

    tmp = BASOP_util_atan2( dv_r_2, temp, sub( sub( 31, Q26 ), exp ) ); // Q13
    index_elevation = shr( mult( tmp, _180_OVER_PI_Q9 ), Q7 );          // Q0
    index_elevation = add( index_elevation, 90 );

    IF( GT_16( index_elevation, 90 ) )
    {
        e = -ONE_IN_Q14; /*-1 Q14*/
        move16();
        el = sub( 180, index_elevation );
    }
    ELSE
    {
        e = ONE_IN_Q14; /*1 Q14*/
        move16();
        el = index_elevation;
        move16();
    }

    IF( GT_16( index_azimuth, 180 ) )
    {
        az = sub( 360, index_azimuth );
        f = -ONE_IN_Q30; /*-1 Q30*/
        move32();
    }
    ELSE
    {
        az = index_azimuth;
        move16();
        f = ONE_IN_Q30; /*1 Q30*/
        move32();
    }

    // dirac_gains_trg_term_int Q30
    cos_1 = L_shr( dirac_gains_trg_term_int[az][0], 1 );     // Q29
    cos_2 = L_shl( Mpy_32_32( cos_1, cos_1 ), 2 );           // Q29
    sin_1 = Mpy_32_32( f, dirac_gains_trg_term_int[az][1] ); // Q29

    cos_az[0] = cos_1; // Q29
    move32();
    cos_az[1] = L_shl( L_sub( Mpy_32_32( TWO_IN_Q29, cos_2 ), ONE_IN_Q27 ), 2 ); // Q29
    move32();
    cos_az[2] = L_sub( L_shl( Mpy_32_32( Mpy_32_32( TWO_IN_Q29, cos_1 ), cos_az[1] ), 4 ), cos_az[0] ); // Q29
    move32();

    sin_az[0] = sin_1; // Q29
    move32();
    sin_az[1] = L_shl( Mpy_32_32( Mpy_32_32( sin_1, TWO_IN_Q29 ), cos_1 ), 4 ); // Q29
    move32();
    sin_az[2] = L_shl( Mpy_32_32( sin_1, L_sub( Mpy_32_32( FOUR_IN_Q28, cos_2 ), ONE_IN_Q26 ) ), 5 ); // Q29
    move32();

    FOR( l = shd_rot_max_order + 1; l <= 3; l++ )
    {
        b_2 = i_mult( l, l );
        b1_2 = add( b_2, i_mult( 2, l ) );

        FOR( m = 0; m < l; m += 2 )
        {
            b = add( b_2, m );
            a = dirac_gains_P_idx[b];
            move16();

            c = Mpy_32_32( Mpy_32_32( SQRT2_FIXED, dirac_gains_norm_term_int[a] ), dirac_gains_Pnm_int[el][a] ); // Q25

            response[b] = L_shl( Mpy_32_32( c, sin_az[l - m - 1] ), 6 ); // Q29
            move32();

            b1 = sub( b1_2, m );
            response[b1] = L_shl( Mpy_32_32( c, cos_az[l - m - 1] ), 6 ); // Q29
            move32();
        }

        FOR( m = 1; m < l; m += 2 )
        {
            b = add( b_2, m );
            a = dirac_gains_P_idx[b];
            move16();

            c = Mpy_32_32( Mpy_32_32( SQRT2_FIXED, dirac_gains_norm_term_int[a] ), dirac_gains_Pnm_int[el][a] ); // Q25
            c = Mpy_32_16_1( c, e );                                                                             // Q24

            response[b] = L_shl( Mpy_32_32( c, sin_az[l - m - 1] ), 7 ); // Q29
            move32();

            b1 = sub( b1_2, m );
            response[b1] = L_shl( Mpy_32_32( c, cos_az[l - m - 1] ), 7 ); // Q29
            move32();
        }

        b = add( b_2, l );
        a = dirac_gains_P_idx[b];
        move16();

        c = L_shl( Mpy_32_32( dirac_gains_norm_term_int[a], dirac_gains_Pnm_int[el][a] ), 3 ); // Q29

        IF( EQ_16( l % 2, 1 ) )
        {
            c = L_shl( Mpy_32_16_1( c, e ), 1 ); // Q29
        }

        response[b] = c; // Q29
        move32();
    }

    *q_response = Q29;
    move16();

    pop_wmops();

    return;
}
#endif

/*-------------------------------------------------------------------------
 * ivas_dirac_dec_compute_directional_responses()
@@ -3121,10 +2824,6 @@ void ivas_dirac_dec_compute_directional_responses_fx(
    const Word16 md_idx,
    const Word32 *surCohRatio_fx, /*i:Q_surCohRatio*/
    Word16 Q_surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
    const Word16 shd_rot_max_order, /* i  : split-order rotation method    */
    const Word32 *p_Rmat,           /* i  : rotation matrix             Q30*/
#endif
    const Word16 hodirac_flag /* i  : flag to indicate HO-DirAC mode */
)
{
@@ -3238,19 +2937,6 @@ void ivas_dirac_dec_compute_directional_responses_fx(
                exp_direct_response_dir2 = 0;
                move16();

#ifndef FIX_998_UNUSED_FUNCTION
                IF( p_Rmat != 0 )
                {
                    ivas_dirac_dec_get_response_split_order_fx( azimuth[k], elevation[k], direct_response_hoa_fx, shd_rot_max_order, p_Rmat, &Q_direct_response_hoa );

                    IF( hodirac_flag )
                    {
                        ivas_dirac_dec_get_response_split_order_fx( azimuth2[k], elevation2[k], direct_response_dir2_fx, shd_rot_max_order, p_Rmat, &Q_direct_response_dir2 );
                    }
                }
                ELSE
                {
#endif
#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx
                    ivas_dirac_dec_get_response_fx_29( azimuth[k], elevation[k], direct_response_hoa_fx, hDirACRend->hOutSetup.ambisonics_order );
#else
@@ -3265,9 +2951,6 @@ void ivas_dirac_dec_compute_directional_responses_fx(
                    ivas_dirac_dec_get_response_fx( azimuth2[k], elevation2[k], direct_response_dir2_fx, hDirACRend->hOutSetup.ambisonics_order, Q_direct_response_dir2 );
#endif
                    }
#ifndef FIX_998_UNUSED_FUNCTION
                }
#endif

                test();
                test();
+0 −8
Original line number Diff line number Diff line
@@ -4239,10 +4239,6 @@ static void ivas_masa_ext_dirac_render_sf_fx(
                                                     md_idx,
                                                     surCohRatio_fx,
                                                     Q_surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
                                                     0,
                                                     NULL,
#endif
                                                     0 );

    Word16 proto_direct_buffer_f_temp_q[60];
@@ -4621,10 +4617,6 @@ static void ivas_masa_ext_dirac_render_sf_fx(
                                                         hSpatParamRendCom->q_diffuseness_vector,
                                                         hSpatParamRendCom,
                                                         hDirACRend,
#ifndef FIX_998_UNUSED_FUNCTION
                                                         0,
                                                         0,
#endif
                                                         hMasaExtRend->hVBAPdata,
                                                         hDirACRend->hOutSetup,
                                                         nchan_transport,
+0 −8
Original line number Diff line number Diff line
@@ -472,10 +472,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx(
  Word16 q_diffuseness,
  SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom, /* i/o: common spatial renderer data handle         */
  DIRAC_REND_HANDLE hDirACRend,                         /* i/o: DirAC renderer handle                       */
#ifndef FIX_998_UNUSED_FUNCTION
  const Word16 sh_rot_max_order,
  const Word32 *p_Rmat,               /* i  : rotation matrix             */
#endif
  const VBAP_HANDLE hVBAPdata,       /* i  : VBAP structure              */
  const IVAS_OUTPUT_SETUP hOutSetup, /* i  : output setup structure      */
  const Word16 nchan_transport,     /* i  : number of transport channels*/
@@ -547,10 +543,6 @@ void ivas_dirac_dec_compute_directional_responses_fx(
    const Word16 md_idx,
    const Word32 *surCohRatio_fx,
    Word16 Q_surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
    const Word16 shd_rot_max_order,                             /* i  : split-order rotation method                                    */
    const Word32 *p_Rmat,                                       /* i  : rotation matrix                                                */
#endif
    const Word16 hodirac_flag                                   /* i  : flag to indicate HO-DirAC mode                                 */
);