Commit d6afc3de authored by TYAGIRIS's avatar TYAGIRIS
Browse files

SBA debug changes

parent cd63a53d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7299,10 +7299,13 @@ Word16 L_norm_arr( Word32 *arr, Word16 size )
    Word16 q = 31;
    move16();
    FOR( Word16 i = 0; i < size; i++ )
    {
        IF( arr[i] != 0 )
        {
            q = s_min( q, norm_l( arr[i] ) );
        }
    }

    return q;
}

+27 −0
Original line number Diff line number Diff line
@@ -781,6 +781,18 @@ void ivas_fb_mixer_update_prior_input_fx(
 *-----------------------------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
#ifdef NONBE_FIX_SBA_FFT_PRECISION
void ivas_fb_mixer_get_windowed_fr_fx(
    IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle                    */
    Word32 *pcm_in_fx[],           // i: Qx
    Word32 *frame_f_real_fx[],
    Word32 *frame_f_imag_fx[],
    const Word16 length,      /* i  : number of new samples in time slot */
    const Word16 mdft_len,    /* i  : MDFT frame length                  */
    const Word16 nchan_fb_in, /* i  : number of analysis channels        */
    Word16 gb,
    Word16 *normlFFT )
#else
void ivas_fb_mixer_get_windowed_fr_fx(
    IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle                    */
    Word32 *pcm_in_fx[],           // i: Qx
@@ -790,6 +802,7 @@ void ivas_fb_mixer_get_windowed_fr_fx(
    const Word16 mdft_len,    /* i  : MDFT frame length                  */
    const Word16 nchan_fb_in, /* i  : number of analysis channels        */
    Word16 gb )
#endif
{
    Word16 ch_idx, j, offset, rev_offset;
    Word16 n_old_samples;
@@ -822,10 +835,24 @@ void ivas_fb_mixer_get_windowed_fr_fx(
            move32();
        }

#ifdef NONBE_FIX_SBA_FFT_PRECISION
        Word16 norms = 0;
        if ( normlFFT != NULL )
        {
            norms = L_norm_arr( fr_in_block_fx, shl( mdft_len, 1 ) );
            normlFFT[ch_idx] = norms;
        }
#endif

        FOR( Word16 i = 0; i < shl( mdft_len, 1 ); i++ )
        {
#ifdef NONBE_FIX_SBA_FFT_PRECISION
            fr_in_block_fx[i] = L_shr( fr_in_block_fx[i], sub( gb, norms ) ); // Qx - gb
            move32();
#else
            fr_in_block_fx[i] = L_shr( fr_in_block_fx[i], gb ); // Qx - gb
            move32();
#endif
        }

        ivas_mdft_fx( fr_in_block_fx, frame_f_real_fx[ch_idx], frame_f_imag_fx[ch_idx], shl( mdft_len, 1 ), mdft_len );
+15 −1
Original line number Diff line number Diff line
@@ -3211,15 +3211,29 @@ void ivas_fb_mixer_update_prior_input_fx(
    const Word16 nchan_fb_in       /* i  : number of analysis channels                 */
);

#ifdef NONBE_FIX_SBA_FFT_PRECISION
void ivas_fb_mixer_get_windowed_fr_fx(
    IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle                    */
    Word32 *pcm_in_fx[],
    Word32 *pcm_in_fx[],           // i: Qx
    Word32 *frame_f_real_fx[],
    Word32 *frame_f_imag_fx[],
    const Word16 length,      /* i  : number of new samples in time slot */
    const Word16 mdft_len,    /* i  : MDFT frame length                  */
    const Word16 nchan_fb_in, /* i  : number of analysis channels        */
    Word16 gb,
    Word16 *norml );
#else
void ivas_fb_mixer_get_windowed_fr_fx(
    IVAS_FB_MIXER_HANDLE hFbMixer, /* i/o: FB mixer handle                    */
    Word32 *pcm_in_fx[],           // i: Qx
    Word32 *frame_f_real_fx[],
    Word32 *frame_f_imag_fx[],
    const Word16 length,      /* i  : number of new samples in time slot */
    const Word16 mdft_len,    /* i  : MDFT frame length                  */
    const Word16 nchan_fb_in, /* i  : number of analysis channels        */
    Word16 gb );
#endif

void ivas_omasa_set_config_fx(
    OMASA_ENC_HANDLE hOMasa,   /* i/o: OMASA encoder handle */
    MASA_ENCODER_HANDLE hMasa, /* i  : MASA encoder handle  */
+10 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@
#include "prot_fx.h"
#endif
#include "ivas_stat_com.h"
#ifdef DEBUG_SPAR_FX_CODE
#include "debug.h"
#endif

/*------------------------------------------------------------------------------------------*
 * Local constants
@@ -675,6 +678,13 @@ void ivas_td_decorr_get_ducking_gains_fx(
    move32();

    Copy32( pIn_pcm, e_fast_fx, frame_len ); /*Q11*/
#ifdef NONBE_FIX_SBA_TRANS_DET_PRECISION
    FOR( i = 0; i < frame_len; i++ )
    {
        e_fast_fx[i] = L_shr_r_sat( e_fast_fx[i], Q11 - q ); // Q14
        move32();
    }
#endif

    /* env hpf */
    ivas_filter_process_fx( &hTranDet->env_hpf, e_fast_fx, frame_len, q );
+11 −5
Original line number Diff line number Diff line
@@ -45,16 +45,18 @@
#pragma warning(disable:4310)     /* cast truncates constant value this affects mainly constants tables*/
#endif

/*#define DEBUGGING*/                             /* Allows debugging message to be printed out during runtime */
#define DEBUGGING                             /* Allows debugging message to be printed out during runtime */
#ifdef DEBUGGING
#define DEBUG_MODE_INFO /* define to output most important parameters to the subdirectory "res/" */
#define DEBUG_MODE_INFO_TWEAK /* enable command line switch to specify subdirectory for debug info output inside "./res/" */
/*#define DBG_WAV_WRITER*/ /* enable dbgwrite_wav() function for generating ".wav" files */
//#define DEBUG_MODE_INFO /* define to output most important parameters to the subdirectory "res/" */
//#define DEBUG_MODE_INFO_TWEAK /* enable command line switch to specify subdirectory for debug info output inside "./res/" */
#define DBG_WAV_WRITER /* enable dbgwrite_wav() function for generating ".wav" files */
#define DEBUG_BYPASS_CORE_CODER
#define DEBUG_SPAR_FX_CODE
#endif

#define SUPPORT_JBM_TRACEFILE                   /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */

/*#define WMOPS*/                                   /* Activate complexity and memory counters */
//#define WMOPS                                   /* Activate complexity and memory counters */
#ifdef WMOPS
/*#define WMOPS_PER_FRAME*/                     /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
/*#define MEM_COUNT_DETAILS*/                   /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */
@@ -198,8 +200,12 @@
#define FIX_999_WRONG_ISM_EXTENDED_METADATA     /* VA: fix 999: fix ISM extended metadata decoding */
#define NONBE_FIX_1205_TD_STEREO_MOD_CT         /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING    /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */

#define NONBE_FIX_SBA_TRANS_DET_PRECISION /*Work in progress*/
#define NONBE_FIX_SBA_FFT_PRECISION  /*Work in progress*/
/* ################## End DEVELOPMENT switches ######################### */


/* clang-format on */
#define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO

Loading