Commit a3804b2d authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept ISAR_BITSTREAM_UPDATE_LC3PLUS

parent 0287dc47
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -558,11 +558,9 @@ 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 )
@@ -1670,10 +1668,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 )
        {
@@ -1684,14 +1680,10 @@ static ivas_error initOnFirstGoodFrame(
        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 ) );
@@ -1707,12 +1699,10 @@ static ivas_error initOnFirstGoodFrame(
                                                   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 );
@@ -1734,12 +1724,10 @@ static ivas_error initOnFirstGoodFrame(
                                                   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 );
@@ -1776,12 +1764,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
@@ -734,13 +734,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


    CmdlnArgs args = parseCmdlnArgs( argc, argv );
@@ -764,9 +760,7 @@ 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 ) )
@@ -776,12 +770,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 )
        {
@@ -804,12 +796,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 )
        {
@@ -819,17 +809,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;
    }
@@ -892,11 +877,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 −14
Original line number Diff line number Diff line
@@ -831,13 +831,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 )
    {
@@ -1281,11 +1277,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 )
@@ -1573,10 +1567,8 @@ 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
#endif
        );

        if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
@@ -1592,12 +1584,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,
                                               args.sampleRate,
                                               bitsBuffer.config.lc3plus_highres
#endif
                                               ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath );
@@ -1614,10 +1604,8 @@ 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
#endif
            );

            if ( IVAS_REND_GetDelay_fx( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
@@ -1633,12 +1621,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,
                                                   args.sampleRate,
                                                   bitsBuffer.config.lc3plus_highres
#endif
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath );
+0 −6
Original line number Diff line number Diff line
@@ -276,10 +276,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;

@@ -295,16 +293,12 @@ typedef struct _ISAR_SPLIT_REND_CONFIG
                              3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                              */
    int16_t codec_delay_ms;   /*PLACEHOLDER (currently being ignored) : 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
@@ -99,10 +99,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