diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d1f033f0c59f866d2152252f85f8d7ec12604ae..58dbedd3c32bc51a2c3a16f476d1b00634f22228 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -138,6 +138,7 @@ stages: - mv IVAS_rend_test IVAS_rend .merge-request-comparison-check: &merge-request-comparison-check + - echo "--------------- Running merge-request-comparison-check anchor ---------------" - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi diff --git a/apps/encoder.c b/apps/encoder.c index ef1e7c1c85232c081010bba22e3f4b9537f5e4dc..4740097a30745838d6f39128dacff83ad5d22a03 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -1690,6 +1690,13 @@ static bool parseCmdlIVAS_enc( i++; } +#ifdef FIX_643_PCA_OPTION + else if ( strcmp( argv_to_upper, "-PCA" ) == 0 ) + { + arg->pca = 1; + i++; + } +#else else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // TODO: should be renamed to "-pca" { i++; @@ -1723,6 +1730,7 @@ static bool parseCmdlIVAS_enc( return false; } } +#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1919,7 +1927,11 @@ static void usage_enc( void ) fprintf( stdout, "-mime : Mime output bitstream file format\n" ); fprintf( stdout, " The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" ); fprintf( stdout, " default output bitstream file format is G.192\n" ); +#ifdef FIX_643_PCA_OPTION + fprintf( stdout, "-pca : activate PCA in SBA format FOA at 256 kbps \n" ); +#else fprintf( stdout, "-bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" ); +#endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); #ifdef DEBUGGING diff --git a/lib_com/options.h b/lib_com/options.h index 7b61ed4b4a6cba050fc97b98cb3f1ba9a301671c..2a7beaea749154fbe7848342ac463604eda6d7ed 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,6 +156,7 @@ #define FIX_890_ARRAY_SIZE /* Nokia: issue #890: mismatch in 2D array size declaration and use */ #define BE_FIX_887_GCC_WARNING_ARRAY_SIZE /* VoiceAge: Issue 887: change array size definition to avoid warning with gcc 11.4.0 */ #define FIX_247_EXTERNAL_RENDERER_COMMAND_LINE /* VA: issue 247: harmonize command-line options names of external renderer with the decoder */ +// #define FIX_643_PCA_OPTION /* VA: issue 643: rename PCA bypass command-line option */ /* #################### End BE switches ################################## */ diff --git a/readme.txt b/readme.txt index 917da705910142b318c0b564cb0b483bd28ea244..e39174163960b44daf988c902afd177883de5bc7 100644 --- a/readme.txt +++ b/readme.txt @@ -224,7 +224,7 @@ EVS mono is default, for IVAS choose one of the following: -stereo, -ism, -sba, -mime : Mime output bitstream file format The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format). default output bitstream file format is G.192 --bypass mode : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1 +-pca : activate PCA in SBA format FOA at 256 kbps -level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. Currently, all values default to level 3 (full functionality). -q : Quiet mode, limit printouts to terminal, default is deactivated diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py index c095f2755856f0d5db7b29365b518fea957eed8c..0ea0c2e5caa91a6a2f8276007a9b34bf4d245f95 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_dec_plc.py @@ -143,7 +143,7 @@ def sba_dec_plc( # ------------ run cmd ------------ tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}" - if gain_flag == 1: + if gain_flag != -1: tag_out += f'_Gain{gain_flag}' plc_tag_out = f"{tag_out}_{plc_pattern}" diff --git a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py index a02865410e178aa9094abe3cf7701fab20ee95ba..08bb609d5debef088b0318c1907358624bf4cc8e 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py +++ b/tests/codec_be_on_mr_nonselection/test_sba_bs_enc.py @@ -69,7 +69,6 @@ ivas_br_HOA2 = ["256000", "384000", "512000"] ivas_br_HOA3 = ["256000", "384000", "512000"] SID_list = [0, 1] sample_rate_list = ["48", "32", "16"] -bypass_list = [1, 2] gain_list = [0, 1] sample_rate_bw_idx_list = [("48", "SWB"), ("48", "WB"), ("32", "WB")] @@ -89,8 +88,7 @@ def check_and_makedir(dir_path): @pytest.mark.create_ref @pytest.mark.parametrize("tag", tag_list) @pytest.mark.parametrize("fs", sample_rate_list) -@pytest.mark.parametrize("bypass", bypass_list) -def test_bypass_enc( +def test_pca_enc( dut_encoder_frontend: EncoderFrontend, dut_decoder_frontend: DecoderFrontend, test_vector_path, @@ -102,11 +100,8 @@ def test_bypass_enc( keep_files, tag, fs, - bypass, ): - if update_ref == 1 and bypass == 1: - pytest.skip() - + pca = True tag = tag + fs + "c" ivas_br = "256000" dtx = "0" @@ -129,11 +124,11 @@ def test_bypass_enc( dtx, None, max_bw, - bypass, sba_order, update_ref, gain_flag, cut_testv=True, + pca=pca, ) # dec @@ -148,11 +143,11 @@ def test_bypass_enc( dtx, None, max_bw, - bypass, output_config, update_ref, gain_flag, keep_files, + pca=pca, ) @@ -197,7 +192,6 @@ def test_sba_enc_system( pytest.skip() tag = tag + fs + "c" max_bw = "FB" - bypass = -1 sba_order = "+1" output_config = "FOA" if gain_flag == 1: @@ -220,7 +214,6 @@ def test_sba_enc_system( dtx, SID, max_bw, - bypass, sba_order, update_ref, gain_flag, @@ -241,7 +234,6 @@ def test_sba_enc_system( dtx, SID, max_bw, - bypass, output_config, update_ref, gain_flag, @@ -271,7 +263,6 @@ def test_spar_hoa2_enc_system( tag = tag + fs + "c" max_bw = "FB" - bypass = -1 sba_order = "+2" output_config = "HOA2" @@ -289,7 +280,6 @@ def test_spar_hoa2_enc_system( dtx, None, max_bw, - bypass, sba_order, update_ref, gain_flag, @@ -307,7 +297,6 @@ def test_spar_hoa2_enc_system( dtx, None, max_bw, - bypass, output_config, update_ref, gain_flag, @@ -337,7 +326,6 @@ def test_spar_hoa3_enc_system( tag = tag + fs + "c" max_bw = "FB" - bypass = -1 sba_order = "+3" output_config = "HOA3" @@ -355,7 +343,6 @@ def test_spar_hoa3_enc_system( dtx, None, max_bw, - bypass, sba_order, update_ref, gain_flag, @@ -373,7 +360,6 @@ def test_spar_hoa3_enc_system( dtx, None, max_bw, - bypass, output_config, update_ref, gain_flag, @@ -411,7 +397,6 @@ def test_sba_enc_BWforce_system( fs = sample_rate_bw_idx[0] bw = sample_rate_bw_idx[1] tag = tag + fs + "c" - bypass = -1 gain_flag = -1 sba_order = "+1" output_config = "FOA" @@ -430,7 +415,6 @@ def test_sba_enc_BWforce_system( dtx, None, bw, - bypass, sba_order, update_ref, gain_flag, @@ -449,7 +433,6 @@ def test_sba_enc_BWforce_system( dtx, None, bw, - bypass, output_config, update_ref, gain_flag, @@ -472,13 +455,13 @@ def sba_enc( dtx, SID, ivas_max_bw, - bypass, sba_order, update_ref, gain_flag, cut_gain="1.0", create_dutenc=False, cut_testv=False, + pca=False, ): # ------------ run cmd ------------ dut_out_dir = f"{dut_base_path}/sba_bs/pkt" @@ -499,18 +482,16 @@ def sba_enc( if ivas_br == "sw_24k4_256k.bin": ivas_br = f"{br_switch_file_path}/sw_24k4_256k.bin" short_tag_ext = "" - if gain_flag == 1: + if gain_flag != -1: short_tag_ext += f"_Gain{gain_flag}" if SID == 1: short_tag_ext += f"_SID" - # we update only bypass = 0/2 (bypass 1 is the same as the baseline) - if bypass in [0, 2]: - short_tag_ext += f"_pca{bypass}" + if pca: + short_tag_ext += f"_pca" # to avoid conflicting names in case of parallel test execution, differentiate all cases - if gain_flag == 1: - long_tag_ext = f"_Gain{gain_flag}" - else: - long_tag_ext = f"_pca{bypass}" + long_tag_ext = "" + if gain_flag != -1: + long_tag_ext += f"_Gain{gain_flag}" if SID == 1: long_tag_ext += f"_SID" dut_pkt_file = f"{dut_out_dir}/{tag_out}{long_tag_ext}.pkt" @@ -523,7 +504,6 @@ def sba_enc( f"{ref_out_dir}/{tag_out}{short_tag_ext}_dutenc_cut.pkt" ) input_path = f"{test_vector_path}/{tag_in}{in_extension}" - bypass_mode = bypass if bypass >= 0 else None dtx_mode = dtx == "1" if cut_testv: @@ -557,7 +537,7 @@ def sba_enc( ref_pkt_file, sba_order=sba_order, max_band=ivas_max_bw, - bypass_mode=bypass_mode, + pca=pca, dtx_mode=dtx_mode, ) if create_dutenc: @@ -569,7 +549,7 @@ def sba_enc( ref_pkt_file_dutenc, sba_order=sba_order, max_band=ivas_max_bw, - bypass_mode=bypass_mode, + pca=pca, dtx_mode=dtx_mode, ) @@ -582,7 +562,7 @@ def sba_enc( dut_pkt_file, sba_order=sba_order, max_band=ivas_max_bw, - bypass_mode=bypass_mode, + pca=pca, dtx_mode=dtx_mode, ) @@ -614,11 +594,11 @@ def sba_dec( dtx, SID, ivas_max_bw, - bypass, output_config, update_ref, gain_flag, keep_files, + pca=False, ): # -------- run cmd ------------ # sampling rate to BW mapping @@ -629,18 +609,16 @@ def sba_dec( tag_out = f"{tag}_ivasbr{ivas_br[:-3]}k_DTX{dtx}" short_tag_ext = "" - if gain_flag == 1: + if gain_flag != -1: short_tag_ext += f"_Gain{gain_flag}" - # we update only bypass = 0/2 (bypass 1 is the same as the baseline) - if bypass in [0, 2]: - short_tag_ext += f"_pca{bypass}" + if pca: + short_tag_ext += f"_pca" if SID == 1: short_tag_ext += f"_SID_cut" # to avoid conflicting names in case of parallel test execution, differentiate all cases - if gain_flag == 1: - long_tag_ext = f"_Gain{gain_flag}" - else: - long_tag_ext = f"_pca{bypass}" + long_tag_ext = "" + if gain_flag != -1: + long_tag_ext += f"_Gain{gain_flag}" if SID == 1: long_tag_ext += f"_SID_cut" dut_out_dir = f"{dut_base_path}/sba_bs/raw" diff --git a/tests/conftest.py b/tests/conftest.py index 3c6d18ceb339e677897d33aaedcf26ad5df29f13..e5851119822f29ddff5154079cd15e94e3ce313b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -223,7 +223,7 @@ class EncoderFrontend: sba_order: Optional[str] = None, dtx_mode: Optional[bool] = False, max_band: Optional[str] = None, - bypass_mode: Optional[int] = None, + pca: Optional[bool] = None, quiet_mode: Optional[bool] = True, add_option_list: Optional[list] = None, ) -> None: @@ -239,8 +239,8 @@ class EncoderFrontend: if max_band is not None: command.extend(["-max_band", max_band]) - if bypass_mode is not None: - command.extend(["-bypass", str(bypass_mode)]) + if pca: + command.extend(["-bypass", "2"]) if quiet_mode: command.extend(["-q"])