From d56b656a2032e615770c39141caa96d3ffd02641 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Thu, 17 May 2018 10:34:39 +0800 Subject: [PATCH] media_module: fix h265 crop size issue in compress PD#165820: vh265 add resolution crop handle for compress width and height Change-Id: I355ac7f62eb4ce4b2d737becdf3a3a2892bb8a74 Signed-off-by: Hui Zhang --- .../frame_provider/decoder/h265/vh265.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c b/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c index 4b20e0739a4a..94a13313015a 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c @@ -6870,21 +6870,29 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) SubHeightC = 1; break; } - vf->width -= SubWidthC * + vf->width -= SubWidthC * (hevc->param.p.conf_win_left_offset + hevc->param.p.conf_win_right_offset); - vf->height -= SubHeightC * + vf->height -= SubHeightC * (hevc->param.p.conf_win_top_offset + hevc->param.p.conf_win_bottom_offset); + + vf->compWidth -= SubWidthC * + (hevc->param.p.conf_win_left_offset + + hevc->param.p.conf_win_right_offset); + vf->compHeight -= SubHeightC * + (hevc->param.p.conf_win_top_offset + + hevc->param.p.conf_win_bottom_offset); + if (get_dbg_flag(hevc) & H265_DEBUG_BUFMGR) hevc_print(hevc, 0, - "conformance_window %d, %d, %d, %d, %d => cropped width %d, height %d\n", + "conformance_window %d, %d, %d, %d, %d => cropped width %d, height %d com_w %d com_h %d\n", hevc->param.p.chroma_format_idc, hevc->param.p.conf_win_left_offset, hevc->param.p.conf_win_right_offset, hevc->param.p.conf_win_top_offset, hevc->param.p.conf_win_bottom_offset, - vf->width, vf->height); + vf->width, vf->height, vf->compWidth, vf->compHeight); } #ifdef HEVC_PIC_STRUCT_SUPPORT