Commit 35cccbdf authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

set correct grannularity for td renderer

parent a1cfc5e9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1559,7 +1559,11 @@ void ivas_dirac_dec_set_md_map(
#ifdef API_5MS
    /* copy also to tc buffer */
    /* only for non-combined formats and combinded formats w/o discrete objects */
    if ( st_ivas->ivas_format != MASA_ISM_FORMAT || st_ivas->ism_mode != ISM_MASA_MODE_DISC )
    if ( (st_ivas->ivas_format != MASA_ISM_FORMAT || st_ivas->ism_mode != ISM_MASA_MODE_DISC )
#ifdef JBM_FOR_OSBA
         && !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
		)
    {
        st_ivas->hTcBuffer->nb_subframes = hSpatParamRendCom->nb_subframes;
        mvs2s( hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, hSpatParamRendCom->nb_subframes );
+12 −2
Original line number Diff line number Diff line
@@ -863,9 +863,16 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer(
#ifdef JBM_FOR_OSBA
    else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
    {

        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            ivas_ism_dec_digest_tc( st_ivas );

            if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            {
                n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size );
            }

            ivas_sba_dec_digest_tc( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );
        }
        else
@@ -1125,7 +1132,9 @@ ivas_error ivas_jbm_dec_render(
    {
        nchan_remapped = st_ivas->nchan_transport;

        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || 
			 st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || 
			 st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC )
            {
@@ -1161,7 +1170,8 @@ ivas_error ivas_jbm_dec_render(
                }
            }
        }
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
			      st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
        {
            ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output );
        }
+36 −10
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@ ivas_error ivas_spar_dec_open(
        int16_t nchan_to_allocate;
        int16_t nchan_tc;
        TC_BUFFER_MODE buffer_mode;
#ifdef JBM_FOR_OSBA
        int16_t granularity;
#endif

        buffer_mode = TC_BUFFER_MODE_RENDERER;
        nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas );
@@ -239,6 +242,11 @@ ivas_error ivas_spar_dec_open(
            nchan_to_allocate += st_ivas->nchan_ism;
        }
#endif

#ifdef JBM_FOR_OSBA
        granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS );
#endif

        if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO )
        {
            buffer_mode = TC_BUFFER_MODE_BUFFER;
@@ -249,7 +257,26 @@ ivas_error ivas_spar_dec_open(
        {
            nchan_to_allocate = 2 * BINAURAL_CHANNELS;
        }
        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )

#ifdef JBM_FOR_OSBA
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
        {
            /* get correct granularity in case of binaural rendering of the discrete objects with the td obj renderer */
            granularity = ( int16_t )( st_ivas->hDecoderConfig->output_Fs / (FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES )  );
        }
#endif

        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas,
			                                        buffer_mode,
			                                        nchan_tc,
                                                    nchan_to_allocate,
			                                        nchan_to_allocate,
#ifdef JBM_FOR_OSBA
		                                        	granularity
#else
                                                    NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS )
#endif
                                                        ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -1529,8 +1556,7 @@ void ivas_spar_dec_upmixer_sf(
            for ( i = 0; i < nchan_transport; i++ )
            {
                tmp = roundf( output[i][j] * PCM16_TO_FLT_FAC );
                pcm = ( tmp > MAX16B_FLT ) ? MAX16B : ( tmp < MIN16B_FLT ) ? MIN16B
                                                                           : (short) tmp;
                pcm = ( tmp > MAX16B_FLT ) ? MAX16B : ( tmp < MIN16B_FLT ) ? MIN16B : (short) tmp;
                dbgwrite( &pcm, sizeof( int16_t ), 1, 1, "dmx_dec.raw" );
            }
        }