1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/vvc: refact, save pf and ciip_flag in ff_vvc_set_intra_mvf

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit is contained in:
Wu Jianhua
2025-05-14 21:40:14 +08:00
committed by Nuo Mi
parent 75e5fb6e37
commit d0f9151eb0
3 changed files with 23 additions and 7 deletions

View File

@ -1756,7 +1756,7 @@ static void fill_dmvr_info(const VVCLocalContext *lc)
const CodingUnit *cu = lc->cu;
if (cu->pred_mode == MODE_IBC) {
ff_vvc_set_intra_mvf(lc, 1);
ff_vvc_set_intra_mvf(lc, true, PF_IBC, false);
} else {
const VVCPPS *pps = fc->ps.pps;
const int w = cu->cb_width >> MIN_PU_LOG2;
@ -1849,8 +1849,8 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
return AVERROR_PATCHWELCOME;
} else {
intra_luma_pred_modes(lc);
ff_vvc_set_intra_mvf(lc, false, PF_INTRA, cu->ciip_flag);
}
ff_vvc_set_intra_mvf(lc, 0);
}
if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA) && sps->r->sps_chroma_format_idc) {
if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) {

View File

@ -144,7 +144,8 @@ static int derive_temporal_colocated_mvs(const VVCLocalContext *lc, MvField temp
const SliceContext *sc = lc->sc;
RefPicList* refPicList = sc->rpl;
if (temp_col.pred_flag == PF_INTRA)
if (temp_col.pred_flag == PF_INTRA ||
temp_col.pred_flag == PF_IBC)
return 0;
if (sb_flag){
@ -266,7 +267,7 @@ void ff_vvc_set_mvf(const VVCLocalContext *lc, const int x0, const int y0, const
}
}
void ff_vvc_set_intra_mvf(const VVCLocalContext *lc, const int dmvr)
void ff_vvc_set_intra_mvf(const VVCLocalContext *lc, const bool dmvr, const PredFlag pf, const bool ciip_flag)
{
const VVCFrameContext *fc = lc->fc;
const CodingUnit *cu = lc->cu;
@ -277,7 +278,10 @@ void ff_vvc_set_intra_mvf(const VVCLocalContext *lc, const int dmvr)
for (int dx = 0; dx < cu->cb_width; dx += min_pu_size) {
const int x = cu->x0 + dx;
const int y = cu->y0 + dy;
TAB_MVF(x, y).pred_flag = PF_INTRA;
MvField *mv = &TAB_MVF(x, y);
mv->pred_flag = pf;
mv->ciip_flag = ciip_flag;
}
}
}
@ -599,7 +603,19 @@ static void init_neighbour_context(NeighbourContext *ctx, const VVCLocalContext
static av_always_inline PredMode pred_flag_to_mode(PredFlag pred)
{
return pred == PF_IBC ? MODE_IBC : (pred == PF_INTRA ? MODE_INTRA : MODE_INTER);
static const PredMode lut[] = {
MODE_INTRA, // PF_INTRA
MODE_INTER, // PF_L0
MODE_INTER, // PF_L1
MODE_INTER, // PF_BI
0, // invalid
MODE_IBC, // PF_IBC
0, // invalid
0, // invalid
MODE_PLT, // PF_PLT
};
return lut[pred];
}
static int check_available(Neighbour *n, const VVCLocalContext *lc, const int check_mer)

View File

@ -43,6 +43,6 @@ void ff_vvc_update_hmvp(VVCLocalContext *lc, const MotionInfo *mi);
int ff_vvc_no_backward_pred_flag(const VVCLocalContext *lc);
MvField* ff_vvc_get_mvf(const VVCFrameContext *fc, const int x0, const int y0);
void ff_vvc_set_mvf(const VVCLocalContext *lc, const int x0, const int y0, const int w, const int h, const MvField *mvf);
void ff_vvc_set_intra_mvf(const VVCLocalContext *lc, int dmvr);
void ff_vvc_set_intra_mvf(const VVCLocalContext *lc, bool dmvr, PredFlag pf, bool ciip_flag);
#endif //AVCODEC_VVC_MVS_H