Commit dac1a86d authored by reutelhuber's avatar reutelhuber
Browse files

first version of mono and stereo output for OSBA

parent 0c91e966
Loading
Loading
Loading
Loading

lib_com/ivas_cnst.h

100644 → 100755
+3 −0
Original line number Diff line number Diff line
@@ -162,6 +162,9 @@ typedef enum
    RENDERER_BINAURAL_MIXER_CONV,
    RENDERER_BINAURAL_MIXER_CONV_ROOM,
    RENDERER_NON_DIEGETIC_DOWNMIX
#ifdef OSBA_MONO_STEREO_OUTPUT
    , RENDERER_OSBA_STEREO
#endif

} RENDERER_TYPE;

+1 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@
#define OSBA_DISC_OBJ_MCT
#define ENABLE_ISM_MD_CODING
#define OSBA_EXT_OUT
#define OSBA_MONO_STEREO_OUTPUT
#endif
/* ################## End BE DEVELOPMENT switches ######################### */

lib_dec/ivas_dec.c

100644 → 100755
+48 −0
Original line number Diff line number Diff line
@@ -560,6 +560,28 @@ ivas_error ivas_dec(
            return error;
        }

#ifdef OSBA_MONO_STEREO_OUTPUT
        if ( st_ivas->sba_dirac_stereo_flag )
        {
            ivas_agc_dec_process( st_ivas->hSpar->hAgcDec, &output[st_ivas->nchan_ism], &output[st_ivas->nchan_ism], st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, output_frame );

            if ( st_ivas->hSpar->hPCA != NULL )
            {
                ivas_pca_dec( st_ivas->hSpar->hPCA, output_frame, st_ivas->hSpar->hMdDec->spar_md_cfg.nchan_transport, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate, st_ivas->bfi, &output[st_ivas->nchan_ism] );
            }

            ivas_spar_dec_gen_umx_mat( st_ivas->hSpar->hMdDec, st_ivas->nchan_transport, IVAS_MAX_NUM_BANDS, st_ivas->bfi,
                                       ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, st_ivas->hDecoderConfig->ivas_total_brate
#ifdef VLBR_20MS_MD
                                       ,
                                       st_ivas->last_active_ivas_total_brate
#endif
                                       ) );

            ivas_sba_dirac_stereo_dec( st_ivas, &output[st_ivas->nchan_ism], output_frame, 0 );
        }
#endif

        /* HP filtering */
        for ( n = 0; n < getNumChanSynthesis( st_ivas ); n++ ) /*TODOfto:check what needs to be filtered here*/
        {
@@ -589,6 +611,32 @@ ivas_error ivas_dec(
                return error;
            }
        }
#ifdef OSBA_MONO_STEREO_OUTPUT
        else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC && ( st_ivas->renderer_type == RENDERER_OSBA_STEREO || st_ivas->renderer_type == RENDERER_MONO_DOWNMIX ) )
        {
            if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
            {
                ivas_mono_downmix_render_passive( st_ivas, output, output_frame );
            }
            else /* stereo output */
            {
                /* shift SBA channels to avoid overwrite by ISM upmix in 1 object case */
                if ( nchan_ism == 1 )
                {
                    mvr2r( output[2], output[3], output_frame );
                    mvr2r( output[1], output[2], output_frame );
                }
                ivas_ism_render( st_ivas, p_output, output_frame );
            }

            for ( n = 0; n < nchan_out; n++ )
            {
                v_add( output[n], output[n + max(nchan_out, nchan_ism)], output[n], output_frame );
            }

            //ivas_sba_upmixer_renderer( st_ivas, &output[st_ivas->nchan_ism], output_frame );
        }
#endif
        else /*HOA3 rendering for now*/
        {
#ifdef OSBA_EXT_OUT

lib_dec/ivas_init_dec.c

100644 → 100755
+11 −2
Original line number Diff line number Diff line
@@ -1199,8 +1199,6 @@ ivas_error ivas_init_decoder(
                                     st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 );
        }
        st_ivas->sba_dirac_stereo_flag = ivas_get_sba_dirac_stereo_flag( st_ivas );


#endif

        st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1;
