From b85dd03459445af9c870c4df084b7d26936e28b7 Mon Sep 17 00:00:00 2001 From: shihong.zheng Date: Fri, 25 Oct 2019 03:30:13 +0000 Subject: mpeg2: fix mosaics when set error_skip. [1/1] PD#SWPL-12375 Problem: mpeg2 mosaics after set error_frame_skip_level to 2. a error p frame store to ref list, so have not set error skip flag in error_skip(). the next mosaic b frame display before p. Solution: set b frame error when error p in ref list. set error_frame_skip_level to 2 default. Verify: u212 Change-Id: Ide23f0cf8a5f6ef72e1a6a6e129a7f7f1ef658fa Signed-off-by: shihong.zheng --- diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index a6f25be..6f64b7c 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -106,7 +106,7 @@ static u32 buf_size = 32 * 1024 * 1024; static int pre_decode_buf_level = 0x800; static u32 dec_control; -static u32 error_frame_skip_level; +static u32 error_frame_skip_level = 2; static u32 stat; static u32 udebug_flag; static unsigned int radr; @@ -1409,6 +1409,15 @@ static int update_reference(struct vdec_mpeg12_hw_s *hw, return index; } +static bool is_ref_error(struct vdec_mpeg12_hw_s *hw) +{ + if ((hw->pics[hw->refs[0]].buffer_info & PICINFO_ERROR) || + (hw->pics[hw->refs[1]].buffer_info & PICINFO_ERROR)) + return 1; + return 0; +} + + static irqreturn_t vmpeg12_isr_thread_fn(struct vdec_s *vdec, int irq) { u32 reg, index, info, seqinfo, offset, pts, frame_size, tmp; @@ -1537,6 +1546,11 @@ static irqreturn_t vmpeg12_isr_thread_fn(struct vdec_s *vdec, int irq) hw->frame_prog = 0; force_interlace_check(hw); + if (is_ref_error(hw)) { + if ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_B) + new_pic->buffer_info |= PICINFO_ERROR; + } + if (((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_I) || ((info & PICINFO_TYPE_MASK) == PICINFO_TYPE_P)) { index = update_reference(hw, index); -- cgit