diff --git a/apps/encoder.c b/apps/encoder.c index e0377088ad7c2033419ba9c5edc71eab18dc5ba5..b7261b4cfcde2076354ee72a8c0fa00ac82db7c9 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -40,9 +40,7 @@ #include "masa_file_reader.h" #include "rotation_file_reader.h" #include "ivas_rtp_file.h" -#ifdef FIX_1527_CMR_BITRATE_IDX #include "requests_file_reader.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -160,9 +158,7 @@ typedef struct char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; -#ifdef FIX_1527_CMR_BITRATE_IDX char *requestsFileName; -#endif } EncArguments; @@ -230,9 +226,7 @@ int main( uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; IVAS_RTP ivasRtp = { 0 }; -#ifdef FIX_1527_CMR_BITRATE_IDX ReqFileReader *requestsFileReader = NULL; -#endif /* 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 */ @@ -672,7 +666,6 @@ int main( } } -#ifdef FIX_1527_CMR_BITRATE_IDX /*------------------------------------------------------------------------------------------* * Open remote requests file for rtp packing (E-bytes) *------------------------------------------------------------------------------------------*/ @@ -684,7 +677,6 @@ int main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Run the encoder @@ -895,7 +887,6 @@ int main( } } -#ifdef FIX_1527_CMR_BITRATE_IDX if ( requestsFileReader ) { if ( ( error = ReadNextRequests( requestsFileReader, ivasRtp.remoteRequests, &ivasRtp.remoteRequestBitmap ) ) != IVAS_ERR_OK ) @@ -904,7 +895,6 @@ int main( goto cleanup; } } -#endif if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK ) { @@ -1010,12 +1000,10 @@ cleanup: fclose( f_bitrateProfile ); } -#ifdef FIX_1527_CMR_BITRATE_IDX if ( requestsFileReader ) { RequestsFileReader_close( &requestsFileReader ); } -#endif if ( sceneOrientationFileReader ) { @@ -1078,10 +1066,8 @@ static bool parseCmdlIVAS_enc( /*-----------------------------------------------------------------* * Set default values *-----------------------------------------------------------------*/ -#ifdef FIX_1527_CMR_BITRATE_IDX // Need less usan/msan or new arg addition memset( arg, 0, sizeof( *arg ) ); -#endif arg->inputWavFilename = NULL; arg->outputBitstreamFilename = NULL; @@ -1962,7 +1948,6 @@ static bool parseCmdlIVAS_enc( arg->deviceOrientationTrajFileName = argv[i]; i++; } -#ifdef FIX_1527_CMR_BITRATE_IDX else if ( strcmp( argv_to_upper, "-REQUESTS" ) == 0 ) { i++; @@ -1975,7 +1960,6 @@ static bool parseCmdlIVAS_enc( arg->requestsFileName = argv[i]; i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -2214,9 +2198,7 @@ static void usage_enc( void ) 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" ); -#ifdef FIX_1527_CMR_BITRATE_IDX fprintf( stdout, "-requests : Remote requests file, Only used with rtpdump output.\n" ); -#endif fprintf( stdout, "\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 6bfe63675545869d26b63960f5671f6c88f9fb20..aeca9026737d54ad43e1dfc118099803045b5e17 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,7 +162,6 @@ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* Nokia: reintroduce format switching for g192 bitstreams */ -#define FIX_1527_CMR_BITRATE_IDX /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */ #define FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN /* FhG: float issue 1560: Avoid optimizing the division on the result of maxWithSign() with -funsafe-math-optimizations */ /* #################### End BE switches ################################## */ diff --git a/lib_util/ivas_rtp_file.c b/lib_util/ivas_rtp_file.c index 16c23a3446b337428c9a5832519cb19c660ac521..218d041e7e47e7b3b848a294696a97e186bc09fe 100644 --- a/lib_util/ivas_rtp_file.c +++ b/lib_util/ivas_rtp_file.c @@ -1037,7 +1037,6 @@ ivas_error IVAS_RTP_WriteNextFrame( rtp->nWrittenPiData--; } -#ifdef FIX_1527_CMR_BITRATE_IDX for ( IVAS_RTP_REQUEST_TYPE req = 0; req < IVAS_REQUEST_MAX; req++ ) { if ( rtp->remoteRequestBitmap & ( 1u << req ) ) @@ -1049,7 +1048,6 @@ ivas_error IVAS_RTP_WriteNextFrame( } } } -#endif if ( forcePacket || IVAS_RTP_PACK_GetNumFrames( rtp->hPack ) == rtp->packCfg.maxFramesPerPacket ) { diff --git a/lib_util/ivas_rtp_file.h b/lib_util/ivas_rtp_file.h index 57af1826cce9db54d8e4a7f9ba3195c1d78a84ca..cb7dd26ecbda92a8e3aecd4ad5e93f9ad987a02a 100644 --- a/lib_util/ivas_rtp_file.h +++ b/lib_util/ivas_rtp_file.h @@ -44,9 +44,7 @@ typedef struct uint8_t packet[NOMINAL_BUFFER_SIZE( IVAS_MAX_FRAMES_PER_RTP_PACKET )]; IVAS_PIDATA_TS piData[IVAS_PI_MAX_ID * IVAS_MAX_FRAMES_PER_RTP_PACKET]; -#ifdef FIX_1527_CMR_BITRATE_IDX IVAS_RTP_REQUEST_VALUE remoteRequests[IVAS_REQUEST_MAX]; -#endif IVAS_RTP_FILE_HANDLE hRtpFile; FILE *f_piDataOut; FILE *f_piExtOut; diff --git a/lib_util/ivas_rtp_payload.c b/lib_util/ivas_rtp_payload.c index 13d5d00175c50e60b074b60544fc62cdcc3d61d6..7b8a3c7e66d0ffb952d22a7ffcc7ec9545f7bafa 100644 --- a/lib_util/ivas_rtp_payload.c +++ b/lib_util/ivas_rtp_payload.c @@ -658,11 +658,7 @@ static uint32_t getBitrateIdx( const uint32_t *table, uint32_t tableLen, uint32_ for ( n = 0; n < tableLen; n++ ) { -#ifdef FIX_1527_CMR_BITRATE_IDX if ( bitrate >= ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) ) -#else - if ( bitrate > ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) ) -#endif { idx = n; } @@ -728,11 +724,7 @@ static void packEBytes( /* EVS Modes */ bitrate = ( bitrate > 128000 ) ? 128000 : bitrate; bitrate = ( bitrate < 5900 ) ? 5900 : bitrate; -#ifdef FIX_1527_CMR_BITRATE_IDX bitrateIdx = getBitrateIdx( evsFrameSizeInBits, ( sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ) ) - 1, bitrate ); -#else - bitrateIdx = getBitrateIdx( evsFrameSizeInBits, sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ), bitrate ); -#endif BR = (uint8_t) bitrateIdx & MASK_4BIT; /* If a bandwidth choice cannot be signalled for a given bitrate @@ -796,11 +788,7 @@ static void packEBytes( /* Initial E-Byte */ bitrate = ( bitrate > 512000 ) ? 512000 : bitrate; bitrate = ( bitrate < 13200 ) ? 13200 : bitrate; -#ifdef FIX_1527_CMR_BITRATE_IDX bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, ( sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ) ) - 2, bitrate ); -#else - bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ), bitrate ); -#endif BR = (uint8_t) bitrateIdx & MASK_4BIT; if ( nByte < maxNumEBytes ) {