summaryrefslogtreecommitdiff
authormiaohong chen <miaohong.chen@amlogic.com>2020-07-14 13:28:23 (GMT)
committer Shen Liu <shen.liu@amlogic.com>2020-08-13 08:03:20 (GMT)
commite6a1752902c33dee2574ea1404ad45dd37eaf39a (patch)
tree804e891c374e466e833d71a6a684f23ac91b92b7
parent0470dd09d0a038e0c7f7410b1473c5beec99fecf (diff)
downloadmedia_modules-e6a1752902c33dee2574ea1404ad45dd37eaf39a.zip
media_modules-e6a1752902c33dee2574ea1404ad45dd37eaf39a.tar.gz
media_modules-e6a1752902c33dee2574ea1404ad45dd37eaf39a.tar.bz2
vmh264: stream mosaic [1/1]
PD#SWPL-29711 Problem: H264 stream mosaic Solution: The first gop of the code stream is a single slice, and the latter part is a multi-slice. Because the multi-slice detection mechanism is added before, the single slice decision is triggered by mistake, resulting in mosaic. Improve multi-slice detection mechanism. Verify: u212 Change-Id: I1e3491a1e0441eb50dcec8666c5ebffcd01ba1f7 Signed-off-by: miaohong chen <miaohong.chen@amlogic.com>
Diffstat
-rw-r--r--drivers/frame_provider/decoder/h264_multi/vmh264.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c
index 0633598..656a90d 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -5183,6 +5183,9 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq)
int frame_num_gap = 0;
/*unsigned char is_idr;*/
unsigned short *p = (unsigned short *)hw->lmem_addr;
+ unsigned mb_width = hw->seq_info2 & 0xff;
+ unsigned short first_mb_in_slice;
+ unsigned int decode_mb_count, mby_mbx;
reset_process_time(hw);
#ifdef DETECT_WRONG_MULTI_SLICE
hw->cur_picture_slice_count++;
@@ -5201,7 +5204,21 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq)
hw->picture_slice_count,
hw->cur_picture_slice_count,
hw->multi_slice_pic_flag);
- if (hw->cur_picture_slice_count > hw->last_picture_slice_count)
+
+ first_mb_in_slice = p[FIRST_MB_IN_SLICE + 3];
+ mby_mbx = READ_VREG(MBY_MBX);
+ decode_mb_count = ((mby_mbx & 0xff) * mb_width +
+ (((mby_mbx >> 8) & 0xff) + 1));
+
+ if (first_mb_in_slice == decode_mb_count &&
+ first_mb_in_slice != 0) {
+ dpb_print(DECODE_ID(hw), PRINT_FLAG_VDEC_STATUS,
+ "%s first_mb_in_slice = %d \n",
+ __func__, first_mb_in_slice);
+
+ hw->multi_slice_pic_flag = 0;
+ hw->multi_slice_pic_check_count = 0;
+ } else if (hw->cur_picture_slice_count > hw->last_picture_slice_count)
vh264_pic_done_proc(vdec);
else {
if (p_H264_Dpb->mVideo.dec_picture) {