Commit 4a84f0d2 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

intensity vector precision fix

parent 11e2e166
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -610,7 +610,12 @@ void computeDirectionVectors_fixed(
    Word32 *direction_vector_x, /* o: Q30*/
    Word32 *direction_vector_y, /* o: Q30*/
    Word32 *direction_vector_z, /* o: Q30*/
    Word16 i_e /*Exponent of all the intensity buffers*/ )
    Word16 i_e                  /*Exponent of all the intensity buffers*/
#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC
    ,
    Word16 *i_e_band
#endif
)
{
    Word16 i;
    Word32 intensityNorm;
@@ -628,9 +633,24 @@ void computeDirectionVectors_fixed(
        scaled_x = L_shl( *intensity_real_x, norm_x );
        scaled_y = L_shl( *intensity_real_y, norm_y );
        scaled_z = L_shl( *intensity_real_z, norm_z );
#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC
        IF( i_e_band != NULL )
        {
            e_x = sub( i_e_band[i - enc_param_start_band], norm_x );
            e_y = sub( i_e_band[i - enc_param_start_band], norm_y );
            e_z = sub( i_e_band[i - enc_param_start_band], norm_z );
        }
        ELSE
        {
            e_x = sub( i_e, norm_x );
            e_y = sub( i_e, norm_y );
            e_z = sub( i_e, norm_z );
        }
#else
        e_x = sub( i_e, norm_x );
        e_y = sub( i_e, norm_y );
        e_z = sub( i_e, norm_z );
#endif
        temp1 = BASOP_Util_Add_Mant32Exp( Mult_32_32( scaled_x, scaled_x ), shl( e_x, 1 ), Mult_32_32( scaled_y, scaled_y ), shl( e_y, 1 ), &exp1 );
        intensityNorm = BASOP_Util_Add_Mant32Exp( temp1, exp1, Mult_32_32( scaled_z, scaled_z ), shl( e_z, 1 ), &intensityNorm_e );

+3 −3
Original line number Diff line number Diff line
@@ -872,7 +872,7 @@ void ivas_fb_mixer_process_fx(
                    move16();
                }
            }
#ifdef DEBUG_SPAR_FX_CODE
#ifdef DEBUG_SPAR_FBMIXER_RE_IM
            {
                char file_name[100] = { 0 };
                float outre[960], outim[960];
@@ -920,7 +920,7 @@ void ivas_fb_mixer_process_fx(
        scale_sig32( pMdft_out_fx[1], shl( frame_len, 1 ), sub( s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] ), q_pMdft_out_fx[1] ) );
#endif

#if 0 // def DEBUG_SPAR_FX_CODE
#ifdef DEBUG_SPAR_FBMIXER_MDFTOUT
        FOR( hist = 0; hist < 2; hist++ )
        {
            char file_name[100] = { 0 };
@@ -942,7 +942,7 @@ void ivas_fb_mixer_process_fx(
        q_ppOut_pcm_fx[ch] = s_min( q_pMdft_out_fx[0], q_pMdft_out_fx[1] );
        move16();
#endif
#if 0 // def DEBUG_SPAR_FX_CODE
#ifdef DEBUG_SPAR_FBMIXER_CROSSFADED
        {
            char file_name[100] = { 0 };
            float mdftoutt[960];
+6 −11
Original line number Diff line number Diff line
@@ -3241,7 +3241,12 @@ void computeDirectionVectors_fixed(
    Word32 *direction_vector_x, /*Q30*/
    Word32 *direction_vector_y, /*Q30*/
    Word32 *direction_vector_z, /*Q30*/
    Word16 i_e /*Exponent of all the intensity buffers*/ );
    Word16 i_e                  /*Exponent of all the intensity buffers*/
#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC
    ,
    Word16 *i_e_band
#endif
);


UWord8 ivas_masa_surrcoh_signicant_fx(
@@ -4950,16 +4955,6 @@ void ivas_dirac_dec_set_md_map(
    const Word16 nCldfbTs    /* i  : number of CLDFB time slots              */
);

void computeDirectionVectors_fixed(
    Word32 *intensity_real_x,
    Word32 *intensity_real_y,
    Word32 *intensity_real_z,
    const Word16 enc_param_start_band,
    const Word16 num_frequency_bands,
    Word32 *direction_vector_x, /*Q30*/
    Word32 *direction_vector_y, /*Q30*/
    Word32 *direction_vector_z, /*Q30*/
    Word16 i_e /*Exponent of all the intensity buffers*/ );

void computeDirectionVectors_fx(
    Word32 *intensity_real_x,
+2 −2
Original line number Diff line number Diff line
@@ -4417,7 +4417,7 @@ void ivas_get_spar_md_from_dirac_enc_fx(
            }
        }

#ifdef DEBUG_SPAR_FX_CODE
#ifdef DEBUG_DIRAC2SPAR_COV_MAT
        {
            char file_name[100] = { 0 };
            sprintf( file_name, "./res/dirac2spar_cov_mat.pcm" );
@@ -4497,7 +4497,7 @@ void ivas_get_spar_md_from_dirac_enc_fx(
                    }
                }
            }
#if 0 // def DEBUG_SPAR_FX_CODE
#ifdef DEBUG_DIRAC2SPAR_MAT_MIXER
            {
                char file_name[100] = { 0 };
                float mixer_mat[16][16][12];
+10 −2
Original line number Diff line number Diff line
@@ -52,7 +52,14 @@
#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 */
#define DEBUG_BYPASS_CORE_CODER
//#define DEBUG_SPAR_FX_CODE
#define DEBUG_SPAR_FX_CODE
//#define DEBUG_SPAR_FBMIXER_RE_IM
//#define DEBUG_SPAR_FBMIXER_MDFTOUT
//#define DEBUG_SPAR_FBMIXER_CROSSFADED
//#define DEBUG_DIRAC2SPAR_COV_MAT
//#define DEBUG_DIRAC2SPAR_MAT_MIXER
//#define DEBUG_SPAR_TRANS_DET
//#define DEBUG_SBA_DIRAC_MD
#endif

#define SUPPORT_JBM_TRACEFILE                   /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */
@@ -96,6 +103,7 @@
//#define NONBE_FIX_SBA_TRANS_DET_PRECISION               /*Work in progress*/
//#define NONBE_FIX_SBA_FFT_PRECISION                     /*Work in progress*/
//#define NONBE_FIX_PRIOR_MIXER_Q
#define NONBE_FB_MIXER_CF_FIX
//#define NONBE_FB_MIXER_CF_FIX
#define NONBE_IMPROVE_DIRAC_INTENSITY_PREC

#endif
Loading