summaryrefslogtreecommitdiff
authormiaohong chen <miaohong.chen@amlogic.com>2020-07-14 13:28:23 (GMT)
committer Miaohong Chen <miaohong.chen@amlogic.com>2020-07-21 03:20:07 (GMT)
commit0d05325ed3f04d98a838a28b3c7b15d365dfaaad (patch)
treeeff8f27ced5bdfb8f604dec57fc16d9aaf82a5a9
parent8871c3e8322a3feecceb13280b517f1ebe38cdbe (diff)
downloadmedia_modules-0d05325ed3f04d98a838a28b3c7b15d365dfaaad.zip
media_modules-0d05325ed3f04d98a838a28b3c7b15d365dfaaad.tar.gz
media_modules-0d05325ed3f04d98a838a28b3c7b15d365dfaaad.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> (cherry picked from commit 9a5cbbebe1cc6f2b7dff38121ba5a2c9397f6fbf)
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 87b5bde..00fe87a 100644
--- a/drivers/frame_provider/decoder/h264_multi/vmh264.c
+++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c
@@ -5953,6 +5953,9 @@ static irqreturn_t vh264_isr_thread_fn(struct vdec_s *vdec, int irq)
union param dpb_param_bak;
/*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
@@ -5972,7 +5975,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) {