Loading scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c +0 −146 Original line number Diff line number Diff line Loading @@ -38,16 +38,9 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "isar_lc3plus_common.h" #include "isar_lc3plus_dec.h" #include "ivas_error_utils.h" #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "lc3plus.h" #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #define MAX_SAMPLES_PER_CHANNEL 960 / 4 #else #define MAX_SAMPLES_PER_CHANNEL 960 #endif #define DEFAULT_BPS 256000 #ifndef PCM_SAMPLE_TYPEDEF_DEFINED Loading Loading @@ -100,7 +93,6 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int perChannelBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / (1000*1000/config.lc3plus_frame_duration_us); int targetOctets = bps / 8 / (1000*1000/config.isar_frame_duration_us); Loading @@ -118,9 +110,6 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) { ISAR_LC3PLUS_ENC_Close( &encHandle ); Loading Loading @@ -200,11 +189,7 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) static int openCloseEncoder( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -221,36 +206,23 @@ static int openCloseEncoder( void ) static int tryOpenEncoderWithInvalidBitrate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif /* lc3plus max bitrate is 320000 per channel */ uint32_t invalid_high_bps = 700000; uint32_t invalid_low_bps = 8; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS uint32_t limitedBitrate; #endif ISAR_LC3PLUS_ENC_HANDLE encHandle; err = ISAR_LC3PLUS_ENC_Open( config, invalid_high_bps, &encHandle ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* setting an invalid bitrate should result in a limited bitrate*/ if ( IVAS_ERR_OK != err ) #else /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) #endif { return 1; } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS limitedBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); if(limitedBitrate != 320000) { return 1; } #endif ISAR_LC3PLUS_ENC_Close(&encHandle); err = ISAR_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ Loading @@ -265,11 +237,7 @@ static int tryOpenEncoderWithInvalidBitrate( void ) static int tryOpenEncoderWithInvalidFrameDuration( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ uint32_t bps = 320000; Loading @@ -286,11 +254,7 @@ static int tryOpenEncoderWithInvalidFrameDuration( void ) static int tryOpenEncoderWithInvalidSampleRate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.samplerate = 1234; /*unsupported sample rate */ uint32_t bps = 320000; Loading Loading @@ -330,22 +294,14 @@ static int tryCallEncoderApiWithInvalidParams( void ) return 1; } ISAR_LC3PLUS_ENC_Close( &invalidEncHandle ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out, bsSize, Q_in ) ) #else if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out ) ) #endif { return 1; } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS memset(Q_in, 0, sizeof(Q_in) ); if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out, bsSize, Q_in) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out, bsSize, Q_in ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out, bsSize, Q_in ) ) #else if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out ) ) #endif { return 1; } Loading Loading @@ -391,11 +347,7 @@ static int tryCallDecoderApiWithInvalidParams( void ) static int openCloseDecoderWithCaching( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif ISAR_LC3PLUS_DEC_HANDLE decHandle; err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING Loading @@ -414,11 +366,7 @@ static int openCloseDecoderWithCaching( void ) static int openCloseDecoderWithoutCaching( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif ISAR_LC3PLUS_DEC_HANDLE decHandle; err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING Loading @@ -438,11 +386,7 @@ static int openCloseDecoderWithoutCaching( void ) static int tryOpenDecoderWithInvalidFrameDuration( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; Loading @@ -462,11 +406,7 @@ static int tryOpenDecoderWithInvalidFrameDuration( void ) static int tryOpenDecoderWithInvalidSampleRate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.samplerate = 1234; /*unsupported sample rate*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; Loading @@ -486,11 +426,7 @@ static int tryOpenDecoderWithInvalidSampleRate( void ) static int encodeOneFrame( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -511,14 +447,10 @@ static int encodeOneFrame( void ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) return err; Loading @@ -531,11 +463,7 @@ static int encodeOneFrame( void ) static int encodeAndDecodeOneMonoFrame( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -559,13 +487,9 @@ static int encodeAndDecodeOneMonoFrame( void ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) return err; ISAR_LC3PLUS_ENC_Close( &encHandle ); Loading Loading @@ -608,11 +532,7 @@ static int encodeAndDecodeOneMonoFrame( void ) static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } Loading @@ -630,140 +550,84 @@ static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_16kHz( void ) static int encodeAndDecodeOneStereoFrameIvas5msLc3plus5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneMonoFrameIvas20msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 1, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneMonoFrameIvas5msLc3plus5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 1, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 2.5 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 2.5 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_80kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 82*1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_96kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 98*1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 126*1000 ); } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 800*1000 ); } #endif static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 204800 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_205600bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 205600 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_206400bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 206400 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_207200bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 207200 ); } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "ivas_lc3plus_unit_test_payload_format.c" #endif int main( int argc, Loading Loading @@ -841,11 +705,9 @@ int main( ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel(); if ( ret != 0 ) return 1; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel(); if ( ret != 0 ) return 1; #endif /* start configs around the FDL threshold */ ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel(); if ( ret != 0 ) Loading @@ -860,16 +722,8 @@ int main( if ( ret != 0 ) return 1; /* end configs around the FDL threshold */ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ret = run_all_payload_tests(); if ( ret != 0 ) return 1; #endif return 0; } #else int main( void ) { return EXIT_SUCCESS; } #endif /* SPLIT_REND_WITH_HEAD_ROT */ scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c +0 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "isar_lc3plus_common.h" #include "options.h" #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* included by ivas_lc3plus_unit_test.c */ Loading Loading @@ -448,4 +447,3 @@ static int run_all_payload_tests( void ) } return 0; } #endif Loading
scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c +0 −146 Original line number Diff line number Diff line Loading @@ -38,16 +38,9 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "isar_lc3plus_common.h" #include "isar_lc3plus_dec.h" #include "ivas_error_utils.h" #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "lc3plus.h" #endif #ifdef SPLIT_REND_WITH_HEAD_ROT #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #define MAX_SAMPLES_PER_CHANNEL 960 / 4 #else #define MAX_SAMPLES_PER_CHANNEL 960 #endif #define DEFAULT_BPS 256000 #ifndef PCM_SAMPLE_TYPEDEF_DEFINED Loading Loading @@ -100,7 +93,6 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS int perChannelBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); int perLc3plusFrameDataBlockOctets = encHandle->num_ftds * perChannelBitrate / 8 / (1000*1000/config.lc3plus_frame_duration_us); int targetOctets = bps / 8 / (1000*1000/config.isar_frame_duration_us); Loading @@ -118,9 +110,6 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) { ISAR_LC3PLUS_ENC_Close( &encHandle ); Loading Loading @@ -200,11 +189,7 @@ static int encodeAndDecodeOneStereoFrame( LC3PLUS_CONFIG config, uint32_t bps ) static int openCloseEncoder( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -221,36 +206,23 @@ static int openCloseEncoder( void ) static int tryOpenEncoderWithInvalidBitrate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif /* lc3plus max bitrate is 320000 per channel */ uint32_t invalid_high_bps = 700000; uint32_t invalid_low_bps = 8; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS uint32_t limitedBitrate; #endif ISAR_LC3PLUS_ENC_HANDLE encHandle; err = ISAR_LC3PLUS_ENC_Open( config, invalid_high_bps, &encHandle ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* setting an invalid bitrate should result in a limited bitrate*/ if ( IVAS_ERR_OK != err ) #else /* setting an invalid bitrate should trigger an error - which is what we expect */ if ( IVAS_ERR_LC3PLUS_INVALID_BITRATE != err ) #endif { return 1; } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS limitedBitrate = lc3plus_enc_get_real_bitrate(encHandle->handles[0]); if(limitedBitrate != 320000) { return 1; } #endif ISAR_LC3PLUS_ENC_Close(&encHandle); err = ISAR_LC3PLUS_ENC_Open( config, invalid_low_bps, &encHandle ); /* setting an invalid bitrate should trigger an error - which is what we expect */ Loading @@ -265,11 +237,7 @@ static int tryOpenEncoderWithInvalidBitrate( void ) static int tryOpenEncoderWithInvalidFrameDuration( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ uint32_t bps = 320000; Loading @@ -286,11 +254,7 @@ static int tryOpenEncoderWithInvalidFrameDuration( void ) static int tryOpenEncoderWithInvalidSampleRate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.samplerate = 1234; /*unsupported sample rate */ uint32_t bps = 320000; Loading Loading @@ -330,22 +294,14 @@ static int tryCallEncoderApiWithInvalidParams( void ) return 1; } ISAR_LC3PLUS_ENC_Close( &invalidEncHandle ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out, bsSize, Q_in ) ) #else if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, invalidBitstream_out ) ) #endif { return 1; } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS memset(Q_in, 0, sizeof(Q_in) ); if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out, bsSize, Q_in) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out, bsSize, Q_in ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out, bsSize, Q_in ) ) #else if ( IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, invalidBitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, invalidPcm_in, bitstream_out ) || IVAS_ERR_UNEXPECTED_NULL_POINTER != ISAR_LC3PLUS_ENC_Encode( invalidEncHandle, pcm_in, bitstream_out ) ) #endif { return 1; } Loading Loading @@ -391,11 +347,7 @@ static int tryCallDecoderApiWithInvalidParams( void ) static int openCloseDecoderWithCaching( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif ISAR_LC3PLUS_DEC_HANDLE decHandle; err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING Loading @@ -414,11 +366,7 @@ static int openCloseDecoderWithCaching( void ) static int openCloseDecoderWithoutCaching( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif ISAR_LC3PLUS_DEC_HANDLE decHandle; err = ISAR_LC3PLUS_DEC_Open( config, #ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING Loading @@ -438,11 +386,7 @@ static int openCloseDecoderWithoutCaching( void ) static int tryOpenDecoderWithInvalidFrameDuration( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.lc3plus_frame_duration_us = 1234; /*unsupported frame duration*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; Loading @@ -462,11 +406,7 @@ static int tryOpenDecoderWithInvalidFrameDuration( void ) static int tryOpenDecoderWithInvalidSampleRate( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif config.samplerate = 1234; /*unsupported sample rate*/ ISAR_LC3PLUS_DEC_HANDLE decHandle; Loading @@ -486,11 +426,7 @@ static int tryOpenDecoderWithInvalidSampleRate( void ) static int encodeOneFrame( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -511,14 +447,10 @@ static int encodeOneFrame( void ) return err; uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) return err; Loading @@ -531,11 +463,7 @@ static int encodeOneFrame( void ) static int encodeAndDecodeOneMonoFrame( void ) { ivas_error err; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20000, .channels = 1, .samplerate = 48000 }; #endif uint32_t bps = 128000; ISAR_LC3PLUS_ENC_HANDLE encHandle; Loading @@ -559,13 +487,9 @@ static int encodeAndDecodeOneMonoFrame( void ) uint8_t *bitstream_out = malloc( bitstreamSizePerIvasFrame ); memset( bitstream_out, 0, bitstreamSizePerIvasFrame ); #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS Word16 Q_in[16]; memset(Q_in, 0, sizeof(Q_in) ); err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out, bitstreamSizePerIvasFrame, Q_in ); #else err = ISAR_LC3PLUS_ENC_Encode( encHandle, pcm_in, bitstream_out ); #endif if ( IVAS_ERR_OK != err ) return err; ISAR_LC3PLUS_ENC_Close( &encHandle ); Loading Loading @@ -608,11 +532,7 @@ static int encodeAndDecodeOneMonoFrame( void ) static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } Loading @@ -630,140 +550,84 @@ static int encodeAndDecodeOneStereoFrameIvas20msLc3plus10ms_16kHz( void ) static int encodeAndDecodeOneStereoFrameIvas5msLc3plus5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneMonoFrameIvas20msLc3plus10ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 1, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneMonoFrameIvas5msLc3plus5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 5 * 1000, .isar_frame_duration_us = 5 * 1000, .channels = 1, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas20msLc3plus2_5ms_48kHz( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 2.5 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 2.5 * 1000, .isar_frame_duration_us = 20 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, DEFAULT_BPS ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_80kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 82*1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_96kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 98*1000 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 126*1000 ); } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 800*1000 ); } #endif static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 204800 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_205600bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 205600 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_206400bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 206400 ); } static int encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_207200bpsPerChannel( void ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 1, .samplerate = 48000, .high_res_mode_enabled = 0 }; #else LC3PLUS_CONFIG config = { .lc3plus_frame_duration_us = 10 * 1000, .isar_frame_duration_us = 10 * 1000, .channels = 2, .samplerate = 48000 }; #endif return encodeAndDecodeOneStereoFrame( config, config.channels * 207200 ); } #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS #include "ivas_lc3plus_unit_test_payload_format.c" #endif int main( int argc, Loading Loading @@ -841,11 +705,9 @@ int main( ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_124kbpsPerChannel(); if ( ret != 0 ) return 1; #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_800kbpsPerChannel(); if ( ret != 0 ) return 1; #endif /* start configs around the FDL threshold */ ret = encodeAndDecodeOneStereoFrameIvas10msLc3_10ms_48kHz_204800bpsPerChannel(); if ( ret != 0 ) Loading @@ -860,16 +722,8 @@ int main( if ( ret != 0 ) return 1; /* end configs around the FDL threshold */ #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS ret = run_all_payload_tests(); if ( ret != 0 ) return 1; #endif return 0; } #else int main( void ) { return EXIT_SUCCESS; } #endif /* SPLIT_REND_WITH_HEAD_ROT */
scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test_payload_format.c +0 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ the United Nations Convention on Contracts on the International Sales of Goods. #include "isar_lc3plus_common.h" #include "options.h" #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS /* included by ivas_lc3plus_unit_test.c */ Loading Loading @@ -448,4 +447,3 @@ static int run_all_payload_tests( void ) } return 0; } #endif