[mpp_enc]: Enlarge mjpeg encoder stream buffer

Due to complex input image content mjpeg encoder required larger buffer
to avoid overflow and hardware mmu fault.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4417ae5e62f16673a2ea06a5954463ce34b6bb8a
This commit is contained in:
Herman Chen
2020-04-24 08:57:43 +08:00
parent ed34cf2aca
commit 3a48d6c31e
2 changed files with 5 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#include "mpp_env.h"
#include "mpp_log.h"
#include "mpp_mem.h"
#include "mpp_common.h"
#include "mpp_packet_impl.h"
@@ -258,9 +259,10 @@ void *mpp_enc_control_thread(void *data)
* if there is available buffer in the input frame do encoding
*/
if (NULL == packet) {
/* NOTE: set buffer w * h * 1.5 to avoid buffer overflow */
RK_U32 width = enc->cfg.prep.width;
RK_U32 height = enc->cfg.prep.height;
RK_U32 size = width * height;
RK_U32 size = MPP_ALIGN(width, 16) * MPP_ALIGN(height, 16) * 3 / 2;
MppBuffer buffer = NULL;
mpp_assert(size);

View File

@@ -629,9 +629,10 @@ void *mpp_enc_thread(void *data)
* if there is available buffer in the input frame do encoding
*/
if (NULL == packet) {
/* NOTE: set buffer w * h * 1.5 to avoid buffer overflow */
RK_U32 width = enc->cfg.prep.width;
RK_U32 height = enc->cfg.prep.height;
RK_U32 size = width * height;
RK_U32 size = MPP_ALIGN(width, 16) * MPP_ALIGN(height, 16) * 3 / 2;
MppBuffer buffer = NULL;
mpp_assert(size);