media_module: fixed can not playback 4k resolution file. [1/1]
authorPeng yixin <yixin.peng@amlogic.com>
Thu, 11 Jun 2020 02:33:11 +0000 (10:33 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Thu, 11 Jun 2020 11:50:16 +0000 (04:50 -0700)
PD#SWPL-27638

Problem:
When the width of the video file is 4096,
it cannot be played due to the total MB was
incorrectly calculated.

Solution:
Modify the logic so that the correct calculations MB
to solve the problem

Verify:
U215

Change-Id: Iccc116705b0d6a3a1c580162e7e2a5f577afe063
Signed-off-by: Peng yixin <yixin.peng@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index 7ecbbe248efa4d391509d47a4778a005ef6b0d4c..dbd07c09aad6d46be36444881a8357597f770064 100644 (file)
@@ -5629,8 +5629,11 @@ static void check_decoded_pic_error(struct vdec_h264_hw_s *hw)
        struct StorablePicture *p = p_H264_Dpb->mVideo.dec_picture;
        unsigned mby_mbx = READ_VREG(MBY_MBX);
        unsigned mb_total = (hw->seq_info2 >> 8) & 0xffff;
-       unsigned decode_mb_count =
-               ((mby_mbx & 0xff) * (hw->seq_info2 & 0xff) +
+       unsigned mb_width = hw->seq_info2 & 0xff;
+       unsigned decode_mb_count;
+       if (!mb_width && mb_total) /*for 4k2k*/
+               mb_width = 256;
+       decode_mb_count = ((mby_mbx & 0xff) * mb_width +
                (((mby_mbx >> 8) & 0xff) + 1));
        if (mby_mbx == 0)
                return;