mpeg12: fix frame mode frame drop. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Mon, 1 Jun 2020 05:56:45 +0000 (13:56 +0800)
committerShihong Zheng <shihong.zheng@amlogic.com>
Mon, 1 Jun 2020 14:27:39 +0000 (07:27 -0700)
PD#SWPL-25896

Problem:
mpeg12 frame mode drop frame abnormal.

Solution:
the pb_skip old code caused error drop,
so remove it.
add some static for global var.

Verify:
u212

Change-Id: I84712cfe1aeeaefa2f43165aaf9d1e4b39a6092e
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/frame_provider/decoder/avs_multi/avs_multi.c
drivers/frame_provider/decoder/h265/vh265.c
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
drivers/frame_provider/decoder/utils/frame_check.c

index dd5a7b6b17464298b14478820c378da323ab89e5..f8a4b1b3fda5f6f11cfa8fe6efad3813230bc04c 100644 (file)
@@ -278,9 +278,9 @@ static u32 vf_buf_num = 8;
 /*static u32 vf_buf_num_used;*/
 static u32 canvas_base = 128;
 #ifdef NV21
-       int     canvas_num = 2; /*NV21*/
+static int     canvas_num = 2; /*NV21*/
 #else
-       int     canvas_num = 3;
+static int     canvas_num = 3;
 #endif
 
 #if 0
@@ -1604,7 +1604,7 @@ static int vavs_event_cb(int type, void *data, void *private_data)
        return 0;
 }
 
-int vavs_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
+static int vavs_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
 {
        struct vdec_avs_hw_s *hw =
        (struct vdec_avs_hw_s *)vdec->private;
@@ -1637,7 +1637,7 @@ int vavs_dec_status(struct vdec_s *vdec, struct vdec_info *vstatus)
        return 0;
 }
 
-int vavs_set_isreset(struct vdec_s *vdec, int isreset)
+static int vavs_set_isreset(struct vdec_s *vdec, int isreset)
 {
        struct vdec_avs_hw_s *hw =
        (struct vdec_avs_hw_s *)vdec->private;
@@ -1800,7 +1800,7 @@ static int vavs_canvas_init(struct vdec_avs_hw_s *hw)
        return 0;
 }
 
-void vavs_recover(struct vdec_avs_hw_s *hw)
+static void vavs_recover(struct vdec_avs_hw_s *hw)
 {
        vavs_canvas_init(hw);
 
index 8a4eda655db7cde1dccfde4f746c070394993a92..f17d7204286a5becb5a583d31321abb5e73848d4 100644 (file)
@@ -521,7 +521,7 @@ static u32 force_bypass_dvenl;
 #define get_buffer_mode(hevc) buffer_mode
 
 
-DEFINE_SPINLOCK(lock);
+static DEFINE_SPINLOCK(lock);
 struct task_struct *h265_task = NULL;
 #undef DEBUG_REG
 #ifdef DEBUG_REG
@@ -1761,7 +1761,7 @@ struct hevc_state_s {
 } /*hevc_stru_t */;
 
 #ifdef AGAIN_HAS_THRESHOLD
-u32 again_threshold;
+static u32 again_threshold;
 #endif
 #ifdef SEND_LMEM_WITH_RPM
 #define get_lmem_params(hevc, ladr) \
index 4e3ffcde6506117068bf1e4f42e5fe7f88712bec..8a0bb194fdbee99cba969585a18196db481cbaed 100644 (file)
@@ -148,7 +148,7 @@ static unsigned int decode_timeout_val = 200;
 #define AGAIN_HAS_THRESHOLD
 
 #ifdef AGAIN_HAS_THRESHOLD
-u32 again_threshold;
+static u32 again_threshold;
 #endif
 
 /*
@@ -1544,8 +1544,6 @@ static int prepare_display_buf(struct vdec_mpeg12_hw_s *hw,
                        nv_order = VIDTYPE_VIU_NV12;
        }
 
-       pb_skip = (hw->pics[hw->refs[0]].offset ==
-               hw->pics[hw->refs[1]].offset);
        if (hw->i_only) {
                pb_skip = 1;
        }
index accb4305feb4a2322b0dd5e70966996478211446..03ad462e46dde1090958edc273137e1d99bc7078 100644 (file)
@@ -158,7 +158,7 @@ static int get_frame_size(struct pic_check_mgr_t *pic,
 static int canvas_get_virt_addr(struct pic_check_mgr_t *pic,
        struct vframe_s *vf)
 {
-       int phy_y_addr, phy_uv_addr;
+       unsigned long phy_y_addr, phy_uv_addr;
        void *vaddr_y, *vaddr_uv;
 
        if ((vf->canvas0Addr == vf->canvas1Addr) &&
@@ -174,7 +174,7 @@ static int canvas_get_virt_addr(struct pic_check_mgr_t *pic,
        vaddr_uv = codec_mm_phys_to_virt(phy_uv_addr);
 
        if (((!vaddr_y) || (!vaddr_uv)) && ((!phy_y_addr) || (!phy_uv_addr))) {
-               dbg_print(FC_ERROR, "%s, y_addr %p(0x%x), uv_addr %p(0x%x)\n",
+               dbg_print(FC_ERROR, "%s, y_addr %p(0x%lx), uv_addr %p(0x%lx)\n",
                        __func__, vaddr_y, phy_y_addr, vaddr_uv, phy_uv_addr);
                return -1;
        }
@@ -595,7 +595,8 @@ static int crc_store(struct pic_check_mgr_t *mgr, struct vframe_s *vf,
                                                mgr->pic_dump.num++;
                                        dbg_print(0, "\n\nError: %08d: %08x %08x != %08x %08x\n\n",
                                                mgr->frame_cnt, crc_y, crc_uv, comp_crc_y, comp_crc_uv);
-                                       do_yuv_dump(mgr, vf);
+                                       if (!(vf->type & VIDTYPE_SCATTER))
+                                               do_yuv_dump(mgr, vf);
                                        if (fc_debug & FC_ERR_CRC_BLOCK_MODE)
                                                mgr->err_crc_block = 1;
                                        mgr->usr_cmp_result = -mgr->frame_cnt;