Commit 1b6b854d authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into use-tracefiles-for-mld

parents 27ca151d e51fb5bf
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -228,12 +228,12 @@ stages:
    - if [ $CLANG_NUM -eq 1 ]; then sanitizer_type="MemorySanitizer"; elif [ $CLANG_NUM -eq 2 ]; then sanitizer_type="AddressSanitizer"; elif [ $CLANG_NUM -eq 3 ]; then sanitizer_type="UndefinedBehaviorSanitizer"; else echo "Wrong CLANG_NUM $CLANG_NUM given!"; exit 1; fi

    # run encoder and decoder with 20ms renderer framesize first, use reference creation mode
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py --param_file $SELF_TEST_PRM_FILE -v --update_ref 1 --html=report-20ms.html --self-contained-html --junit-xml=report-junit-20ms.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code20=$?
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --update_ref 1 --html=report-20ms.html --self-contained-html --junit-xml=report-junit-20ms.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code20=$?
    # for 10ms and 5ms renderer framesize, we only need to run the decoder part as renderer framesize is a decoder-only option
    # set tolerance very high do ignore any BE differences due to the different renderer framesizes, those can appear due to the limiter being active
    # we are only interested in runtime errors from the sanitizers and ignore the diffs
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py --param_file $SELF_TEST_PRM_FILE -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only --abs_tol 100000 || exit_code5=$?
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py --param_file $SELF_TEST_PRM_FILE -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only --abs_tol 100000 || exit_code10=$?
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only --abs_tol 100000 || exit_code5=$?
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only --abs_tol 100000 || exit_code10=$?

    - if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi

@@ -570,6 +570,7 @@ codec-msan:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with address-sanitizer binaries
@@ -580,6 +581,7 @@ codec-asan:
    - CLANG_NUM=2
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with undefined-behaviour-sanitizer binaries
@@ -592,6 +594,7 @@ codec-usan:
    - CLANG_NUM=3
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# compare bit-exactness between 5ms and 20 on the branch
@@ -1206,7 +1209,7 @@ check-bitexactness-ext-and-transport-format:
# check bitexactness to EVS windows binaries
be-2-evs-windows:
  extends:
    - .rules-main-push
    - .rules-merge-request
  tags:
    - ivas-windows
  stage: test
@@ -1612,11 +1615,11 @@ test-long-self-test:
    # create references
    - exit_code_ref=0
    - testcase_timeout=300
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 --param_file scripts/config/self_test_ltv.prm --testcase_timeout=$testcase_timeout || exit_code_ref=$?
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR --use_ltv -v --update_ref 1 --param_file scripts/config/self_test_ltv.prm --testcase_timeout=$testcase_timeout || exit_code_ref=$?

    ### run pytest self-test using long test vectors
    - exit_code=0
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_ltv.prm --html=report-ltv.html --self-contained-html --junit-xml=report-junit-ltv.xml --testcase_timeout=$testcase_timeout || exit_code=$?
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR --use_ltv -v --param_file scripts/config/self_test_ltv.prm --html=report-ltv.html --self-contained-html --junit-xml=report-junit-ltv.xml --testcase_timeout=$testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
@@ -1654,6 +1657,7 @@ ltv-msan:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm"
    - USE_LTV="--use_ltv"
  <<: *sanitizer-selftest-anchor

# code selftest long testvectors with address-sanitizer binaries
@@ -1671,6 +1675,7 @@ ltv-asan:
    - CLANG_NUM=2
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm"
    - USE_LTV="--use_ltv"
  <<: *sanitizer-selftest-anchor

# code selftest long testvectors with undefined-behaviour-sanitizer binaries
@@ -1688,6 +1693,7 @@ ltv-usan:
    - CLANG_NUM=3
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - SELF_TEST_PRM_FILE="scripts/config/self_test_ltv.prm"
    - USE_LTV="--use_ltv"
  <<: *sanitizer-selftest-anchor

.sanitizer-test-template:
@@ -2223,7 +2229,7 @@ coverage-test-on-main-scheduled:
    - .test-job-linux-needs-testv-dir
    - .rules-main-scheduled
  tags:
    - ivas-linux
    - ivas-linux-fast
  stage: test
  rules:
    # only run in scheduled pipeline that passes this env vars
+148 −7
Original line number Diff line number Diff line
@@ -54,6 +54,11 @@
#include "debug.h"
#endif
#include "wmc_auto.h"
#ifdef OBJ_EDITING_API
#ifdef OBJ_EDITING_EXAMPLE
#include <math.h>
#endif
#endif


#define WMC_TOOL_SKIP
@@ -150,6 +155,9 @@ typedef struct
    AcousticEnvironmentSequence aeSequence;
    bool dpidEnabled;
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
#ifdef OBJ_EDITING_EXAMPLE
    bool objEditEnabled;
