fix[m2vd]: Fix seq_head check error

The width and height is 16 aligned.

Issue occurs by commit:
I03732d5eec1902b6fbe80b1504e729b3a1d61330

Change-Id: Icf9b53942f8c5c15536114638d5763545eae8b26
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
This commit is contained in:
xueman.ruan
2024-07-19 14:46:36 +08:00
parent 6766b43a6b
commit d1b73032f3

View File

@@ -958,14 +958,18 @@ static int m2vd_decode_seq_header(M2VDParserContext *ctx)
RK_U32 width = m2vd_read_bits(bx, 12);
RK_U32 height = m2vd_read_bits(bx, 12);
ctx->display_width = width;
ctx->display_height = height;
height = MPP_ALIGN(height, 16);
width = MPP_ALIGN(width, 16);
if (width != ctx->seq_head.decode_width ||
height != ctx->seq_head.decode_height)
ctx->info_changed = 1;
ctx->seq_head.decode_width = width;
ctx->seq_head.decode_height = height;
ctx->display_width = ctx->seq_head.decode_width;
ctx->display_height = ctx->seq_head.decode_height;
ctx->seq_head.aspect_ratio_information = m2vd_read_bits(bx, 4);
ctx->seq_head.frame_rate_code = m2vd_read_bits(bx, 4);
if (!ctx->frame_period || pre_frame_rate_code != ctx->seq_head.frame_rate_code)
@@ -1274,8 +1278,6 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
pic_head->pre_temporal_reference = pic_head->temporal_reference;
pic_head->pre_picture_coding_type = pic_head->picture_coding_type;
ctx->frame_cur->picCodingType = pic_head->picture_coding_type;
ctx->seq_head.decode_height = (ctx->seq_head.decode_height + 15) & (~15);
ctx->seq_head.decode_width = (ctx->seq_head.decode_width + 15) & (~15);
mpp_frame_set_width(ctx->frame_cur->f, ctx->display_width);
mpp_frame_set_height(ctx->frame_cur->f, ctx->display_height);