Commit 12ee1294 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into 20250827_maintenance

parents fc3046ac 1c1ac790
Loading
Loading
Loading
Loading
+164 −143
Original line number Diff line number Diff line
@@ -354,10 +354,12 @@ void sns_shape_spectrum_fx(
    const Word32 *scf_int,                        /* i  : already interpolated SNS scalefactors                     */
    const Word16 q_scf_int,                       /* i  : Q of interpolated SNS scalefactors               q_scf_int*/
    const Word16 L_frame,                         /* i  : frame length                                              */
    Word16 *length );
    Word16 *length 
);

Word32 ECSQ_dequantize_gain_fx(
    const Word16 index );
    const Word16 index 
);

void stereo_tca_enc_fx(
    CPE_ENC_HANDLE hCPE,     /* i  : CPE encoder structure           */
@@ -611,7 +613,8 @@ void ivas_sba_config_fx(
);

Word16 ivas_get_bits_to_encode(
    Word32 val );
    Word32 val 
);

Word16 ivas_get_spar_table_idx_fx(
    const Word32 ivas_total_brate, /* i  : IVAS total bitrate      */
@@ -1394,7 +1397,8 @@ Word16 matrix_product_diag_fx(
    const Word16 colsY,   /* i  : number of columns of the right hand matrix                                             */
    const Word16 transpY, /* i  : flag indicating the transposition of the right hand matrix prior to the multiplication */
    Word32 *Z,            /* o  : resulting matrix after the matrix multiplication                                       */
    Word16 *Z_e );
    Word16 *Z_e 
);

// ivas_stereo_mdct_core_dec_fx.c
void stereo_mdct_core_dec_fx(
@@ -1965,7 +1969,8 @@ Word16 ivas_wb_bwe_dec_fx(
    const Word16 output_frame,      /* i  : frame length                            */
    Word16 *voice_factors_fx,       /* i  : voicing factors                        Q15 */
    const Word16 pitch_buf_fx[],    /* i  : pitch buffer                           Q6 */
    Word16 *Qpost );
    Word16 *Qpost 
);

void ivas_param_ism_config_fx(
    PARAM_ISM_CONFIG_HANDLE hParamIsm, /* i/o: IVAS Param ISM Config Structure      */
@@ -2054,7 +2059,8 @@ ivas_error stereo_memory_dec_fx(

void initFdCngDec_ivas_fx(
    DEC_CORE_HANDLE st, /* i/o: decoder state structure     */
    Word16 scale );
    Word16 scale 
);

void ivas_initFdCngCom_fx( 
    HANDLE_FD_CNG_COM hFdCngCom, Word16 scale 
@@ -2097,7 +2103,8 @@ void ivas_calc_c_p_coeffs_fx(
    const Word16 band_idx,
    const Word16 dtx_vad,
    const Word16 compute_p_flag,
    const Word16 dyn_active_w_flag );
    const Word16 dyn_active_w_flag 
);

Word16 is_SIDrate(
    const Word32 ivas_total_brate /* i  : IVAS total bitrate   */
@@ -2341,8 +2348,13 @@ void ivas_dirac_dec_render_sf_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                      */
    Word32 *output_fx[],                                        /* i/o: synthesized core-coder transport channels/DirAC output  */
    const Word16 nchan_transport,                               /* i  : number of transport channels                */
#ifdef FIX_1319_STACK_SBA_DECODER
    Word32 *pppQMfFrame_ts_re_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[HOA3_CHANNELS][CLDFB_NO_COL_MAX]
#else
    Word32 *pppQMfFrame_ts_re_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX],
    Word32 *pppQMfFrame_ts_im_fx[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX] 
#endif
);

