Commit 5c52a292 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into 755-lib_rend_fix_hrtfparambin_memleak-switch
parents 34cdaa86 674bafe7
Loading
Loading
Loading
Loading
Loading
+59 −3
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ codec-smoke-test:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  timeout: "15 minutes"
  timeout: "17 minutes"
  stage: test
  needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
@@ -732,7 +732,7 @@ ivas-pytest-on-merge-request:
    - non_be_flag=$(grep -c --ignore-case "\[non[ -]*be\]" tmp.txt) || true
    - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    ### If ref_using_main is not set, checkout the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
@@ -767,6 +767,62 @@ ivas-pytest-on-merge-request:
      junit:
        - report-junit.xml


# Check interop IVAS_cod_test -> IVAS_dec_ref
ivas-interop-on-merge-request:
  extends:
    - .test-job-linux
    - .rules-merge-request
  stage: test
  needs: ["build-codec-linux-cmake"]
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *get-commits-behind-count
    - *check-commits-behind-count-in-compare-jobs
    - *merge-request-comparison-setup-codec
    # the next line is dependent on ref-using-main flag in the other tests, but here the flag does not make sense
    - git checkout $source_branch_commit_sha

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    # write to temporary file as workaround for failures observed with piping echo
    - echo $CI_MERGE_REQUEST_TITLE > tmp.txt
    - non_interop_flag=$(grep -c --ignore-case "\[non[ -]*io\]" tmp.txt) || true

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py

    # Run reference creation, using source branch encoder and main decoder (see .merge-request-comparison-setup-codec)
    - exit_code=0
    - exit_code2=0
    # set timeout for individual testcase runs to 60 seconds
    - testcase_timeout=60
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec_ref --testcase_timeout=$testcase_timeout || exit_code=$?
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --html=report2.html --self-contained-html --junit-xml=report2-junit.xml --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec_ref --testcase_timeout=$testcase_timeout || exit_code2=$?
    - zero_failures=$(cat report-junit.xml report2-junit.xml | grep -c 'failures="0"') || true

    - if [ $zero_failures != 2 ] && [ $non_interop_flag == 0 ]; then echo "Non-interop cases without non-interop flag encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $zero_failures != 2 ] && [ $non_interop_flag == 1 ]; then echo "Non-interop cases with non-interop flag encountered"; exit $EXIT_CODE_NON_BE; fi
    - exit 0

  allow_failure:
    exit_codes:
      - 123
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
      - report2-junit.xml
      - report2.html
    expose_as: "interop test results"
    reports:
      junit:
        - report*-junit.xml

evs-pytest-on-merge-request:
  extends:
    - .test-job-linux
+12 −0
Original line number Diff line number Diff line
@@ -180,7 +180,11 @@ $(LIB_LIBREND): $(OBJS_LIBREND)
	$(QUIET_AR)$(AR) rcs $@ $^

$(LIB_LC3PLUS): $(OBJS_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
	$(QUIET_AR)$(AR) rcs $@ $^
else
	
endif

$(LIB_LIBUTIL): $(OBJS_LIBUTIL)
	$(QUIET_AR)$(AR) rcs $@ $^
@@ -189,10 +193,18 @@ $(CLI_APIENC): $(OBJS_CLI_APIENC) $(LIB_LIBENC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(L
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIENC) -L. -livasenc -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIENC)

$(CLI_APIDEC): $(OBJS_CLI_APIDEC) $(LIB_LIBDEC) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug -llc3plus $(LDLIBS) -o $(CLI_APIDEC)
else
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APIDEC) -L. -livasdec -livascom -livasutil -livasdebug $(LDLIBS) -o $(CLI_APIDEC)
endif

$(CLI_APIREND): $(OBJS_CLI_APPREND) $(LIB_LIBREND) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBDEBUG) $(LIB_LIBDEC) $(LIB_LC3PLUS)
ifeq "$(INCLUDE_SPLIT)" "1"
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -livasdec -livasutil -livasdebug -livascom -llc3plus $(LDLIBS) -o $(CLI_APIREND)
else
	$(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_CLI_APPREND) -L. -livasrend -livasdec -livasutil -livasdebug -livascom $(LDLIBS) -o $(CLI_APIREND)
endif

libs: $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LC3PLUS) $(LIB_LIBUTIL)

