Commit bca52151 authored by norvell's avatar norvell
Browse files

Merge branch 'main' into ci/enforce-code-formatting

parents e0432a5b caeaf269
Loading
Loading
Loading
Loading
Loading
+44 −7
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ variables:
  SCRIPTS_DIR: "/usr/local/scripts"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1
  LONG_TEST_SUITE: "tests/test_param_file_ltv.py tests/renderer"
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection/test_param_file.py tests/renderer --param_file scripts/config/self_test_ltv.prm"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  TEST_SUITE: ""
  DUT_ENCODER_PATH: "./IVAS_cod"
@@ -77,6 +77,7 @@ stages:
  - prevalidate
  - build
  - test
  - deploy

# ---------------------------------------------------------------
# Generic script anchors
@@ -123,10 +124,10 @@ stages:

.update-scripts-repo: &update-scripts-repo
  - cd $SCRIPTS_DIR
  - git remote set-branches --add origin $BASOP_CI_BRANCH_PC_REPO
  - git remote prune origin
  - git branch
  - sed -i '/fetch/d' .git/config # Remove all fetch lines to clean out dead links
  - git remote set-branches --add origin $BASOP_CI_BRANCH_PC_REPO # Add currently used branch
  - git fetch
  - git restore . # Just as a precaution
  - git checkout $BASOP_CI_BRANCH_PC_REPO
  - git pull
  - cd -
@@ -217,6 +218,8 @@ stages:
  stage: test
  needs: ["build-codec-linux-make"]
  timeout: "240 minutes"
  variables:
    MLD_ARTIFACT_NAME: "mld--$CI_JOB_NAME-$CI_JOB_ID--sha-$CI_COMMIT_SHORT_SHA.csv"
  script:
    - *print-common-info
    - *update-scripts-repo
@@ -238,7 +241,21 @@ stages:
    - python3 -m pytest $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

    - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv
    - python3 scripts/parse_mld_xml.py report-junit.xml $MLD_ARTIFACT_NAME

    - if [ $USE_LTV -eq 1 ] && [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
    -    id_previous=$(python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID)
    -    echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous"
    -    curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip
    -    unzip artifacts.zip -d previous_artifacts
    # This wildcard thingy relies on only one csv file being present per job
    -    file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv"
    -    python3 ci/basop-pages/create_report_pages.py $CI_JOB_NAME-index.html $CI_JOB_NAME--merged_csv--$CI_JOB_ID--$id_previous.csv $MLD_ARTIFACT_NAME $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME
    - else
    # create empty file for artifacts to avoid errors
    -    touch $CI_JOB_NAME-index.html
    -    touch $CI_JOB_NAME--merged_csv--$CI_JOB_ID--$id_previous.csv
    - fi

    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi
@@ -254,7 +271,9 @@ stages:
    paths:
      - report-junit.xml
      - report.html
      - mld.csv
      - $CI_JOB_NAME-index.html
      - $MLD_ARTIFACT_NAME
      - $CI_JOB_NAME-merged_csv--$CI_JOB_ID--$id_previous.csv
    expose_as: "pytest mld results"
    reports:
      junit:
@@ -656,3 +675,21 @@ be-2-evs-26444:
    reports:
      junit:
        - report-junit.xml    

# job that sets up gitlab pages website
pages:
  stage: deploy
  tags:
    - ivas-basop-linux
  rules:
    - if: $UPDATE_PAGES
  script:
    - *print-common-info
    - *update-scripts-repo
    - python3 ci/setup_pages.py
    - ls
    - ls public
  artifacts:
    paths:
      - public
    expire_in: 1 day
+1 −1
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ int main(
        {
            renderConfig.directivity_fx[i * 3] = (Word16) ( renderConfig.directivity[i * 3] * ( 1u << 6 ) );
            renderConfig.directivity_fx[i * 3 + 1] = (Word16) ( renderConfig.directivity[i * 3 + 1] * ( 1u << 6 ) );
            renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( 1u << 15 ) );
            renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( (1u << 15)-1 ) );
        }
#endif // IVAS_FLOAT_FIXED

+37 −2
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@
#include "vector3_pair_file_reader.h"
#include "wmc_auto.h"

#ifdef IVAS_FLOAT_FIXED
#include "prot_fx1.h"
#endif

#define WMC_TOOL_SKIP

