Loading .gitlab/merge_request_templates/default.md 0 → 100644 +25 −0 Original line number Diff line number Diff line <!--- Basic information that is useful --> - Related issues: - Requested reviewers: ### Reason why this change is needed * This may be a direct copy from the issue. ### Description of the change * Describe what is done. ### Affected operating points * Describe here as well as possible what operating points are affected and how * In minimum, there should be a status for bitstream compatibility and output bit exactness * For bitstream compatibility, the following levels are helpful for describing encoder 1. Produced bitstream is BE compared to previous state. 2. Produced bitstream is non-BE but it is fully backwards compatible for decoding. Decoded output may differ. 3. Produced bitstream is non-BC. Old decoder cannot decode the produced bitstream correctly. * For output difference, use BE or non-BE. Additionally, amount of difference can be presented. <!--- By default, no labels are added as they often come from the issue. Add labels if there is no issue for this. --> apps/decoder.c +22 −530 File changed.Preview size limit exceeded, changes collapsed. Show changes apps/encoder.c +2 −53 Original line number Diff line number Diff line Loading @@ -43,11 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading @@ -74,13 +73,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) #else #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) #endif #endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ Loading Loading @@ -167,12 +160,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; #ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; #endif } EncArguments; Loading Loading @@ -216,10 +207,8 @@ int main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; #ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; #endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif Loading @@ -229,28 +218,15 @@ int main( reset_mem( USE_BYTES ); #endif #ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; IVAS_RTP ivasRtp = { 0 }; #endif #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); #else #ifdef FIXED_RTP_SEQUENCE_NUM /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); #endif #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments Loading Loading @@ -278,11 +254,7 @@ int main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; #ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #else if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -640,18 +612,13 @@ int main( } } #ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput ) { #ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -683,7 +650,6 @@ int main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Run the encoder Loading Loading @@ -853,7 +819,6 @@ int main( } /* *** Encode one frame *** */ #ifdef IVAS_RTPDUMP if ( ivasRtp.hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); Loading Loading @@ -901,11 +866,7 @@ int main( goto cleanup; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading @@ -913,7 +874,6 @@ int main( } else { #endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); Loading @@ -926,9 +886,7 @@ int main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } #ifdef IVAS_RTPDUMP } #endif frame++; if ( !arg.quietModeEnabled ) Loading Loading @@ -997,7 +955,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); Loading @@ -1009,7 +966,6 @@ cleanup: } IVAS_RTP_Term( &ivasRtp ); #endif IVAS_ENC_Close( &hIvasEnc ); Loading Loading @@ -1066,11 +1022,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; #ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; #endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; Loading Loading @@ -1849,7 +1803,6 @@ static bool parseCmdlIVAS_enc( i++; } #ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ Loading Loading @@ -1915,8 +1868,6 @@ static bool parseCmdlIVAS_enc( i++; } #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -2129,14 +2080,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump <N> : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); #endif fprintf( stdout, "\n" ); return; Loading apps/encoder_fmtsw.c +4 −69 Original line number Diff line number Diff line Loading @@ -43,11 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -77,13 +76,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) #else #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) #endif #endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ Loading Loading @@ -170,12 +163,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; #ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; #endif } EncArguments; Loading @@ -193,11 +184,8 @@ static ivas_error readForcedMode( FILE *file, IVAS_ENC_FORCED_MODE *forcedMode, static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); #endif static void str2arg( char *str, int *argc_local, char *argv_local[] ); #ifdef IVAS_RTPDUMP static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ); #else static int encoder_main( int argc, char *argv[] ); #endif /*------------------------------------------------------------------------------------------* * main() Loading @@ -215,11 +203,9 @@ int main( char line[2048]; int argc_local = 0; char *argv_local[MAX_ARGV] = { 0 }; #ifdef IVAS_RTPDUMP IVAS_RTP ivasRtp = { 0 }; char prev_outputBitstreamFilename[2048] = { 0 }; int rtp_term = 0; #endif IVAS_ENC_PrintDisclaimer(); Loading @@ -244,7 +230,6 @@ int main( printf( "Processing format switching commandline: %s\n", line ); str2arg( line, &argc_local, argv_local ); #ifdef IVAS_RTPDUMP if ( strcmp( argv_local[argc_local - 1], (char *) prev_outputBitstreamFilename ) == 0 ) { /* append to last Rtp file */ Loading @@ -269,9 +254,6 @@ int main( rtp_term = 1; } strcpy( (char *) prev_outputBitstreamFilename, argv_local[argc_local - 1] ); #else encoder_main( argc_local, argv_local ); #endif } /*------------------------------------------------------------------------------------------* Loading @@ -282,9 +264,8 @@ int main( cleanup: #ifdef IVAS_RTPDUMP IVAS_RTP_Term( &ivasRtp ); #endif if ( FmtSWFile ) { fclose( FmtSWFile ); Loading Loading @@ -318,13 +299,9 @@ void str2arg( int encoder_main( int argc, #ifdef IVAS_RTPDUMP char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ) #else char *argv[] ) #endif { bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ EncArguments arg; Loading @@ -341,10 +318,8 @@ int encoder_main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; #ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; #endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif Loading @@ -354,28 +329,15 @@ int encoder_main( reset_mem( USE_BYTES ); #endif #ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; /* IVAS_RTP ivasRtp = { 0 }; */ #endif #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); #else #ifdef FIXED_RTP_SEQUENCE_NUM /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); #endif #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments Loading @@ -401,11 +363,7 @@ int encoder_main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; #ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #else if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -763,18 +721,13 @@ int encoder_main( } } #ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput && init_RtpWriter ) { #ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -806,7 +759,6 @@ int encoder_main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Run the encoder Loading Loading @@ -976,7 +928,6 @@ int encoder_main( } /* *** Encode one frame *** */ #ifdef IVAS_RTPDUMP if ( ivasRtp->hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); Loading Loading @@ -1024,11 +975,7 @@ int encoder_main( goto cleanup; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading @@ -1036,7 +983,6 @@ int encoder_main( } else { #endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); Loading @@ -1049,9 +995,7 @@ int encoder_main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } #ifdef IVAS_RTPDUMP } #endif frame++; if ( !arg.quietModeEnabled ) Loading Loading @@ -1120,7 +1064,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); Loading @@ -1132,7 +1075,6 @@ cleanup: } /* IVAS_RTP_Term( &ivasRtp ); */ #endif IVAS_ENC_Close( &hIvasEnc ); Loading Loading @@ -1185,11 +1127,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; #ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; #endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; Loading Loading @@ -1968,7 +1908,6 @@ static bool parseCmdlIVAS_enc( i++; } #ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ Loading Loading @@ -2032,8 +1971,6 @@ static bool parseCmdlIVAS_enc( i++; } #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -2246,14 +2183,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump <N> : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); #endif fprintf( stdout, "\n" ); return; Loading apps/isar_post_rend.c +5 −106 Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ #endif #include "stl.h" #include "wmc_auto.h" #ifdef RTP_S4_251135_CR26253_0016_REV1 #include "ivas_rtp_file.h" #endif #define WMC_TOOL_SKIP Loading Loading @@ -82,9 +80,7 @@ static typedef struct { #ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp; #endif IVAS_AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; Loading @@ -106,9 +102,7 @@ typedef struct char executableName[POST_REND_MAX_CLI_ARG_LENGTH]; char inputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; char outputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; #ifdef RTP_S4_251135_CR26253_0016_REV1 char srParamsFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; #endif int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; Loading Loading @@ -138,9 +132,7 @@ typedef enum CmdLnOptionId_listFormats, CmdLnOptionId_SplitRendBFIFile, CmdLnOptionId_framing, #ifdef RTP_S4_251135_CR26253_0016_REV1 CmdLnOptionId_srParamsFile, #endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { Loading Loading @@ -216,14 +208,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "fr", .description = "Set Render audio framing.", }, #ifdef RTP_S4_251135_CR26253_0016_REV1 { .id = CmdLnOptionId_srParamsFile, .match = "sr_params", .matchShort = "s", .description = "Path to the split rendering init params file", }, #endif }; Loading @@ -235,14 +225,11 @@ static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_ static void printSupportedAudioConfigs( void ); #ifdef RTP_S4_251135_CR26253_0016_REV1 static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString, bool *srRtp ); #else static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); #endif static void convertOutputBuffer( const Word32 *fixedBuffer, Word16 q, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ Loading Loading @@ -327,20 +314,14 @@ static bool parseInConfig( } /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ #ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp = false; IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr, &srRtp ); #else IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); #endif switch ( audioConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: inConfig->numBinBuses = 1; #ifdef RTP_S4_251135_CR26253_0016_REV1 inConfig->binBuses[0].srRtp = srRtp; #endif inConfig->binBuses[0].audioConfig = audioConfig; inConfig->binBuses[0].inputChannelIndex = 0; inConfig->binBuses[0].gain_dB = 0.0f; Loading Loading @@ -391,19 +372,13 @@ static bool parseRenderFramesize( static IVAS_AUDIO_CONFIG parseAudioConfig( #ifdef RTP_S4_251135_CR26253_0016_REV1 const char *configString, bool *srRtp ) #else const char *configString ) #endif { char charBuf[25]; charBuf[24] = '\0'; #ifdef RTP_S4_251135_CR26253_0016_REV1 *srRtp = false; #endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; to_upper( charBuf ); Loading @@ -420,13 +395,12 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( strcmp( charBuf, "RTPDUMP" ) == 0 ) { *srRtp = true; return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #endif return IVAS_AUDIO_CONFIG_INVALID; } Loading Loading @@ -483,9 +457,8 @@ static CmdlnArgs defaultArgs( strncpy( args.executableName, executableName, POST_REND_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); clearString( args.outputFilePath ); #ifdef RTP_S4_251135_CR26253_0016_REV1 clearString( args.srParamsFilePath ); #endif args.sampleRate = 0; args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; Loading Loading @@ -591,14 +564,11 @@ static void parseOption( fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); } break; #ifdef RTP_S4_251135_CR26253_0016_REV1 case CmdLnOptionId_srParamsFile: assert( numOptionValues == 1 ); strncpy( args->srParamsFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 ); break; #endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; Loading Loading @@ -635,9 +605,7 @@ static void printSupportedAudioConfigs( void ) "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", "BINAURAL_SPLIT_CODED", #ifdef RTP_S4_251135_CR26253_0016_REV1 "RTPDUMP", #endif }; fprintf( stdout, "Supported audio formats:\n" ); Loading Loading @@ -729,7 +697,7 @@ static void convertOutputBuffer( return; } #ifdef RTP_S4_251135_CR26253_0016_REV1 static void trim( char *str ) { char c; Loading @@ -747,11 +715,10 @@ static void trim( char *str ) str[w] = 0; } static ivas_error parseSRParamsFile( const char *srParamsFilePath, #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE const char *rtpFilePath, #endif ISAR_SPLIT_REND_CODEC *codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, int16_t *codec_frame_size_ms, Loading @@ -778,7 +745,6 @@ static ivas_error parseSRParamsFile( trim( key ); trim( value ); #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE if ( 0 == strncmp( key, "DOF", 3 ) ) { int val = atoi( value ); Loading @@ -795,51 +761,11 @@ static ivas_error parseSRParamsFile( *lc3plusHighRes = (int16_t) val; } } #else if ( 0 == strncmp( key, "CODEC", 5 ) ) { *codec = ( 0 == strncmp( value, "LCLD", 4 ) ) ? ISAR_SPLIT_REND_CODEC_LCLD : *codec; *codec = ( 0 == strncmp( value, "LC3PLUS", 7 ) ) ? ISAR_SPLIT_REND_CODEC_LC3PLUS : *codec; } else if ( 0 == strncmp( key, "DOF", 3 ) ) { int val = atoi( value ); if ( val == 0 || val == 1 ) { *poseCorrection = ( val == 0 ) ? ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE : ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; } } else if ( 0 == strncmp( key, "FRAMESIZE", 9 ) ) { int val = atoi( value ); if ( val == 5 || val == 10 || val == 20 ) { *codec_frame_size_ms = (int16_t) val; } } else if ( 0 == strncmp( key, "RENDERSIZE", 9 ) ) { int val = atoi( value ); if ( val == 5 || val == 10 || val == 20 ) { *isar_frame_size_ms = (int16_t) val; } } else if ( 0 == strncmp( key, "LC3PLUS_HIGHRES", 15 ) ) { int val = atoi( value ); if ( val == 0 || val == 1 ) { *lc3plusHighRes = (int16_t) val; } } #endif } } fclose( fParamSR ); #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE { /* Peek the RTP stream to ascertain the codec and codec_frame_size */ ivas_error error = IVAS_ERR_OK; Loading Loading @@ -877,11 +803,9 @@ static ivas_error parseSRParamsFile( } IVAS_RTP_Term( &srRtp ); } #endif return IVAS_ERR_OK; } #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -923,9 +847,7 @@ int main( int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; bool splitBinNeedsNewFrame = true; #ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_RTP srRTP = { 0 }; #endif #ifdef WMOPS reset_wmops(); Loading Loading @@ -955,9 +877,7 @@ int main( convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); #ifdef RTP_S4_251135_CR26253_0016_REV1 convert_backslash( args.srParamsFilePath ); #endif /*------------------------------------------------------------------------------------------* * Open head-rotation file Loading Loading @@ -1008,13 +928,10 @@ int main( } } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].srRtp ) ) { error = parseSRParamsFile( args.srParamsFilePath, #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE args.inputFilePath, #endif &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, Loading @@ -1026,28 +943,18 @@ int main( goto cleanup; } #ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE if ( ( error = IVAS_RTP_READER_Init( &srRTP, (uint32_t) bitsBuffer.config.codec_frame_size_ms, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_READER_Init( &srRTP, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); goto cleanup; } audioReader = NULL; #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE /* Force owerwrite of command line provided rendersize to align with codec frame size */ args.render_framesize = bitsBuffer.config.isar_frame_size_ms / 5; #endif } /*if split renderer is running in post renderer mode*/ else if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) #else /*if split renderer is running in post renderer mode*/ if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) #endif { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath, Loading Loading @@ -1254,7 +1161,6 @@ int main( num_in_channels = inBuffer.config.numChannels; numSamplesRead = 0; #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srRTP.hRtpFile && splitBinNeedsNewFrame ) { IVAS_RTP_SR_INFO srInfo = { 0 }; Loading @@ -1277,9 +1183,7 @@ int main( if ( error == IVAS_ERR_END_OF_FILE ) { numSamplesRead = 0; #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE break; #endif } else { Loading @@ -1301,9 +1205,6 @@ int main( } } else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) #else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) #endif { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; Loading Loading @@ -1416,7 +1317,6 @@ int main( goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP /* Set BFI if frame is empty */ int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); if ( frameEmpty ) Loading @@ -1427,7 +1327,6 @@ int main( goto cleanup; } } #endif } } Loading Loading
.gitlab/merge_request_templates/default.md 0 → 100644 +25 −0 Original line number Diff line number Diff line <!--- Basic information that is useful --> - Related issues: - Requested reviewers: ### Reason why this change is needed * This may be a direct copy from the issue. ### Description of the change * Describe what is done. ### Affected operating points * Describe here as well as possible what operating points are affected and how * In minimum, there should be a status for bitstream compatibility and output bit exactness * For bitstream compatibility, the following levels are helpful for describing encoder 1. Produced bitstream is BE compared to previous state. 2. Produced bitstream is non-BE but it is fully backwards compatible for decoding. Decoded output may differ. 3. Produced bitstream is non-BC. Old decoder cannot decode the produced bitstream correctly. * For output difference, use BE or non-BE. Additionally, amount of difference can be presented. <!--- By default, no labels are added as they often come from the issue. Add labels if there is no issue for this. -->
apps/encoder.c +2 −53 Original line number Diff line number Diff line Loading @@ -43,11 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading @@ -74,13 +73,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) #else #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) #endif #endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ Loading Loading @@ -167,12 +160,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; #ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; #endif } EncArguments; Loading Loading @@ -216,10 +207,8 @@ int main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; #ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; #endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif Loading @@ -229,28 +218,15 @@ int main( reset_mem( USE_BYTES ); #endif #ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; IVAS_RTP ivasRtp = { 0 }; #endif #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); #else #ifdef FIXED_RTP_SEQUENCE_NUM /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); #endif #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments Loading Loading @@ -278,11 +254,7 @@ int main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; #ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #else if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -640,18 +612,13 @@ int main( } } #ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput ) { #ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -683,7 +650,6 @@ int main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Run the encoder Loading Loading @@ -853,7 +819,6 @@ int main( } /* *** Encode one frame *** */ #ifdef IVAS_RTPDUMP if ( ivasRtp.hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); Loading Loading @@ -901,11 +866,7 @@ int main( goto cleanup; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading @@ -913,7 +874,6 @@ int main( } else { #endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); Loading @@ -926,9 +886,7 @@ int main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } #ifdef IVAS_RTPDUMP } #endif frame++; if ( !arg.quietModeEnabled ) Loading Loading @@ -997,7 +955,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); Loading @@ -1009,7 +966,6 @@ cleanup: } IVAS_RTP_Term( &ivasRtp ); #endif IVAS_ENC_Close( &hIvasEnc ); Loading Loading @@ -1066,11 +1022,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; #ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; #endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; Loading Loading @@ -1849,7 +1803,6 @@ static bool parseCmdlIVAS_enc( i++; } #ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ Loading Loading @@ -1915,8 +1868,6 @@ static bool parseCmdlIVAS_enc( i++; } #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -2129,14 +2080,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump <N> : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); #endif fprintf( stdout, "\n" ); return; Loading
apps/encoder_fmtsw.c +4 −69 Original line number Diff line number Diff line Loading @@ -43,11 +43,10 @@ #include "ism_file_reader.h" #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" #ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" #endif #include "wmc_auto.h" #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. Loading Loading @@ -77,13 +76,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) #else #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) #endif #endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ Loading Loading @@ -170,12 +163,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; #ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; #endif } EncArguments; Loading @@ -193,11 +184,8 @@ static ivas_error readForcedMode( FILE *file, IVAS_ENC_FORCED_MODE *forcedMode, static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); #endif static void str2arg( char *str, int *argc_local, char *argv_local[] ); #ifdef IVAS_RTPDUMP static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ); #else static int encoder_main( int argc, char *argv[] ); #endif /*------------------------------------------------------------------------------------------* * main() Loading @@ -215,11 +203,9 @@ int main( char line[2048]; int argc_local = 0; char *argv_local[MAX_ARGV] = { 0 }; #ifdef IVAS_RTPDUMP IVAS_RTP ivasRtp = { 0 }; char prev_outputBitstreamFilename[2048] = { 0 }; int rtp_term = 0; #endif IVAS_ENC_PrintDisclaimer(); Loading @@ -244,7 +230,6 @@ int main( printf( "Processing format switching commandline: %s\n", line ); str2arg( line, &argc_local, argv_local ); #ifdef IVAS_RTPDUMP if ( strcmp( argv_local[argc_local - 1], (char *) prev_outputBitstreamFilename ) == 0 ) { /* append to last Rtp file */ Loading @@ -269,9 +254,6 @@ int main( rtp_term = 1; } strcpy( (char *) prev_outputBitstreamFilename, argv_local[argc_local - 1] ); #else encoder_main( argc_local, argv_local ); #endif } /*------------------------------------------------------------------------------------------* Loading @@ -282,9 +264,8 @@ int main( cleanup: #ifdef IVAS_RTPDUMP IVAS_RTP_Term( &ivasRtp ); #endif if ( FmtSWFile ) { fclose( FmtSWFile ); Loading Loading @@ -318,13 +299,9 @@ void str2arg( int encoder_main( int argc, #ifdef IVAS_RTPDUMP char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ) #else char *argv[] ) #endif { bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ EncArguments arg; Loading @@ -341,10 +318,8 @@ int encoder_main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; #ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; #endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif Loading @@ -354,28 +329,15 @@ int encoder_main( reset_mem( USE_BYTES ); #endif #ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; /* IVAS_RTP ivasRtp = { 0 }; */ #endif #ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); #else #ifdef FIXED_RTP_SEQUENCE_NUM /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); #endif #endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments Loading @@ -401,11 +363,7 @@ int encoder_main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; #ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #else if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -763,18 +721,13 @@ int encoder_main( } } #ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput && init_RtpWriter ) { #ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; Loading Loading @@ -806,7 +759,6 @@ int encoder_main( goto cleanup; } } #endif /*------------------------------------------------------------------------------------------* * Run the encoder Loading Loading @@ -976,7 +928,6 @@ int encoder_main( } /* *** Encode one frame *** */ #ifdef IVAS_RTPDUMP if ( ivasRtp->hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); Loading Loading @@ -1024,11 +975,7 @@ int encoder_main( goto cleanup; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; Loading @@ -1036,7 +983,6 @@ int encoder_main( } else { #endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); Loading @@ -1049,9 +995,7 @@ int encoder_main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } #ifdef IVAS_RTPDUMP } #endif frame++; if ( !arg.quietModeEnabled ) Loading Loading @@ -1120,7 +1064,6 @@ cleanup: fclose( f_bitrateProfile ); } #ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); Loading @@ -1132,7 +1075,6 @@ cleanup: } /* IVAS_RTP_Term( &ivasRtp ); */ #endif IVAS_ENC_Close( &hIvasEnc ); Loading Loading @@ -1185,11 +1127,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; #ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; #endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; Loading Loading @@ -1968,7 +1908,6 @@ static bool parseCmdlIVAS_enc( i++; } #ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ Loading Loading @@ -2032,8 +1971,6 @@ static bool parseCmdlIVAS_enc( i++; } #endif /*-----------------------------------------------------------------* * Option not recognized *-----------------------------------------------------------------*/ Loading Loading @@ -2246,14 +2183,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump <N> : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); #endif fprintf( stdout, "\n" ); return; Loading
apps/isar_post_rend.c +5 −106 Original line number Diff line number Diff line Loading @@ -47,9 +47,7 @@ #endif #include "stl.h" #include "wmc_auto.h" #ifdef RTP_S4_251135_CR26253_0016_REV1 #include "ivas_rtp_file.h" #endif #define WMC_TOOL_SKIP Loading Loading @@ -82,9 +80,7 @@ static typedef struct { #ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp; #endif IVAS_AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; Loading @@ -106,9 +102,7 @@ typedef struct char executableName[POST_REND_MAX_CLI_ARG_LENGTH]; char inputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; char outputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; #ifdef RTP_S4_251135_CR26253_0016_REV1 char srParamsFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; #endif int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; Loading Loading @@ -138,9 +132,7 @@ typedef enum CmdLnOptionId_listFormats, CmdLnOptionId_SplitRendBFIFile, CmdLnOptionId_framing, #ifdef RTP_S4_251135_CR26253_0016_REV1 CmdLnOptionId_srParamsFile, #endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { Loading Loading @@ -216,14 +208,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "fr", .description = "Set Render audio framing.", }, #ifdef RTP_S4_251135_CR26253_0016_REV1 { .id = CmdLnOptionId_srParamsFile, .match = "sr_params", .matchShort = "s", .description = "Path to the split rendering init params file", }, #endif }; Loading @@ -235,14 +225,11 @@ static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_ static void printSupportedAudioConfigs( void ); #ifdef RTP_S4_251135_CR26253_0016_REV1 static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString, bool *srRtp ); #else static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); #endif static void convertOutputBuffer( const Word32 *fixedBuffer, Word16 q, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); /*------------------------------------------------------------------------------------------* * Local functions *------------------------------------------------------------------------------------------*/ Loading Loading @@ -327,20 +314,14 @@ static bool parseInConfig( } /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ #ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp = false; IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr, &srRtp ); #else IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); #endif switch ( audioConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: inConfig->numBinBuses = 1; #ifdef RTP_S4_251135_CR26253_0016_REV1 inConfig->binBuses[0].srRtp = srRtp; #endif inConfig->binBuses[0].audioConfig = audioConfig; inConfig->binBuses[0].inputChannelIndex = 0; inConfig->binBuses[0].gain_dB = 0.0f; Loading Loading @@ -391,19 +372,13 @@ static bool parseRenderFramesize( static IVAS_AUDIO_CONFIG parseAudioConfig( #ifdef RTP_S4_251135_CR26253_0016_REV1 const char *configString, bool *srRtp ) #else const char *configString ) #endif { char charBuf[25]; charBuf[24] = '\0'; #ifdef RTP_S4_251135_CR26253_0016_REV1 *srRtp = false; #endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; to_upper( charBuf ); Loading @@ -420,13 +395,12 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( strcmp( charBuf, "RTPDUMP" ) == 0 ) { *srRtp = true; return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #endif return IVAS_AUDIO_CONFIG_INVALID; } Loading Loading @@ -483,9 +457,8 @@ static CmdlnArgs defaultArgs( strncpy( args.executableName, executableName, POST_REND_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); clearString( args.outputFilePath ); #ifdef RTP_S4_251135_CR26253_0016_REV1 clearString( args.srParamsFilePath ); #endif args.sampleRate = 0; args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; Loading Loading @@ -591,14 +564,11 @@ static void parseOption( fprintf( stderr, "Unknown or invalid option for frame size: %s\n", optionValues[0] ); exit( -1 ); } break; #ifdef RTP_S4_251135_CR26253_0016_REV1 case CmdLnOptionId_srParamsFile: assert( numOptionValues == 1 ); strncpy( args->srParamsFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 ); break; #endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; Loading Loading @@ -635,9 +605,7 @@ static void printSupportedAudioConfigs( void ) "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", "BINAURAL_SPLIT_CODED", #ifdef RTP_S4_251135_CR26253_0016_REV1 "RTPDUMP", #endif }; fprintf( stdout, "Supported audio formats:\n" ); Loading Loading @@ -729,7 +697,7 @@ static void convertOutputBuffer( return; } #ifdef RTP_S4_251135_CR26253_0016_REV1 static void trim( char *str ) { char c; Loading @@ -747,11 +715,10 @@ static void trim( char *str ) str[w] = 0; } static ivas_error parseSRParamsFile( const char *srParamsFilePath, #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE const char *rtpFilePath, #endif ISAR_SPLIT_REND_CODEC *codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, int16_t *codec_frame_size_ms, Loading @@ -778,7 +745,6 @@ static ivas_error parseSRParamsFile( trim( key ); trim( value ); #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE if ( 0 == strncmp( key, "DOF", 3 ) ) { int val = atoi( value ); Loading @@ -795,51 +761,11 @@ static ivas_error parseSRParamsFile( *lc3plusHighRes = (int16_t) val; } } #else if ( 0 == strncmp( key, "CODEC", 5 ) ) { *codec = ( 0 == strncmp( value, "LCLD", 4 ) ) ? ISAR_SPLIT_REND_CODEC_LCLD : *codec; *codec = ( 0 == strncmp( value, "LC3PLUS", 7 ) ) ? ISAR_SPLIT_REND_CODEC_LC3PLUS : *codec; } else if ( 0 == strncmp( key, "DOF", 3 ) ) { int val = atoi( value ); if ( val == 0 || val == 1 ) { *poseCorrection = ( val == 0 ) ? ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE : ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; } } else if ( 0 == strncmp( key, "FRAMESIZE", 9 ) ) { int val = atoi( value ); if ( val == 5 || val == 10 || val == 20 ) { *codec_frame_size_ms = (int16_t) val; } } else if ( 0 == strncmp( key, "RENDERSIZE", 9 ) ) { int val = atoi( value ); if ( val == 5 || val == 10 || val == 20 ) { *isar_frame_size_ms = (int16_t) val; } } else if ( 0 == strncmp( key, "LC3PLUS_HIGHRES", 15 ) ) { int val = atoi( value ); if ( val == 0 || val == 1 ) { *lc3plusHighRes = (int16_t) val; } } #endif } } fclose( fParamSR ); #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE { /* Peek the RTP stream to ascertain the codec and codec_frame_size */ ivas_error error = IVAS_ERR_OK; Loading Loading @@ -877,11 +803,9 @@ static ivas_error parseSRParamsFile( } IVAS_RTP_Term( &srRtp ); } #endif return IVAS_ERR_OK; } #endif /*------------------------------------------------------------------------------------------* Loading Loading @@ -923,9 +847,7 @@ int main( int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; bool splitBinNeedsNewFrame = true; #ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_RTP srRTP = { 0 }; #endif #ifdef WMOPS reset_wmops(); Loading Loading @@ -955,9 +877,7 @@ int main( convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); #ifdef RTP_S4_251135_CR26253_0016_REV1 convert_backslash( args.srParamsFilePath ); #endif /*------------------------------------------------------------------------------------------* * Open head-rotation file Loading Loading @@ -1008,13 +928,10 @@ int main( } } #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].srRtp ) ) { error = parseSRParamsFile( args.srParamsFilePath, #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE args.inputFilePath, #endif &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, Loading @@ -1026,28 +943,18 @@ int main( goto cleanup; } #ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE if ( ( error = IVAS_RTP_READER_Init( &srRTP, (uint32_t) bitsBuffer.config.codec_frame_size_ms, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) #else if ( ( error = IVAS_RTP_READER_Init( &srRTP, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); goto cleanup; } audioReader = NULL; #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE /* Force owerwrite of command line provided rendersize to align with codec frame size */ args.render_framesize = bitsBuffer.config.isar_frame_size_ms / 5; #endif } /*if split renderer is running in post renderer mode*/ else if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) #else /*if split renderer is running in post renderer mode*/ if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) #endif { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath, Loading Loading @@ -1254,7 +1161,6 @@ int main( num_in_channels = inBuffer.config.numChannels; numSamplesRead = 0; #ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srRTP.hRtpFile && splitBinNeedsNewFrame ) { IVAS_RTP_SR_INFO srInfo = { 0 }; Loading @@ -1277,9 +1183,7 @@ int main( if ( error == IVAS_ERR_END_OF_FILE ) { numSamplesRead = 0; #ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE break; #endif } else { Loading @@ -1301,9 +1205,6 @@ int main( } } else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) #else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) #endif { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; Loading Loading @@ -1416,7 +1317,6 @@ int main( goto cleanup; } #ifdef FIX_1119_SPLIT_RENDERING_VOIP /* Set BFI if frame is empty */ int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); if ( frameEmpty ) Loading @@ -1427,7 +1327,6 @@ int main( goto cleanup; } } #endif } } Loading