Loading .gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -1093,9 +1093,9 @@ check-first-frame-is-sid: - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA") - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo --timeout 10 || exit_code_hoa=$? - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA") - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo timeout 10 || exit_code_foa=$? - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo --timeout 10 || exit_code_foa=$? - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_foa -ne 0 ]; then exit 1; fi artifacts: paths: - out/logs Loading lib_com/ivas_stereo_td_bit_alloc.c +31 −0 Original line number Diff line number Diff line Loading @@ -456,17 +456,48 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } #else lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); #endif } else if ( flag_ACELP16k == 1 ) { #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #endif } else { #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); #endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ #define FIX_TDREND_HRTF_FILE_FORMAT_OR /* OR: highligth changes in FIX_TDREND_HRTF_FILE_FORMAT */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ /* #################### End BE switches ################################## */ Loading lib_enc/ivas_core_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -99,7 +99,11 @@ ivas_error ivas_core_enc( int16_t Voicing_flag[CPE_CHANNELS]; float pitch_buf[CPE_CHANNELS][NB_SUBFR16k]; int16_t unbits[CPE_CHANNELS]; #ifdef FIX_1111_TDM_LSP_BUFFER float tdm_lsfQ_PCh[M]; #else float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; #endif int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; int16_t diff_nBits; Loading Loading @@ -270,7 +274,11 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { #ifdef FIX_1111_TDM_LSP_BUFFER td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #else td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #endif } } Loading tests/cmp_pcm.py +18 −8 Original line number Diff line number Diff line Loading @@ -12,7 +12,16 @@ import pyaudio3dtools import pyivastest def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) -> (int, str): def cmp_pcm( file1, file2, out_config, fs, get_mld=False, allow_differing_lengths=False, mld_lim=0, abs_tol=0, ) -> (int, str): """ Compare 2 PCM files for bitexactness """ Loading @@ -22,24 +31,26 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) - out_config = "MONO" if out_config == "" else out_config # out_config may be a string or a Path. Wrap in str() to avoid error in case it is a Path. if str(out_config).upper() not in pyivastest.constants.OC_TO_NCHANNELS: out_config_in_file_names = os.path.splitext(os.path.basename(out_config))[0] nchannels = ( pyivastest.IvasScriptsCommon.IvasScript.get_n_channels_from_ls_layout( out_config ) ) else: out_config_in_file_names = out_config nchannels = pyivastest.constants.OC_TO_NCHANNELS[out_config.upper()] s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs, outdtype=np.int16) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs, outdtype=np.int16) nchannels = s1.shape[ 1 ] # In case of wav input, override the nchannels with the one from the wav header # In case of wav input, override the nchannels with the one from the wav header nchannels = s1.shape[1] if s1.shape != s2.shape: if allow_differing_lengths: # to allow for MLD comparison, shorten longer file min_len = min(s1.shape[0], s2.shape[0]) s1 = s1[:min_len, :] s2 = s2[:min_len, :] elif s1.shape != s2.shape: print( f"file size in samples: file 1 = {s1.shape[0]},", f"file 2 = {s2.shape[0]}", Loading @@ -54,7 +65,6 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) - s1, s2, fs, per_frame=False, get_mld=get_mld ) output_differs = 0 reason = "SUCCESS: Files are bitexact" Loading Loading
.gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -1093,9 +1093,9 @@ check-first-frame-is-sid: - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA") - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo --timeout 10 || exit_code_hoa=$? - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA") - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo timeout 10 || exit_code_foa=$? - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo --timeout 10 || exit_code_foa=$? - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_foa -ne 0 ]; then exit 1; fi artifacts: paths: - out/logs Loading
lib_com/ivas_stereo_td_bit_alloc.c +31 −0 Original line number Diff line number Diff line Loading @@ -456,17 +456,48 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } #else lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); #endif } else if ( flag_ACELP16k == 1 ) { #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #endif } else { #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); #endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ #define FIX_TDREND_HRTF_FILE_FORMAT_OR /* OR: highligth changes in FIX_TDREND_HRTF_FILE_FORMAT */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ /* #################### End BE switches ################################## */ Loading
lib_enc/ivas_core_enc.c +8 −0 Original line number Diff line number Diff line Loading @@ -99,7 +99,11 @@ ivas_error ivas_core_enc( int16_t Voicing_flag[CPE_CHANNELS]; float pitch_buf[CPE_CHANNELS][NB_SUBFR16k]; int16_t unbits[CPE_CHANNELS]; #ifdef FIX_1111_TDM_LSP_BUFFER float tdm_lsfQ_PCh[M]; #else float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; #endif int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; int16_t diff_nBits; Loading Loading @@ -270,7 +274,11 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { #ifdef FIX_1111_TDM_LSP_BUFFER td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #else td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #endif } } Loading
tests/cmp_pcm.py +18 −8 Original line number Diff line number Diff line Loading @@ -12,7 +12,16 @@ import pyaudio3dtools import pyivastest def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) -> (int, str): def cmp_pcm( file1, file2, out_config, fs, get_mld=False, allow_differing_lengths=False, mld_lim=0, abs_tol=0, ) -> (int, str): """ Compare 2 PCM files for bitexactness """ Loading @@ -22,24 +31,26 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) - out_config = "MONO" if out_config == "" else out_config # out_config may be a string or a Path. Wrap in str() to avoid error in case it is a Path. if str(out_config).upper() not in pyivastest.constants.OC_TO_NCHANNELS: out_config_in_file_names = os.path.splitext(os.path.basename(out_config))[0] nchannels = ( pyivastest.IvasScriptsCommon.IvasScript.get_n_channels_from_ls_layout( out_config ) ) else: out_config_in_file_names = out_config nchannels = pyivastest.constants.OC_TO_NCHANNELS[out_config.upper()] s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs, outdtype=np.int16) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs, outdtype=np.int16) nchannels = s1.shape[ 1 ] # In case of wav input, override the nchannels with the one from the wav header # In case of wav input, override the nchannels with the one from the wav header nchannels = s1.shape[1] if s1.shape != s2.shape: if allow_differing_lengths: # to allow for MLD comparison, shorten longer file min_len = min(s1.shape[0], s2.shape[0]) s1 = s1[:min_len, :] s2 = s2[:min_len, :] elif s1.shape != s2.shape: print( f"file size in samples: file 1 = {s1.shape[0]},", f"file 2 = {s2.shape[0]}", Loading @@ -54,7 +65,6 @@ def cmp_pcm(file1, file2, out_config, fs, get_mld=False, mld_lim=0, abs_tol=0) - s1, s2, fs, per_frame=False, get_mld=get_mld ) output_differs = 0 reason = "SUCCESS: Files are bitexact" Loading