+28 −2
Original line number Diff line number Diff line
@@ -335,11 +335,22 @@ int32_t ivas_interformat_brate(
void ivas_combined_format_brate_sanity(
    const int32_t element_brate, /* i  : element bitrate                */
    const int16_t core,          /* i  : core                           */
#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    const int32_t total_brate, /* i  : total bitrate                  */
#endif
    int32_t *core_brate, /* i/o: core bitrate                   */
#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    int16_t *inactive_coder_type_flag, /* o  : inactive coder_type flag       */
#endif
    int16_t *diff_nBits /* o  : number of differential bits    */
)
{
    int16_t limit_high, nBits;
#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    int32_t brate_diff;

    brate_diff = total_brate - *core_brate;
#endif

    /* sanity check: at lowest IVAS bit-rates and one ISM channel coded by
    low-rate core-coder mode, it can happen that the CPE (MASA) bit-budget
@@ -364,6 +375,21 @@ void ivas_combined_format_brate_sanity(
        }
    }

#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    /*-----------------------------------------------------------------*
     * set inactive coder_type flag in ACELP core
     *-----------------------------------------------------------------*/

    if ( core == ACELP_CORE )
    {
        *inactive_coder_type_flag = 0; /* AVQ by default */
        if ( *core_brate + brate_diff <= MAX_GSC_INACTIVE_BRATE )
        {
            *inactive_coder_type_flag = 1; /* GSC */
        }
    }
#endif

    return;
}

+17 −0
Original line number Diff line number Diff line
@@ -1043,10 +1043,17 @@ void ivas_param_ism_enc(
    const int16_t input_frame                                   /* i  : input frame length per channel              */
);

#ifndef PARAM_ISM_REFACTOR
void ivas_param_ism_enc_close(
    DIRAC_ENC_HANDLE *hDirAC,                                   /* i/o: encoder DirAC handle                        */
    const int32_t input_Fs                                      /* i  : input sampling_rate                         */
);
#else
void ivas_param_ism_enc_close(
    PARAM_ISM_CONFIG_HANDLE *hParamIsm,                         /* i/o: ParamISM handle                             */
    const int32_t input_Fs                                      /* i  : input sampling_rate                         */
);
#endif

void ivas_ism_metadata_close(
    ISM_METADATA_HANDLE hIsmMetaData[],                         /* i/o  : object metadata handles                   */
@@ -1085,7 +1092,11 @@ ivas_error ivas_param_ism_dec_open(
);

void ivas_param_ism_dec_close(
#ifndef PARAM_ISM_REFACTOR
    DIRAC_DEC_HANDLE *hDirAC,                                   /* i/o: decoder DirAC handle                        */
#else
    PARAM_ISM_DEC_HANDLE *hParamIsmDec,                         /* i/o: decoder ParamISM handle                     */
#endif
    SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,  /* i/o: common spatial renderer data                */
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                  */
);
@@ -5816,7 +5827,13 @@ int32_t ivas_interformat_brate(
void ivas_combined_format_brate_sanity(
    const int32_t element_brate,                                /* i  : element bitrate                         */
    const int16_t core,                                         /* i  : core                                    */
#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    const int32_t total_brate,                                  /* i  : total bitrate                           */
#endif
    int32_t *core_brate,                                        /* i/o: core bitrate                            */
#ifdef NONBE_FIX_797_OMASA_INACTIVE_SEP_OBJ
    int16_t *inactive_coder_type_flag,                          /* o  : inactive coder_type flag                */
#endif
    int16_t *diff_nBits                                         /* o  : number of differential bits             */
);

+35 −30
Original line number Diff line number Diff line
@@ -150,36 +150,6 @@ typedef struct

} ECSQ_instance;

/*----------------------------------------------------------------------------------*
 * PARAMETRIC ISM encoder/decoder (common) structure
 *----------------------------------------------------------------------------------*/

typedef struct ivas_param_ism_data_structure
{
    int16_t nbands;
    int16_t nblocks[MAX_PARAM_ISM_NBANDS];
    int16_t band_grouping[MAX_PARAM_ISM_NBANDS + 1];

    int16_t azi_index[MAX_NUM_OBJECTS];
    int16_t ele_index[MAX_NUM_OBJECTS];

    int16_t obj_indices[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS][MAX_PARAM_ISM_WAVE];
    int16_t power_ratios_idx[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS];

    int16_t last_az_sgn[MAX_NUM_OBJECTS];
    int16_t last_az_diff[MAX_NUM_OBJECTS];
    int16_t last_el_sgn[MAX_NUM_OBJECTS];
    int16_t last_el_diff[MAX_NUM_OBJECTS];

    int16_t flag_noisy_speech;
    int16_t noisy_speech_buffer[PARAM_ISM_HYS_BUF_SIZE];
    int16_t flag_equal_energy;

    float last_dmx_gain;
    float last_cardioid_left[MAX_NUM_OBJECTS];

} PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE;


/*----------------------------------------------------------------------------------*
 * Declaration of DirAC common (encoder & decoder) structure
@@ -813,4 +783,39 @@ typedef struct ivas_fb_mixer_state_structure
} IVAS_FB_MIXER_DATA, *IVAS_FB_MIXER_HANDLE;


/*----------------------------------------------------------------------------------*
 * PARAMETRIC ISM encoder/decoder (common) structure
 *----------------------------------------------------------------------------------*/

typedef struct ivas_param_ism_data_structure
{
#ifdef PARAM_ISM_REFACTOR
    IVAS_FB_MIXER_HANDLE hFbMixer;

#endif
    int16_t nbands;
    int16_t nblocks[MAX_PARAM_ISM_NBANDS];
    int16_t band_grouping[MAX_PARAM_ISM_NBANDS + 1];

    int16_t azi_index[MAX_NUM_OBJECTS];
    int16_t ele_index[MAX_NUM_OBJECTS];

    int16_t obj_indices[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS][MAX_PARAM_ISM_WAVE];
    int16_t power_ratios_idx[MAX_PARAM_ISM_NBANDS][MAX_PARAM_ISM_NBLOCKS];

    int16_t last_az_sgn[MAX_NUM_OBJECTS];
    int16_t last_az_diff[MAX_NUM_OBJECTS];
    int16_t last_el_sgn[MAX_NUM_OBJECTS];
    int16_t last_el_diff[MAX_NUM_OBJECTS];

    int16_t flag_noisy_speech;
    int16_t noisy_speech_buffer[PARAM_ISM_HYS_BUF_SIZE];
    int16_t flag_equal_energy;

    float last_dmx_gain;
    float last_cardioid_left[MAX_NUM_OBJECTS];

} PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE;


#endif /* IVAS_STAT_COM */
Loading