Commit a1c5c0e3 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_998_UNUSED_FUNCTION

parent b6db33cb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
/*#define SPLIT_REND_WITH_HEAD_ROT  */                  /* Dlb,FhG: Split Rendering contributions 21 and 35 */

#define FIX_998_UNUSED_FUNCTION                         /* FhG: issue 998: delete unused funtion ivas_dirac_dec_get_response_split_order */ 
#define FIX_1009_ISM_NONDIEGETIC_PANNING                /* FhG: issue #1009: use correct object buffer for ISM1 non-diegetic pan      */
#define FIX_1020_AEID_SELECTION_ERRORS                  /* Philips: issue #1020: fix for acoustic environment ID selection errors */
#define FIX_993_REMOVE_SBA_GET_ORDER                    /* VA: issue 993: remove unused function ivas_sba_get_order() */
+0 −73
Original line number Diff line number Diff line
@@ -1840,25 +1840,6 @@ void ivas_dirac_dec_render_sf(
                set_zero( surCohRatio, hSpatParamRendCom->num_freq_bands );
            }
        }
#ifndef FIX_998_UNUSED_FUNCTION

        if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] && st_ivas->hCombinedOrientationData->shd_rot_max_order == 1 )
        {
            ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom,
                                                          hDirACRend,
                                                          st_ivas->hVBAPdata,
                                                          st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping,
                                                          st_ivas->hMasaIsmData,
                                                          azimuth,
                                                          elevation,
                                                          md_idx,
                                                          surCohRatio,
                                                          st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                          p_Rmat,
                                                          hodirac_flag );
        }
        else
        {
        ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom,
                                                      hDirACRend,
                                                      st_ivas->hVBAPdata,
@@ -1868,23 +1849,8 @@ void ivas_dirac_dec_render_sf(
                                                      elevation,
                                                      md_idx,
                                                      surCohRatio,
                                                          0,
                                                          NULL,
                                                      hodirac_flag );
    }
#else
        ivas_dirac_dec_compute_directional_responses( hSpatParamRendCom,
                                                      hDirACRend,
                                                      st_ivas->hVBAPdata,
                                                      st_ivas->hMasa == NULL ? NULL : st_ivas->hMasa->data.band_mapping,
                                                      st_ivas->hMasaIsmData,
                                                      azimuth,
                                                      elevation,
                                                      md_idx,
                                                      surCohRatio,
                                                      hodirac_flag );
