You've already forked FFmpeg
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:
@ -1756,7 +1756,7 @@ static void fill_dmvr_info(const VVCLocalContext *lc)
|
|||||||
const CodingUnit *cu = lc->cu;
|
const CodingUnit *cu = lc->cu;
|
||||||
|
|
||||||
if (cu->pred_mode == MODE_IBC) {
|
if (cu->pred_mode == MODE_IBC) {
|
||||||
ff_vvc_set_intra_mvf(lc, 1);
|
ff_vvc_set_intra_mvf(lc, true, PF_IBC, false);
|
||||||
} else {
|
} else {
|
||||||
const VVCPPS *pps = fc->ps.pps;
|
const VVCPPS *pps = fc->ps.pps;
|
||||||
const int w = cu->cb_width >> MIN_PU_LOG2;
|
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;
|
return AVERROR_PATCHWELCOME;
|
||||||
} else {
|
} else {
|
||||||
intra_luma_pred_modes(lc);
|
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 ((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) {
|
if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) {
|
||||||
|
@ -144,7 +144,8 @@ static int derive_temporal_colocated_mvs(const VVCLocalContext *lc, MvField temp
|
|||||||
const SliceContext *sc = lc->sc;
|
const SliceContext *sc = lc->sc;
|
||||||
RefPicList* refPicList = sc->rpl;
|
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;
|
return 0;
|
||||||
|
|
||||||
if (sb_flag){
|
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 VVCFrameContext *fc = lc->fc;
|
||||||
const CodingUnit *cu = lc->cu;
|
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) {
|
for (int dx = 0; dx < cu->cb_width; dx += min_pu_size) {
|
||||||
const int x = cu->x0 + dx;
|
const int x = cu->x0 + dx;
|
||||||
const int y = cu->y0 + dy;
|
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)
|
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)
|
static int check_available(Neighbour *n, const VVCLocalContext *lc, const int check_mer)
|
||||||
|
@ -43,6 +43,6 @@ void ff_vvc_update_hmvp(VVCLocalContext *lc, const MotionInfo *mi);
|
|||||||
int ff_vvc_no_backward_pred_flag(const VVCLocalContext *lc);
|
int ff_vvc_no_backward_pred_flag(const VVCLocalContext *lc);
|
||||||
MvField* ff_vvc_get_mvf(const VVCFrameContext *fc, const int x0, const int y0);
|
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_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
|
#endif //AVCODEC_VVC_MVS_H
|
||||||
|
Reference in New Issue
Block a user