Commit 1e203168 authored by fotopoulou's avatar fotopoulou
Browse files

enable EXT output under OSBA_EXT_OUT

parent a575435e
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -81,7 +81,11 @@ static
#define MAX_FRAME_SIZE ( 48000 / 50 )
#endif
#define MAX_NUM_OUTPUT_CHANNELS 16
#ifdef OSBA_EXT_OUT
#define MAX_OUTPUT_PCM_BUFFER_SIZE ( ( MAX_NUM_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) * MAX_FRAME_SIZE )
#else
#define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE )
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define MAX_SPLIT_REND_BITRATE                   ( 1792000 ) /* TODO tmu: unify with SPLIT_REND_MAX_BRATE ?*/
#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
@@ -1680,9 +1684,12 @@ static ivas_error initOnFirstGoodFrame(
            fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error );
            return error;
        }

        /* If outputting ISM, get number of objects, open output files and write zero metadata for initial bad frames */
#ifdef OSBA_EXT_OUT
        if ( *pBsFormat == IVAS_DEC_BS_OBJ || *pBsFormat == IVAS_DEC_BS_SBA_ISM )
#else
        if ( *pBsFormat == IVAS_DEC_BS_OBJ )
#endif
        {
            if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, pNumObj ) ) != IVAS_ERR_OK )
            {
@@ -2078,7 +2085,11 @@ static ivas_error decodeG192(
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT )
        {
#ifdef OSBA_EXT_OUT
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_SBA_ISM )
#else
            if ( bsFormat == IVAS_DEC_BS_OBJ )
#endif
            {
                if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK )
                {
+1 −0
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@
#ifdef SBA_AND_OBJECTS
#define OSBA_DISC_OBJ_MCT
#define ENABLE_ISM_MD_CODING
#define OSBA_EXT_OUT
#endif
/* ################## End BE DEVELOPMENT switches ######################### */

+20 −6
Original line number Diff line number Diff line
@@ -62,7 +62,11 @@ ivas_error ivas_dec(
{
    int16_t n, output_frame, nchan_out;
    Decoder_State *st; /* used for bitstream handling */
#ifdef OSBA_EXT_OUT
    float output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */
#else
    float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */
#endif
    int16_t nchan_remapped;
    float output_lfe_ch[L_FRAME48k];
#ifndef OSBA_DISC_OBJ_MCT
@@ -74,7 +78,11 @@ ivas_error ivas_dec(
    AUDIO_CONFIG output_config;
    float pan_left, pan_right;
    ivas_error error;
#ifdef OSBA_EXT_OUT
    float *p_output[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS];
#else
    float *p_output[MAX_OUTPUT_CHANNELS];
#endif
#ifdef VLBR_20MS_MD
    int16_t num_md_sub_frames;
#endif
@@ -110,7 +118,11 @@ ivas_error ivas_dec(

    output_frame = ( int16_t )( output_Fs / FRAMES_PER_SEC );

#ifdef OSBA_EXT_OUT
    for ( n = 0; n < nchan_out; n++ )
#else
    for ( n = 0; n < MAX_OUTPUT_CHANNELS; n++ )
#endif
    {
        p_output[n] = &output[n][0];
    }
@@ -567,9 +579,11 @@ ivas_error ivas_dec(
                return error;
            }
        }
        else
        else /*HOA3 rendering for now*/
        {
            /* Todo OSBA: Implement other outputs. */
#ifdef OSBA_EXT_OUT
            ivas_sba_upmixer_renderer( st_ivas, &output[st_ivas->nchan_ism], output_frame );
#endif
        }
    }
#endif
+25 −7
Original line number Diff line number Diff line
@@ -779,6 +779,14 @@ ivas_error ivas_init_decoder(

    if ( output_config == AUDIO_CONFIG_EXTERNAL )
    {
#ifdef OSBA_EXT_OUT
        if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
            hDecoderConfig->nchan_out = audioCfg2channels( AUDIO_CONFIG_HOA3 ); /*TODOfto: only hoa3 ouput for now*/
            hDecoderConfig->nchan_out += st_ivas->nchan_ism;
        }
        else
#endif
            if ( !( st_ivas->ism_mode == ISM_MODE_PARAM ) )
        {
            hDecoderConfig->nchan_out = st_ivas->nchan_transport;
@@ -794,6 +802,16 @@ ivas_error ivas_init_decoder(

    ivas_output_init( &( st_ivas->hOutSetup ), output_config );

#ifdef OSBA_EXT_OUT
    if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL )
    {
        st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER;
        st_ivas->intern_config = AUDIO_CONFIG_HOA3;
        st_ivas->hOutSetup.output_config = AUDIO_CONFIG_HOA3;
        st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( AUDIO_CONFIG_HOA3 );
    }
#endif

    /* Only initialize transport setup if it is used */
    if ( st_ivas->transport_config != AUDIO_CONFIG_INVALID )
    {
+4 −0
Original line number Diff line number Diff line
@@ -397,7 +397,11 @@ void ivas_renderer_select(
#endif
    {
        *renderer_type = RENDERER_DIRAC;
#ifdef OSBA_EXT_OUT
        if ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) &&
#else
        if ( st_ivas->ivas_format == SBA_FORMAT &&
#endif
             ( output_config != AUDIO_CONFIG_5_1 && output_config != AUDIO_CONFIG_5_1_2 && output_config != AUDIO_CONFIG_5_1_4 && output_config != AUDIO_CONFIG_7_1 && output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_LS_CUSTOM && output_config != AUDIO_CONFIG_MONO && output_config != AUDIO_CONFIG_STEREO ) )
        {
            if ( output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_FOA )
Loading