Commit 20476f31 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

Merge branch '682-add-ext-support-for-omasa-jbm' into 'main'

Resolve "Add EXT support for OMASA JBM"

See merge request !940
parents eb3bea0b a3d30fb7
Loading
Loading
Loading
Loading
Loading
+35 −6
Original line number Diff line number Diff line
@@ -417,6 +417,27 @@ ivas_error ivas_jbm_dec_tc(
        {
            ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
        }
        else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL )
        {
            /* sanity check in case of bitrate switching */
            if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC )
            {
                return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" );
            }

            /* in case of external rendering, rearrange the channels order */
            mvr2r( output[0], output[MAX_TRANSPORT_CHANNELS - 2], output_frame );
            mvr2r( output[1], output[MAX_TRANSPORT_CHANNELS - 1], output_frame );

            for ( n = 0; n < nchan_transport_ism; n++ )
            {
                mvr2r( output[st_ivas->nchan_transport + n], output[n], output_frame );
            }
            mvr2r( output[MAX_TRANSPORT_CHANNELS - 2], output[n], output_frame );
            mvr2r( output[MAX_TRANSPORT_CHANNELS - 1], output[++n], output_frame );

            ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas );
        }

#ifndef FIX_657_REMOVE_EDITING
        /* Set edited object positions, if editing enabled */
@@ -701,7 +722,12 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer(
    {
        ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
#ifdef FIX_470_MASA_JBM_EXT
#ifdef MASA_AND_OBJECTS
        if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL )
#else

        if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL )
#endif
        {
            ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
        }
@@ -1687,6 +1713,8 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
    }
#ifdef MASA_AND_OBJECTS
    else if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
        if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL )
        {
            if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ )
            {
@@ -1697,6 +1725,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels(
                num_tc += st_ivas->nchan_ism;
            }
        }
    }
#endif
    else if ( st_ivas->ivas_format == MC_FORMAT )
    {