mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Refactoring encoder.c in preparation for adding merge-mode
This commit is contained in:
parent
b1b45944a9
commit
96a0f03298
|
@ -977,10 +977,7 @@ void encode_coding_tree(encoder_control *encoder, uint16_t x_ctb,
|
|||
} else {
|
||||
CABAC_BIN_EP(&cabac, symbol, "ref_frame_flag2");
|
||||
}
|
||||
|
||||
if (symbol == 0) {
|
||||
break;
|
||||
}
|
||||
if (symbol == 0) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1041,6 +1038,16 @@ void encode_coding_tree(encoder_control *encoder, uint16_t x_ctb,
|
|||
|
||||
CABAC_BIN_EP(&cabac, (mvd_ver>0)?0:1, "mvd_sign_flag_ver");
|
||||
}
|
||||
}
|
||||
|
||||
// Signal which candidate MV to use
|
||||
cabac_write_unary_max_symbol(&cabac, g_mvp_idx_model, cur_cu->inter.mv_ref, 1,
|
||||
AMVP_MAX_NUM_CANDS - 1);
|
||||
}
|
||||
}
|
||||
} // for ref_list
|
||||
} // if !merge
|
||||
|
||||
|
||||
// Inter reconstruction
|
||||
inter_recon(encoder->ref->pics[0], x_ctb * CU_MIN_SIZE_PIXELS,
|
||||
|
@ -1049,17 +1056,9 @@ void encode_coding_tree(encoder_control *encoder, uint16_t x_ctb,
|
|||
|
||||
// Mark this block as "coded" (can be used for predictions..)
|
||||
picture_set_block_coded(encoder->in.cur_pic, x_ctb, y_ctb, depth, 1);
|
||||
}
|
||||
|
||||
// Signal which candidate MV to use
|
||||
cabac_write_unary_max_symbol(&cabac, g_mvp_idx_model, cur_cu->inter.mv_ref, 1,
|
||||
AMVP_MAX_NUM_CANDS - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (1) {
|
||||
{
|
||||
pixel *base_y = &encoder->in.cur_pic->y_data[x_ctb*(LCU_WIDTH>>(MAX_DEPTH)) + (y_ctb*(LCU_WIDTH>>(MAX_DEPTH))) *encoder->in.width];
|
||||
pixel *base_u = &encoder->in.cur_pic->u_data[x_ctb*(LCU_WIDTH>>(MAX_DEPTH+1)) + (y_ctb*(LCU_WIDTH>>(MAX_DEPTH+1)))*(encoder->in.width>>1)];
|
||||
pixel *base_v = &encoder->in.cur_pic->v_data[x_ctb*(LCU_WIDTH>>(MAX_DEPTH+1)) + (y_ctb*(LCU_WIDTH>>(MAX_DEPTH+1)))*(encoder->in.width>>1)];
|
||||
|
@ -1130,7 +1129,7 @@ void encode_coding_tree(encoder_control *encoder, uint16_t x_ctb,
|
|||
encode_transform_coeff(encoder, &ti,depth, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// END for each part
|
||||
} else if (cur_cu->type == CU_INTRA) {
|
||||
|
|
Loading…
Reference in a new issue