Commit 9269bd50 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into...

Merge branch 'main' into 27-tcx-plc-fadeout-to-noise-for-long-frameloss-periods-not-working-correctly-185
parents a4058bdf eac6a8b3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ scripts/c-code_instrument/
scripts/ifdef_instrument.list
scripts/ref/
scripts/test/
scripts/out/
scripts/self_test_summary.txt

# Python files that pop up when running scripts
+28 −0
Original line number Diff line number Diff line
variables:
  TESTV_DIR: "/usr/local/testv"
  BUILD_OUTPUT: "build_output.txt"
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"


# This sets when pipelines are created. Jobs have more specific rules to restrict them.
@@ -331,6 +332,33 @@ self-test-on-merge-request:
# Test jobs for main branch
# ---------------------------------------------------------------

# check bitexactness to EVS
be-2-evs-linux:
  extends:
    - .test-job-linux
    - .rules-main-push
  tags:
    - be-2-evs-temp
  stage: test
  needs: [ "build-codec-linux-cmake" ]
  script:
    - *print-common-info

    - mkdir build
    - cd build
    - cmake ..
    - make -j
    - cd ..

    # copy over to never change the testvector dir
    - cp -r $EVS_BE_TEST_DIR ./evs_be_test
    - cp build/IVAS_cod ./evs_be_test/bin/EVS_cod
    - cp build/IVAS_dec ./evs_be_test/bin/EVS_dec

    - cd evs_be_test
    - python3 ../ci/run_evs_be_test.py


codec-comparison-on-main-push:
  extends:
    - .test-job-linux

apps/encoder.c

100755 → 100644
+1 −1
Original line number Diff line number Diff line
@@ -1618,7 +1618,7 @@ static void usage_enc( void )
    fprintf( stdout, "                      where 0 = adaptive, 3-100 = fixed in number of frames,\n" );
    fprintf( stdout, "                      default is deactivated\n" );
    fprintf( stdout, "-dtx                : Activate DTX mode with a SID update rate of 8 frames\n" );
    fprintf( stdout, "                      Note: DTX is currently supported in EVS, DFT/TD stereo, 1 ISm, \n" );
    fprintf( stdout, "                      Note: DTX is currently supported in EVS, stereo, 1 ISm, \n" );
    fprintf( stdout, "                      SBA (up to 128kbps) and MASA (up to 128kbps)\n" );
    fprintf( stdout, "-rf p o             : Activate channel-aware mode for WB and SWB signal at 13.2kbps, \n" );
    fprintf( stdout, "                      where FEC indicator, p: LO or HI, and FEC offset, o: 2, 3, 5, or 7 in number of frames.\n" );

ci/run_evs_be_test.py

0 → 100755
+76 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3
import subprocess
import pathlib
import sys
import concurrent.futures
from threading import Lock


README_FILES_PARALLEL = [
    "Readme_AMRWB_IO_enc.txt",
    "Readme_AMRWB_IO_dec.txt",
    "Readme_EVS_enc.txt",
    "Readme_EVS_dec.txt",
]
README_FILES_JBM = ["Readme_JBM_dec.txt"]
README_FILES = README_FILES_PARALLEL + README_FILES_JBM
BINARY_PATHS = ["./bin/EVS_cod", "./bin/EVS_dec"]
FOLDER_PATHS = ["testv"]
BIN_PATHS = BINARY_PATHS * 2

def main():

    if not environment_is_correct():
        return 1

    result_dict = dict()
    # run first part in parallel
    with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
        executor.map(
            run_file, README_FILES_PARALLEL, BIN_PATHS, [result_dict] * len(README_FILES_PARALLEL)
        )

    # JBM test can not run concurrently with the others
    run_file(README_FILES_JBM[0], BINARY_PATHS[1], result_dict)

    return analyze_results(result_dict)


