Commit d2d3ae18 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into...

Merge branch 'main' into 1068-asan-memory-leak-in-mc-to-binaural_room-decoding-with-bitrate-switching
parents 2863d321 05c5f452
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -800,6 +800,18 @@ split-rendering-smoke-test:
      junit:
        - report-junit.xml

lc3-wrapper-unit-test:
  extends:
    - .test-job-linux
    - .rules-merge-request
  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

# compare split-rendering bitexactness between target and source branch
split-rendering-pytest-on-merge-request:
  extends:
+3 −1
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@
    <ClCompile Include="..\lib_isar\isar_lc3plus_common.c" />
    <ClCompile Include="..\lib_isar\isar_lc3plus_dec.c" />
    <ClCompile Include="..\lib_isar\isar_lc3plus_enc.c" />
    <ClCompile Include="..\lib_isar\isar_lc3plus_payload.c" />
    <ClCompile Include="..\lib_isar\isar_MSPred.c" />
    <ClCompile Include="..\lib_isar\isar_NoiseGen.c" />
    <ClCompile Include="..\lib_isar\isar_PerceptualModel.c" />
@@ -169,6 +170,7 @@
    <ClInclude Include="..\lib_isar\isar_lc3plus_common.h" />
    <ClInclude Include="..\lib_isar\isar_lc3plus_dec.h" />
    <ClInclude Include="..\lib_isar\isar_lc3plus_enc.h" />
    <ClInclude Include="..\lib_isar\isar_lc3plus_payload.h" />
    <ClInclude Include="..\lib_isar\isar_rom_post_rend.h" />
    <ClInclude Include="..\lib_isar\lib_isar_post_rend.h" />
    <ClInclude Include="..\lib_isar\lib_isar_pre_rend.h" />
+56 −3
Original line number Diff line number Diff line
@@ -713,6 +713,13 @@ int main(
            }
            renderConfig.roomAcoustics.override = true;
        }
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        /* ISAR frame size is set from command line, not renderer config file.
         * This will be ignored if output format is not split rendering. */
        renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) arg.renderFramesize /* given in number of 5ms subframes */ * 5;
