Commit e0654dfb authored by emerit's avatar emerit
Browse files

Merge branch 'main' into 744_step3_code_changes

parents c8feb725 75e669c1
Loading
Loading
Loading
Loading
+25 −27
Original line number Diff line number Diff line
@@ -172,6 +172,13 @@ stages:
    - cp "$LTV_DIR"/*.met scripts/testv/
    - cp "$LTV_DIR"/*.csv scripts/testv/

.activate-Werror-linux: &activate-Werror-linux
  - sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile
  - sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt

.activate-WX-windows: &activate-WX-windows
  - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt"
  - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace '<TreatWarningAsError>false', '<TreatWarningAsError>true' | Set-Content -Path $_.FullName }

# ---------------------------------------------------------------
# Job templates
@@ -239,21 +246,6 @@ stages:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/

# template for build jobs to include the check for warnings
.build-job-with-check-for-warnings:
  extends: .build-job-linux
  stage: build
  allow_failure:
    exit_codes:
      - 123

.build-job-windows-with-check-for-warnings:
  extends: .build-job-windows
  stage: build
  allow_failure:
    exit_codes:
      - 123

# ---------------------------------------------------------------
# .pre jobs for setting up things
# ---------------------------------------------------------------
@@ -309,18 +301,20 @@ branch-is-up-to-date-with-main-post:

build-codec-linux-make:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *activate-Werror-linux
    - make -j

build-codec-linux-cmake:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake ..
@@ -334,33 +328,37 @@ build-codec-instrumented-linux:
  timeout: "6 minutes"
  script:
    - *print-common-info
    - *activate-Werror-linux
    - bash ci/build_codec_instrumented_linux.sh

# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *activate-Werror-linux
    - bash ci/build_codec_sanitizers_linux.sh

build-codec-include-split-linux-make:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - make -j INCLUDE_SPLIT=1

build-codec-include-split-linux-cmake:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake .. -DINCLUDE_SPLIT=1
@@ -369,21 +367,21 @@ build-codec-include-split-linux-cmake:

build-codec-windows-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j

build-codec-windows-include-split-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - get-content .\lib_com\options.h | %{$_ -replace "/\*#define[\s]*SPLIT_REND_WITH_HEAD_ROT[\s]*\*/", "#define SPLIT_REND_WITH_HEAD_ROT"} | set-content -Path ./options_patched.h
    - rm ./lib_com/options.h
    - mv ./options_patched.h ./lib_com/options.h
@@ -392,13 +390,13 @@ build-codec-windows-include-split-cmake:

build-codec-windows-msbuild:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - py .\scripts\strip_split_rendering.py
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug

# ---------------------------------------------------------------
# Test jobs for merge requests
+7 −2
Original line number Diff line number Diff line
@@ -60,7 +60,10 @@ if(UNIX)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off")  # disable floating point operation contraction
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-unused-parameter")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
  # to be uncommented in CI
  # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

  # CLANG
  if(CLANG)
    find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED)
@@ -113,7 +116,9 @@ elseif(WIN32)
    /MP
  )
  if(NOT INCLUDE_SPLIT)
    add_compile_options("/W4" "/WX")
    add_compile_options("/W4")
    # to be uncommented in CI
    # add_compile_options("/WX")
  endif()
endif()

+2 −1
Original line number Diff line number Diff line
@@ -57,8 +57,9 @@ endif
# C compiler flags
CFLAGS   += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long     \
            -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes  \
            -Werror \
            -Wno-implicit-fallthrough -ffp-contract=off
# to be uncommented in CI
# CFLAGS += -Werror

# libs to link
LDLIBS   += -lm
+2 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@
#define FIX_OLD_BINARY_FORMAT                           /* Orange: temporary to maintain bitexactness */
#define FIX_INV_DIFFUSE_WEIGHT                          /* Orange : Fix error in energy compensation in late binaural reverb*/
#define FIX_20_MS_FRAME_LEN_TABLES_CONVERTER            /* Orange : generate_tables_converter tools can generate rom for 5 and 20 ms frame length */
#define FIX_911_REMOVE_CREND_DUPLICATION                /* VA: issue 911: resolve duplication of CRend binaural external renderer function */

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

@@ -173,6 +174,7 @@
#define NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING                 /* Dlb: issue 907: fix for band mapping at VLBR */
#define NONBE_FIX_869_MASA_PREREND_MERGE                      /* Nokia: issue: #869: MASA pre-rend not updating energy */
#define NONBE_FIX_931_IGF_STEREO_DEC_NOISE	                  /* FhG: issue #931: fix noise substitution in the stereo IGF decoder      */
#define NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW           /* FhG: issue 943: fix crash in BW switchin from WB in MDCT-Stereo core encoder */

/* ##################### End NON-BE switches ########################### */

+18 −0
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ ivas_error ivas_cpe_enc(
     * Core codec configuration
     *----------------------------------------------------------------*/

#ifndef NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW
    /* IGF reconfiguration */
    for ( n = 0; n < n_CoreChannels; n++ )
    {
@@ -533,6 +534,7 @@ ivas_error ivas_cpe_enc(
        }
    }

#endif
    if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->hMCT == NULL )
    {
        /* set coded BW for MDCT stereo */
@@ -554,6 +556,22 @@ ivas_error ivas_cpe_enc(
        }
    }

#ifdef NONBE_FIX_943_RECONFIG_IGF_AFTER_SETTING_BW
    /* IGF reconfiguration */
    for ( n = 0; n < n_CoreChannels; n++ )
    {
        if ( ( hCPE->last_element_brate != hCPE->element_brate || hCPE->element_mode != hCPE->last_element_mode || ( hCPE->element_mode == IVAS_CPE_TD && sts[0]->bits_frame_nominal != last_bits_frame_nominal ) || sts[n]->last_bwidth != sts[n]->bwidth ) && ( n == 0 || hCPE->element_mode == IVAS_CPE_MDCT ) )
        {
            int16_t igf;
            igf = getIgfPresent( sts[n]->element_mode, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->rf_mode );
            if ( ( error = IGF_Reconfig( &sts[n]->hIGFEnc, igf, 0, sts[n]->bits_frame_nominal * FRAMES_PER_SEC, sts[n]->max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
    }
#endif

    /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */
    for ( n = 0; n < n_CoreChannels; n++ )
    {
Loading