diff --git a/apps/decoder.c b/apps/decoder.c index c31d4cd5cde0286a920d17b1f72e9f1ac8cb7287..1310ef4d865b0f14d65e4fa942a1e53a51897b62 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -68,9 +68,13 @@ static #endif int32_t frame = 0; /* Counter of frames */ +#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS +#define RANDOM_INITSEED_DEC ( 0xFADE ) +#else #ifdef FIXED_RTP_SEQUENCE_NUM #define RANDOM_INITSEED_DEC ( 0xFEEDFADE ) #endif +#endif #ifdef DEBUGGING #define MIN_NUM_BITS_ACTIVE_FRAME 56 @@ -1888,6 +1892,14 @@ static ivas_error initOnFirstGoodFrame( int16_t splitRendIsarFrameSizeMs; int16_t lc3plusHighRes; +#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 rtpDecSeed = RANDOM_INITSEED_DEC; + uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) << 16 ); + uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpDecSeed ); +#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 @@ -1895,6 +1907,7 @@ static ivas_error initOnFirstGoodFrame( srand( RANDOM_INITSEED_DEC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); +#endif #endif if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK ) diff --git a/apps/encoder.c b/apps/encoder.c index 3e2bd77781c80b22eaf8918622debc9aa67b37ae..551eee9af4130123b654c03d93c1bab6450a4350 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -74,9 +74,13 @@ 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 */ @@ -230,6 +234,14 @@ int main( 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 @@ -237,6 +249,7 @@ int main( srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); +#endif #endif /*------------------------------------------------------------------------------------------* diff --git a/apps/encoder_fmtsw.c b/apps/encoder_fmtsw.c index df8236361dbec101e7c3a460ddee187702c44a99..10d81fc2f8e6bdbae8eb8f3eb3a4abcab341870c 100644 --- a/apps/encoder_fmtsw.c +++ b/apps/encoder_fmtsw.c @@ -77,9 +77,13 @@ 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 */ @@ -355,6 +359,14 @@ int encoder_main( /* 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 @@ -362,6 +374,7 @@ int encoder_main( srand( RANDOM_INITSEED_ENC ); uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); +#endif #endif /*------------------------------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index eb172a83c4475baf18db442bc8f389c214bb06bf..b1d98931d142e92bc91c4ee518d947dfef8b8788 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -113,6 +113,8 @@ #define NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES /* FhG: Adjust scaleFactor according to st->cldfbSyn->cldfb_state_fx too to avoid overflow in cldfbSynthesis_ivas_fx() */ +#define NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Nokia: fix basop issue 2233: Fix differing rtpdump streams */ + /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ diff --git a/lib_util/ivas_rtp_file.c b/lib_util/ivas_rtp_file.c index a1101c785c7a41a237a73b460194fbb83ec3e56f..6ded4e78e1a4cad2f90c125fd57111e4207bf175 100644 --- a/lib_util/ivas_rtp_file.c +++ b/lib_util/ivas_rtp_file.c @@ -1154,3 +1154,10 @@ ivas_error IVAS_RTP_ReadNextFrame( return IVAS_ERR_OK; } + +uint16_t IVAS_RTP_OwnRandom( uint16_t *seed ) +{ + *seed = (uint16_t) ( *seed * 31821L + 13849L ); + + return ( *seed ); +} diff --git a/lib_util/ivas_rtp_file.h b/lib_util/ivas_rtp_file.h index a52708266e45ae28485a49748e73b392f13cb0d6..fc92a4d021470d71de14f11f2731496a67f85d9d 100644 --- a/lib_util/ivas_rtp_file.h +++ b/lib_util/ivas_rtp_file.h @@ -94,6 +94,7 @@ ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t *auSizeBi void IVAS_RTP_LogPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent ); void IVAS_RTP_WriteExtPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent, uint16_t numObj ); const char *IVAS_RTP_GetExtPiFilePath( IVAS_RTP *rtp ); +uint16_t IVAS_RTP_OwnRandom( uint16_t *seed ); #endif /* IVAS_RTP_FILE_H */