Browse Source

fix[sys_cfg]: Align to CTU64 to avoid info change.

Platform: General
Spec: avs2

Error case:
In AVS2, CTU supports both 64 and 32 alignment. The
sys_cfg defaults to 64 alignment. However, if the
parsed CTU size is 32, it may cause additional info
changes.

This is because, initially, when calculating the
stride, there is no external stride configuration,
so it defaults to 64 alignment. After parsing the
video sequence, the stride is configured, and
calculations should then follow the configured
stride.

Solution:
During the parsing process, the stride is not set
and is entirely calculated by sys_cfg.

Reported-by: Liming Xu <rimon.xu@rock-chips.com>

Source: test_avs2_160x90.av1

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I0fed8b86391a03651f22ef859ec2ff1c02647b12
Hongjin Li 3 weeks ago
parent
commit
adf21e18ba
1 changed files with 0 additions and 6 deletions
  1. 0 6
      mpp/codec/dec/avs2/avs2d_dpb.c

+ 0 - 6
mpp/codec/dec/avs2/avs2d_dpb.c

@@ -472,9 +472,6 @@ static Avs2dFrame_t *dpb_alloc_frame(Avs2dCtx_t *p_dec, HalDecTask *task)
     Avs2dPicHeader_t *ph  = &p_dec->ph;
     Avs2dSeqExtHeader_t *exh  = &p_dec->exh;
     Avs2dFrameMgr_t *mgr = &p_dec->frm_mgr;
-    RK_U32 ctu_size = 1 << (p_dec->vsh.lcu_size);
-    RK_U32 bitdepth = p_dec->vsh.bit_depth;
-    RK_U32 ver_stride = vsh->vertical_size;
 
     avs2d_dbg_dpb("In.");
     frm = dpb_get_one_frame(mgr, vsh, ph);
@@ -512,7 +509,6 @@ static Avs2dFrame_t *dpb_alloc_frame(Avs2dCtx_t *p_dec, HalDecTask *task)
         mpp_frame_set_fbc_hdr_stride(mframe, fbc_hdr_stride);
         // fbc output frame update
         mpp_frame_set_offset_y(mframe, 8);
-        ver_stride += 16;
     } else if (MPP_FRAME_FMT_IS_TILE(p_dec->init.cfg->base.out_fmt))
         mpp_frame_set_fmt(mframe, mpp_frame_get_fmt(mframe) | (p_dec->init.cfg->base.out_fmt & (MPP_FRAME_TILE_FLAG)));
 
@@ -526,8 +522,6 @@ static Avs2dFrame_t *dpb_alloc_frame(Avs2dCtx_t *p_dec, HalDecTask *task)
 
     mpp_frame_set_width(mframe, vsh->horizontal_size);
     mpp_frame_set_height(mframe, vsh->vertical_size);
-    mpp_frame_set_hor_stride(mframe, (MPP_ALIGN(vsh->horizontal_size, ctu_size) * bitdepth + 7) / 8);
-    mpp_frame_set_ver_stride(mframe, MPP_ALIGN(ver_stride, ctu_size));
     mpp_frame_set_pts(mframe, mpp_packet_get_pts(task->input_packet));
     mpp_frame_set_dts(mframe, mpp_packet_get_dts(task->input_packet));
     mpp_frame_set_errinfo(mframe, 0);