Commit bd0762f1 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

changes as per review comments

parent 2b74dee8
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4024,6 +4024,10 @@ ivas_error ivas_spar_md_dec_init(
    ivas_spar_md_dec_state_t *hMdDec,                           /* 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  : SBA order                */
#endif
);

void ivas_spar_md_dec_process(
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ typedef INT64 int64_t;
/* This is the maximum number of allocations for which to keep information.
   It can be increased if required. */
#ifdef SBA_BR_SWITCHING
#define MAX_INFO_RECORDS 3200
#define MAX_INFO_RECORDS 5000
#else
#define MAX_INFO_RECORDS 3000
#endif
+6 −1
Original line number Diff line number Diff line
@@ -666,7 +666,12 @@ static void ivas_spar_dec_MD(
                hSpar->hMdDec->table_idx = table_idx;
                hSpar->hTdDecorr->ducking_flag = ivas_spar_br_table_consts[table_idx].td_ducking;

                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels );
                ivas_spar_md_dec_init( hSpar->hMdDec, hDecoderConfig, num_channels
#ifdef SBA_HOA_HBR_IMPROV
                                       ,
                                       sba_order
#endif
                );
            }
        }

+12 −5
Original line number Diff line number Diff line
@@ -271,12 +271,14 @@ ivas_error ivas_spar_md_dec_open(
        return error;
    }

#ifdef SBA_HOA_HBR_IMPROV
    hMdDec->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hDecoderConfig->ivas_total_brate );
#endif
    hMdDec->table_idx = 0; /* just to initialize state variables*/

    if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels ) ) != IVAS_ERR_OK )
    if ( ( error = ivas_spar_md_dec_init( hMdDec, hDecoderConfig, num_channels
#ifdef SBA_HOA_HBR_IMPROV
                                          ,
                                          sba_order
#endif
                                          ) ) != IVAS_ERR_OK )
    {
        return error;
    }
@@ -438,6 +440,10 @@ ivas_error ivas_spar_md_dec_init(
    ivas_spar_md_dec_state_t *hMdDec,           /* 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  : SBA order                */
#endif
)
{
    int16_t i, j, k;
@@ -447,6 +453,7 @@ ivas_error ivas_spar_md_dec_init(
    hMdDec->spar_md_cfg.gen_bs = 1; // VE2DB : always 1 - can it be removed?

#ifdef SBA_HOA_HBR_IMPROV
    hMdDec->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hDecoderConfig->ivas_total_brate );
    hMdDec->spar_md.num_bands = ( hMdDec->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND );
#else
    hMdDec->spar_md.num_bands = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND );
+3 −4
Original line number Diff line number Diff line
@@ -121,10 +121,6 @@ ivas_error ivas_spar_md_enc_open(

    num_channels = 2 * sba_order + 2;

#ifdef SBA_HOA_HBR_IMPROV
    hMdEnc->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hEncoderConfig->ivas_total_brate );
#endif

    if ( ( hMdEnc->spar_md.band_coeffs = (ivas_band_coeffs_t *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" );
@@ -319,6 +315,9 @@ static ivas_error ivas_spar_md_enc_init(
    float PR_minmax[2];
    int16_t num_channels, i, j, k;

#ifdef SBA_HOA_HBR_IMPROV
    hMdEnc->spar_hoa_md_flag = ivas_sba_get_spar_hoa_md_flag( sba_order, hEncoderConfig->ivas_total_brate );
#endif
    num_channels = ivas_sba_get_nchan_metadata( sba_order );

    table_idx = ivas_get_spar_table_idx( hEncoderConfig->ivas_total_brate, sba_order, SPAR_CONFIG_BW, NULL, NULL );