Commit 90878c96 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

IVAS downmix dumping debug code

parent 2d6d9ca8
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -278,6 +278,10 @@ ivas_error pre_proc_front_ivas_fx(
    const IVAS_FORMAT ivas_format,                             /* i  : IVAS format                              */
    const Word16 MCT_flag,                                     /* i  : hMCT handle allocated (1) or not (0)    */
    const Word32 ivas_total_brate                              /* i  : IVAS total bitrate - for setting the DTX */
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
    ,
    const Word16 ch_idx
#endif
);
#ifdef IVAS_FLOAT_FIXED
ivas_error pre_proc_ivas(
+5 −0
Original line number Diff line number Diff line
@@ -51,6 +51,11 @@
#define DEBUG_MODE_INFO_TWEAK                 /* Enable command line switch to specify subdirectory for debug info output inside "./res/" */
#define DEBUG_FORCE_MDCT_STEREO_MODE      /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */
/*#define DBG_WAV_WRITER*/                    /* Enable dbgwrite_wav() function for generating ".wav" files */
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
#define DEBUG_MODE_INFO_CORE_CODER_IN        /*dump core coder input*/
#endif
#endif
#endif

#define SUPPORT_JBM_TRACEFILE                   /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */
+34 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@
#include "ivas_prot_fx.h"
#include "wmc_auto.h"
#include <math.h>
#ifdef DEBUGGING
#include "debug.h"
#include "string.h"
#endif

#ifdef IVAS_FLOAT_FIXED
#include "prot_fx_enc.h"
@@ -928,6 +932,10 @@ ivas_error pre_proc_front_ivas_fx(
    const IVAS_FORMAT ivas_format,   /* i  : IVAS format                              */
    const Word16 MCT_flag,           /* i  : hMCT handle allocated (1) or not (0)    */
    const Word32 ivas_total_brate    /* i  : IVAS total bitrate - for setting the DTX */
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
    ,
    const Word16 ch_idx
#endif
)
{
    Encoder_State *st;
@@ -1036,10 +1044,15 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 imagBuffer16[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    Word16 res_cod_SNR_M_fx_e[STEREO_DFT_BAND_MAX];
    Word16 band_energies_fx_exp, Qfact_PS, q_lf_E_fx;
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
    Word32 *in_buff_temp;
    Word16 in_q_temp;
#endif

    mem_decim_dummy_fx = (Word16 *) malloc( 90 * sizeof( Word16 * ) );
    temp1F_icatdmResampBuf_fx = (Word16 *) malloc( 45 * sizeof( Word16 * ) );
    set16_fx( fft_buff_fx, 0, 512 );

    IF( hSCE != NULL )
    {
        Copy_Scale_sig_16_32( hSCE->hCoreCoder[n]->input_fx, hSCE->hCoreCoder[n]->input32_fx, input_frame, sub( Q11, hSCE->hCoreCoder[n]->q_inp ) );
@@ -1052,6 +1065,11 @@ ivas_error pre_proc_front_ivas_fx(
        Scale_sig( hSCE->hCoreCoder[n]->old_input_signal_fx, input_frame, sub( -1, hSCE->hCoreCoder[n]->q_old_inp ) );
        hSCE->hCoreCoder[n]->q_old_inp = -1;
        move16();

#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
        in_buff_temp = hSCE->hCoreCoder[n]->input32_fx;
        in_q_temp = hSCE->hCoreCoder[n]->q_inp32;
#endif
    }
    ELSE
    {
@@ -1065,7 +1083,23 @@ ivas_error pre_proc_front_ivas_fx(
        Scale_sig( hCPE->hCoreCoder[n]->old_input_signal_fx, input_frame, sub( -1, hCPE->hCoreCoder[n]->q_old_inp ) );
        hCPE->hCoreCoder[n]->q_old_inp = -1;
        move16();
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
        in_buff_temp = hCPE->hCoreCoder[n]->input32_fx;
        in_q_temp = hCPE->hCoreCoder[n]->q_inp32;
#endif
    }

#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
    {
        int16_t tmpF[L_FRAME48k];
        for ( int16_t isample = 0; isample < input_frame; isample++ )
        {
            tmpF[isample] = (int16_t) ( (float) in_buff_temp[isample] / ( (float) ( 1 << in_q_temp ) ) );
        }
        dbgwrite( &tmpF, sizeof( int16_t ), input_frame, 1, strcat( fname( debug_dir, "input_dmx", 0, ch_idx + 1, ENC ), ".pcm" ) );
    }
#endif

#ifdef MSAN_FIX
    FOR( Word16 k = 0; k < CLDFB_NO_COL_MAX; k++ )
    {
+6 −1
Original line number Diff line number Diff line
@@ -856,7 +856,12 @@ ivas_error ivas_cpe_enc_fx(
                                        &ener_fx[n], &relE_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], &vad_hover_flag[n], &attack_flag[n],
                                        realBuffer_fx[n], imagBuffer_fx[n], &q_re_im_buf[n], old_wsp_fx[n], &q_old_wsp, pitch_fr_fx[n], voicing_fr_fx[n], &loc_harm[n], &cor_map_sum_fx[n], &vad_flag_dtx[n], enerBuffer_fx[n], &enerBuffer_fx_exp[n],
                                        fft_buff_fx[n], &fft_buff_fx_q[n], A_fx[0], lsp_new_fx[0], currFlatness_fx[n], tdm_ratio_idx, fr_bands_fx, add( Q_buffer[n], QSCALE ), Etot_LR_fx, lf_E_fx, add( Q_buffer[n], QSCALE - 2 ), localVAD_HE_SAD,
                                        band_energies_LR_fx, sub( add( Q_buffer[n], QSCALE ), band_ener_guardbits ), 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate );
                                        band_energies_LR_fx, sub( add( Q_buffer[n], QSCALE ), band_ener_guardbits ), 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
                                        ,
                                        ( ( cpe_id * CPE_CHANNELS ) + n )
#endif
        );
        e_old_wsp[n] = sub( Q15, q_old_wsp );
        move16();
#else
+6 −1
Original line number Diff line number Diff line
@@ -609,7 +609,12 @@ ivas_error ivas_ism_enc_fx(
        error = pre_proc_front_ivas_fx( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8_fx[sce_id][0], old_inp_16k_fx[sce_id][0],
                                        &ener_fx[sce_id][0], &relE_fx[sce_id][0], A_fx[sce_id][0], Aw_fx[sce_id][0], epsP_fx[sce_id][0], &epsP_fx_q[sce_id][0], lsp_new_fx[sce_id][0], lsp_mid_fx[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0],
                                        realBuffer_fx[sce_id][0], imagBuffer_fx[sce_id][0], &q_re_im_buf[sce_id], old_wsp_fx[sce_id][0], &q_old_wsp, pitch_fr_fx[sce_id][0], voicing_fr_fx[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum_fx[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer_fx[sce_id][0], &enerBuffer_fx_exp[sce_id][0],
                                        fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate );
                                        fft_buff_fx[sce_id][0], &fft_buff_fx_q[sce_id][0], A_fx[sce_id][0], lsp_new_fx[sce_id][0], currFlatness_fx[0], 0, fr_bands_fx, 31, Etot_LR_fx, lf_E_fx, 31, localVAD_HE_SAD, NULL, 31, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate
#ifdef DEBUG_MODE_INFO_CORE_CODER_IN
                                        ,
                                        sce_id
#endif
        );
        e_old_wsp[sce_id][0] = sub( Q15, q_old_wsp );
        move16();
        IF( NE_32( error, IVAS_ERR_OK ) )
Loading