Fix intra neighboring block selection and clean some unused code

This commit is contained in:
Marko Viitanen 2020-04-16 14:12:40 +03:00
parent 27b4dd50f8
commit 86d76b19a4
3 changed files with 4 additions and 30 deletions

View file

@ -532,12 +532,12 @@ static void encode_intra_coding_unit(encoder_state_t * const state,
if (pu_x > 0) {
assert(pu_x >> 2 > 0);
left_pu = kvz_cu_array_at_const(frame->cu_array, pu_x - 1, pu_y);
left_pu = kvz_cu_array_at_const(frame->cu_array, pu_x - 1, pu_y + cu_width - 1);
}
// Don't take the above PU across the LCU boundary.
if (pu_y % LCU_WIDTH > 0 && pu_y > 0) {
assert(pu_y >> 2 > 0);
above_pu = kvz_cu_array_at_const(frame->cu_array, pu_x, pu_y - 1);
above_pu = kvz_cu_array_at_const(frame->cu_array, pu_x + cu_width - 1, pu_y - 1);
}

View file

@ -804,10 +804,10 @@ void kvz_search_cu_intra(encoder_state_t * const state,
// Select left and top CUs if they are available.
// Top CU is not available across LCU boundary.
if (x_px >= SCU_WIDTH) {
left_cu = LCU_GET_CU_AT_PX(lcu, lcu_px.x - 1, lcu_px.y);
left_cu = LCU_GET_CU_AT_PX(lcu, lcu_px.x - 1, lcu_px.y+ cu_width-1);
}
if (y_px >= SCU_WIDTH && lcu_px.y > 0) {
above_cu = LCU_GET_CU_AT_PX(lcu, lcu_px.x, lcu_px.y - 1);
above_cu = LCU_GET_CU_AT_PX(lcu, lcu_px.x+ cu_width-1, lcu_px.y - 1);
}
kvz_intra_get_dir_luma_predictor(x_px, y_px, candidate_modes, cur_cu, left_cu, above_cu);

View file

@ -235,32 +235,6 @@ void kvz_encode_coeff_nxn_generic(encoder_state_t * const state,
quant_state = (quant_state_transition_table >> ((quant_state << 2) + ((coeff[blk_pos] & 1) << 1))) & 3;
}
/*
**** SECOND PASS ****
*/
/*
if (next_pass) {
next_pass = 0;
for (scan_pos = first_sig_pos; scan_pos >= min_sub_pos; scan_pos--) {
blk_pos = scan[scan_pos];
pos_y = blk_pos >> log2_block_size;
pos_x = blk_pos - (pos_y << log2_block_size);
if (abs(coeff[blk_pos]) > 2) {
assert(scan_pos - min_sub_pos >= 0 && scan_pos - min_sub_pos < 16);
uint8_t* offset = &ctx_offset[scan_pos - min_sub_pos];
uint8_t gt2 = abs(coeff[blk_pos]) > 4 ? 1 : 0;
cabac->cur_ctx = (type == 0) ? &(cabac->ctx.cu_gtx_flag_model_luma[0][*offset]) :
&(cabac->ctx.cu_gtx_flag_model_chroma[0][*offset]);
CABAC_BIN(cabac, gt2, "gt2_flag");
next_pass |= gt2;
}
}
}
*/
/*
**** THIRD PASS ****
*/
/*
**** SECOND PASS: Go-rice ****