Commit 996c4c09 authored by vaclav's avatar vaclav
Browse files

improvements around ISAR_BITSTREAM_UPDATE_LC3PLUS

parent 37aab016
Loading
Loading
Loading
Loading
+10 −34
Original line number Diff line number Diff line
@@ -712,6 +712,7 @@ 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.
@@ -1993,18 +1994,11 @@ static ivas_error initOnFirstGoodFrame(
            return error;
        }

        if ( ( error = IVAS_DEC_GetSplitRendBitstreamHeader( hIvasDec,
                                                             &splitRendCodec,
                                                             &poseCorrection,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                             &splitRendIsarFrameSizeMs,
#endif
                                                             &splitRendCodecFrameSizeMs
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                             ,
                                                             &lc3plusHighRes
        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
                                                             ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nUnable to get split renderer bitstream header: %s\n", ivas_error_to_string( error ) );
            return error;
@@ -2012,20 +2006,11 @@ 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
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   splitRendIsarFrameSizeMs,
                                                   arg.output_Fs,
                                                   lc3plusHighRes
            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
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -2041,20 +2026,11 @@ static ivas_error initOnFirstGoodFrame(
            }
#endif

            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
            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
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
+21 −40
Original line number Diff line number Diff line
@@ -771,6 +771,7 @@ int main(
    bitsBuffer.config.codec_frame_size_ms = 20;
#endif
#endif

    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
        lfeRoutingConfigs[i] = NULL;
@@ -1380,16 +1381,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
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                               ,
                                               &bitsBuffer.config.isar_frame_size_ms
        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 );
        }

        if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
        {
@@ -1397,20 +1397,11 @@ 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
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                               ,
                                               bitsBuffer.config.isar_frame_size_ms,
                                               args.sampleRate,
                                               bitsBuffer.config.lc3plus_highres
        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
                                               ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Could not open split rend metadata file %s\n", args.outputFilePath );
            exit( -1 );
@@ -1421,16 +1412,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
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   &bitsBuffer.config.isar_frame_size_ms
            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 );
            }

            if ( IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ) != IVAS_ERR_OK )
            {
@@ -1438,20 +1428,11 @@ 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
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
                                                   ,
                                                   bitsBuffer.config.isar_frame_size_ms,
                                                   args.sampleRate,
                                                   bitsBuffer.config.lc3plus_highres
            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
                                                   ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Could not open split rend metadata file %s\n", args.outMetadataFilePath );
                exit( -1 );
+8 −8
Original line number Diff line number Diff line
@@ -3818,11 +3818,10 @@ ivas_error IVAS_DEC_GetSplitRendBitstreamHeader(
    ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o  : pointer to pose correction mode       */
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    int16_t *pIsar_frame_size_ms,  /* o  : pointer to isar frame size setting    */
#endif
    int16_t *pCodec_frame_size_ms, /* o  : pointer to codec frame size setting   */
    int16_t *pLc3plusHighRes       /* o  : pointer to LC3plus High-Res setting   */
#else
    int16_t *pCodec_frame_size_ms /* o: pointer to codec frame size setting     */
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
    ,
    int16_t *pLc3plusHighRes
#endif
)
{
@@ -3838,6 +3837,7 @@ ivas_error IVAS_DEC_GetSplitRendBitstreamHeader(
    *pIsar_frame_size_ms = hIvasDec->st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms;
    *pLc3plusHighRes = hIvasDec->st_ivas->hRenderConfig->split_rend_config.lc3plus_highres;
#endif

    return IVAS_ERR_OK;
}

+2 −0
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ ivas_error IVAS_DEC_GetSplitRendBitstreamHeader(
    int16_t *pIsar_frame_size_ms,               /* o  : pointer to isar frame size setting                                      */
    int16_t *pCodec_frame_size_ms,              /* o  : pointer to codec frame size setting                                     */
    int16_t *pLc3plusHighRes                    /* o  : pointer to LC3plus High-Res setting                                     */
#else
    int16_t *pCodec_frame_size_ms               /* o  : pointer to codec frame size setting                                     */
#endif
);

+10 −1
Original line number Diff line number Diff line
@@ -57,8 +57,17 @@ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr(

    return IVAS_ERR_INTERNAL;
}


#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError )
/*-----------------------------------------------------------------------------------------*
 * Function IVAS_LC3PLUS_LC3plusRtpErrToIvasErr()
 *
 *
 *-----------------------------------------------------------------------------------------*/

ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr(
    const LC3PLUS_RTP_ERR lc3PlusRtpError )
{
    switch ( lc3PlusRtpError )
    {
Loading