Commit 7cc835b4 authored by multrus's avatar multrus
Browse files

[cleanup] accept ISAR_BITSTREAM_UPDATE_LC3PLUS

parent 3d4311d7
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -700,11 +700,9 @@ int main(
        }

#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 )
@@ -1920,10 +1918,8 @@ 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 )
        {
@@ -1931,11 +1927,7 @@ static ivas_error initOnFirstGoodFrame(
            return error;
        }

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

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

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK )
#else
            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -2001,12 +1985,8 @@ 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 )
            {
+0 −17
Original line number Diff line number Diff line
@@ -733,13 +733,9 @@ 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
@@ -778,9 +774,7 @@ int main(
     * Open input files
     *------------------------------------------------------------------------------------------*/

#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 ) )
@@ -790,12 +784,10 @@ int main(
                                        &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 )
        {
@@ -818,12 +810,10 @@ int main(
                                        &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 )
        {
@@ -833,17 +823,12 @@ 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;
    }
@@ -914,11 +899,9 @@ int main(
                                                              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 ) );
+0 −22
Original line number Diff line number Diff line
@@ -753,13 +753,9 @@ 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 )
@@ -1096,11 +1092,9 @@ int main(
        }

#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 )
@@ -1362,11 +1356,7 @@ int main(

    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    {
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" );
            exit( -1 );
@@ -1378,11 +1368,7 @@ int main(
            exit( -1 );
        }

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
        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, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
#else
        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 )
#endif
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath );
            exit( -1 );
@@ -1393,11 +1379,7 @@ int main(
    {
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader()!\n" );
                exit( -1 );
@@ -1409,11 +1391,7 @@ int main(
                exit( -1 );
            }

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
            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, bitsBuffer.config.isar_frame_size_ms, args.sampleRate, bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK )
#else
            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 )
#endif
            {
                fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath );
                exit( -1 );
+0 −6
Original line number Diff line number Diff line
@@ -259,10 +259,8 @@ typedef struct _ISAR_SPLIT_REND_BITS_DATA
    int16_t codec_frame_size_ms;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t isar_frame_size_ms;
    int16_t lc3plus_highres;
#endif

} ISAR_SPLIT_REND_BITS_DATA, *ISAR_SPLIT_REND_BITS_HANDLE;

@@ -278,16 +276,12 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
                              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*/
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    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 */
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
    ISAR_SPLIT_REND_CODEC codec;
    ISAR_SPLIT_REND_RENDERER_SELECTION rendererSelection;
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t lc3plus_highres;
#endif

} ISAR_SPLIT_REND_CONFIG_DATA, *ISAR_SPLIT_REND_CONFIG_HANDLE;
#endif
+0 −2
Original line number Diff line number Diff line
@@ -105,10 +105,8 @@ typedef enum
     *----------------------------------------*/
    IVAS_ERR_INVALID_BITSTREAM = 0x2000,
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM,
    IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM_CONFIG,
#endif
#endif

    /*----------------------------------------*
Loading