diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 5a08bd82..20f70b01 100644 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -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);