Commit 34c6b03f authored by TYAGIRIS's avatar TYAGIRIS
Browse files

Merge branch '91-sba-improvements-at-high-bitrates-with-hoa-input' into 'main'

[Non-BE] fix for issue 91: Improvements to SBA high bitrate HOA3 coding

See merge request !109
parents fb4dd681 3f5f2058
Loading
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -3028,6 +3028,10 @@ void ivas_dirac_param_est_enc(
    float **pp_fr_real,
    float **pp_fr_imag,
    const int16_t input_frame 
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                    
#endif
 );

/*----------------------------------------------------------------------------------*
@@ -3087,6 +3091,14 @@ int16_t ivas_sba_get_nchan_metadata(
    const int16_t sba_order                                     /* i  : Ambisonic (SBA) order                   */
);

#ifdef SBA_HOA_HBR_IMPROV
/*! r: get the flag to code SPAR HOA MD for all band  */
int16_t ivas_sba_get_spar_hoa_md_flag(
    const int16_t sba_order,       /* i  : Ambisonic (SBA) order            */
    const int32_t ivas_total_brate /* i  : IVAS total bitrate            */
);
#endif

void ivas_sba_zero_vert_comp(
    float sba_data[][L_FRAME48k],                               /* i/o: SBA data frame                          */
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                   */
@@ -3974,6 +3986,10 @@ ivas_error ivas_spar_md_dec_open(
    ivas_spar_md_dec_state_t **hMdDec_out,                      /* i/o: SPAR MD decoder handle                  */
    const DECODER_CONFIG_HANDLE hDecoderConfig,                 /* i  : configuration structure                 */
    const int16_t num_channels                                  /* i  : number of internal channels             */
#ifdef SBA_HOA_HBR_IMPROV
    ,
	const int16_t sba_order                            /* i  : flag to send HOA MD for all bands                */
#endif
);

void ivas_spar_md_dec_close(
@@ -4821,6 +4837,10 @@ void computeReferencePower_enc(
    float *reference_power,                                     /* o  : Estimated power                                 */
    const int16_t enc_param_start_band,                         /* i  : first band to process                           */
    const int16_t num_freq_bands                                /* i  : Number of frequency bands                       */
#ifdef SBA_HOA_HBR_IMPROV
	,
    const SBA_MODE sba_mode                                     /* i  : SBA mode                       */
#endif
);


+25 −0
Original line number Diff line number Diff line
@@ -281,6 +281,31 @@ int16_t ivas_sba_get_nchan_metadata(
    return ( nb_channels );
}

#ifdef SBA_HOA_HBR_IMPROV
/*-------------------------------------------------------------------*
 * ivas_sba_get_spar_hoa_md_flag()
 *
 * et the flag to code SPAR HOA MD for all band
 *-------------------------------------------------------------------*/

/*! r: get the flag to code SPAR HOA MD for all band  */
int16_t ivas_sba_get_spar_hoa_md_flag(
    const int16_t sba_order,       /* i  : Ambisonic (SBA) order            */
    const int32_t ivas_total_brate /* i  : IVAS total bitrate            */
)
{
    int16_t spar_hoa_md_flag = 0;
    if ( sba_order > 1 && ivas_total_brate >= IVAS_256k )
    {
        spar_hoa_md_flag = 1;
    }
    else
    {
        spar_hoa_md_flag = 0;
    }
    return spar_hoa_md_flag;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_zero_vert_comp()
+2 −1
Original line number Diff line number Diff line
@@ -1737,10 +1737,11 @@ void ivas_get_spar_md_from_dirac(

            /*SPAR from DirAC*/
            set_f( response_avg, 0.0f, MAX_OUTPUT_CHANNELS );
#ifndef SBA_HOA_HBR_IMPROV
            set_f( hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].pred_re, 0.0f, IVAS_SPAR_MAX_CH - 1 );
            set_f( &hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].C_re[0][0], 0.0f, ( IVAS_SPAR_MAX_CH - IVAS_SPAR_MAX_DMX_CHS ) * ( IVAS_SPAR_MAX_DMX_CHS - 1 ) );
            set_f( &hSpar_md->band_coeffs[band + i_ts * IVAS_MAX_NUM_BANDS].P_re[0], 0.0f, ( IVAS_SPAR_MAX_CH - 1 ) );

#endif
            if ( n_ts > 1 )
            {
                ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][i_ts], (int16_t) ele_dirac[band][i_ts], response_avg, order );

lib_com/options.h

100755 → 100644
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@
#define SBA_SPAR_HARM                                   /* Issue 92: maintenance of the SBA SPAR functions */
#define FIX_155_HP20_ISSUE                              /* Issue 155: apply hp20 on all input channels instead of just 2 channels */
#define EFAP_FIX_POLY                                   /* Issue 167: fix bug in EFAP polygon selection */

#define SBA_HOA_HBR_IMPROV                              /* issue 91: Improvements to SBA high bitrate HOA3 coding */


/* ################## End DEVELOPMENT switches ######################### */
+21 −2
Original line number Diff line number Diff line
@@ -89,7 +89,12 @@ ivas_error ivas_spar_dec_open(
    }

    /* MD handle */
    if ( ( error = ivas_spar_md_dec_open( &hSpar->hMdDec, st_ivas->hDecoderConfig, num_channels_internal ) ) != IVAS_ERR_OK )
    if ( ( error = ivas_spar_md_dec_open( &hSpar->hMdDec, st_ivas->hDecoderConfig, num_channels_internal
#ifdef SBA_HOA_HBR_IMPROV
                                          ,
                                          sba_order_internal
#endif
                                          ) ) != IVAS_ERR_OK )
    {
        return error;
    }
@@ -645,7 +650,16 @@ static void ivas_spar_dec_MD(
        {
            ivas_parse_spar_header( hDecoderConfig->ivas_total_brate, sba_order, st0, &table_idx );

#ifdef SBA_HOA_HBR_IMPROV
            if ( hSpar->hMdDec->spar_hoa_md_flag )
            {
                hSpar->hMdDec->spar_md.num_bands = IVAS_MAX_NUM_BANDS;
            }
            else
#endif
            {
                hSpar->hMdDec->spar_md.num_bands = min( SPAR_DIRAC_SPLIT_START_BAND, IVAS_MAX_NUM_BANDS );
            }

            if ( hSpar->hMdDec->table_idx != table_idx )
            {
@@ -788,7 +802,12 @@ void ivas_spar_get_parameters(

    weight = ivas_spar_get_cldfb_slot_gain( hSpar, hDecoderConfig, ts, &ts0, &ts1, &weight_20ms );

#ifdef SBA_HOA_HBR_IMPROV
    split_band = hSpar->hMdDec->spar_md.num_bands;
#else
    split_band = SPAR_DIRAC_SPLIT_START_BAND;
#endif

    for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ )
    {
        for ( out_ch = 0; out_ch < num_ch_out; out_ch++ )
Loading