mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[ISP] Fix ISP cost calculation and DepQuant with mts
This commit is contained in:
parent
6e24b9a7f9
commit
7d787c6b22
|
@ -240,6 +240,7 @@ int uvg_init_nb_info(encoder_control_t * encoder) {
|
|||
{
|
||||
nbSbb->inPos[k] = 0;
|
||||
}
|
||||
printf("");
|
||||
}
|
||||
{
|
||||
//===== outside subband neighbours =====
|
||||
|
@ -1282,8 +1283,8 @@ int uvg_dep_quant(
|
|||
encoder->m_scanId2NbInfoSbbArray[log2_tr_width][log2_tr_height][scanIdx ? scanIdx - 1 : 0],
|
||||
(zeroOut && (pos_x >= effWidth || pos_y >= effHeight)),
|
||||
q_coeff[blkpos],
|
||||
effectWidth,
|
||||
effectHeight
|
||||
width,
|
||||
height
|
||||
); //tu.cu->slice->getReverseLastSigCoeffFlag());
|
||||
}
|
||||
else {
|
||||
|
@ -1304,9 +1305,13 @@ int uvg_dep_quant(
|
|||
encoder->m_scanId2NbInfoSbbArray[log2_tr_width][log2_tr_height][scanIdx ? scanIdx - 1 : 0],
|
||||
(zeroOut && (pos_x >= effWidth || pos_y >= effHeight)),
|
||||
default_quant_coeff,
|
||||
effectWidth,
|
||||
effectHeight); //tu.cu->slice->getReverseLastSigCoeffFlag());
|
||||
width,
|
||||
height); //tu.cu->slice->getReverseLastSigCoeffFlag());
|
||||
}
|
||||
Decision temp[8];
|
||||
Decision* decisions = ctxs->m_trellis[scanIdx];
|
||||
memcpy(temp, decisions, sizeof(Decision) * 8);
|
||||
decisions++;
|
||||
}
|
||||
|
||||
//===== find best path =====
|
||||
|
|
|
@ -2016,7 +2016,7 @@ bool uvg_can_use_isp_with_lfnst(const int width, const int height, const int isp
|
|||
return false;
|
||||
}
|
||||
if (isp_split_type == ISP_MODE_NO_ISP) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const int tu_width = (isp_split_type == ISP_MODE_HOR) ? width : uvg_get_isp_split_dim(width, height, SPLIT_TYPE_VER, true);
|
||||
|
@ -2062,7 +2062,7 @@ double uvg_recon_and_estimate_cost_isp(encoder_state_t* const state,
|
|||
&tu_loc, &search_data->pred_cu, lcu,
|
||||
false, UVG_LUMA_T);
|
||||
|
||||
int index = cu_loc->local_y * LCU_WIDTH + cu_loc->local_x;
|
||||
int index = tu_loc.local_y * LCU_WIDTH + tu_loc.local_x;
|
||||
int ssd = uvg_pixels_calc_ssd(&lcu->ref.y[index], &lcu->rec.y[index],
|
||||
LCU_WIDTH, LCU_WIDTH,
|
||||
tu_loc.width, tu_loc.height);
|
||||
|
|
|
@ -361,21 +361,16 @@ static double search_intra_trdepth(
|
|||
}
|
||||
|
||||
|
||||
for (int lfnst_idx = start_idx; lfnst_idx <= end_lfnst_idx; lfnst_idx++) {
|
||||
// Initialize lfnst variables
|
||||
pred_cu->lfnst_idx = lfnst_idx;
|
||||
pred_cu->violates_lfnst_constrained_luma = false;
|
||||
pred_cu->violates_lfnst_constrained_chroma = false;
|
||||
pred_cu->lfnst_last_scan_pos = false;
|
||||
|
||||
//if (pred_cu->lfnst_idx != 0) {
|
||||
// // Cannot use ISP with LFNST for small blocks
|
||||
// pred_cu->intra.isp_mode = uvg_can_use_isp_with_lfnst(width, height, pred_cu->intra.isp_mode, tree_type) ? pred_cu->intra.isp_mode : ISP_MODE_NO_ISP;
|
||||
//}
|
||||
|
||||
for (trafo = mts_start; trafo < num_transforms; trafo++) {
|
||||
for (trafo = mts_start; trafo < num_transforms; trafo++) {
|
||||
for (int lfnst_idx = start_idx; lfnst_idx <= end_lfnst_idx; lfnst_idx++) {
|
||||
// Initialize lfnst variables
|
||||
pred_cu->tr_idx = trafo;
|
||||
pred_cu->tr_skip = trafo == MTS_SKIP;
|
||||
pred_cu->lfnst_idx = lfnst_idx;
|
||||
pred_cu->violates_lfnst_constrained_luma = false;
|
||||
pred_cu->violates_lfnst_constrained_chroma = false;
|
||||
pred_cu->lfnst_last_scan_pos = false;
|
||||
|
||||
bool constraints[2] = {false, false};
|
||||
if (mts_enabled) {
|
||||
pred_cu->mts_last_scan_pos = 0;
|
||||
|
@ -1337,7 +1332,7 @@ static int8_t search_intra_rdo(
|
|||
uint8_t best_mts_mode_for_isp[NUM_ISP_MODES] = {0};
|
||||
uint8_t best_lfnst_mode_for_isp[NUM_ISP_MODES] = {0};
|
||||
for (int isp_mode = 0; isp_mode < max_isp_modes; ++isp_mode) {
|
||||
|
||||
|
||||
|
||||
search_data[mode].pred_cu.intra.isp_mode = isp_mode;
|
||||
double rdo_bitcost = uvg_luma_mode_bits(state, &search_data[mode].pred_cu, cu_loc, lcu);
|
||||
|
|
Loading…
Reference in a new issue