[debug] Add yuview debug output for transform skip

This commit is contained in:
Marko Viitanen 2021-12-03 19:38:50 +02:00
parent 545fc305e7
commit f501465e8d
3 changed files with 5 additions and 2 deletions

View file

@ -144,6 +144,8 @@ void kvz_dbg_yuview_init(const encoder_control_t* const encoder, char* filename,
fprintf(yuview_output, "%%;type;17;NumSigCoeffV;range\r\n");
fprintf(yuview_output, "%%;range;0;1024;0;255;0;255;0;255;255;255\r\n");
fprintf(yuview_output, "%%;scaleToBlockSize;1\r\n");
fprintf(yuview_output, "%%;type;18;TR-Skip;range\r\n");
fprintf(yuview_output, "%%;defaultRange;0;2;heat\r\n");
}

View file

@ -53,7 +53,8 @@ enum {
DBG_YUVIEW_NUM_SIG_COEFF_Y = 15,
DBG_YUVIEW_NUM_SIG_COEFF_U = 16,
DBG_YUVIEW_NUM_SIG_COEFF_V = 17,
DBG_YUVIEW_NUM_ITEMS = 18,
DBG_YUVIEW_TR_SKIP = 18,
DBG_YUVIEW_NUM_ITEMS = 19,
};

View file

@ -416,7 +416,7 @@ static void encode_transform_unit(encoder_state_t * const state,
if(state->encoder_control->cfg.trskip_enable && width <= (1 << state->encoder_control->cfg.trskip_max_size)) {
cabac->cur_ctx = &cabac->ctx.transform_skip_model_luma;
CABAC_BIN(cabac, cur_pu->tr_idx == MTS_SKIP, "transform_skip_flag");
DBG_YUVIEW_VALUE(state->frame->poc, DBG_YUVIEW_TR_SKIP, x, y, width, width, (cur_pu->tr_idx == MTS_SKIP) ? 1 : 0);
}
if(cur_pu->tr_idx == MTS_SKIP) {
kvz_encode_ts_residual(state, cabac, coeff_y, width, 0, scan_idx);