Commit 86527fee authored by bayers's avatar bayers
Browse files

added non-diegetic panning to JITTER rendering, fixed a few problems with the...

added non-diegetic panning to JITTER rendering, fixed a few problems with the FIX_356_ISM_METADATA_SYNC switch in this path.
parent f221482e
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@
#define FIX_468_16KHZ_PUPMIX                            /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */

#define FIX_485_STATIC_BUFFERS                          /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */
#define FIX_473_JITTER_NONDIEGETIC_PANNING              /* FhG,Orange: add missing non-diegetic panning to JITTER */

                                                        /* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+4 −0
Original line number Diff line number Diff line
@@ -269,7 +269,11 @@ void ivas_ism_render_sf(
    {

        /* Head rotation: rotate the object positions depending the head's orientation */
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
        if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 && !st_ivas->hIsmMetaData[i]->non_diegetic_flag )
#else
        if ( st_ivas->hHeadTrackData != NULL && st_ivas->hHeadTrackData->num_quaternions >= 0 )
#endif
        {
            rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, Rmat, st_ivas->hIntSetup.is_planar_setup );
            if ( st_ivas->hEFAPdata != NULL )
+25 −0
Original line number Diff line number Diff line
@@ -611,6 +611,9 @@ ivas_error ivas_jbm_dec_render(
    int16_t nchan_remapped;
    int32_t output_Fs;
    AUDIO_CONFIG output_config;
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
    float pan_left, pan_right;
#endif
    int16_t nSamplesAskedLocal;
    ivas_error error;
    float *p_output[MAX_OUTPUT_CHANNELS];
@@ -669,6 +672,16 @@ ivas_error ivas_jbm_dec_render(
            {
                ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, st_ivas->nchan_transport, p_output );
            }
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
            else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX )
            {
                *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
                pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f;
                pan_right = 1.f - pan_left;
                v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered );
            }
#endif
            else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
            {
                ivas_param_ism_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );
@@ -689,6 +702,15 @@ ivas_error ivas_jbm_dec_render(
                /* Convert to CICPxx; used also for ISM->CICP19->binaural_room rendering */
                ivas_ism_render_sf( st_ivas, p_output, *nSamplesRendered );
            }
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
            else if ( st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX )
            {
                pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f;
                pan_right = 1.f - pan_left;
                v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered );
            }
#endif
            else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            {
                /* Convert to Ambisonics; used also for ISM->HOA3->binaural rendering */
@@ -1655,6 +1677,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( Decoder_Struct *st_ivas )
        case RENDERER_PARAM_ISM:
        case RENDERER_BINAURAL_MIXER_CONV:
        case RENDERER_BINAURAL_MIXER_CONV_ROOM:
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
        case RENDERER_NON_DIEGETIC_DOWNMIX:
#endif
            buffer_mode = TC_BUFFER_MODE_RENDERER;
            break;
        case RENDERER_MC_PARAMMC:
+18 −3
Original line number Diff line number Diff line
@@ -113,7 +113,8 @@ void ObjRenderIVASSubframe(
    float *tc_local[MAX_TRANSPORT_CHANNELS];
    int16_t ch, slot_size, slots_to_render, output_frame;
#ifdef FIX_356_ISM_METADATA_SYNC
    int16_t ism_md_subframe_update_jbm = 0; /* Number of subframes to delay metadata to sync with audio */
    int16_t ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2; /* Number of subframes to delay metadata to sync with audio */
    int16_t c_indx, nS;
#endif
    for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
    {
@@ -145,7 +146,21 @@ void ObjRenderIVASSubframe(

        /* Update object position(s) */
#ifdef FIX_356_ISM_METADATA_SYNC
        c_indx = 0;

        for ( nS = 0; nS < st_ivas->nchan_transport; nS++ )
        {
            if ( !( st_ivas->ivas_format == MC_FORMAT && nS == LFE_CHANNEL ) ) /* Skip LFE for MC */
            {
                st_ivas->hBinRendererTd->Sources[c_indx]->InputFrame_p = tc_local[nS];
                st_ivas->hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE;
                c_indx++;
            }
        }
        if ( subframe_idx == ism_md_subframe_update_jbm )
        {
            TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData );
        }
#else
        TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, tc_local );
#endif
@@ -163,7 +178,7 @@ void ObjRenderIVASSubframe(

        /* Render subframe */
#ifdef FIX_356_ISM_METADATA_SYNC
        TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm );
        TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx );
#else
        TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 );
#endif
+18 −2
Original line number Diff line number Diff line
@@ -891,8 +891,20 @@ static ivas_error IVAS_DEC_Setup(

    if ( hIvasDec->mode == IVAS_DEC_MODE_EVS )
    {
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
        if ( hIvasDec->st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX )
        {
            *nTransportChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN;
            *nOutChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN;
        }
        else
        {
#endif
            *nTransportChannels = 1;
            *nOutChannels = 1;
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
        }
#endif
    }
    else
    {
@@ -2909,7 +2921,11 @@ static ivas_error evs_dec_main(
    if ( floatBuf != NULL )
    {
        /* BE workaround */
#ifdef FIX_473_JITTER_NONDIEGETIC_PANNING
        int16_t pcm_buf_local[L_FRAME48k * MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN];
#else
        int16_t pcm_buf_local[L_FRAME48k];
#endif


        /* convert 'float' output data to 'short' */