From 5c2f044d432d6b25c04a8f0c0947b8d2aa045a87 Mon Sep 17 00:00:00 2001 From: Ding Wei Date: Wed, 22 Aug 2018 16:55:44 +0800 Subject: [PATCH] [h264d]: relax condition: check frame_num continue tips: 1. In h264 protocol, last frame is used for reference, current frame num must increase by one, otherwise equel last frame. 2. Very few error stream, not increase by one, then consider it error. for this case, relax condition, just check cur->frame_num is equal to last_frame->frame_num or increse by one, not consider whehter last_frame is reference or not. Change-Id: I885074b781fa5a53419e77e9e73243b439bf15d4 Signed-off-by: Ding Wei --- mpp/codec/dec/h264/h264d_init.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mpp/codec/dec/h264/h264d_init.c b/mpp/codec/dec/h264/h264d_init.c index a8a11ab8..a0aa300f 100644 --- a/mpp/codec/dec/h264/h264d_init.c +++ b/mpp/codec/dec/h264/h264d_init.c @@ -509,13 +509,12 @@ static MPP_RET check_dpb_discontinuous(H264_StorePic_t *p_last, H264_StorePic_t #if 1 if (p_last && dec_pic && (dec_pic->slice_type != I_SLICE)) { RK_U32 error_flag = 0; - RK_U32 wrap_frame_num = 0; - if (p_last->used_for_reference && !dec_pic->combine_flag) { - wrap_frame_num = (p_last->frame_num + 1) % currSlice->p_Vid->max_frame_num; - } else { - wrap_frame_num = p_last->frame_num; - } - error_flag = (wrap_frame_num != dec_pic->frame_num) ? 1 : 0; + + if (dec_pic->frame_num == p_last->frame_num || + dec_pic->frame_num == (p_last->frame_num + 1)) + error_flag = 0; + else + error_flag = 1; currSlice->p_Dec->errctx.cur_err_flag |= error_flag ? 1 : 0; H264D_DBG(H264D_DBG_DISCONTINUOUS, "[discontinuous] last_slice=%d, cur_slice=%d, last_fnum=%d, cur_fnum=%d, last_poc=%d, cur_poc=%d",