Commit 26fd76c1 authored by vaclav's avatar vaclav
Browse files

fixes + improvements

parent 8bef1c48
Loading
Loading
Loading
Loading
+84 −147
Original line number Diff line number Diff line
@@ -176,9 +176,11 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF

static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
#ifdef DEBUGGING
#ifndef API_5MS
#ifdef VARIABLE_SPEED_DECODING
static ivas_error decodeVariableSpeed( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
#endif
#endif
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar );
@@ -439,74 +441,10 @@ int main(
        }
    }

#ifdef API_5MS
    /*-------------------------------------------------------------------*
     * Load renderer configuration from file
     *--------------------------------------------------------------------*/

    IVAS_RENDER_CONFIG_DATA renderConfigSplit;
    if ( ( error = IVAS_DEC_GetDefaultRenderConfig( &renderConfigSplit ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_GetDefaultRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
    if ( arg.renderConfigEnabled )
    {
        /* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            exit( -1 );
        }
#else
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
            goto cleanup;
        }
#endif
        if ( RenderConfigReader_read( renderConfigReader,
                                      arg.renderConfigFilename,
                                      &renderConfigSplit ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------------------*
 * Configure the decoder
 *------------------------------------------------------------------------------------------*/
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        arg.enableHeadRotation = true;
#ifdef API_5MS_BASELINE
        if ( arg.enable5ms &&
             ( renderConfigSplit.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
               renderConfigSplit.split_rend_config.dof == 0 ) )
        {
            /*TODO : needs to be refined as this wont work with LCLD codec*/
            arg.enable5ms = true;
        }
        else
        {
            arg.enable5ms = false;
        }
#endif
    }
#endif

    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig,
#ifdef API_5MS_BASELINE
                                       arg.tsmEnabled, arg.enable5ms,
@@ -517,9 +455,8 @@ int main(
        goto cleanup;
    }


    /*------------------------------------------------------------------------------------------*
     * Configure VoIP mode
     * Configure Split rendering
     *------------------------------------------------------------------------------------------*/

#ifdef API_5MS
@@ -531,6 +468,8 @@ int main(
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }

        arg.enableHeadRotation = true;
    }
#endif
#endif
@@ -707,6 +646,22 @@ int main(
            goto cleanup;
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef API_5MS_BASELINE
        if ( arg.enable5ms &&
             ( renderConfig.split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ||
               renderConfig.split_rend_config.dof == 0 ) )
        {
            /*TODO : needs to be refined as this wont work with LCLD codec*/
            arg.enable5ms = true;
        }
        else
        {
            arg.enable5ms = false;
        }
#endif
#endif

        if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
@@ -743,6 +698,7 @@ int main(
            goto cleanup;
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Load custom loudspeaker layout data
     *------------------------------------------------------------------------------------------*/
@@ -1758,7 +1714,7 @@ static ivas_error initOnFirstGoodFrame(
    uint16_t *pNumObj                                /* o  : */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    ,
    SplitFileReadWrite **hSplitRendFileReadWrite
    SplitFileReadWrite **splitRendWriter
#endif
)
{
@@ -1813,7 +1769,7 @@ static ivas_error initOnFirstGoodFrame(

        if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
        {
            if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -1821,7 +1777,7 @@ static ivas_error initOnFirstGoodFrame(
        }
        else
        {
            if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputMdFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to open output split rendering metadata file %s\n", arg.outputWavFilename );
                return error;
@@ -1848,7 +1804,7 @@ static ivas_error initOnFirstGoodFrame(
    for ( int16_t i = 0; i < numInitialBadFrames; ++i )
    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( *hSplitRendFileReadWrite != NULL )
        if ( *splitRendWriter != NULL )
        {
            IVAS_SPLIT_REND_BITS_DATA splitRendBitsZero;
            splitRendBitsZero.bits_buf = NULL;
@@ -1860,7 +1816,7 @@ static ivas_error initOnFirstGoodFrame(
#ifdef API_5MS
            splitRendBitsZero.codec_frame_size_ms = 20;
#endif
            if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written,
            if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written,
                                                     -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE
#ifdef API_5MS
                                                     ,
@@ -1869,7 +1825,7 @@ static ivas_error initOnFirstGoodFrame(
                                                     ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
                return error;
            }
        }
        else
@@ -1996,9 +1952,8 @@ static ivas_error initOnFirstGoodFrame(
    }

#if defined( SPLIT_REND_WITH_HEAD_ROT ) && defined( API_5MS )
    if ( *hSplitRendFileReadWrite != NULL )
    if ( *splitRendWriter != NULL )
    {

        int16_t enable5ms;

        if ( numOutSamples == NULL || vec_pos_len == NULL )
@@ -2006,7 +1961,10 @@ static ivas_error initOnFirstGoodFrame(
            return IVAS_ERR_UNEXPECTED_NULL_POINTER;
        }

        IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms );
        if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK )
        {
            return error;
        }

        /* real setting of the 5ms mode for split rendering is only known after the decoded first good frame, reset the variables needed in the main decoding loop accordingly here*/
        if ( enable5ms )
@@ -2083,7 +2041,7 @@ static ivas_error decodeG192(

#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_SPLIT_REND_BITS_DATA splitRendBits;
    SplitFileReadWrite *hSplitRendFileReadWrite;
    SplitFileReadWrite *splitRendWriter;
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
@@ -2137,7 +2095,7 @@ static ivas_error decodeG192(
    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
    if ( arg.enableHeadRotation
    if ( ( arg.enableHeadRotation || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#ifdef API_5MS_BASELINE
         && arg.enable5ms
#endif
@@ -2160,7 +2118,7 @@ static ivas_error decodeG192(
    splitRendBits.codec = IVAS_SPLIT_REND_CODEC_DEFAULT;
    splitRendBits.pose_correction = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
    splitRendBits.codec_frame_size_ms = 0;
    hSplitRendFileReadWrite = NULL;
    splitRendWriter = NULL;
#endif

    /*------------------------------------------------------------------------------------------*
@@ -2209,7 +2167,10 @@ static ivas_error decodeG192(
        }
#ifdef API_5MS
        int16_t enable5ms, num_subframes;
        IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms );
        if ( ( error = IVAS_DEC_Get5msFlag( hIvasDec, &enable5ms ) ) != IVAS_ERR_OK )
        {
            return error;
        }
        arg.enable5ms = enable5ms;
        num_subframes = ( arg.enable5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
#else
@@ -2290,11 +2251,9 @@ static ivas_error decodeG192(

            for ( i = 0; i < num_subframes; i++ )
            {

                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                             RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    goto cleanup;
                }
            }
@@ -2374,11 +2333,8 @@ static ivas_error decodeG192(
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
            {
                error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec,
                                                            (void *) ( pcmBuf + nOutChannels * nSamplesRendered ),
                                                            &splitRendBits,
                                                            &nSamplesRendered_loop,
                                                            &needNewFrame );
                error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ),
                                                            &splitRendBits, &nSamplesRendered_loop, &needNewFrame );
                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
                if ( error != IVAS_ERR_OK )
@@ -2392,12 +2348,10 @@ static ivas_error decodeG192(
#endif
                error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender,
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
                                             IVAS_DEC_PCM_INT16,
                                             (void *)
                                             IVAS_DEC_PCM_INT16, (void *)
#endif
                                                                     ( pcmBuf + nOutChannels * nSamplesRendered ),
                                             &nSamplesRendered_loop,
                                             &needNewFrame );
                                             &nSamplesRendered_loop, &needNewFrame );
                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
                if ( error != IVAS_ERR_OK )
@@ -2429,28 +2383,16 @@ static ivas_error decodeG192(
            /* Once good frame decoded, catch up */
            if ( decodedGoodFrame )
            {
                error = initOnFirstGoodFrame(
                    hIvasDec,
                    arg,
                    numInitialBadFrames,
                error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames,
#if defined( SPLIT_REND_WITH_HEAD_ROT ) && defined( API_5MS )
                    &nOutSamples,
                    &vec_pos_len,
                                              &nOutSamples, &vec_pos_len,
#else
                                              nOutSamples,
#endif
                    delayNumSamples_orig,
                    &delayNumSamples,
                    &delayTimeScale,
                    &bsFormat,
                    &afWriter,
                    &masaWriter,
                    ismWriters,
                    &nOutChannels,
                    &numObj
                                              delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                              ,
                    &hSplitRendFileReadWrite
                                              &splitRendWriter
#endif
                );
                if ( error != IVAS_ERR_OK )
@@ -2468,26 +2410,19 @@ static ivas_error decodeG192(
        if ( decodedGoodFrame )
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
            if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
            {
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                         splitRendBits.codec, splitRendBits.pose_correction
#ifdef API_5MS
                                                         ,
                                                         splitRendBits.codec_frame_size_ms
#endif
                                                         ) != IVAS_ERR_OK )
#if 0
                IVAS_SPLIT_REND_BITS_DATA splitRendBits;

                if ( ( error = IVAS_DEC_GetSplitRendBits( hIvasDec, &splitRendBits ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                    fprintf( stderr, "\nError in IVAS_DEC_SplitRendBits: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
            else
            {
                if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
                {
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                             splitRendBits.codec, splitRendBits.pose_correction
#endif

                if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written, splitRendBits.codec, splitRendBits.pose_correction
#ifdef API_5MS
                                                         ,
                                                         splitRendBits.codec_frame_size_ms
@@ -2498,6 +2433,9 @@ static ivas_error decodeG192(
                    goto cleanup;
                }
            }

            if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
            {
#endif
                if ( delayNumSamples < nOutSamples )
                {
@@ -2520,7 +2458,7 @@ static ivas_error decodeG192(
        /* Write ISm metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
            {
                if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK )
                {
@@ -2545,7 +2483,8 @@ static ivas_error decodeG192(
                    }
                }
            }
            else if ( bsFormat == IVAS_DEC_BS_MASA )

            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
@@ -2583,6 +2522,7 @@ static ivas_error decodeG192(
#ifdef WMOPS
        if ( vec_pos_update == 0 )
        {
            // update_mem(); TODO: verify this
            update_wmops();
        }
#ifdef MEM_COUNT_DETAILS
@@ -2591,7 +2531,6 @@ static ivas_error decodeG192(
#endif
    }


    /*------------------------------------------------------------------------------------------*
     * Flush what is still left in the VoIP Buffers....
     *------------------------------------------------------------------------------------------*/
@@ -2638,15 +2577,12 @@ static ivas_error decodeG192(
        if ( arg.enableHeadRotation )
        {
            IVAS_QUATERNION Quaternion;


            if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos[0] ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) );
                goto cleanup;
            }


            if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos[0], 0
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                       ,
@@ -2662,8 +2598,7 @@ static ivas_error decodeG192(
        /* decode and get samples */
        if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples,
#if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT
                                       IVAS_DEC_PCM_INT16,
                                       (void *)
                                       IVAS_DEC_PCM_INT16, (void *)
#endif
                                                               pcmBuf,
                                       &nSamplesFlushed ) ) != IVAS_ERR_OK )
@@ -2682,7 +2617,7 @@ static ivas_error decodeG192(
        /* Write ISm metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
            {
                if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK )
                {
@@ -2707,7 +2642,8 @@ static ivas_error decodeG192(
                    }
                }
            }
            else if ( bsFormat == IVAS_DEC_BS_MASA )

            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
@@ -2755,7 +2691,7 @@ static ivas_error decodeG192(
    /* Print output metadata file name(s) */
    if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
    {
        if ( bsFormat == IVAS_DEC_BS_OBJ )
        if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
        {
            for ( i = 0; i < numObj; i++ )
            {
@@ -2763,7 +2699,8 @@ static ivas_error decodeG192(
            }
            fprintf( stdout, "\n" );
        }
        else if ( bsFormat == IVAS_DEC_BS_MASA )

        if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
        {
            fprintf( stdout, "\nOutput metadata file:   %s\n", MasaFileWriter_getFilePath( masaWriter ) );
        }
@@ -2793,7 +2730,7 @@ static ivas_error decodeG192(
cleanup:

#ifdef SPLIT_REND_WITH_HEAD_ROT
    split_rend_reader_writer_close( &hSplitRendFileReadWrite );
    split_rend_reader_writer_close( &splitRendWriter );
#endif
    AudioFileWriter_close( &afWriter );
    MasaFileWriter_close( &masaWriter );
@@ -3654,7 +3591,7 @@ static ivas_error decodeVoIP(
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT

                SplitFileReadWrite *hSplitRendFileReadWrite = NULL;
                SplitFileReadWrite *splitRendWriter = NULL;
#endif
                error = initOnFirstGoodFrame(
                    hIvasDec,
@@ -3677,7 +3614,7 @@ static ivas_error decodeVoIP(
                    &numObj
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    ,
                    &hSplitRendFileReadWrite
                    &splitRendWriter
#endif
                );
                if ( error != IVAS_ERR_OK )
@@ -3718,7 +3655,7 @@ static ivas_error decodeVoIP(
            {
                int16_t i;

                if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM )
                if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
                {
                    if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, &numObj ) ) != IVAS_ERR_OK )
                    {
@@ -4100,7 +4037,7 @@ static ivas_error decodeVariableSpeed(
            if ( decodedGoodFrame )
            {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                SplitFileReadWrite *hSplitRendFileReadWrite = NULL;
                SplitFileReadWrite *splitRendWriter = NULL;
#endif
                error = initOnFirstGoodFrame(
                    hIvasDec,
@@ -4118,7 +4055,7 @@ static ivas_error decodeVariableSpeed(
                    &numObj
#ifdef SPLIT_REND_WITH_HEAD_ROT
                    ,
                    &hSplitRendFileReadWrite
                    &splitRendWriter
#endif
                );
                if ( error != IVAS_ERR_OK )
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

/*#define SPLIT_REND_WITH_HEAD_ROT*/                    /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define SPLIT_REND_WITH_HEAD_ROT                    /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_PRED_QUANT_63_PNTS
#define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN               /* Nokia: Issue 623: Split rendering support for parambin renderer */
+126 −69

File changed.

Preview size limit exceeded, changes collapsed.

+38 −38
Original line number Diff line number Diff line
@@ -134,8 +134,8 @@ ivas_error IVAS_DEC_Configure(
    const uint32_t sampleRate,                  /* i  : output sampling frequency                                               */
    const AUDIO_CONFIG outputConfig,            /* i  : audio configuration                                                     */
#ifdef API_5MS
    const int16_t tsmEnabled,                   /* i  : enable TSM                                                              */
    const int16_t enable5ms,                    /* i  : enable 5ms rendering path                                               */
    const bool tsmEnabled,                      /* i  : enable TSM                                                              */
    const bool enable5ms,                       /* i  : enable 5ms rendering path                                               */
#endif    
	const int16_t customLsOutputEnabled,        /* i  : enable custom loudspeaker setup handle                                  */
    const int16_t hrtfReaderEnabled,            /* i  : enable HRTF binary file input                                           */
@@ -175,7 +175,7 @@ ivas_error IVAS_DEC_GetSamples(
    int16_t *pcmBuf,                            /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels  */
#endif    
    int16_t *nOutSamples,                       /* o  : number of samples per channel written to output buffer                  */
    bool *needNewFrame           /* indication that the decoder needs a new frame                                */
    bool *needNewFrame                          /* o  : indication that the decoder needs a new frame                           */
#else
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    int16_t *pcmBuf,                            /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels  */
@@ -193,7 +193,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    void *pcmBuf_out,                           /* o  : output synthesis signal for BINAURAL_SPLIT_PCM                          */
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits, /* o  : bitstream output for split rendering mode                               */
    int16_t *nOutSamples,                       /* o  : number of samples per channel written to output buffer                  */
    bool *needNewFrame           /* indication that the decoder needs a new frame                                */
    bool *needNewFrame                          /* o  :indication that the decoder needs a new frame                            */
);
#endif

@@ -235,7 +235,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
#ifdef API_5MS
    IVAS_QUATERNION orientation,                /* i  : head-tracking data, listener orientation                                */
    IVAS_VECTOR3 Pos,                           /* i  : listener position                                                       */
    const int16_t subframe_idx   /*subframe index*/
    const int16_t subframe_idx                  /* o  : subframe index                                                          */
#else
    IVAS_QUATERNION *orientation,               /* i  : head-tracking data, listener orientation                                */
    IVAS_VECTOR3 *Pos                           /* i  : listener position                                                       */
@@ -365,11 +365,11 @@ ivas_error IVAS_DEC_EnableSplitRendering(
    IVAS_DEC_HANDLE hIvasDec                    /* i/o: IVAS decoder handle                                                     */
);
#endif

ivas_error IVAS_DEC_Get5msFlag(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    int16_t *enable5ms                          /* o  : 5ms flag                                                                */
);

#endif

#ifdef DEBUGGING