void ivas_dirac_dec_render_fx(
@@ -2719,32 +2731,13 @@ void ivas_limiter_close_fx(
    IVAS_LIMITER_HANDLE *phLimiter /* i/o: pointer to limiter handle, can be NULL  */
);



void copy_masa_descriptive_meta_fx(
    MASA_DECRIPTIVE_META *outMeta, /* o  : metadata to be written */
    MASA_DECRIPTIVE_META *inMeta   /* i  : input metadata         */
);

void efap_free_data_fx(
    EFAP_HANDLE *hEFAPdata /* i/o: EFAP handle to be freed */
);

void tdm_SCh_LSF_intra_pred_fx(
    const Word32 element_brate,    /* i  : element bitrate                         */
    const Word16 *tdm_lsfQ_PCh_fx, /* i  : primary channel LSFs                    */
    Word16 *pred_lsf_SCh_fx        /* o  : predicted secondary channel LSFs        */
);

ivas_error ivas_create_lfe_lpf_enc_fx(
    ivas_filters_process_state_t **hLfeLpf, /* o  : LFE LPF handle                          */
    const Word32 input_Fs                   /* i  : input sampling rate                     */
);

void ivas_lfe_lpf_enc_apply_fx(
    ivas_filters_process_state_t *hLfeLpf, /* i/o: LFE LPF handle                   */
    Word32 data_lfe_ch[],                  /* i/o: LFE signal                       */
    const Word16 input_frame               /* i  : input frame length per channel   */
);

void ivas_ari_done_encoding_14bits_fx(
    BSTR_ENC_HANDLE hBstr,
    Tastat *s 
@@ -2966,7 +2959,8 @@ Word16 quantize_sns_fx(
    Encoder_State **sts,
    Word16 *indices,           /* Q0 */
    Word16 *zero_side_flag,    /* Q0 */
    Word16 *sns_stereo_mode ); /* Q0 */
    Word16 *sns_stereo_mode    /* Q0 */
);

void stereo_enc_cng_init_fx(
    STEREO_CNG_ENC_HANDLE hStereoCng /* i/o: stereo CNG encoder structure            */
@@ -3191,7 +3185,8 @@ Word16 transient_analysis_ivas_fx(
    const Word16 cor_map_LT[], /* i  : LT correlation map  Q_cor_map = Qx */
    Word16 Q_cor_map,
    const Word16 multi_harm_limit, /* i  : multi harmonic threshold Q_multi_harm_limit = Qx */
    Word16 Q_multi_harm_limit );
    Word16 Q_multi_harm_limit 
);

void set_transient_stereo_fx(
    CPE_ENC_HANDLE hCPE,  /* i  : CPE structure                           */
@@ -3606,7 +3601,9 @@ void ivas_omasa_encode_masa_to_total_fx(
    BSTR_ENC_HANDLE hMetaData,
    const Word16 low_bitrate_mode,
    const Word16 nbands,
    const Word16 nblocks );
    const Word16 nblocks 
);

ivas_error ivas_masa_enc_config_fx(
    Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */
);
@@ -4448,7 +4445,8 @@ Word16 res_bpf_adapt_ivas_fx(
    STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: DFT stereo decoder handle */
    const Word32 *bpf_error_signal_8k,     /* i  : BPF modification signal   */
    Word32 res_buf[STEREO_DFT_N_8k],       /* i  : residual buffer Q_res       */
    Word16 q_res );
    Word16 q_res 
);