#endif
#endif

        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
        {
@@ -1976,6 +1983,10 @@ static ivas_error initOnFirstGoodFrame(
        ISAR_SPLIT_REND_CODEC splitRendCodec;
        int16_t splitRendCodecFrameSizeMs;
        ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        int16_t splitRendIsarFrameSizeMs;
        int16_t lc3plusHighRes;
#endif

        if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK )
        {
@@ -1983,7 +1994,18 @@ static ivas_error initOnFirstGoodFrame(
            return error;
        }

        if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec, &splitRendCodec, &poseCorrection, &splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec,
                                                             &splitRendCodec,
                                                             &poseCorrection,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                             &splitRendIsarFrameSizeMs,
#endif
                                                             &splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                             ,
                                                             &lc3plusHighRes
#endif
                                                             ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            return error;
@@ -1991,7 +2013,20 @@ static ivas_error initOnFirstGoodFrame(

        if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) )
        {
            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( splitRendWriter,
                                                   arg.outputWavFilename,
                                                   delayNumSamples_temp[0],
                                                   delayTimeScale_temp,
                                                   splitRendCodec,
                                                   poseCorrection,
                                                   splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   splitRendIsarFrameSizeMs,
                                                   arg.output_Fs,
                                                   lc3plusHighRes
#endif
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -2007,7 +2042,20 @@ static ivas_error initOnFirstGoodFrame(
            }
#endif

            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( splitRendWriter,
                                                   arg.outputMdFilename,
                                                   delayNumSamples_temp[0],
                                                   delayTimeScale_temp,
                                                   splitRendCodec,
                                                   poseCorrection,
                                                   splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   splitRendIsarFrameSizeMs,
                                                   arg.output_Fs,
                                                   lc3plusHighRes
#endif
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -2043,7 +2091,12 @@ static ivas_error initOnFirstGoodFrame(
            splitRendBitsZero.buf_len = 0;
            splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT;
            splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            splitRendBitsZero.codec_frame_size_ms = 0;
            splitRendBitsZero.isar_frame_size_ms = 20;
#else
            splitRendBitsZero.codec_frame_size_ms = 20;
#endif

            if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK )
            {
+49 −5
Original line number Diff line number Diff line
@@ -730,7 +730,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


    CmdlnArgs args = parseCmdlnArgs( argc, argv );
@@ -754,11 +760,25 @@ int main(
        SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader );
    }

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    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 ) )
    {
        error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inMetadataFilePaths[0], &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms );
        error = split_rend_reader_open( &hSplitRendFileReadWrite,
                                        args.inMetadataFilePaths[0],
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inMetadataFilePaths[0] );
@@ -775,7 +795,18 @@ int main(
    /*if split renderer is running in post renderer mode*/
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
    {
        error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms );
        error = split_rend_reader_open( &hSplitRendFileReadWrite,
                                        args.inputFilePath,
                                        &bitsBuffer.config.codec,
                                        &bitsBuffer.config.poseCorrection,
                                        &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                        ,
                                        &bitsBuffer.config.isar_frame_size_ms,
                                        &inFileSampleRate,
                                        &bitsBuffer.config.lc3plusHighRes
#endif
        );
        if ( error != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.inputFilePath );
@@ -784,12 +815,17 @@ 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
    {
        inFileSampleRate = args.sampleRate;
    }
@@ -797,7 +833,7 @@ int main(
    switch ( error )
    {
        case IVAS_ERR_OK:
            /* If sampling rate not given on command line, use the one from wav file */
            /* If sampling rate not given on command line, use the one from SR file */
            if ( args.sampleRate == 0 )
            {
                args.sampleRate = inFileSampleRate;
@@ -848,8 +884,16 @@ int main(

    if ( args.inConfig.numBinBuses > 0 )
    {
        if ( ( error = ISAR_REND_SetSplitRendBitstreamHeader( hIsarPostRend, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection,
                                                              bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK )
        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.isar_frame_size_ms,
                                                              bitsBuffer.config.lc3plusHighRes
#endif
                                                              ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error in getting split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            exit( -1 );
+60 −4
Original line number Diff line number Diff line
@@ -762,7 +762,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.lc3plus_highres = 0;
#else
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif
#endif
    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
@@ -1106,6 +1112,14 @@ int main(
            renderConfig.roomAcoustics.override = 1;
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        /* ISAR frame size is set from command line, not renderer config file.
         * This will be ignored if output format is not split rendering. */
        renderConfig.split_rend_config.isar_frame_size_ms = (int16_t) args.render_framesize /* given in number of 5ms subframes */ * 5;
#endif
#endif

        if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -1366,7 +1380,15 @@ int main(
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    {

        IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms );
        IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend,
                                               &bitsBuffer.config.codec,
                                               &bitsBuffer.config.poseCorrection,
                                               &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                               ,
                                               &bitsBuffer.config.isar_frame_size_ms
#endif
        );

        if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
        {
@@ -1374,7 +1396,20 @@ int main(
            exit( -1 );
        }

        if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK )
        if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite,
                                               args.outputFilePath,
                                               delayNumSamples_temp,
                                               delayTimeScale_temp,
                                               bitsBuffer.config.codec,
                                               bitsBuffer.config.poseCorrection,
                                               bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                               ,
                                               bitsBuffer.config.isar_frame_size_ms,
                                               args.sampleRate,
                                               bitsBuffer.config.lc3plus_highres
#endif
                                               ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath );
            exit( -1 );
@@ -1386,7 +1421,15 @@ int main(
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {

            IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms );
            IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend,
                                                   &bitsBuffer.config.codec,
                                                   &bitsBuffer.config.poseCorrection,
                                                   &bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   &bitsBuffer.config.isar_frame_size_ms
#endif
            );

            if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
            {
@@ -1394,7 +1437,20 @@ int main(
                exit( -1 );
            }

            if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( &hSplitRendFileReadWrite,
                                                   args.outMetadataFilePath,
                                                   delayNumSamples_temp,
                                                   delayTimeScale_temp,
                                                   bitsBuffer.config.codec,
                                                   bitsBuffer.config.poseCorrection,
                                                   bitsBuffer.config.codec_frame_size_ms
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   bitsBuffer.config.isar_frame_size_ms,
                                                   args.sampleRate,
                                                   bitsBuffer.config.lc3plus_highres
#endif
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath );
                exit( -1 );
Loading