Commit 8d4b036b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Fabian Bauer
Browse files

High MLD fixes, bug fixes and Q-info updates

[x] Fix for wrong q of exc buffers
[x] bug-fix in attack detection
[x] Removed saturations in find_enr_dft_fx and ivas_find_enr1
[x] Q documentation and Basop updation
[x] High mld fix for [basop_encoder-Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, 7_1_4 out]
[x] Bug fix related to bckr
parent 6a243efb
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -747,10 +747,8 @@ enum
#define PIT_UP_SAMP6                        6
#define PIT_L_INTERPOL6_2                   17
#define PIT_FIR_SIZE6_2                     ( PIT_UP_SAMP6 * PIT_L_INTERPOL6_2 + 1 )
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define E_MIN                               0.0035f                /* minimum allowable energy */
#define E_MIN_Q11_FX                            7                      /* minimum allowable energy in Q11*/
#define E_MIN_Q16_FX                         229                      /* minimum allowable energy in Q16*/
#define STEP_DELTA                          0.0625f                /* quantization step for tilt compensation of gaussian cb. excitation */
#define GAMMA_EV                            0.92f                  /* weighting factor for core synthesis error weighting */
#define FORMANT_SHARPENING_NOISE_THRESHOLD  21.0f                  /* lp_noise level above which formant sharpening is deactivated */
+20 −0
Original line number Diff line number Diff line
@@ -7282,6 +7282,26 @@ Word16 L_norm_arr( Word32 *arr, Word16 size )
    return q;
}

Word16 norm_arr( Word16 *arr, Word16 size )
{
    Word16 q = 15;
    Word16 exp = 0;
    move16();
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        if ( arr[i] != 0 )
        {
            exp = norm_s( arr[i] );
        }
        if ( arr[i] != 0 )
        {
            q = s_min( q, exp );
        }
    }
    return q;
}

