Loading apps/decoder.c +389 −1587 File changed.Preview size limit exceeded, changes collapsed. Show changes apps/renderer.c +16 −135 Original line number Original line Diff line number Diff line Loading @@ -777,12 +777,7 @@ int main( int32_t delayTimeScale = 0; int32_t delayTimeScale = 0; int16_t i, numChannels; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; ivas_error error = IVAS_ERR_OK; #ifndef API_5MS IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #endif #ifdef API_5MS bool splitBinNeedsNewFrame = true; bool splitBinNeedsNewFrame = true; #endif #ifdef WMOPS #ifdef WMOPS reset_wmops(); reset_wmops(); Loading Loading @@ -1001,13 +996,7 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT } } #endif #endif const int16_t frameSize_smpls = (int16_t) ( const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 ); #ifdef API_5MS ( args.framing_5ms ? 5 : 20 ) #else 20 #endif * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; Loading @@ -1017,12 +1006,8 @@ int main( IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 }; IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 }; #endif #endif if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, #ifdef API_5MS ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK ) , ( args.framing_5ms ) ? 1 : 4 #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); Loading Loading @@ -1426,9 +1411,7 @@ int main( bitsBuffer.config.bufLenInBytes = bitsBufferSize; bitsBuffer.config.bufLenInBytes = bitsBufferSize; bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; #ifdef API_5MS bitsBuffer.config.codec_frame_size_ms = 20; bitsBuffer.config.codec_frame_size_ms = 20; #endif #else #else inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); Loading Loading @@ -1458,35 +1441,23 @@ int main( fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); } } #ifdef API_5MS ObjectPositionBuffer mtdBuffer; ObjectPositionBuffer mtdBuffer; #endif while ( 1 ) while ( 1 ) { { int16_t num_in_channels; int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; num_in_channels = inBuffer.config.numChannels; #ifdef API_5MS const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT numSamplesRead = 0; numSamplesRead = 0; if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { ivas_error error_tmp; ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; numSamplesRead = (int16_t) inBufferSize; error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, #ifdef API_5MS &bitsBuffer.config.codec_frame_size_ms ); , &bitsBuffer.config.codec_frame_size_ms #endif ); if ( error_tmp != IVAS_ERR_OK ) if ( error_tmp != IVAS_ERR_OK ) { { if ( error_tmp == IVAS_ERR_END_OF_FILE ) if ( error_tmp == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -1514,11 +1485,7 @@ int main( } } #endif #endif if ( numSamplesRead == 0 if ( numSamplesRead == 0 && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { /* end of input data */ /* end of input data */ break; break; Loading @@ -1533,18 +1500,10 @@ int main( ); ); int16_t num_subframes, sf_idx; int16_t num_subframes, sf_idx; #ifdef API_5MS num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #else num_subframes = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #endif #ifdef API_5MS if ( isCurrentFrameMultipleOf20ms ) if ( isCurrentFrameMultipleOf20ms ) { { #else ObjectPositionBuffer mtdBuffer; #endif IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); if ( referenceVectorReader != NULL ) if ( referenceVectorReader != NULL ) Loading Loading @@ -1580,14 +1539,11 @@ int main( } } } } } } #ifdef API_5MS } } #endif /* Read from head rotation trajectory file if specified */ /* Read from head rotation trajectory file if specified */ if ( headRotReader != NULL ) if ( headRotReader != NULL ) { { #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { { IVAS_QUATERNION headRot; IVAS_QUATERNION headRot; Loading @@ -1603,70 +1559,26 @@ int main( , , DEFAULT_AXIS DEFAULT_AXIS #endif #endif #ifdef API_5MS , , sf_idx sf_idx ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } } } #else IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } } if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, Pos #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif } } else else { { #ifdef API_5MS if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } #else /* API_5MS */ error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS #endif ); if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif /* API_5MS */ } } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT /* Read from split renderer bfi file if specified */ /* Read from split renderer bfi file if specified */ if ( splitRendBFIReader != NULL if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { int16_t bfi; int16_t bfi; SplitRendBFIFileReading( splitRendBFIReader, &bfi ); SplitRendBFIFileReading( splitRendBFIReader, &bfi ); Loading @@ -1682,11 +1594,7 @@ int main( int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) #else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) #endif { { if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) { { Loading @@ -1694,27 +1602,15 @@ int main( exit( -1 ); exit( -1 ); } } } } #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { { if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx] if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx], #ifdef API_5MS sf_idx ) ) != IVAS_ERR_OK ) , sf_idx #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } } } #else if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, quatBuffer, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif } } /* Combine external orientations and head rotation */ /* Combine external orientations and head rotation */ Loading Loading @@ -1828,10 +1724,8 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < args.inConfig.numBinBuses; ++i ) for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { { #ifdef API_5MS if ( splitBinNeedsNewFrame ) if ( splitBinNeedsNewFrame ) { { #endif if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); Loading @@ -1850,13 +1744,11 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } #ifdef API_5MS } } #endif } } #endif #endif #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT if ( args.inConfig.numBinBuses != 0 ) if ( args.inConfig.numBinBuses != 0 ) { { if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK ) Loading @@ -1877,14 +1769,7 @@ int main( else else { { #endif #endif if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK ) #ifndef API_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT , &bitsBuffer #endif #endif ) ) != IVAS_ERR_OK ) { { #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); Loading @@ -1893,7 +1778,7 @@ int main( #endif #endif exit( -1 ); exit( -1 ); } } #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT } } #endif #endif Loading Loading @@ -1944,12 +1829,8 @@ int main( if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) { { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, #ifdef API_5MS bitsBuffer.config.codec_frame_size_ms ) != IVAS_ERR_OK ) , bitsBuffer.config.codec_frame_size_ms #endif ) != IVAS_ERR_OK ) { { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); exit( -1 ); Loading lib_com/common_api_types.h +10 −17 Original line number Original line Diff line number Diff line Loading @@ -57,9 +57,6 @@ #define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4 #define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4 #ifndef API_5MS #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 // ToDo: should it be harmonized with IVAS_MAX_PARAM_SPATIAL_SUBFRAMES? #endif #define QC_ABS_COEFF 6 #define QC_ABS_COEFF 6 #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT Loading Loading @@ -181,9 +178,7 @@ typedef struct ivas_split_rend_bits_t int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ int32_t bits_written; int32_t bits_written; int32_t bits_read; int32_t bits_read; #ifdef API_5MS int16_t codec_frame_size_ms; int16_t codec_frame_size_ms; #endif IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; } ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; } ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; Loading Loading @@ -266,9 +261,7 @@ typedef struct _IVAS_SPLIT_REND_CONFIG 3 - (3dof correction. By default YAW, PITCH and ROLL correction) 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*/ 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 API_5MS int16_t codec_frame_size_ms; /*Codec frame size in milliseconds, only relevant with LC3plus */ int16_t codec_frame_size_ms; /*Codec frame size in milliseconds, only relevant with LC3plus */ #endif IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_RENDERER_SELECTION rendererSelection; IVAS_SPLIT_REND_RENDERER_SELECTION rendererSelection; Loading lib_com/ivas_cnst.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -130,7 +130,7 @@ typedef enum } ivas_renderTypeOverride; } ivas_renderTypeOverride; #endif #endif #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT typedef enum typedef enum { { PCM_INT16, PCM_INT16, Loading lib_com/ivas_error.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -86,10 +86,8 @@ typedef enum IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, #ifdef API_5MS IVAS_ERR_TSM_NOT_ENABLED, IVAS_ERR_TSM_NOT_ENABLED, IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, #endif #ifdef DEBUGGING #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef DEBUG_AGC_ENCODER_CMD_OPTION Loading Loading
apps/renderer.c +16 −135 Original line number Original line Diff line number Diff line Loading @@ -777,12 +777,7 @@ int main( int32_t delayTimeScale = 0; int32_t delayTimeScale = 0; int16_t i, numChannels; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; ivas_error error = IVAS_ERR_OK; #ifndef API_5MS IVAS_VECTOR3 Pos[RENDERER_HEAD_POSITIONS_PER_FRAME]; #endif #ifdef API_5MS bool splitBinNeedsNewFrame = true; bool splitBinNeedsNewFrame = true; #endif #ifdef WMOPS #ifdef WMOPS reset_wmops(); reset_wmops(); Loading Loading @@ -1001,13 +996,7 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT } } #endif #endif const int16_t frameSize_smpls = (int16_t) ( const int16_t frameSize_smpls = (int16_t) ( ( args.framing_5ms ? 5 : 20 ) * args.sampleRate / 1000 ); #ifdef API_5MS ( args.framing_5ms ? 5 : 20 ) #else 20 #endif * args.sampleRate / 1000 ); IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; Loading @@ -1017,12 +1006,8 @@ int main( IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 }; IVAS_REND_InputId splitBinIds[RENDERER_MAX_BIN_INPUTS] = { 0 }; #endif #endif if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, args.nonDiegeticPan, args.nonDiegeticPanGain, #ifdef API_5MS ( args.framing_5ms ) ? 1 : 4 ) ) != IVAS_ERR_OK ) , ( args.framing_5ms ) ? 1 : 4 #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); Loading Loading @@ -1426,9 +1411,7 @@ int main( bitsBuffer.config.bufLenInBytes = bitsBufferSize; bitsBuffer.config.bufLenInBytes = bitsBufferSize; bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.codec = IVAS_SPLIT_REND_CODEC_DEFAULT; bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; bitsBuffer.config.poseCorrection = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; #ifdef API_5MS bitsBuffer.config.codec_frame_size_ms = 20; bitsBuffer.config.codec_frame_size_ms = 20; #endif #else #else inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); Loading Loading @@ -1458,35 +1441,23 @@ int main( fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); fprintf( stdout, "\n\n-- Start the renderer (quiet mode) --\n\n" ); } } #ifdef API_5MS ObjectPositionBuffer mtdBuffer; ObjectPositionBuffer mtdBuffer; #endif while ( 1 ) while ( 1 ) { { int16_t num_in_channels; int16_t num_in_channels; num_in_channels = inBuffer.config.numChannels; num_in_channels = inBuffer.config.numChannels; #ifdef API_5MS const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; const bool isCurrentFrameMultipleOf20ms = !args.framing_5ms || frame % 4 == 0; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT numSamplesRead = 0; numSamplesRead = 0; if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) if ( ( hSplitRendFileReadWrite != NULL ) && is_split_post_rend_mode( &args ) && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { ivas_error error_tmp; ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; numSamplesRead = (int16_t) inBufferSize; error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, #ifdef API_5MS &bitsBuffer.config.codec_frame_size_ms ); , &bitsBuffer.config.codec_frame_size_ms #endif ); if ( error_tmp != IVAS_ERR_OK ) if ( error_tmp != IVAS_ERR_OK ) { { if ( error_tmp == IVAS_ERR_END_OF_FILE ) if ( error_tmp == IVAS_ERR_END_OF_FILE ) Loading Loading @@ -1514,11 +1485,7 @@ int main( } } #endif #endif if ( numSamplesRead == 0 if ( numSamplesRead == 0 && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { /* end of input data */ /* end of input data */ break; break; Loading @@ -1533,18 +1500,10 @@ int main( ); ); int16_t num_subframes, sf_idx; int16_t num_subframes, sf_idx; #ifdef API_5MS num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; num_subframes = ( args.framing_5ms ) ? 1 : IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #else num_subframes = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES; #endif #ifdef API_5MS if ( isCurrentFrameMultipleOf20ms ) if ( isCurrentFrameMultipleOf20ms ) { { #else ObjectPositionBuffer mtdBuffer; #endif IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); if ( referenceVectorReader != NULL ) if ( referenceVectorReader != NULL ) Loading Loading @@ -1580,14 +1539,11 @@ int main( } } } } } } #ifdef API_5MS } } #endif /* Read from head rotation trajectory file if specified */ /* Read from head rotation trajectory file if specified */ if ( headRotReader != NULL ) if ( headRotReader != NULL ) { { #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { { IVAS_QUATERNION headRot; IVAS_QUATERNION headRot; Loading @@ -1603,70 +1559,26 @@ int main( , , DEFAULT_AXIS DEFAULT_AXIS #endif #endif #ifdef API_5MS , , sf_idx sf_idx ) ) != IVAS_ERR_OK ) #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } } } #else IVAS_QUATERNION quatBuffer[RENDERER_HEAD_POSITIONS_PER_FRAME]; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) { if ( ( error = HeadRotationFileReading( headRotReader, &quatBuffer[i], &Pos[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error in Head Rotation File Reading: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } } if ( ( error = IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer, Pos #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS #endif ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif } } else else { { #ifdef API_5MS if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_DisableHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error disabling head rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } #else /* API_5MS */ error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL #ifdef SPLIT_REND_WITH_HEAD_ROT , DEFAULT_AXIS #endif ); if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif /* API_5MS */ } } #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT /* Read from split renderer bfi file if specified */ /* Read from split renderer bfi file if specified */ if ( splitRendBFIReader != NULL if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame ) #ifdef API_5MS && splitBinNeedsNewFrame #endif ) { { int16_t bfi; int16_t bfi; SplitRendBFIFileReading( splitRendBFIReader, &bfi ); SplitRendBFIFileReading( splitRendBFIReader, &bfi ); Loading @@ -1682,11 +1594,7 @@ int main( int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableExternalOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int8_t enableRotationInterpolation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; int16_t numFramesToTargetOrientation[IVAS_MAX_PARAM_SPATIAL_SUBFRAMES]; #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) #else for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ ) #endif { { if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &quatBuffer[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK ) { { Loading @@ -1694,27 +1602,15 @@ int main( exit( -1 ); exit( -1 ); } } } } #ifdef API_5MS for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) for ( sf_idx = 0; sf_idx < num_subframes; sf_idx++ ) { { if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx] if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, &quatBuffer[sf_idx], enableHeadRotation[sf_idx], enableExternalOrientation[sf_idx], enableRotationInterpolation[sf_idx], numFramesToTargetOrientation[sf_idx], #ifdef API_5MS sf_idx ) ) != IVAS_ERR_OK ) , sf_idx #endif ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } } } #else if ( ( error = IVAS_REND_SetExternalOrientation( hIvasRend, quatBuffer, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error setting External Orientation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); } #endif } } /* Combine external orientations and head rotation */ /* Combine external orientations and head rotation */ Loading Loading @@ -1828,10 +1724,8 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < args.inConfig.numBinBuses; ++i ) for ( i = 0; i < args.inConfig.numBinBuses; ++i ) { { #ifdef API_5MS if ( splitBinNeedsNewFrame ) if ( splitBinNeedsNewFrame ) { { #endif if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, splitBinIds[i], &numChannels ) ) != IVAS_ERR_OK ) { { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); Loading @@ -1850,13 +1744,11 @@ int main( fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); exit( -1 ); } } #ifdef API_5MS } } #endif } } #endif #endif #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT if ( args.inConfig.numBinBuses != 0 ) if ( args.inConfig.numBinBuses != 0 ) { { if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK ) if ( ( error = IVAS_REND_GetSplitBinauralSamples( hIvasRend, outBuffer, &splitBinNeedsNewFrame ) ) != IVAS_ERR_OK ) Loading @@ -1877,14 +1769,7 @@ int main( else else { { #endif #endif if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer if ( ( error = IVAS_REND_GetSamples( hIvasRend, outBuffer ) ) != IVAS_ERR_OK ) #ifndef API_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT , &bitsBuffer #endif #endif ) ) != IVAS_ERR_OK ) { { #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); fprintf( stderr, "Error %s\n", ivas_error_to_string( error ) ); Loading @@ -1893,7 +1778,7 @@ int main( #endif #endif exit( -1 ); exit( -1 ); } } #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT } } #endif #endif Loading Loading @@ -1944,12 +1829,8 @@ int main( if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) ) { { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, bitsBuffer.config.codec, bitsBuffer.config.poseCorrection bitsBuffer.config.codec, bitsBuffer.config.poseCorrection, #ifdef API_5MS bitsBuffer.config.codec_frame_size_ms ) != IVAS_ERR_OK ) , bitsBuffer.config.codec_frame_size_ms #endif ) != IVAS_ERR_OK ) { { fprintf( stderr, "\nUnable to write to bitstream file!\n" ); fprintf( stderr, "\nUnable to write to bitstream file!\n" ); exit( -1 ); exit( -1 ); Loading
lib_com/common_api_types.h +10 −17 Original line number Original line Diff line number Diff line Loading @@ -57,9 +57,6 @@ #define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4 #define IVAS_MAX_PARAM_SPATIAL_SUBFRAMES 4 #ifndef API_5MS #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 // ToDo: should it be harmonized with IVAS_MAX_PARAM_SPATIAL_SUBFRAMES? #endif #define QC_ABS_COEFF 6 #define QC_ABS_COEFF 6 #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef SPLIT_REND_WITH_HEAD_ROT Loading Loading @@ -181,9 +178,7 @@ typedef struct ivas_split_rend_bits_t int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/ int32_t bits_written; int32_t bits_written; int32_t bits_read; int32_t bits_read; #ifdef API_5MS int16_t codec_frame_size_ms; int16_t codec_frame_size_ms; #endif IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction; } ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; } ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS_DATA, *IVAS_SPLIT_REND_BITS_HANDLE; Loading Loading @@ -266,9 +261,7 @@ typedef struct _IVAS_SPLIT_REND_CONFIG 3 - (3dof correction. By default YAW, PITCH and ROLL correction) 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*/ 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 API_5MS int16_t codec_frame_size_ms; /*Codec frame size in milliseconds, only relevant with LC3plus */ int16_t codec_frame_size_ms; /*Codec frame size in milliseconds, only relevant with LC3plus */ #endif IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_CODEC codec; IVAS_SPLIT_REND_RENDERER_SELECTION rendererSelection; IVAS_SPLIT_REND_RENDERER_SELECTION rendererSelection; Loading
lib_com/ivas_cnst.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -130,7 +130,7 @@ typedef enum } ivas_renderTypeOverride; } ivas_renderTypeOverride; #endif #endif #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT #if defined SPLIT_REND_WITH_HEAD_ROT typedef enum typedef enum { { PCM_INT16, PCM_INT16, Loading
lib_com/ivas_error.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -86,10 +86,8 @@ typedef enum IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_ISM_INVALID_METADATA_VALUE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED, #ifdef API_5MS IVAS_ERR_TSM_NOT_ENABLED, IVAS_ERR_TSM_NOT_ENABLED, IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS, #endif #ifdef DEBUGGING #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, IVAS_ERR_INVALID_FORCE_MODE, #ifdef DEBUG_AGC_ENCODER_CMD_OPTION #ifdef DEBUG_AGC_ENCODER_CMD_OPTION Loading