Commit b27584a6 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into...

Merge branch 'main' of ssh://forge.3gpp.org:29419/sa4/audio/ivas-basop into 1072-complexity-high-complexity-overhead-for-osba-decoding_tmpbranch1
parents 8fcadb93 d818c148
Loading
Loading
Loading
Loading
+102 −10
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ variables:
  PRM_FILES: "scripts/config/self_test.prm scripts/config/self_test_ltv.prm"
  TESTCASE_TIMEOUT_STV: 900
  TESTCASE_TIMEOUT_LTV: 2400
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 7200
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 10800
  CI_REGRESSION_THRESH_MLD: "0.1"
  CI_REGRESSION_THRESH_MAX_ABS_DIFF: "50"
  CI_REGRESSION_THRESH_SSNR: "-1"
@@ -32,6 +32,7 @@ variables:
  INSTR_DIR: "scripts/c-code_instrument"
  BUILD_WITH_DEBUG_MODE_INFO: ""
  ENCODER_TEST: ""
  COMPARE_DMX: ""
  SKIP_REGRESSION_CHECK: ""
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec."
@@ -39,6 +40,7 @@ variables:
    options:
      - 'default'
      - 'pytest-compare'
      - 'pytest-compare-enc-dmx'
      - 'pytest-compare-long'
      - 'pytest-compare-to-input'
      - 'pytest-saturation-smoke-test'
@@ -72,6 +74,9 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-compare'
      variables:
        IVAS_PIPELINE_NAME: 'Run comparison tools against float ref: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'pytest-compare-enc-dmx'
      variables:
        IVAS_PIPELINE_NAME: 'Run encoder dmx comparison against float ref: $CI_COMMIT_BRANCH'
    - 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'
@@ -141,6 +146,7 @@ stages:
  - git checkout $REFERENCE_BRANCH
  - git pull
  - *activate-debug-mode-info-if-set
  - cat lib_com/options.h
  - make clean
  - make -j
  - mv ./IVAS_cod ./$REF_ENCODER_PATH
@@ -167,9 +173,18 @@ stages:
  - python3 tests/create_short_testvectors.py
  # create references
  - exit_code=0

  - enc_stats_arg=""
  - if [ "$ENCODER_TEST" = "true" ]; then enc_stats_arg="--enc_stats"; fi
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 $enc_stats_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?
  - if [ "$ENCODER_TEST" = "true" ]; then
  -   enc_stats_arg="--enc_stats"
  - fi

  - enc_dmx_arg=""
  - if [ "$COMPARE_DMX" = "true" ]; then
  -   enc_dmx_arg="--compare_enc_dmx"
  - fi

  - python3 -m pytest $TEST_SUITE -v --update_ref 1 $enc_stats_arg $enc_dmx_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$?

.update-scripts-repo: &update-scripts-repo
  - cd $SCRIPTS_DIR
@@ -223,6 +238,14 @@ stages:
    - if: $CI_PIPELINE_SOURCE == 'schedule'
      when: never

.rules-pytest-to-ref-enc-sort-dmx:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "pytest-compare-enc-dmx"
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'schedule'
      when: never

.rules-pytest-to-main-short:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main
@@ -299,6 +322,7 @@ stages:
    SUMMARY_HTML_ARTIFACT_NAME: "summary_$CI_JOB_NAME.html"
    IMAGES_ARTIFACT_NAME: "images_$CI_JOB_NAME"
  script:
    - set -euxo pipefail
    - *print-common-info
    - *update-scripts-repo
    - if [ $USE_LTV -eq 1 ]; then
@@ -314,11 +338,20 @@ stages:
    -   *apply-testv-scaling
    - fi

    - if [ "$ENCODER_TEST" = "true" ]; then BUILD_WITH_DEBUG_MODE_INFO="true"; fi
    - if [ "$COMPARE_DMX" = "true" ] || [ "$ENCODER_TEST" = "true" ]; then
    -   BUILD_WITH_DEBUG_MODE_INFO="true"
    - fi
    - *build-and-create-reference-outputs

    - comp_args="--mld --ssnr --odg"
    - if [ "$ENCODER_TEST" = "true" ]; then comp_args="${comp_args} --enc_stats"; fi
    - if [ "$ENCODER_TEST" = "true" ]; then
    -   comp_args="${comp_args} --enc_stats"
    - fi

    # DMX comparison only in manual job with no other metrics
    - if [ "$COMPARE_DMX" = "true" ]; then
    -   comp_args="--compare_enc_dmx"
    - fi
    - echo "$comp_args"

    ### run pytest
