mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-04 08:46:24 +08:00
fix[enc_utils]: Support read odd resolution image
Change-Id: Ib6b9d9ebc9d552ee0fda0f3a14c77b2ae37881d8 Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
This commit is contained in:
@@ -613,7 +613,7 @@ MPP_RET mpi_enc_test_cmd_update_by_args(MpiEncTestArgs* cmd, int argc, char **ar
|
|||||||
if (!cmd->hor_stride)
|
if (!cmd->hor_stride)
|
||||||
cmd->hor_stride = mpi_enc_width_default_stride(cmd->width, cmd->format);
|
cmd->hor_stride = mpi_enc_width_default_stride(cmd->width, cmd->format);
|
||||||
if (!cmd->ver_stride)
|
if (!cmd->ver_stride)
|
||||||
cmd->ver_stride = cmd->height;
|
cmd->ver_stride = MPP_ALIGN(cmd->height, 2);
|
||||||
|
|
||||||
if (cmd->type_src == MPP_VIDEO_CodingUnused) {
|
if (cmd->type_src == MPP_VIDEO_CodingUnused) {
|
||||||
if (cmd->width <= 0 || cmd->height <= 0 ||
|
if (cmd->width <= 0 || cmd->height <= 0 ||
|
||||||
|
@@ -549,6 +549,8 @@ MPP_RET read_image(RK_U8 *buf, FILE *fp, RK_U32 width, RK_U32 height,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
height = MPP_ALIGN(height, 2);
|
||||||
|
width = MPP_ALIGN(width, 2);
|
||||||
for (row = 0; row < height / 2; row++) {
|
for (row = 0; row < height / 2; row++) {
|
||||||
read_size = fread(buf_u + row * hor_stride, 1, width, fp);
|
read_size = fread(buf_u + row * hor_stride, 1, width, fp);
|
||||||
if (read_size != width) {
|
if (read_size != width) {
|
||||||
@@ -566,6 +568,8 @@ MPP_RET read_image(RK_U8 *buf, FILE *fp, RK_U32 width, RK_U32 height,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
width = MPP_ALIGN(width, 2);
|
||||||
|
height = MPP_ALIGN(height, 2);
|
||||||
for (row = 0; row < height / 2; row++) {
|
for (row = 0; row < height / 2; row++) {
|
||||||
read_size = fread(buf_u + row * hor_stride / 2, 1, width / 2, fp);
|
read_size = fread(buf_u + row * hor_stride / 2, 1, width / 2, fp);
|
||||||
if (read_size != width / 2) {
|
if (read_size != width / 2) {
|
||||||
|
Reference in New Issue
Block a user