#endif
    }

    if ( st_ivas->ivas_format == MASA_ISM_FORMAT && nchan_transport == 2 )
    {
@@ -2213,27 +2179,6 @@ void ivas_dirac_dec_render_sf(
        }

        /*Compute PSDs*/
#ifndef FIX_998_UNUSED_FUNCTION
        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( reference_power,
                                                          p_onset_filter,
                                                          azimuth,
                                                          elevation,
                                                          hSpatParamRendCom->diffuseness_vector[md_idx],
                                                          hSpatParamRendCom,
                                                          hDirACRend,
                                                          st_ivas->hCombinedOrientationData->shd_rot_max_order,
                                                          p_Rmat,
                                                          st_ivas->hVBAPdata,
                                                          hDirACRend->hOutSetup,
                                                          nchan_transport,
                                                          md_idx,
                                                          hodirac_flag,
                                                          hDirAC->hConfig->dec_param_estim );
        }
        else
        {
        ivas_dirac_dec_output_synthesis_process_slot( reference_power,
                                                      p_onset_filter,
                                                      azimuth,
@@ -2241,30 +2186,12 @@ void ivas_dirac_dec_render_sf(
                                                      hSpatParamRendCom->diffuseness_vector[md_idx],
                                                      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( reference_power,
                                                      p_onset_filter,
                                                      azimuth,
                                                      elevation,
                                                      hSpatParamRendCom->diffuseness_vector[md_idx],
                                                      hSpatParamRendCom,
                                                      hDirACRend,
                                                      st_ivas->hVBAPdata,
                                                      hDirACRend->hOutSetup,
                                                      nchan_transport,
                                                      md_idx,
                                                      hodirac_flag,
                                                      hDirAC->hConfig->dec_param_estim );
#endif

        if ( hDirAC->hConfig->dec_param_estim )
        {
+0 −195
Original line number Diff line number Diff line
@@ -542,10 +542,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    const float *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 int16_t sh_rot_max_order,
    const float *p_Rmat, /* i  : rotation matrix             */
#endif
    const VBAP_HANDLE hVBAPdata,       /* i  : VBAP structure              */
    const IVAS_OUTPUT_SETUP hOutSetup, /* i  : output setup structure      */
    const int16_t nchan_transport,     /* i  : number of transport channels*/
@@ -592,10 +588,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                                                      elevation,
                                                      md_idx,
                                                      NULL,
#ifndef FIX_998_UNUSED_FUNCTION
                                                      2,
                                                      p_Rmat,
#endif
                                                      hodirac_flag );
    }

@@ -642,10 +634,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(
                                                      elevation,
                                                      md_idx,
                                                      NULL,
#ifndef FIX_998_UNUSED_FUNCTION
                                                      sh_rot_max_order,
                                                      p_Rmat,
#endif
                                                      hodirac_flag );

        if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
@@ -1576,169 +1564,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls(
    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(
    const int16_t azimuth,
    const int16_t elevation,
    float *response,
    const int16_t shd_rot_max_order,
    const float *p_Rmat )
{
    int16_t index_azimuth, index_elevation;
    int16_t el, e, az;
    float cos_1, cos_2, sin_1, cos_az[3];
    float sin_az[3];
    float f, c;
    int16_t l, m;
    int16_t b, b1, b_2, b1_2, a;
    float dv_0, dv_1, dv_2, dv_r_0, dv_r_1, dv_r_2;
    float w;

    push_wmops( "ivas_dirac_dec_get_response_split_order" );

    index_azimuth = ( azimuth + 180 ) % 360;
    index_elevation = elevation + 90;
    e = index_elevation > 90 ? -1 : 1;
    el = index_elevation > 90 ? 180 - index_elevation : index_elevation;

    az = index_azimuth > 180 ? 360 - index_azimuth : index_azimuth;
    f = index_azimuth > 180 ? -1.0f : 1.0f;

    cos_1 = dirac_gains_trg_term[az][0];
    sin_1 = f * dirac_gains_trg_term[az][1];

    cos_2 = cos_1 * cos_1;

    cos_az[0] = cos_1;
    cos_az[1] = 2.0f * cos_2 - 1.0f;
    cos_az[2] = 2.0f * cos_1 * cos_az[1] - cos_az[0];
    sin_az[0] = sin_1;
    sin_az[1] = sin_1 * 2.0f * cos_1;
    sin_az[2] = sin_1 * ( 4.0f * cos_2 - 1.0f );

    response[0] = 1.0f;
    for ( l = 1; l <= shd_rot_max_order; l++ )
    {
        b_2 = l * l;
        b1_2 = l * l + 2 * l;
        for ( m = 0; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];
            c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];

            response[b] = c * sin_az[l - m - 1];

            b1 = b1_2 - m;
            response[b1] = c * cos_az[l - m - 1];
        }

        for ( m = 1; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];
            c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];
            c = c * e;

            response[b] = c * sin_az[l - m - 1];

            b1 = b1_2 - m;
            response[b1] = c * cos_az[l - m - 1];
        }

        b = b_2 + l;
        a = dirac_gains_P_idx[b];
        c = dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];
        if ( l % 2 == 1 )
        {
            c = c * e;
        }

        response[b] = c;
    }

    /*Conversion spherical to cartesian coordinates*/
    w = -dirac_gains_trg_term[el][1];
    dv_0 = w * cos_1;
    dv_1 = w * sin_1;
    dv_2 = e * dirac_gains_trg_term[el][0];

    /*Rotation mtx multiplication*/
    dv_r_0 = p_Rmat[0] * dv_0 + p_Rmat[1] * dv_1 + p_Rmat[2] * dv_2;
    dv_r_1 = p_Rmat[3] * dv_0 + p_Rmat[4] * dv_1 + p_Rmat[5] * dv_2;
    dv_r_2 = p_Rmat[6] * dv_0 + p_Rmat[7] * dv_1 + p_Rmat[8] * dv_2;

    index_azimuth = ( (int16_t) ( atan2f( dv_r_1, dv_r_0 ) * _180_OVER_PI ) + 180 ) % 360;
    index_elevation = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ) + 90;
    e = index_elevation > 90 ? -1 : 1;
    el = index_elevation > 90 ? 180 - index_elevation : index_elevation;

    az = index_azimuth > 180 ? 360 - index_azimuth : index_azimuth;
    f = index_azimuth > 180 ? -1.0f : 1.0f;

    cos_1 = dirac_gains_trg_term[az][0];
    sin_1 = f * dirac_gains_trg_term[az][1];

    cos_2 = cos_1 * cos_1;

    cos_az[0] = cos_1;
    cos_az[1] = 2.0f * cos_2 - 1.0f;
    cos_az[2] = 2.0f * cos_1 * cos_az[1] - cos_az[0];
    sin_az[0] = sin_1;
    sin_az[1] = sin_1 * 2.0f * cos_1;
    sin_az[2] = sin_1 * ( 4.0f * cos_2 - 1.0f );

    for ( l = shd_rot_max_order + 1; l <= 3; l++ )
    {
        b_2 = l * l;
        b1_2 = l * l + 2 * l;
        for ( m = 0; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];
            c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];

            response[b] = c * sin_az[l - m - 1];

            b1 = b1_2 - m;
            response[b1] = c * cos_az[l - m - 1];
        }

        for ( m = 1; m < l; m += 2 )
        {
            b = b_2 + m;
            a = dirac_gains_P_idx[b];
            c = SQRT2 * dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];
            c = c * e;

            response[b] = c * sin_az[l - m - 1];

            b1 = b1_2 - m;
            response[b1] = c * cos_az[l - m - 1];
        }

        b = b_2 + l;
        a = dirac_gains_P_idx[b];
        c = dirac_gains_norm_term[a] * dirac_gains_Pnm[el][a];
        if ( l % 2 == 1 )
        {
            c = c * e;
        }

        response[b] = c;
    }

    pop_wmops();

    return;
}
#endif

