mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Remove debug stuff and disable intra NxN in preparation for a merge.
- Re-enable intra search based on reconstructed image. - This didn't have as much of an effect as I thought it would. - Re-enable SAO and deblocking. - Disable NxN searching. (4x4 luma coding is still broken)
This commit is contained in:
parent
bf80007270
commit
e33655fde5
|
@ -146,11 +146,11 @@ int main(int argc, char *argv[])
|
|||
encoder->QP = 32;
|
||||
encoder->in.video_format = FORMAT_420;
|
||||
// deblocking filter
|
||||
encoder->deblock_enable = 0;
|
||||
encoder->deblock_enable = 1;
|
||||
encoder->beta_offset_div2 = 0;
|
||||
encoder->tc_offset_div2 = 0;
|
||||
// SAO
|
||||
encoder->sao_enable = 0;
|
||||
encoder->sao_enable = 1;
|
||||
|
||||
init_encoder_input(&encoder->in, input, cfg->width, cfg->height);
|
||||
|
||||
|
|
|
@ -1582,14 +1582,13 @@ void encode_transform_tree(encoder_control *encoder, int32_t x_pu, int32_t y_pu,
|
|||
for (i = 0; i < width * width; i++) {
|
||||
if (coeff_y[i] != 0) {
|
||||
// Found one, we can break here
|
||||
cur_cu->coeff_y = 1;
|
||||
cbf_y = 1;
|
||||
if (depth <= MAX_DEPTH) {
|
||||
cur_cu->coeff_y = 1;
|
||||
cur_cu->coeff_top_y[depth] = 1;
|
||||
cbf_y = 1;
|
||||
} else {
|
||||
int pu_index = x_pu % 2 + 2 * (y_pu % 2);
|
||||
cur_cu->coeff_top_y[depth + pu_index] = 1;
|
||||
cbf_y = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1644,8 +1643,8 @@ void encode_transform_tree(encoder_control *encoder, int32_t x_pu, int32_t y_pu,
|
|||
for (i = 0; i < chroma_size; i++) {
|
||||
if (coeff_u[i] != 0) {
|
||||
// Found one, we can break here
|
||||
cur_cu->coeff_u = 1;
|
||||
cur_cu->coeff_top_u[depth] = 1;
|
||||
cur_cu->coeff_u = 1;
|
||||
cur_cu->coeff_top_u[depth] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1653,8 +1652,8 @@ void encode_transform_tree(encoder_control *encoder, int32_t x_pu, int32_t y_pu,
|
|||
for (i = 0; i < chroma_size; i++) {
|
||||
if (coeff_v[i] != 0) {
|
||||
// Found one, we can break here
|
||||
cur_cu->coeff_v = 1;
|
||||
cur_cu->coeff_top_v[depth] = 1;
|
||||
cur_cu->coeff_v = 1;
|
||||
cur_cu->coeff_top_v[depth] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2244,7 +2243,7 @@ void encode_block_residual(encoder_control *encoder,
|
|||
|
||||
if (cur_cu->type == CU_INTRA) {
|
||||
// INTRAPREDICTION VARIABLES
|
||||
//pixel pred_y[LCU_WIDTH * LCU_WIDTH];
|
||||
pixel pred_y[LCU_WIDTH * LCU_WIDTH];
|
||||
|
||||
pixel *recbase_y = &encoder->in.cur_pic->y_recdata[x_ctb * (LCU_WIDTH >> (MAX_DEPTH)) + (y_ctb * (LCU_WIDTH >> (MAX_DEPTH))) * encoder->in.width];
|
||||
pixel *recbase_u = &encoder->in.cur_pic->u_recdata[x_ctb * (LCU_WIDTH >> (MAX_DEPTH + 1)) + (y_ctb * (LCU_WIDTH >> (MAX_DEPTH + 1))) * (encoder->in.width >> 1)];
|
||||
|
@ -2268,10 +2267,13 @@ void encode_block_residual(encoder_control *encoder,
|
|||
|
||||
cur_cu->intra[0].mode_chroma = 36; // TODO: Chroma intra prediction
|
||||
|
||||
// Disable for now because it doesn't implement NxN yet.
|
||||
/*intra_build_reference_border(encoder->in.cur_pic, x_ctb, y_ctb,
|
||||
(LCU_WIDTH >> (depth)) * 2 + 8, rec,
|
||||
(LCU_WIDTH >> (depth)) * 2 + 8, 0);
|
||||
// This does not support NxN yet.
|
||||
// A quick test with 10 frames of PeopleOnStreet_3840x2160 showed that
|
||||
// re-doing the search here with actual reconstructed reference lowered
|
||||
// bitrate by 4% and improved luma PSNR by 0.03dB. Doing it here might
|
||||
// not be worth it.
|
||||
intra_build_reference_border(encoder->in.cur_pic, x_ctb * 8, y_ctb * 8,
|
||||
width * 2 + 8, rec, width * 2 + 8, 0);
|
||||
cur_cu->intra[0].mode = (int8_t)intra_prediction(encoder->in.cur_pic->y_data,
|
||||
encoder->in.width,
|
||||
rec_shift,
|
||||
|
@ -2281,7 +2283,9 @@ void encode_block_residual(encoder_control *encoder,
|
|||
width, pred_y, width,
|
||||
&cur_cu->intra[0].cost);
|
||||
intra_set_block_mode(encoder->in.cur_pic, x_ctb, y_ctb, depth,
|
||||
cur_cu->intra[0].mode, cur_cu->part_size);*/
|
||||
cur_cu->intra[0].mode, cur_cu->part_size);
|
||||
intra_set_block_mode(encoder->in.cur_pic, x_ctb, y_ctb, depth,
|
||||
cur_cu->intra[0].mode, cur_cu->part_size);
|
||||
|
||||
|
||||
|
||||
|
|
15
src/intra.c
15
src/intra.c
|
@ -62,21 +62,6 @@ void intra_set_block_mode(picture *pic,uint32_t x_cu, uint32_t y_cu, uint8_t dep
|
|||
cur_cu->tr_depth = depth;
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through all the blocks in the area of cur_cu
|
||||
/*for (y = y_cu; y < y_cu + block_scu_width; y++) {
|
||||
int cu_pos = y * width_in_scu;
|
||||
for (x = x_cu; x < x_cu + block_scu_width; x++) {
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].depth = depth;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].type = CU_INTRA;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].intra[0].mode = mode;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].intra[1].mode = mode;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].intra[2].mode = mode;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].intra[3].mode = mode;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].part_size = part_mode;
|
||||
pic->cu_array[MAX_DEPTH][cu_pos + x].tr_depth = depth;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -400,7 +400,8 @@ void search_intra(encoder_control *encoder, uint16_t x_ctb, uint16_t y_ctb, uint
|
|||
cur_cu->part_size = SIZE_2Nx2N;
|
||||
|
||||
// Do search for NxN split.
|
||||
if (1 && depth == MAX_DEPTH) { // Disabled because coding NxN doesn't work yet.
|
||||
// This feature doesn't work yet so it is disabled.
|
||||
if (0 && depth == MAX_DEPTH) { // Disabled because coding NxN doesn't work yet.
|
||||
// Save 2Nx2N information to compare with NxN.
|
||||
int nn_cost = cur_cu->intra[0].cost;
|
||||
int nn_mode = cur_cu->intra[0].mode;
|
||||
|
@ -525,9 +526,6 @@ uint32_t search_best_mode(encoder_control *encoder,
|
|||
} else {
|
||||
intra_set_block_mode(encoder->in.cur_pic, x_ctb, y_ctb, depth,
|
||||
cur_cu->intra[0].mode, cur_cu->part_size);
|
||||
if (cur_cu->part_size == SIZE_NxN) {
|
||||
printf("coded NxN (%u, %u)\n", x_ctb, y_ctb);
|
||||
}
|
||||
return best_intra_cost;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue