mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-14 21:25:42 +08:00
[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:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user