```
#if DSAWP
void com_tpl_ipred(pel* src_le, pel* src_up, pel* dst, int ipm, int blk_w, int blk_h, int bit_depth, u16 avail_cu, u8 ipf_flag
#if MIPF
, int mipf_enable_flag
#endif
#if IIP
, u8 iip_flag
#endif
, int tpl_w, int tpl_h)
{
const int tpl_size_offset = DAWP_REF_OFFSET;
int w = blk_w + tpl_size_offset;
int h = blk_h + tpl_size_offset;
#if PARTITIONING_OPT
assert(w <= 128 && h <= 128);
#else
assert(w <= 64 && h <= 64);
#endif
const int is_luma = 1;
const int is_small = blk_w * blk_h <= (is_luma ? MIPF_TH_SIZE : MIPF_TH_SIZE_CHROMA);
switch (ipm)
{
case IPD_VER:
ipred_vert(src_up, dst, w, h
#if IIP
, iip_flag
#endif
, tpl_w, tpl_h);
break;
case IPD_HOR:
ipred_hor(src_le, dst, w, h
#if IIP
, iip_flag
#endif
, tpl_w, tpl_h);
break;
case IPD_DC:
ipred_dc(src_le, src_up, dst, w, h, bit_depth, avail_cu
#if IIP
, iip_flag
#endif
);
break;
case IPD_PLN:
ipred_plane(src_le, src_up, dst, w, h
#if IIP
, iip_flag
#endif
);
break;
case IPD_BI:
ipred_bi(src_le, src_up, dst, w, h
#if IIP
, iip_flag
#endif
);
break;
default:
ipred_ang(src_le, src_up, dst, w, h, ipm
#if MIPF
, 1, mipf_enable_flag
#endif
#if IIP
, iip_flag
#endif
, is_small, tpl_w, tpl_h);
break;
}
if (ipf_flag)
{
assert((w < MAX_CU_SIZE) && (h < MAX_CU_SIZE));
ipf_core(src_le, src_up, dst, ipm, w, h);
}
#if IIP
if (iip_flag)
{
assert((w * h >= MIN_IIP_BLK) && (w * h <= MAX_IIP_BLK));
iip_refine(src_le, src_up, dst, w, h);
}
#endif
// Clip predicted value
#if UNIFIED_INTRA_CLIP
int clipCondition = -1;
#if MIPF
if (mipf_enable_flag)
{
clipCondition = ipf_flag
#if IIP
|| iip_flag
#endif
|| 1 // must clip in AVS3-Phase II
;
}
else
#endif
{
clipCondition = ipf_flag || (ipm == IPD_BI) || (ipm == IPD_PLN);
}
if (clipCondition)
#else
#if MIPF
#if IIP
if (ipf_flag || ipm != IPD_DC || iip_flag)
#else
if (ipf_flag || (ipm != IPD_VER && ipm != IPD_HOR && ipm != IPD_DC))
#endif
#else
if (ipf_flag || (ipm == IPD_BI) || (ipm == IPD_PLN))
#endif
#endif
{
clip_pred(dst, w, h, bit_depth);
}
}
#endif```为什么要用模版?
最新发布