def analyze_results(result_dict):
    ret = 0

    for filename, ret_code in result_dict.items():
        if ret_code != 0:
            print(f"========= Test for {filename} failed! See log below: ==========")
            with open(filename.replace("Readme", "Log")) as f:
                print(f.read())
            ret = 1

    return ret


def run_file(filename: str, bin_path: str, result_dict: dict):
    ret_code = subprocess.call(["bash", filename, bin_path])
    with Lock():
        result_dict[filename] = ret_code


def environment_is_correct():
    """
    Check that the folder with the test resources is set up correctly:
    - all Readme files there
    - EVS binaries available in bin/
    - testv and switchPaths folder exist - Content is not checked, though
    """
    ret = True

    for path in README_FILES + BINARY_PATHS + FOLDER_PATHS:
        if not pathlib.Path(path).exists():
            print(f"Environment setup is incorrect - {path} not found.")
            ret = False

    return ret


if __name__ == "__main__":
    sys.exit(main())

lib_com/bitstream.c

100755 → 100644
+10 −6
Original line number Diff line number Diff line
@@ -1975,11 +1975,15 @@ ivas_error preview_indices(
        }
        else if ( st_ivas->ivas_format == SBA_FORMAT )
        {

            /* Read SBA planar flag and SBA order */
            st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 );
            st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 );
            st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 );
            ivas_sba_config( total_brate, st_ivas->sba_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode );

            st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( total_brate, st_ivas->sba_order );

            ivas_sba_config( total_brate, st_ivas->sba_analysis_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode );
        }
    }

@@ -2059,7 +2063,7 @@ ivas_error read_indices(
        }
        else if ( k == SIZE_IVAS_BRATE_TBL )
        {
            /*temp change for spar DTX*/
            /*temp change for SPAR DTX*/
            if ( total_brate == IVAS_SID_5k )
            {
                st_ivas->element_mode_init = -1;
@@ -2112,7 +2116,7 @@ ivas_error read_indices(
        }
        else
        {
            sid_upd_bad = 1; /* this frame type may happen in ETSI/3GPP CS cases ,  a corrupt sid frames  */
            sid_upd_bad = 1; /* this frame type may happen in ETSI/3GPP CS cases, a corrupt SID frames  */
        }
    }

@@ -2197,7 +2201,7 @@ ivas_error read_indices(
                          /* total_brate= 0  */
    }

    /* handle bad/lost speech frame(and CS bad sid frame) in the decoders CNG synthesis settings pair (total_brate, bfi) */
    /* handle bad/lost speech frame(and CS bad SID frame) in the decoders CNG synthesis settings pair (total_brate, bfi) */
    if ( ( ( *CNG != 0 ) && ( ( speech_bad != 0 ) || ( speech_lost != 0 ) ) ) || /* SP_BAD or SPEECH_LOST)   --> stay in CNG */
         ( sid_upd_bad != 0 ) )                                                  /* SID_UPD_BAD              --> start CNG */
    {
@@ -2316,7 +2320,7 @@ static Word32 read_indices_mime_handle_dtx(
    {
        if ( st->bfi )
        {
            sid_upd_bad = 1; /*  corrupt sid_first, signaled as bad sid  */
            sid_upd_bad = 1; /*  corrupt sid_first, signaled as bad SID  */
        }
        else
        {
@@ -2374,7 +2378,7 @@ static Word32 read_indices_mime_handle_dtx(
    }

    /* in CNG  */
    /* handle bad speech frame(and bad sid frame) in the decoders CNG synthesis settings pair (total_brate, bfi)  */
    /* handle bad speech frame(and bad SID frame) in the decoders CNG synthesis settings pair (total_brate, bfi)  */
    if ( ( *CNG != 0 && ( speech_bad || speech_lost || no_data ) ) || /* SP_BAD or SPEECH_LOST)   --> stay in CNG */
         sid_upd_bad )                                                /* SID_UPD_BAD               --> start/stay  CNG   */
    {
Loading