[mpi_enc_test]: Add AFBC_V2 source support

Change-Id: I089c41137edf39211f33faf234b68295256bcfc1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2022-05-24 14:34:41 +08:00
parent 0d85aab268
commit 5dccad43d4
2 changed files with 13 additions and 4 deletions

View File

@@ -247,10 +247,14 @@ MPP_RET test_ctx_init(MpiEncMultiCtxInfo *info)
} break;
}
if (MPP_FRAME_FMT_IS_FBC(p->fmt))
if (MPP_FRAME_FMT_IS_FBC(p->fmt)) {
if ((p->fmt & MPP_FRAME_FBC_MASK) == MPP_FRAME_FBC_AFBC_V1)
p->header_size = MPP_ALIGN(MPP_ALIGN(p->width, 16) * MPP_ALIGN(p->height, 16) / 16, SZ_4K);
else
p->header_size = MPP_ALIGN(p->width, 16) * MPP_ALIGN(p->height, 16) / 16;
} else {
p->header_size = 0;
}
return ret;
}

View File

@@ -434,7 +434,12 @@ MPP_RET read_image(RK_U8 *buf, FILE *fp, RK_U32 width, RK_U32 height,
if (MPP_FRAME_FMT_IS_FBC(fmt)) {
RK_U32 align_w = MPP_ALIGN(width, 16);
RK_U32 align_h = MPP_ALIGN(height, 16);
RK_U32 header_size = MPP_ALIGN(align_w * align_h / 16, SZ_4K);
RK_U32 header_size = 0;
if ((fmt & MPP_FRAME_FBC_MASK) == MPP_FRAME_FBC_AFBC_V1)
header_size = MPP_ALIGN(align_w * align_h / 16, SZ_4K);
else
header_size = align_w * align_h / 16;
/* read fbc header first */
read_size = fread(buf, 1, header_size, fp);