[mpp_dec]: Fix the problem of read data error

For data with sizes of 5120x7160 and 8000x8000, the required buffer size
was calculated incorrectly during the encoding process, which caused the
requested buffer to be too large, resulting in drm exceptions.
Therefore, the method of calculating data has been modified.

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I519a76687118d568cf57e7d3d54a150e9019285c
This commit is contained in:
Hongjin Li
2022-01-04 15:41:11 +08:00
parent 0e15e96c9f
commit 33269e39e7
2 changed files with 14 additions and 4 deletions

View File

@@ -208,14 +208,24 @@ MPP_RET test_ctx_init(MpiEncMultiCtxInfo *info)
case MPP_FMT_YUV422_UYVY :
case MPP_FMT_YUV422_VYUY :
case MPP_FMT_YUV422P :
case MPP_FMT_YUV422SP :
case MPP_FMT_YUV422SP : {
p->frame_size = MPP_ALIGN(p->hor_stride, 64) * MPP_ALIGN(p->ver_stride, 64) * 2;
} break;
case MPP_FMT_RGB444 :
case MPP_FMT_BGR444 :
case MPP_FMT_RGB555 :
case MPP_FMT_BGR555 :
case MPP_FMT_RGB565 :
case MPP_FMT_BGR565 : {
p->frame_size = MPP_ALIGN(p->hor_stride, 64) * MPP_ALIGN(p->ver_stride, 64) * 2;
case MPP_FMT_BGR565 :
case MPP_FMT_RGB888 :
case MPP_FMT_BGR888 :
case MPP_FMT_RGB101010 :
case MPP_FMT_BGR101010 :
case MPP_FMT_ARGB8888 :
case MPP_FMT_ABGR8888 :
case MPP_FMT_BGRA8888 :
case MPP_FMT_RGBA8888 : {
p->frame_size = MPP_ALIGN(p->hor_stride, 64) * MPP_ALIGN(p->ver_stride, 64);
} break;
default: {