From f501465e8d17010fb5e8d4fe5c41d361669f9f41 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Fri, 3 Dec 2021 19:38:50 +0200 Subject: [PATCH] [debug] Add yuview debug output for transform skip --- src/debug.c | 2 ++ src/debug.h | 3 ++- src/encode_coding_tree.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/debug.c b/src/debug.c index c5f13cfc..50b90e03 100644 --- a/src/debug.c +++ b/src/debug.c @@ -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"); } diff --git a/src/debug.h b/src/debug.h index 8ee2def0..7c9197a8 100644 --- a/src/debug.h +++ b/src/debug.h @@ -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, }; diff --git a/src/encode_coding_tree.c b/src/encode_coding_tree.c index 030f6881..0d68cc6f 100644 --- a/src/encode_coding_tree.c +++ b/src/encode_coding_tree.c @@ -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);