Commit 489f8623 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

address comments, BR switching fix

parent 34dde513
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5769,6 +5769,18 @@ ivas_error ivas_osba_ism_metadata_dec(
    int16_t nb_bits_metadata[]           /* o  : number of ISM metadata bits       */
);

/*-------------------------------------------------------------------------*
 * ivas_osba_render()
 *
 * Object + SBA rendering process.
 *-------------------------------------------------------------------------*/

void ivas_osba_render(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder structure                      */
    float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */
    const int16_t output_frame    /* i  : output frame length per channel             */
);

void ivas_masa_ism_data_close(
    MASA_ISM_DATA_HANDLE *hMasaIsmData /* i/o: MASA_ISM rendering handle    */
);
+2 −33
Original line number Diff line number Diff line
@@ -377,9 +377,6 @@ ivas_error ivas_dec(
    }
    else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT )
    {
#ifdef OSBA_BR_SWITCHING
        st_ivas->ism_mode = ISM_MODE_NONE;
#endif
        set_s( nb_bits_metadata, 0, MAX_SCE );

        /* read parameters from the bitstream */
@@ -860,36 +857,7 @@ ivas_error ivas_dec(
        }
        else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS )
        {
            float tmp_ism_out[MAX_OUTPUT_CHANNELS][L_FRAME48k];
            float *p_tmp_ism_out[MAX_OUTPUT_CHANNELS];

            for ( n = 0; n < nchan_out; n++ )
            {
                p_tmp_ism_out[n] = &tmp_ism_out[n][0];
            }

            for ( n = 0; n < nchan_ism; n++ )
            {
                mvr2r( output[n], tmp_ism_out[n], output_frame );
                delay_signal( tmp_ism_out[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size );
            }

            if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI )
            {
                ivas_ism2sba( p_tmp_ism_out, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_ism, output_frame, st_ivas->hIntSetup.ambisonics_order );
            }
            else
            {
                ivas_ism_render( st_ivas, p_tmp_ism_out, output_frame );
            }

            ivas_sba_upmixer_renderer( st_ivas, &output[st_ivas->nchan_ism], output_frame );

            for ( n = 0; n < nchan_out; n++ )
            {
                v_add( output[n + nchan_ism], tmp_ism_out[n], output[n], output_frame );
                v_multc( output[n], 0.5f, output[n], output_frame );
            }
            ivas_osba_render( st_ivas, output, output_frame );
        }
        else if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL && !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
        {
@@ -904,6 +872,7 @@ ivas_error ivas_dec(
                    delay_signal( output[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size );
                }
            }

            ivas_sba_upmixer_renderer( st_ivas, &output[sba_ch_idx], output_frame );

            if ( st_ivas->ism_mode == ISM_MODE_NONE )
+1 −1
Original line number Diff line number Diff line
@@ -877,7 +877,7 @@ int16_t getNumChanSynthesis(
    {
        n = st_ivas->nchan_transport;
    }
#if defined( SBA_AND_OBJECTS ) && !defined( OSBA_BR_SWITCHING )
#ifdef SBA_AND_OBJECTS
    else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
    {
        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
+64 −0
Original line number Diff line number Diff line
@@ -289,4 +289,68 @@ ivas_error ivas_osba_ism_metadata_dec(

    return IVAS_ERR_OK;
}

/*-------------------------------------------------------------------------*
 * ivas_osba_render()
 *
 * Object + SBA rendering process.
 *-------------------------------------------------------------------------*/

void ivas_osba_render(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder structure                      */
    float output_f[][L_FRAME48k], /* i/o: core-coder transport channels/object output */
    const int16_t output_frame    /* i  : output frame length per channel             */
)
{
    float tmp_ism_out[MAX_OUTPUT_CHANNELS][L_FRAME48k];
    float *p_tmp_ism_out[MAX_OUTPUT_CHANNELS];
    int16_t n, nchan_out, nchan_ism, sba_ch_idx;

    nchan_out = st_ivas->hDecoderConfig->nchan_out;
    nchan_ism = st_ivas->nchan_ism;
    if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
    {
        sba_ch_idx = st_ivas->nchan_ism;
    }
    else
    {
        sba_ch_idx = 0;
    }

    for ( n = 0; n < nchan_out; n++ )
    {
        p_tmp_ism_out[n] = &tmp_ism_out[n][0];
    }

    if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
    {
        for ( n = 0; n < nchan_ism; n++ )
        {
            mvr2r( output_f[n], tmp_ism_out[n], output_frame );
            delay_signal( tmp_ism_out[n], output_frame, st_ivas->hMasaIsmData->delayBuffer[n], st_ivas->hMasaIsmData->delayBuffer_size );
        }

        if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI )
        {
            ivas_ism2sba( p_tmp_ism_out, st_ivas->hIsmRendererData, st_ivas->hIsmMetaData, st_ivas->nchan_ism, output_frame, st_ivas->hIntSetup.ambisonics_order );
        }
        else
        {
            ivas_ism_render( st_ivas, p_tmp_ism_out, output_frame );
        }
    }

    ivas_sba_upmixer_renderer( st_ivas, &output_f[sba_ch_idx], output_frame );

    if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
    {
        for ( n = 0; n < nchan_out; n++ )
        {
            v_add( output_f[n + nchan_ism], tmp_ism_out[n], output_f[n], output_frame );
            v_multc( output_f[n], 0.5f, output_f[n], output_frame );
        }
    }

    return;
}
#endif
+15 −9
Original line number Diff line number Diff line
@@ -145,17 +145,13 @@ ivas_error ivas_sba_dec_reconfigure(
        {
            st_ivas->ism_mode = ISM_MODE_NONE;
        }
        if ( ism_mode_old == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            nchan_hp20_old = st_ivas->nchan_transport;
    }
        else if ( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE )
    else
    {
            nchan_hp20_old += st_ivas->nchan_ism;
        }
        st_ivas->ism_mode = ISM_MODE_NONE;
    }

#endif

    nSCE_old = st_ivas->nSCE;
    nCPE_old = st_ivas->nCPE;
    nchan_transport_old = st_ivas->nchan_transport;
@@ -433,6 +429,16 @@ ivas_error ivas_sba_dec_reconfigure(
        return error;
    }

#ifdef OSBA_BR_SWITCHING
    if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
    {
        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            st_ivas->nchan_transport -= st_ivas->nchan_ism;
        }
    }
#endif

    /*-----------------------------------------------------------------*
     * HP20 memories
     *-----------------------------------------------------------------*/
Loading