Commit 5052809b authored by sbsarac's avatar sbsarac
Browse files

Merge branch '1053-reverb-reconfiguration-runtime-test' into...

Merge branch '1053-reverb-reconfiguration-runtime-test' into 1053-reverb-reconfiguration-runtime-aeid-file-tests
parents 1e1a4d0d d78cf771
Loading
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -602,8 +602,6 @@ pytest-compare-20ms-and-5ms-rendering:
    ### prepare pytest
    - cp IVAS_cod IVAS_cod_ref
    - cp IVAS_dec IVAS_dec_ref
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # create references
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2
@@ -920,8 +918,6 @@ ivas-pytest-on-merge-request:
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # create references
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 -m create_ref_part2
@@ -975,8 +971,6 @@ ivas-interop-on-merge-request:
    - non_interop_flag=$(grep -c --ignore-case "\[non[ -]*io\]" tmp.txt) || true

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py

    # Run reference creation, using source branch encoder and main decoder (see .merge-request-comparison-setup-codec)
    - exit_code=0
@@ -1183,7 +1177,7 @@ check-bitexactness-hrtf-rom-and-file:
    - *print-common-info
    - cmake .
    - make -j
    - python3 tests/create_short_testvectors.py --which all --cut_len 1.0
    - python3 tests/create_short_testvectors.py --cut_len 1.0
    - python3 -m pytest tests/hrtf_binary_loading --html=report.html --junit-xml=report-junit.xml --self-contained-html
  artifacts:
    paths:
@@ -1300,8 +1294,6 @@ codec-comparison-on-main-push:
    - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
@@ -1385,7 +1377,6 @@ ivas-conformance:
    - cp -force IVAS_rend.exe IVAS_rend_ref.exe 
    
    # Reference creation
    - python tests/create_short_testvectors.py
    - python scripts/prepare_combined_format_inputs.py
    - $TEST_SET = "tests/codec_be_on_mr_nonselection", "tests/renderer/test_renderer.py", "tests/split_rendering/test_split_rendering.py"
    - python -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files
@@ -1479,7 +1470,6 @@ ivas-conformance-linux:
    - cp IVAS_rend IVAS_rend_ref
    
    # Reference creation
    - python3 tests/create_short_testvectors.py
    - python3 scripts/prepare_combined_format_inputs.py
    - TEST_SET="tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py tests/split_rendering/test_split_rendering.py"
    - python3 -m pytest $TEST_SET -v -n auto --update_ref 1 -m create_ref --create_ref --keep_files
@@ -2237,7 +2227,6 @@ coverage-test-on-main-scheduled:
    - *copy-ltv-files-to-testv-dir
    - make GCOV=1 -j
    - cp IVAS_rend IVAS_rend_ref # Copy exec to be able to run renderer script
    - python3 tests/create_short_testvectors.py
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    # need to ignore non-zero exit codes as limiter is active and thus the different framesiszes will not be BE in all cases
+88 −0
Original line number Diff line number Diff line
__copyright__ = """
(C) 2022-2024 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.
"""

from pathlib import Path
import argparse

# Enter tag of testcases to remove here WITHOUT the leading //
TESTCASES = [
    "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out",
    "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out",
    "4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, combined render config, directivity configuration with identifiers",
    "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out",
    "Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching",
    "OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 5%, bandwidth switching",
    "OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching",
    "OMASA 2Dir2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out",
    "OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out",
    "OSBA planar FOA 1ISM at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out",
    "SBA 3OA at 128 kbps, 48kHz in 48kHz out, BINAURAL_ROOM_REVERB combined renderer configuration with selected acoustic environment",
    "OSBA FOA 4ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 16kHz out, BINAURAL out (Model from file), FER at 5%, bandwidth switching",
    "stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, EXT out",
    "SBA FOA bitrate switching from 13.2 kbps to 192 kbps, 32kHz in, 32kHz out, DTX on, EXT out",
    "SBA 2OA bitrate switching from 13.2 kbps to 128 kbps, 32kHz in, 32kHz out, DTX on, EXT out",
    "SBA 3OA bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, EXT out",
    "Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out",
    "Multi-channel 5_1_2 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, EXT out",
    "Multi-channel 5_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 32kHz out, EXT out",
    "Multi-channel 7_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 16kHz out, EXT out",
    "Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out",
]


def remove_testcases(cfg: Path, testcases: list):
    """
    Go through file line by line and copy all testcases except the given ones
    """
    with open(cfg, "r") as f:
        content_in = f.readlines()

    content_out = list()
    copy_flag = True
    for line in content_in:
        if any([tc in line for tc in testcases]):
            copy_flag = False

        if copy_flag:
            content_out.append(line)
        elif line == "\n":
            copy_flag = True

    with open(cfg, "w") as f:
        f.write("".join(content_out))


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("cfg_files", nargs="+", type=Path)
    args = parser.parse_args()

    for f in args.cfg_files:
        remove_testcases(f, TESTCASES)
+16 −0
Original line number Diff line number Diff line
@@ -884,7 +884,11 @@ ivas_error check_ind_list_limits(
        }
        else
        {
#ifdef DEBUGGING
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#else
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#endif
        }
    }

