Unverified Commit f324217e authored by norvell's avatar norvell
Browse files

Merge with main

parents 7a9c4b74 3b94e993
Loading
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ set(CMAKE_C_STANDARD 99)
if(UNIX)
  set(TARGET_PLATFORM ""  CACHE STRING "i686 / x86_64")
  set(CLANG           ""  CACHE STRING "1=msan / 2=asan / 3=usan")
  set(GCOV            OFF CACHE BOOL   "enable GCOV")
  set(MSAN_TRACK_ORIGINS OFF CACHE BOOL "enable origin tracking for Clang MSAN")
  set(COVERAGE            OFF CACHE BOOL   "enable coverage instrumentation")
  set(STRIP           OFF CACHE BOOL   "enable STRIP")

  if(NOT CMAKE_BUILD_TYPE)
@@ -62,13 +63,19 @@ if(UNIX)
  # to be uncommented in CI
  # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

  # set C compiler
  find_program(cc NAMES clang-18 clang REQUIRED)
  set(CMAKE_C_COMPILER "${cc}" CACHE STRING "")

  # CLANG
  if(CLANG)
    find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED)
    set(CMAKE_C_COMPILER "${clangBin}" CACHE STRING "")
    if("${CLANG}" MATCHES "1" OR "${CLANG}" MATCHES "msan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")
      if(MSAN_TRACK_ORIGINS)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize-memory-track-origins")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize-memory-track-origins")
      endif()
    elseif("${CLANG}" MATCHES "2" OR "${CLANG}" MATCHES "asan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
@@ -89,8 +96,8 @@ if(UNIX)
      message(FATAL_ERROR "Unknown CLANG setting: ${CLANG}")
    endif()
  endif()
  # GCOV
  if(GCOV)
  # COVERAGE
  if(COVERAGE)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
  endif()
+24 −12
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ LIB_LC3PLUS ?= liblc3plus.a
LIB_LIBUTIL  	?= libivasutil.a

# Default tool settings
CC        ?= gcc
CC        ?= cc
RM        ?= rm -f
AR        ?= ar

@@ -65,32 +65,43 @@ endif
CFLAGS   += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long     \
            -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes  \
            -Werror-implicit-function-declaration \
            -Wno-implicit-fallthrough -ffp-contract=off
            -Wno-implicit-fallthrough -ffp-contract=off \
            -Winit-self -Wunused-but-set-variable
# to be uncommented in CI
# CFLAGS += -Werror
CFLAGS += -Winit-self
CFLAGS += -Wunused-but-set-variable

# libs to link
LDLIBS   += -lm

# Clang sanitizer compiler options
CCCLANG = clang
ifeq "$(CLANG)" "0"
CC       = $(CCCLANG)
# check if clang is available on system and use it if it is there
CLANG_EXISTS := $(shell which clang)

ifneq "$(CLANG_EXISTS)" ""
CC = clang
else
$(warning clang compiler not found - falling back to cc)
endif

# Clang sanitizer compiler options
ifeq "$(CLANG)" "1"
CC       = $(CCCLANG)
CC       = clang
CFLAGS  += -fsanitize=memory
LDFLAGS += -fsanitize=memory

# can be set in call to make, e.g. "make CLANG=1 MSAN_TRACK_ORIGINS=1"
ifeq "$(MSAN_TRACK_ORIGINS)" "1"
CFLAGS  += -fsanitize-memory-track-origins
LDFLAGS += -fsanitize-memory-track-origins
endif

endif
ifeq "$(CLANG)" "2"
CC       = $(CCCLANG)
CC       = clang
CFLAGS  += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
ifeq "$(CLANG)" "3"
CC       = $(CCCLANG) 
CC       = clang
# NOTE: keep in sync with list in CMakeLists.txt
usan_checks = undefined,float-divide-by-zero,implicit-conversion,local-bounds
CFLAGS  += -fsanitize=$(usan_checks)
@@ -114,7 +125,8 @@ CFLAGS += -g3
LDFLAGS  += -g3
endif

ifeq "$(GCOV)" "1"
ifeq "$(COVERAGE)" "1"
CC       = gcc
CFLAGS  += -fprofile-arcs -ftest-coverage -fprofile-update=atomic
LDFLAGS += -fprofile-arcs -ftest-coverage -fprofile-update=atomic
endif
+10 −1
Original line number Diff line number Diff line
@@ -1681,6 +1681,7 @@ void ivas_mdct_tcx10_bit_distribution_fx(
    const Word16 nTnsBitsTCX10[NB_DIV]                          /* i  : TNS bits                                */
);

#ifndef FIX_2480_HARM_TONALMDCT
void TonalMDCTConceal_Detect_ivas_fx(
    const TonalMDCTConcealPtr hTonalMDCTConc,
    const Word32 pitchLag,
@@ -1688,7 +1689,15 @@ void TonalMDCTConceal_Detect_ivas_fx(
    const PsychoacousticParameters *psychParamsCurrent,
    Word16 element_mode 
);

#else
void TonalMDCTConceal_Detect_fx(
    const TonalMDCTConcealPtr hTonalMDCTConc,
    const Word32 pitchLag,
    Word16* numIndices,
    const PsychoacousticParameters* psychParamsCurrent,
    Word16 element_mode
);
#endif // !FIX_2480_HARM_TONALMDCT
ivas_error stereo_dft_dec_create_fx(
    STEREO_DFT_DEC_DATA_HANDLE *hStereoDft,                     /* i/o: decoder DFT stereo handle               */
    const Word32 element_brate,                                 /* i  : element bitrate                         */
+3 −7
Original line number Diff line number Diff line
@@ -84,20 +84,16 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARM_HQ_CORE_KEEP_BE                            /* hack to keep all BE after HQ core functions harmonization; pending resolving issues #2450, #2451, #2452 */
#define FIX_BASOP_2457_HARM_GEN                         /* FhG: harmonization of function generate_comfort_noise_dec_hf_ivas_fx()*/
#define FIX_BASOP_2478_HARM_ENC_PRM_HM                  /* FhG: basop issue 2478: harmonize enc_prm_hm() and enc_prm_hm_ivas_fx() */
#define FIX_2455_HARMONIZE_generate_comfort_noise_enc   /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define FIX_2455_HARMONIZE_configureFdCngEnc            /* FhG: harmonize generate_comfort_noise_enc and generate_comfort_noise_enc_ivas */
#define FIX_2463_EVS_BWE_LSF                            /* VA: basop issue 2463: harmonize calling of Quant_BWE_LSF_fx() */
#define FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM            /* Eri: Basop issue 2453: Fix alignment of peak_avrg_ratio_fx */
#define FIX_2480_HARM_TONALMDCT                         /* FhG: basop issue 2480: Harmonize TonalMDCTConceal_Detect_fx() and TonalMDCTConceal_Detect_ivas_fx() */
#define FIX_2479_HARM_PITCH_GAIN                        /* FhG: basop issue 2479: Harmonize tcx_ltp_pitch_search_*(), tcx_ltp_find_gain_*fx() */
#define HARMONIZE_2481_EXTEND_SHRINK                    /* FhG: basop issue 2481: Harmonize extend_frm_*fx() and shrink_frm_*fx() */

/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_BASOP_2451_HQ_FEC_SELECTOR                  /* Eri: Resolve basop issue 2451, wrong condition on env_stab_plc_fx */
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING        /* FhG: use refinement of Sqrt32 within certain functions*/
#define FIX_BASOP_2469_OBJ_EDIT_TD_REND_GAIN            /* Eri: Basop issue 2469: TD renderer gain has wrong Q and does not support the object editing gain range */
#define FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT           /* Eri: Basop issue 2486: IVAS BASOP used calculations with truncation, EVS BASOP used rounding. This aligns the use of a table lookup. */
#define FIX_1543_MID_LSF_BITS                           /* VA: float issue 1543: Resolve "MSAN: use-of-uninitialized-value in lib_enc/lsf_enc.c:262:5 for EVS encoder" */
+2 −16
Original line number Diff line number Diff line
@@ -5708,12 +5708,14 @@ void TonalMDCTConceal_UpdateState_fx(
    const Word16 badBlock,
    const Word8 tonalConcealmentActive );

#ifndef FIX_2480_HARM_TONALMDCT
void TonalMDCTConceal_Detect_fx(
    const TonalMDCTConcealPtr self, /*IN */
    const Word32 pitchLag,          /*IN */
    Word16 *umIndices,              /*OUT*/
    const Word16 element_mode       /* IN */
);
#endif // !FIX_2480_HARM_TONALMDCT

void TonalMDCTConceal_Apply_fx(
    const TonalMDCTConcealPtr hTonalMDCTConc, /*IN */
@@ -6618,15 +6620,6 @@ void generate_comfort_noise_dec_ivas_fx(
    const Word16 nchan_out /* i  : number of output channels     */
);

#ifndef FIX_BASOP_2457_HARM_GEN
void generate_comfort_noise_dec_hf_ivas_fx(
    Word32 **bufferReal,         /* o   : matrix to real part of input bands   bufferScale*/
    Word32 **bufferImag,         /* o   : matrix to imaginary part of input bands  bufferScale*/
    Word16 *bufferScale,         /* o   : pointer to scalefactor for real and imaginary part of input bands */
    HANDLE_FD_CNG_COM hFdCngCom, /* i/o: FD_CNG structure containing all buffers and variables  */
    const Word16 cng_coh_flag    /* i  : CNG Flag for coherence handling                        Q0*/
);
#endif

void generate_comfort_noise_dec_hf_fx(
    Word32 **bufferReal, /* o   : matrix to real part of input bands   bufferScale*/
@@ -9789,13 +9782,6 @@ void core_coder_mode_switch_ivas_fx(
    const Word16 MCT_flag          /* i  : hMCT handle allocated (1) or not (0)*/
);

#ifndef FIX_2455_HARMONIZE_configureFdCngEnc
void configureFdCngEnc_ivas_fx(
    HANDLE_FD_CNG_ENC hFdCngEnc, /* i/o: Contains the variables related to the FD-based CNG process */
    const Word16 bwidth,         /* Q0 */
    const Word32 total_brate     /* Q0 */
);
#endif

void SetModeIndex_ivas_fx(
    Encoder_State *st,              /* i  : Encoder state                          */
Loading