mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 13:23:41 +08:00
[h264e]: Fix slice / dpb operation errors
1. long-term reference flag in IDR frame should be clear at next frame. Otherwise multi-slice operation will be error. 2. The max long-term reference index is reset to zero at IDR. So the new sequence must redefine its own value again. 3. The end bits of prefix nal should be flushed. Signed-off-by: Herman Chen <herman.chen@rock-chips.com> Change-Id: Ia9ba01719861401c2ca95ded3ccfc537c3b10083
This commit is contained in:
@@ -357,6 +357,7 @@ void h264e_dpb_build_marking(H264eDpb *dpb)
|
||||
}
|
||||
|
||||
marking->idr_flag = 0;
|
||||
marking->long_term_reference_flag = 0;
|
||||
marking->adaptive_ref_pic_buffering = 0;
|
||||
|
||||
h264e_dbg_dpb("frm %d ref %d lt %d T%d\n",
|
||||
@@ -415,6 +416,8 @@ MPP_RET h264e_dpb_proc(H264eDpb *dpb, EncCpbStatus *cpb)
|
||||
frames[i].status.valid = 0;
|
||||
}
|
||||
dpb->used_size = 0;
|
||||
dpb->curr_max_lt_idx = 0;
|
||||
dpb->next_max_lt_idx = 0;
|
||||
}
|
||||
|
||||
if (h264e_debug & H264E_DBG_DPB)
|
||||
|
@@ -191,9 +191,6 @@ void write_marking(MppWriteCtx *s, H264eMarkingInfo *marking)
|
||||
mpp_writer_put_bits(s, marking->long_term_reference_flag, 1);
|
||||
h264e_dbg_slice("used bit %2d long_term_reference_flag %d\n",
|
||||
mpp_writer_bits(s), marking->long_term_reference_flag);
|
||||
|
||||
// clear long_term_reference_flag flag
|
||||
marking->long_term_reference_flag = 0;
|
||||
} else {
|
||||
h264e_dbg_mmco("mmco count %d\n", marking->wr_cnt);
|
||||
|
||||
@@ -907,6 +904,8 @@ RK_S32 h264e_slice_write_prefix_nal_unit_svc(H264ePrefixNal *prefix, void *p, RK
|
||||
mpp_writer_trailing(s);
|
||||
}
|
||||
|
||||
mpp_writer_flush(s);
|
||||
|
||||
bitCnt = s->buffered_bits + s->byte_cnt * 8;
|
||||
|
||||
return bitCnt;
|
||||
|
Reference in New Issue
Block a user