fix: fix redundant prefix NALU amended problem

1. For normal Smart-P mode, if TSVC is not enabled, temporal_id can be
   zero, and no need to add prefix NAL.
2. For RK3588 H.264 dual core encoders working concurrently, redundant
   prefix_nal should also be removed, if prefix NALU is empty.

Change-Id: I89aca4f0cf418afb48e39a141107c5f4491a1ce1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2023-08-17 09:25:29 +08:00
parent 5ae03a4bdb
commit 65eea468b0
2 changed files with 4 additions and 1 deletions

View File

@@ -589,6 +589,9 @@ static MPP_RET hal_h264e_vepu580_get_task(void *hal, HalEncTask *task)
//store async encode TSVC info //store async encode TSVC info
if (ctx->prefix) if (ctx->prefix)
memcpy(prefix, ctx->prefix, sizeof(H264ePrefixNal)); memcpy(prefix, ctx->prefix, sizeof(H264ePrefixNal));
else
prefix = NULL;
if (ctx->slice) { if (ctx->slice) {
memcpy(slice, ctx->slice, sizeof(H264eSlice)); memcpy(slice, ctx->slice, sizeof(H264eSlice));

View File

@@ -852,7 +852,7 @@ MPP_RET mpi_enc_gen_smart_gop_ref_cfg(MppEncRefCfg ref, RK_S32 gop_len, RK_S32 v
/* st 1 layer 1 - non-ref */ /* st 1 layer 1 - non-ref */
if (vi_len > 1) { if (vi_len > 1) {
st_ref[pos].is_non_ref = 0; st_ref[pos].is_non_ref = 0;
st_ref[pos].temporal_id = 1; st_ref[pos].temporal_id = 0;
st_ref[pos].ref_mode = REF_TO_PREV_REF_FRM; st_ref[pos].ref_mode = REF_TO_PREV_REF_FRM;
st_ref[pos].ref_arg = 0; st_ref[pos].ref_arg = 0;
st_ref[pos].repeat = vi_len - 2; st_ref[pos].repeat = vi_len - 2;