Commit ec936522 authored by vaclav's avatar vaclav
Browse files

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

Merge remote-tracking branch 'remotes/origin/main' into VoiceAge/contribution-omasa-combined-format_updt
parents 57f8d915 6a41fce1
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -49,6 +49,13 @@ stages:
    echo "Commit time was $CI_COMMIT_TIMESTAMP"
    date | xargs echo "System time is"

.print-common-info-windows: &print-common-info-windows
  - |
    echo "Printing common information for build job."
    echo "Current job is run on commit $CI_COMMIT_SHA"
    echo "Commit time was $CI_COMMIT_TIMESTAMP"
    ("echo 'System time is'", "Get-Date -Format 'dddd dd/MM/yyyy HH:mm K'") | Invoke-Expression

.get-previous-merge-commit-sha: &get-previous-merge-commit-sha
  - previous_merge_commit=$(git --no-pager log --merges HEAD~1 -n 1 --pretty=format:%H)

@@ -156,6 +163,11 @@ stages:
  tags:
    - ivas-linux

.build-job-windows:
  stage: build
  timeout: "4 minutes"
  tags:
    - ivas-windows

# template for test jobs on linux that need the TESTV_DIR
.test-job-linux-needs-testv-dir:
@@ -172,6 +184,12 @@ stages:
    exit_codes:
      - 123

.build-job-windows-with-check-for-warnings:
  extends: .build-job-windows
  stage: build
  allow_failure:
    exit_codes:
      - 123


# ---------------------------------------------------------------
@@ -262,6 +280,31 @@ build-codec-sanitizers-linux:
    - *print-common-info
    - bash ci/build_codec_sanitizers_linux.sh

build-codec-windows-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression

build-codec-windows-msbuild:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression

# ---------------------------------------------------------------
# Test jobs for merge requests
# ---------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ LDLIBS += -lm
CCCLANG = clang
ifeq "$(CLANG)" "1"
CC       = $(CCCLANG)
CFLAGS  += -fsanitize=memory
CFLAGS  += -fsanitize=memory -fsanitize-memory-track-origins
LDFLAGS += -fsanitize=memory
endif
ifeq "$(CLANG)" "2"
+22 −0
Original line number Diff line number Diff line
@@ -355,9 +355,26 @@ typedef enum
#define PARAM_ISM_MAX_CHAN                      16
#define PARAM_ISM_HYS_BUF_SIZE                  10

/* ISM DTX */
#ifdef DISCRETE_ISM_DTX_CNG
#define ISM_DTX_COH_SCA_BITS                    4
#else
#define PARAM_ISM_DTX_COH_SCA_BITS              4
#endif
#ifdef DISCRETE_ISM_DTX_CNG
#define ISM_DTX_AZI_BITS_HIGH                   8
#define ISM_DTX_ELE_BITS_HIGH                   7
#define ISM_Q_STEP_HIGH                         (ISM_Q_STEP / 2)
#define ISM_Q_STEP_BORDER_HIGH                  (ISM_Q_STEP_BORDER / 2)
#define ISM_DTX_AZI_BITS_LOW                    6
#define ISM_DTX_ELE_BITS_LOW                    5
#define ISM_Q_STEP_LOW                          (ISM_Q_STEP * 2)
#define ISM_Q_STEP_BORDER_LOW                   (ISM_Q_STEP_BORDER * 2)
#else
#define PARAM_ISM_DTX_AZI_BITS                  5 
#define PARAM_ISM_DTX_ELE_BITS                  4
#endif


typedef enum 
{
@@ -384,8 +401,13 @@ enum
    IND_ISM_METADATA_FLAG = IND_ISM_NUM_OBJECTS + MAX_NUM_OBJECTS,
#endif
    IND_ISM_VAD_FLAG = IND_ISM_METADATA_FLAG + MAX_NUM_OBJECTS,
#ifdef DISCRETE_ISM_DTX_CNG
    IND_ISM_NOISY_SPEECH_FLAG = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS,
    IND_ISM_SCE_ID_DTX,
#else
    IND_ISM_SCE_ID_DTX = IND_ISM_VAD_FLAG + MAX_NUM_OBJECTS,
    IND_ISM_NOISY_SPEECH_FLAG,
#endif
    IND_ISM_DTX_COH_SCA,

    /* ------------- loop for objects -------------- */
+114 −31
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ static void bitbudget_to_brate(
ivas_error ivas_ism_config(
    const int32_t ism_total_brate,           /* i  : ISM total bitrate              */
    const int16_t nchan_transport,           /* i  : number of transport channels   */
    const int16_t num_obj,                   /* i  : number of objects            */
    const int16_t nchan_ism,                 /* i  : number of objects              */
    ISM_METADATA_HANDLE hIsmMeta[],          /* i/o: ISM metadata handles           */
    const int16_t localVAD[MAX_NUM_OBJECTS], /* i  : local VAD flag                 */
    const int16_t ism_imp[],                 /* i  : ISM importance flags           */
@@ -122,7 +122,7 @@ ivas_error ivas_ism_config(
#ifdef MASA_AND_OBJECTS
    if ( combined_format_flag == 1 )
    {
        n_ISms = num_obj;
        n_ISms = nchan_ism;
    }
    else
    {
@@ -165,7 +165,7 @@ ivas_error ivas_ism_config(
        /* count ISm common signaling bits */
        if ( hIsmMeta != NULL )
        {
            nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj;
            nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism;

            for ( ch = 0; ch < n_ISms; ch++ )
            {
@@ -197,10 +197,10 @@ ivas_error ivas_ism_config(
        if ( combined_format_flag == 0 )
        {
            /* the  bits for writing the number of objects are counted here for pure ISM modes */
            nb_bits_metadata[0] += num_obj;
            nb_bits_metadata[0] += nchan_ism;
        }
#else
        nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + num_obj;
        nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism;
#endif

        for ( ch = 0; ch < n_ISms; ch++ )
@@ -467,6 +467,8 @@ int16_t ism_quant_meta(
    const float val,           /* i  : scalar value to quantize        */
    float *valQ,               /* o  : quantized value                 */
    const float borders[],     /* i  : level borders                   */
    const float q_step,        /* i  : quantization step               */
    const float q_step_border, /* i  : quantization step at the border */
    const int16_t cbsize       /* i  : codebook size                   */
)
{
@@ -477,19 +479,19 @@ int16_t ism_quant_meta(
    {
        qlow = borders[0];
        idx_start = 0;
        step = ISM_Q_STEP_BORDER;
        step = q_step_border;
    }
    else if ( val <= borders[2] )
    {
        qlow = borders[1];
        idx_start = (int16_t) ( ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER );
        step = ISM_Q_STEP;
        idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border );
        step = q_step;
    }
    else
    {
        qlow = borders[2];
        idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER );
        step = ISM_Q_STEP_BORDER;
        idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border );
        step = q_step_border;
    }

    idx = idx_start + (int16_t) max( 0.f, min( cbsize - 1, ( ( val - qlow ) / step + 0.5f ) ) );
@@ -509,29 +511,31 @@ int16_t ism_quant_meta(
float ism_dequant_meta(
    const int16_t idx,         /* i  : quantizer index              */
    const float borders[],     /* i  : level borders                */
    const float q_step,        /* i  : quantization step               */
    const float q_step_border, /* i  : quantization step at the border */
    const int16_t cbsize       /* i  : codebook size                */
)
{
    int16_t idx_start;
    float qlow, step, valQ;

    if ( idx <= ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER )
    if ( idx <= ( borders[1] - borders[0] ) / q_step_border )
    {
        qlow = borders[0];
        idx_start = 0;
        step = ISM_Q_STEP_BORDER;
        step = q_step_border;
    }
    else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER )
    else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border )
    {
        qlow = borders[1];
        idx_start = (int16_t) ( ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER );
        step = ISM_Q_STEP;
        idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border );
        step = q_step;
    }
    else
    {
        qlow = borders[2];
        idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER );
        step = ISM_Q_STEP_BORDER;
        idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border );
        step = q_step_border;
    }

    valQ = ( idx - idx_start ) * step + qlow;
@@ -548,12 +552,22 @@ float ism_dequant_meta(

void ivas_param_ism_config(
    PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure      */
#ifdef NCHAN_ISM_PARAMETER
    ,
    const int16_t nchan_obj /* i  : number of ISM channels                      */
#endif
)
{
#ifdef NCHAN_ISM_PARAMETER
    int16_t i;

    hParamIsm->nbands = MAX_PARAM_ISM_NBANDS;
#else
    int16_t i, num_obj;

    hParamIsm->nbands = MAX_PARAM_ISM_NBANDS;
    num_obj = hParamIsm->num_obj;
#endif

    for ( i = 0; i < hParamIsm->nbands; i++ )
    {
@@ -561,7 +575,11 @@ void ivas_param_ism_config(
    }

    /* for elevation zero compute the max azi quantization indices */
#ifdef NCHAN_ISM_PARAMETER
    for ( i = 0; i < nchan_obj; i++ )
#else
    for ( i = 0; i < num_obj; i++ )
#endif
    {
        hParamIsm->last_az_diff[i] = 0;
        hParamIsm->last_az_sgn[i] = 1;
@@ -636,3 +654,68 @@ void ivas_ism_metadata_close(

    return;
}


#ifdef DISCRETE_ISM_DTX_CNG
/*-------------------------------------------------------------------*
 * update_last_metadata()
 *
 * Store last metadata values
 *-------------------------------------------------------------------*/

void update_last_metadata(
    const int16_t nchan_ism,        /* i  : number of objects           */
    ISM_METADATA_HANDLE hIsmMeta[], /* i/o: ISM metadata handles        */
    const int16_t updt_flag[]       /* i  : last metadata update flag   */
)
{
    int16_t ch;

    for ( ch = 0; ch < nchan_ism; ch++ )
    {
        if ( updt_flag[ch] == 1 )
        {
            hIsmMeta[ch]->last_azimuth = hIsmMeta[ch]->azimuth;
            hIsmMeta[ch]->last_elevation = hIsmMeta[ch]->elevation;
        }
    }

    return;
}


/*----------------------------------------------------------------*
 * ivas_get_ism_sid_quan_bitbudget()
 *
 * Set quantization bits based on the number of coded objects
 *----------------------------------------------------------------*/

void ivas_get_ism_sid_quan_bitbudget(
    const int16_t nchan_ism,  /* i  : number of objects                 */
    int16_t *nBits_azimuth,   /* o  : number of Q bits for azimuth      */
    int16_t *nBits_elevation, /* o  : number of Q bits for elevation    */
    float *q_step,            /* o  : quantization step                 */
    float *q_step_border,     /* o  : quantization step at the border   */
    int16_t *nBits_coh,       /* o  : number of Q bits for coherence    */
    int16_t *nBits_sce_id     /* o  : number of Q bits for sce_id_dtx   */
)
{
    *nBits_azimuth = ISM_DTX_AZI_BITS_HIGH;
    *nBits_elevation = ISM_DTX_ELE_BITS_HIGH;
    *q_step = ISM_Q_STEP_HIGH;
    *q_step_border = ISM_Q_STEP_BORDER_HIGH;
    *nBits_coh = ISM_DTX_COH_SCA_BITS;
    *nBits_sce_id = 1;

    if ( nchan_ism >= 3 )
    {
        *nBits_azimuth = ISM_DTX_AZI_BITS_LOW;
        *nBits_elevation = ISM_DTX_ELE_BITS_LOW;
        *q_step = ISM_Q_STEP_LOW;
        *q_step_border = ISM_Q_STEP_BORDER_LOW;
        *nBits_sce_id = 2;
    }

    return;
}
#endif
+108 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading