mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 09:06:50 +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:
@@ -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++) {
|
||||
read_size = fread(buf_u + row * hor_stride, 1, width, fp);
|
||||
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++) {
|
||||
read_size = fread(buf_u + row * hor_stride / 2, 1, width / 2, fp);
|
||||
if (read_size != width / 2) {
|
||||
|
Reference in New Issue
Block a user