[deblock] Use the isp block dimensions instead of cu dimensions fro deblock

This commit is contained in:
Joose Sainio 2022-12-20 11:25:58 +02:00
parent 51ad48ea1c
commit 50ae8cbc82
2 changed files with 35 additions and 4 deletions

View file

@ -36,6 +36,7 @@
#include "cu.h" #include "cu.h"
#include "encoder.h" #include "encoder.h"
#include "intra.h"
#include "uvg266.h" #include "uvg266.h"
#include "transform.h" #include "transform.h"
#include "videoframe.h" #include "videoframe.h"
@ -832,10 +833,40 @@ static void filter_deblock_edge_luma(encoder_state_t * const state,
const int cu_height = 1 << cu_q->log2_height; const int cu_height = 1 << cu_q->log2_height;
const int pu_size = dir == EDGE_HOR ? cu_height : cu_width; const int pu_size = dir == EDGE_HOR ? cu_height : cu_width;
const int pu_pos = dir == EDGE_HOR ? y_coord : x_coord; const int pu_pos = dir == EDGE_HOR ? y_coord : x_coord;
int tu_size_q_side = 0;
if (cu_q->type == CU_INTRA && cu_q->intra.isp_mode != ISP_MODE_NO_ISP) {
if (cu_q->intra.isp_mode == ISP_MODE_VER && dir == EDGE_VER) {
tu_size_q_side = MAX(4, cu_height >> 2);
} else if (cu_q->intra.isp_mode == ISP_MODE_HOR && dir == EDGE_HOR) {
tu_size_q_side = MAX(4, cu_width >> 2);
} else {
tu_size_q_side = dir == EDGE_HOR ?
MIN(1 << cu_q->log2_height, TR_MAX_WIDTH) :
MIN(1 << cu_q->log2_width, TR_MAX_WIDTH);
}
} else {
tu_size_q_side = dir == EDGE_HOR ?
MIN(1 << cu_q->log2_height, TR_MAX_WIDTH) :
MIN(1 << cu_q->log2_width, TR_MAX_WIDTH);
}
int tu_size_p_side = 0;
const int tu_size_p_side = dir == EDGE_HOR ? MIN(1 << cu_p->log2_height, TR_MAX_WIDTH) : MIN(1 << cu_p->log2_width, TR_MAX_WIDTH); if (cu_p->type == CU_INTRA && cu_p->intra.isp_mode != ISP_MODE_NO_ISP) {
const int tu_size_q_side = dir == EDGE_HOR ? MIN(1 << cu_q->log2_height, TR_MAX_WIDTH) : MIN(1 << cu_q->log2_width, TR_MAX_WIDTH); if (cu_p->intra.isp_mode == ISP_MODE_VER && dir == EDGE_VER) {
tu_size_p_side = MAX(4, (1 << cu_p->log2_height) >> 2);
} else if (cu_p->intra.isp_mode == ISP_MODE_HOR && dir == EDGE_HOR) {
tu_size_p_side = MAX(4, (1 << cu_p->log2_width) >> 2);
} else {
tu_size_p_side = dir == EDGE_HOR ?
MIN(1 << cu_p->log2_height, TR_MAX_WIDTH) :
MIN(1 << cu_p->log2_width, TR_MAX_WIDTH);
}
} else {
tu_size_p_side = dir == EDGE_HOR ?
MIN(1 << cu_p->log2_height, TR_MAX_WIDTH) :
MIN(1 << cu_p->log2_width, TR_MAX_WIDTH);
}
get_max_filter_length(&max_filter_length_P, &max_filter_length_Q, state, x_coord, y_coord, get_max_filter_length(&max_filter_length_P, &max_filter_length_Q, state, x_coord, y_coord,
dir, tu_boundary, dir, tu_boundary,

View file

@ -1567,7 +1567,7 @@ static double search_cu(
i, i,
cur_cu->intra.isp_mode, cur_cu->intra.isp_mode,
true); true);
if (x % 4 || y % 4) continue; if (isp_loc.x % 4 || isp_loc.y % 4) continue;
mark_deblocking( mark_deblocking(
&isp_loc, &isp_loc,
chroma_loc, chroma_loc,