fix[enc]: Add use_lt_idx to output packet meta

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9d02f68362f4e294489c23d313edc2cc81925440
This commit is contained in:
Herman Chen
2024-05-21 15:33:10 +08:00
parent 293f61a8f6
commit 530eceb7d0
2 changed files with 8 additions and 1 deletions

View File

@@ -2234,6 +2234,9 @@ static MPP_RET set_enc_info_to_packet(MppEncImpl *enc, HalEncTask *hal_task)
/* frame type */ /* frame type */
mpp_meta_set_s32(meta, KEY_OUTPUT_INTRA, frm->is_intra); mpp_meta_set_s32(meta, KEY_OUTPUT_INTRA, frm->is_intra);
mpp_meta_set_s32(meta, KEY_OUTPUT_PSKIP, frm->force_pskip || is_pskip); mpp_meta_set_s32(meta, KEY_OUTPUT_PSKIP, frm->force_pskip || is_pskip);
if (rc_task->info.frame_type == INTER_VI_FRAME)
mpp_meta_set_s32(meta, KEY_ENC_USE_LTR, rc_task->cpb.refr.lt_idx);
} }
/* start qp and average qp */ /* start qp and average qp */
mpp_meta_set_s32(meta, KEY_ENC_START_QP, rc_task->info.quality_target); mpp_meta_set_s32(meta, KEY_ENC_START_QP, rc_task->info.quality_target);

View File

@@ -815,6 +815,7 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
RK_S32 temporal_id = 0; RK_S32 temporal_id = 0;
RK_S32 lt_idx = -1; RK_S32 lt_idx = -1;
RK_S32 avg_qp = -1; RK_S32 avg_qp = -1;
RK_S32 use_lt_idx = -1;
if (MPP_OK == mpp_meta_get_s32(meta, KEY_TEMPORAL_ID, &temporal_id)) if (MPP_OK == mpp_meta_get_s32(meta, KEY_TEMPORAL_ID, &temporal_id))
log_len += snprintf(log_buf + log_len, log_size - log_len, log_len += snprintf(log_buf + log_len, log_size - log_len,
@@ -826,7 +827,10 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
if (MPP_OK == mpp_meta_get_s32(meta, KEY_ENC_AVERAGE_QP, &avg_qp)) if (MPP_OK == mpp_meta_get_s32(meta, KEY_ENC_AVERAGE_QP, &avg_qp))
log_len += snprintf(log_buf + log_len, log_size - log_len, log_len += snprintf(log_buf + log_len, log_size - log_len,
" qp %d", avg_qp); " qp %2d", avg_qp);
if (MPP_OK == mpp_meta_get_s32(meta, KEY_ENC_USE_LTR, &use_lt_idx))
log_len += snprintf(log_buf + log_len, log_size - log_len, " vi");
} }
mpp_log_q(quiet, "chn %d %s\n", chn, log_buf); mpp_log_q(quiet, "chn %d %s\n", chn, log_buf);