Commit 63ab61d0 authored by norvell's avatar norvell
Browse files

Merge branch 'main' into 850-ci-add-history-graph-to-report-page

parents 1398a2b4 ca08f4da
Loading
Loading
Loading
Loading
Loading
+281 −174
Original line number Diff line number Diff line
@@ -290,8 +290,8 @@ stages:

    - if [ $zero_errors != 1 ]; then
    -     echo "Run errors encountered!"
    # TODO: temporary only to not fail pipelines on crashes in encoder
    -     if [[ "$CI_JOB_NAME" =~ "ivas-pytest-compare_to_ref-short-enc" ]]; then
    # TODO: temporary only to not fail MR pipelines on crashes
    -     if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then
    -         exit $EXIT_CODE_NON_BE
    -     else
    -         exit $EXIT_CODE_FAIL
@@ -358,10 +358,13 @@ stages:
    # this per default builds the branch and the reference and creates the reference outputs
    - *build-and-create-reference-outputs
    - exit_code=0
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=$HTML_REPORT_BRANCH --self-contained-html --junit-xml=$XML_REPORT_BRANCH --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - python3 -m pytest --tb=no $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_BRANCH --self-contained-html --junit-xml=$XML_REPORT_BRANCH --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - zero_errors_branch=$(cat $XML_REPORT_BRANCH | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_BRANCH $CSV_BRANCH

    # Store branch outputs for comparison
    - mv tests/dut tests/dut_branch

    # create the summary based on the branch
    - mkdir $IMAGES_ARTIFACT_NAME
    - for MEASURE in MLD DIFF SSNR;do python3 scripts/create_histogram_summary.py $CSV_BRANCH $IMAGES_ARTIFACT_NAME/summary_"$MEASURE".csv $IMAGES_ARTIFACT_NAME/summary_"$MEASURE".png --measure $MEASURE; done
@@ -372,24 +375,38 @@ stages:
    - git pull
    - make clean
    - make -j
    - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=$HTML_REPORT_MAIN --self-contained-html --junit-xml=$XML_REPORT_MAIN --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 -m pytest --tb=no $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_MAIN --self-contained-html --junit-xml=$XML_REPORT_MAIN --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_MAIN $CSV_MAIN

    # If outputs of main and branch are equal, have equal reports and no run errors were encountered, the job will pass.
    - diff_sba=0
    - diff_param=0
    - diff_report=0
    - python3 scripts/batch_comp_audio.py --tool pyaudio3dtools -sd tests/dut/sba_bs/raw tests/dut_branch/sba_bs/raw || diff_sba=$?
    - python3 scripts/batch_comp_audio.py --tool pyaudio3dtools -sd tests/dut/param_file/dec tests/dut_branch/param_file/dec || diff_param=$?
    - diff $CSV_BRANCH $CSV_MAIN || diff_report=$?
    - if [ $diff_param -eq 0 ] && [ $diff_sba -eq 0 ] && [ $diff_report -eq 0 ] && [ $zero_errors_branch -eq 1 ]; then
    -    echo "Output BE to main, identical report and no run errors encountered."
    -    exit 0;
    - fi

    ### compare the two csv files for regressions
    - regressions_found=0
    - python3 scripts/basop_check_for_changes_in_testcases.py $CSV_BRANCH $CSV_MAIN || regressions_found=$?

    - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit_code=$EXIT_CODE_NON_BE; fi
    - if [ $zero_errors_branch != 1 ]; then echo "Run errors encountered!"; exit_code=$EXIT_CODE_NON_BE; fi
    - if [ $regressions_found != 0 ]; then
    -    echo "Detected regression wrt to main!"
    -    if [ $allow_regressions_flag == 0 ]; then
    -        exit $EXIT_CODE_FAIL;
    -        echo "Detected regression wrt to main, [allow regression] not set!"
    -        exit_code=$EXIT_CODE_FAIL;
    -    else
    -        exit $EXIT_CODE_NON_BE;
    -        echo "Detected regression wrt to main, [allow regression] set."
    -        exit_code=$EXIT_CODE_NON_BE;
    -    fi
    - fi
    - if [ $zero_errors_branch != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi
    - exit 0

    - exit $exit_code
  after_script:
    - rm -rf tests/dut tests/ref
  allow_failure:
@@ -699,7 +716,7 @@ ivas-pytest-compare_to_ref-short-dec:
    - LEVEL_SCALING=1.0
  <<: *ivas-pytest-anchor
  
ivas-pytest-compare_to_ref-short-lev-10:
ivas-pytest-compare_to_ref-short-dec-lev-10:
  extends:
    - .rules-pytest-to-ref-short
    - .test-job-linux    
@@ -965,10 +982,10 @@ ivas-pytest-renderer:
.complexity-template:
  extends:
    - .test-job-linux
  timeout: 3 hours 30 minutes
  stage: test
  variables:
    ret_val: 0
  timeout: 3 hours 30 minutes
  before_script:
    - *print-common-info
    - *update-scripts-repo
@@ -979,7 +996,7 @@ ivas-pytest-renderer:
  artifacts:
    name: "$CI_JOB_NAME--$CI_COMMIT_REF_NAME--sha-$CI_COMMIT_SHA"
    when: always
    expire_in: 1 week
    expire_in: 2 week
    paths:
      - $CI_JOB_NAME-public

@@ -995,200 +1012,290 @@ complexity-stereo-in-stereo-out:
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-stereo-in-7_1_4-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#   script:
#     - in_format=stereo
#     - out_format=7_1_4
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-ism-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 1 hour
  script:
    - in_format=ISM
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-ism-in-ext-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 1 hours
#   script:
#     - in_format=ISM
#     - out_format=EXT
#     - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-ism-in-binaural_room_ir-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 2 hours
  script:
    - in_format=ISM
    - out_format=BINAURAL_ROOM_IR
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-ism-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 1 hours
#   script:
#     - in_format=ISM
#     - out_format=BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB
#     - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-ism-in-ext-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 3 hours 30 minutes
  script:
    - in_format=ISM
    - out_format=EXT
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-hoa3-in-hoa3-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=HOA3
#     - out_format=HOA3
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-sba-hoa3-in-hoa3-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 4 hours 30 minutes
  script:
    - in_format=HOA3
    - out_format=HOA3
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-hoa3-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=HOA3
#     - out_format=BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-sba-hoa3-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 5 hours 30 minutes
  script:
    - in_format=HOA3
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-osba-in-ext-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=OSBA
#     - out_format=EXT
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-sba-hoa3-in-binaural_room_ir-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 6 hours 30 minutes
  script:
    - in_format=HOA3
    - out_format=BINAURAL_ROOM_IR
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-osba-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=OSBA
#     - out_format=BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-mc-in-7_1_4-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 7 hours 30 minutes
  script:
    - in_format=MC
    - out_format=7_1_4
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-mc-in-7_1_4-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=MC
#     - out_format=7_1_4
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-mc-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 10 hours
  script:
    - in_format=MC
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-mc-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=MC
#     - out_format=BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-mc-in-binaural_room_ir-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 12 hours 30 minutes
  script:
    - in_format=MC
    - out_format=BINAURAL_ROOM_IR
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-masa-in-ext-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=MASA
#     - out_format=EXT
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-masa-in-ext-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 15 hours
  script:
    - in_format=MASA
    - out_format=EXT
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-masa-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=MASA
#     - out_format="BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-masa-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 16 hours
  script:
    - in_format=MASA
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

complexity-masa-in-hoa3-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 17 hours
  script:
    - in_format=MASA
    - out_format=HOA3
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-omasa-in-ext-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#       when: delayed
#       start_in: 13 hours
#   script:
#     - in_format=OMASA
#     - out_format=EXT
#     - ret_val=0
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val

# complexity-omasa-in-binaural-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#   script:
#     - in_format=OMASA
#     - out_format="BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val
complexity-omasa-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 18 hours
  script:
    - in_format=OMASA
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-StereoDmxEVS-stereo-in-mono-out:
complexity-omasa-in-hoa3-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 20 hours
  script:
    - in_format=OMASA
    - out_format=HOA3
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

complexity-StereoDmxEVS-stereo-in-mono-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 22 hours
  script:
    - in_format=StereoDmxEVS
    - out_format=mono
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# complexity-osba-in-ext-out:
#   extends:
#     - .complexity-template
#   rules:
#     - if: $MEASURE_COMPLEXITY_LINUX
#       # when: delayed:
#       # start_in: 2 hours
#       when: delayed
#       start_in: 17 hours
#   script:
#     - in_format=StereoDmxEVS
#     - out_format=mono
#     - in_format=OSBA
#     - out_format=EXT
#     - ret_val=0
#     - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
#     - *complexity-measurements-prepare-artifacts
#     - exit $ret_val

complexity-osba-in-binaural-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 22 hours 30 minutes
  script:
    - in_format=OSBA
    - out_format=BINAURAL
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

complexity-osba-in-binaural_room_ir-out:
  extends:
    - .complexity-template
  rules:
    - if: $MEASURE_COMPLEXITY_LINUX
      when: delayed
      start_in: 25 hours
  script:
    - in_format=OSBA
    - out_format=BINAURAL_ROOM_IR
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

# job that sets up gitlab pages website
pages:
+18 −1
Original line number Diff line number Diff line
@@ -937,7 +937,19 @@ static bool parseCmdlIVAS_enc(
                return false;
            }
        }

#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
        /*-----------------------------------------------------------------*
         * Define additional subfolder for debug info output in ./res
         *-----------------------------------------------------------------*/
        else if ( strcmp( argv_to_upper, "-INFO" ) == 0 )
        {
            extern char infoFolder[FILENAME_MAX];
            strncpy( infoFolder, argv[i + 1], sizeof( infoFolder ) );
            i += 2;
        }
#endif /* #ifdef DEBUG_MODE_INFO_TWEAK */
#endif /* #ifdef DEBUG_MODE_INFO */

        /*-----------------------------------------------------------------*
         * deactivate delay compensation
@@ -1637,6 +1649,11 @@ static void usage_enc( void )
    fprintf( stdout, "-pca                : activate PCA in SBA format FOA at 256 kbps \n" );
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
    fprintf( stdout, "-info <folder>      : specify subfolder name for debug output\n" );
#endif
#endif
    fprintf( stdout, "-q                  : Quiet mode, no frame counters\n" );
    fprintf( stdout, "                      default is deactivated\n" );
    fprintf( stdout, "\n" );
+17 −0
Original line number Diff line number Diff line
@@ -74,3 +74,20 @@ Word16 update_mixed_context( Word16 ctx, Word16 a )
    }
    return add( shl( s_and( ctx, 0xf ), 4 ), add( t, 13 ) );
}

#ifdef IVAS_FLOAT_FIXED
Word32 update_mixed_context_ivas_fx( Word32 ctx, Word16 a )
{
    Word32 t32;

    t32 = L_mac0( 1 - 13, s_and( a, ~1 ), add( shr( a, 2 ), 1 ) );

    a = shr( a, 3 );

    IF( t32 > 0 )
    {
        t32 = L_min( a, 2 );
    }
    return L_add( L_shl( L_and( ctx, 0xf ), 4 ), L_add( t32, 13 ) );
}
#endif
+10 −1
Original line number Diff line number Diff line
@@ -176,8 +176,17 @@ Word32 BASOP_Util_InvLog2( Word32 x )

Word32 BASOP_Util_Log10( Word32 x, Word16 e )
{
    test();
    IF( e >= 0 && LE_16( e, 31 ) )
    {
        IF( EQ_32( x, L_shl_sat( 1, sub( 31, e ) ) ) )
        {
            return 0;
        }
    }
    Word32 res = BASOP_Util_Log2( x );
    res = L_add( Mpy_32_32( res, 646456993 /* log10(2) in Q31 */ ), Mpy_32_32( L_shl( e, 25 ), 646456993 /* log10(2) in Q31 */ ) ); // Adjusting for the exponent mismatch: multiplying first so as to avoid saturation
    res = L_add( Mpy_32_32( res, 646456993 /* log10(2) in Q31 */ ), Mpy_32_32( L_shl( e, 24 ), 1292913986 /* log10(2) in Q32 */ ) ); // Adjusting for the exponent mismatch: multiplying first so as to avoid saturation
    /* log10(2) is used in Q32 to support exponent till 127 in  Mpy_32_32( L_shl( e, 24 ), 1292913986 )*/
    return res;
}

