Commit 7e6cf85a authored by malenov's avatar malenov
Browse files

merge main to branchy

parents bbd68d06 0da15e11
Loading
Loading
Loading
Loading
+5 −51
Original line number Diff line number Diff line
@@ -174,11 +174,6 @@ stages:
  - git pull
  - 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
# 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
@@ -460,30 +455,6 @@ build-codec-sanitizers-linux:
    - *activate-Werror-linux
    - 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:
  extends:
    - .build-job-windows
@@ -494,19 +465,6 @@ build-codec-windows-cmake:
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - 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:
  extends:
    - .build-job-windows
@@ -792,8 +750,7 @@ split-rendering-smoke-test:
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j
    - 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
  artifacts:
@@ -814,7 +771,6 @@ lc3-wrapper-unit-test:
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - *enable-split-rendering
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - 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"

    # build reference binaries
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j
    - mv IVAS_cod IVAS_cod_ref
    - mv IVAS_dec IVAS_dec_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 checkout $source_branch_commit_sha
    - make clean
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1
    - make -j

    ### 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
@@ -1139,9 +1093,9 @@ check-first-frame-is-sid:
    - 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=$?
    - 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:
    paths:
      - out/logs
+54 −277

File changed.

Preview size limit exceeded, changes collapsed.

+53 −54
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@

#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 <math.h>
@@ -229,6 +218,7 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString );

static void convertOutputBuffer( const float *floatBuffer, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer );


/*------------------------------------------------------------------------------------------*
 * Local functions
 *------------------------------------------------------------------------------------------*/
@@ -275,10 +265,6 @@ static int16_t getTotalNumInChannels(
    return totalNumInChannels;
}

/*------------------------------------------------------------------------------------------*
 * Local functions
 *------------------------------------------------------------------------------------------*/