Word16 get_min_scalefactor( Word32 x, Word32 y )
{
#ifndef FIX_1104_OPT_GETMINSCALEFAC
+19 −18
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ ivas_error create_cpe_enc(
    const int32_t element_brate                                 /* i  : element bitrate                         */
);

ivas_error create_mct_enc(
ivas_error create_mct_enc_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);

@@ -112,7 +112,7 @@ void destroy_cpe_enc(
    CPE_ENC_HANDLE hCPE                                         /* i/o: CPE encoder structure                   */
);

void ivas_mct_enc_close(
void ivas_mct_enc_close_fx(
    MCT_ENC_HANDLE *hMCT                                        /* i/o: MCT encoder structure                   */
);

@@ -775,7 +775,7 @@ Word16 ism_quant_meta_fx(
    const Word16 cbsize            /* i  : codebook size                       */
);

ivas_error ivas_ism_metadata_enc_create(
ivas_error ivas_ism_metadata_enc_create_fx(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                      */
    const int16_t n_ISms,                                       /* i  : number of objects                           */
    int32_t element_brate_tmp[]                                 /* o  : element bitrate per object                  */
@@ -818,11 +818,11 @@ ivas_error ivas_ism_metadata_dec(

/*! r: ISM format mode */

ivas_error ivas_param_ism_enc_open(
ivas_error ivas_param_ism_enc_open_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                      */
);

void ivas_param_ism_enc_close(
void ivas_param_ism_enc_close_fx(
    PARAM_ISM_CONFIG_HANDLE *hParamIsm,                         /* i/o: ParamISM handle                             */
    const int32_t input_Fs                                      /* i  : input sampling_rate                         */
);
@@ -890,7 +890,7 @@ void ivas_ism_dtx_dec(
    int16_t *nb_bits_metadata                                   /* o  : number of metadata bits                     */
);

void ivas_ism_metadata_sid_enc(
void ivas_ism_metadata_sid_enc_fx(
    ISM_DTX_HANDLE hISMDTX,                                     /* i/o: ISM DTX handle                              */
    const int16_t flag_noisy_speech,                            /* i  : noisy speech flag                           */
    const int16_t nchan_ism,                                    /* i  : number of objects                           */
@@ -917,7 +917,7 @@ void ivas_ism_metadata_sid_dec(
);


void ivas_param_ism_compute_noisy_speech_flag(
void ivas_param_ism_compute_noisy_speech_flag_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure              */
);

@@ -2712,11 +2712,11 @@ void ivas_dirac_dec_get_response(



ivas_error ivas_mc_paramupmix_enc_open(
ivas_error ivas_mc_paramupmix_enc_open_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                             */
);

void ivas_mc_paramupmix_enc_close(
void ivas_mc_paramupmix_enc_close_fx(
    MC_PARAMUPMIX_ENC_HANDLE *hMCParamUpmix,                    /* i/o: MC Param-Upmix encoder handle                   */
    const int32_t input_Fs                                      /* i  : input sampling rate                             */
);
@@ -3456,11 +3456,11 @@ void generate_gridEq(
    SPHERICAL_GRID_DATA *data                                   /* o  : data structure for grid                         */
);

ivas_error ivas_masa_enc_open(
ivas_error ivas_masa_enc_open_fx(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder handle                             */
);

void ivas_masa_enc_close(
void ivas_masa_enc_close_fx(
    MASA_ENCODER_HANDLE *hMasa                                  /* i/o: MASA metadata structure                         */
);

@@ -3792,6 +3792,7 @@ void ivas_mcmasa_split_brate(
void ivas_mcmasa_dmx_modify_fx(
  const Word16 n_samples,                                             /* i  : input frame length in samples                        */
  Word32 dmx_fx[][L_FRAME48k + NS2SA(48000, IVAS_FB_ENC_DELAY_NS)], /* i/o: downmix signal to be transformed into another format Qx*/
  Word16 dmx_Q[],                                                     /* i/o : Q of the intput signal which is being transformed*/
  const Word16 n_chnls_dmx_old,                                       /* i  : number of downmix channels in the old format        Q0 */
  const Word16 n_chnls_dmx_new                                      /* i  : number of downmix channels in the target format      Q0*/
);
@@ -3821,7 +3822,7 @@ ivas_error ivas_create_lfe_lpf_enc(
    const int32_t input_Fs                                      /* i  : input sampling rate                     */
);

void ivas_lfe_lpf_enc_close(
void ivas_lfe_lpf_enc_close_fx(
    ivas_filters_process_state_t **hLfeLpf                      /* i/o: LFE LPF handle                          */
);

@@ -3836,12 +3837,12 @@ void ivas_lfe_lpf_enc_apply(
 * LFE Coding prototypes
 *----------------------------------------------------------------------------------*/

ivas_error ivas_create_lfe_enc(
ivas_error ivas_create_lfe_enc_fx(
    LFE_ENC_HANDLE *hLFE,                                       /* o  : IVAS LFE encoder structure              */
    const int32_t input_Fs                                      /* i  : input sampling rate                     */
);

void ivas_lfe_enc_close( 
void ivas_lfe_enc_close_fx( 
    LFE_ENC_HANDLE *hLFE                                        /* i/o: LFE encoder handle                      */
);

+1 −1
Original line number Diff line number Diff line
@@ -4127,7 +4127,7 @@ ivas_error ivas_set_ism_metadata_fx(
    const Word16 non_diegetic_flag /* i  : non-diegetic object flag                    */
);

ivas_error ivas_ism_metadata_enc(
ivas_error ivas_ism_metadata_enc_fx(
    Word32 *ism_total_brate,                 /* i/o: ISM total bitrate                           */
    const Word16 nchan_ism,                  /* i  : number of ISM channels                      */
    const Word16 nchan_transport,            /* i  : number of transport channels                */
+7 −6
Original line number Diff line number Diff line
@@ -4566,6 +4566,7 @@ void DoRTFTn_fx_ivas(
Word16 find_guarded_bits_fx( Word32 n );
Word16 L_norm_arr( Word32 *arr, Word16 size );
Word16 norm_arr( Word16 *arr, Word16 size );
Word16 get_min_scalefactor( Word32 x, Word32 y );
@@ -4955,7 +4956,7 @@ void fine_gain_quant_ivas_fx(
    const Word16 *ord,       /* i  : Indices for energy order                 Q0     */
    const Word16 num_sfm,    /* i  : Number of bands                          Q0     */
    const Word16 *gain_bits, /* i  : Gain adjustment bits per sub band        Q0     */
    Word16 *fg_pred,         /* i/o: Predicted gains / Corrected gains        Q12 */
    Word16 *fg_pred,         /* i/o: Predicted gains / Corrected gains i:Q12 / o:Q11 */
    const Word16 *gopt       /* i  : Optimal gains                            Q12    */
);
void get_max_pulses_fx(
Loading