From ed77dd798889f5f6893d6f49cbc2e4e20f356f75 Mon Sep 17 00:00:00 2001 From: Yanjun Liao Date: Wed, 10 Jan 2024 16:08:53 +0800 Subject: [PATCH] feat[mpi_enc_test]: add YUV400 fmt support Change-Id: I05d149d176e1e692e9706dac07e6d843446309f9 Signed-off-by: Yanjun Liao --- test/mpi_enc_mt_test.cpp | 1 + test/mpi_enc_test.c | 1 + utils/mpi_enc_utils.c | 1 + utils/utils.c | 3 +++ 4 files changed, 6 insertions(+) diff --git a/test/mpi_enc_mt_test.cpp b/test/mpi_enc_mt_test.cpp index a419ce76..55b714ad 100644 --- a/test/mpi_enc_mt_test.cpp +++ b/test/mpi_enc_mt_test.cpp @@ -232,6 +232,7 @@ MPP_RET mt_test_ctx_init(MpiEncMtCtxInfo *info) case MPP_FMT_YUV422SP : { p->frame_size = MPP_ALIGN(p->hor_stride, 64) * MPP_ALIGN(p->ver_stride, 64) * 2; } break; + case MPP_FMT_YUV400 : case MPP_FMT_RGB444 : case MPP_FMT_BGR444 : case MPP_FMT_RGB555 : diff --git a/test/mpi_enc_test.c b/test/mpi_enc_test.c index db1055b3..af77a975 100644 --- a/test/mpi_enc_test.c +++ b/test/mpi_enc_test.c @@ -229,6 +229,7 @@ MPP_RET test_ctx_init(MpiEncMultiCtxInfo *info) case MPP_FMT_YUV422SP : { p->frame_size = MPP_ALIGN(p->hor_stride, 64) * MPP_ALIGN(p->ver_stride, 64) * 2; } break; + case MPP_FMT_YUV400: case MPP_FMT_RGB444 : case MPP_FMT_BGR444 : case MPP_FMT_RGB555 : diff --git a/utils/mpi_enc_utils.c b/utils/mpi_enc_utils.c index 551e7182..9d525f35 100644 --- a/utils/mpi_enc_utils.c +++ b/utils/mpi_enc_utils.c @@ -36,6 +36,7 @@ RK_S32 mpi_enc_width_default_stride(RK_S32 width, MppFrameFormat fmt) RK_S32 stride = 0; switch (fmt & MPP_FRAME_FMT_MASK) { + case MPP_FMT_YUV400 : case MPP_FMT_YUV420SP : case MPP_FMT_YUV420SP_VU : { stride = MPP_ALIGN(width, 8); diff --git a/utils/utils.c b/utils/utils.c index 8999f09f..cecc28e3 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -612,6 +612,9 @@ MPP_RET read_image(RK_U8 *buf, FILE *fp, RK_U32 width, RK_U32 height, case MPP_FMT_BGR888 : { ret = read_with_pixel_width(buf_y, width, height, hor_stride, 3, fp); } break; + case MPP_FMT_YUV400 : { + ret = read_with_pixel_width(buf_y, width, height, hor_stride, 1, fp); + } break; default : { mpp_err_f("read image do not support fmt %d\n", fmt); ret = MPP_ERR_VALUE;