vmh264: fix h264 error recovery issue [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Wed, 27 May 2020 06:40:05 +0000 (14:40 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 3 Jun 2020 08:25:50 +0000 (16:25 +0800)
PD#SWPL-26869

Problem:
the stream has many frame drop. frame num is discontinue
which cause gap fill in error

Solution:
if frame_num_gap_allowed = 0, ignore the fill frame num
gap and mark frame error

Verify:
U212

Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
Change-Id: Ib7fc3ed98ba79aaa7d95f1253b45669e6363129f

drivers/frame_provider/decoder/h264_multi/h264_dpb.c
drivers/frame_provider/decoder/h264_multi/h264_dpb.h

index 56ee63731ccdb4d5ac7971ee0d78a00dbe550202..4b67107a0df36551587cc9cbfe2e000ea720deb7 100644 (file)
@@ -428,6 +428,7 @@ void slice_prepare(struct h264_dpb_stru *p_H264_Dpb,
        /* pSlice->adaptive_ref_pic_buffering_flag; */
        sps->log2_max_frame_num_minus4 =
                p_H264_Dpb->dpb_param.l.data[LOG2_MAX_FRAME_NUM] - 4;
+       sps->frame_num_gap_allowed = p_H264_Dpb->dpb_param.l.data[FRAME_NUM_GAP_ALLOWED];
 
        p_Vid->non_conforming_stream =
                p_H264_Dpb->dpb_param.l.data[NON_CONFORMING_STREAM];
@@ -5763,6 +5764,7 @@ int h264_slice_header_process(struct h264_dpb_stru *p_H264_Dpb, int *frame_num_g
                        currSlice->frame_num != p_Vid->pre_frame_num &&
                        currSlice->frame_num !=
                        (p_Vid->pre_frame_num + 1) % p_Vid->max_frame_num) {
+                       struct SPSParameters *active_sps = p_Vid->active_sps;
                        /*if (active_sps->
                         *gaps_in_frame_num_value_allowed_flag
                         *== 0) {
@@ -5772,7 +5774,8 @@ int h264_slice_header_process(struct h264_dpb_stru *p_H264_Dpb, int *frame_num_g
                         *}
                         *if (p_Vid->conceal_mode == 0)
                         */
-                       fill_frame_num_gap(p_Vid, currSlice);
+                        if (active_sps->frame_num_gap_allowed)
+                               fill_frame_num_gap(p_Vid, currSlice);
                        *frame_num_gap = 1;
                }
 
index 52a6650691fe4c1b19a694d9068eef77b13bec67..619ba416b70932e2423b00b256602c2ed5c48dec 100644 (file)
@@ -483,8 +483,8 @@ struct SPSParameters {
        int frame_mbs_only_flag;
        int num_ref_frames;
        int max_dpb_size;
-
        int log2_max_frame_num_minus4;
+       int frame_num_gap_allowed;
 };
 
 #define DEC_REF_PIC_MARKING_BUFFER_NUM_MAX   45