@@ -1692,11 +1690,19 @@ ivas_error ivas_init_decoder(
        }
    }

#ifdef OSBA_MONO_STEREO_OUTPUT
    if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) &&
         ( st_ivas->ism_mode == ISM_MODE_DISC || st_ivas->ism_mode == ISM_SBA_MODE_DISC ) &&
#else
    if ( st_ivas->ivas_format == ISM_FORMAT &&
         st_ivas->ism_mode == ISM_MODE_DISC &&
#endif
         ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
           st_ivas->renderer_type == RENDERER_NON_DIEGETIC_DOWNMIX ||
           st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
#ifdef OSBA_MONO_STEREO_OUTPUT
           st_ivas->renderer_type == RENDERER_OSBA_STEREO ||
#endif
           st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
           st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
           st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) )
@@ -2421,6 +2427,9 @@ void ivas_init_dec_get_num_cldfb_instances(
        case RENDERER_BINAURAL_MIXER_CONV_ROOM:
        case RENDERER_BINAURAL_FASTCONV:
        case RENDERER_BINAURAL_FASTCONV_ROOM:
#ifdef OSBA_MONO_STEREO_OUTPUT
        case RENDERER_OSBA_STEREO:
#endif
#ifdef OSBA_DISC_OBJ_MCT
            if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT )
#else
+16 −1
Original line number Diff line number Diff line
@@ -160,7 +160,11 @@ ivas_error ivas_mct_dec(
    ivas_mct_core_dec( hMCT, st_ivas->hCPE, nCPE, output );

    /* for sba to stereo output disable any further processing for TCs > 2 as it is not needed*/
#ifdef OSBA_MONO_STEREO_OUTPUT
    if ( st_ivas->sba_dirac_stereo_flag && st_ivas->ivas_format != SBA_ISM_FORMAT )
#else
    if ( st_ivas->sba_dirac_stereo_flag )
#endif
    {
        for ( cpe_id = 1; cpe_id < nCPE; cpe_id++ )
        {
@@ -226,14 +230,21 @@ ivas_error ivas_mct_dec(

        for ( n = 0; n < CPE_CHANNELS; n++ )
        {

#ifdef OSBA_MONO_STEREO_OUTPUT
            if ( st_ivas->sba_dirac_stereo_flag && ( st_ivas->ivas_format != SBA_ISM_FORMAT || cpe_id >= nCPE - 2 ) )
#else
            if ( st_ivas->sba_dirac_stereo_flag )
#endif
            {
                ivas_post_proc( NULL, hCPE, n, synth[n], NULL, output_frame, 1 );
            }

            /* Postprocessing for ACELP/MDCT core switching and synchronization */
#ifdef OSBA_MONO_STEREO_OUTPUT
            if ( ( error = core_switching_post_dec( sts[n], synth[n], output[cpe_id * CPE_CHANNELS + n], hCPE->output_mem[1], st_ivas->ivas_format, 0, output_frame, 0 /*core_switching_flag*/, (st_ivas->ivas_format != SBA_ISM_FORMAT || cpe_id >= nCPE - 2) ? st_ivas->sba_dirac_stereo_flag : 0, -1, hCPE->last_element_mode ) ) != IVAS_ERR_OK )
#else
            if ( ( error = core_switching_post_dec( sts[n], synth[n], output[cpe_id * CPE_CHANNELS + n], hCPE->output_mem[1], st_ivas->ivas_format, 0, output_frame, 0 /*core_switching_flag*/, st_ivas->sba_dirac_stereo_flag, -1, hCPE->last_element_mode ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -254,7 +265,11 @@ ivas_error ivas_mct_dec(


        /* synthesis synchronization between stereo modes */
#ifdef OSBA_MONO_STEREO_OUTPUT
        if ( !st_ivas->sba_dirac_stereo_flag || ( st_ivas->ivas_format == SBA_ISM_FORMAT && cpe_id < nCPE - 2 ) )
#else
        if ( !st_ivas->sba_dirac_stereo_flag )
#endif
        {
            synchro_synthesis( ivas_total_brate, hCPE, output + cpe_id * CPE_CHANNELS, output_frame, 0 );
        }
Loading