@@ -939,7 +943,11 @@ ivas_error push_indice(
    /* check the limits of the list of indices */
    if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
    {
#ifdef DEBUGGING
        return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame );
#else
        return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices!\n" );
#endif
    }

    /* find the location in the list of indices based on ID */
@@ -1095,7 +1103,11 @@ ivas_error push_next_bits(
        /* check the limits of the list of indices */
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
#ifdef DEBUGGING
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#else
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#endif
        }
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];

@@ -1114,7 +1126,11 @@ ivas_error push_next_bits(
        /* check the limits of the list of indices */
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
#ifdef DEBUGGING
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#else
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#endif
        }
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];

+3 −0
Original line number Diff line number Diff line
@@ -161,6 +161,9 @@
#define FIX_1081_BINAURAL_SPLIT_PCM_SANITY_CHECK        /* VA: issue 1081: correct error print-out when BINAURAL_SPLIT_PCM is requested */
#endif

//#define FIX_CREND_FIX_POINT_HRTF_FILE_FORMAT          /* Orange issue 1031 : new fix point hrtf binary file format */
//#define FIX_CREND_SIMPLIFY_CODE                         /* Ora : simplify line code in crend */
#define FLOAT_FIX_POINT_HRTF_FILE_FORMAT                /* allows reading floation or fix point hrtf binary file format */
#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */
#define FIX_1082_INSTRUM_FAILED_LC3PLUS                 /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */
+31 −0
Original line number Diff line number Diff line
@@ -1642,7 +1642,11 @@ static ivas_error ivas_rend_crendConvolver(
    const float *pIn;
    float *pFreq_buf_re, *pFreq_buf_im;
    float *pFreq_buf2_re, *pFreq_buf2_im;
#ifdef FIX_CREND_SIMPLIFY_CODE
    float *pFreq_filt_re, *pFreq_filt_im;
#else
    const float *pFreq_filt_re, *pFreq_filt_im;
#endif
    float pOut[L_FRAME48k * 2];
    float tmp_out_re[L_FRAME48k], tmp_out_im[L_FRAME48k];
    CREND_HANDLE hCrend;
@@ -1694,6 +1698,23 @@ static ivas_error ivas_rend_crendConvolver(
    }

    i = 0;
#ifdef FIX_CREND_SIMPLIFY_CODE
    if ( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 )
    {
        if ( pCrend->hHrtfCrend->same_inv_diffuse_weight )
        {
            pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse];
            pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[0][offset_diffuse];
        }
        else
        {
            pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse];
            pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[0][offset_diffuse];
            pFreq_buf2_re = &hCrend->freq_buffer_re_diffuse[1][offset_diffuse];
            pFreq_buf2_im = &hCrend->freq_buffer_im_diffuse[1][offset_diffuse];
        }
    }
#endif
    for ( idx_in = 0; idx_in < nchan_in; idx_in++ )
    {
        pIn = &pcm_in[idx_in][i_ts * subframe_length];
@@ -1703,8 +1724,10 @@ static ivas_error ivas_rend_crendConvolver(
            {
                if ( pCrend->hHrtfCrend->same_inv_diffuse_weight )
                {
#ifndef FIX_CREND_SIMPLIFY_CODE
                    pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse];
                    pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[0][offset_diffuse];
#endif
                    pFreq_filt_re = &hCrend->freq_buffer_re[i][offset];
                    pFreq_filt_im = &hCrend->freq_buffer_im[i][offset];

@@ -1716,10 +1739,12 @@ static ivas_error ivas_rend_crendConvolver(
                }
                else
                {
#ifndef FIX_CREND_SIMPLIFY_CODE
                    pFreq_buf_re = &hCrend->freq_buffer_re_diffuse[0][offset_diffuse];
                    pFreq_buf_im = &hCrend->freq_buffer_im_diffuse[0][offset_diffuse];
                    pFreq_buf2_re = &hCrend->freq_buffer_re_diffuse[1][offset_diffuse];
                    pFreq_buf2_im = &hCrend->freq_buffer_im_diffuse[1][offset_diffuse];
#endif
                    pFreq_filt_re = &hCrend->freq_buffer_re[i][offset];
                    pFreq_filt_im = &hCrend->freq_buffer_im[i][offset];

@@ -1732,11 +1757,17 @@ static ivas_error ivas_rend_crendConvolver(
                    }
                }
            }
#ifdef FIX_CREND_SIMPLIFY_CODE
            pFreq_filt_re = &hCrend->freq_buffer_re[i][offset];
            pFreq_filt_im = &hCrend->freq_buffer_im[i][offset];

            ivas_mdft( pIn, pFreq_filt_re, pFreq_filt_im, subframe_length, subframe_length );
#else
            pFreq_buf_re = &hCrend->freq_buffer_re[i][offset];
            pFreq_buf_im = &hCrend->freq_buffer_im[i][offset];

            ivas_mdft( pIn, pFreq_buf_re, pFreq_buf_im, subframe_length, subframe_length );
#endif
            i++;
        }
    }
Loading