@@ -506,7 +539,7 @@ stages:
.ivas-pytest-sanitizers-anchor: &ivas-pytest-sanitizers-anchor
  stage: test
  needs: ["build-codec-linux-make"]
  timeout: "300 minutes"
  timeout: "600 minutes"
  rules:
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
@@ -522,7 +555,7 @@ stages:
    - *build-reference-and-dut-binaries
    - make clean
    - make -j CLANG=$CLANG_NUM
    - if [[ $CLANG_NUM == 3 ]]; then export UBSAN_OPTIONS="suppressions=scripts/ubsan.supp,report_error_type=1"; fi
    - if [[ $CLANG_NUM == 3 ]]; then export UBSAN_OPTIONS="suppressions=scripts/ubsan_basop.supp,report_error_type=1"; fi
    - testcase_timeout=$TESTCASE_TIMEOUT_LTV_SANITIZERS
    - python3 -m pytest $TEST_SUITE -v --tb=no --update_ref 1 --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout $testcase_timeout --ref_encoder_path $DUT_ENCODER_PATH --ref_decoder_path $DUT_DECODER_PATH
  artifacts:
@@ -871,6 +904,46 @@ ivas-pytest-compare_to_ref-short-enc-lev+10:
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor

# encoder dmx comparison jobs
ivas-pytest-compare_to_ref-dmx-short-enc:
  extends:
    - .rules-pytest-to-ref-enc-sort-dmx
    - .test-job-linux
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - COMPARE_DMX="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor

ivas-pytest-compare_to_ref-dmx-short-enc-lev-10:
  extends:
    - .rules-pytest-to-ref-enc-sort-dmx
    - .test-job-linux
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - COMPARE_DMX="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=0.3162
  <<: *ivas-pytest-anchor

ivas-pytest-compare_to_ref-dmx-short-enc-lev+10:
  extends:
    - .rules-pytest-to-ref-enc-sort-dmx
    - .test-job-linux
  before_script:
    - USE_LTV=0
    - ENCODER_TEST="true"
    - COMPARE_DMX="true"
    - DUT_DECODER_PATH=./$REF_DECODER_PATH
    - TEST_SUITE="$SHORT_TEST_SUITE_ENCODER"
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-anchor

ivas-pytest-enc-msan:
  extends:
    - .test-job-linux
@@ -1253,8 +1326,27 @@ voip-be-on-merge-request:
  - unzip artifacts.zip || true # this may fail on first run, when there are no artifacts there and the zip file is actually just "404"-html
  - ls
  - public_dir="$CI_JOB_NAME-public"

  # if is needed to catch case when no artifact is there (first run), similarly as above
  - if [[ -d $public_dir ]]; then mv $public_dir/* wmops/;  fi
  # 1. check for public_dir being there as this might not be the case when artifact download failed
  # 2. check for public dir not being empty - handle job failures in prev job that happen after the dir is created. In that case, the empty dir is in the artifacts
  - if [ -d $public_dir ] && [ ! -z "$( ls -A $public_dir )" ]; then
  -   mv $public_dir/* wmops/
  # check here if we have the split-by-levels files present - if not, fake them up with the existing global one
  # this is needed for the first run with split graphs on a branch where the global version did run previously
  # NOTE: checking only for level_1 file here as this should already be sufficient
  # NOTE2: also not chechking for RAM for same reason
  -   wmops_all_global="wmops/log_wmops_all.txt"
  -   ram_all_global="wmops/log_ram_all.txt"
  -   if [ -f "${wmops_all_global}" ] && [ ! -f "wmops/log_wmops_all_level_1.txt" ]; then
  -     declare -a suffixes=("level_1" "level_2" "level_3" "rate_sw")
  -     for suffix in "${suffixes[@]}"; do
  -       cp ${wmops_all_global} wmops/log_wmops_all_${suffix}.txt
  -       cp ${ram_all_global} wmops/log_ram_all_${suffix}.txt
  -     done
  -   fi
  - fi

  - ls wmops
  - rm artifacts.zip
  - rm -rf $public_dir
@@ -1271,7 +1363,7 @@ voip-be-on-merge-request:
  &complexity-measurements-prepare-artifacts # prepare artifacts -> move to public directory
  - public_dir="$CI_JOB_NAME-public"
  - mkdir $public_dir
  - mv -f wmops/log_*_all.txt ./*.js ${public_dir}/
  - mv -f wmops/log_*_all*.txt ./*.js ${public_dir}/
  # move logfiles for links
  - mkdir $public_dir/logs
  # first move logs
+106 −24
Original line number Diff line number Diff line
@@ -773,6 +773,9 @@ ivas_error config_acelp1(
    ACELP_config *acelp_cfg,       /* i  : ACELP bit-allocation            */
    const Word16 signalling_bits,  /* i  : number of signalling bits       */
    const Word16 coder_type,       /* i  : coder type                      */
