Commit d54bd50a authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch 'main' into 1097-out-of-bound-writing-in-sba-dtx-bitrate-switching

parents dbedc47a 0da15e11
Loading
Loading
Loading
Loading
Loading
+5 −51
Original line number Original line Diff line number Diff line
@@ -174,11 +174,6 @@ stages:
  - git pull
  - git pull
  - Pop-Location
  - Pop-Location


.enable-split-rendering: &enable-split-rendering
# automatically enable #define SPLIT_REND_WITH_HEAD_ROT in options.h, handling both /**/-comment and //-comment
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
  - sed -i.bak -e "s/\/\/[[:space:]]*\(#define[[:space:]]*SPLIT_REND_WITH_HEAD_ROT\)/\1/g"        ./lib_com/options.h

.disable-limiter: &disable-limiter
.disable-limiter: &disable-limiter
# automatically enable #define DISABLE_LIMITER in options.h, handling both /**/-comment and //-comment
# automatically enable #define DISABLE_LIMITER in options.h, handling both /**/-comment and //-comment
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*DISABLE_LIMITER\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
  - sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*DISABLE_LIMITER\)[[:space:]]*\*\//\1/g" ./lib_com/options.h
@@ -460,30 +455,6 @@ build-codec-sanitizers-linux:
    - *activate-Werror-linux
    - *activate-Werror-linux
    - bash ci/build_codec_sanitizers_linux.sh
    - bash ci/build_codec_sanitizers_linux.sh


build-codec-include-split-linux-make:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - make -j INCLUDE_SPLIT=1

build-codec-include-split-linux-cmake:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake .. -DINCLUDE_SPLIT=1
    - cd ..
    - make -C build -j

build-codec-windows-cmake:
build-codec-windows-cmake:
  extends:
  extends:
    - .build-job-windows
    - .build-job-windows
@@ -494,19 +465,6 @@ build-codec-windows-cmake:
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j
    - cmake --build build -j


build-codec-windows-include-split-cmake:
  extends:
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - *activate-WX-windows
    - get-content .\lib_com\options.h | %{$_ -replace "/\*#define[\s]*SPLIT_REND_WITH_HEAD_ROT[\s]*\*/", "#define SPLIT_REND_WITH_HEAD_ROT"} | set-content -Path ./options_patched.h
    - rm ./lib_com/options.h
    - mv ./options_patched.h ./lib_com/options.h
    - cmake -DINCLUDE_SPLIT=1 -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j

build-codec-windows-msbuild:
build-codec-windows-msbuild:
  extends:
  extends:
    - .build-job-windows
    - .build-job-windows
@@ -792,8 +750,7 @@ split-rendering-smoke-test:
  needs: ["build-codec-linux-make"]
  needs: ["build-codec-linux-make"]
  stage: test
  stage: test
  script:
  script:
    - *enable-split-rendering
    - make -j
    - make -j INCLUDE_SPLIT=1
    - testcase_timeout=10
    - testcase_timeout=10
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout
  artifacts:
  artifacts:
@@ -814,7 +771,6 @@ lc3-wrapper-unit-test:
  needs: ["build-codec-linux-cmake"]
  needs: ["build-codec-linux-cmake"]
  stage: test
  stage: test
  script:
  script:
    - *enable-split-rendering
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - cmake --build cmake-build -- -j
    - scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test
    - scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test
@@ -848,8 +804,7 @@ split-rendering-pytest-on-merge-request:
    - echo "Building reference codec at commit $target_commit"
    - echo "Building reference codec at commit $target_commit"


    # build reference binaries
    # build reference binaries
    - *enable-split-rendering
    - make -j
    - make -j INCLUDE_SPLIT=1
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_dec IVAS_dec_ref
    - mv IVAS_dec IVAS_dec_ref
    - mv IVAS_rend IVAS_rend_ref
    - mv IVAS_rend IVAS_rend_ref
