[ibc] Tune search costs a bit and revert debug vector scaling

This commit is contained in:
Marko Viitanen 2022-07-03 10:07:17 +03:00
parent 0fdf96fab2
commit 7ce01b4826
2 changed files with 4 additions and 4 deletions

View file

@ -131,7 +131,7 @@ void uvg_dbg_yuview_init(const encoder_control_t* const encoder, char* filename,
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
fprintf(yuview_output, "%%;type;13;MVInterL0;vector\r\n");
fprintf(yuview_output, "%%;vectorColor;0;0;0;255\r\n");
fprintf(yuview_output, "%%;scaleFactor;4\r\n");
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
fprintf(yuview_output, "%%;type;14;MVInterL1;vector\r\n");
fprintf(yuview_output, "%%;vectorColor;255;255;255;255\r\n");
fprintf(yuview_output, "%%;scaleFactor;16\r\n");

View file

@ -1064,13 +1064,13 @@ static double search_cu(
uvg_inter_recon_cu(state, lcu, x, y, CU_WIDTH_FROM_DEPTH(depth), true, state->encoder_control->chroma_format != UVG_CSP_400);
if (optimized_sad != NULL) {
ibc_cost_y = ibc_cost = optimized_sad(lcu->rec.y + offset, &state->tile->frame->source->y[y * source_stride + x], cu_width, LCU_WIDTH, source_stride);
ibc_cost_y = ibc_cost = 3*optimized_sad(lcu->rec.y + offset, &state->tile->frame->source->y[y * source_stride + x], cu_width, LCU_WIDTH, source_stride);
if(state->encoder_control->chroma_format != UVG_CSP_400) {
ibc_cost += optimized_sad(lcu->rec.u + offset_c, &state->tile->frame->source->u[(y / 2) * source_stride / 2 + x / 2], cu_width / 2, LCU_WIDTH_C, source_stride / 2);
ibc_cost += optimized_sad(lcu->rec.v + offset_c, &state->tile->frame->source->v[(y / 2) * source_stride / 2 + x / 2], cu_width / 2, LCU_WIDTH_C, source_stride / 2);
}
} else {
ibc_cost_y = ibc_cost = uvg_reg_sad(lcu->rec.y + offset, &state->tile->frame->source->y[y * source_stride + x], cu_width,cu_width, LCU_WIDTH, source_stride);
ibc_cost_y = ibc_cost = 3*uvg_reg_sad(lcu->rec.y + offset, &state->tile->frame->source->y[y * source_stride + x], cu_width,cu_width, LCU_WIDTH, source_stride);
if(state->encoder_control->chroma_format != UVG_CSP_400) {
ibc_cost += uvg_reg_sad(lcu->rec.u + offset_c, &state->tile->frame->source->u[(y / 2) * source_stride / 2 + x / 2], cu_width / 2, cu_width / 2, LCU_WIDTH_C, source_stride / 2);
ibc_cost += uvg_reg_sad(lcu->rec.v + offset_c, &state->tile->frame->source->v[(y / 2) * source_stride / 2 + x / 2], cu_width / 2, cu_width / 2, LCU_WIDTH_C, source_stride / 2);
@ -1081,7 +1081,7 @@ static double search_cu(
base_cost_y = ibc_cost_y;
best_vector[0] = cur_cu->inter.mv[0][0];
best_vector[1] = cur_cu->inter.mv[0][1];
//break;
break;
}
}