Commit 0af55942 authored by kinuthia's avatar kinuthia
Browse files

Merge branch 'main' into add-saturation-smoke-test

parents 854ca129 e6df9804
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ variables:
  SCRIPTS_DIR: "/usr/local/scripts"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/test_param_file_ltv.py tests/renderer"
  LONG_TEST_SUITE: "tests/test_param_file_ltv.py tests/renderer"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  USE_REF_ENC: "1"
  TEST_SUITE: ""
@@ -91,6 +91,7 @@ stages:
  - make -j
  - mv ./IVAS_cod ./IVAS_cod_ref
  - mv ./IVAS_dec ./IVAS_dec_ref
  - mv ./IVAS_rend ./IVAS_rend_ref

  ### build test binaries
  - git checkout $current_commit_sha
@@ -105,8 +106,9 @@ stages:
  # create short test vectors
  - python3 tests/create_short_testvectors.py
  # create references
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref -n auto
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto
  - exit_code=0
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref --create_ref -n auto || exit_code=$? 
  - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto || exit_code=$? # Catch exit code to prevent halt in case this step produces zero tests


.update-scripts-repo: &update-scripts-repo
@@ -212,9 +214,9 @@ stages:
    # timeout of 15 min per individual testcase - hopefully too much, but better be safe for now
    - testcase_timeout=900
    - if [ $USE_REF_ENC -eq 1 ]; then
    -    python3 -m pytest $TEST_SUITE -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path ./IVAS_cod_ref -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    -    python3 -m pytest $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path ./IVAS_cod_ref -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - else
    -    python3 -m pytest $TEST_SUITE -v --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    -    python3 -m pytest $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true

+2 −3
Original line number Diff line number Diff line
@@ -414,13 +414,12 @@ int main(
    /*------------------------------------------------------------------------------------------*
     * Open input audio file
     *------------------------------------------------------------------------------------------*/
    short isInputRawFile;
    if ( AudioFileReader_open( &audioReader, arg.inputWavFilename, &isInputRawFile ) != IVAS_ERR_OK )

    if ( AudioFileReader_open( &audioReader, arg.inputWavFilename ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nCan't open %s\n\n", arg.inputWavFilename );
        goto cleanup;
    }
    set_raw_file_flag( hIvasEnc, isInputRawFile );

    /* Validate input sampling rate */
    int32_t inFileSampleRate = 0;
+2 −2
Original line number Diff line number Diff line
@@ -780,8 +780,8 @@ int main(
            exit( -1 );
        }
    }
    short ignore;
    if ( AudioFileReader_open( &audioReader, audioFilePath, &ignore ) != IVAS_ERR_OK )

    if ( AudioFileReader_open( &audioReader, audioFilePath ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening file: %s\n", audioFilePath );
        exit( -1 );
+2 −2
Original line number Diff line number Diff line
@@ -665,7 +665,7 @@ void write_indices_fx(
 *-------------------------------------------------------------------*/

void write_indices_buf_fx(
    Encoder_State_fx *st_fx,  /* i/o: encoder state structure */
    Encoder_State *st_fx,  /* i/o: encoder state structure */
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */
    UWord16 *out_buf,      /* i  : output bitstream buf   */
    UWord8 *pFrame,        /* i: byte array with bit packet and byte aligned coded speech data */
@@ -726,7 +726,7 @@ void write_indices_buf_fx(
    {
        /* Create and write ToC header */
        /*  qbit always  set to  1 on encoder side  for AMRWBIO ,  no qbit in use for EVS, but set to 0(bad)  */
        header = (UWord8) ( st_fx->Opt_AMR_WB_fx << 5 | st_fx->Opt_AMR_WB_fx << 4 | rate2EVSmode( hBstr->nb_bits_tot_fx * 50, &isAmrWb ) );
        header = (UWord8) ( st_fx->Opt_AMR_WB << 5 | st_fx->Opt_AMR_WB << 4 | rate2EVSmode( hBstr->nb_bits_tot_fx * 50, &isAmrWb ) );
        // fwrite(&header, sizeof(UWord8), 1, file);
        memcpy( out_buf, &header, sizeof( UWord8 ) );
        *num_bits += sizeof( UWord8 );
+79 −0
Original line number Diff line number Diff line
@@ -2295,6 +2295,45 @@ static void cldfb_init_proto_and_twiddles(
 *
 * Save the memory of filter; to be restored with cldfb_restore_memory_ivas()
 *--------------------------------------------------------------------*/
#ifdef IVAS_FLOAT_FIXED
ivas_error cldfb_save_memory_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */
)
{
    UWord16 offset = sub(hs->p_filter_length , hs->no_channels);

    IF ( hs->memory_flt != NULL || NE_16(hs->memory_length , 0) )
    {
        /* memory already stored; Free memory first */
        return IVAS_ERR_OK;
    }

    IF ( EQ_16(hs->type , CLDFB_ANALYSIS) )
    {
        hs->memory_length = offset;
        move16();
    }
    ELSE
    {
        hs->memory_length = hs->p_filter_length;
        move16();
    }
#if 1/*Floating point memory allocation: To be removed later*/
    IF ( ( hs->memory_flt = (float *) malloc( hs->memory_length * sizeof( float ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
#endif
    IF ( ( hs->memory32 = (Word32 *) malloc( hs->memory_length * sizeof(Word32) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
    /* save the memory */
    Copy32( hs->cldfb_state_fx, hs->memory32, hs->memory_length );

    return IVAS_ERR_OK;
}
#endif // IVAS_FLOAT_FIXED

ivas_error cldfb_save_memory_ivas(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */
@@ -2334,6 +2373,46 @@ ivas_error cldfb_save_memory_ivas(
 *
 * Restores the memory of filter; memory to be save by cldfb_save_memory_ivas()
 *--------------------------------------------------------------------*/
#ifdef IVAS_FLOAT_FIXED
void cldfb_restore_memory_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */
)
{
    UWord16 offset = sub(hs->p_filter_length , hs->no_channels);
    UWord16 size;
    IF ( hs->memory_flt == NULL || EQ_16(hs->memory_length , 0) )
    {
        /* memory not allocated */
        return;
    }

    IF ( EQ_16(hs->type , CLDFB_ANALYSIS) )
    {
        size = offset;
        move16();
    }
    ELSE
    {
        size = hs->p_filter_length;
        move16();
    }

    /* read the memory */
    Copy32( hs->memory32, hs->cldfb_state_fx, hs->memory_length );

    /* adjust sample rate if it was changed in the meanwhile */
    IF ( NE_16(hs->memory_length , size) )
    {
        L_lerp_fx_q11( hs->cldfb_state_fx, hs->cldfb_state_fx, size, hs->memory_length);
    }
    hs->cldfb_state_length = size;
    hs->memory_length = 0;
    free( hs->memory32 );
    hs->memory32 = NULL;

    return;
}
#endif // IVAS_FLOAT_FIXED

void cldfb_restore_memory_ivas(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */
Loading