[h265d]: Modify hw resolution capability check method

Change-Id: Ibb7d450d77812f203f5502579e9ed61468c63140
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
This commit is contained in:
sayon.chen
2022-09-05 18:21:59 +08:00
committed by Herman Chen
parent 346c126ac2
commit a2094ca30a

View File

@@ -1982,22 +1982,30 @@ int mpp_hevc_decode_nal_pps(HEVCContext *s)
// check support solution
{
RK_S32 max_supt_width = PIXW_1080P;
RK_S32 max_supt_height = pps->tiles_enabled_flag ? PIXH_1080P : PIXW_1080P;
const MppDecHwCap *hw_info = s->h265dctx->hw_info;
if (hw_info && hw_info->cap_lmt_linebuf) {
RK_S32 max_supt_width = PIXW_1080P;
RK_S32 max_supt_height = pps->tiles_enabled_flag ? PIXH_1080P : PIXW_1080P;
if (hw_info && hw_info->cap_8k) {
max_supt_width = PIXW_8Kx4K;
max_supt_height = pps->tiles_enabled_flag ? PIXH_8Kx4K : PIXW_8Kx4K;
} else if (hw_info && hw_info->cap_4k) {
max_supt_width = PIXW_4Kx2K;
max_supt_height = pps->tiles_enabled_flag ? PIXH_4Kx2K : PIXW_4Kx2K;
}
if (hw_info && hw_info->cap_8k) {
max_supt_width = PIXW_8Kx4K;
max_supt_height = pps->tiles_enabled_flag ? PIXH_8Kx4K : PIXW_8Kx4K;
} else if (hw_info && hw_info->cap_4k) {
max_supt_width = PIXW_4Kx2K;
max_supt_height = pps->tiles_enabled_flag ? PIXH_4Kx2K : PIXW_4Kx2K;
}
if (sps->width > max_supt_width || sps->height > max_supt_height) {
mpp_err("cannot support %dx%d, max solution %dx%d\n",
sps->width, sps->height, max_supt_width, max_supt_height);
goto err;
if (sps->width > max_supt_width || (sps->height > max_supt_height && pps->tiles_enabled_flag)
|| sps->width * sps->height > max_supt_width * max_supt_width) {
mpp_err("cannot support %dx%d, max solution %dx%d\n",
sps->width, sps->height, max_supt_width, max_supt_height);
goto err;
}
} else {
if (sps->width * sps->height > PIXW_8Kx4K * PIXW_8Kx4K * hw_info->cap_core_num) {
mpp_err("cannot support %dx%d, max solution %dx%d\n",
sps->width, sps->height, PIXW_8Kx4K, PIXW_8Kx4K);
goto err;
}
}
}