Commit 482a19ac authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch '2138-basop-PortMr2114-from-float-resolve-osba-object-editing-on-uninitialized-values' into 'main'

Port MR2114 and MR2222 from float to BASOP - Resolve "OSBA object-editing on uninitialized values

Closes #2138

See merge request !2424
parents 2aa01294 5a8fd88e
Loading
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1184,20 +1184,20 @@ void v_multc_acc_32_32(

void ivas_mono_stereo_downmix_mcmasa_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                          */
    Word32 *output_f_fx[],                                      /* i/o: synthesized core-coder transport channels/mono or stereo output */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/mono or stereo output */
    Word16 output_frame                                         /* i  : output frame length per channel                                 */
);

void ivas_apply_non_diegetic_panning_fx(
    Word32 *input_f_fx,                                         /* i  : non-diegetic object                              */
    Word32 *output_f_fx[],                                      /* i/o: core-coder transport mono channel/stereo output  */
    Word32 *output_fx[],                                        /* i/o: core-coder transport mono channel/stereo output  */
    const Word16 non_diegetic_pan_gain_fx,                      /* i  : non-diegetic panning gain                        */
    const Word16 output_frame                                   /* i  : output frame length per channel                  */
);

void ivas_ism_mono_dmx_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                */
    Word32 *output_f_fx[],                                      /* i/o: synthesized core-coder transport channels/mono output */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/mono output */
    const Word16 output_frame                                   /* i  : output frame length                                   */
);

@@ -2364,7 +2364,7 @@ void ivas_dirac_dec_render_fx(
    const UWord16 nSamplesAsked,                                /* i  : number of CLDFB slots requested             */
    UWord16 *nSamplesRendered,                                  /* o  : number of CLDFB slots rendered              */
    UWord16 *nSamplesAvailableNext,                             /* o  : number of CLDFB slots still to render       */
    Word32 *output_f[]                                          /* o  : rendered time signal                        */
    Word32 *output_fx[]                                         /* o  : rendered time signal                        */
);

void ivas_dirac_dec_read_BS_fx(
@@ -2557,7 +2557,7 @@ void ivas_omasa_dirac_rend_jbm_fx(
    UWord16 *nSamplesRendered,                                  /* o  : number of samples rendered              */
    UWord16 *nSamplesAvailable,                                 /* o  : number of samples still to render       */
    const Word16 nchan_transport,                               /* i  : number of transport channels            */
    Word32 *output_f[]                                          /* o  : rendered time signal                    */
    Word32 *output_fx[]                                         /* o  : rendered time signal                    */
);

ivas_error ivas_jbm_dec_render_fx(
@@ -4065,7 +4065,7 @@ ivas_error ivas_init_encoder_fx(
);

ivas_error ivas_output_buff_dec_fx(
    Word32 *p_output_f[],                                       /* i/o: output audio buffers                        */
    Word32 *p_output_fx[],                                      /* i/o: output audio buffers                        */
    const Word16 nchan_out_buff_old,                            /* i  : previous frame number of output channels    */
    const Word16 nchan_out_buff                                 /* i  : number of output channels                   */
);
@@ -4348,7 +4348,7 @@ void ivas_param_ism_dec_render_fx(
    const UWord16 nSamplesAsked,                                /* i  : number of CLDFB slots requested             */
    UWord16 *nSamplesRendered,                                  /* o  : number of CLDFB slots rendered              */
    UWord16 *nSamplesAvailable,                                 /* o  : number of CLDFB slots still to render       */
    Word32 *output_f_fx[]                                       /* i/o: synthesized core-coder TCs / rendered signal*/
    Word32 *output_fx[]                                         /* i/o: synthesized core-coder TCs / rendered signal*/
);

void ivas_param_ism_params_to_masa_param_mapping_fx(
@@ -5151,7 +5151,7 @@ void ivas_param_mc_dec_render_fx(
    const UWord16 nSamplesAsked,                                /* i  : number of CLDFB slots requested                 */
    UWord16 *nSamplesRendered,                                  /* o  : number of CLDFB slots rendered                  */
    UWord16 *nSamplesAvailable,                                 /* o  : number of CLDFB slots still to render           */
    Word32 *output_f_fx[],                                      /* o  : rendered time signal                            */
    Word32 *output_fx[],                                        /* o  : rendered time signal                            */
    Word16 channel_active_fx[MAX_OUTPUT_CHANNELS] 
);

@@ -5349,7 +5349,7 @@ void ivas_spar_dec_close_fx(
);

ivas_error ivas_sba_linear_renderer_fx(
    Word32 *output_f[],                                         /* i/o: synthesized core-coder transport channels/DirAC output  */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output  */
    const Word16 output_frame,                                  /* i  : output frame length per channel                         */
    const Word16 nchan_in,                                      /* i  : number of input ambisonics channels                     */
    const Word16 nchan_ism,                                     /* i  : number of objects                                       */
+3 −1
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/
#define LIB_DEC_REVISION                                /* VA: cleaning and simplification of lib_dec.c */
#define UNIFIED_DECODING_PATHS_LEFTOVERS                /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */
#define FIX_NCHAN_BUFFERS                               /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */
#define FIX_RENDERER_STACK                              /* VA: issue 1322: reduction of renderers' buffers size */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
@@ -120,7 +122,7 @@
#define FIX_1217_OBJECT_EDIT_FILE_INTERFACE             /* Nokia: issue #1217: add decoder functionality to read object edit instructions from a file */
#define NONBE_1217_OBJ_EDIT_FOA                         /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */
#define NONBE_FIX_1255_OBJ_EDIT_JBM                     /* VA: issue 1255: restore object editing in JBM */

#define FIX_1372_OSBA_OBJECT_EDITING                    /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */

/* #################### End BASOP porting switches ############################ */

+30 −9
Original line number Diff line number Diff line
@@ -2075,20 +2075,28 @@ void ivas_dirac_dec_render_fx(
    Word16 temp = 0;
    move16();
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
    Word32 *output_f_local_fx[MAX_OUTPUT_CHANNELS];
    Word32 output_f_local_buff_fx[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 };
    Word32 *output_fx_local[MAX_OUTPUT_CHANNELS];
#ifdef FIX_RENDERER_STACK
    Word32 *p_output_fx[MAX_OUTPUT_CHANNELS];
    Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES];
#else
    Word32 output_fx_local_buff[MAX_OUTPUT_CHANNELS][L_FRAME48k] = { 0 };
#endif

    hSpatParamRendCom = st_ivas->hSpatParamRendCom;

    nchan_intern = add( st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hIntSetup.num_lfe );
    FOR( ch = 0; ch < nchan_intern; ch++ )
    {
        output_f_local_fx[ch] = output_f_local_buff_fx[ch];
        set_zero_fx( output_f_local_fx[ch], nSamplesAsked );
        output_fx_local[ch] = output_fx_local_buff[ch];
#ifdef FIX_RENDERER_STACK
        p_output_fx[ch] = output_fx[ch];
#else
        set_zero_fx( output_fx_local[ch], nSamplesAsked );
#endif
    }
    slot_size = NS2SA_FX2( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); // cL


    /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */
    slots_to_render = s_min( sub( hSpatParamRendCom->num_slots, hSpatParamRendCom->slots_rendered ), idiv1616( nSamplesAsked, slot_size ) );

@@ -2108,29 +2116,42 @@ void ivas_dirac_dec_render_fx(

    FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        ivas_dirac_dec_render_sf_fx( st_ivas, output_f_local_fx, nchan_transport, NULL, NULL );
        ivas_dirac_dec_render_sf_fx( st_ivas, output_fx_local, nchan_transport, NULL, NULL );

        n_samples_sf = i_mult( hSpatParamRendCom->subframe_nbslots[subframe_idx], hSpatParamRendCom->slot_size );

        FOR( ch = 0; ch < nchan_intern; ch++ )
        {
            output_f_local_fx[ch] += n_samples_sf;
#ifdef FIX_RENDERER_STACK
            /* move to output */
            test();
            test();
            IF( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( EQ_16( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, ch ) || EQ_16( add( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, 1 ), ch ) ) ) )
            {
                Copy32( output_fx_local_buff[ch], p_output_fx[ch], n_samples_sf );
            }

            p_output_fx[ch] += n_samples_sf;
#else
            output_fx_local[ch] += n_samples_sf;
#endif
        }

        /* update combined orientation access index */
        ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_sf );
    }

#ifndef FIX_RENDERER_STACK
    FOR( ch = 0; ch < nchan_intern; ch++ )
    {
        test();
        test();
        IF( !( ( st_ivas->hDirACRend->hOutSetup.separateChannelEnabled ) && ( ( EQ_16( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, ch ) || EQ_16( add( st_ivas->hDirACRend->hOutSetup.separateChannelIndex, 1 ), ch ) ) ) ) )
        {
            Copy32( output_f_local_buff_fx[ch], output_fx[ch], *nSamplesRendered );
            Copy32( output_fx_local_buff[ch], output_fx[ch], *nSamplesRendered );
        }
    }

#endif
    /* clang-format off */
    IF( EQ_16( hSpatParamRendCom->slots_rendered, hSpatParamRendCom->num_slots ) )
    {
+6 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ ivas_error ivas_dec_setup(
    }

    /*-------------------------------------------------------------------*
     * Read other signling (ISM/MC mode, number of channels, etc.)
     * Read other signaling (ISM/MC mode, number of channels, etc.)
     *-------------------------------------------------------------------*/

    IF( is_DTXrate( ivas_total_brate ) == 0 )
@@ -2953,7 +2953,12 @@ ivas_error ivas_init_decoder_fx(
     * Allocate output audio buffers
     *-----------------------------------------------------------------*/

#ifdef FIX_NCHAN_BUFFERS
    k = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate );
    FOR( n = 0; n < k; n++ )
#else
    FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, ivas_total_brate ); n++ )
#endif
    {
        /* note: these are intra-frame heap memories */
        IF( ( st_ivas->p_output_fx[n] = (Word32 *) malloc( ( 48000 / FRAMES_PER_SEC ) * sizeof( Word32 ) ) ) == NULL )
+9 −9
Original line number Diff line number Diff line
@@ -1620,7 +1620,7 @@ static void ivas_ism_param_dec_render_sf_fx(
    const Word16 nchan_transport,
    const Word16 nchan_out,
    const Word16 nchan_out_woLFE,
    Word32 *output_f_fx[], /*Q_output*/
    Word32 *output_fx[], /*Q_output*/
    Word16 Q_output[] )
{
    Word16 ch, slot_idx, i, index_slot, cldfb_idx;
@@ -1690,7 +1690,7 @@ static void ivas_ism_param_dec_render_sf_fx(
        test();
        IF( ( hSetup.num_lfe > 0 ) && EQ_16( hSetup.index_lfe[idx_lfe], ch ) )
        {
            set32_fx( output_f_fx[ch], 0, i_mult( hSpatParamRendCom->subframe_nbslots[subframe_idx], hSpatParamRendCom->num_freq_bands ) );
            set32_fx( output_fx[ch], 0, i_mult( hSpatParamRendCom->subframe_nbslots[subframe_idx], hSpatParamRendCom->num_freq_bands ) );

            if ( LT_16( idx_lfe, sub( hSetup.num_lfe, 1 ) ) )
            {
@@ -1724,7 +1724,7 @@ static void ivas_ism_param_dec_render_sf_fx(
            Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( sub( Q_real, 1 ), Q11 ) ); // Q_real-1
            st_ivas->cldfbSynDec[ch]->Q_cldfb_state = sub( Q_real, 1 );
            move16();
            cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, 0, st_ivas->cldfbSynDec[ch] );
            cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, 0, st_ivas->cldfbSynDec[ch] );
            Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( Q11, sub( Q_real, 1 ) ) ); // Q11
            st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11;
            move16();
@@ -1741,7 +1741,7 @@ static void ivas_ism_param_dec_render_sf_fx(
            }

            size_cldfb = imult1616( st_ivas->cldfbSynDec[ch]->no_channels, no_col_cldfb );
            Scale_sig32( output_f_fx[ch], size_cldfb, sub( Q11, sub( Q_real, 1 ) ) ); // Q11
            Scale_sig32( output_fx[ch], size_cldfb, sub( Q11, sub( Q_real, 1 ) ) ); // Q11

            Q_output[ch] = 11;
            move16();
@@ -1769,7 +1769,7 @@ void ivas_param_ism_dec_render_fx(
    const UWord16 nSamplesAsked,    /* i  : number of CLDFB slots requested                 */
    UWord16 *nSamplesRendered,      /* o  : number of CLDFB slots rendered                  */
    UWord16 *nSamplesAvailableNext, /* o  : number of CLDFB slots still to render           */
    Word32 *output_f_fx[]           /* i/o: synthesized core-coder TCs / rendered signal Q11*/
    Word32 *output_fx[]             /* i/o: synthesized core-coder TCs / rendered signal Q11*/
)
{
    Word16 ch, slots_to_render, first_sf, last_sf, subframe_idx;
@@ -1778,7 +1778,7 @@ void ivas_param_ism_dec_render_fx(
    SPAT_PARAM_REND_COMMON_DATA_HANDLE hSpatParamRendCom;
    IVAS_OUTPUT_SETUP hSetup;
    Word16 nchan_transport, nchan_out, nchan_out_woLFE;
    Word32 *output_f_local_fx[MAX_OUTPUT_CHANNELS];
    Word32 *output_fx_local[MAX_OUTPUT_CHANNELS];
    Word16 Q_output[MAX_OUTPUT_CHANNELS];

    set16_fx( Q_output, 0, MAX_OUTPUT_CHANNELS );
@@ -1827,17 +1827,17 @@ void ivas_param_ism_dec_render_fx(

    FOR( ch = 0; ch < nchan_out; ch++ )
    {
        output_f_local_fx[ch] = &output_f_fx[ch][0];
        output_fx_local[ch] = &output_fx[ch][0];
    }

    FOR( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        ivas_ism_param_dec_render_sf_fx( st_ivas, hSetup, nchan_transport, nchan_out, nchan_out_woLFE, output_f_local_fx, Q_output );
        ivas_ism_param_dec_render_sf_fx( st_ivas, hSetup, nchan_transport, nchan_out, nchan_out_woLFE, output_fx_local, Q_output );

        n_samples_sf = i_mult( hSpatParamRendCom->subframe_nbslots[subframe_idx], hSpatParamRendCom->slot_size );
        FOR( ch = 0; ch < nchan_out; ch++ )
        {
            output_f_local_fx[ch] += n_samples_sf;
            output_fx_local[ch] += n_samples_sf;
        }
    }

Loading