mpeg2: fix mosaics when set error_skip. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Fri, 25 Oct 2019 03:30:13 +0000 (11:30 +0800)
committershihong.zheng <shihong.zheng@amlogic.com>
Fri, 25 Oct 2019 03:36:49 +0000 (11:36 +0800)
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 <shihong.zheng@amlogic.com>
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c

index a6f25beae54211dd12cccd0c609191ada11110fd..6f64b7c4ae9054562df7b9206107a9a3e6f9df6c 100644 (file)
 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);