Loading lib_com/ivas_prot.h +1 −1 Original line number Diff line number Diff line Loading @@ -879,7 +879,7 @@ ivas_error ivas_ism_metadata_dec( int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ); Loading lib_dec/ivas_dec.c +2 −2 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ ivas_error ivas_dec( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->ism_dtx_hangover_cnt ), st_ivas->hDirAC->hParamIsm ); ivas_ism_metadata_dec( ivas_total_brate, &( 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 ); #else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); #endif Loading @@ -160,7 +160,7 @@ ivas_error ivas_dec( else /* ISM_MODE_DISC */ { #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->ism_dtx_hangover_cnt ), NULL ); ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL ); #else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ); #endif Loading lib_dec/ivas_ism_dtx_dec.c +19 −43 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ static void ivas_ism_preprocessing( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; #ifndef DISCRETE_ISM_DTX_CNG if ( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) #endif { /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; Loading @@ -77,10 +79,12 @@ static void ivas_ism_preprocessing( st->cng_paramISM_flag = 1; } #ifndef DISCRETE_ISM_DTX_CNG else { st->cng_paramISM_flag = 0; } #endif return; } Loading @@ -101,7 +105,7 @@ ivas_error ivas_ism_dtx_dec( int32_t ivas_total_brate; #ifdef DISCRETE_ISM_DTX_CNG int16_t md_diff_flag[MAX_NUM_OBJECTS]; int16_t flag_noisy_speech, sce_id; int16_t flag_noisy_speech, sce_id_dtx; #endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; Loading Loading @@ -159,30 +163,16 @@ ivas_error ivas_ism_dtx_dec( /* Metadata decoding and dequantization */ #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_sid_dec( st_ivas->hSCE, ivas_total_brate, st_ivas->bfi, num_obj, st_ivas->nchan_transport, st_ivas->ism_mode, &flag_noisy_speech, &sce_id, st_ivas->hIsmMetaData, nb_bits_metadata ); &flag_noisy_speech, &sce_id_dtx, st_ivas->hIsmMetaData, nb_bits_metadata ); if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) if ( st_ivas->hDirAC != NULL ) { st_ivas->hDirAC->hParamIsm->flag_noisy_speech = flag_noisy_speech; } } if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->hISMDTX.sce_id_dtx = sce_id; } else /* ism_mode == ISM_MODE_DISC */ { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { st_ivas->hSCE[ch]->hCoreCoder[0]->read_sid_info = 0; } st_ivas->hSCE[sce_id]->hCoreCoder[0]->read_sid_info = 1; } st_ivas->hISMDTX.sce_id_dtx = sce_id_dtx; } #else ivas_param_ism_metadata_dtx_dec( st_ivas ); Loading @@ -202,44 +192,30 @@ ivas_error ivas_ism_dtx_dec( update_last_metadata( st_ivas->nchan_transport, st_ivas->hIsmMetaData, md_diff_flag ); st_ivas->ism_dtx_hangover_cnt = 0; if ( st_ivas->ism_mode != ISM_MODE_PARAM ) // VE!!!!! { /* set core_brate for all channels */ for ( ch = 0; ch < num_obj; ch++ ) { st_ivas->hSCE[ch]->hCoreCoder[0]->core_brate = FRAME_NO_DATA; } if ( ivas_total_brate == IVAS_SID_5k2 ) { st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = SID_2k40; } } st_ivas->hISMDTX.ism_dtx_hangover_cnt = 0; #endif for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { #ifdef DISCRETE_ISM_DTX_CNG nb_bits_metadata[ch] = nb_bits_metadata[sce_id_dtx]; #else nb_bits_metadata[ch] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; #endif } #ifdef DISCRETE_ISM_DTX_CNG if ( !st_ivas->bfi ) #else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) #endif { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { ivas_ism_preprocessing( st_ivas, ch ); } } #ifdef DISCRETE_ISM_DTX_CNG else { for ( ch = 1; ch < st_ivas->nchan_transport; ch++ ) { nb_bits_metadata[ch] = nb_bits_metadata[0]; } } #endif return IVAS_ERR_OK; } Loading lib_dec/ivas_ism_metadata_dec.c +7 −7 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ ivas_error ivas_ism_metadata_dec( int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ) Loading Loading @@ -545,14 +545,14 @@ ivas_error ivas_ism_metadata_dec( } #ifdef DISCRETE_ISM_DTX_CNG if ( *ism_dtx_hangover_cnt < IVAS_ISM_DTX_HO_MAX ) if ( hISMDTX.ism_dtx_hangover_cnt < IVAS_ISM_DTX_HO_MAX ) { #ifdef MD_SMOOTH_PARAM_BE if ( ism_mode != ISM_MODE_PARAM ) #endif ism_metadata_smooth( hIsmMeta, ism_total_brate, num_obj ); } *ism_dtx_hangover_cnt = min( ( *ism_dtx_hangover_cnt )++, IVAS_ISM_DTX_HO_MAX ); hISMDTX.ism_dtx_hangover_cnt = min( ( hISMDTX.ism_dtx_hangover_cnt )++, IVAS_ISM_DTX_HO_MAX ); #endif /*----------------------------------------------------------------* Loading Loading @@ -668,7 +668,7 @@ ivas_error create_ism_metadata_dec( ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); #ifdef DISCRETE_ISM_DTX_CNG st_ivas->ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; st_ivas->hISMDTX.ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; #endif return IVAS_ERR_OK; Loading Loading @@ -797,9 +797,6 @@ ivas_error ivas_ism_metadata_sid_dec( if ( !bfi ) { /* take into account padding bits as metadata bits to keep later bitrate checks valid */ nb_bits_metadata[0] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; /*----------------------------------------------------------------* * ISm common signaling *----------------------------------------------------------------*/ Loading Loading @@ -948,6 +945,9 @@ ivas_error ivas_ism_metadata_sid_dec( } } /* take into account padding bits as metadata bits to keep later bitrate checks valid */ nb_bits_metadata[*sce_id_dtx] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; /* set the bitstream pointer to its original position */ st0->bit_stream = bstr_orig; st0->next_bit_pos = next_bit_pos_orig; Loading lib_dec/ivas_sce_dec.c +0 −17 Original line number Diff line number Diff line Loading @@ -82,23 +82,6 @@ ivas_error ivas_sce_dec( { st->cng_type = FD_CNG; /* TODO: move to init if possible */ } #ifdef DISCRETE_ISM_DTX_CNG // VE!!!!! if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC && st_ivas->nchan_transport > 1 ) // VE!!!!! keep bitexactness for 1ISM case for now { if ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) { /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; st->cng_paramISM_flag = 1; } else { st->cng_paramISM_flag = 0; } } #endif #endif /*------------------------------------------------------------------* Loading Loading
lib_com/ivas_prot.h +1 −1 Original line number Diff line number Diff line Loading @@ -879,7 +879,7 @@ ivas_error ivas_ism_metadata_dec( int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ); Loading
lib_dec/ivas_dec.c +2 −2 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ ivas_error ivas_dec( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->ism_dtx_hangover_cnt ), st_ivas->hDirAC->hParamIsm ); ivas_ism_metadata_dec( ivas_total_brate, &( 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 ); #else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hDirAC->hParamIsm ); #endif Loading @@ -160,7 +160,7 @@ ivas_error ivas_dec( else /* ISM_MODE_DISC */ { #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, &( st_ivas->ism_dtx_hangover_cnt ), NULL ); ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL ); #else ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ); #endif Loading
lib_dec/ivas_ism_dtx_dec.c +19 −43 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ static void ivas_ism_preprocessing( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; #ifndef DISCRETE_ISM_DTX_CNG if ( ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) ) #endif { /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; Loading @@ -77,10 +79,12 @@ static void ivas_ism_preprocessing( st->cng_paramISM_flag = 1; } #ifndef DISCRETE_ISM_DTX_CNG else { st->cng_paramISM_flag = 0; } #endif return; } Loading @@ -101,7 +105,7 @@ ivas_error ivas_ism_dtx_dec( int32_t ivas_total_brate; #ifdef DISCRETE_ISM_DTX_CNG int16_t md_diff_flag[MAX_NUM_OBJECTS]; int16_t flag_noisy_speech, sce_id; int16_t flag_noisy_speech, sce_id_dtx; #endif ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; Loading Loading @@ -159,30 +163,16 @@ ivas_error ivas_ism_dtx_dec( /* Metadata decoding and dequantization */ #ifdef DISCRETE_ISM_DTX_CNG ivas_ism_metadata_sid_dec( st_ivas->hSCE, ivas_total_brate, st_ivas->bfi, num_obj, st_ivas->nchan_transport, st_ivas->ism_mode, &flag_noisy_speech, &sce_id, st_ivas->hIsmMetaData, nb_bits_metadata ); &flag_noisy_speech, &sce_id_dtx, st_ivas->hIsmMetaData, nb_bits_metadata ); if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) if ( st_ivas->hDirAC != NULL ) { st_ivas->hDirAC->hParamIsm->flag_noisy_speech = flag_noisy_speech; } } if ( ivas_total_brate == IVAS_SID_5k2 && !st_ivas->bfi ) { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->hISMDTX.sce_id_dtx = sce_id; } else /* ism_mode == ISM_MODE_DISC */ { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { st_ivas->hSCE[ch]->hCoreCoder[0]->read_sid_info = 0; } st_ivas->hSCE[sce_id]->hCoreCoder[0]->read_sid_info = 1; } st_ivas->hISMDTX.sce_id_dtx = sce_id_dtx; } #else ivas_param_ism_metadata_dtx_dec( st_ivas ); Loading @@ -202,44 +192,30 @@ ivas_error ivas_ism_dtx_dec( update_last_metadata( st_ivas->nchan_transport, st_ivas->hIsmMetaData, md_diff_flag ); st_ivas->ism_dtx_hangover_cnt = 0; if ( st_ivas->ism_mode != ISM_MODE_PARAM ) // VE!!!!! { /* set core_brate for all channels */ for ( ch = 0; ch < num_obj; ch++ ) { st_ivas->hSCE[ch]->hCoreCoder[0]->core_brate = FRAME_NO_DATA; } if ( ivas_total_brate == IVAS_SID_5k2 ) { st_ivas->hSCE[0]->hCoreCoder[0]->core_brate = SID_2k40; } } st_ivas->hISMDTX.ism_dtx_hangover_cnt = 0; #endif for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { #ifdef DISCRETE_ISM_DTX_CNG nb_bits_metadata[ch] = nb_bits_metadata[sce_id_dtx]; #else nb_bits_metadata[ch] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; #endif } #ifdef DISCRETE_ISM_DTX_CNG if ( !st_ivas->bfi ) #else if ( st_ivas->ism_mode == ISM_MODE_PARAM ) #endif { for ( ch = 0; ch < st_ivas->nchan_transport; ch++ ) { ivas_ism_preprocessing( st_ivas, ch ); } } #ifdef DISCRETE_ISM_DTX_CNG else { for ( ch = 1; ch < st_ivas->nchan_transport; ch++ ) { nb_bits_metadata[ch] = nb_bits_metadata[0]; } } #endif return IVAS_ERR_OK; } Loading
lib_dec/ivas_ism_metadata_dec.c +7 −7 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ ivas_error ivas_ism_metadata_dec( int16_t nb_bits_metadata[], /* o : number of metadata bits */ ISM_MODE ism_mode, /* i : ISM mode */ #ifdef DISCRETE_ISM_DTX_CNG int16_t *ism_dtx_hangover_cnt, /* i/o: DTX hangover counter */ ISM_DTX_DATA_DEC hISMDTX, /* i/o: ISM DTX structure */ #endif const PARAM_ISM_CONFIG_HANDLE hParamIsm /* i : Param ISM Config Handle */ ) Loading Loading @@ -545,14 +545,14 @@ ivas_error ivas_ism_metadata_dec( } #ifdef DISCRETE_ISM_DTX_CNG if ( *ism_dtx_hangover_cnt < IVAS_ISM_DTX_HO_MAX ) if ( hISMDTX.ism_dtx_hangover_cnt < IVAS_ISM_DTX_HO_MAX ) { #ifdef MD_SMOOTH_PARAM_BE if ( ism_mode != ISM_MODE_PARAM ) #endif ism_metadata_smooth( hIsmMeta, ism_total_brate, num_obj ); } *ism_dtx_hangover_cnt = min( ( *ism_dtx_hangover_cnt )++, IVAS_ISM_DTX_HO_MAX ); hISMDTX.ism_dtx_hangover_cnt = min( ( hISMDTX.ism_dtx_hangover_cnt )++, IVAS_ISM_DTX_HO_MAX ); #endif /*----------------------------------------------------------------* Loading Loading @@ -668,7 +668,7 @@ ivas_error create_ism_metadata_dec( ivas_ism_config( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, NULL, NULL, element_brate_tmp, NULL, NULL ); #ifdef DISCRETE_ISM_DTX_CNG st_ivas->ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; st_ivas->hISMDTX.ism_dtx_hangover_cnt = IVAS_ISM_DTX_HO_MAX; #endif return IVAS_ERR_OK; Loading Loading @@ -797,9 +797,6 @@ ivas_error ivas_ism_metadata_sid_dec( if ( !bfi ) { /* take into account padding bits as metadata bits to keep later bitrate checks valid */ nb_bits_metadata[0] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; /*----------------------------------------------------------------* * ISm common signaling *----------------------------------------------------------------*/ Loading Loading @@ -948,6 +945,9 @@ ivas_error ivas_ism_metadata_sid_dec( } } /* take into account padding bits as metadata bits to keep later bitrate checks valid */ nb_bits_metadata[*sce_id_dtx] = ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC; /* set the bitstream pointer to its original position */ st0->bit_stream = bstr_orig; st0->next_bit_pos = next_bit_pos_orig; Loading
lib_dec/ivas_sce_dec.c +0 −17 Original line number Diff line number Diff line Loading @@ -82,23 +82,6 @@ ivas_error ivas_sce_dec( { st->cng_type = FD_CNG; /* TODO: move to init if possible */ } #ifdef DISCRETE_ISM_DTX_CNG // VE!!!!! if ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_DISC && st_ivas->nchan_transport > 1 ) // VE!!!!! keep bitexactness for 1ISM case for now { if ( ivas_total_brate == IVAS_SID_5k2 || ivas_total_brate == FRAME_NO_DATA ) { /* reset the bitstream to at least read the cng type and bandwidth for non transmitted SCE */ st->bit_stream = st_ivas->hSCE[0]->hCoreCoder[0]->bit_stream; st->cng_paramISM_flag = 1; } else { st->cng_paramISM_flag = 0; } } #endif #endif /*------------------------------------------------------------------* Loading