Commit fb399129 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

restore original code with OBJ_EDITING_INTERFACE disabled

parent e6378fbe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@

/* ################## Start DEVELOPMENT switches ######################### */

#define OBJ_EDITING_INTERFACE                           /* Interface for object editing */
//#define OBJ_EDITING_INTERFACE                           /* Interface for object editing */
#ifdef OBJ_EDITING_INTERFACE
#define OBJ_EDITING_API                                 /* object editing changes related to the API */
#define OBJ_EDITING_DECODER                             /* object editing changes realted to the decoder functions */
+78 −3
Original line number Diff line number Diff line
@@ -1487,9 +1487,22 @@ void ivas_param_ism_params_to_masa_param_mapping(
)
{
    PARAM_ISM_DEC_HANDLE hParamIsmDec;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
    int32_t ivas_total_brate;

#ifndef OBJ_EDITING_PARAMISM
	SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;

	int16_t nBins;
    int16_t band_idx, bin_idx, sf_idx;
    int16_t brange[2];
    int16_t azimuth[2];
    int16_t elevation[2];
    float power_ratio[2];

    hSpatParamRendCom = st_ivas->hSpatParamRendCom;
    nBins = hSpatParamRendCom->num_freq_bands;
#endif

    hParamIsmDec = st_ivas->hParamIsmDec;

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
@@ -1505,8 +1518,70 @@ void ivas_param_ism_params_to_masa_param_mapping(
        st_ivas->hISMDTX.dtx_flag = 1;
    }

#ifdef OBJ_EDITING_PARAMISM
    ivas_param_ism_obj2band( st_ivas );
#ifndef OBJ_EDITING_PARAMISM
    if ( st_ivas->hISMDTX.dtx_flag )
    {
        float energy_ratio;
        energy_ratio = powf( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence, 2.0f );

        hSpatParamRendCom->numSimultaneousDirections = 1;
        azimuth[0] = (int16_t) roundf( hParamIsmDec->azimuth_values[0] );
        elevation[0] = (int16_t) roundf( hParamIsmDec->elevation_values[0] );

        for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ )
        {
            for ( bin_idx = 0; bin_idx < nBins; bin_idx++ )
            {
                hSpatParamRendCom->azimuth[sf_idx][bin_idx] = azimuth[0];
                hSpatParamRendCom->elevation[sf_idx][bin_idx] = elevation[0];

                hSpatParamRendCom->energy_ratio1[sf_idx][bin_idx] = energy_ratio;

                hSpatParamRendCom->spreadCoherence[sf_idx][bin_idx] = 0.0f;
                hSpatParamRendCom->surroundingCoherence[sf_idx][bin_idx] = 0.0;
            }
        }
    }
    else
    {
        hSpatParamRendCom->numSimultaneousDirections = 2;
        for ( band_idx = 0; band_idx < hParamIsmDec->hParamIsm->nbands; band_idx++ )
        {
            brange[0] = hParamIsmDec->hParamIsm->band_grouping[band_idx];
            brange[1] = hParamIsmDec->hParamIsm->band_grouping[band_idx + 1];

            azimuth[0] = (int16_t) roundf( hParamIsmDec->azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] );
            elevation[0] = (int16_t) roundf( hParamIsmDec->elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][0]] );
            power_ratio[0] = hParamIsmDec->power_ratios[band_idx][0][0];

            azimuth[1] = (int16_t) roundf( hParamIsmDec->azimuth_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] );
            elevation[1] = (int16_t) roundf( hParamIsmDec->elevation_values[hParamIsmDec->hParamIsm->obj_indices[band_idx][0][1]] );
            power_ratio[1] = hParamIsmDec->power_ratios[band_idx][0][1];

            for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ )
            {
                for ( bin_idx = brange[0]; bin_idx < brange[1]; bin_idx++ )
                {
                    hSpatParamRendCom->azimuth[sf_idx][bin_idx] = azimuth[0];
                    hSpatParamRendCom->elevation[sf_idx][bin_idx] = elevation[0];
                    hSpatParamRendCom->energy_ratio1[sf_idx][bin_idx] = power_ratio[0];
                    hSpatParamRendCom->azimuth2[sf_idx][bin_idx] = azimuth[1];
                    hSpatParamRendCom->elevation2[sf_idx][bin_idx] = elevation[1];
                    hSpatParamRendCom->energy_ratio2[sf_idx][bin_idx] = power_ratio[1];
                }
            }
        }

        for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ )
        {
            for ( bin_idx = 0; bin_idx < nBins; bin_idx++ )
            {
                hSpatParamRendCom->spreadCoherence[sf_idx][bin_idx] = 0.0f;
                hSpatParamRendCom->spreadCoherence2[sf_idx][bin_idx] = 0.0f;
                hSpatParamRendCom->surroundingCoherence[sf_idx][bin_idx] = 0.0;
            }
        }
    }
#endif

    return;