Fixed inter deblocking by setting correct CU residual info on transform split

This commit is contained in:
Marko Viitanen 2013-10-10 17:47:08 +03:00
parent 1b2b3c19bb
commit 7a53bddead
2 changed files with 14 additions and 7 deletions

View file

@ -1112,7 +1112,15 @@ void encode_coding_tree(encoder_control *encoder, uint16_t x_ctb,
ti.cb_top[2] = (ti.cb[0] & 0x4 || ti.cb[1] & 0x4 || ti.cb[2] & 0x4 || ti.cb[3] & 0x4)?1:0;
residual = ti.cb_top[0] | ti.cb_top[1] | ti.cb_top[2];
picture_set_block_residual(encoder->in.cur_pic,x_ctb,y_ctb,depth,ti.cb_top[0]);
if(depth == 0) {
picture_set_block_residual(encoder->in.cur_pic,x_ctb ,y_ctb ,depth+1,ti.cb[0] & 0x1);
picture_set_block_residual(encoder->in.cur_pic,x_ctb + 4,y_ctb ,depth+1,ti.cb[1] & 0x1);
picture_set_block_residual(encoder->in.cur_pic,x_ctb ,y_ctb + 4,depth+1,ti.cb[2] & 0x1);
picture_set_block_residual(encoder->in.cur_pic,x_ctb + 4,y_ctb + 4,depth+1,ti.cb[3] & 0x1);
} else {
picture_set_block_residual(encoder->in.cur_pic,x_ctb,y_ctb,depth,ti.cb_top[0]);
}
cabac.ctx = &g_cu_qt_root_cbf_model;
CABAC_BIN(&cabac, residual, "rqt_root_cbf");

View file

@ -190,21 +190,20 @@ void filter_deblock_edge_luma(encoder_control *encoder,
if((block_idx & 1) == 0)
{
// CU in the side we are filtering, update every 8-pixels
cu_p = &encoder->in.cur_pic->cu_array[MAX_DEPTH][(x_cu - (dir == EDGE_VER) + (dir == EDGE_HOR ? block_idx/2 : 0)) +
(y_cu - (dir == EDGE_HOR) + (dir == EDGE_VER ? block_idx/2 : 0))
cu_p = &encoder->in.cur_pic->cu_array[MAX_DEPTH][(x_cu - (dir == EDGE_VER) + (dir == EDGE_HOR ? block_idx>>1 : 0)) +
(y_cu - (dir == EDGE_HOR) + (dir == EDGE_VER ? block_idx>>1 : 0))
* (encoder->in.width_in_lcu << MAX_DEPTH)];
// Filter strength
strength = 0;
strength = 0;
// Intra blocks have strength 2
if(cu_q->type == CU_INTRA || cu_p->type == CU_INTRA) {
strength = 2;
// Non-zero residual and transform boundary
} else if((cu_q->residual || cu_p->residual) && (cu_q->depth==0 ? !((dir == EDGE_VER ? y_cu + (block_idx>>1) : x_cu + (block_idx>>1) )&0x3) : 1 ) ) {
} else if(cu_q->residual || cu_p->residual) {
strength = 1;
// Absolute motion vector diff between blocks >= 1 (Integer pixel)
} else if((abs(cu_q->inter.mv[0] - cu_p->inter.mv[0]) >= 4) || (abs(cu_q->inter.mv[1] - cu_p->inter.mv[1]) >= 4)) {
strength = 1;
strength = 1;
}
tc_index = CLIP(0, 51 + 2, (int32_t)(qp + 2*(strength - 1) + (tc_offset_div2 << 1)));
tc = g_tc_table_8x8[tc_index] * bitdepth_scale;