#endif

} DecArguments;

@@ -400,6 +408,7 @@ int main(
        }
    }

#ifndef FIX_1158_FASTCONV_REVERB_HRTF
    /*------------------------------------------------------------------------------------------*
     * Open renderer configuration reader file
     *------------------------------------------------------------------------------------------*/
@@ -419,6 +428,7 @@ int main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure the decoder
@@ -606,6 +616,14 @@ int main(
            goto cleanup;
        }

#ifdef FIX_1158_FASTCONV_REVERB_HRTF
        if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
            goto cleanup;
        }
#endif

        if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
@@ -1091,6 +1109,11 @@ static bool parseCmdlIVAS_dec(
        arg->directivityPatternId[i] = 65535;
    }

#ifdef OBJ_EDITING_EXAMPLE
    arg->objEditEnabled = false;
#endif


    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1544,6 +1567,14 @@ static bool parseCmdlIVAS_dec(
            i += tmp;
        }

#ifdef OBJ_EDITING_EXAMPLE
        else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 )
        {
            arg->objEditEnabled = true;
            i++;
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -1748,6 +1779,9 @@ static void usage_dec( void )
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
    fprintf( stdout, "                      default is deactivated\n" );
#ifdef OMASA_OBJECT_EDITING
    fprintf( stdout, "-obj_edit           : enable object editing\n" );
#endif
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
    fprintf( stdout, "-info <folder>      : specify subfolder name for debug output\n" );
@@ -2115,6 +2149,10 @@ static ivas_error decodeG192(
        return error;
    }

#ifdef OBJ_EDITING_API
    IVAS_EDITABLE_PARAMETERS editableParameters;
#endif

    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;

@@ -2416,11 +2454,84 @@ static ivas_error decodeG192(
                }
#endif
                /* Feed into decoder */
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi
#ifdef OBJ_EDITING_API
                                                          ,
                                                          isSplitRend,
                                                          splitRendBits
#endif
                                                          ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#ifdef OBJ_EDITING_API
#ifdef OBJ_EDITING_EXAMPLE
                if ( arg.objEditEnabled )
                {

                    /* Do object info editing here */
                    /* get object parameters */
                    if ( ( error = IVAS_DEC_GetEditableParameters( hIvasDec, &editableParameters ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError: could not get the editable parameters: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }

                    /* edit object parameters...*/

                    /* put the objects equally spaced at the horizontal plane */
                    /* and play a little bit with the gains... */
                    int16_t obj_idx, non_diegetic_obj_idx;
                    int16_t num_nondiegetic_objects;

                    num_nondiegetic_objects = 0;
                    for ( obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ )
                    {
                        if ( !editableParameters.ism_metadata[obj_idx].non_diegetic_flag )
                        {
                            num_nondiegetic_objects++;
                        }
                    }
                    if ( num_nondiegetic_objects )
                    {
                        float start_angle, angle_inc;
                        angle_inc = 360.0f / (float) num_nondiegetic_objects;
                        start_angle = angle_inc / 2.0f;
                        for ( obj_idx = 0, non_diegetic_obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ )
                        {
                            if ( !editableParameters.ism_metadata[obj_idx].non_diegetic_flag )
                            {
                                editableParameters.ism_metadata[obj_idx].elevation = 0.0f;
                                editableParameters.ism_metadata[obj_idx].azimuth = start_angle + (float) non_diegetic_obj_idx * angle_inc;
                                non_diegetic_obj_idx++;
                            }
                        }
                    }

                    /* breakover object gains */
                    for ( obj_idx = 0; obj_idx < editableParameters.num_obj; obj_idx++ )
                    {
                        editableParameters.ism_metadata[obj_idx].gain = 0.5f + (float) ( ( frame + obj_idx * 50 ) % 250 ) / 250.0f;
                    }

                    editableParameters.gain_bed = 0.5f;

                    /* set new object parameters*/
                    if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError: could not set the editable parameters: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
#endif
                /* Do the final preparations needed for rendering */
                if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError: could not prepare the renderer: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#endif
            }

            if ( isSplitRend )
@@ -2970,6 +3081,11 @@ static ivas_error decodeVoIP(
    int16_t vec_pos_update, vec_pos_len;
    int16_t nOutSamples = 0;

#ifdef OBJ_EDITING_API
    bool parameterAvailableForEditing = false;
    uint16_t nSamplesRendered = 0;
#endif

    vec_pos_update = 0;
    if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK )
    {
@@ -3086,6 +3202,9 @@ static ivas_error decodeVoIP(

    while ( 1 )
    {
#ifdef OBJ_EDITING_API
        nSamplesRendered = 0;
#endif

        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
@@ -3248,15 +3367,37 @@ static ivas_error decodeVoIP(


        /* decode and get samples */
#ifdef OBJ_EDITING_API
        while ( nSamplesRendered < nOutSamples )
        {
#endif

#ifdef SUPPORT_JBM_TRACEFILE
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter
#ifdef OBJ_EDITING_API
                                                     ,
                                                     &nSamplesRendered, &parameterAvailableForEditing
#endif
                                                     ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, &parameterAvailableForEditing
#ifdef OBJ_EDITING_API
                                                                                                                                                   & nSamplesRendered,
                                                 &parameterAvailableForEditing
#endif
                                                 ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
#ifdef OBJ_EDITING_API
            if ( parameterAvailableForEditing == true )
            {
                /* do the object editing here */
            }
        } /* while ( nSamplesRendered < nOutSamples ) */
#endif

        /* write JBM Offset file entry */
        if ( jbmOffsetWriter != NULL )
+0 −14
Original line number Diff line number Diff line
@@ -169,10 +169,8 @@ typedef struct
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    int16_t Opt_Headrotation;
    int16_t Opt_ExternalOrientation;
#endif
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_REND_COMPLEXITY_LEVEL complexityLevel;
@@ -886,11 +884,7 @@ int main(

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -2518,10 +2512,8 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );
    clearString( args.externalOrientationFilePath );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    args.Opt_Headrotation = 0;
    args.Opt_ExternalOrientation = 0;
#endif
    args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;

    args.nonDiegeticPan = 0;
@@ -2611,9 +2603,7 @@ static void parseOption(
            break;
        case CmdLnOptionId_trajFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_Headrotation = 1;
#endif
            strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_outputMetadata:
@@ -2634,9 +2624,7 @@ static void parseOption(
            break;
        case CmdLnOptionId_exteriorOrientationFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_ExternalOrientation = 1;
#endif
            strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_customHrtfFile:
@@ -2761,12 +2749,10 @@ static CmdlnArgs parseCmdlnArgs(
        exit( -1 ); /* Error printout handled by failing function */
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        args.Opt_Headrotation = 1;
    }
#endif

    return args;
}
+5 −0
Original line number Diff line number Diff line
@@ -15,4 +15,9 @@
    <li><a href="ivas-pytest-compare_ref-long-enc-lev+10-index.html">ivas-pytest-compare_ref-long-enc-lev+10</a></li>
    <li><a href="ivas-pytest-compare_ref-long-enc-lev-10-index.html">ivas-pytest-compare_ref-long-enc-lev-10</a></li>
  </ul>

  <h3>Complexity Reports</h3>

  {}

</body>
+12 −5
Original line number Diff line number Diff line
@@ -199,11 +199,15 @@ def tr_from_row(row, id_current, id_previous):
                if float(curr) > float(prev):
                    curr += f" {ARROW_UP}"
                    # increase is bad -> mark in red, execpt for SNR for which it is good -> mark in green
                    td_tmpl_curr = TD_TMPL_REDUCE if c == "MIN_SSNR" else TD_TMPL_INCREASE
                    td_tmpl_curr = (
                        TD_TMPL_REDUCE if c == "MIN_SSNR" else TD_TMPL_INCREASE
                    )
                elif float(curr) < float(prev):
                    curr += f" {ARROW_DOWN}"
                    # reduce is good -> mark in green, execpt for SNR for which it is bad -> mark in red
                    td_tmpl_curr = TD_TMPL_INCREASE if c == "MIN_SSNR" else TD_TMPL_REDUCE
                    td_tmpl_curr = (
                        TD_TMPL_INCREASE if c == "MIN_SSNR" else TD_TMPL_REDUCE
                    )
            except ValueError:
                # if we land here, one of the cells is not a number, this indicates a crash
                # or some error in the scripts, so mark with red as well
@@ -295,6 +299,7 @@ def merge_tables(tbl1, tbl2, suffix1, suffix2, merge_key, other_keys):
        for key in other_keys:
            new_row[f"{key}-{suffix1}"] = row1[key]

        found_merge_key_in_both_tbls = False
        for row2 in tbl2:
            if row1[merge_key] == row2[merge_key]:
                new_row[merge_key] = row1[merge_key]
@@ -303,14 +308,16 @@ def merge_tables(tbl1, tbl2, suffix1, suffix2, merge_key, other_keys):
                        new_row[f"{key}-{suffix2}"] = row2[key]
                    else:
                        new_row[f"{key}-{suffix2}"] = ""

                found_merge_key_in_both_tbls = True
                break

        if found_merge_key_in_both_tbls:
            merged.append(new_row)

    return merged



if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("html_out")
Loading