Commit 968fd04e authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept NONBE_1303_REND_GRANULARITY

parent 93f9a311
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -903,16 +903,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(

/*! r: render granularity */
int16_t ivas_jbm_dec_get_render_granularity(
#ifdef NONBE_1303_REND_GRANULARITY
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                               */
    const RENDERER_TYPE renderer_type_sec,                      /* i  : secondary renderer type                                     */
    const int32_t output_Fs                                     /* i  : sampling rate                                               */
#else
    const RENDERER_TYPE rendererType, /* i  : renderer type     */
    const IVAS_FORMAT ivas_format,    /* i  : ivas format */
    const MC_MODE mc_mode,            /* i  : MC mode */
    const int32_t output_Fs           /* i  : sampling rate     */
    #endif
);

ivas_error ivas_jbm_dec_tc_buffer_open(
+0 −1
Original line number Diff line number Diff line
@@ -180,7 +180,6 @@
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_1300_TDREND_LARGE_ITD                     /* Eri: issue 1300: There was a bug feeding 1.25 ms frames to the TD renderer, causing out-of-buffer access. This was resolved. However, it is still possible that modeled HRTF with large ITDs could trigger out-of-buffer access. This adds a check to prevent this.*/
#define FIX_1384_MSAN_stereo_tcx_core_enc               /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */
#define FIX_1384_MSAN_ivas_spar_dec_open                /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/
+0 −39
Original line number Diff line number Diff line
@@ -2132,15 +2132,6 @@ ivas_error ivas_init_decoder(
                return error;
            }
        }
#ifndef NONBE_1303_REND_GRANULARITY
        granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES );
        n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );

        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif
    }
    else if ( st_ivas->renderer_type == RENDERER_MC )
    {
@@ -2173,30 +2164,6 @@ ivas_error ivas_init_decoder(
        }

        st_ivas->binaural_latency_ns = st_ivas->hCrendWrapper->binaural_latency_ns;
#ifndef NONBE_1303_REND_GRANULARITY
        if ( ( st_ivas->ivas_format == MC_FORMAT ) && ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) )
        {
            granularity = NS2SA( output_Fs, CLDFB_SLOT_NS );

            n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );

            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, MC_PARAMUPMIX_MAX_INPUT_CHANS, MC_PARAMUPMIX_MAX_INPUT_CHANS, granularity ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
        else
        {
            granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES );

            n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );

            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
#endif
    }

    if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
@@ -2398,16 +2365,10 @@ ivas_error ivas_init_decoder(
    if ( st_ivas->hTcBuffer == NULL )
    {
        /* no module has yet open the TC buffer, open a default one */
#ifdef NONBE_1303_REND_GRANULARITY
        granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, ivas_renderer_secondary_select( st_ivas ), output_Fs );
        n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );

        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, ivas_jbm_dec_get_tc_buffer_mode( st_ivas ), n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, granularity ) ) != IVAS_ERR_OK )
#else
        n_channels_transport_jbm = ivas_jbm_dec_get_num_tc_channels( st_ivas );

        if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, ivas_jbm_dec_get_tc_buffer_mode( st_ivas ), n_channels_transport_jbm, n_channels_transport_jbm, n_channels_transport_jbm, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
+0 −4
Original line number Diff line number Diff line
@@ -124,11 +124,7 @@ static ivas_error ivas_ism_bitrate_switching_dec(

    /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv
            render what still fits in the new granularity */
#ifdef NONBE_1303_REND_GRANULARITY
    tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, st_ivas->hDecoderConfig->output_Fs );
#else
    tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs );
#endif

    if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity )
    {
+0 −14
Original line number Diff line number Diff line
@@ -412,11 +412,7 @@ ivas_error ivas_param_ism_dec_open(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
{
#ifdef NONBE_1303_REND_GRANULARITY
    int16_t i, granularity;
#else
    int16_t i;
#endif
    PARAM_ISM_DEC_HANDLE hParamIsmDec;
    IVAS_OUTPUT_SETUP hOutSetup;
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
@@ -552,9 +548,7 @@ ivas_error ivas_param_ism_dec_open(
    st_ivas->hParamIsmDec = hParamIsmDec;
    st_ivas->hSpatParamRendCom = hSpatParamRendCom;

#ifdef NONBE_1303_REND_GRANULARITY
    granularity = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, RENDERER_DISABLE, output_Fs );
#endif

    if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE )
    {
@@ -594,11 +588,7 @@ ivas_error ivas_param_ism_dec_open(

        if ( st_ivas->hTcBuffer == NULL )
        {
#ifdef NONBE_1303_REND_GRANULARITY
            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, granularity ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_RENDERER, nchan_transport, nchan_transport, nchan_full, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -611,11 +601,7 @@ ivas_error ivas_param_ism_dec_open(
        if ( st_ivas->hTcBuffer == NULL )
        {
            int16_t nchan_to_allocate = st_ivas->hDecoderConfig->nchan_out;
#ifdef NONBE_1303_REND_GRANULARITY
            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, granularity ) ) != IVAS_ERR_OK )
#else
            if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_BUFFER, nchan_to_allocate, nchan_to_allocate, nchan_to_allocate, NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ) ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
Loading