From 8b5159fb8f395fb8b31c55f0129032ef67570415 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 10 May 2023 15:37:39 +0200 Subject: [PATCH 01/30] remove outdated todos related to DTX thresholds --- lib_enc/lib_enc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 45d4c85683..823a22c31b 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -879,10 +879,9 @@ static ivas_error configureEncoder( } if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && - ( ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation - ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done - hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD - ) ) + ( ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation + ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || + hEncoderConfig->ivas_format == MC_FORMAT ) ) { return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } -- GitLab From d55dc76f9b5c99c68d5e624cae791514dfd612ae Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 10 May 2023 17:15:03 +0200 Subject: [PATCH 02/30] revision of ToDo comments --- apps/encoder.c | 2 +- apps/renderer.c | 2 +- lib_com/bitstream.c | 3 --- lib_com/ivas_cnst.h | 6 +++--- lib_com/ivas_pca_tools.c | 2 +- lib_dec/ivas_dec.c | 1 - lib_dec/ivas_ism_dtx_dec.c | 2 +- lib_dec/ivas_pca_dec.c | 4 ++-- lib_dec/ivas_spar_md_dec.c | 4 ++-- lib_enc/init_enc.c | 2 +- lib_enc/ivas_front_vad.c | 4 ++-- lib_enc/ivas_ism_enc.c | 9 ++------- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_spar_encoder.c | 3 +-- 14 files changed, 18 insertions(+), 28 deletions(-) diff --git a/apps/encoder.c b/apps/encoder.c index 7f6d6baa30..25a8b73107 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -1476,7 +1476,7 @@ static bool parseCmdlIVAS_enc( arg->inputFormatConfig.stereoToMonoDownmix = true; i++; } - else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // VE: should be renamed to "-pca" + else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // TODO: should be renamed to "-pca" { i++; if ( i < argc - 4 ) diff --git a/apps/renderer.c b/apps/renderer.c index 9045bbeaa0..24b5773493 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -965,7 +965,7 @@ int main( else { error = IVAS_REND_SetHeadRotation( hIvasRend, NULL, NULL ); - if ( ( error != IVAS_ERR_OK ) && ( error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) ) // VE: TBC + if ( error != IVAS_ERR_OK && error != IVAS_ERR_INVALID_OUTPUT_FORMAT ) { fprintf( stderr, "Error setting Head Rotation: %s\n", ivas_error_to_string( error ) ); exit( -1 ); diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 886509b5ac..1aae7c97ed 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -1839,9 +1839,6 @@ ivas_error preview_indices( break; case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; - /* temporary hack to make mode signaling work with the current 1-object ISM DTX: read padding bits */ - /* Todo: how to apply this here? maybe pt_stream += ... would work? */ - /* st->bit_stream += ( IVAS_SID_4k4 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; */ break; case SID_MULTICHANNEL: st_ivas->ivas_format = MC_FORMAT; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index c840fd3a83..8df7247021 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -865,7 +865,7 @@ typedef enum { /*----------------------------------------------------------------------------------* * General Parametric Coding Constants *----------------------------------------------------------------------------------*/ -// VE: this should be renamed to e.g. N_SPATIAL_SUBFRAMES + #define MAX_PARAM_SPATIAL_SUBFRAMES 4 /* Maximum number of subframes for parameteric spatial coding */ #define L_SPATIAL_SUBFR_48k (L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES) #ifdef FIX_355_REFACTOR_PARAMBIN_TO_5MS @@ -893,7 +893,7 @@ typedef enum { SBA_MODE_NONE, SBA_MODE_DIRAC, - SBA_MODE_SPAR, // VE: this is actually SBA_MODE_SPAR_DIRAC + SBA_MODE_SPAR, } SBA_MODE; @@ -1024,7 +1024,7 @@ typedef enum #define IVAS_SPAR_BR_TABLE_LEN 20 -/* TD decorr */ // VE: not all 16CH are currently supported -> t be revisited later +/* TD decorr */ // ToDo: not all 16CH are currently supported -> to be revisited later enum { IVAS_TD_DECORR_OUT_1CH = 1, diff --git a/lib_com/ivas_pca_tools.c b/lib_com/ivas_pca_tools.c index 63285dabb1..40322727af 100644 --- a/lib_com/ivas_pca_tools.c +++ b/lib_com/ivas_pca_tools.c @@ -645,7 +645,7 @@ static void norm_quat( norm_q = dotp( q, q, IVAS_PCA_INTERP ); - norm_q = inv_sqrt( norm_q ); // VE: TBV: possible division by 0 + norm_q = inv_sqrt( norm_q ); // TBV: possible division by 0 for ( i = 0; i < IVAS_PCA_INTERP; i++ ) { diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 68ce3c75fe..c12cbb7c6c 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -149,7 +149,6 @@ ivas_error ivas_dec( } else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - // VE: call ivas_ism_metadata_dec() with 'st_ivas' - TBD if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index 935db95eea..58ee829b24 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -192,7 +192,7 @@ ivas_error ivas_ism_dtx_dec( st->cng_ism_flag = 1; st->L_frame = min( st->L_frame, L_FRAME16k ); /* note: needed for switching from active frame with L_frame=640 to CNG in object with no SID */ #else - ivas_ism_preprocessing( st_ivas, ch ); // VE: after the acceptance of switches, replace the function call by its content + ivas_ism_preprocessing( st_ivas, ch ); #endif } } diff --git a/lib_dec/ivas_pca_dec.c b/lib_dec/ivas_pca_dec.c index 4444a73cee..a64e72615c 100644 --- a/lib_dec/ivas_pca_dec.c +++ b/lib_dec/ivas_pca_dec.c @@ -232,7 +232,7 @@ void ivas_pca_dec( mvr2r( &hPCA->mem_eigVec_interp[IVAS_PCA_N_SLOTS * 16], hPCA->mem_eigVec_interp, IVAS_PCA_DELAY_CMP * 16 ); - /* @@@TODO: check how ivas_total_brate is set if bfi == 1 */ // VE: and what happens in DTX where "ivas_total_brate" can be close to zero? + /* @@@TODO: check how ivas_total_brate is set if bfi == 1 */ // ToDo: and what happens in DTX where "ivas_total_brate" can be close to zero? /* handle bit rate switching */ if ( ivas_total_brate != PCA_BRATE || ( ivas_total_brate == PCA_BRATE && n_channels > FOA_CHANNELS ) ) @@ -240,7 +240,7 @@ void ivas_pca_dec( /* set PCA by-pass mode in current frame and interpolate transform as previous frame used PCA */ pca_dec_reset_dquat( ql, qr ); - // VE: todo - rather call PCA resets in the first PCA frame + // todo - rather call PCA resets in the first PCA frame if ( ( last_ivas_total_brate != PCA_BRATE ) || ( last_ivas_total_brate == PCA_BRATE && hPCA->prev_pca_bypass > 1 ) ) { diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 1552734434..51e3d4c77c 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -584,10 +584,10 @@ static ivas_error ivas_spar_set_dec_config( case 4: /* FOA_CHANNELS */ hMdDec->num_decorr = IVAS_TD_DECORR_OUT_3CH; break; - case 9: /* IVAS_HOA_2_CH */ // VE: is this relevant? + case 9: /* IVAS_HOA_2_CH */ // ToDo: is this relevant? hMdDec->num_decorr = IVAS_TD_DECORR_OUT_5CH; break; - case 16: /* IVAS_HOA_3_CH */ // VE: is this relevant? + case 16: /* IVAS_HOA_3_CH */ // ToDo: is this relevant? hMdDec->num_decorr = IVAS_TD_DECORR_OUT_12CH; break; case 6: /* IVAS_HOA_2_CH */ diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 9efd3c7f16..1dd7fd88ed 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -692,7 +692,7 @@ ivas_error init_encoder( * TCX core *-----------------------------------------------------------------*/ - // VE: reduction possible for MCT_CHAN_MODE_LFE channel - see I1-172 + // ToDo: reduction possible for MCT_CHAN_MODE_LFE channel - see I1-172 if ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) { if ( ( st->hTcxEnc = (TCX_ENC_HANDLE) malloc( sizeof( TCX_ENC_DATA ) ) ) == NULL ) diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 3810df1de9..9593f6682f 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -407,8 +407,8 @@ ivas_error front_vad_spar( mvr2r( st->old_wsp, old_wsp, L_WSP_MEM ); wsp = old_wsp + L_WSP_MEM; - st->core_brate = -1; /* updated in dtx() */ - st->input_bwidth = st->last_input_bwidth; // VE: TBD - this might be updated by actual detected BW + st->core_brate = -1; /* updated in dtx() */ + st->input_bwidth = st->last_input_bwidth; /*------------------------------------------------------------------* * compensate for SPAR filterbank delay diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 4a56252be8..55f63f89ab 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -222,16 +222,11 @@ ivas_error ivas_ism_enc( } else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - // VE: call ivas_ism_metadata_enc() with 'st_ivas' - TBD - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, - nchan_ism, - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); } else /* ISM_MODE_DISC */ { - ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, - nchan_ism, - st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); + ivas_ism_metadata_enc( st_ivas->hEncoderConfig->ivas_total_brate, nchan_ism, st_ivas->nchan_transport, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData, nb_bits_metadata, vad_flag, st_ivas->ism_mode, NULL, st_ivas->hEncoderConfig->ism_extended_metadata_flag ); } update_last_metadata( nchan_ism, st_ivas->hIsmMetaData, md_diff_flag ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 5b5363efb3..c582a91c19 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2023,7 +2023,7 @@ static uint8_t are_masa_subframes_similar( } } - /* TODO: a nicer negation */ // VE: ?? + /* TODO: a nicer negation */ if ( sf_differ ) { return FALSE; diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index b13bb4f20d..894c10a1d0 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -316,7 +316,7 @@ ivas_error ivas_spar_enc( error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; - // VE2DB: can hFbMixer->ppFilterbank_prior_input be replaced by st->input ? + // ToDo: can hFbMixer->ppFilterbank_prior_input be replaced by st->input ? /* check last sba_mode */ if ( ivas_sba_mode_select() == SBA_MODE_DIRAC ) @@ -339,7 +339,6 @@ ivas_error ivas_spar_enc( } /* update FB prior input */ - // VE: last 1ms of 'ppFilterbank_prior_input' is not correct for ( int16_t i = 0; i < st_ivas->nchan_transport; i++ ) { mvr2r( ( sts[i]->input_buff + NS2SA( hEncoderConfig->input_Fs, IVAS_FB_ENC_DELAY_NS ) ), -- GitLab From 3efd772543b198a565b10d1bfe416a62019def10 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 10 May 2023 17:50:51 +0200 Subject: [PATCH 03/30] revision of ToDo comments --- lib_com/bits_alloc.c | 4 ++-- lib_com/gs_bitallocation.c | 2 +- lib_com/ivas_cnst.h | 4 ++-- lib_com/ivas_pca_tools.c | 2 +- lib_dec/acelp_core_dec.c | 4 ++-- lib_dec/core_switching_dec.c | 2 +- lib_dec/dec_tcx.c | 4 ++-- lib_dec/gs_dec.c | 3 +-- lib_dec/ivas_binRenderer_internal.c | 2 +- lib_dec/ivas_init_dec.c | 2 +- lib_dec/ivas_stereo_icbwe_dec.c | 2 +- lib_dec/swb_bwe_dec.c | 6 +++--- lib_dec/swb_tbe_dec.c | 1 - lib_enc/core_switching_enc.c | 2 +- lib_enc/fd_cng_enc.c | 12 ++++++------ lib_enc/ivas_cpe_enc.c | 2 +- lib_rend/lib_rend.h | 2 +- lib_util/ism_file_writer.c | 1 - 18 files changed, 27 insertions(+), 30 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 5ae9cb84d0..56e523b392 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -737,7 +737,7 @@ ivas_error config_acelp1( } else /* L_frame == L_FRAME16k */ { - acelp_cfg->lsf_bits = 41; /* TBV: currently LSFQ @16kHz is not flexible (only 31/41 bits supported */ + acelp_cfg->lsf_bits = 41; } } @@ -1360,7 +1360,7 @@ ivas_error config_acelp1( acelp_cfg->ubits = acelp_cfg->lsf_bits - 46; acelp_cfg->lsf_bits = 46; } - else if ( acelp_cfg->lsf_bits > 42 && L_frame == L_FRAME ) /* TBV: verify maximum supported LSF Q bitbudget (for some reason 43 bits LSFQ decreases segSNR by 0.7 dB) */ + else if ( acelp_cfg->lsf_bits > 42 && L_frame == L_FRAME ) { acelp_cfg->ubits = acelp_cfg->lsf_bits - 42; acelp_cfg->lsf_bits = 42; diff --git a/lib_com/gs_bitallocation.c b/lib_com/gs_bitallocation.c index 7f7809428f..1e86ea04de 100644 --- a/lib_com/gs_bitallocation.c +++ b/lib_com/gs_bitallocation.c @@ -616,7 +616,7 @@ void bands_and_bit_alloc( * Complete the bit allocation per frequency band for 16kHz high brate mode *--------------------------------------------------------------------------*/ - if ( L_frame == L_FRAME16k && core_brate > ACELP_32k ) /* TBV if applicable */ + if ( L_frame == L_FRAME16k && core_brate > ACELP_32k ) /* TODO - TBV if applicable */ { for ( j = st_band; j < nb_bands; j++ ) { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 8df7247021..650f30c929 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -110,8 +110,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ - AUDIO_CONFIG_MASA1, /* MASA1 */ // TBV: seems not to be used - AUDIO_CONFIG_MASA2, /* MASA2 */ // TBV: seems not to be used + AUDIO_CONFIG_MASA1, /* MASA1 */ // TODO: seems not to be used + AUDIO_CONFIG_MASA2, /* MASA2 */ // TODO: seems not to be used AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; diff --git a/lib_com/ivas_pca_tools.c b/lib_com/ivas_pca_tools.c index 40322727af..a1f8efd629 100644 --- a/lib_com/ivas_pca_tools.c +++ b/lib_com/ivas_pca_tools.c @@ -645,7 +645,7 @@ static void norm_quat( norm_q = dotp( q, q, IVAS_PCA_INTERP ); - norm_q = inv_sqrt( norm_q ); // TBV: possible division by 0 + norm_q = inv_sqrt( norm_q ); // TODO: possible division by 0 for ( i = 0; i < IVAS_PCA_INTERP; i++ ) { diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index f7b7465028..b31c50e66b 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -627,7 +627,7 @@ ivas_error acelp_core_dec( config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); - if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) /* ISfm: why is this called again after above */ + if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); } @@ -1090,7 +1090,7 @@ ivas_error acelp_core_dec( * Formant post-filter *-----------------------------------------------------------------*/ - if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) /* VE2TV: TBV for TD stereo */ + if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) /* TODO: TBV for TD stereo */ { mvr2r( syn, temp_buf + L_SYN_MEM, L_FRAME16k ); diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 9ae8550e40..552f0ff988 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -374,7 +374,7 @@ ivas_error core_switching_pre_dec( st->gc_threshold = 0.0f; set_f( st->dispMem, 0, 8 ); - st->last_coder_type = GENERIC; /* fcs : this might be superfluous */ + st->last_coder_type = GENERIC; /* TODO - fcs : this might be superfluous */ fer_energy( output_frame, UNVOICED_CLAS, st->previoussynth, -1, &st->enr_old, 1 ); st->lp_gainp = 0.0f; diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 9896d1d8c0..8a574c95f6 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -1507,7 +1507,7 @@ void decoder_tcx_tns( if ( ( L_frame == st->L_frame >> 1 ) && st->tcxonly && isTCX5 ) { - if ( st->element_mode == EVS_MONO || L_spec < L_frameTCX ) /* TBC: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */ + if ( st->element_mode == EVS_MONO || L_spec < L_frameTCX ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */ { tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC ); } @@ -1742,7 +1742,7 @@ void decoder_tcx_imdct( if ( st->element_mode > EVS_MONO ) { - st->old_fpitchFB = st->old_fpitch * (float) L_frameTCX_glob / (float) L_frame_glob; /* TBV - or maybe used min(L_frame_TCX,L_FRAME48k) ... */ + st->old_fpitchFB = st->old_fpitch * (float) L_frameTCX_glob / (float) L_frame_glob; /* TODO - or maybe used min(L_frame_TCX,L_FRAME48k) ... */ } else { diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 2e7fb267ab..ff684b47d3 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -541,8 +541,7 @@ void gsc_dec( i++; } - if ( st->element_mode > EVS_MONO && coder_type == AUDIO && - st->core_brate <= STEREO_GSC_BIT_RATE_ALLOC && brate_intermed_tbl[i] == ACELP_9k60 ) /* Bit allocation should be mapped to 8 kb/s instead of 9.6 kb/s in this case */ + if ( st->element_mode > EVS_MONO && coder_type == AUDIO && st->core_brate <= STEREO_GSC_BIT_RATE_ALLOC && brate_intermed_tbl[i] == ACELP_9k60 ) /* Bit allocation is mapped to 8 kb/s instead of 9.6 kb/s in this case */ { i--; } diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 63372cd5ba..bf28c314cc 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -446,7 +446,7 @@ static void ivas_binaural_obtain_DMX( { int16_t chIdx, bandIdx, k; - // ToDo: hBinRenderer->ivas_format is never set to ISM_FORMAT -> TBV + // ToDo: hBinRenderer->ivas_format is never set to ISM_FORMAT if ( hBinRenderer->ivas_format == MC_FORMAT || hBinRenderer->ivas_format == ISM_FORMAT ) { /* Obtain the downmix */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index a58220a9b7..45dff5da5d 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -459,7 +459,7 @@ static ivas_error ivas_read_format( int16_t tc_mode_offset; tc_mode_offset = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); idx = st_ivas->bit_stream[tc_mode_offset]; - // TBD: needs more work for HOA + // TODO: needs more work for HOA if ( st_ivas->sba_analysis_order == 0 ) { st_ivas->sba_analysis_order = SBA_FOA_ORDER; diff --git a/lib_dec/ivas_stereo_icbwe_dec.c b/lib_dec/ivas_stereo_icbwe_dec.c index 78196eaaa8..13722f2b2a 100644 --- a/lib_dec/ivas_stereo_icbwe_dec.c +++ b/lib_dec/ivas_stereo_icbwe_dec.c @@ -739,7 +739,7 @@ void stereo_icBWE_decproc( { if ( hCPE->element_mode == IVAS_CPE_TD ) { - /* QC: TBV */ + /* QC: TODO - TBV */ v_add( output[0], hStereoICBWE->memOutHB[hStereoICBWE->prev_refChanIndx_bwe], output[0], memOffset ); v_add( output[1], hStereoICBWE->memOutHB[!hStereoICBWE->prev_refChanIndx_bwe], output[1], memOffset ); } diff --git a/lib_dec/swb_bwe_dec.c b/lib_dec/swb_bwe_dec.c index e7eda534ae..a89a17cca8 100644 --- a/lib_dec/swb_bwe_dec.c +++ b/lib_dec/swb_bwe_dec.c @@ -586,8 +586,8 @@ void swb_bwe_dec( if ( st->element_mode == IVAS_CPE_DFT && !use_cldfb_for_dft ) { - /* TBD - wtda() does not support L_FRAME length; thus temporarily resample the signal */ - /* TBV - delay output[] by 1.25ms ? */ + /* todo - wtda() does not support L_FRAME length; thus temporarily resample the signal */ + /* todo - delay output[] by 1.25ms ? */ lerp( output, ysynth, L_FRAME16k, st->L_frame ); /* windowing of the ACELP core synthesis */ @@ -734,7 +734,7 @@ void swb_bwe_dec( } else if ( frica_flag == 1 && hBWE_FD->prev_frica_flag == 0 ) { - /* IVAS_fmToDo: TBD - synth[] is @internal_Fs!!! */ + /* IVAS_fmToDo: synth[] is @internal_Fs!!! */ time_reduce_pre_echo( synth, hb_synth, hBWE_FD->prev_td_energy, l_subfr ); } else diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 79fe3b0e68..7ca3b64990 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -577,7 +577,6 @@ void swb_tbe_dec( set_f( GainShape, hBWE_TD->prev_GainShape, NUM_SHB_SUBFR ); } - /* this never happens */ mvr2r( hBWE_TD->lsp_prevfrm, lsf_shb, LPC_SHB_ORDER ); set_f( shb_res_gshape, 0.2f, NB_SUBFR16k ); } diff --git a/lib_enc/core_switching_enc.c b/lib_enc/core_switching_enc.c index ad52e197b9..2b16b49d46 100644 --- a/lib_enc/core_switching_enc.c +++ b/lib_enc/core_switching_enc.c @@ -258,7 +258,7 @@ void core_switching_pre_enc( /* reset BWE memories */ if ( st->hBWE_TD != NULL ) { - set_f( st->hBWE_FD->old_syn_12k8_16k, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_NS ) ); /* TBV: this might not be needed */ + set_f( st->hBWE_FD->old_syn_12k8_16k, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_NS ) ); /* TODO - TBV: this might not be needed */ } } diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index d71c24d45c..d7780d388c 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -1252,7 +1252,7 @@ void FdCngEncodeDiracMDCTStereoSID( for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { E[ch] = 0.0f; - for ( p = 0; p < NPART; p++ ) /* TBD Note: NPART should likely be N[ch] if N[ch] may change */ + for ( p = 0; p < NPART; p++ ) /* TODO Note: NPART should likely be N[ch] if N[ch] may change */ { ms_ptr[ch][p] = 10.f * log10f( lr_in_ptr[ch][p] + EPSILON ); E[ch] += ms_ptr[ch][p]; @@ -1260,9 +1260,9 @@ void FdCngEncodeDiracMDCTStereoSID( } /* M/S transform on log envelopes */ - convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ + convertToMS( NPART, ms_ptr[0], ms_ptr[1], 0.5f ); /* TODO Note: NPART should likely be N[0] if N[0] may change */ - E[0] = sum_f( ms_ptr[0], NPART ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ + E[0] = sum_f( ms_ptr[0], NPART ); /* TODO Note: NPART should likely be N[0] if N[0] may change */ /* Quantize M noise shape */ @@ -1298,7 +1298,7 @@ void FdCngEncodeDiracMDCTStereoSID( set_zero( ms_ptr[1], NPART ); /* compute M gain */ - gain[0] = sum_f( ms_ptr[0], NPART ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ + gain[0] = sum_f( ms_ptr[0], NPART ); /* TODO Note: NPART should likely be N[0] if N[0] may change */ gain[0] = ( E[0] - gain[0] ) / (float) N[0]; apply_scale( &gain[0], sts[0]->hFdCngEnc->hFdCngCom->CngBandwidth, sts[0]->hDtxEnc->last_active_brate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO ); @@ -1310,7 +1310,7 @@ void FdCngEncodeDiracMDCTStereoSID( gain[1] = gain[0]; /* undo M/S */ - convertToMS( NPART, ms_ptr[0], ms_ptr[1], 1.0f ); /* TBD Note: NPART should likely be N[0] if N[0] may change */ + convertToMS( NPART, ms_ptr[0], ms_ptr[1], 1.0f ); /* TODO Note: NPART should likely be N[0] if N[0] may change */ /* restore channel noise envelopes */ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) @@ -1318,7 +1318,7 @@ void FdCngEncodeDiracMDCTStereoSID( HANDLE_FD_CNG_ENC hFdCngEnc = sts[ch]->hFdCngEnc; HANDLE_FD_CNG_COM hFdCngCom = hFdCngEnc->hFdCngCom; - for ( p = 0; p < NPART; p++ ) /* TBD Note: NPART should likely be N[0] if N[0] may change */ + for ( p = 0; p < NPART; p++ ) /* TODO Note: NPART should likely be N[0] if N[0] may change */ { lr_out_ptr[ch][p] = powf( 10.f, ( ms_ptr[ch][p] + gain[ch] ) / 10.f ); } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index b60f8be45b..cff9de4615 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -274,7 +274,7 @@ ivas_error ivas_cpe_enc( } else { - /* note; "bits_frame_nominal" needed in TD stereo as well */ /* IVAS_fmToDo: is "bits_frame_nominal" set optimaly in TD stereo? */ + /* note; "bits_frame_nominal" needed in TD stereo as well */ stereo_dft_config( hCPE->hStereoDft == NULL ? NULL : hCPE->hStereoDft->hConfig, hCPE->element_brate, &sts[0]->bits_frame_nominal, &sts[1]->bits_frame_nominal ); } } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1e9d41fd38..2089af8315 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -143,7 +143,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for renderer output */ ); -/* Support for custom HRTFs will be added in the future. */ +/* ToDo: Support for custom HRTFs will be added in the future. */ /* Note: this affects output delay */ ivas_error IVAS_REND_SetCustomHrtf( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index b29386282b..5896a38aae 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -113,7 +113,6 @@ ivas_error IsmFileWriter_writeFrame( file = ismWriter->file; - /* IVAS_fmToDo: work in progress; currently position_azimuth, position_elevation, position_radius, spread, gain_factor */ #ifdef FIX_293_EXT_RENDERER_CLI sprintf( char_buff, "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch ); #endif -- GitLab From 3c8a15b942054b9520c659c6060a747ccaaf1ef2 Mon Sep 17 00:00:00 2001 From: torresjua <259-jtorr@users.noreply.gitlab.example.com> Date: Fri, 26 May 2023 03:37:55 +0000 Subject: [PATCH 04/30] Update lib_dec/ivas_stat_dec.h, lib_dec/ivas_init_dec.c, lib_dec/ivas_sba_dec.c, lib_dec/ivas_spar_md_dec.c, lib_enc/ivas_agc_enc.c, lib_enc/ivas_dirac_enc.c, lib_enc/ivas_lfe_enc.c, lib_enc/ivas_spar_encoder.c, lib_enc/ivas_spar_md_enc.c --- lib_dec/ivas_init_dec.c | 3 +-- lib_dec/ivas_sba_dec.c | 10 ++-------- lib_dec/ivas_spar_md_dec.c | 3 +-- lib_dec/ivas_stat_dec.h | 1 - lib_enc/ivas_agc_enc.c | 6 ++---- lib_enc/ivas_dirac_enc.c | 7 +------ lib_enc/ivas_lfe_enc.c | 1 - lib_enc/ivas_spar_encoder.c | 2 -- lib_enc/ivas_spar_md_enc.c | 2 +- 9 files changed, 8 insertions(+), 27 deletions(-) diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 45dff5da5d..6661d1d4c4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -458,8 +458,7 @@ static ivas_error ivas_read_format( { int16_t tc_mode_offset; tc_mode_offset = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 ); - idx = st_ivas->bit_stream[tc_mode_offset]; - // TODO: needs more work for HOA + idx = st_ivas->bit_stream[tc_mode_offset]; if ( st_ivas->sba_analysis_order == 0 ) { st_ivas->sba_analysis_order = SBA_FOA_ORDER; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index ec47273c64..c822560b9d 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -59,13 +59,7 @@ void ivas_sba_set_cna_cng_flag( { int16_t n, cpe_id; - if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->nchan_transport == 1 ) - { - /* skip as done in init function */ - /* st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 0; */ /* Todo: Check if these can be enabled */ - /* st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 0; */ - } - else if ( st_ivas->nchan_transport == 1 && ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) ) + if ( st_ivas->nchan_transport == 1 && ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) ) { st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 1; st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 1; @@ -74,7 +68,7 @@ void ivas_sba_set_cna_cng_flag( { for ( n = 0; n < CPE_CHANNELS; n++ ) { - st_ivas->hCPE[0]->hCoreCoder[n]->cna_dirac_flag = 0; /* Todo: Check if these can be enabled */ + st_ivas->hCPE[0]->hCoreCoder[n]->cna_dirac_flag = 0; st_ivas->hCPE[0]->hCoreCoder[n]->cng_sba_flag = 1; } } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 51e3d4c77c..1922387011 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -43,7 +43,6 @@ #include "wmc_auto.h" #include "ivas_stat_dec.h" -/*#define ENABLE_DITHER */ /* IVAS_fmToDo: development switch */ /*------------------------------------------------------------------------------------------* * Local constants @@ -584,7 +583,7 @@ static ivas_error ivas_spar_set_dec_config( case 4: /* FOA_CHANNELS */ hMdDec->num_decorr = IVAS_TD_DECORR_OUT_3CH; break; - case 9: /* IVAS_HOA_2_CH */ // ToDo: is this relevant? + case 9: /* IVAS_HOA_2_CH */ hMdDec->num_decorr = IVAS_TD_DECORR_OUT_5CH; break; case 16: /* IVAS_HOA_3_CH */ // ToDo: is this relevant? diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index ad453cd5bd..f661903c26 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -798,7 +798,6 @@ typedef struct ivas_spar_md_dec_state_t int16_t td_decorr_flag; int16_t spar_plc_enable_fadeout_flag; float ***mixer_mat; - /*TODO : reuse hFbMixer->prior_mixer for this as that buffer is unused in decoder with FB_HARMONIZATION*/ float mixer_mat_prev[MAX_PARAM_SPATIAL_SUBFRAMES + 1][IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH][IVAS_MAX_NUM_BANDS]; ivas_spar_md_com_cfg spar_md_cfg; ivas_arith_coeffs_t arith_coeffs; diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index 83dbdad1e1..641965e90a 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -454,8 +454,7 @@ void ivas_agc_enc_process( #ifdef DEBUG_AGC /* writing to a temporary bitstream file */ if ( ivas_agc_writeBits( agcOut, n_channels, pState ) ) - { - /* TODO: return error once error codes are harmonized */ + { IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "SPAR ENC AGC Failed to open agcOut\n " ); } #endif @@ -476,8 +475,7 @@ static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_ { if ( pState->gain_data[i].absGainExpCurr < 0 || pState->gain_data[i].absGainExpCurr >= (int16_t) pow( 2, pState->agc_com.betaE ) ) - { - /* TODO: return error once error codes are harmonized */ + { IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error Gain values to write!!\n\n" ); } diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 45ce09bb15..158b2afdb2 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -381,12 +381,7 @@ void ivas_dirac_enc( *nb_bits_metadata = hMetaData->nb_bits_tot; if ( Opt_DTX_ON ) - { - /* ToDo: If DIRAC_MIN_BITRATE_4_TRANS_CHAN is reached with DTX on (possible only with bitrate switching) - metadata is not quantized since it can be deduced at the decoder from transmitted TCs. - The solution would be to switch to active-only/ignore and resume DTX operation when switching back to a supported bitrate. - */ - + { if ( !( hQMetaData->no_directions == 1 && hQMetaData->numCodingBands == 5 ) ) { float orig_azi[DIRAC_MAX_NBANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index a14424774f..8faa4b1340 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -297,7 +297,6 @@ static void ivas_lfe_enc_quant( { if ( quant_strategy < ( num_quant_strategies - 1 ) ) { - /* reset all indices that were already written - TODO: maybe better store them temporarily first and write at the very end? */ for ( j = hBstr->next_ind - 1; j >= next_ind_pos; j-- ) { hBstr->ind_list[j].nb_bits = -1; diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 894c10a1d0..e8e562c086 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -316,8 +316,6 @@ ivas_error ivas_spar_enc( error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; - // ToDo: can hFbMixer->ppFilterbank_prior_input be replaced by st->input ? - /* check last sba_mode */ if ( ivas_sba_mode_select() == SBA_MODE_DIRAC ) { diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index cdfd6050ba..9373dcc342 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -560,7 +560,7 @@ ivas_error ivas_spar_md_enc_process( int16_t code_strat; int16_t bit_pos_start, next_ind_start, last_ind_start; BSTR_ENC_DATA hMetaData_tmp; - Indice ind_list_tmp[MAX_BITS_METADATA]; // IVAS_fmToDo: size to be optimized + Indice ind_list_tmp[MAX_BITS_METADATA]; float Wscale[IVAS_MAX_NUM_BANDS]; num_quant_strats = hMdEnc->spar_md_cfg.num_quant_strats; -- GitLab From 166cce22385d27c83d5e9f1fad776f8e58237519 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 30 May 2023 10:18:34 +0200 Subject: [PATCH 05/30] remove unnecessary TODO from ivas_masa_enc.c --- lib_enc/ivas_masa_enc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index e4972dd3a0..465468fdec 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2100,7 +2100,6 @@ static uint8_t are_masa_subframes_similar( } } - /* TODO: a nicer negation */ if ( sf_differ ) { return FALSE; -- GitLab From 2bc386f71c87f8267f1fa250f2dbc2f10fcc72f7 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 30 May 2023 10:29:31 +0200 Subject: [PATCH 06/30] remove unnecessary TODO from ivas_mcmasa_enc.c --- lib_enc/ivas_mcmasa_enc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index ec3a49956b..8fac2f323d 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -1240,10 +1240,10 @@ void ivas_mcmasa_param_est_enc( *--------------------------------------------------------------------------*/ void ivas_mcmasa_dmx_modify( - const int16_t n_samples, /* i : input frame length in samples */ - float dmx[][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )], /* i/o: downmix signal to be transformed into another format. TODO: buffer size into define? */ - const int16_t n_chnls_dmx_old, /* i : number of downmix channels in the old format */ - const int16_t n_chnls_dmx_new ) /* i : number of downmix channels in the target format */ + const int16_t n_samples, /* i : input frame length in samples */ + float dmx[][L_FRAME48k + NS2SA( 48000, IVAS_FB_ENC_DELAY_NS )], /* i/o: downmix signal to be transformed into another format */ + const int16_t n_chnls_dmx_old, /* i : number of downmix channels in the old format */ + const int16_t n_chnls_dmx_new ) /* i : number of downmix channels in the target format */ { /* assumed data ordering in **dmx: [sce][cpe_chnl0][cpe_chnl1], i.e., [c][l][r] */ int16_t i; -- GitLab From dabc98186fe4d7d8e620a24fed0863fa6efd4a41 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Tue, 30 May 2023 10:52:34 +0200 Subject: [PATCH 07/30] added a better comment to the functionality and removed a TODO from ivas_vbap.c --- lib_dec/ivas_vbap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index cda52c1aec..841f3df132 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -178,11 +178,13 @@ ivas_error vbap_init_data( push_wmops( "vbap_init" ); /* Basic init checks */ + /* If the requested layout is invalid, hVBAPdata is set to NULL and the signal will + * be distributed with an equal gain into all output channels. + * The surrounding code needs to handle the NULL pointer properly. */ if ( num_speaker_nodes > VBAP_MAX_NUM_SPEAKER_NODES || num_speaker_nodes < 3 ) { hVBAPdata = NULL; pop_wmops(); - /* TODO: are these two paths correct behaviour or should and error be returned ? */ return IVAS_ERR_OK; } -- GitLab From a6b814903593d2470eac886d108245de6f087098 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 31 May 2023 08:33:24 +0200 Subject: [PATCH 08/30] edit comments --- lib_dec/ivas_dirac_decorr_dec.c | 2 +- lib_dec/ivas_qmetadata_dec.c | 2 +- lib_enc/ivas_qmetadata_enc.c | 4 ++-- lib_enc/ivas_stereo_dft_enc.c | 2 +- lib_util/tinywaveout_c.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib_dec/ivas_dirac_decorr_dec.c b/lib_dec/ivas_dirac_decorr_dec.c index bcaa6cf2a1..8c19d9698b 100644 --- a/lib_dec/ivas_dirac_decorr_dec.c +++ b/lib_dec/ivas_dirac_decorr_dec.c @@ -156,7 +156,7 @@ ivas_error ivas_dirac_dec_decorr_open( freq_domain_decorr_ap_params->max_frequency = ( DIRAC_MAX_DECORR_CLDFB_BANDS * 24000 ) / CLDFB_NO_CHANNELS_MAX; } - freq_domain_decorr_ap_params->use_ducker = 1; /* fcs: fixed for now but can be adaptive in an extended version */ + freq_domain_decorr_ap_params->use_ducker = 1; /* ToDo: fcs: fixed for now but can be adaptive in an extended version */ assert( ( freq_domain_decorr_ap_params->max_frequency >= 0 ) && ( freq_domain_decorr_ap_params->max_frequency <= output_Fs / 2 ) && "Error: max_frequency invalid!" ); diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index cc7335c221..f6333ca944 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -2388,7 +2388,7 @@ static uint16_t ivas_qmetadata_DecodeQuasiUniform( uint16_t tresh, value; #ifdef DEBUGGING - assert( ( alphabet_size >= 1 ) ); /*fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ + assert( ( alphabet_size >= 1 ) ); /* ToDo: fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ #endif bits = 30 - norm_l( alphabet_size ); /* bits = floor(log2(alphabet_size)) */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 17ddbe3676..9a1b0c8625 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -2284,7 +2284,7 @@ static void ivas_qmetadata_encode_quasi_uniform( int16_t bits; uint16_t tresh; #ifdef DEBUGGING - assert( ( alphabet_size >= 1 ) ); /*fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ + assert( ( alphabet_size >= 1 ) ); /* ToDo: fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ assert( value < alphabet_size ); #endif @@ -2523,7 +2523,7 @@ static int16_t ivas_qmetadata_encode_quasi_uniform_length( int16_t bits; uint16_t tresh; #ifdef DEBUGGING - assert( ( alphabet_size >= 1 ) ); /*fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ + assert( ( alphabet_size >= 1 ) ); /* ToDo: fcs: to check if this additional conditon is really needed: && (alphabet_size <= (1U << 31) - 1));*/ assert( value < alphabet_size ); #endif diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c index dbc0662255..36e577b482 100644 --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -767,7 +767,7 @@ void stereo_dft_enc_analyze( { int16_t tmp[1024]; - /*fcs: stereo side info is only simulated */ + /* stereo side info is only simulated */ for ( i = 0; i < input_frame; i++ ) { tmp[i] = (int16_t) ( input[0][i] + 0.5f ); diff --git a/lib_util/tinywaveout_c.h b/lib_util/tinywaveout_c.h index b82c0cd131..393633a745 100644 --- a/lib_util/tinywaveout_c.h +++ b/lib_util/tinywaveout_c.h @@ -205,7 +205,7 @@ static WAVEFILEOUT *CreateBWF( wfch.blockAlignment = LittleEndian16( (int16_t) blockAlignment ); wfch.sampleRate = LittleEndian32( sampleRate ); wfch.bytesPerSecond = LittleEndian32( sampleRate * blockAlignment ); - /* tbd: wavfmt ext hdr here */ + /* ToDo: tbd: wavfmt ext hdr here */ /* write to file */ self->fmtChunkOffset = ByteCnt; ByteCnt += (uint32_t) fwrite( &wfch, 1, sizeof( wfch ), self->theFile ); -- GitLab From e58803b4dff819c807ff4a5275bf5543851c868e Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Wed, 31 May 2023 09:01:29 +0200 Subject: [PATCH 09/30] Remove TODOs that are no longer relevant --- lib_com/bitstream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 37bdcd1626..b6b68cf02b 100755 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -3067,7 +3067,7 @@ ivas_error read_indices( file_read_FECpattern( &st_ivas->bfi ); st_ivas->bfi |= bfi; - if ( bfi == FRAMEMODE_MISSING ) /* TODO(mcjbm): This fixes channel-aware mode BE. Still requires review from a bitstream reading expert */ + if ( bfi == FRAMEMODE_MISSING ) { for ( k = 0; k < num_bits; k++ ) { @@ -3233,7 +3233,7 @@ ivas_error read_indices( /* handle bad/lost speech frame(and CS bad SID frame) in the decoders CNG synthesis settings pair (total_brate, bfi) */ if ( ( - bfi != FRAMEMODE_FUTURE && /* TODO(mcjbm): This fixes channel-aware mode BE. Still requires review from a bitstream reading expert */ + bfi != FRAMEMODE_FUTURE && ( *CNG != 0 ) && ( ( speech_bad != 0 ) || ( speech_lost != 0 ) ) ) || /* SP_BAD or SPEECH_LOST) --> stay in CNG */ ( sid_upd_bad != 0 ) ) /* SID_UPD_BAD --> start CNG */ { @@ -3277,7 +3277,7 @@ ivas_error read_indices( } /* GOOD frame */ - if ( st_ivas->bfi == 0 || st_ivas->bfi == FRAMEMODE_FUTURE /* TODO(mcjbm): This fixes channel-aware mode BE. Still requires review from a bitstream reading expert */ + if ( st_ivas->bfi == 0 || st_ivas->bfi == FRAMEMODE_FUTURE ) { /* GOOD frame - convert ITU-T G.192 words to short values */ -- GitLab From 716cbe90ceb7bc6d634ba62c91028c9f226aef7a Mon Sep 17 00:00:00 2001 From: emerit Date: Wed, 31 May 2023 09:23:08 +0200 Subject: [PATCH 10/30] FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER --- apps/renderer.c | 6 +++++- lib_com/options.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/renderer.c b/apps/renderer.c index 10a5bc38bb..5270931a51 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -147,7 +147,7 @@ typedef struct bool sceneDescriptionInput; float inputGainGlobal; /* Linear gain (not in dB) */ bool lfePanningEnabled; - float lfeConfigGain; /* Linear gain (not in dB) */ + float lfeConfigGain; /* Linear gain (not in dB) */ float lfeConfigAzimuth; float lfeConfigElevation; bool lfeCustomRoutingEnabled; @@ -242,7 +242,11 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_nonDiegeticPan, .match = "non_diegetic_pan", .matchShort = "ndp", +#ifdef FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER + .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n", +#else .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n(todo: implementation)", +#endif }, { .id = CmdLnOptionId_orientationTracking, diff --git a/lib_com/options.h b/lib_com/options.h index c0f9011de9..0a0d354242 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -227,6 +227,7 @@ #define FIX_509 /* FhG: fix issue 509, too low number of bitsream indices in SBA */ +#define FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER /* ..\apps\renderer.c(240): .... (todo: implementation)",*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab From 96ec6b8f79f26e0da91f6a3c2ee5bba025761f49 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Wed, 31 May 2023 10:05:47 +0200 Subject: [PATCH 11/30] Remove irrelevant TODO comment --- lib_rend/lib_rend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index cd4f16aaa7..a96715277f 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5509,7 +5509,6 @@ static void renderMasaToMc( copyBufferTo2dArray( masaInput->base.inputBuffer, tmpBuffer ); copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hDirAC ); - /* TODO(sgi): Remove code duplication w.r.t. MASA rendering to other output configs */ if ( masaInput->decDummy->renderer_type == RENDERER_STEREO_PARAMETRIC ) { ivas_dirac_dec_binaural( masaInput->decDummy, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); -- GitLab From 398f61004ed6a0ffd6826a489eaee362dcd5035d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 31 May 2023 10:46:01 +0200 Subject: [PATCH 12/30] Removed obsolete todo comment --- lib_rend/ivas_objectRenderer_hrFilt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6a2bf00278..6463261ec4 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -79,7 +79,7 @@ ivas_error TDREND_REND_RenderSourceHRFilt( v_add( LeftOutputFrame, output_buf[0], output_buf[0], subframe_length ); v_add( RightOutputFrame, output_buf[1], output_buf[1], subframe_length ); - Src_p->InputFrame_p += subframe_length; /* Increment input pointer -- todo: should we remove this and input the current subframe instead? */ + Src_p->InputFrame_p += subframe_length; /* Increment input pointer */ return IVAS_ERR_OK; -- GitLab From f642891df75e6b0acca7b67776391e084d7267d4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 31 May 2023 11:53:37 +0200 Subject: [PATCH 13/30] reintroduce code lost during merging --- lib_dec/ivas_sba_dec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index f07ae40d90..478749ddc0 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -64,6 +64,12 @@ void ivas_sba_set_cna_cng_flag( #else if ( st_ivas->sba_mode == SBA_MODE_SPAR && st_ivas->nchan_transport == 1 ) #endif + { + /* skip as done in init function */ + /* st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 0; */ + /* st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 0; */ + } + else if ( st_ivas->nchan_transport == 1 && ( ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) ) ) { st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 1; st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 1; -- GitLab From 03baeb88bc8d7f5efc112367568e0d2119f6e05b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 12:04:42 +0200 Subject: [PATCH 14/30] address MC binaural renderer allocation related comment --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index a96715277f..dea8b48d75 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1812,7 +1812,7 @@ static ivas_error initMcBinauralRendering( outSampleRate = *inputMc->base.ctx.pOutSampleRate; - /* TODO tmu : needs review allocate both renderers; needed if headrotation is toggled so the renderer can be switched */ + /* Needs optimization, see issue 513 */ // bool initTDRend; // initTDRend = false; // if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) -- GitLab From dc7e1a3a51ae4d5267ad37fa762e42b393745c3d Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 31 May 2023 12:20:07 +0200 Subject: [PATCH 15/30] remove comments that are outdated or handled in tickets --- lib_com/stl.h | 2 +- lib_dec/ivas_dec.c | 4 ++-- lib_dec/ivas_ism_dtx_dec.c | 1 - lib_dec/ivas_ism_metadata_dec.c | 1 - lib_dec/ivas_jbm_dec.c | 6 +++--- lib_dec/ivas_pca_dec.c | 2 -- lib_dec/ivas_stat_dec.h | 2 +- lib_enc/evs_enc.c | 3 +-- lib_enc/ivas_enc.c | 2 +- lib_enc/lib_enc.c | 1 - 10 files changed, 9 insertions(+), 15 deletions(-) diff --git a/lib_com/stl.h b/lib_com/stl.h index 234aec9e16..c9ca422806 100644 --- a/lib_com/stl.h +++ b/lib_com/stl.h @@ -57,7 +57,7 @@ #ifndef _STL_H #define _STL_H -#include "options.h" /* TODO: TEMPORARY during BASOP development - to be removed */ +#include "options.h" /* note: needed until BASOP_NOGLOB is accepted */ #include "typedef.h" #include "basop32.h" #include "move.h" diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 59856cfb8e..82f03fdb3b 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -57,8 +57,8 @@ ivas_error ivas_dec( ) { int16_t n, output_frame, nchan_out; - Decoder_State *st; /* used for bitstream handling */ - float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ /* IVAS_fmToDo: buffer can be allocated dynamically based on the actual number of output channels */ + Decoder_State *st; /* used for bitstream handling */ + float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ int16_t nchan_remapped; float output_lfe_ch[L_FRAME48k]; int16_t nb_bits_metadata[MAX_SCE]; diff --git a/lib_dec/ivas_ism_dtx_dec.c b/lib_dec/ivas_ism_dtx_dec.c index 6dd301f161..054603a15e 100644 --- a/lib_dec/ivas_ism_dtx_dec.c +++ b/lib_dec/ivas_ism_dtx_dec.c @@ -80,7 +80,6 @@ ivas_error ivas_ism_dtx_dec( if ( nchan_ism != nchan_ism_prev ) { - /* IVAS_fmToDo: more work needed when the number of transported objects is not constant */ return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index e269d1e604..a39c496ab6 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -219,7 +219,6 @@ ivas_error ivas_ism_metadata_dec( if ( *nchan_transport != nchan_transport_prev ) { - /* IVAS_fmToDo: more work needed when the number of transported objects is not constant */ return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong number of objects signalled!" ); } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 987c55f221..04ae490414 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -69,8 +69,8 @@ ivas_error ivas_jbm_dec_tc( ) { int16_t n, output_frame, nchan_out; - Decoder_State *st; /* used for bitstream handling */ - float output[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* 'float' buffer for transport channels, MAX_TRANSPORT_CHANNELS channels */ /* IVAS_fmToDo: buffer can be allocated dynamically based on the actual number of output channels */ + Decoder_State *st; /* used for bitstream handling */ + float output[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* 'float' buffer for transport channels, MAX_TRANSPORT_CHANNELS channels */ int16_t nchan_remapped, hodirac_flag; float output_lfe_ch[L_FRAME48k]; int16_t nb_bits_metadata[MAX_SCE]; @@ -641,7 +641,7 @@ ivas_error ivas_jbm_dec_render( { int16_t n, nchan_out; int16_t nchan_transport; - float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ /* IVAS_fmToDo: buffer can be allocated dynamically based on the actual number of output channels */ + float output[MAX_OUTPUT_CHANNELS][L_FRAME48k]; /* 'float' buffer for output synthesis, MAX_OUTPUT_CHANNELS channels */ int16_t nchan_remapped; int32_t output_Fs; AUDIO_CONFIG output_config; diff --git a/lib_dec/ivas_pca_dec.c b/lib_dec/ivas_pca_dec.c index a64e72615c..e73b3aa1d6 100644 --- a/lib_dec/ivas_pca_dec.c +++ b/lib_dec/ivas_pca_dec.c @@ -240,8 +240,6 @@ void ivas_pca_dec( /* set PCA by-pass mode in current frame and interpolate transform as previous frame used PCA */ pca_dec_reset_dquat( ql, qr ); - // todo - rather call PCA resets in the first PCA frame - if ( ( last_ivas_total_brate != PCA_BRATE ) || ( last_ivas_total_brate == PCA_BRATE && hPCA->prev_pca_bypass > 1 ) ) { pca_dec_reset_mem_eigvec( hPCA ); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 7c6a452fcd..cd565f3eae 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1285,7 +1285,7 @@ typedef struct Decoder_Struct int16_t ini_active_frame; /* initialization active frames counter */ int16_t bfi; /* FEC - bad frame indicator */ - int16_t BER_detect; /* BER detect flag */ /* IVAS_fmToDo: eventually replace hCoreCoder->BER_detect by a pointer to ease the updating of this main parameter */ + int16_t BER_detect; /* BER detect flag */ uint16_t *bit_stream; /* Pointer to bitstream buffer */ int16_t writeFECoffset; /* parameter for debugging JBM stuff */ diff --git a/lib_enc/evs_enc.c b/lib_enc/evs_enc.c index c45bb444f3..8a0a92c76a 100644 --- a/lib_enc/evs_enc.c +++ b/lib_enc/evs_enc.c @@ -264,8 +264,7 @@ ivas_error evs_enc( core_switching_post_enc( st, old_inp_12k8, old_inp_16k, A ); -#if !defined( FIX_I4_OL_PITCH ) - /* ToDo: this is a hack to keep bitexactness wrt. EVS but the logic is wrong */ +#ifndef FIX_I4_OL_PITCH if ( st->core == HQ_CORE ) { mvs2s( pitch_orig, st->pitch, 3 ); /* original open-loop pitch values might be altered in core_acelp_tcx20_switching() */ diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 64ed5c9c02..89a97ea0b0 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -62,7 +62,7 @@ ivas_error ivas_enc( BSTR_ENC_HANDLE hMetaData; Encoder_State *st; /* used for bitstream handling */ int16_t nb_bits_metadata[MAX_SCE]; - float data_f[MAX_INPUT_CHANNELS][L_FRAME48k]; /* IVAS_fmToDo: buffer can be allocated dynamically based on the number of analysed channels */ + float data_f[MAX_INPUT_CHANNELS][L_FRAME48k]; int32_t ivas_total_brate; ivas_error error; error = IVAS_ERR_OK; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 4f0eefeb51..37c3e57ab5 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1296,7 +1296,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( * Main function to encode one frame to a compact bitstream (bytestream) *---------------------------------------------------------------------*/ -/* IVAS_fmToDo: Currently unused and untested */ ivas_error IVAS_ENC_EncodeFrameToCompact( IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ int16_t *inputBuffer, /* i : PCM input */ -- GitLab From 1050d2a911f85f7dcfbf7364cfdd13fef5f8cb54 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 12:21:39 +0200 Subject: [PATCH 16/30] remove comments related to existing issue #194 --- lib_rend/lib_rend.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index dea8b48d75..a85e4be3f1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4871,7 +4871,6 @@ static ivas_error renderMcToBinaural( accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); - /* TODO tmu : needs delay compensation */ if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) { return error; @@ -4955,7 +4954,6 @@ static ivas_error renderMcToBinauralRoom( accumulate2dArrayToBuffer( tmpRendBuffer, &outAudio ); - /* TODO tmu : needs delay compensation */ if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) { return error; @@ -5042,7 +5040,6 @@ static ivas_error renderMcCustomLsToBinauralRoom( accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); - /* TODO tmu : needs delay compensation */ if ( ( error = renderLfeToBinaural( mcInput, outAudio ) ) != IVAS_ERR_OK ) { return error; -- GitLab From f316ee0405278d11e0d7017ffe8b5fc947fb4b46 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 12:23:03 +0200 Subject: [PATCH 17/30] remove comment related to existing issue #314 --- lib_rend/lib_rend.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index be52e7a7f1..33cbd78f56 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -145,7 +145,6 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for renderer output */ ); -/* ToDo: Support for custom HRTFs will be added in the future. */ /* Note: this affects output delay */ ivas_error IVAS_REND_SetCustomHrtf( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ -- GitLab From 80849a0ca6b3f0c0eb04653a1d8f57a37a690d2b Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 31 May 2023 12:34:41 +0200 Subject: [PATCH 18/30] remove TODO comment that does not need to be addressed --- lib_dec/core_switching_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 552f0ff988..e70b1d59d7 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -374,7 +374,7 @@ ivas_error core_switching_pre_dec( st->gc_threshold = 0.0f; set_f( st->dispMem, 0, 8 ); - st->last_coder_type = GENERIC; /* TODO - fcs : this might be superfluous */ + st->last_coder_type = GENERIC; fer_energy( output_frame, UNVOICED_CLAS, st->previoussynth, -1, &st->enr_old, 1 ); st->lp_gainp = 0.0f; -- GitLab From 9f85f1e1562511a54a1b2245f6ddc42b8988b176 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 13:22:10 +0200 Subject: [PATCH 19/30] remove redundant comment for Crend refactoring --- lib_rend/ivas_crend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 76af4a17c8..8a013bc715 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -1090,7 +1090,6 @@ ivas_error ivas_rend_openCrend( HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ) { - /* TODO tmu : Based on ivas_crend_open() - could be harmonized / refactored */ int16_t i, subframe_length; int16_t max_total_ir_len; HRTFS_HANDLE hHrtf; -- GitLab From ccf5d2e67bbf8cfdc8c4468a00de99e070c56f64 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 13:33:47 +0200 Subject: [PATCH 20/30] change a TODO to a note about multiple LFE support --- lib_dec/ivas_binRenderer_internal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 33be8bf7db..d4bd43f544 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -151,14 +151,15 @@ static ivas_error ivas_binRenderer_convModuleOpen( if ( !isLoudspeaker ) { #ifdef UPDATE_SBA_FILTER - hBinRenderer->nInChannels = audioCfg2channels( input_config ); // TODO maybe an audioCfg2channels_woLFE() function? Works as long as only 1 LFE is present + hBinRenderer->nInChannels = audioCfg2channels( input_config ); #else hBinRenderer->nInChannels = 16; #endif } else { - hBinRenderer->nInChannels = ( audioCfg2channels( input_config ) - isLoudspeaker ); // TODO maybe an audioCfg2channels_woLFE() function? Works as long as only 1 LFE is present + /* Note: needs to be revisited if multiple LFE support is required */ + hBinRenderer->nInChannels = ( audioCfg2channels( input_config ) - isLoudspeaker ); } if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && hRenderConfig->roomAcoustics.use_brir ) -- GitLab From b130f851abca50d3fbeba8bb1f958e32a64ec4cd Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Wed, 31 May 2023 13:54:01 +0200 Subject: [PATCH 21/30] remove comment as no action will be taken for it --- lib_dec/ivas_stereo_switching_dec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 88d82ac17b..013cc24660 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -1545,7 +1545,6 @@ void stereo_switching_dec( mvr2r( sts[0]->hHQ_core->old_out, sts[1]->hHQ_core->old_out, L_FRAME48k ); mvr2r( sts[0]->delay_buf_out, sts[1]->delay_buf_out, HQ_DELTA_MAX * HQ_DELAY_COMP ); mvr2r( sts[0]->hTcxDec->old_syn_Overl, sts[1]->hTcxDec->old_syn_Overl, 256 ); - /* Todo: apply panning to buffers instead of simply using dmx in left and right channel */ } } else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT ) -- GitLab From 3b377404722d29ba5a6d61c97d51ee7c59efa59b Mon Sep 17 00:00:00 2001 From: Jonas Sv Date: Wed, 31 May 2023 15:12:13 +0200 Subject: [PATCH 22/30] removed irrelevant PVQ getK() comments --- lib_com/rom_com.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index e4b8ec9db9..800362b576 100755 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -15684,11 +15684,7 @@ const float finegain_4[16] = {-1.3234321f, -1.1164439f, -0.9153915f, -0.7248241f const float finegain_5[32] = {-1.3099370f, -1.1532731f, -0.9939113f, -0.8627403f, -0.7693628f, -0.6901322f, -0.6188556f, -0.5438313f, -0.4899869f, -0.4145289f, -0.3440915f, -0.2936875f, -0.2241453f, -0.1636186f, -0.1052746f, -0.0292431f, 0.0273763f, 0.0848355f, 0.1443042f, 0.2095194f, 0.2794882f, 0.3366661f, 0.4131591f, 0.4740591f, 0.5545165f, 0.6196313f, 0.6719442f, 0.7650533f, 0.9012053f, 1.0432675f, 1.2264170f, 1.5085750f}; const float * const finegain[5] = { finegain_1, finegain_2, finegain_3, finegain_4, finegain_5 }; -/* getk(16,8)+ maxqKIind=40 --> KMAX=127 needs support , 32bit- saturates at dim=6 - getK(21,9)+ maxqKInd=64 --> KMAX=512, needs support , 32bit saturates at dim=5 - getK(TBD,TBD)+ maxqKInd=TBD --> KMAX=1024, needs support , 32bit saturates at dim~=4 - getK(TBD,TBD)+ maxqKInd=TBD --> KMAX=32767, needs support, 32bit saturates at dim =3 -*/ + const uint8_t hBitsMinus1_N01[2] = {1, 7}; const uint8_t hBitsMinus1_N02[65]= -- GitLab From 211a4e298d7aae8e997606c32b251d74da30a604 Mon Sep 17 00:00:00 2001 From: malenov Date: Wed, 31 May 2023 15:17:37 +0200 Subject: [PATCH 23/30] remove obsolete comments that were inserted when debugging the SWB_TBE@1k75 --- lib_dec/swb_tbe_dec.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 7ca3b64990..e4f211b2aa 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -1863,19 +1863,16 @@ static void dequantizeSHBparams( lsf_q[LATTICE_DIM + 1] = dotp( lsf_q, &LastCoefPred_1bit[2 * ( LATTICE_DIM + 1 ) * Idx_pred + LATTICE_DIM + 1], LATTICE_DIM ); } - /* !!! TODO: read empty bits - should be removed */ if ( nbits < NUM_BITS_SHB_MSLVQ ) { Idx_pred = get_next_indice( st, NUM_BITS_SHB_MSLVQ - nbits ); } - /* !!! end empty bits */ v_add( SHB_LSF_mean, lsf_q, lsf_q, LPC_SHB_ORDER ); v_sort( lsf_q, 0, LPC_SHB_ORDER - 1 ); } else { - /* !!!! this purposely reverts the inclusion of extl_brate == SWB_TBE_1k75 into the logic - remove this comment when this macro is deleted !!!!! */ if ( extl_brate == SWB_TBE_1k6 || extl_brate == FB_TBE_1k8 || extl_brate == SWB_TBE_2k8 || extl_brate == FB_TBE_3k0 ) { for ( i = 0; i < NUM_Q_LSF; i++ ) -- GitLab From 1f28fbecd46ecf989bf7ab2d69ebefa352789e77 Mon Sep 17 00:00:00 2001 From: malenov Date: Wed, 31 May 2023 15:24:10 +0200 Subject: [PATCH 24/30] remove obsolete comment - the deallocation of all PPP structures is properly done at the end of ppp_voiced_encoder() --- lib_enc/voiced_enc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_enc/voiced_enc.c b/lib_enc/voiced_enc.c index b32692b983..18a3305902 100644 --- a/lib_enc/voiced_enc.c +++ b/lib_enc/voiced_enc.c @@ -498,7 +498,6 @@ ivas_error ppp_voiced_encoder( error = IVAS_ERR_OK; - /* TODO: deallocation missing */ if ( ( error = DTFS_new( &CURRP_NQ ) ) != IVAS_ERR_OK ) { IVAS_ERROR( error, "Error creating DTFS structure" ); -- GitLab From 42507cb244f8af9b534ab059d86d70c73b892040 Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Wed, 31 May 2023 09:38:47 -0400 Subject: [PATCH 25/30] remove obselete comment --- lib_dec/acelp_core_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 0904e75116..187f82a0cd 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -1079,7 +1079,7 @@ ivas_error acelp_core_dec( * Formant post-filter *-----------------------------------------------------------------*/ - if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) /* TODO: TBV for TD stereo */ + if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) { mvr2r( syn, temp_buf + L_SYN_MEM, L_FRAME16k ); -- GitLab From c6928e948b5827557de38b827a9101524b2fd3be Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Wed, 31 May 2023 09:40:54 -0400 Subject: [PATCH 26/30] remove obselete comment, for TD it is better the way it is now --- lib_dec/ivas_cpe_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 3717501c83..437f2b6f1a 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -292,7 +292,7 @@ ivas_error ivas_cpe_dec( } else { - /* subtract metadata bitbudget */ /* IVAS_fmToDo: TBC whether it is not better to distribute the metadata bits equally between 2 channels */ + /* subtract metadata bitbudget */ sts[0]->bits_frame_channel -= nb_bits_metadata; } } -- GitLab From 3ff1a0b499db8b5fba0ad2586829721f19b6ca21 Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Wed, 31 May 2023 09:49:32 -0400 Subject: [PATCH 27/30] remove obselete comment, keep the code as a safety if someone changes the behavior in a later stage --- lib_com/gs_bitallocation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/gs_bitallocation.c b/lib_com/gs_bitallocation.c index 1e86ea04de..d099c2200c 100644 --- a/lib_com/gs_bitallocation.c +++ b/lib_com/gs_bitallocation.c @@ -616,7 +616,7 @@ void bands_and_bit_alloc( * Complete the bit allocation per frequency band for 16kHz high brate mode *--------------------------------------------------------------------------*/ - if ( L_frame == L_FRAME16k && core_brate > ACELP_32k ) /* TODO - TBV if applicable */ + if ( L_frame == L_FRAME16k && core_brate > ACELP_32k ) { for ( j = st_band; j < nb_bands; j++ ) { -- GitLab From 22f8f1f91a78d8772d08ba960b3bf410ee0930af Mon Sep 17 00:00:00 2001 From: Auto Commit Date: Wed, 31 May 2023 10:10:07 -0400 Subject: [PATCH 28/30] fix clang --- lib_dec/acelp_core_dec.c | 2 +- lib_dec/ivas_cpe_dec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 187f82a0cd..eb2e84f598 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -1079,7 +1079,7 @@ ivas_error acelp_core_dec( * Formant post-filter *-----------------------------------------------------------------*/ - if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) + if ( st->hPFstat != NULL && st->last_bwidth >= WB && ( st->core_brate > ACELP_24k40 || st->element_mode > EVS_MONO ) && st->core_brate <= ACELP_32k ) { mvr2r( syn, temp_buf + L_SYN_MEM, L_FRAME16k ); diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 437f2b6f1a..6511bb1181 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -292,7 +292,7 @@ ivas_error ivas_cpe_dec( } else { - /* subtract metadata bitbudget */ + /* subtract metadata bitbudget */ sts[0]->bits_frame_channel -= nb_bits_metadata; } } -- GitLab From fc2b98989a665401563083317fcf7194bf3f916f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 31 May 2023 17:10:27 +0200 Subject: [PATCH 29/30] address comments related to 5ms rendering in external renderer --- lib_rend/lib_rend.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index a85e4be3f1..41f68b6520 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4390,7 +4390,6 @@ static ivas_error renderIsmToBinaural( copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); - /* TODO tmu : missing: interpolation between positions, 5ms rendering */ if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, @@ -4445,7 +4444,6 @@ static ivas_error renderIsmToBinauralRoom( { copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer ); - /* TODO tmu : missing: interpolation between positions, 5ms rendering */ if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, @@ -4478,9 +4476,9 @@ static ivas_error renderIsmToBinauralRoom( (void) subframe_len; // avoid warning } - /* TODO tmu : missing: interpolation between positions, 5ms rendering */ - /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ - /* TODO tmu2sgi: needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ + /* TODO tmu : see issue #518 */ + /* Possible optimization: less processing needed if position didn't change + * needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ /* previous position gains */ if ( headRotData->headRotEnabled ) { -- GitLab From 40a11f3a3ffc3d93824500652ab7a31c53154441 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Thu, 1 Jun 2023 10:25:26 +0200 Subject: [PATCH 30/30] remove obsolete code in cpe deallocation function, since LFE not part of CPE anymore (to do in issue 451) --- lib_com/options.h | 2 +- lib_dec/ivas_cpe_dec.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 011611ea16..47a2bbdad2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -228,7 +228,7 @@ #define FIX_509 /* FhG: fix issue 509, too low number of bitsream indices in SBA */ #define FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER /* ..\apps\renderer.c(240): .... (todo: implementation)",*/ - +#define REMOVE_OBS_CODE /* FhG: Remove unnecessary assignement after LFE cleanup (Issue #451)*/ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 6511bb1181..a19fb21dc2 100755 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -832,11 +832,13 @@ void destroy_cpe_dec( int16_t n; Decoder_State *st; +#ifndef REMOVE_OBS_CODE /* make sure we deallocate a potential distinct hTcxCfg for a MCT LFE channel (can only happen in rs) */ /*TODO Check this again with LFE clean up!*/ if ( hCPE->hCoreCoder[1] != NULL && hCPE->hCoreCoder[1]->hTcxCfg != hCPE->hCoreCoder[0]->hTcxCfg ) { hCPE->hCoreCoder[1]->mct_chan_mode = MCT_CHAN_MODE_IGNORE; } +#endif for ( n = 0; n < CPE_CHANNELS; n++ ) { -- GitLab