#ifdef NONBE_FIX_GSC_BSTR
    const Word16 inactive_coder_type_flag, /* i  : AVQ (0) or GSC (1) IC flag      */
#endif
    const Word16 tc_subfr,             /* i  : TC subfr ID                     */
    const Word16 tc_call,              /* i  : TC call number (0,1,2,3,5(DEC)) */
    Word16 *nBits_es_Pred,             /* o  : number of bits for Es_pred Q    */
@@ -1068,14 +1071,20 @@ ivas_error config_acelp1(
        {
            bits = sub( bits, TDM_IC_LSF_PRED_BITS );
        }
        /* gain Q bit-budget - part 1 */
        /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */
        test();
        test();
        test();
        test();
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ ||
            ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */
        )
#else
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( coder_type == INACTIVE && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
        {
            *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX_fx( core_brate, coder_type, -1, -1 )];
            move16();
@@ -1196,7 +1205,11 @@ ivas_error config_acelp1(
    {
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */
#else
        IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */
#endif
        {
            acelp_cfg->ltf_mode = FULL_BAND;
            move16();
@@ -1414,7 +1427,14 @@ ivas_error config_acelp1(
        acelp_cfg->fixed_cdk_index[3] = -1;
        move16();
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || /* @12.8kHz core except of GSC */
             ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ ||
             EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */
    )
#else
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
#endif
    {
        /* pitch Q & gain Q bit-budget - part 2*/
        FOR( i = 0; i < nb_subfr; i++ )
@@ -1478,7 +1498,13 @@ ivas_error config_acelp1(
        test();
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( flag_hardcoded /* EVS */ ||
            ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
        {
            FOR( i = 0; i < nb_subfr; i++ )
            {
@@ -1587,7 +1613,12 @@ ivas_error config_acelp1(
        test();
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
        {
            FOR( i = 0; i < nb_subfr; i++ )
            {
@@ -1627,7 +1658,13 @@ ivas_error config_acelp1(
            }
        }
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ ||
             ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ ||
             ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ )
#else
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
    {
        Word32 Local_BR, Pitch_BR;
        Word16 Pitch_CT;
@@ -1768,7 +1805,12 @@ ivas_error config_acelp1(
        test();
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ ||
            ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */
#else
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
#endif
        {
            acelp_cfg->ubits = 0;
            move16();
@@ -1888,6 +1930,9 @@ ivas_error config_acelp1_IVAS(
    ACELP_config *acelp_cfg,       /* i  : ACELP bit-allocation            */
    const Word16 signaling_bits,   /* i  : number of signaling bits        */
    const Word16 coder_type,       /* i  : coder type                      */
#ifdef NONBE_FIX_GSC_BSTR
    const Word16 inactive_coder_type_flag, /* i  : AVQ (0) or GSC (1) IC flag      */
#endif
    const Word16 tc_subfr,             /* i  : TC subfr ID                     */
    const Word16 tc_call,              /* i  : TC call number (0,1,2,3,5(DEC)) */
    Word16 *nBits_es_Pred,             /* o  : number of bits for Es_pred Q    */
@@ -2168,8 +2213,13 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
        test();
        /* gain Q bit-budget - part 1 */
        /* gain Q bit-budget - part 1: 'Es_pred' of memory-less gain Q */
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && coder_type != INACTIVE && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) /* mid bitrates in GC and VC, low+mid bitrates in TC */ ||
            ( coder_type == INACTIVE && !inactive_coder_type_flag ) /* AVQ inactive */ )
#else
        IF( ( NE_16( coder_type, UNVOICED ) && NE_16( coder_type, AUDIO ) && ( coder_type != INACTIVE ) && !( LE_32( core_brate, ACELP_8k00 ) && NE_16( coder_type, TRANSITION ) ) ) || ( ( coder_type == INACTIVE ) && GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
        {
            *nBits_es_Pred = Es_pred_bits_tbl[BIT_ALLOC_IDX( core_brate, coder_type, -1, -1 )];
            move16();
@@ -2294,7 +2344,11 @@ ivas_error config_acelp1_IVAS(
    {
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && inactive_coder_type_flag ) /* GSC Inactive @16kHz */
#else
        IF( coder_type == INACTIVE && EQ_16( L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) /* GSC Inactive @16kHz */
#endif
        {
            acelp_cfg->ltf_mode = FULL_BAND;
            move16();
@@ -2510,7 +2564,13 @@ ivas_error config_acelp1_IVAS(
        acelp_cfg->fixed_cdk_index[3] = -1;
        move16();
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) /* @12.8kHz core except of GSC */ ||
             ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( !inactive_coder_type_flag || coder_type != INACTIVE ) ) /* @16kHz core GC, TC, AVQ inactive */ ||
             EQ_16( core, HQ_CORE ) /* ACELP -> HQ switching in EVS */ )
#else
    ELSE IF( ( coder_type != INACTIVE && EQ_16( nb_subfr, NB_SUBFR ) && NE_16( coder_type, AUDIO ) ) || ( EQ_16( nb_subfr, NB_SUBFR16k ) && ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) || coder_type != INACTIVE ) ) || EQ_16( core, HQ_CORE ) )
#endif
    {
        /* pitch Q & gain Q bit-budget - part 2*/
        FOR( i = 0; i < nb_subfr; i++ )
@@ -2574,7 +2634,13 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
        /* algebraic codebook bit-budget */
#ifdef NONBE_FIX_GSC_BSTR
        IF( flag_hardcoded /* EVS */ ||
            ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( flag_hardcoded || ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
        {
            FOR( i = 0; i < nb_subfr; i++ )
            {
@@ -2675,7 +2741,12 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
        /* AVQ codebook */
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) /* high-birate ACELP except IC */ ||
            ( !inactive_coder_type_flag && coder_type == INACTIVE ) /* AVQ inactive */ )
#else
        IF( ( GE_32( core_brate_inp, MIN_BRATE_AVQ_EXC ) && coder_type != INACTIVE ) || ( GT_32( total_brate, MAX_GSC_INACTIVE_BRATE ) && coder_type == INACTIVE ) )
#endif
        {
            FOR( i = 0; i < nb_subfr; i++ )
            {
@@ -2713,7 +2784,13 @@ ivas_error config_acelp1_IVAS(
            }
        }
    }
#ifdef NONBE_FIX_GSC_BSTR
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) /* LBR secondary channel in TD stereo */ ||
             ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) /* GSC @12.8kHz */ ||
             ( coder_type == INACTIVE && inactive_coder_type_flag ) /* AVQ inactive */ )
#else
    ELSE IF( ( EQ_16( coder_type, UNVOICED ) && EQ_16( tdm_low_rate_mode, 1 ) && EQ_16( element_mode, IVAS_CPE_TD ) ) || ( ( coder_type == INACTIVE || EQ_16( coder_type, AUDIO ) ) && EQ_16( nb_subfr, NB_SUBFR ) ) || ( coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) )
#endif
    {
        Word32 Local_BR, Pitch_BR;
        Word16 Pitch_CT;
@@ -2854,7 +2931,12 @@ ivas_error config_acelp1_IVAS(
        test();
        test();
        test();
#ifdef NONBE_FIX_GSC_BSTR
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && inactive_coder_type_flag ) /* GSC Inactive @16kHz */ ||
            ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* IVAS GSC @16kHz */
#else
        IF( ( EQ_16( L_frame, L_FRAME16k ) && coder_type == INACTIVE && LE_32( total_brate, MAX_GSC_INACTIVE_BRATE ) ) || ( GSC_IVAS_mode > 0 && EQ_16( L_frame, L_FRAME16k ) ) ) /* GSC Inactive @16kHz */
#endif
        {
            acelp_cfg->ubits = 0;
            move16();
+1 −1
Original line number Diff line number Diff line
@@ -1213,7 +1213,7 @@ void cldfbSynthesis_ivas_fx(
            /*cplxMult(&iBuffer[2*i], &iBuffer[2*i+1],-imagBuffer[k][2*i], imagBuffer[k][M1-1-2*i], rot_vctr_re[i], rot_vctr_im[i]);*/
            iBuffer_fx[2 * i] = Msub_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_re_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_im_fx[i] ); // Qx
            move32();
            iBuffer_fx[2 * i + 1] = Madd_32_32( Mpy_32_32( ( L_negate( imagBuffer_fx[k][2 * i] ) ), rot_vctr_im_fx[i] ), imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ); // Qx
            iBuffer_fx[2 * i + 1] = Msub_32_32( Mpy_32_32( imagBuffer_fx[k][( M1 - 1 ) - ( i * 2 )], rot_vctr_re_fx[i] ), imagBuffer_fx[k][2 * i], rot_vctr_im_fx[i] ); // Qx
            move32();
        }

+1 −0
Original line number Diff line number Diff line
@@ -1233,6 +1233,7 @@ enum
#define SPC                                 0.0234952f
#define SPC_plus                            SPC * 1.001f
#define ALPHA_SQ                            ( ( 0.5f / PI2 ) * ( 0.5f / PI2 ) )
#define ALPHA_SQ_Q30                        (6799549) /* ( ( 0.5f / PI2 ) * ( 0.5f / PI2 ) ) in Q30 */

#define NC                                  M / 2
#define LSF_GAP                             50.0f
+162 −0
Original line number Diff line number Diff line
@@ -301,6 +301,168 @@ void fft_rel(
    return;
}

void fft_rel_16_32fx(
    Word16 x[],  /* i/o: input/output vector Qx   */
    Word16 *q_x, /* extra scaling added on speech buffer*/
    Word16 i_subfr,
    const Word16 n, /* i  : vector length          */
    const Word16 m  /* i  : log2 of vector length  */
)
{
    Word16 i, j, k, n1, n2, n4;
    Word16 step;
    Word32 xt, t1, t2;
    Word32 *x0, *x1, *x2;
    const Word16 *s, *c;
    Word32 *xi2, *xi3, *xi4, *xi1;

    Word32 fft_bff32[L_FFT];
    Copy_Scale_sig_16_32_no_sat( x, fft_bff32, L_FFT, 0 ); // copying x to fft_bff32 without scaling

    /*-----------------------------------------------------------------*
     * Digit reverse counter
     *-----------------------------------------------------------------*/

    j = 0;
    move16();
    x0 = &fft_bff32[0]; // Qx
    FOR( i = 0; i < n - 1; i++ )
    {
        IF( LT_16( i, j ) )
        {
            xt = fft_bff32[j]; // Qx
            move32();
            fft_bff32[j] = *x0; // Qx
            move32();
            *x0 = xt; // Qx
            move32();
        }
        x0++;
        k = shr( n, 1 );
        WHILE( ( k <= j ) )
        {
            j = sub( j, k );
            k = shr( k, 1 );
        }
        j = add( j, k );
    }

    /*-----------------------------------------------------------------*
     * Length two butterflies
     *-----------------------------------------------------------------*/

    x0 = &fft_bff32[0];
    x1 = &fft_bff32[1];
    FOR( i = 0; i < ( n >> 1 ); i++ )
    {
        xt = *x0;
        move32();
        *x0 = L_add( xt, *x1 );
        move32();
        *x1 = L_sub( xt, *x1 );
        move32();
        x0++;
        x0++;
        x1++;
        x1++;
    }

    /*-----------------------------------------------------------------*
     * Other butterflies
     *
     * The implementation described in [1] has been changed by using
     * table lookup for evaluating sine and cosine functions.  The
     * variable ind and its increment step are needed to access table
     * entries.  Note that this implementation assumes n4 to be so
     * small that ind will never exceed the table.  Thus the input
     * argument n and the constant N_MAX_SAS must be set properly.
     *-----------------------------------------------------------------*/

    n2 = 1;
    move16();
    /* step = N_MAX_SAS/4; */
    FOR( k = 2; k <= m; k++ )
    {
        n4 = n2;
        move16();
        n2 = shl( n4, 1 );
        n1 = shl( n2, 1 );

        step = idiv1616( N_MAX_SAS, n1 );

        x0 = fft_bff32;
        x1 = fft_bff32 + n2;
        x2 = fft_bff32 + add( n2, n4 );
        FOR( i = 0; i < n; i += n1 )
        {
            xt = *x0;
            move32(); /* xt = x[i];   */
            *x0 = L_add( xt, *x1 );
            move32(); /* x[i] = xt + x[i+n2];    */
            *x1 = L_sub( xt, *x1 );
            move32(); /* x[i+n2] = xt - x[i+n2];      */
            *x2 = L_negate( *x2 );
            move32(); /* x[i+n2+n4] = -x[i+n2+n4];     */


            s = sincos_t_fx + step; // Q15
            c = s + 64;             // Q15
            xi1 = fft_bff32 + add( i, 1 );
            xi3 = xi1 + n2;
            xi2 = xi3 - 2;
            xi4 = xi1 + sub( n1, 2 );

            FOR( j = 1; j < n4; j++ )
            {
                t1 = L_add( Mpy_32_16_1( *xi3, *c ), Mpy_32_16_1( *xi4, *s ) ); /* t1 = *xi3**(pt_c+ind) + *xi4**(pt_s+ind); Qx  */
                t2 = L_sub( Mpy_32_16_1( *xi3, *s ), Mpy_32_16_1( *xi4, *c ) ); /* t2 = *xi3**(pt_s+ind) - *xi4**(pt_c+ind); Qx    */
                *xi4 = L_sub( *xi2, t2 );
                move32();
                *xi3 = L_negate( L_add( *xi2, t2 ) );
                move32();
                *xi2 = L_sub( *xi1, t1 );
                move32();
                *xi1 = L_add( *xi1, t1 );
                move32();

                xi4--;
                xi2--;
                xi3++;
                xi1++;
                c += step;
                s += step; /* autoincrement by ar0 */
            }

            x0 += n1;
            x1 += n1;
            x2 += n1;
        }
        /* step = shr(step, 1); */
    }
    Word16 norm = L_norm_arr( fft_bff32, L_FFT );
    IF( i_subfr == 0 )
    {
        Copy_Scale_sig32_16( fft_bff32, x, L_FFT, norm );
        *q_x = sub( norm, 16 );
        move16();
    }
    ELSE
    {
        IF( LT_16( sub( norm, 16 ), *q_x ) )
        {
            scale_sig( x - L_FFT, L_FFT, sub( sub( norm, 16 ), *q_x ) );
            Copy_Scale_sig32_16( fft_bff32, x, L_FFT, norm );
            *q_x = sub( norm, 16 );
            move16();
        }
        ELSE
        {
            Copy_Scale_sig32_16( fft_bff32, x, L_FFT, add( 16, *q_x ) );
        }
    }

    return;
}

void fft_rel_fx(
    Word16 x[],     /* i/o: input/output vector Qx   */
Loading