Commit 7b4c1f4c authored by Fabian Bauer's avatar Fabian Bauer
Browse files

new fix

parent cda13bd6
Loading
Loading
Loading
Loading
Loading
+5026 −0

File added.

Preview size limit exceeded, changes collapsed.

+102 −0
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository retain full ownership rights in their respective contributions in
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.

*******************************************************************************************************/

/*====================================================================================
    EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0
  ====================================================================================*/

#ifndef OPTIONS_H
#define OPTIONS_H

/* clang-format off */

/* ################### Start DEBUGGING switches ######################## */

/*#define DEBUGGING*/                             /* Allows debugging message to be printed out during runtime */
#ifdef DEBUGGING
/*#define DBG_BITSTREAM_ANALYSIS*/            /* Write bitstream with annotations to a text file */
#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 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 DEBUG_FORCE_DIR*/                       /* Force modes/parameters by reading from external binary files */
/*#define DBG_WAV_WRITER*/                    /* Enable dbgwrite_wav() function for generating ".wav" files */
#define SUPPORT_FORCE_TCX10_TCX20             /* VA: Enable -force tcx10|tcx20 command-line option */
/*#define DEBUG_MODE_JBM */                     /* define to output JBM relevant parameters */
#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 */
#ifdef WMOPS
#define WMOPS_PER_FRAME                   /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
#define WMOPS_DETAIL                       /* Output detailed complexity printout for every function. Increases runtime overhead */
#define WMOPS_WC_FRAME_ANALYSIS             /* Output detailed complexity analysis for the worst-case frame */
/*define MEM_COUNT_DETAILS*/                   /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */
#endif

/*#define DISABLE_LIMITER*/

/* #################### End DEBUGGING switches ############################ */

#ifndef BASOP_NOGLOB_DEV_USE_GLOBALS
#define BASOP_NOGLOB_DECLARE_LOCAL
#endif

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */

#define ISSUE_1836_replace_overflow_libcom                   /* FhG: replace overflow operators by non-overflow-alternatives in lib_com - BE */
#define FIX_1942_ASSERTION_LOWSHELF                          /* FhG: Modified the target_gains_db_fx calculation in compute_t60_coeffs_fx() */
#define FIX_1944_CRASH_FOR_STEREO                            /* FhG: improve TonalMDCTConceal_InsertNoise calculation precision */
#define FIX_1970_SBA_CRASH                                   /* Dlb: Fix for issue 1970, SBA crash */

#define FIX_1978_SAT_MISSING_IN_GAIN_ENC                     /* VA:  Fix add saturation missing that lead to a crash in P800-10 */
//#define FIX_1981_MAXIMUM_EXP_FX                              /* FhG: Fix bug in function to find maximum value in vector */

#define FIX_1979_SAT_MISSING_IN_LSF_ENC                      /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING                        /* FhG: Increased guard bits of DFT_fx */
#define FIX_1980_CRASH_FDCNG_ENCODESID                       /* FhG: Add one bit of headroom in e_fx calculation in FdCng_encodeSID_ivas_fx() */
#define FIX_1987_CRASH_OMASA_ENERGY                          /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */
#define FIX_1985_SBA_714_HF_LOSS                             /* Dlb: Fix for issue 1985, improved dirac ref pow precision*/

/* #################### Start BASOP porting switches ############################ */

#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_1302_FIX_OMASA_JBM_FLUSH                  /* VA: issue 1302: fix OMASA JBM bitrate switching flush in binaural 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 */
#define FIX_1320_STACK_CPE_DECODER                      /* VA: issue 1320: Optimize the stack memory consumption in the CPE decoder */
#define FIX_1984_SAT_IN_PSYCHAD                         /* VA: Issue 1984: proposal to fix an assert */

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

#endif
+2475 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@

#define FIX_1978_SAT_MISSING_IN_GAIN_ENC                     /* VA:  Fix add saturation missing that lead to a crash in P800-10 */
#define FIX_1981_MAXIMUM_EXP_FX                              /* FhG: Fix bug in function to find maximum value in vector */
//#define PITCH_OL_PRINTIND
//#define PITCH_OL_PRINTVAL

#define FIX_1979_SAT_MISSING_IN_LSF_ENC                      /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING                        /* FhG: Increased guard bits of DFT_fx */
+8 −5
Original line number Diff line number Diff line
@@ -1246,6 +1246,8 @@ Word16 maximum_exp_fx( /* o : index of the maximum value

#ifdef FIX_1981_MAXIMUM_EXP_FX
    scale = sub( norm_s( vec_fx[ind] ), 1 );
    tmp = shl( vec_fx[ind], scale );
    exp = sub( exp_vec[ind], scale );

    FOR( j = 1; j < lvec_fx; j++ )
    {
@@ -1256,8 +1258,8 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
            move16();

            scale = sub( norm_s( vec_fx[ind] ), 1 );
            tmp = shl( vec_fx[j], scale );
            exp = sub( exp_vec[j], scale );
            tmp = shl( vec_fx[ind], scale );
            exp = sub( exp_vec[ind], scale );
        }
    }
#else
@@ -1272,6 +1274,7 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
            Word32 tmp32, tmp32_1;
            tmp16 = tmp;
            tmp32 = L_deposit_l( tmp );

            tmp16_1 =   shr_sat(              vec_fx[j]  , sub( exp, exp_vec[j] ) );
            tmp32_1 = L_shr_sat( L_deposit_l( vec_fx[j] ), sub( exp, exp_vec[j] ) );

@@ -1295,8 +1298,8 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
        }
    }
#endif
#if 0 /*value out*/
    printf( "\n val= %15.15f", vec_fx[ind] * pow(2,exp_vec[ind] - 15) );
#ifdef PITCH_OL_PRINTVAL /*value out*/
    printf( "\n val= %15.15f", (float)vec_fx[ind] * pow(2,exp_vec[ind] - 15) );
#endif

    return ind;
Loading