/*-------------------------------------------------------------------------
 * ivas_dirac_dec_compute_directional_responses()
@@ -1756,10 +1581,6 @@ void ivas_dirac_dec_compute_directional_responses(
    const int16_t *elevation,
    const int16_t md_idx,
    const float *surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
    const int16_t shd_rot_max_order, /* i  : split-order rotation method    */
    const float *p_Rmat,             /* i  : rotation matrix                */
#endif
    const int16_t hodirac_flag /* i  : flag to indicate HO-DirAC mode */
)
{
@@ -1830,28 +1651,12 @@ void ivas_dirac_dec_compute_directional_responses(
                set_f( direct_response_hoa, 1.0f, MAX_OUTPUT_CHANNELS );
                set_f( direct_response_dir2, 1.0f, MAX_OUTPUT_CHANNELS );

#ifndef FIX_998_UNUSED_FUNCTION
                if ( p_Rmat != 0 )
                {
                    ivas_dirac_dec_get_response_split_order( azimuth[k], elevation[k], direct_response_hoa, shd_rot_max_order, p_Rmat );

                    if ( hodirac_flag )
                    {
                        ivas_dirac_dec_get_response_split_order( azimuth2[k], elevation2[k], direct_response_dir2, shd_rot_max_order, p_Rmat );
                    }
                }
                else
                {
#endif
                    ivas_dirac_dec_get_response( azimuth[k], elevation[k], direct_response_hoa, hDirACRend->hOutSetup.ambisonics_order );

                    if ( hodirac_flag )
                    {
                        ivas_dirac_dec_get_response( azimuth2[k], elevation2[k], direct_response_dir2, hDirACRend->hOutSetup.ambisonics_order );
                    }
#ifndef FIX_998_UNUSED_FUNCTION
                }
#endif

                if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
                {
+0 −8
Original line number Diff line number Diff line
@@ -2216,10 +2216,6 @@ static void ivas_masa_ext_dirac_render_sf(
                                                  elevation,
                                                  md_idx,
                                                  surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
                                                  0,
                                                  NULL,
#endif
                                                  0 );


@@ -2374,10 +2370,6 @@ static void ivas_masa_ext_dirac_render_sf(
                                                      hSpatParamRendCom->diffuseness_vector[md_idx],
                                                      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
@@ -466,10 +466,6 @@ void ivas_dirac_dec_output_synthesis_process_slot(
    const float *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 int16_t sh_rot_max_order,
    const float *p_Rmat,                                        /* i  : rotation matrix                             */
#endif
    const VBAP_HANDLE hVBAPdata,                                /* i  : VBAP structure                              */
    const IVAS_OUTPUT_SETUP hOutSetup,                          /* i  : output setup structure                      */
    const int16_t nchan_transport,                              /* i  : number of transport channels                */
@@ -536,10 +532,6 @@ void ivas_dirac_dec_compute_directional_responses(
    const int16_t *elevation,
    const int16_t md_idx,
    const float *surCohRatio,
#ifndef FIX_998_UNUSED_FUNCTION
    const int16_t shd_rot_max_order,                            /* i  : split-order rotation method                                    */
    const float *p_Rmat,                                        /* i  : rotation matrix                                                */
#endif
    const int16_t hodirac_flag                                  /* i  : flag to indicate HO-DirAC mode                                 */
);