Commit 0e9b5599 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

implement output to STEREO in OSBA JBM path

parent e144d637
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -779,7 +779,10 @@ ivas_error ivas_dec(
        }

        /* Loudspeakers, Ambisonics or Binaural rendering */
        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 
			)
        {
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, &output[sba_ch_idx], nchan_remapped
#ifdef API_5MS
+77 −15
Original line number Diff line number Diff line
@@ -1169,6 +1169,68 @@ ivas_error ivas_jbm_dec_render(
                    return error;
                }
            }
            else if ( st_ivas->renderer_type == RENDERER_OSBA_STEREO || 
				      st_ivas->renderer_type == RENDERER_MONO_DOWNMIX 
				)
            {
                int16_t slots_to_render, first_sf, last_sf, subframe_idx, ch;
                uint16_t slot_size, slot_idx_start;
                float *output_f_local[MAX_OUTPUT_CHANNELS];

				for ( ch = 0; ch < nchan_out; ch++ )
                {
                    output_f_local[ch] = p_output[ch];
                }

                slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS );
                slots_to_render = min( st_ivas->hSpar->num_slots - st_ivas->hSpar->slots_rendered, nSamplesAsked / slot_size );
                *nSamplesRendered = slots_to_render * slot_size;
                first_sf = st_ivas->hSpar->subframes_rendered;
                last_sf = first_sf;

				while ( slots_to_render > 0 )
                {
                    slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf];
                    last_sf++;
                }

				st_ivas->hSpar->slots_rendered += st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];

                for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
                {
                    int16_t nchan_ism;
                    int16_t n_samples_sf = slot_size * st_ivas->hSpar->subframe_nbslots[subframe_idx];

					slot_size = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS );
                    slot_idx_start = st_ivas->hSpar->slots_rendered;

                    nchan_ism = st_ivas->nchan_ism;

					p_tc[0] = st_ivas->hTcBuffer->tc[0 + nchan_ism] + slot_idx_start * slot_size;
                    p_tc[1] = st_ivas->hTcBuffer->tc[1 + nchan_ism] + slot_idx_start * slot_size;

					for ( n = 0; n < BINAURAL_CHANNELS; n++ )
                    {
                        int16_t i;
                        for ( i = 0; i < slot_size; i++ )
                        {
                            output_f_local[n][i] = p_tc[n][i];
                        }
                    }

					st_ivas->hSpar->slots_rendered += st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];
					st_ivas->hSpar->subframes_rendered++;

					for ( ch = 0; ch < nchan_out; ch++ )
                    {
						output_f_local[ch] += n_samples_sf;
                    }
                }
            }
            else
            {
                ivas_sba_dec_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output );
			}
		}
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
                  st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
+15 −14
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm(

        ivas_sba_dec_render( st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailable, &output_f[2] );


    if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, output_f, *nSamplesRendered ) ) != IVAS_ERR_OK )
    {
        return error;
+5 −1
Original line number Diff line number Diff line
@@ -247,7 +247,11 @@ ivas_error ivas_spar_dec_open(
        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 )
        if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO )
#ifdef JBM_FOR_OSBA
			&& !(st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
			)
        {
            buffer_mode = TC_BUFFER_MODE_BUFFER;
            nchan_tc = st_ivas->hDecoderConfig->nchan_out;