Commit 9a020307 authored by bayers's avatar bayers
Browse files

decouple subframe indexing of head rotation/combined orientation from general...

decouple subframe indexing of head rotation/combined orientation from general rendering subframe indexing
parent 031045d7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2214,6 +2214,13 @@ static ivas_error decodeG192(
            }
        }

#ifdef NONBE_UNIFIED_DECODING_PATHS
        if ( arg.enableExternalOrientation )
        {
        }
#endif


        /* decode and get samples */
        nSamplesRendered = 0;
        nSamplesToRender = nOutSamples;
+2 −0
Original line number Diff line number Diff line
@@ -5238,7 +5238,9 @@ void ivas_binRenderer(
    HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData,
#endif
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,       /* i  : combined head and external orientation handle           */
#ifndef NONBE_UNIFIED_DECODING_PATHS
    int16_t subframe_idx,                                       /* i  : subframe index                                          */
#endif
    const int16_t numTimeSlots,                                 /* i  : number of time slots to process                         */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    float Cldfb_RealBuffer_Binaural[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o  : Rotated Binaural signals */
+2 −2
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@

#define NONBE_FIX_736_FOA_BR_SWITCH                           /* FhG/Dlb : Issue 736: FOA bitrate switching decoding crashes in in ivas_spar_to_dirac */
#define NONBE_FIX_746_NONDIEGETIC_MD                          /* Eri: Issue 746: The non-diegetic panning flag affects the encoder bitstream even if extended metadata is not enabled. Crashes the decoder.*/

#define NONBE_UNIFIED_DECODING_PATHS                          /* FhG: unify decoding paths   */
/* ##################### End NON-BE switches ############################# */

/* ################## End DEVELOPMENT switches ######################### */
+45 −8
Original line number Diff line number Diff line
@@ -1655,7 +1655,9 @@ void ivas_binaural_cldfb(
            &st_ivas->hSplitBinRend.splitrend.multiBinPoseData,
#endif
            st_ivas->hCombinedOrientationData,
#ifndef NONBE_UNIFIED_DECODING_PATHS
            subframeIdx,
#endif
            JBM_CLDFB_SLOTS_IN_SUBFRAME,
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
            NULL,
@@ -1702,7 +1704,10 @@ void ivas_binaural_cldfb(
            }
        }
#endif

#ifdef NONBE_UNIFIED_DECODING_PATHS
        /* update combined orientation access index */
        ivas_combined_rotation_update_index( st_ivas->hCombinedOrientationData, maxBand * MAX_PARAM_SPATIAL_SUBFRAMES );
#endif
        /* Implement CLDFB synthesis */
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
@@ -1832,7 +1837,9 @@ void ivas_binaural_cldfb_sf(
            &st_ivas->hSplitBinRend.splitrend.multiBinPoseData,
#endif
            st_ivas->hCombinedOrientationData,
#ifndef NONBE_UNIFIED_DECODING_PATHS
            subframeIdx,
#endif
            st_ivas->hTcBuffer->subframe_nbslots[subframeIdx],
            Cldfb_RealBuffer_Binaural,
            Cldfb_ImagBuffer_Binaural,
@@ -1856,7 +1863,10 @@ void ivas_binaural_cldfb_sf(
            }
        }
#endif

#ifdef NONBE_UNIFIED_DECODING_PATHS
        /* update combined orientation access index */
        ivas_combined_rotation_update_index( st_ivas->hCombinedOrientationData, maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] );
#endif
        /* Implement CLDFB synthesis */
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
@@ -1899,7 +1909,9 @@ void ivas_binRenderer(
    const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData,
#endif
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, /* i  : combined head and external orientation handle*/
#ifndef NONBE_UNIFIED_DECODING_PATHS
    int16_t subframe_idx, /* i  : subframe index                               */
#endif
    const int16_t numTimeSlots, /* i  : number of time slots to render               */
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
    HEAD_TRACK_DATA_HANDLE hPostRendHeadTrackData,
@@ -1951,24 +1963,49 @@ void ivas_binRenderer(
#endif

    /* Head rotation in HOA3 or CICPx */
    if ( hCombinedOrientationData != NULL && hCombinedOrientationData->enableCombinedOrientation[subframe_idx] && hBinRenderer->rotInCldfb )
    if ( hCombinedOrientationData != NULL &&
#ifdef NONBE_UNIFIED_DECODING_PATHS
         hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx]
#else
         hCombinedOrientationData->enableCombinedOrientation[subframe_idx]
#endif

         && hBinRenderer->rotInCldfb )
    {
        if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 )
        {
            /* Rotation in SHD (HOA3) */
            if ( hCombinedOrientationData->shd_rot_max_order == -1 )
            {
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 );
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer,
#ifdef NONBE_UNIFIED_DECODING_PATHS
                                       hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx],
#else
                                       hCombinedOrientationData->Rmat[subframe_idx],
#endif
                                       hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 );
            }
            else if ( hCombinedOrientationData->shd_rot_max_order > 0 )
            {
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, hCombinedOrientationData->Rmat[subframe_idx], hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order );
                rotateFrame_shd_cldfb( RealBuffer, ImagBuffer,
#ifdef NONBE_UNIFIED_DECODING_PATHS
                                       hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx],
#else
                                       hCombinedOrientationData->Rmat[subframe_idx],
#endif
                                       hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hCombinedOrientationData->shd_rot_max_order );
            }
        }
        else
        {
            /* Rotation in SD (CICPx) */
            rotateFrame_sd_cldfb( hCombinedOrientationData->Rmat[subframe_idx], RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band );
            rotateFrame_sd_cldfb(
#ifdef NONBE_UNIFIED_DECODING_PATHS
                hCombinedOrientationData->Rmat[hCombinedOrientationData->subframe_idx],
#else
                hCombinedOrientationData->Rmat[subframe_idx],
#endif
                RealBuffer, ImagBuffer, hBinRenderer->hInputSetup, hBinRenderer->hEFAPdata, numTimeSlots, hBinRenderer->conv_band );
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -99,16 +99,16 @@ ivas_error ivas_dec(
        p_output[n] = output[n];
    }


    /*----------------------------------------------------------------*
     * Combine orientations
     *----------------------------------------------------------------*/

#ifndef NONBE_UNIFIED_DECODING_PATHS
    if ( ( error = combine_external_and_head_orientations_dec( st_ivas->hHeadTrackData, st_ivas->hExtOrientationData, st_ivas->hCombinedOrientationData ) ) != IVAS_ERR_OK )
    {
        return error;
    }

#endif
#if defined SPLIT_REND_WITH_HEAD_ROT
    if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
         ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
Loading