Commit f91e7283 authored by PLAINSI's avatar PLAINSI
Browse files

Checking in a few draft chunks of code

parent ebe50d64
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@
#define FIX_545_ASSERT                                  /* VA: fix issue 545, replace assert() with warning message when hitting memory limit in the buffer of indices */
#endif

#define JBM_PARAMUPMIX

#define FIX_383_CLEAN_UP                                /* Dlb : Clean up of unused functions */
#define FIX_532_ISM_MD_INACTIVE                         /* VA: issue 532: improve MD coding in ISM inactive frames */
#define FIX_547_NAN_IGF_DEC                             /* FhG: issue 547: fix possible nan in IGF decoder */
+75 −0
Original line number Diff line number Diff line
@@ -350,6 +350,81 @@ ivas_error ivas_jbm_dec_tc(
                }
            }
        }
#ifdef JBM_PARAMUPMIX
        else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX )
        {
            ivas_lfe_dec( st_ivas->hLFE, st, output_frame, st_ivas->bfi, output_lfe_ch );

            ivas_mc_paramupmix_dec_read_BS( st_ivas, st, st_ivas->hMCParamUpmix, &nb_bits_metadata[0] );

            if ( ( error = ivas_mct_dec( st_ivas, output, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
            {
                return error;
            }

            mvr2r( output_lfe_ch, output[LFE_CHANNEL], output_frame );

            ivas_mc_paramupmix_dec( st_ivas, output );

            /* HP filtering */
            for ( n = 0; n < st_ivas->nchan_transport; n++ )
            {
                if ( n != LFE_CHANNEL )
                {
                    hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs );
                }
            }

            if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) )
            {
                ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE );
            }

            /* Rendering */
            if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO )
            {
                ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output );
            }
#if 0 
            /* Rendering */
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
            {
                if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig,
                                                       st_ivas->hCombinedOrientationData,
                                                       &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs ) ) != IVAS_ERR_OK )
                {
                    return error;
                }

                ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output );
            }
            else if ( st_ivas->renderer_type == RENDERER_MC )
            {
                if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) )
                {
                    ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output );
                }
                else
                {
                    ivas_ls_setup_conversion( st_ivas, MC_PARAMUPMIX_MAX_INPUT_CHANS, output_frame, p_output, p_output );
                }
            }
            else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
            {
                ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f );
            }
            else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD )
            {
                if ( ( ivas_td_binaural_renderer( st_ivas, p_output, output_frame ) ) != IVAS_ERR_OK )
                {
                    return error;
                }

                ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output );
            }
#endif
        }
#endif
        else if ( st_ivas->mc_mode == MC_MODE_PARAMMC )
        {
            /* read Parametric MC parameters from the bitstream */
+32 −0
Original line number Diff line number Diff line
@@ -307,6 +307,10 @@ ivas_error ivas_mc_paramupmix_dec_open(
    int16_t nchan_transport;
    uint16_t i;
    ivas_error error;
#ifdef JBM_PARAMUPMIX
    int16_t num_channels_internal;
    num_channels_internal = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS;
#endif

    error = IVAS_ERR_OK;

@@ -356,6 +360,34 @@ ivas_error ivas_mc_paramupmix_dec_open(
        set_zero( hMCParamUpmix->pcm_delay[i], 240 );
    }

#ifdef JBM_PARAMUPMIX
    /* allocate transport channels*/
    if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL )
    {
        int16_t nchan_to_allocate;
        int16_t nchan_tc;
        TC_BUFFER_MODE buffer_mode;

        buffer_mode = TC_BUFFER_MODE_RENDERER;
        nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas );
        nchan_to_allocate = num_channels_internal;
        if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO )
        {
            buffer_mode = TC_BUFFER_MODE_BUFFER;
            nchan_tc = st_ivas->hDecoderConfig->nchan_out;
            nchan_to_allocate = nchan_tc;
        }
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            nchan_to_allocate = 2 * BINAURAL_CHANNELS;
        }
        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, buffer_mode, nchan_tc, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
        {
            return error;
        }
    }
#endif

    st_ivas->hMCParamUpmix = hMCParamUpmix;

    return error;