@@ -865,8 +820,7 @@ split-rendering-pytest-on-merge-request:
    - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
    - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
    - git checkout $source_branch_commit_sha
    - git checkout $source_branch_commit_sha
    - make clean
    - make clean
    - *enable-split-rendering
    - make -j
    - make -j INCLUDE_SPLIT=1


    ### Run test using scripts and input from main
    ### Run test using scripts and input from main
    - if [ $ref_using_main == 1 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
    - if [ $ref_using_main == 1 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
@@ -1139,9 +1093,9 @@ check-first-frame-is-sid:
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo --timeout 10 || exit_code_hoa=$?
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo --timeout 10 || exit_code_hoa=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo timeout 10 || exit_code_foa=$?
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo --timeout 10 || exit_code_foa=$?


    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi
    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_foa -ne 0 ]; then exit 1; fi
  artifacts:
  artifacts:
    paths:
    paths:
      - out/logs
      - out/logs
+10 −185

File changed.

Preview size limit exceeded, changes collapsed.

+7 −44
Original line number Original line Diff line number Diff line
@@ -32,17 +32,6 @@


#include "lib_isar_post_rend.h"
#include "lib_isar_post_rend.h"


#ifndef SPLIT_REND_WITH_HEAD_ROT

int main( int argc, char **argv )
{
    (void) argc;
    (void) argv;
    ISAR_POST_REND_void_func();
    return 0;
}

#else


#include <assert.h>
#include <assert.h>
#include <math.h>
#include <math.h>
@@ -733,13 +722,9 @@ int main(
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.lc3plusHighRes = 0;
    bitsBuffer.config.lc3plusHighRes = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif


    /*------------------------------------------------------------------------------------------*
    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     * Parse command-line arguments
@@ -778,9 +763,7 @@ int main(
     * Open input files
     * Open input files
     *------------------------------------------------------------------------------------------*/
     *------------------------------------------------------------------------------------------*/


#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
    int32_t inFileSampleRate = 0;
#endif
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    hSplitRendFileReadWrite = NULL;
    hSplitRendFileReadWrite = NULL;
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -789,14 +772,10 @@ int main(
                                        args.inMetadataFilePaths[0],
                                        args.inMetadataFilePaths[0],
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
                                        &bitsBuffer.config.codec_frame_size_ms,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
                                        &bitsBuffer.config.lc3plusHighRes );
#endif
        );
        if ( error != IVAS_ERR_OK )
        if ( error != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
@@ -817,14 +796,10 @@ int main(
                                        args.inputFilePath,
                                        args.inputFilePath,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
                                        &bitsBuffer.config.codec_frame_size_ms,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
                                        &bitsBuffer.config.lc3plusHighRes );
#endif
        );
        if ( error != IVAS_ERR_OK )
        if ( error != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
@@ -833,17 +808,11 @@ int main(
        audioReader = NULL;
        audioReader = NULL;
    }
    }


#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    if ( audioReader != NULL )
    if ( audioReader != NULL )
    {
    {
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
    }
    }
    else
    else if ( hSplitRendFileReadWrite == NULL )
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( hSplitRendFileReadWrite == NULL )
#endif
    {
    {
        inFileSampleRate = args.sampleRate;
        inFileSampleRate = args.sampleRate;
    }
    }
@@ -913,13 +882,9 @@ int main(
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms
                                                              bitsBuffer.config.codec_frame_size_ms,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                              ,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
#endif
                                                              ) ) != IVAS_ERR_OK )
        {
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
            exit( -1 );
@@ -1285,5 +1250,3 @@ int main(




#undef WMC_TOOL_SKIP
#undef WMC_TOOL_SKIP

#endif /* SPLIT_REND_WITH_HEAD_ROT */
+2 −163

File changed.

Preview size limit exceeded, changes collapsed.

+11 −23
Original line number Original line Diff line number Diff line
@@ -202,7 +202,6 @@ typedef struct _IVAS_JBM_TRACE_DATA
} IVAS_JBM_TRACE_DATA;
} IVAS_JBM_TRACE_DATA;




#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------------------*
/*----------------------------------------------------------------------------------*
 * Split rendering API constants, structures, and enums
 * Split rendering API constants, structures, and enums
 *----------------------------------------------------------------------------------*/
 *----------------------------------------------------------------------------------*/
@@ -259,10 +258,8 @@ typedef struct _ISAR_SPLIT_REND_BITS_DATA
    int16_t codec_frame_size_ms;
    int16_t codec_frame_size_ms;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms;
    int16_t isar_frame_size_ms;
    int16_t lc3plus_highres;
    int16_t lc3plus_highres;
#endif


} ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE;
} ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE;


@@ -278,19 +275,14 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
                                 3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                                 3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                                 */
                                 */
    int16_t codec_delay_ms;      /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
    int16_t codec_delay_ms;      /* look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms;  /* ISAR bit stream frame size in milliseconds */
    int16_t isar_frame_size_ms;  /* ISAR bit stream frame size in milliseconds */
#endif
    int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */
    int16_t codec_frame_size_ms; /* Codec frame size in milliseconds, only relevant with LC3plus */
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
    ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t lc3plus_highres;
    int16_t lc3plus_highres;
#endif


} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
#endif


/*----------------------------------------------------------------------------------*
/*----------------------------------------------------------------------------------*
 * Renderer API structures and enums
 * Renderer API structures and enums
@@ -331,9 +323,7 @@ typedef struct _IVAS_RENDER_CONFIG
    IVAS_RENDER_TYPE_OVERRIDE renderer_type_override;
    IVAS_RENDER_TYPE_OVERRIDE renderer_type_override;
#endif
#endif
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics;
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
#endif
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    float distAtt[3];
    float distAtt[3];


@@ -343,9 +333,7 @@ typedef struct
{
{
    int16_t numSamplesPerChannel;
    int16_t numSamplesPerChannel;
    int16_t numChannels;
    int16_t numChannels;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    int16_t is_cldfb;
    int16_t is_cldfb;
#endif


} IVAS_REND_AudioBufferConfig;
} IVAS_REND_AudioBufferConfig;


Loading