/*------------------------------------------------------------------------------------------*
@@ -826,11 +830,20 @@ int main(
    }
    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#ifdef IVAS_FLOAT_FIXED
    Word32 nonDiegeticPanGain_fx = (args.nonDiegeticPanGain ==1.0f)? ONE_IN_Q31: (args.nonDiegeticPanGain == -1.0f)? L_negate(ONE_IN_Q31):(Word32)(args.nonDiegeticPanGain*(1LL<< Q31 ));
    IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
    }
#else
    IF ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
    }
#endif // IVAS_FLOAT_FIXED

    /* === Configure === */
    if ( ( error = IVAS_REND_InitConfig( hIvasRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
@@ -924,12 +937,20 @@ int main(
            fprintf( stderr, "Error in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) );
            exit( -1 );
        }

#ifdef IVAS_FLOAT_FIXED
        Word32 var1 = (Word32)(args.syncMdDelay);
        IF((error = IVAS_REND_SetIsmMetadataDelay(hIvasRend, var1)) != IVAS_ERR_OK)
        {
            fprintf(stderr, "Error in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string(error));
            exit(-1);
        }
#else
        if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) );
            exit( -1 );
        }
#endif
    }

    IVAS_REND_LfePanMtx lfePanMatrix;
@@ -2540,6 +2561,9 @@ void getMetadataFromFileReader(
#ifdef IVAS_FLOAT_FIXED
    objectMetadataBuffer->positions[objIdx].azimuth_fx = (Word32)(ismMetadata.azimuth * (1<<22));
    objectMetadataBuffer->positions[objIdx].elevation_fx = (Word32)(ismMetadata.elevation * (1 << 22));
    objectMetadataBuffer->positions[objIdx].radius_fx = (Word16)(ismMetadata.radius * (1 << 9));
    objectMetadataBuffer->positions[objIdx].yaw_fx = (Word32)(ismMetadata.yaw * (1 << 22));
    objectMetadataBuffer->positions[objIdx].pitch_fx = (Word32)(ismMetadata.pitch * (1 << 22));
#endif // DEBUG

    objectMetadataBuffer->positions[objIdx].azimuth = ismMetadata.azimuth;
@@ -2605,6 +2629,13 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].radius = 1.0f;
            objectMetadataBuffer->positions[objIdx].yaw = 0.0f;
            objectMetadataBuffer->positions[objIdx].pitch = 0.0f;
#ifdef IVAS_FLOAT_FIXED
            objectMetadataBuffer->positions[objIdx].azimuth_fx = 0;
            objectMetadataBuffer->positions[objIdx].elevation_fx = 0;
            objectMetadataBuffer->positions[objIdx].radius_fx = 512;
            objectMetadataBuffer->positions[objIdx].yaw_fx = 0;
            objectMetadataBuffer->positions[objIdx].pitch_fx = 0;
#endif
            objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0;
        }

@@ -2636,6 +2667,10 @@ static void IsmPositionProvider_getNextFrame(

        /* Clamp pitch to lie within [-90, 90] range (can't be wrapped easily) */
        objectMetadataBuffer->positions[objIdx].pitch = min( max( objectMetadataBuffer->positions[objIdx].pitch, -90 ), 90 );
#ifdef IVAS_FLOAT_FIXED
        objectMetadataBuffer->positions[objIdx].yaw_fx = (Word32)objectMetadataBuffer->positions[objIdx].yaw * (1 << Q22);
        objectMetadataBuffer->positions[objIdx].pitch_fx = (Word32)objectMetadataBuffer->positions[objIdx].pitch * (1 << Q22);
#endif
    }

    ++positionProvider->frameCounter;
+43 −1
Original line number Diff line number Diff line
@@ -2438,6 +2438,48 @@ void mdct_switching_dec(
 * Simulate packet losses by reading FEC pattern from external file
 *-------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
Decoder_State **reset_elements(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
{
    Word16 k, n;
    Decoder_State **sts = NULL; /* to avoid compilation warning */

    FOR ( k = 0; k < st_ivas->nSCE; k++ )
    {
        sts = st_ivas->hSCE[k]->hCoreCoder;

        sts[0]->bfi = 0;
        sts[0]->BER_detect = 0;
        sts[0]->mdct_sw_enable = 0;
        sts[0]->mdct_sw = 0;

        move16(); move16(); move16(); move16();

        reset_indices_dec( sts[0] );
    }

    FOR ( k = 0; k < st_ivas->nCPE; k++ )
    {
        sts = st_ivas->hCPE[k]->hCoreCoder;

        FOR ( n = 0; n < CPE_CHANNELS; n++ )
        {
            sts[n]->bfi = 0;
            sts[n]->BER_detect = 0;
            sts[n]->mdct_sw_enable = 0;
            sts[n]->mdct_sw = 0;

            move16(); move16(); move16(); move16();

            reset_indices_dec( sts[n] );
        }
    }

    return sts; /* return last decoder state */
}
#else
Decoder_State **reset_elements(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
@@ -2474,7 +2516,7 @@ Decoder_State **reset_elements(

    return sts; /* return last decoder state */
}

#endif

/*-------------------------------------------------------------------*
 * ivas_set_bitstream_pointers()
+6 −2
Original line number Diff line number Diff line
@@ -731,6 +731,8 @@ void cldfbAnalysis_ts_fx(
        Copy32( timeIn_fx, timeBuffer_fx + offset, frameSize );
    }

    h_cldfb->Q_cldfb_state = *q_cldfb;

    /* only process needed cols */
    if ( samplesToProcess > -1 )
    {
@@ -968,6 +970,7 @@ void cldfbAnalysis_ts_fx_fixed_q(
    /* prepare input buffer */
    timeBuffer_fx = buffer_fx;
    Copy32( h_cldfb->cldfb_state_fx, timeBuffer_fx, offset );
    h_cldfb->Q_cldfb_state = *q_cldfb;

    if ( samplesToProcess > -1 )
    {
@@ -1659,7 +1662,7 @@ ivas_error openCldfb_ivas(
	hs->cldfb_state_length = buf_len;//Temporarily added to store the length of buffer
	hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/
    set32_fx(hs->cldfb_state_fx, 0, buf_len);
    hs->Q_cldfb_state = Q31;
    hs->Q_cldfb_state = Q11;
#endif // IVAS_FLOAT_FIXED


@@ -1756,7 +1759,7 @@ ivas_error openCldfb_ivas_fx(
    hs->cldfb_state_length = buf_len; // Temporarily added to store the length of buffer
	hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/
    set32_fx(hs->cldfb_state_fx, 0, buf_len);

    hs->Q_cldfb_state = Q11;
    /* TODO: remove the floating point dependency */

    IF ( ( hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ) ) == NULL )
@@ -2609,6 +2612,7 @@ void cldfb_reset_memory_fx(
	hs->cldfb_state_length = memory_length;
		/* save the memory */
	set32_fx(hs->cldfb_state_fx, 0, memory_length);
    hs->Q_cldfb_state = Q11;

    return;
}
Loading