From db7d0c7897e905c02aac08998cbe0da3c30869ea Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 08:16:44 +0100 Subject: [PATCH 1/4] Issue 284: Update highest bitrate limit in ISM format; under ISM_HIGHEST_BITRATE --- apps/encoder.c | 19 ++++++++++++++----- lib_com/options.h | 2 +- lib_enc/lib_enc.c | 23 ++++++++++++++++++++--- readme.txt | 22 +++++++++++++--------- scripts/config/self_test.prm | 9 +++++++++ 5 files changed, 57 insertions(+), 18 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 9a29c9b2db..1d20de1e74 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -1640,8 +1640,18 @@ static void usage_enc( void ) fprintf( stdout, " *VBR mode (average bitrate),\n" ); fprintf( stdout, " for AMR-WB IO modes R = (6600, 8850, 12650, 14250, 15850, 18250,\n" ); fprintf( stdout, " 19850, 23050, 23850) \n" ); +#ifdef ISM_HIGHEST_BITRATE + fprintf( stdout, " for IVAS stereo R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); + fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); + fprintf( stdout, " for IVAS ISM R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); + fprintf( stdout, " 96000, 128000, \n" ); + fprintf( stdout, " for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000) \n" ); + fprintf( stdout, " for 3 ISM and 4 ISM also 384000 \n" ); + fprintf( stdout, " for 4 ISM also 512000 \n" ); +#else fprintf( stdout, " for IVAS stereo & ISm R =(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); +#endif fprintf( stdout, " for IVAS SBA, MASA, MC R=(13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); fprintf( stdout, " 96000, 128000, 160000, 192000, 256000, 384000, 512000) \n" ); fprintf( stdout, " Alternatively, R can be a bitrate switching file which consists of R values\n" ); @@ -1664,9 +1674,9 @@ static void usage_enc( void ) fprintf( stdout, "-sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D),\n" ); fprintf( stdout, " where Order specifies the Ambisionics order (1-3),\n" ); fprintf( stdout, " where positive (+) means full 3D and negative (-) only 2D/planar components to be coded\n" ); - fprintf( stdout, "-masa Ch File : MASA format \n" ); - fprintf( stdout, " where Ch specifies the number of input/transport channels (1 or 2): \n" ); - fprintf( stdout, " and File specifies input file containing parametric metadata \n" ); + fprintf( stdout, "-masa Channels File : MASA format \n" ); + fprintf( stdout, " where Channels specifies the number of input/transport channels (1 or 2): \n" ); + fprintf( stdout, " and File specifies input file containing parametric MASA metadata \n" ); fprintf( stdout, "-mc InputConf : Multi-channel format\n" ); fprintf( stdout, " where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4\n" ); fprintf( stdout, " Loudspeaker positions are assumed to have azimuth and elevation as per \n" ); @@ -1676,8 +1686,7 @@ static void usage_enc( void ) fprintf( stdout, " where 0 = adaptive, 3-100 = fixed in number of frames,\n" ); fprintf( stdout, " default is deactivated\n" ); fprintf( stdout, "-dtx : Activate DTX mode with a SID update rate of 8 frames\n" ); - fprintf( stdout, " Note: DTX is currently supported in EVS, stereo, 1 ISm, \n" ); - fprintf( stdout, " SBA (up to 128kbps) and MASA (up to 128kbps)\n" ); + fprintf( stdout, " Note: DTX is supported in EVS, stereo, ISM, SBA up to 80kbps and MASA up to 128kbps \n" ); fprintf( stdout, "-rf p o : Activate channel-aware mode for WB and SWB signal at 13.2kbps, \n" ); fprintf( stdout, " where FEC indicator, p: LO or HI, and FEC offset, o: 2, 3, 5, or 7 in number of frames.\n" ); fprintf( stdout, " Alternatively p and o can be replaced by a rf configuration file with each line \n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 45406dadb9..7b0f0625b9 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,7 +164,7 @@ #define FIX_351_HRTF_COMMAND /* VA: Issue 354 - improve "-hrtf" command-line option */ #define FIX_94_VERIFY_WAV_NUM_CHANNELS /* FhG: Issue 94 - Check if number of channels in input wav file matches encoder/renderer configuration */ - +#define ISM_HIGHEST_BITRATE /* VA: Issue 284: Update highest bitrate limit in ISM format */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 85de203f10..0678cbf8e0 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1985,24 +1985,41 @@ static ivas_error sanitizeBandwidth( static ivas_error sanitizeBitrateISM( const ENCODER_CONFIG_HANDLE hEncoderConfig ) { +#ifdef ISM_HIGHEST_BITRATE + if ( hEncoderConfig->ivas_total_brate > IVAS_128k && hEncoderConfig->nchan_inp == 1 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 1 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + } + + if ( hEncoderConfig->ivas_total_brate > IVAS_256k && hEncoderConfig->nchan_inp == 2 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 2 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + } + + if ( hEncoderConfig->ivas_total_brate > IVAS_384k && hEncoderConfig->nchan_inp == 3 ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for 3 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + } +#else if ( hEncoderConfig->ivas_total_brate > IVAS_256k ) { return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } +#endif if ( hEncoderConfig->ivas_total_brate < IVAS_16k4 && hEncoderConfig->nchan_inp == 2 ) { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 2 ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 2 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 && hEncoderConfig->nchan_inp == 3 ) { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 3 ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 3 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 && hEncoderConfig->nchan_inp == 4 ) { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 4 ISm specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); + return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for 4 ISM specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); } return IVAS_ERR_OK; diff --git a/readme.txt b/readme.txt index 39223ca0d3..bff241a8d6 100644 --- a/readme.txt +++ b/readme.txt @@ -160,8 +160,13 @@ R : Bitrate in bps, *VBR mode (average bitrate), for AMR-WB IO modes R = (6600, 8850, 12650, 14250, 15850, 18250, 19850, 23050, 23850) - for IVAS stereo & ISm R =(13200, 16400, 24400, 32000, 48000, 64000, 80000, - 96000, 128000, 160000, 192000, 256000) + for IVAS stereo R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, + 96000, 128000, 160000, 192000, 256000) + for IVAS ISM R = 13200 for ISM 1, 16400 for ISM 1 and ISM 2, + (24400, 32000, 48000, 64000, 80000, 96000, 128000) + for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000 + for 3 ISM and 4 ISM also 384000 + for 4 ISM also 512000 for IVAS SBA, MASA, MC R=(13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000) Alternatively, R can be a bitrate switching file which consists of R values @@ -176,16 +181,16 @@ Options: EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -masa, -mc -stereo [Mode] : Stereo format, default is unified stereo optional for Mode: 1: DFT Stereo, 2: TD Stereo, 3: MDCT Stereo --ism Channels Files : ISm format - where Channels specifies the number of ISms (1-4) +-ism Channels Files : ISM format + where Channels specifies the number of ISMs (1-4) and Files specify input files containing metadata, one file per object (use NULL for no input metadata) -sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D), where Order specifies the Ambisionics order (1-3), where positive (+) means full 3D and negative (-) only 2D/planar components to be coded --masa Ch File : MASA format - where Ch specifies the number of input/transport channels (1 or 2): - and File specifies input file containing parametric metadata +-masa Channels File : MASA format + where Channels specifies the number of input/transport channels (1 or 2): + and File specifies input file containing parametric MASA metadata -mc InputConf : Multi-channel format where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4 Loudspeaker positions are assumed to have azimuth and elevation as per @@ -195,8 +200,7 @@ EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, where 0 = adaptive, 3-100 = fixed in number of frames, default is deactivated -dtx : Activate DTX mode with a SID update rate of 8 frames - Note: DTX is currently supported in EVS, stereo, 1 ISm, - SBA (up to 128kbps) and MASA (up to 128kbps) + Note: DTX is supported in EVS, stereo, ISM, SBA up to 80kbps and MASA up to 128kbps -rf p o : Activate channel-aware mode for WB and SWB signal at 13.2kbps, where FEC indicator, p: LO or HI, and FEC offset, o: 2, 3, 5, or 7 in number of frames. Alternatively p and o can be replaced by a rf configuration file with each line diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 93a0acce18..7f48f1a1cf 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -378,6 +378,15 @@ ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TDHR.tst +// 3 ISm with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out +../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 384000 48 testv/stv3ISM48s.wav bit +../IVAS_dec 7_1_4 32 bit testv/stv3ISM48s.wav_384000_48-32_7_1_4.tst + +// 4 ISm with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 +../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit +../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst + + // 1 ISm with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on ../IVAS_cod -dtx -ism 1 testv/stvISM1.csv ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 32 testv/stv32c.wav bit ../IVAS_dec MONO 32 bit testv/stv32c.wav_brate_sw_32-32_mono_dtx.tst -- GitLab From 245929ce24f398bdff9981bcfed8f1ba767755f7 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 08:20:02 +0100 Subject: [PATCH 2/4] comment --- apps/encoder.c | 8 ++++---- readme.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 1d20de1e74..48cdb8f4bd 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -1643,8 +1643,8 @@ static void usage_enc( void ) #ifdef ISM_HIGHEST_BITRATE fprintf( stdout, " for IVAS stereo R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); fprintf( stdout, " 96000, 128000, 160000, 192000, 256000) \n" ); - fprintf( stdout, " for IVAS ISM R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, \n" ); - fprintf( stdout, " 96000, 128000, \n" ); + fprintf( stdout, " for IVAS ISM R = 13200 for 1 ISM, 16400 for 1 ISM and 2 ISM, \n" ); + fprintf( stdout, " (24400, 32000, 48000, 64000, 80000, 96000, 128000) \n" ); fprintf( stdout, " for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000) \n" ); fprintf( stdout, " for 3 ISM and 4 ISM also 384000 \n" ); fprintf( stdout, " for 4 ISM also 512000 \n" ); @@ -1667,8 +1667,8 @@ static void usage_enc( void ) fprintf( stdout, "EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -masa, -mc\n" ); fprintf( stdout, "-stereo [Mode] : Stereo format, default is unified stereo \n" ); fprintf( stdout, " optional for Mode: 1: DFT Stereo, 2: TD Stereo, 3: MDCT Stereo\n" ); - fprintf( stdout, "-ism Channels Files : ISm format \n" ); - fprintf( stdout, " where Channels specifies the number of ISms (1-4)\n" ); + fprintf( stdout, "-ism Channels Files : ISM format \n" ); + fprintf( stdout, " where Channels specifies the number of ISMs (1-4)\n" ); fprintf( stdout, " and Files specify input files containing metadata, one file per object\n" ); fprintf( stdout, " (use NULL for no input metadata)\n" ); fprintf( stdout, "-sba +/-Order : Scene Based Audio input format (Ambisonics ACN/SN3D),\n" ); diff --git a/readme.txt b/readme.txt index bff241a8d6..649fe1c4cd 100644 --- a/readme.txt +++ b/readme.txt @@ -162,7 +162,7 @@ R : Bitrate in bps, 19850, 23050, 23850) for IVAS stereo R = (13200, 16400, 24400, 32000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000) - for IVAS ISM R = 13200 for ISM 1, 16400 for ISM 1 and ISM 2, + for IVAS ISM R = 13200 for 1 ISM, 16400 for 1 ISM and 2 ISM, (24400, 32000, 48000, 64000, 80000, 96000, 128000) for 2 ISM, 3 ISM and 4 ISM also 160000, 192000, 256000 for 3 ISM and 4 ISM also 384000 -- GitLab From 2ef037bcfe55effea4f71b7855319b32bcb8dbc3 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 08:56:21 +0100 Subject: [PATCH 3/4] reflect ISM bitrates in json modes file --- scripts/config/ivas_modes.json | 51 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/scripts/config/ivas_modes.json b/scripts/config/ivas_modes.json index 77ffb55c1a..a2adaa4ccf 100644 --- a/scripts/config/ivas_modes.json +++ b/scripts/config/ivas_modes.json @@ -1828,10 +1828,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ], "swb": [ 13200, @@ -1842,10 +1839,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ], "fb": [ 32000, @@ -1853,10 +1847,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ] } }, @@ -1892,10 +1883,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ], "swb": [ 13200, @@ -1906,10 +1894,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ], "fb": [ 32000, @@ -1917,10 +1902,7 @@ 64000, 80000, 96000, - 128000, - 160000, - 192000, - 256000 + 128000 ] } } @@ -2021,7 +2003,8 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000 ], "swb": [ 24400, @@ -2033,7 +2016,8 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000 ], "fb": [ 32000, @@ -2044,7 +2028,8 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000 ] } }, @@ -2118,7 +2103,9 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000, + 512000 ], "swb": [ 24400, @@ -2130,7 +2117,9 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000, + 512000 ], "fb": [ 32000, @@ -2141,7 +2130,9 @@ 128000, 160000, 192000, - 256000 + 256000, + 384000, + 512000 ] } }, -- GitLab From 53df95adc87711d8ed3fbb79f9adeb9d556e65af Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 6 Mar 2023 08:51:20 +0000 Subject: [PATCH 4/4] Update self_test.prm --- scripts/config/self_test.prm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 7f48f1a1cf..305fabf71d 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -378,13 +378,7 @@ ../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 256000 48 testv/stv4ISM48s.wav bit ../IVAS_dec -t testv/headrot_case03_3000_q.csv BINAURAL 48 bit testv/stv4ISM48s.wav_256000_48-48_TDHR.tst -// 3 ISm with metadata at 384 kbps, 48 kHz in, 32 kHz out, 7_1_4 out -../IVAS_cod -ism 3 testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 384000 48 testv/stv3ISM48s.wav bit -../IVAS_dec 7_1_4 32 bit testv/stv3ISM48s.wav_384000_48-32_7_1_4.tst -// 4 ISm with metadata at 512 kbps, 48 kHz in, 48 kHz out, 5_1 -../IVAS_cod -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stv4ISM48s.wav bit -../IVAS_dec 5_1 48 bit testv/stv4ISM48s.wav_512000_48-48_5_1.tst // 1 ISm with metadata bitrate switching from 13.2 kbps to 128 kbps, 32 kHz in, 32 kHz out, mono out, DTX on -- GitLab