+10 −0
Original line number Diff line number Diff line
@@ -48,7 +48,9 @@

static int16_t BITS_ALLOC_adjust_acelp_fixed_cdk( const int16_t bits_frame, int16_t *fixed_cdk_index, const int16_t nb_subfr );

#ifndef IVAS_FLOAT_FIXED
static int16_t allocate_unused( const int32_t core_brate, const int16_t coder_type, const int16_t unused_bits, const int16_t nb_prm, const int16_t subfr, const int16_t prm_type, int16_t *prm_bit_mode );
#endif

typedef enum
{
@@ -356,6 +358,7 @@ static int16_t BITS_ALLOC_adjust_acelp_fixed_cdk(
 * Selection of fixed innovation codebook bitbudget table
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static int16_t fcb_table(
    const int16_t n,
    const int16_t L_subfr )
@@ -370,6 +373,7 @@ static int16_t fcb_table(

    return ( out );
}
#endif

/*-------------------------------------------------------------------*
 * acelp_FCB_allocator()
@@ -377,6 +381,7 @@ static int16_t fcb_table(
 * Routine to allocate fixed innovation codebook bit-budget
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static ivas_error acelp_FCB_allocator(
    int16_t *nBits,            /* i/o: available bit-budget    */
    int16_t fixed_cdk_index[], /* o  : codebook index          */
@@ -507,6 +512,7 @@ static ivas_error acelp_FCB_allocator(

    return error;
}
#endif


/*-------------------------------------------------------------------*
@@ -517,6 +523,7 @@ static ivas_error acelp_FCB_allocator(
 *   - per channel bitrate minimum is 13250 kbps for ACELP@16kHz
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
ivas_error config_acelp1_IVAS(
    const int16_t enc_dec,              /* i  : encoder/decoder flag            */
    const int32_t total_brate,          /* i  : total bitrate                   */
@@ -1334,6 +1341,7 @@ ivas_error config_acelp1_IVAS(

    return error;
}
#endif

/*-------------------------------------------------------------------*
 * allocate_unused()
@@ -1341,6 +1349,7 @@ ivas_error config_acelp1_IVAS(
 * Allocate unused bits
 *--------------------------------------------------------------------*/

#ifndef IVAS_FLOAT_FIXED
static int16_t allocate_unused(
    const int32_t core_brate,
    const int16_t coder_type,
@@ -1417,6 +1426,7 @@ static int16_t allocate_unused(

    return bit_added + max_bit_per_pos;
}
#endif


/*-------------------------------------------------------------------*
Loading