Commit cd8a633d authored by vaclav's avatar vaclav
Browse files

editorial improvements

parent 7e7e171f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3754,9 +3754,10 @@ void ivas_sba_prototype_renderer(

/* AGC */
#ifdef AGC_ENABLE_FOR_LBR
/*! r: AGC enable flag */
int16_t ivas_agc_enc_get_flag(
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
    int16_t agc_configuration,                             /* i  : configuration used when encoder was initialised from cmd line */
    int16_t agc_configuration,                                  /* i  : AGC configuration from command-line     */
#endif
    int16_t nchan_transport                                     /* i  : number of transport channels            */
);
+7 −2
Original line number Diff line number Diff line
@@ -79,11 +79,13 @@ static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_
 *-----------------------------------------------------------------------------------------*/
#endif

/*! r: AGC enable flag */
int16_t ivas_agc_enc_get_flag(
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
    int16_t agc_configuration,
    int16_t agc_configuration, /* i  : AGC configuration from command-line     */
#endif
    int16_t nchan_transport )
    int16_t nchan_transport /* i  : number of transport channels            */
)
{
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
    return (int16_t) ( ( agc_configuration == SBA_AGC_DEFAULT )
@@ -143,6 +145,7 @@ static void ivas_agc_enc_init(
    return;
}


/*-------------------------------------------------------------------------
 * ivas_spar_agc_enc_open()
 *
@@ -187,6 +190,7 @@ ivas_error ivas_spar_agc_enc_open(
    return IVAS_ERR_OK;
}


/*-------------------------------------------------------------------------
 * ivas_spar_agc_enc_close()
 *
@@ -219,6 +223,7 @@ void ivas_spar_agc_enc_close(
    return;
}


/*-----------------------------------------------------------------------------------------*
 * Function ivas_agc_enc_process()
 *
+11 −27
Original line number Diff line number Diff line
@@ -123,20 +123,21 @@ ivas_error ivas_spar_enc_open(
#ifdef AGC_ENABLE_FOR_LBR
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
    hSpar->AGC_Enable = ivas_agc_enc_get_flag( hEncoderConfig->Opt_AGC_ON, nchan_transport );
    hSpar->hAgcEnc = NULL;
#else
    hSpar->AGC_Enable = ivas_agc_enc_get_flag( nchan_transport );
#endif
#endif
    if (

#ifdef AGC_ENABLE_FOR_LBR
        hSpar->AGC_Enable &&
    hSpar->hAgcEnc = NULL;
    if ( hSpar->AGC_Enable )
#endif
        ( error = ivas_spar_agc_enc_open( &hSpar->hAgcEnc, input_Fs, nchan_inp ) ) != IVAS_ERR_OK )
    {
        if ( ( error = ivas_spar_agc_enc_open( &hSpar->hAgcEnc, input_Fs, nchan_inp ) ) != IVAS_ERR_OK )
        {
            return error;
        }

    }
    /* PCA handle */
    hSpar->hPCA = NULL;
    if ( hEncoderConfig->Opt_PCA_ON )
@@ -242,7 +243,6 @@ void ivas_spar_enc_close(
            hSpar->hFrontVad = NULL;
        }


        num_chans = hSpar->hFbMixer->fb_cfg->num_in_chans;
        assert( num_chans <= nchan_inp );

@@ -259,14 +259,7 @@ void ivas_spar_enc_close(
        ivas_spar_transient_det_close( &hSpar->hTranDet );

        /* AGC */
#ifdef AGC_ENABLE_FOR_LBR
        if ( hSpar->hAgcEnc != NULL )
        {
#endif
        ivas_spar_agc_enc_close( &hSpar->hAgcEnc );
#ifdef AGC_ENABLE_FOR_LBR
        }
#endif

        /* PCA */
        if ( hSpar->hPCA != NULL )
@@ -391,7 +384,6 @@ static ivas_error ivas_spar_enc_process(
        mvr2r( data_f[HOA_keep_ind[i]], data_f[i], input_frame );
    }


    /*-----------------------------------------------------------------------------------------*
     * Transient detector
     *-----------------------------------------------------------------------------------------*/
@@ -445,17 +437,13 @@ static ivas_error ivas_spar_enc_process(
        p_pcm_tmp[i] = pcm_tmp[i];
    }


    dtx_vad = ( hEncoderConfig->Opt_DTX_ON == 1 ) ? front_vad_flag : 1;

    /*-----------------------------------------------------------------------------------------*
     * DirAC encoding
     *-----------------------------------------------------------------------------------------*/

    ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes,
                              data_f, ppIn_FR_real, ppIn_FR_imag, input_frame,
                              st_ivas->sba_mode );

    ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, st_ivas->sba_mode );

    if ( hQMetaData->q_direction->cfg.nbands > 0 )
    {
@@ -540,7 +528,6 @@ static ivas_error ivas_spar_enc_process(
        }
    }


    /*-----------------------------------------------------------------------------------------*
     * Covariance process
     *-----------------------------------------------------------------------------------------*/
@@ -565,8 +552,7 @@ static ivas_error ivas_spar_enc_process(
    if ( hSpar->hMdEnc->table_idx != table_idx )
    {
        hSpar->hMdEnc->table_idx = table_idx;
        ivas_spar_set_bitrate_config( &hSpar->hMdEnc->spar_md_cfg, table_idx,
                                      ( hSpar->hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND );
        ivas_spar_set_bitrate_config( &hSpar->hMdEnc->spar_md_cfg, table_idx, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? IVAS_MAX_NUM_BANDS : SPAR_DIRAC_SPLIT_START_BAND );
    }

    nchan_transport = st_ivas->nchan_transport;
@@ -620,9 +606,7 @@ static ivas_error ivas_spar_enc_process(
        }

        ivas_get_spar_md_from_dirac( azi_dirac, ele_dirac, diffuseness, 1, hSpar->hMdEnc->mixer_mat, &hSpar->hMdEnc->spar_md, &hSpar->hMdEnc->spar_md_cfg,
                                     d_start_band, d_end_band,
                                     ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order,
                                     dtx_vad, Wscale_d );
                                     d_start_band, d_end_band, ( hSpar->hMdEnc->spar_hoa_md_flag ) ? 1 : sba_order, dtx_vad, Wscale_d );
    }

    if ( hSpar->hMdEnc->spar_hoa_md_flag )
+3 −0
Original line number Diff line number Diff line
@@ -480,8 +480,10 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics(
    hEncoderConfig->element_mode_init = IVAS_SCE; /* Just needs to be something not mono, will be set later */
    hEncoderConfig->sba_planar = isPlanar;
    hEncoderConfig->sba_order = order;

    /* Input in ACN/SN3D in all cases (3D and planar): get number of channels */
    hEncoderConfig->nchan_inp = ivas_sba_get_nchan( hEncoderConfig->sba_order, 0 ); /*planar input arg. deliberately set to zero since input always in ACN/SN3D*/

#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
#ifdef AGC_ENABLE_FOR_LBR
    if ( ( error = agcAPIToInternal( Opt_AGC_ON, &( hEncoderConfig->Opt_AGC_ON ) ) ) != IVAS_ERR_OK )
@@ -492,6 +494,7 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics(
    hEncoderConfig->Opt_AGC_ON = (int16_t) Opt_AGC_ON;
#endif /* AGC_ENABLE_FOR_LBR */
#endif /* DEBUG_AGC_ENCODER_CMD_OPTION */

    hEncoderConfig->Opt_PCA_ON = (int16_t) Opt_PCA_ON;

    hIvasEnc->maxBandwidthUser = max_bwidth_user;