author | Peng Yixin <yixin.peng@amlogic.com> | 2019-12-25 14:43:08 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-01-07 09:29:28 (GMT) |
commit | 7cf525309950089d56b208e6467a1e0af9337238 (patch) | |
tree | f4e3232d1d79cd6c97e3a46059c798d1e48c94e0 | |
parent | 043ae8b4e264b34ecea4c0b23a4a084db43a9b29 (diff) | |
download | media_modules-7cf525309950089d56b208e6467a1e0af9337238.zip media_modules-7cf525309950089d56b208e6467a1e0af9337238.tar.gz media_modules-7cf525309950089d56b208e6467a1e0af9337238.tar.bz2 |
media_module: A minute later, display the previous frame with the mosaic [1/1]
PD#OTT-7781
Problem:
Due to some error data in the video stream, several reference frames
remained in the DPB queue and were referenced by other frames
incorrectly later, resulting in show mosaic picture.
Solution:
A timeout mechanism has been added so that when one frame is in
the DPB queue for a long time, this frame will be forcibly removed
from the DPB queue.
Verify:
U212
Change-Id: I42350771c2a88465750f20fbef2e463a4115d691
Signed-off-by: Peng Yixin <yixin.peng@amlogic.com>
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.c | 9 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/h264_dpb.h | 6 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 18 |
3 files changed, 31 insertions, 2 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c index 4cc9a07..bbf30a3 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c @@ -1622,6 +1622,8 @@ static void insert_picture_in_dpb(struct h264_dpb_stru *p_H264_Dpb, */ dpb_print(p_H264_Dpb->decoder_index, PRINT_FLAG_DPB_DETAIL, "%s %p %p\n", __func__, fs, p); + p_H264_Dpb->dpb_frame_count++; + fs->dpb_frame_count = p_H264_Dpb->dpb_frame_count; #if 1 /* rain */ /* p->buf_spec_num = fs->index; */ @@ -1796,7 +1798,7 @@ void reset_frame_store(struct h264_dpb_stru *p_H264_Dpb, } } -static void unmark_for_reference(struct DecodedPictureBuffer *p_Dpb, +void unmark_for_reference(struct DecodedPictureBuffer *p_Dpb, struct FrameStore *fs) { struct h264_dpb_stru *p_H264_Dpb = container_of(p_Dpb, @@ -2699,6 +2701,11 @@ void dump_dpb(struct DecodedPictureBuffer *p_Dpb, u8 force) 0, "non_existing "); } + dpb_print_cont(p_H264_Dpb->decoder_index, + 0, + "dpb_frame_count %d ", + p_Dpb->fs[i]->dpb_frame_count); + #if (MVC_EXTENSION_ENABLE) if (p_Dpb->fs[i]->is_reference) dpb_print_cont(p_H264_Dpb->decoder_index, diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h index 7f11582..f701d47 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.h +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.h @@ -805,6 +805,7 @@ struct FrameStore { int max_mv; int min_mv; int avg_mv; + int dpb_frame_count; }; @@ -897,6 +898,7 @@ struct h264_dpb_stru { unsigned int origin_max_reference; unsigned int first_insert_frame; int first_output_poc; + int dpb_frame_count; }; @@ -960,4 +962,8 @@ enum PictureStructure get_cur_slice_picture_struct( int dpb_check_ref_list_error( struct h264_dpb_stru *p_H264_Dpb); + +void unmark_for_reference(struct DecodedPictureBuffer *p_Dpb, + struct FrameStore *fs); + #endif diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 965dbda..8361006 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -275,7 +275,7 @@ static unsigned int i_only_flag; bit[17] 1: If the decoded Mb count is insufficient but greater than the threshold, it is considered the correct frame. bit[18] 1: time out status, store pic to dpb buffer. */ -static unsigned int error_proc_policy = 0x7Cfb6; /*0x1f14*/ +static unsigned int error_proc_policy = 0xCfb6; /*0x1f14*/ /* @@ -8211,6 +8211,22 @@ static void vh264_work_implement(struct vdec_h264_hw_s *hw, /* if (!hw->ctx_valid) hw->ctx_valid = 1; */ result_done: + { + if (error_proc_policy & 0x8000) { + struct h264_dpb_stru *p_H264_Dpb = &hw->dpb; + int i; + struct DecodedPictureBuffer *p_Dpb = &p_H264_Dpb->mDPB; + + for (i = 0; i < p_Dpb->used_size; i++) { + if (p_Dpb->fs[i]->dpb_frame_count + 500 < p_H264_Dpb->dpb_frame_count) { + dpb_print(DECODE_ID(hw), + 0, + "unmark reference dpb_frame_count diffrence large in dpb\n"); + unmark_for_reference(p_Dpb, p_Dpb->fs[i]); + } + } + } + } if (hw->mmu_enable && hw->frame_busy && hw->frame_done) { long used_4k_num; |