Commit ff00410b authored by thomas dettbarn's avatar thomas dettbarn
Browse files

Merge branch 'dettbarn_exp5_-_lib_dec' of...

Merge branch 'dettbarn_exp5_-_lib_dec' of https://forge.3gpp.org/rep/sa4/audio/ivas-basop into dettbarn_exp5_-_lib_dec
parents fe789038 0ccef48c
Loading
Loading
Loading
Loading
+57 −2
Original line number Diff line number Diff line
variables:
  # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this
  # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 44cb5638949b874ce0f5c3bf4359f9db860d88bc
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 41186736915f5c0a857ac92e8ab438c434e5247d

include:
  - local: .gitlab-ci/variables.yml
@@ -38,6 +38,9 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-compare-long'
      variables:
        IVAS_PIPELINE_NAME: 'Run comparison tools against float ref (long test vectors): $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-compare-long-fx-fx'
      variables:
        IVAS_PIPELINE_NAME: 'Run comparison tools against float ref FX-FX (long test vectors): $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-compare-to-input'
      variables:
        IVAS_PIPELINE_NAME: 'Run comparison tools against input (pass-through only): $CI_COMMIT_BRANCH'
@@ -133,6 +136,15 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never

.rules-pytest-long-fx-fx:
  rules:
    - if: $PYTEST_MLD_LONG_FX_FX # Set by scheduled pipeline
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "pytest-compare-long-fx-fx"
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never

.rules-coverage:
  rules:
    - if: $COVERAGE_TEST # Set by scheduled pipeline
@@ -184,7 +196,7 @@ workflow:
.ivas-pytest-anchor: &ivas-pytest-anchor
  stage: test
  needs: ["build-codec-linux-make"]
  timeout: "360 minutes"
  timeout: "15 hours"
  variables:
    # keep "mld" in artifact name for backwards compatibility reasons
    CSV_ARTIFACT_NAME: "mld--$CI_JOB_NAME-$CI_JOB_ID--sha-$CI_COMMIT_SHORT_SHA.csv"
@@ -1336,6 +1348,49 @@ ivas-pytest-compare_ref-long-dec-lev+10:
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor

ivas-pytest-compare_ref-long-fx-fx:
  extends:
    - .rules-pytest-long-fx-fx
    - .test-job-linux
  tags:
    - ivas-linux
  before_script:
    - USE_LTV=1
    - REF_ENCODER_PATH=./$DUT_ENCODER_PATH
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=1.0
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor

ivas-pytest-compare_ref-long-fx-fx-lev-10:
  extends:
    - .rules-pytest-long-fx-fx
    - .test-job-linux
  tags:
    - ivas-linux
  before_script:
    - USE_LTV=1
    - REF_ENCODER_PATH=./$DUT_ENCODER_PATH
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=0.3162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor

ivas-pytest-compare_ref-long-fx-fx-lev+10:
  extends:
    - .rules-pytest-long-fx-fx
    - .test-job-linux
  tags:
    - ivas-linux
  before_script:
    - USE_LTV=1
    - REF_ENCODER_PATH=./$DUT_ENCODER_PATH
    - TEST_SUITE="$LONG_TEST_SUITE_NO_RENDERER"
    - LEVEL_SCALING=3.162
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor


ivas-smoke-test-saturation:
  extends:
    - .rules-pytest-saturation-smoke-test
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ variables:
      - 'pytest-compare'
      - 'pytest-compare-enc-dmx'
      - 'pytest-compare-long'
      - 'pytest-compare-long-fx-fx'
      - 'pytest-compare-to-input'
      - 'pytest-saturation-smoke-test'
      - 'evs-26444'
+95 −0
Original line number Diff line number Diff line
@@ -2462,7 +2462,14 @@ static ivas_error decodeVoIP(
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;
#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
        if ( vec_pos_update == 0 )
        {
            systemTime_ms += vec_pos_len * systemTimeInc_ms;
        }
#else
        systemTime_ms += systemTimeInc_ms;
#endif

#ifdef WMOPS
        update_mem();
@@ -2470,6 +2477,94 @@ static ivas_error decodeVoIP(
#endif
    }


#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
    int16_t nSamplesFlushed = 0;

    /* decode and get samples */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    if ( nSamplesFlushed )
    {
        /* Write current frame */
        if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nOutput audio file writer error\n" );
            goto cleanup;
        }

        /* Write ISm metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
            {
                if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

                for ( i = 0; i < numObj; ++i )
                {
                    IVAS_ISM_METADATA IsmMetadata;

                    if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, &IsmMetadata, 0, i ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetObjectMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }

                    if ( ( IsmFileWriter_writeFrame( IsmMetadata, ismWriters[i] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError writing ISM metadata to file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) );
                        goto cleanup;
                    }
                }
            }

            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

                /* delayNumSamples is zeroed, and delayNumSamples_orig is updated only on first good frame, so need to re-fetch delay info */
                if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamples, &delayTimeScale ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
                }
            }
        }
    }
#endif


    /*------------------------------------------------------------------------------------------*
     * Add zeros at the end to have equal length of synthesized signals
     *------------------------------------------------------------------------------------------*/
+4 −0
Original line number Diff line number Diff line
@@ -1409,7 +1409,11 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s )
        *s = 0;
        return ( (Word32) 0 );
    }
#ifdef FIX_USAN_BASOP_UTIL_DIVIDE3232
    IF( EQ_32( y, (Word32) 0x80000000 ) )
#else
    IF( EQ_32( y, 0x80000000 ) )
#endif
    {
        /* Division by -1.0: same as negation of numerator */
        /* Return normalized negated numerator */
+31 −12
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ void cldfbAnalysis_ts_fx(
        }
        fft_cldfb_fx( rBuffer_fx, M2 );

#ifndef FIX_1733_CLDFB_BUG
        /* post modulation of DST IV */
        FOR( k = 0; k < M2; k++ )
        {
@@ -533,6 +534,7 @@ void cldfbAnalysis_ts_fx(
            move32();
            move32();
        }
#endif
        *q_cldfb = sub( *q_cldfb, 2 );
        move16();

@@ -553,6 +555,23 @@ void cldfbAnalysis_ts_fx(
            move32();
        }

#ifdef FIX_1733_CLDFB_BUG
        /* post modulation of DST IV */
        FOR( k = 0; k < M2; k++ )
        {
            /*cplxMult(&realBuffer[M1-1-(2*k)],&realBuffer[2*k],rBuffer[2*k],rBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/
#ifdef OPT_AVOID_STATE_BUF_RESCALE
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5
            realBuffer_fx[2 * k] = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] );                      // q - 5
#else                                                                                                                                                              /* OPT_AVOID_STATE_BUF_RESCALE */
            realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = L_sub( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5
            realBuffer_fx[2 * k] = L_add( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) );                      // q - 5
#endif                                                                                                                                                             /* OPT_AVOID_STATE_BUF_RESCALE */
            move32();
            move32();
        }

#endif
        /* post modulation of DCT IV */
        FOR( k = 0; k < M2; k++ )
        {
Loading