From 8d905fe82eaa11f3ceba00c0c2be65cecf6d73ce Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Wed, 21 Sep 2022 10:47:13 +0800 Subject: [PATCH] [h265_vdpu34x]: fix rcb size cal err in multi-tile case A ext 64 bytes are required for each col tile boundary Signed-off-by: Yandong Lin Change-Id: I3d6b64579b4f881354c015e556c69ea126d5976a --- mpp/hal/rkdec/h265d/hal_h265d_vdpu34x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mpp/hal/rkdec/h265d/hal_h265d_vdpu34x.c b/mpp/hal/rkdec/h265d/hal_h265d_vdpu34x.c index 78d116f8..2f8349a1 100644 --- a/mpp/hal/rkdec/h265d/hal_h265d_vdpu34x.c +++ b/mpp/hal/rkdec/h265d/hal_h265d_vdpu34x.c @@ -682,8 +682,8 @@ static void h265d_refine_rcb_size(Vdpu34xRcbInfo *rcb_info, RK_U32 chroma_fmt_idc = pp->chroma_format_idc;//0 400,1 4202 ,422,3 444 RK_U8 bit_depth = MPP_MAX(pp->bit_depth_luma_minus8, pp->bit_depth_chroma_minus8) + 8; RK_U8 ctu_size = 1 << (pp->log2_diff_max_min_luma_coding_block_size + pp->log2_min_luma_coding_block_size_minus3 + 3); - RK_U32 num_tiles = pp->num_tile_rows_minus1 + 1; - RK_U32 ext_align_size = num_tiles * 64 * 8; + RK_U32 tile_col_cut_num = pp->num_tile_columns_minus1; + RK_U32 ext_align_size = tile_col_cut_num * 64 * 8; width = MPP_ALIGN(width, ctu_size); height = MPP_ALIGN(height, ctu_size); @@ -727,7 +727,7 @@ static void h265d_refine_rcb_size(Vdpu34xRcbInfo *rcb_info, else rcb_bits = width * ( 2 + 8 * bit_depth); } - rcb_bits += (num_tiles * (bit_depth == 8 ? 256 : 192)) + ext_align_size; + rcb_bits += (tile_col_cut_num * (bit_depth == 8 ? 256 : 192)) + ext_align_size; rcb_info[RCB_DBLK_ROW].size = MPP_RCB_BYTES(rcb_bits); /* RCB_SAO_ROW */ if (chroma_fmt_idc == 1 || chroma_fmt_idc == 2) { @@ -735,12 +735,12 @@ static void h265d_refine_rcb_size(Vdpu34xRcbInfo *rcb_info, } else { rcb_bits = width * (128 / ctu_size + 3 * bit_depth); } - rcb_bits += (num_tiles * (bit_depth == 8 ? 160 : 128)) + ext_align_size; + rcb_bits += (tile_col_cut_num * (bit_depth == 8 ? 160 : 128)) + ext_align_size; rcb_info[RCB_SAO_ROW].size = MPP_RCB_BYTES(rcb_bits); /* RCB_FBC_ROW */ if (hw_regs->common.reg012.fbc_e) { rcb_bits = width * (chroma_fmt_idc - 1) * 2 * bit_depth; - rcb_bits += (num_tiles * (bit_depth == 8 ? 128 : 64)) + ext_align_size; + rcb_bits += (tile_col_cut_num * (bit_depth == 8 ? 128 : 64)) + ext_align_size; } else rcb_bits = 0; rcb_info[RCB_FBC_ROW].size = MPP_RCB_BYTES(rcb_bits);