void stereo_dft_dec_read_BS_fx(
    const Word32 ivas_total_brate,         /* i  : IVAS total bitrate		Q0*/
@@ -4645,6 +4643,12 @@ void tdm_SCh_LSF_intra_pred_fx(
    Word16 *pred_lsf_SCh_fx        /* o  : predicted secondary channel LSFs        */
);

void tdm_SCh_LSF_intra_pred_fx(
    const Word32 element_brate,    /* i  : element bitrate                         */
    const Word16 *tdm_lsfQ_PCh_fx, /* i  : primary channel LSFs                    */
    Word16 *pred_lsf_SCh_fx        /* o  : predicted secondary channel LSFs        */
);

void tdm_SCh_lsf_reuse_fx(
    const Word16 enc_dec,            /* i  : encoder/decoder flag                    */
    const Word32 element_brate,      /* i  : element bitrate                         */
@@ -4926,8 +4930,8 @@ void stereo_switching_enc_fx(
    CPE_ENC_HANDLE hCPE,           /* i  : CPE encoder structure               */
    Word32 old_input_signal_pri[], /* i  : old input signal of primary channel */
    const Word16 input_frame,      /* i  : input frame length                  */
    const Word16 q_inp );

    const Word16 q_inp 
);

void stereo_td2dft_update_fx(
    CPE_DEC_HANDLE hCPE,      /* i/o: CPE decoder structure     */
@@ -5430,7 +5434,8 @@ void ivas_agc_enc_process_fx(
    Word32 **ppPcm_out,                         /* o  : output audio channels    */
    const Word16 n_channels,                    /* i  : number of channels       */
    const ENCODER_CONFIG_HANDLE hEncoderConfig, /* i  : configuration structure  */
    Word16 *q_ppPcm );
    Word16 *q_ppPcm 
);

void ivas_spar_set_bitrate_config_fx(
    ivas_spar_md_com_cfg *pSpar_md_cfg, /* i/o: SPAR MD config. handle  */
@@ -5439,7 +5444,8 @@ void ivas_spar_set_bitrate_config_fx(
    const Word16 dirac2spar_md_flag,
    const Word16 enc_flag,
    const Word16 pca_flag,
    const Word16 agc_flag );
    const Word16 agc_flag 
);

Word16 ivas_is_res_channel(
    const Word16 ch,             /* i  : ch index in WYZX ordering               */
@@ -5706,12 +5712,14 @@ void ivas_pca_dec_fx(
void eye_matrix_fx(
    Word16 *mat,
    const Word16 n,
    const Word16 d );
    const Word16 d 
);

void eye_matrix_fx32(
    Word32 *mat, // Q
    const Word16 n,
    const Word32 d ); // Q
    const Word32 d // Q
);

void eig_qr_fx(
    const Word32 *A_fx, // A_q
@@ -6461,6 +6469,7 @@ UWord16 get_indice_st(
    const Word16 nb_bits                                        /* i  : number of bits to quantize the indice   */
);


/*----------------------------------------------------------------------------------*
 * MDCT Stereo prototypes
 *----------------------------------------------------------------------------------*/
@@ -6481,6 +6490,7 @@ Word16 write_stereo_to_bitstream_fx
    BSTR_ENC_HANDLE hBstr                                       /* i/o: bitstream handle                        */
);


/*----------------------------------------------------------------------------------*
 * Stereo CNG prototypes
 *----------------------------------------------------------------------------------*/
@@ -6809,6 +6819,17 @@ void ivas_lfe_lpf_enc_close_fx(
    ivas_filters_process_state_t **hLfeLpf                      /* i/o: LFE LPF handle                          */
);

ivas_error ivas_create_lfe_lpf_enc_fx(
    ivas_filters_process_state_t **hLfeLpf, /* o  : LFE LPF handle                          */
    const Word32 input_Fs                   /* i  : input sampling rate                     */
);

void ivas_lfe_lpf_enc_apply_fx(
    ivas_filters_process_state_t *hLfeLpf, /* i/o: LFE LPF handle                   */
    Word32 data_lfe_ch[],                  /* i/o: LFE signal                       */
    const Word16 input_frame               /* i  : input frame length per channel   */
);


/*----------------------------------------------------------------------------------*
 * LFE Coding prototypes
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@
#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */
#define FIX_1319_STACK_SBA_DECODER                      /* VA: issue 1319: Optimize the definition of buffer lengths in the SBA decoder */

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

+3 −6
Original line number Diff line number Diff line
@@ -356,17 +356,14 @@ ivas_error ivas_core_dec_fx(
        move16();
    }

    save_hb_synth_32_fx = NULL;
    test();
    test();
    test();
    IF( sba_dirac_stereo_flag && hSCE && LE_32( sts[0]->total_brate, SID_2k40 ) && EQ_16( sts[0]->cng_type, FD_CNG ) )
    if ( sba_dirac_stereo_flag && hSCE && LE_32( sts[0]->total_brate, SID_2k40 ) && EQ_16( sts[0]->cng_type, FD_CNG ) )
    {
        save_hb_synth_32_fx = hSCE->save_hb_synth_fx;
    }
    ELSE
    {
        save_hb_synth_32_fx = NULL;
    }

    /*------------------------------------------------------------------*
     * Decode SID for MDCT-Stereo DTX mode
@@ -1447,7 +1444,7 @@ ivas_error ivas_core_dec_fx(
         *--------------------------------------------------------*/

        Word16 exp_max;
        Word32 output_fx_loc[L_FRAME48k];
        Word32 *output_fx_loc = synth_32_fx[0];

        exp_max = 0;
        move16();
+14 −15
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ ivas_error ivas_cpe_dec_fx(
    Word16 q_res_buf;
    Word32 res_buf_fx[STEREO_DFT_N_8k]; /* Q(q_res_buf) */
    CPE_DEC_HANDLE hCPE;
    STEREO_DFT_CONFIG_DATA_HANDLE hConfigDft;
    Decoder_State **sts;
    Word32 ivas_total_brate;
    ivas_error error;
@@ -159,6 +160,12 @@ ivas_error ivas_cpe_dec_fx(
        }
    }

    hConfigDft = NULL;
    if ( hCPE->hStereoDft != NULL )
    {
        hConfigDft = hCPE->hStereoDft->hConfig;
    }

    /*------------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -222,25 +229,16 @@ ivas_error ivas_cpe_dec_fx(
    test();
    IF( NE_16( hCPE->element_mode, IVAS_CPE_MDCT ) && ( NE_32( hCPE->element_brate, hCPE->last_element_brate ) || NE_16( hCPE->last_element_mode, hCPE->element_mode ) || sts[0]->ini_frame == 0 || ( NE_32( ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate ) ) ) )
    {
        STEREO_DFT_CONFIG_DATA_HANDLE hConfig;
        IF( hCPE->hStereoDft == NULL )
        {
            hConfig = NULL;
        }
        ELSE
        {
            hConfig = hCPE->hStereoDft->hConfig;
        }
        test();
        IF( st_ivas->hQMetaData != NULL && GT_32( ivas_total_brate, IVAS_SID_5k2 ) )
        {
            IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
            {
                stereo_dft_config_fx( hConfig, L_mult0( st_ivas->hQMetaData->bits_frame_nominal, 35 /* 0.7f * FRAMES_PER_SEC */ ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
                stereo_dft_config_fx( hConfigDft, L_mult0( st_ivas->hQMetaData->bits_frame_nominal, 35 /* 0.7f * FRAMES_PER_SEC */ ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
            }
            ELSE
            {
                stereo_dft_config_fx( hConfig, L_mult0( st_ivas->hQMetaData->bits_frame_nominal, FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
                stereo_dft_config_fx( hConfigDft, L_mult0( st_ivas->hQMetaData->bits_frame_nominal, FRAMES_PER_SEC ), &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
            }
        }
        ELSE
@@ -248,11 +246,11 @@ ivas_error ivas_cpe_dec_fx(
            /* Note: This only works for stereo operation. If DTX would be applied for multiple CPEs a different bitrate signaling is needed */
            IF( LE_32( ivas_total_brate, IVAS_SID_5k2 ) )
            {
                stereo_dft_config_fx( hConfig, ivas_total_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
                stereo_dft_config_fx( hConfigDft, ivas_total_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
            }
            ELSE
            {
                stereo_dft_config_fx( hConfig, hCPE->element_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
                stereo_dft_config_fx( hConfigDft, hCPE->element_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal );
            }
        }
    }
@@ -592,7 +590,7 @@ ivas_error ivas_cpe_dec_fx(

    test();
    test();
    IF( NE_16( hCPE->element_mode, IVAS_CPE_DFT ) || ( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hCPE->hStereoDft->hConfig->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) )
    IF( NE_16( hCPE->element_mode, IVAS_CPE_DFT ) || ( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hConfigDft->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) )
    {
        IF( NE_32( ( error = ivas_core_dec_fx( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB_fx, NULL, st_ivas->sba_dirac_stereo_flag ) ), IVAS_ERR_OK ) )
        {
@@ -610,9 +608,10 @@ ivas_error ivas_cpe_dec_fx(
    /*----------------------------------------------------------------*
     * Stereo decoder & upmixing
     *----------------------------------------------------------------*/

    test();
    test();
    IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && !( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hCPE->hStereoDft->hConfig->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) )
    IF( EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) && !( EQ_16( hCPE->nchan_out, 1 ) && EQ_16( hConfigDft->res_cod_mode, STEREO_DFT_RES_COD_OFF ) ) )
    {
        Word32 DFT_fx[CPE_CHANNELS][STEREO_DFT_BUF_MAX]; // q_dft
        set32_fx( DFT_fx[0], 0, STEREO_DFT_BUF_MAX );
+170 −32

File changed.

Preview size limit exceeded, changes collapsed.

Loading