Loading lib_com/ivas_cnst.h +11 −0 Original line number Diff line number Diff line Loading @@ -340,9 +340,20 @@ typedef enum #else #define PARAM_ISM_DTX_COH_SCA_BITS 4 #endif #if (defined DISCRETE_ISM_DTX_CNG && defined UNIFY_MD_QUANTIZER ) #define ISM_DTX_AZI_BITS_HIGH 8 #define ISM_DTX_ELE_BITS_HIGH 7 #define ISM_Q_STEP_HIGH (ISM_Q_STEP / 2) #define ISM_Q_STEP_BORDER_HIGH (ISM_Q_STEP_BORDER / 2) #define ISM_DTX_AZI_BITS_LOW 6 #define ISM_DTX_ELE_BITS_LOW 5 #define ISM_Q_STEP_LOW (ISM_Q_STEP * 2) #define ISM_Q_STEP_BORDER_LOW (ISM_Q_STEP_BORDER * 2) #else #define PARAM_ISM_DTX_AZI_BITS 5 #define PARAM_ISM_DTX_ELE_BITS 4 #endif #endif #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_ENER_BITS 4 #define ISM_DTX_COH_SCA_BITS 4 Loading lib_com/ivas_ism_config.c +84 −4 Original line number Diff line number Diff line Loading @@ -359,12 +359,36 @@ int16_t ism_quant_meta( const float val, /* i : scalar value to quantize */ float *valQ, /* o : quantized value */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ) { int16_t idx, idx_start; float qlow, step; #ifdef UNIFY_MD_QUANTIZER if ( val <= borders[1] ) { qlow = borders[0]; idx_start = 0; step = q_step_border; } else if ( val <= borders[2] ) { qlow = borders[1]; idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); step = q_step; } else { qlow = borders[2]; idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); step = q_step_border; } #else if ( val <= borders[1] ) { qlow = borders[0]; Loading @@ -383,6 +407,7 @@ int16_t ism_quant_meta( idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); step = ISM_Q_STEP_BORDER; } #endif idx = idx_start + (int16_t) max( 0.f, min( cbsize - 1, ( ( val - qlow ) / step + 0.5f ) ) ); *valQ = ( idx - idx_start ) * step + qlow; Loading @@ -401,12 +426,36 @@ int16_t ism_quant_meta( float ism_dequant_meta( const int16_t idx, /* i : quantizer index */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ) { int16_t idx_start; float qlow, step, valQ; #ifdef UNIFY_MD_QUANTIZER if ( idx <= ( borders[1] - borders[0] ) / q_step_border ) { qlow = borders[0]; idx_start = 0; step = q_step_border; } else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ) { qlow = borders[1]; idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); step = q_step; } else { qlow = borders[2]; idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); step = q_step_border; } #else if ( idx <= ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER ) { qlow = borders[0]; Loading @@ -425,6 +474,7 @@ float ism_dequant_meta( idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); step = ISM_Q_STEP_BORDER; } #endif valQ = ( idx - idx_start ) * step + qlow; Loading @@ -439,8 +489,7 @@ float ism_dequant_meta( * ---------------------------------------------------------------*/ void ivas_param_ism_config( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ ) PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ ) { int16_t i, num_obj; Loading Loading @@ -526,6 +575,36 @@ void update_last_metadata( * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ #ifdef UNIFY_MD_QUANTIZER void ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ float *q_step, /* o : quantization step */ float *q_step_border, /* o : quantization step at the border */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ) { *nBits_azimuth = ISM_DTX_AZI_BITS_HIGH; *nBits_elevation = ISM_DTX_ELE_BITS_HIGH; *q_step = ISM_Q_STEP_HIGH; *q_step_border = ISM_Q_STEP_BORDER_HIGH; *nBits_coh = ISM_DTX_COH_SCA_BITS; *nBits_sce_id = 1; if ( num_obj >= 3 ) { *nBits_azimuth = ISM_DTX_AZI_BITS_LOW; *nBits_elevation = ISM_DTX_ELE_BITS_LOW; *q_step = ISM_Q_STEP_LOW; *q_step_border = ISM_Q_STEP_BORDER_LOW; *nBits_sce_id = 2; } return; } #else /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ Loading Loading @@ -554,3 +633,4 @@ int16_t ivas_get_ism_sid_quan_bitbudget( return low_res_q; } #endif #endif lib_com/ivas_prot.h +21 −0 Original line number Diff line number Diff line Loading @@ -793,6 +793,10 @@ int16_t ism_quant_meta( const float val, /* i : scalar value to quantize */ float *valQ, /* o : quantized value */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ); Loading @@ -800,6 +804,10 @@ int16_t ism_quant_meta( float ism_dequant_meta( const int16_t idx, /* i : quantizer index */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ); Loading Loading @@ -1023,6 +1031,18 @@ void update_last_metadata( const int16_t updt_flag[] /* i : last metadata update flag */ ); #ifdef UNIFY_MD_QUANTIZER /*! r: low resolution flag */ void ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ float *q_step, /* o : quantization step */ float *q_step_border, /* o : quantization step at the border */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #else /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ Loading @@ -1033,6 +1053,7 @@ int16_t ivas_get_ism_sid_quan_bitbudget( ); #endif #endif #endif /*----------------------------------------------------------------------------------* * DFT Stereo prototypes Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ #define MD_Q_PARAM_BE #define MD_SMOOTH_PARAM_BE /*#define DTX_PARAM_BE*/ #define UNIFY_MD_QUANTIZER /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_dec/ivas_ism_metadata_dec.c +31 −3 Original line number Diff line number Diff line Loading @@ -376,7 +376,11 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { #ifdef UNIFY_MD_QUANTIZER hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); #else hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); #endif } /*----------------------------------------------------------------* Loading Loading @@ -438,7 +442,11 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { #ifdef UNIFY_MD_QUANTIZER hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); #else hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); #endif } /*----------------------------------------------------------------* Loading Loading @@ -676,6 +684,7 @@ ivas_error create_ism_metadata_dec( #ifdef DISCRETE_ISM_DTX_CNG #ifndef UNIFY_MD_QUANTIZER /*-------------------------------------------------------------------* * ivas_ism_dec_dequantize_DOA_dtx() * Loading Loading @@ -737,7 +746,7 @@ static void ivas_ism_dec_dequantize_DOA_dtx( return; } #endif /*-------------------------------------------------------------------* * ivas_ism_metadata_sid_dec() Loading @@ -758,7 +767,12 @@ ivas_error ivas_ism_metadata_sid_dec( int16_t nb_bits_metadata[] /* o : number of metadata bits */ ) { #ifdef UNIFY_MD_QUANTIZER int16_t i, ch, nb_bits_start, last_bit_pos; float q_step, q_step_border; #else int16_t i, ch, nb_bits_start, last_bit_pos, low_res_q; #endif int16_t idx, idx_azimuth, idx_elevation; int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; int16_t md_diff_flag[MAX_NUM_OBJECTS]; Loading Loading @@ -815,7 +829,11 @@ ivas_error ivas_ism_metadata_sid_dec( * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ #ifdef UNIFY_MD_QUANTIZER ivas_get_ism_sid_quan_bitbudget( num_obj, &nBits_azimuth, &nBits_elevation, &q_step, &q_step_border, &nBits_coh, &nBits_sce_id ); #else low_res_q = ivas_get_ism_sid_quan_bitbudget( num_obj, &nBits_azimuth, &nBits_elevation, &nBits_coh, &nBits_sce_id ); #endif /*----------------------------------------------------------------* * Spatial parameters, loop over TCs - 1 Loading Loading @@ -881,6 +899,7 @@ ivas_error ivas_ism_metadata_sid_dec( if ( md_diff_flag[ch] == 1 ) { #ifndef UNIFY_MD_QUANTIZER if ( low_res_q ) { idx_azimuth = get_next_indice( st0, nBits_azimuth ); Loading @@ -889,10 +908,12 @@ ivas_error ivas_ism_metadata_sid_dec( ivas_ism_dec_dequantize_DOA_dtx( nBits_azimuth, nBits_elevation, idx_azimuth, idx_elevation, &( hIsmMetaData->azimuth ), &( hIsmMetaData->elevation ) ); } else #endif { /* Azimuth decoding */ idx_azimuth = get_next_indice( st0, nBits_azimuth ); #ifndef UNIFY_MD_QUANTIZER // VE!!!!! TBV /* azimuth is on a circle - check for diff coding for -180° -> 180° and vice versa changes */ if ( idx_azimuth > ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) { Loading @@ -916,9 +937,13 @@ ivas_error ivas_ism_metadata_sid_dec( } hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); #else hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << nBits_azimuth ); #endif /* Elevation decoding */ idx_elevation = get_next_indice( st0, nBits_elevation ); #ifndef UNIFY_MD_QUANTIZER /* sanity check in case of FER or BER */ if ( idx_elevation < 0 || idx_elevation > ( 1 << ISM_ELEVATION_NBITS ) - 1 ) Loading @@ -928,9 +953,12 @@ ivas_error ivas_ism_metadata_sid_dec( /* Elevation dequantization */ hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); #else hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << nBits_elevation ); #endif } // VE: ToDo: this would not work well for switching from low_res_q to active frame coding // VE!!!!! verify for switching from low_res_q to active frame coding #ifdef MD_Q_PARAM_BE if ( ism_mode != ISM_MODE_PARAM ) #endif Loading Loading
lib_com/ivas_cnst.h +11 −0 Original line number Diff line number Diff line Loading @@ -340,9 +340,20 @@ typedef enum #else #define PARAM_ISM_DTX_COH_SCA_BITS 4 #endif #if (defined DISCRETE_ISM_DTX_CNG && defined UNIFY_MD_QUANTIZER ) #define ISM_DTX_AZI_BITS_HIGH 8 #define ISM_DTX_ELE_BITS_HIGH 7 #define ISM_Q_STEP_HIGH (ISM_Q_STEP / 2) #define ISM_Q_STEP_BORDER_HIGH (ISM_Q_STEP_BORDER / 2) #define ISM_DTX_AZI_BITS_LOW 6 #define ISM_DTX_ELE_BITS_LOW 5 #define ISM_Q_STEP_LOW (ISM_Q_STEP * 2) #define ISM_Q_STEP_BORDER_LOW (ISM_Q_STEP_BORDER * 2) #else #define PARAM_ISM_DTX_AZI_BITS 5 #define PARAM_ISM_DTX_ELE_BITS 4 #endif #endif #ifdef DISCRETE_ISM_DTX_CNG #define ISM_DTX_ENER_BITS 4 #define ISM_DTX_COH_SCA_BITS 4 Loading
lib_com/ivas_ism_config.c +84 −4 Original line number Diff line number Diff line Loading @@ -359,12 +359,36 @@ int16_t ism_quant_meta( const float val, /* i : scalar value to quantize */ float *valQ, /* o : quantized value */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ) { int16_t idx, idx_start; float qlow, step; #ifdef UNIFY_MD_QUANTIZER if ( val <= borders[1] ) { qlow = borders[0]; idx_start = 0; step = q_step_border; } else if ( val <= borders[2] ) { qlow = borders[1]; idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); step = q_step; } else { qlow = borders[2]; idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); step = q_step_border; } #else if ( val <= borders[1] ) { qlow = borders[0]; Loading @@ -383,6 +407,7 @@ int16_t ism_quant_meta( idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); step = ISM_Q_STEP_BORDER; } #endif idx = idx_start + (int16_t) max( 0.f, min( cbsize - 1, ( ( val - qlow ) / step + 0.5f ) ) ); *valQ = ( idx - idx_start ) * step + qlow; Loading @@ -401,12 +426,36 @@ int16_t ism_quant_meta( float ism_dequant_meta( const int16_t idx, /* i : quantizer index */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ) { int16_t idx_start; float qlow, step, valQ; #ifdef UNIFY_MD_QUANTIZER if ( idx <= ( borders[1] - borders[0] ) / q_step_border ) { qlow = borders[0]; idx_start = 0; step = q_step_border; } else if ( idx <= cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ) { qlow = borders[1]; idx_start = (int16_t) ( ( borders[1] - borders[0] ) / q_step_border ); step = q_step; } else { qlow = borders[2]; idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / q_step_border ); step = q_step_border; } #else if ( idx <= ( borders[1] - borders[0] ) / ISM_Q_STEP_BORDER ) { qlow = borders[0]; Loading @@ -425,6 +474,7 @@ float ism_dequant_meta( idx_start = (int16_t) ( cbsize - 1 - ( borders[3] - borders[2] ) / ISM_Q_STEP_BORDER ); step = ISM_Q_STEP_BORDER; } #endif valQ = ( idx - idx_start ) * step + qlow; Loading @@ -439,8 +489,7 @@ float ism_dequant_meta( * ---------------------------------------------------------------*/ void ivas_param_ism_config( PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ ) PARAM_ISM_CONFIG_HANDLE hParamIsm /* i/o: IVAS Param ISM Config Structure */ ) { int16_t i, num_obj; Loading Loading @@ -526,6 +575,36 @@ void update_last_metadata( * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ #ifdef UNIFY_MD_QUANTIZER void ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ float *q_step, /* o : quantization step */ float *q_step_border, /* o : quantization step at the border */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ) { *nBits_azimuth = ISM_DTX_AZI_BITS_HIGH; *nBits_elevation = ISM_DTX_ELE_BITS_HIGH; *q_step = ISM_Q_STEP_HIGH; *q_step_border = ISM_Q_STEP_BORDER_HIGH; *nBits_coh = ISM_DTX_COH_SCA_BITS; *nBits_sce_id = 1; if ( num_obj >= 3 ) { *nBits_azimuth = ISM_DTX_AZI_BITS_LOW; *nBits_elevation = ISM_DTX_ELE_BITS_LOW; *q_step = ISM_Q_STEP_LOW; *q_step_border = ISM_Q_STEP_BORDER_LOW; *nBits_sce_id = 2; } return; } #else /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ Loading Loading @@ -554,3 +633,4 @@ int16_t ivas_get_ism_sid_quan_bitbudget( return low_res_q; } #endif #endif
lib_com/ivas_prot.h +21 −0 Original line number Diff line number Diff line Loading @@ -793,6 +793,10 @@ int16_t ism_quant_meta( const float val, /* i : scalar value to quantize */ float *valQ, /* o : quantized value */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ); Loading @@ -800,6 +804,10 @@ int16_t ism_quant_meta( float ism_dequant_meta( const int16_t idx, /* i : quantizer index */ const float borders[], /* i : level borders */ #ifdef UNIFY_MD_QUANTIZER const float q_step, /* i : quantization step */ const float q_step_border, /* i : quantization step at the border */ #endif const int16_t cbsize /* i : codebook size */ ); Loading Loading @@ -1023,6 +1031,18 @@ void update_last_metadata( const int16_t updt_flag[] /* i : last metadata update flag */ ); #ifdef UNIFY_MD_QUANTIZER /*! r: low resolution flag */ void ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ int16_t *nBits_azimuth, /* o : number of Q bits for azimuth */ int16_t *nBits_elevation, /* o : number of Q bits for elevation */ float *q_step, /* o : quantization step */ float *q_step_border, /* o : quantization step at the border */ int16_t *nBits_coh, /* o : number of Q bits for coherence */ int16_t *nBits_sce_id /* o : number of Q bits for sce_id_dtx */ ); #else /*! r: low resolution flag */ int16_t ivas_get_ism_sid_quan_bitbudget( const int16_t num_obj, /* i : number of objects */ Loading @@ -1033,6 +1053,7 @@ int16_t ivas_get_ism_sid_quan_bitbudget( ); #endif #endif #endif /*----------------------------------------------------------------------------------* * DFT Stereo prototypes Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ #define MD_Q_PARAM_BE #define MD_SMOOTH_PARAM_BE /*#define DTX_PARAM_BE*/ #define UNIFY_MD_QUANTIZER /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_dec/ivas_ism_metadata_dec.c +31 −3 Original line number Diff line number Diff line Loading @@ -376,7 +376,11 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { #ifdef UNIFY_MD_QUANTIZER hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_AZIMUTH_NBITS ); #else hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); #endif } /*----------------------------------------------------------------* Loading Loading @@ -438,7 +442,11 @@ ivas_error ivas_ism_metadata_dec( } else /* ISM_MODE_DISC */ { #ifdef UNIFY_MD_QUANTIZER hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << ISM_ELEVATION_NBITS ); #else hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); #endif } /*----------------------------------------------------------------* Loading Loading @@ -676,6 +684,7 @@ ivas_error create_ism_metadata_dec( #ifdef DISCRETE_ISM_DTX_CNG #ifndef UNIFY_MD_QUANTIZER /*-------------------------------------------------------------------* * ivas_ism_dec_dequantize_DOA_dtx() * Loading Loading @@ -737,7 +746,7 @@ static void ivas_ism_dec_dequantize_DOA_dtx( return; } #endif /*-------------------------------------------------------------------* * ivas_ism_metadata_sid_dec() Loading @@ -758,7 +767,12 @@ ivas_error ivas_ism_metadata_sid_dec( int16_t nb_bits_metadata[] /* o : number of metadata bits */ ) { #ifdef UNIFY_MD_QUANTIZER int16_t i, ch, nb_bits_start, last_bit_pos; float q_step, q_step_border; #else int16_t i, ch, nb_bits_start, last_bit_pos, low_res_q; #endif int16_t idx, idx_azimuth, idx_elevation; int16_t nBits_azimuth, nBits_elevation, nBits_coh, nBits_sce_id; int16_t md_diff_flag[MAX_NUM_OBJECTS]; Loading Loading @@ -815,7 +829,11 @@ ivas_error ivas_ism_metadata_sid_dec( * Set quantization bits based on the number of coded objects *----------------------------------------------------------------*/ #ifdef UNIFY_MD_QUANTIZER ivas_get_ism_sid_quan_bitbudget( num_obj, &nBits_azimuth, &nBits_elevation, &q_step, &q_step_border, &nBits_coh, &nBits_sce_id ); #else low_res_q = ivas_get_ism_sid_quan_bitbudget( num_obj, &nBits_azimuth, &nBits_elevation, &nBits_coh, &nBits_sce_id ); #endif /*----------------------------------------------------------------* * Spatial parameters, loop over TCs - 1 Loading Loading @@ -881,6 +899,7 @@ ivas_error ivas_ism_metadata_sid_dec( if ( md_diff_flag[ch] == 1 ) { #ifndef UNIFY_MD_QUANTIZER if ( low_res_q ) { idx_azimuth = get_next_indice( st0, nBits_azimuth ); Loading @@ -889,10 +908,12 @@ ivas_error ivas_ism_metadata_sid_dec( ivas_ism_dec_dequantize_DOA_dtx( nBits_azimuth, nBits_elevation, idx_azimuth, idx_elevation, &( hIsmMetaData->azimuth ), &( hIsmMetaData->elevation ) ); } else #endif { /* Azimuth decoding */ idx_azimuth = get_next_indice( st0, nBits_azimuth ); #ifndef UNIFY_MD_QUANTIZER // VE!!!!! TBV /* azimuth is on a circle - check for diff coding for -180° -> 180° and vice versa changes */ if ( idx_azimuth > ( 1 << ISM_AZIMUTH_NBITS ) - 1 ) { Loading @@ -916,9 +937,13 @@ ivas_error ivas_ism_metadata_sid_dec( } hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, 1 << ISM_AZIMUTH_NBITS ); #else hIsmMetaData->azimuth = ism_dequant_meta( idx_azimuth, ism_azimuth_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << nBits_azimuth ); #endif /* Elevation decoding */ idx_elevation = get_next_indice( st0, nBits_elevation ); #ifndef UNIFY_MD_QUANTIZER /* sanity check in case of FER or BER */ if ( idx_elevation < 0 || idx_elevation > ( 1 << ISM_ELEVATION_NBITS ) - 1 ) Loading @@ -928,9 +953,12 @@ ivas_error ivas_ism_metadata_sid_dec( /* Elevation dequantization */ hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, 1 << ISM_ELEVATION_NBITS ); #else hIsmMetaData->elevation = ism_dequant_meta( idx_elevation, ism_elevation_borders, ISM_Q_STEP, ISM_Q_STEP_BORDER, 1 << nBits_elevation ); #endif } // VE: ToDo: this would not work well for switching from low_res_q to active frame coding // VE!!!!! verify for switching from low_res_q to active frame coding #ifdef MD_Q_PARAM_BE if ( ism_mode != ISM_MODE_PARAM ) #endif Loading