From 7d0c55d879fed613cf6d40a76bdc5c6b006d4a66 Mon Sep 17 00:00:00 2001 From: peng huang Date: Thu, 3 Dec 2020 21:26:27 +0800 Subject: [PATCH] mpeg4: Add VOP header to the mpeg4 native source frame end [1/1] PD#SWPL-27799 Problem: Some sources without vop header will cause chunk to be unable to judge the end of frame Solution: Add VOP header to the mpeg4 native source frame end Verify: TL1 Change-Id: Ieb5b3fd581eb6ead855f086e8873d24f2c84975f Signed-off-by: peng huang --- drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c index 64fc836..289178a 100644 --- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c +++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c @@ -2394,6 +2394,17 @@ static void run(struct vdec_s *vdec, unsigned long mask, hw->chunk_frame_count = 0; } } + if (vdec_frame_based(vdec) && !vdec_secure(vdec)) { + /* HW needs padding (NAL start) for frame ending */ + char* tail = (char *)hw->chunk->block->start_virt; + + tail += hw->chunk->offset + hw->chunk->size; + tail[0] = 0; + tail[1] = 0; + tail[2] = 1; + tail[3] = 0xb6; + codec_mm_dma_flush(tail, 4, DMA_TO_DEVICE); + } if (vdec_frame_based(vdec) && (debug_enable & 0xc00)) { u8 *data = NULL; -- 2.20.1