diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index 45c497c6..1cc3b3a6 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -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); } diff --git a/src/search_intra.c b/src/search_intra.c index 21842ad5..588aee96 100644 --- a/src/search_intra.c +++ b/src/search_intra.c @@ -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); diff --git a/src/strategies/generic/encode_coding_tree-generic.c b/src/strategies/generic/encode_coding_tree-generic.c index 49c9c8af..437440c5 100644 --- a/src/strategies/generic/encode_coding_tree-generic.c +++ b/src/strategies/generic/encode_coding_tree-generic.c @@ -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 ****