Loading lib_com/ivas_cnst.h +4 −1 Original line number Diff line number Diff line Loading @@ -1553,8 +1553,11 @@ typedef enum #define COMPLEX_MD_BAND_THRESH (MAX_SPLIT_REND_MD_BANDS) #define COMPLEX_MD_BAND_THRESH_LOW (5) #ifndef SPLIT_REND_PRED_QUANT_63_PNTS #define IVAS_SPLIT_REND_NUM_QUANT_STRATS (3) #else #define IVAS_SPLIT_REND_NUM_QUANT_STRATS (4) #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS #define IVAS_SPLIT_REND_PRED_63QUANT_PNTS ( 63 ) #define IVAS_SPLIT_REND_PRED_31QUANT_PNTS ( 31 ) Loading lib_rend/ivas_prot_rend.h +5 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,11 @@ void ivas_split_rend_get_quant_params( const int16_t num_md_bands, int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #endif int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], Loading lib_rend/ivas_splitRendererPost.c +91 −22 Original line number Diff line number Diff line Loading @@ -255,7 +255,12 @@ static void ivas_split_rend_unquant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) float fix_pos_rot_mat[][BINAURAL_CHANNELS] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , float pred_quant_step #endif ) { int16_t ch1, ch2; int16_t gd_idx_min; Loading @@ -271,14 +276,7 @@ static void ivas_split_rend_unquant_md( #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS if ( pose_type == PRED_ONLY ) { quantstep = IVAS_SPLIT_REND_PRED31_Q_STEP; } else { quantstep = IVAS_SPLIT_REND_PRED_ROLL_Q_STEP; } quantstep = pred_quant_step; #endif for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) Loading Loading @@ -348,6 +346,9 @@ static void ivas_splitBinPostRendMdBase2Dec( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -356,13 +357,24 @@ static void ivas_splitBinPostRendMdBase2Dec( int16_t sf_idx, pos_idx, b, ch1, ch2; int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len; int16_t min_pred_roll_idx, pred_roll_code_len; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_cb_idx; #endif int16_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; Loading @@ -371,7 +383,7 @@ static void ivas_splitBinPostRendMdBase2Dec( min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_code_len = pHuff_cfg->pred_base2_code_len[0]; pred_code_len = pHuff_cfg->pred_base2_code_len[pred_cb_idx]; pred_roll_code_len = pHuff_cfg->pred_roll_base2_code_len; #else pred_code_len = pHuff_cfg->pred_base2_code_len; Loading Loading @@ -468,6 +480,9 @@ static void ivas_splitBinPostRendMdHuffDec( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -478,15 +493,23 @@ static void ivas_splitBinPostRendMdHuffDec( int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t min_pred_roll_idx, max_pred_roll_idx; int16_t min_pred_roll_idx, max_pred_roll_idx, pred_cb_idx; #endif BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) * 3]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[( pred_quant_pnts_yaw - 1 ) * 3]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; Loading @@ -511,7 +534,7 @@ static void ivas_splitBinPostRendMdHuffDec( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[0], pBits, pHuff_cfg->pred_idx_trav[0] ); sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); #else sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); #endif Loading @@ -528,7 +551,7 @@ static void ivas_splitBinPostRendMdHuffDec( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[0], pBits, pHuff_cfg->pred_idx_trav[0] ); sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); #else sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); #endif Loading Loading @@ -636,6 +659,11 @@ void ivas_splitBinPostRendMdDec( int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int16_t num_complex_bands, num_quant_strats; int32_t quant_strat_bits, is_huff_coding, quant_strat; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG int16_t ch1, ch2; #endif Loading Loading @@ -681,6 +709,11 @@ void ivas_splitBinPostRendMdDec( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, pred_quantstep_yaw, pred_1byquantstep_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -700,6 +733,9 @@ void ivas_splitBinPostRendMdDec( num_subframes, pred_real_bands_yaw[quant_strat], pred_imag_bands_yaw[quant_strat], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[quant_strat], #endif d_bands_yaw[quant_strat], bands_pitch[quant_strat], pred_real_bands_roll[quant_strat], Loading @@ -713,6 +749,9 @@ void ivas_splitBinPostRendMdDec( num_subframes, pred_real_bands_yaw[quant_strat], pred_imag_bands_yaw[quant_strat], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[quant_strat], #endif d_bands_yaw[quant_strat], bands_pitch[quant_strat], pred_real_bands_roll[quant_strat], Loading Loading @@ -832,14 +871,24 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, PRED_ONLY, 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_quantstep_yaw[quant_strat] #endif ); } for ( ; b < pred_real_bands_yaw[quant_strat]; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, PRED_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_quantstep_yaw[quant_strat] #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -856,7 +905,12 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, COM_GAIN_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -871,7 +925,12 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, LR_GAIN_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -891,7 +950,12 @@ void ivas_splitBinPostRendMdDec( #else PRED_ONLY, #endif 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_Q_STEP #endif ); } for ( ; b < pred_real_bands_roll[quant_strat]; b++ ) { Loading @@ -902,7 +966,12 @@ void ivas_splitBinPostRendMdDec( #else PRED_ONLY, #endif 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_Q_STEP #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading lib_rend/ivas_splitRendererPre.c +110 −27 Original line number Diff line number Diff line Loading @@ -459,7 +459,12 @@ static void ivas_split_rend_quant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) float fix_pos_rot_mat[][BINAURAL_CHANNELS] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , float pred_1byquantstep #endif ) { int16_t ch1, ch2; int16_t gd_idx_min; Loading @@ -476,15 +481,7 @@ static void ivas_split_rend_quant_md( #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS if ( pose_type == PRED_ONLY ) { onebyquantstep = IVAS_SPLIT_REND_PRED31_1BYQ_STEP; } else { onebyquantstep = IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP; } onebyquantstep = pred_1byquantstep; #endif if ( real_only == 1 ) { Loading Loading @@ -543,12 +540,10 @@ static void ivas_split_rend_quant_md( quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * IVAS_SPLIT_REND_PITCH_G_MIN_VAL ); hMd->gd_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); // hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; hMd->gd_idx = hMd->gd_idx - gd_idx_min; quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd2, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); hMd->gd2_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); // hMd->gd2 = hMd->gd2_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; hMd->gd2_idx = hMd->gd2_idx - gd_idx_min; } Loading Loading @@ -759,20 +754,29 @@ static void get_base2_bits( const int16_t num_quant_strats, const int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #endif const int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS] ) { int16_t pred_bits, d_gain_bits, pitch_gain_bits, pose_idx, q; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_roll_bits; int16_t d_gain_bits, pitch_gain_bits, pose_idx, q; int16_t pred_yaw_bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #else int16_t pred_bits, d_gain_bits, pitch_gain_bits, pose_idx, q; #endif IVAS_SPLIT_REND_POSE_TYPE pose_type; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_PRED_31QUANT_PNTS ) ); for ( q = 0; q < num_quant_strats; q++ ) { pred_yaw_bits[q] = (int16_t) ceilf( log2f( pred_quant_pnts_yaw[q] ) ); } pred_roll_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS ) ); #else pred_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_PRED_QUANT_PNTS ) ); Loading @@ -792,8 +796,13 @@ static void get_base2_bits( pose_type = hBinHrSplitPreRend->pose_type[pose_idx]; if ( pose_type == ANY_YAW ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS base2bits[q] += pred_yaw_bits[q] * pred_real_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; base2bits[q] += pred_yaw_bits[q] * pred_imag_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; #else base2bits[q] += pred_bits * pred_real_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; base2bits[q] += pred_bits * pred_imag_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; #endif base2bits[q] += d_gain_bits * d_bands_yaw[q] * num_subframes; } else if ( pose_type == PITCH_ONLY ) Loading Loading @@ -823,6 +832,9 @@ static void ivas_SplitRenderer_code_md_base2( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -832,12 +844,23 @@ static void ivas_SplitRenderer_code_md_base2( int16_t pos_idx, b, ch1, ch2, sf_idx; int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len, num_poses; int16_t min_pred_roll_idx, pred_roll_code_len; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_cb_idx; #endif int32_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; Loading @@ -846,7 +869,7 @@ static void ivas_SplitRenderer_code_md_base2( min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_code_len = pHuff_cfg->pred_base2_code_len[0]; pred_code_len = pHuff_cfg->pred_base2_code_len[pred_cb_idx]; pred_roll_code_len = pHuff_cfg->pred_roll_base2_code_len; #else pred_code_len = pHuff_cfg->pred_base2_code_len; Loading Loading @@ -966,6 +989,9 @@ static void ivas_SplitRenderer_code_md_huff( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -976,7 +1002,7 @@ static void ivas_SplitRenderer_code_md_huff( int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t min_pred_roll_idx, max_pred_roll_idx; int16_t min_pred_roll_idx, max_pred_roll_idx, pred_cb_idx; #endif int32_t code, len; BIN_HR_SPLIT_REND_MD_HANDLE hMd; Loading @@ -984,8 +1010,16 @@ static void ivas_SplitRenderer_code_md_huff( pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) * 3]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[( pred_quant_pnts_yaw - 1 ) * 3]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; max_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) * 3]; #else Loading @@ -1010,7 +1044,7 @@ static void ivas_SplitRenderer_code_md_huff( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS ivas_split_rend_huffman_encode( &pHuff_cfg->pred[0], sym_adj_idx[ch1][ch2], &code, &len ); ivas_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); #else ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); #endif Loading @@ -1027,7 +1061,7 @@ static void ivas_SplitRenderer_code_md_huff( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS ivas_split_rend_huffman_encode( &pHuff_cfg->pred[0], sym_adj_idx[ch1][ch2], &code, &len ); ivas_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); #else ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); #endif Loading Loading @@ -1150,6 +1184,11 @@ static void ivas_SplitRenderer_quant_code( int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #endif BIN_HR_SPLIT_REND_MD_HANDLE hMd; if ( low_res_pre_rend_rot ) Loading Loading @@ -1191,6 +1230,11 @@ static void ivas_SplitRenderer_quant_code( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, pred_quantstep_yaw, pred_1byquantstep_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -1207,6 +1251,9 @@ static void ivas_SplitRenderer_quant_code( num_quant_strats, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -1226,21 +1273,36 @@ static void ivas_SplitRenderer_quant_code( hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, PRED_ONLY, 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_1byquantstep_yaw[q] #endif ); } for ( ; b < pred_real_bands_yaw[q]; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, PRED_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_1byquantstep_yaw[q] #endif ); } for ( b = 0; b < d_bands_yaw[q]; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, COM_GAIN_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } } else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) Loading @@ -1250,7 +1312,12 @@ static void ivas_SplitRenderer_quant_code( hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, LR_GAIN_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } } else Loading @@ -1264,7 +1331,12 @@ static void ivas_SplitRenderer_quant_code( #else PRED_ONLY, #endif 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP #endif ); } for ( ; b < pred_real_bands_roll[q]; b++ ) { Loading @@ -1275,7 +1347,12 @@ static void ivas_SplitRenderer_quant_code( #else PRED_ONLY, #endif 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP #endif ); } } } Loading @@ -1293,6 +1370,9 @@ static void ivas_SplitRenderer_quant_code( num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[q], #endif d_bands_yaw[q], bands_pitch[q], pred_real_bands_roll[q], Loading @@ -1312,6 +1392,9 @@ static void ivas_SplitRenderer_quant_code( num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[q], #endif d_bands_yaw[q], bands_pitch[q], pred_real_bands_roll[q], Loading lib_rend/ivas_splitRenderer_utils.c +34 −2 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
lib_com/ivas_cnst.h +4 −1 Original line number Diff line number Diff line Loading @@ -1553,8 +1553,11 @@ typedef enum #define COMPLEX_MD_BAND_THRESH (MAX_SPLIT_REND_MD_BANDS) #define COMPLEX_MD_BAND_THRESH_LOW (5) #ifndef SPLIT_REND_PRED_QUANT_63_PNTS #define IVAS_SPLIT_REND_NUM_QUANT_STRATS (3) #else #define IVAS_SPLIT_REND_NUM_QUANT_STRATS (4) #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS #define IVAS_SPLIT_REND_PRED_63QUANT_PNTS ( 63 ) #define IVAS_SPLIT_REND_PRED_31QUANT_PNTS ( 31 ) Loading
lib_rend/ivas_prot_rend.h +5 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,11 @@ void ivas_split_rend_get_quant_params( const int16_t num_md_bands, int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #endif int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], Loading
lib_rend/ivas_splitRendererPost.c +91 −22 Original line number Diff line number Diff line Loading @@ -255,7 +255,12 @@ static void ivas_split_rend_unquant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) float fix_pos_rot_mat[][BINAURAL_CHANNELS] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , float pred_quant_step #endif ) { int16_t ch1, ch2; int16_t gd_idx_min; Loading @@ -271,14 +276,7 @@ static void ivas_split_rend_unquant_md( #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS if ( pose_type == PRED_ONLY ) { quantstep = IVAS_SPLIT_REND_PRED31_Q_STEP; } else { quantstep = IVAS_SPLIT_REND_PRED_ROLL_Q_STEP; } quantstep = pred_quant_step; #endif for ( ch1 = 0; ch1 < BINAURAL_CHANNELS; ch1++ ) Loading Loading @@ -348,6 +346,9 @@ static void ivas_splitBinPostRendMdBase2Dec( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -356,13 +357,24 @@ static void ivas_splitBinPostRendMdBase2Dec( int16_t sf_idx, pos_idx, b, ch1, ch2; int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len; int16_t min_pred_roll_idx, pred_roll_code_len; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_cb_idx; #endif int16_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; Loading @@ -371,7 +383,7 @@ static void ivas_splitBinPostRendMdBase2Dec( min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_code_len = pHuff_cfg->pred_base2_code_len[0]; pred_code_len = pHuff_cfg->pred_base2_code_len[pred_cb_idx]; pred_roll_code_len = pHuff_cfg->pred_roll_base2_code_len; #else pred_code_len = pHuff_cfg->pred_base2_code_len; Loading Loading @@ -468,6 +480,9 @@ static void ivas_splitBinPostRendMdHuffDec( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -478,15 +493,23 @@ static void ivas_splitBinPostRendMdHuffDec( int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t min_pred_roll_idx, max_pred_roll_idx; int16_t min_pred_roll_idx, max_pred_roll_idx, pred_cb_idx; #endif BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPostRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) * 3]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[( pred_quant_pnts_yaw - 1 ) * 3]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred.codebook[( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ) * 3]; Loading @@ -511,7 +534,7 @@ static void ivas_splitBinPostRendMdHuffDec( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[0], pBits, pHuff_cfg->pred_idx_trav[0] ); sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); #else sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); #endif Loading @@ -528,7 +551,7 @@ static void ivas_splitBinPostRendMdHuffDec( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[0], pBits, pHuff_cfg->pred_idx_trav[0] ); sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred[pred_cb_idx], pBits, pHuff_cfg->pred_idx_trav[pred_cb_idx] ); #else sym_adj_idx[ch1][ch2] = ivas_split_rend_huffman_decode_opt( &pHuff_cfg->pred, pBits, pHuff_cfg->pred_idx_trav ); #endif Loading Loading @@ -636,6 +659,11 @@ void ivas_splitBinPostRendMdDec( int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int16_t num_complex_bands, num_quant_strats; int32_t quant_strat_bits, is_huff_coding, quant_strat; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG int16_t ch1, ch2; #endif Loading Loading @@ -681,6 +709,11 @@ void ivas_splitBinPostRendMdDec( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, pred_quantstep_yaw, pred_1byquantstep_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -700,6 +733,9 @@ void ivas_splitBinPostRendMdDec( num_subframes, pred_real_bands_yaw[quant_strat], pred_imag_bands_yaw[quant_strat], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[quant_strat], #endif d_bands_yaw[quant_strat], bands_pitch[quant_strat], pred_real_bands_roll[quant_strat], Loading @@ -713,6 +749,9 @@ void ivas_splitBinPostRendMdDec( num_subframes, pred_real_bands_yaw[quant_strat], pred_imag_bands_yaw[quant_strat], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[quant_strat], #endif d_bands_yaw[quant_strat], bands_pitch[quant_strat], pred_real_bands_roll[quant_strat], Loading Loading @@ -832,14 +871,24 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, PRED_ONLY, 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_quantstep_yaw[quant_strat] #endif ); } for ( ; b < pred_real_bands_yaw[quant_strat]; b++ ) { hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, PRED_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_quantstep_yaw[quant_strat] #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -856,7 +905,12 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, COM_GAIN_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -871,7 +925,12 @@ void ivas_splitBinPostRendMdDec( hMd = &hBinHrSplitPostRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_unquant_md( hMd, LR_GAIN_ONLY, 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading @@ -891,7 +950,12 @@ void ivas_splitBinPostRendMdDec( #else PRED_ONLY, #endif 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_Q_STEP #endif ); } for ( ; b < pred_real_bands_roll[quant_strat]; b++ ) { Loading @@ -902,7 +966,12 @@ void ivas_splitBinPostRendMdDec( #else PRED_ONLY, #endif 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPostRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_Q_STEP #endif ); } for ( ; b < MAX_SPLIT_REND_MD_BANDS; b++ ) { Loading
lib_rend/ivas_splitRendererPre.c +110 −27 Original line number Diff line number Diff line Loading @@ -459,7 +459,12 @@ static void ivas_split_rend_quant_md( BIN_HR_SPLIT_REND_MD_HANDLE hMd, IVAS_SPLIT_REND_POSE_TYPE pose_type, int16_t real_only, float fix_pos_rot_mat[][BINAURAL_CHANNELS] ) float fix_pos_rot_mat[][BINAURAL_CHANNELS] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , float pred_1byquantstep #endif ) { int16_t ch1, ch2; int16_t gd_idx_min; Loading @@ -476,15 +481,7 @@ static void ivas_split_rend_quant_md( #endif #ifdef SPLIT_REND_PRED_QUANT_63_PNTS if ( pose_type == PRED_ONLY ) { onebyquantstep = IVAS_SPLIT_REND_PRED31_1BYQ_STEP; } else { onebyquantstep = IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP; } onebyquantstep = pred_1byquantstep; #endif if ( real_only == 1 ) { Loading Loading @@ -543,12 +540,10 @@ static void ivas_split_rend_quant_md( quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); gd_idx_min = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * IVAS_SPLIT_REND_PITCH_G_MIN_VAL ); hMd->gd_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); // hMd->gd = hMd->gd_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; hMd->gd_idx = hMd->gd_idx - gd_idx_min; quant_val = min( IVAS_SPLIT_REND_PITCH_G_MAX_VAL, max( hMd->gd2, IVAS_SPLIT_REND_PITCH_G_MIN_VAL ) ); hMd->gd2_idx = (int16_t) roundf( IVAS_SPLIT_REND_PITCH_G_1BYQ_STEP * quant_val ); // hMd->gd2 = hMd->gd2_idx * IVAS_SPLIT_REND_PITCH_G_Q_STEP; hMd->gd2_idx = hMd->gd2_idx - gd_idx_min; } Loading Loading @@ -759,20 +754,29 @@ static void get_base2_bits( const int16_t num_quant_strats, const int16_t pred_real_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], #endif const int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_real_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], const int16_t pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS], int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS] ) { int16_t pred_bits, d_gain_bits, pitch_gain_bits, pose_idx, q; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_roll_bits; int16_t d_gain_bits, pitch_gain_bits, pose_idx, q; int16_t pred_yaw_bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #else int16_t pred_bits, d_gain_bits, pitch_gain_bits, pose_idx, q; #endif IVAS_SPLIT_REND_POSE_TYPE pose_type; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_PRED_31QUANT_PNTS ) ); for ( q = 0; q < num_quant_strats; q++ ) { pred_yaw_bits[q] = (int16_t) ceilf( log2f( pred_quant_pnts_yaw[q] ) ); } pred_roll_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS ) ); #else pred_bits = (int16_t) ceilf( log2f( IVAS_SPLIT_REND_PRED_QUANT_PNTS ) ); Loading @@ -792,8 +796,13 @@ static void get_base2_bits( pose_type = hBinHrSplitPreRend->pose_type[pose_idx]; if ( pose_type == ANY_YAW ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS base2bits[q] += pred_yaw_bits[q] * pred_real_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; base2bits[q] += pred_yaw_bits[q] * pred_imag_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; #else base2bits[q] += pred_bits * pred_real_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; base2bits[q] += pred_bits * pred_imag_bands_yaw[q] * num_subframes * BINAURAL_CHANNELS * BINAURAL_CHANNELS; #endif base2bits[q] += d_gain_bits * d_bands_yaw[q] * num_subframes; } else if ( pose_type == PITCH_ONLY ) Loading Loading @@ -823,6 +832,9 @@ static void ivas_SplitRenderer_code_md_base2( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -832,12 +844,23 @@ static void ivas_SplitRenderer_code_md_base2( int16_t pos_idx, b, ch1, ch2, sf_idx; int16_t min_pred_idx, min_gd_idx, min_p_gd_idx, pred_code_len, gd_code_len, p_gd_code_len, num_poses; int16_t min_pred_roll_idx, pred_roll_code_len; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_cb_idx; #endif int32_t code; BIN_HR_SPLIT_REND_MD_HANDLE hMd; BIN_HR_SPLIT_REND_HUFF_HANDLE pHuff_cfg; pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; #else min_pred_idx = (int16_t) pHuff_cfg->pred.codebook[0]; Loading @@ -846,7 +869,7 @@ static void ivas_SplitRenderer_code_md_base2( min_gd_idx = (int16_t) pHuff_cfg->gd.codebook[0]; min_p_gd_idx = (int16_t) pHuff_cfg->p_gd.codebook[0]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_code_len = pHuff_cfg->pred_base2_code_len[0]; pred_code_len = pHuff_cfg->pred_base2_code_len[pred_cb_idx]; pred_roll_code_len = pHuff_cfg->pred_roll_base2_code_len; #else pred_code_len = pHuff_cfg->pred_base2_code_len; Loading Loading @@ -966,6 +989,9 @@ static void ivas_SplitRenderer_code_md_huff( const int16_t num_subframes, const int16_t pred_real_bands_yaw, const int16_t pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS const int16_t pred_quant_pnts_yaw, #endif const int16_t d_bands_yaw, const int16_t bands_pitch, const int16_t pred_real_bands_roll, Loading @@ -976,7 +1002,7 @@ static void ivas_SplitRenderer_code_md_huff( int16_t sym_adj_idx[BINAURAL_CHANNELS][BINAURAL_CHANNELS]; int16_t min_pred_idx, max_pred_idx; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t min_pred_roll_idx, max_pred_roll_idx; int16_t min_pred_roll_idx, max_pred_roll_idx, pred_cb_idx; #endif int32_t code, len; BIN_HR_SPLIT_REND_MD_HANDLE hMd; Loading @@ -984,8 +1010,16 @@ static void ivas_SplitRenderer_code_md_huff( pHuff_cfg = &hBinHrSplitPreRend->huff_cfg; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS min_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[0].codebook[( IVAS_SPLIT_REND_PRED_31QUANT_PNTS - 1 ) * 3]; if ( pred_quant_pnts_yaw == IVAS_SPLIT_REND_PRED_63QUANT_PNTS ) { pred_cb_idx = 1; } else { pred_cb_idx = 0; } min_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[0]; max_pred_idx = (int16_t) pHuff_cfg->pred[pred_cb_idx].codebook[( pred_quant_pnts_yaw - 1 ) * 3]; min_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[0]; max_pred_roll_idx = (int16_t) pHuff_cfg->pred_roll.codebook[( IVAS_SPLIT_REND_ROLL_PRED_QUANT_PNTS - 1 ) * 3]; #else Loading @@ -1010,7 +1044,7 @@ static void ivas_SplitRenderer_code_md_huff( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS ivas_split_rend_huffman_encode( &pHuff_cfg->pred[0], sym_adj_idx[ch1][ch2], &code, &len ); ivas_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); #else ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); #endif Loading @@ -1027,7 +1061,7 @@ static void ivas_SplitRenderer_code_md_huff( for ( ch2 = 0; ch2 < BINAURAL_CHANNELS; ch2++ ) { #ifdef SPLIT_REND_PRED_QUANT_63_PNTS ivas_split_rend_huffman_encode( &pHuff_cfg->pred[0], sym_adj_idx[ch1][ch2], &code, &len ); ivas_split_rend_huffman_encode( &pHuff_cfg->pred[pred_cb_idx], sym_adj_idx[ch1][ch2], &code, &len ); #else ivas_split_rend_huffman_encode( &pHuff_cfg->pred, sym_adj_idx[ch1][ch2], &code, &len ); #endif Loading Loading @@ -1150,6 +1184,11 @@ static void ivas_SplitRenderer_quant_code( int16_t pred_imag_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], pred_imag_bands_roll[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int16_t d_bands_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS], bands_pitch[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; int32_t base2bits[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #ifdef SPLIT_REND_PRED_QUANT_63_PNTS int16_t pred_quant_pnts_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_1byquantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; float pred_quantstep_yaw[IVAS_SPLIT_REND_NUM_QUANT_STRATS]; #endif BIN_HR_SPLIT_REND_MD_HANDLE hMd; if ( low_res_pre_rend_rot ) Loading Loading @@ -1191,6 +1230,11 @@ static void ivas_SplitRenderer_quant_code( MAX_SPLIT_REND_MD_BANDS, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, pred_quantstep_yaw, pred_1byquantstep_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -1207,6 +1251,9 @@ static void ivas_SplitRenderer_quant_code( num_quant_strats, pred_real_bands_yaw, pred_imag_bands_yaw, #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw, #endif d_bands_yaw, bands_pitch, pred_real_bands_roll, Loading @@ -1226,21 +1273,36 @@ static void ivas_SplitRenderer_quant_code( hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, PRED_ONLY, 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_1byquantstep_yaw[q] #endif ); } for ( ; b < pred_real_bands_yaw[q]; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, PRED_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , pred_1byquantstep_yaw[q] #endif ); } for ( b = 0; b < d_bands_yaw[q]; b++ ) { hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, COM_GAIN_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } } else if ( hBinHrSplitPreRend->pose_type[pos_idx] == PITCH_ONLY ) Loading @@ -1250,7 +1312,12 @@ static void ivas_SplitRenderer_quant_code( hMd = &hBinHrSplitPreRend->rot_md[pos_idx][sf_idx][b]; ivas_split_rend_quant_md( hMd, LR_GAIN_ONLY, 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , 0 #endif ); } } else Loading @@ -1264,7 +1331,12 @@ static void ivas_SplitRenderer_quant_code( #else PRED_ONLY, #endif 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 0, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP #endif ); } for ( ; b < pred_real_bands_roll[q]; b++ ) { Loading @@ -1275,7 +1347,12 @@ static void ivas_SplitRenderer_quant_code( #else PRED_ONLY, #endif 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] ); 1, hBinHrSplitPreRend->fix_pos_rot_mat[pos_idx] #ifdef SPLIT_REND_PRED_QUANT_63_PNTS , IVAS_SPLIT_REND_PRED_ROLL_1BYQ_STEP #endif ); } } } Loading @@ -1293,6 +1370,9 @@ static void ivas_SplitRenderer_quant_code( num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[q], #endif d_bands_yaw[q], bands_pitch[q], pred_real_bands_roll[q], Loading @@ -1312,6 +1392,9 @@ static void ivas_SplitRenderer_quant_code( num_subframes, pred_real_bands_yaw[q], pred_imag_bands_yaw[q], #ifdef SPLIT_REND_PRED_QUANT_63_PNTS pred_quant_pnts_yaw[q], #endif d_bands_yaw[q], bands_pitch[q], pred_real_bands_roll[q], Loading
lib_rend/ivas_splitRenderer_utils.c +34 −2 File changed.Preview size limit exceeded, changes collapsed. Show changes