Commit 0f57609c authored by Jouni Paulus's avatar Jouni Paulus
Browse files

fixes to SR off-path: missing call to ivas_dirac_dec_binaural_process_output, OSBA functionality

parent a99d6dac
Loading
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -102,11 +102,7 @@ typedef struct parambin_rend_config_data
 * Local function prototypes
 *------------------------------------------------------------------------*/

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, float *output_f[], const int16_t nchan_transport, const int16_t subframe );
#else
static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const int16_t nchan_transport, const int16_t subframe );
#endif

static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const int16_t num_freq_bands, const int16_t slot, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] );

@@ -529,11 +525,7 @@ void ivas_dirac_dec_binaural_render(
    for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe_idx];
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
        ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, output_f_local, nchan_transport, subframe_idx );
#else
        ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, nchan_transport, subframe_idx );
#endif

        for ( ch = 0; ch < nchan_out; ch++ )
        {
@@ -703,11 +695,7 @@ void ivas_dirac_dec_binaural(
    {
        int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe];

#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
        ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, p_output, nchan_transport, subframe );
#else
        ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, nchan_transport, subframe );
#endif

        for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ )
        {
@@ -732,9 +720,7 @@ void ivas_dirac_dec_binaural(
static void ivas_dirac_dec_binaural_internal(
    Decoder_Struct *st_ivas,
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,
#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN
    float *output_f[],
#endif
    const int16_t nchan_transport,
    const int16_t subframe )
{
@@ -1054,6 +1040,8 @@ static void ivas_dirac_dec_binaural_internal(
                                                max_band_decorr, numInChannels, config_data.processReverb, subframe, NULL, NULL,
                                                reverbRe, reverbIm, decorrRe, decorrIm, 1 );
    }
#else
    ivas_dirac_dec_binaural_process_output( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in, max_band_decorr, numInChannels, config_data.processReverb, subframe );
#endif
    hDiracDecBin->hDiffuseDist = NULL;

@@ -1895,21 +1883,32 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric
        }
    }

#ifdef SBA_AND_OBJECTS
    if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && nchan_transport == 2 )
#else
    if ( ivas_format == SBA_FORMAT && nchan_transport == 2 )
#endif
    {
        float tempRe, tempIm;
        float subFrameSumEne[CLDFB_NO_CHANNELS_MAX];

        set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX );
        v_multc( subFrameTotalEne, SBA_CARDI_TARGET_ENERGY_GAIN, subFrameTotalEne, nBins );

        set_zero( subFrameSumEne, CLDFB_NO_CHANNELS_MAX );
        for ( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ )
        {
            for ( bin = 0; bin < nBins; bin++ )
            {
                tempRe = inRe[0][slot][bin] + inRe[1][slot][bin];
                tempIm = inIm[0][slot][bin] + inIm[1][slot][bin];
                subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm;
                subFrameSumEne[bin] += tempRe * tempRe + tempIm * tempIm;
            }
        }
        for ( bin = 0; bin < nBins; bin++ )
        {
            subFrameTotalEne[bin] = max( subFrameTotalEne[bin], subFrameSumEne[bin] );
        }

    }

    /* Determine target covariance matrix containing target binaural properties */
@@ -2199,7 +2198,11 @@ static void ivas_dirac_dec_binaural_formulate_input_and_target_covariance_matric
        }
        else /* When rendering binaural, ambience has frequency dependent ICC. */
        {
#ifdef SBA_AND_OBJECTS
            if ( ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS )
#else
            if ( ivas_format == SBA_FORMAT && bin < BINAURAL_COHERENCE_DIFFERENCE_BINS )
#endif
            {
                float diffuseFieldCoherence;
                diffuseFieldCoherence = hDiracDecBin->hDiffuseDist->diffuseRatioX[bin] * hDiracDecBin->diffuseFieldCoherenceX[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioY[bin] * hDiracDecBin->diffuseFieldCoherenceY[bin] + hDiracDecBin->hDiffuseDist->diffuseRatioZ[bin] * hDiracDecBin->diffuseFieldCoherenceZ[bin];