static const CmdLnParser_Option *findOptionById(
    const int32_t id )
{
@@ -440,6 +426,7 @@ static bool checkRequiredArgs(
    return !missingRequiredArg;
}


static CmdlnArgs defaultArgs(
    const char *executableName )
{
@@ -470,6 +457,7 @@ static CmdlnArgs defaultArgs(
    return args;
}


static void parseOption(
    const int32_t optionId,
    char **optionValues,
@@ -562,6 +550,7 @@ static void parseOption(
    return;
}


static CmdlnArgs parseCmdlnArgs(
    const int argc,
    char **argv )
@@ -600,6 +589,7 @@ static void printSupportedAudioConfigs( void )
    return;
}


/*--------------------------------------------------------------------------*
 * convertInputBuffer()
 *
@@ -638,6 +628,7 @@ static void convertInputBuffer(
    return;
}


/*--------------------------------------------------------------------------*
 * convertOutputBuffer()
 *
@@ -679,6 +670,7 @@ static void convertOutputBuffer(
    return;
}


/*------------------------------------------------------------------------------------------*
 * main()
 *
@@ -730,14 +722,13 @@ int main(
    bitsBuffer.config.bufLenInBytes = 0;
    bitsBuffer.config.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
    bitsBuffer.config.poseCorrection = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    bitsBuffer.config.codec_frame_size_ms = 5;
    bitsBuffer.config.isar_frame_size_ms = 20;
    bitsBuffer.config.lc3plusHighRes = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     *------------------------------------------------------------------------------------------*/

    CmdlnArgs args = parseCmdlnArgs( argc, argv );

@@ -745,6 +736,10 @@ int main(
    convert_backslash( args.outputFilePath );
    convert_backslash( args.headRotationFilePath );

    /*------------------------------------------------------------------------------------------*
     * Open head-rotation file
     *------------------------------------------------------------------------------------------*/

    if ( !isEmptyString( args.headRotationFilePath ) )
    {
        if ( RotationFileReader_open( args.headRotationFilePath, &headRotReader ) != IVAS_ERR_OK )
@@ -754,15 +749,21 @@ int main(
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Open BFI file
     *------------------------------------------------------------------------------------------*/

    if ( !isEmptyString( args.splitRendBFIFilePath ) )
    {
        convert_backslash( args.splitRendBFIFilePath );
        SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader );
    }

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    /*------------------------------------------------------------------------------------------*
     * Open input files
     *------------------------------------------------------------------------------------------*/

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

#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int32_t inFileSampleRate = 0;
#endif
    if ( audioReader != NULL )
    {
        error = AudioFileReader_getSamplingRate( audioReader, &inFileSampleRate );
    }
    else
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( hSplitRendFileReadWrite == NULL )
#endif
    else if ( hSplitRendFileReadWrite == NULL )
    {
        inFileSampleRate = args.sampleRate;
    }
@@ -867,6 +854,11 @@ int main(
            exit( -1 );
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Open ISAR handle
     *------------------------------------------------------------------------------------------*/

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );
    args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_BINAURAL;
    if ( ( error = ISAR_POST_REND_open( &hIsarPostRend, args.sampleRate, args.outConfig.audioConfig, true, 0, 0.0, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
@@ -875,7 +867,10 @@ int main(
        exit( -1 );
    }

    /* === Configure === */
    /*------------------------------------------------------------------------------------------*
     * Configuration
     *------------------------------------------------------------------------------------------*/

    if ( ( error = ISAR_POST_REND_InitConfig( hIsarPostRend, args.outConfig.audioConfig ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error in Renderer Config Init: %s\n", ivas_error_to_string( error ) );
@@ -887,22 +882,16 @@ int main(
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend,
                                                              bitsBuffer.config.codec,
                                                              bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                              ,
                                                              bitsBuffer.config.codec_frame_size_ms,
                                                              bitsBuffer.config.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
#endif
                                                              ) ) != IVAS_ERR_OK )
                                                              bitsBuffer.config.lc3plusHighRes ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
        }
    }


    ISAR_POST_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS];

    for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ )
    {
        splitBinIds[i] = 0u;
@@ -918,7 +907,6 @@ int main(
    }

    const int16_t totalNumInChannels = getTotalNumInChannels( hIsarPostRend, splitBinIds );

    if ( inFileNumChannels != 0 /* inFileNumChannels is 0 with raw PCM input */ && totalNumInChannels != inFileNumChannels )
    {
        fprintf( stderr, "Number of channels in input file does not match selected configuration\n" );
@@ -926,13 +914,16 @@ int main(
    }

    int16_t numOutChannels = 2;

    if ( AudioFileWriter_open( &audioWriter, args.outputFilePath, args.sampleRate, numOutChannels ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Failed to open file: %s\n", args.outputFilePath );
        exit( -1 );
    }

    /*------------------------------------------------------------------------------------------*
     * Allocate processing buffers
     *------------------------------------------------------------------------------------------*/

    inBufferSize = frameSize_smpls * totalNumInChannels;
    outBufferSize = frameSize_smpls * numOutChannels;
    inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) );
@@ -985,6 +976,13 @@ int main(
        fprintf( stdout, "\n\n-- Start the ISAR post renderer (quiet mode) --\n\n" );
    }

    /*------------------------------------------------------------------------------------------*
     * Loop for every frame of data
     * - Read the input data
     * - Run the post-rendering
     * - Write the data into output file
     *------------------------------------------------------------------------------------------*/

    while ( 1 )
    {
        int16_t num_in_channels;
@@ -1215,7 +1213,10 @@ int main(
    }
#endif

    /* === Close === */
    /*------------------------------------------------------------------------------------------*
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

    free( inpInt16Buffer );
    free( inFloatBuffer );
    free( outInt16Buffer );
@@ -1249,5 +1250,3 @@ int main(


#undef WMC_TOOL_SKIP

#endif /* SPLIT_REND_WITH_HEAD_ROT */
+20 −247

File changed.

Preview size limit exceeded, changes collapsed.

+0 −6
Original line number Diff line number Diff line
@@ -13,10 +13,4 @@
    <li><a href="ivas-pytest-mld-long-dec-lev-10-index.html">ivas-pytest-mld-long-dec-lev-10</a></li>
  </ul>

  <h2>Test Coverage</h2>

  <br>
  tbd...
  </br>

</body>
Loading