History

avcodec/vvcdec: refact out VVCRefPic from RefPicList

Nuo Mi committed 2 years ago

Commit 66c6bee1 parent 44bbafb8 files · +52 −47Browse files

Showing the changes to libavcodec (8 of 8 files). Show all

Unified · Split

8 files
  1. libavcodec/vvc/ctu.c +5 −5
  2. libavcodec/vvc/dec.c +2 −2
  3. libavcodec/vvc/dec.h +7 −3
  4. libavcodec/vvc/filter.c +11 −11
  5. libavcodec/vvc/inter.c +2 −2
  6. libavcodec/vvc/mvs.c +18 −18
  7. libavcodec/vvc/refs.c +6 −5
  8. libavcodec/vvc/thread.c +1 −1
libavcodec/vvc/ctu.c+5−5
@@ -1263,8 +1263,8 @@ static void derive_mmvd(const VVCLocalContext *lc, MvField *mvf, const Mv *mmvd_ · 1262 unmodified lines
1263 const RefPicList *rpl = sc->rpl;1263 const RefPicList *rpl = sc->rpl;
1264 const int poc = lc->fc->ps.ph.poc;1264 const int poc = lc->fc->ps.ph.poc;
1265 const int diff[] = {1265 const int diff[] = {
1266 poc - rpl[0].list[mvf->ref_idx[0]],1266 poc - rpl[L0].refs[mvf->ref_idx[L0]].poc,
1267 poc - rpl[1].list[mvf->ref_idx[1]]1267 poc - rpl[L1].refs[mvf->ref_idx[L1]].poc
1268 };1268 };
1269 const int sign = FFSIGN(diff[0]) != FFSIGN(diff[1]);1269 const int sign = FFSIGN(diff[0]) != FFSIGN(diff[1]);
1270 1270
@@ -1275,7 +1275,7 @@ static void derive_mmvd(const VVCLocalContext *lc, MvField *mvf, const Mv *mmvd_ · 4 unmodified lines
1275 const int i = FFABS(diff[0]) < FFABS(diff[1]);1275 const int i = FFABS(diff[0]) < FFABS(diff[1]);
1276 const int o = !i;1276 const int o = !i;
1277 mmvd[i] = *mmvd_offset;1277 mmvd[i] = *mmvd_offset;
1278 if (!rpl[0].isLongTerm[mvf->ref_idx[0]] && !rpl[1].isLongTerm[mvf->ref_idx[1]]) {1278 if (!rpl[L0].refs[mvf->ref_idx[L0]].is_lt && !rpl[L1].refs[mvf->ref_idx[L1]].is_lt) {
1279 ff_vvc_mv_scale(&mmvd[o], mmvd_offset, diff[i], diff[o]);1279 ff_vvc_mv_scale(&mmvd[o], mmvd_offset, diff[i], diff[o]);
1280 }1280 }
1281 else {1281 else {
@@ -1699,8 +1699,8 @@ static void derive_dmvr_bdof_flag(const VVCLocalContext *lc, PredictionUnit *pu) · 417 unmodified lines
1699 pu->bdof_flag = 0;1699 pu->bdof_flag = 0;
1700 1700
1701 if (mi->pred_flag == PF_BI &&1701 if (mi->pred_flag == PF_BI &&
1702 (poc - rpl0->list[ref_idx[L0]] == rpl1->list[ref_idx[L1]] - poc) &&1702 (poc - rpl0->refs[ref_idx[L0]].poc == rpl1->refs[ref_idx[L1]].poc - poc) &&
1703 !rpl0->isLongTerm[ref_idx[L0]] && !rpl1->isLongTerm[ref_idx[L1]] &&1703 !rpl0->refs[ref_idx[L0]].is_lt && !rpl1->refs[ref_idx[L1]].is_lt &&
1704 !cu->ciip_flag &&1704 !cu->ciip_flag &&
1705 !mi->bcw_idx &&1705 !mi->bcw_idx &&
1706 !w->weight_flag[L0][LUMA][mi->ref_idx[L0]] && !w->weight_flag[L1][LUMA][mi->ref_idx[L1]] &&1706 !w->weight_flag[L0][LUMA][mi->ref_idx[L0]] && !w->weight_flag[L1][LUMA][mi->ref_idx[L1]] &&
libavcodec/vvc/dec.c+2−2
@@ -403,8 +403,8 @@ static int8_t smvd_find(const VVCFrameContext *fc, const SliceContext *sc, int l · 402 unmodified lines
403 int8_t idx = -1;403 int8_t idx = -1;
404 int old_diff = -1;404 int old_diff = -1;
405 for (int i = 0; i < rsh->num_ref_idx_active[lx]; i++) {405 for (int i = 0; i < rsh->num_ref_idx_active[lx]; i++) {
406 if (!rpl->isLongTerm[i]) {406 if (!rpl->refs[i].is_lt) {
407 int diff = poc - rpl->list[i];407 int diff = poc - rpl->refs[i].poc;
408 if (find(idx, diff, old_diff)) {408 if (find(idx, diff, old_diff)) {
409 idx = i;409 idx = i;
410 old_diff = diff;410 old_diff = diff;
libavcodec/vvc/dec.h+7−3
@@ -42,10 +42,14 @@ · 41 unmodified lines
42#define L0 042#define L0 0
43#define L1 143#define L1 1
44 44
45typedef struct VVCRefPic {
46 struct VVCFrame *ref;
47 int poc;
48 int is_lt; // is long term reference
49} VVCRefPic;
50
45typedef struct RefPicList {51typedef struct RefPicList {
46 struct VVCFrame *ref[VVC_MAX_REF_ENTRIES];52 VVCRefPic refs[VVC_MAX_REF_ENTRIES];
47 int list[VVC_MAX_REF_ENTRIES];
48 int isLongTerm[VVC_MAX_REF_ENTRIES];
49 int nb_refs;53 int nb_refs;
50} RefPicList;54} RefPicList;
51 55
libavcodec/vvc/filter.c+11−11
@@ -321,9 +321,9 @@ static int boundary_strength(const VVCLocalContext *lc, const MvField *curr, con · 320 unmodified lines
321 321
322 if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {322 if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {
323 // same L0 and L1323 // same L0 and L1
324 if (rpl[0].list[curr->ref_idx[0]] == neigh_rpl[0].list[neigh->ref_idx[0]] &&324 if (rpl[L0].refs[curr->ref_idx[L0]].poc == neigh_rpl[L0].refs[neigh->ref_idx[L0]].poc &&
325 rpl[0].list[curr->ref_idx[0]] == rpl[1].list[curr->ref_idx[1]] &&325 rpl[L0].refs[curr->ref_idx[L0]].poc == rpl[L1].refs[curr->ref_idx[L1]].poc &&
326 neigh_rpl[0].list[neigh->ref_idx[0]] == neigh_rpl[1].list[neigh->ref_idx[1]]) {326 neigh_rpl[L0].refs[neigh->ref_idx[L0]].poc == neigh_rpl[L1].refs[neigh->ref_idx[L1]].poc) {
327 if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 8 ||327 if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 8 ||
328 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 8) &&328 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 8) &&
329 (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 8 ||329 (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 8 ||
@@ -331,15 +331,15 @@ static int boundary_strength(const VVCLocalContext *lc, const MvField *curr, con · 1 unmodified line
331 return 1;331 return 1;
332 else332 else
333 return 0;333 return 0;
334 } else if (neigh_rpl[0].list[neigh->ref_idx[0]] == rpl[0].list[curr->ref_idx[0]] &&334 } else if (neigh_rpl[L0].refs[neigh->ref_idx[L0]].poc == rpl[L0].refs[curr->ref_idx[L0]].poc &&
335 neigh_rpl[1].list[neigh->ref_idx[1]] == rpl[1].list[curr->ref_idx[1]]) {335 neigh_rpl[L1].refs[neigh->ref_idx[L1]].poc == rpl[L1].refs[curr->ref_idx[L1]].poc) {
336 if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 8 ||336 if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 8 ||
337 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 8)337 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 8)
338 return 1;338 return 1;
339 else339 else
340 return 0;340 return 0;
341 } else if (neigh_rpl[1].list[neigh->ref_idx[1]] == rpl[0].list[curr->ref_idx[0]] &&341 } else if (neigh_rpl[L1].refs[neigh->ref_idx[L1]].poc == rpl[L0].refs[curr->ref_idx[L0]].poc &&
342 neigh_rpl[0].list[neigh->ref_idx[0]] == rpl[1].list[curr->ref_idx[1]]) {342 neigh_rpl[L0].refs[neigh->ref_idx[L0]].poc == rpl[L1].refs[curr->ref_idx[L1]].poc) {
343 if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 8 ||343 if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 8 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 8 ||
344 FFABS(neigh->mv[0].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 8)344 FFABS(neigh->mv[0].x - curr->mv[1].x) >= 8 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 8)
345 return 1;345 return 1;
@@ -354,18 +354,18 @@ static int boundary_strength(const VVCLocalContext *lc, const MvField *curr, con · 8 unmodified lines
354 354
355 if (curr->pred_flag & 1) {355 if (curr->pred_flag & 1) {
356 A = curr->mv[0];356 A = curr->mv[0];
357 ref_A = rpl[0].list[curr->ref_idx[0]];357 ref_A = rpl[L0].refs[curr->ref_idx[L0]].poc;
358 } else {358 } else {
359 A = curr->mv[1];359 A = curr->mv[1];
360 ref_A = rpl[1].list[curr->ref_idx[1]];360 ref_A = rpl[L1].refs[curr->ref_idx[L1]].poc;
361 }361 }
362 362
363 if (neigh->pred_flag & 1) {363 if (neigh->pred_flag & 1) {
364 B = neigh->mv[0];364 B = neigh->mv[0];
365 ref_B = neigh_rpl[0].list[neigh->ref_idx[0]];365 ref_B = neigh_rpl[L0].refs[neigh->ref_idx[L0]].poc;
366 } else {366 } else {
367 B = neigh->mv[1];367 B = neigh->mv[1];
368 ref_B = neigh_rpl[1].list[neigh->ref_idx[1]];368 ref_B = neigh_rpl[L1].refs[neigh->ref_idx[L1]].poc;
369 }369 }
370 370
371 if (ref_A == ref_B) {371 if (ref_A == ref_B) {
libavcodec/vvc/inter.c+2−2
@@ -394,7 +394,7 @@ static int pred_get_refs(const VVCLocalContext *lc, VVCFrame *ref[2], const MvF · 393 unmodified lines
394 for (int mask = PF_L0; mask <= PF_L1; mask++) {394 for (int mask = PF_L0; mask <= PF_L1; mask++) {
395 if (mv->pred_flag & mask) {395 if (mv->pred_flag & mask) {
396 const int lx = mask - PF_L0;396 const int lx = mask - PF_L0;
397 ref[lx] = rpl[lx].ref[mv->ref_idx[lx]];397 ref[lx] = rpl[lx].refs[mv->ref_idx[lx]].ref;
398 if (!ref[lx])398 if (!ref[lx])
399 return AVERROR_INVALIDDATA;399 return AVERROR_INVALIDDATA;
400 }400 }
@@ -450,7 +450,7 @@ static void pred_gpm_blk(VVCLocalContext *lc) · 49 unmodified lines
450 for (int i = 0; i < 2; i++) {450 for (int i = 0; i < 2; i++) {
451 const MvField *mv = pu->gpm_mv + i;451 const MvField *mv = pu->gpm_mv + i;
452 const int lx = mv->pred_flag - PF_L0;452 const int lx = mv->pred_flag - PF_L0;
453 VVCFrame *ref = lc->sc->rpl[lx].ref[mv->ref_idx[lx]];453 VVCFrame *ref = lc->sc->rpl[lx].refs[mv->ref_idx[lx]].ref;
454 if (!ref)454 if (!ref)
455 return;455 return;
456 mc(lc, tmp[i], ref->frame, mv->mv + lx, x, y, width, height, c_idx);456 mc(lc, tmp[i], ref->frame, mv->mv + lx, x, y, width, height, c_idx);
libavcodec/vvc/mvs.c+18−18
@@ -88,8 +88,8 @@ static int check_mvset(Mv *mvLXCol, Mv *mvCol, · 87 unmodified lines
88 const RefPicList *refPicList, int X, int refIdxLx,88 const RefPicList *refPicList, int X, int refIdxLx,
89 const RefPicList *refPicList_col, int listCol, int refidxCol)89 const RefPicList *refPicList_col, int listCol, int refidxCol)
90{90{
91 int cur_lt = refPicList[X].isLongTerm[refIdxLx];91 int cur_lt = refPicList[X].refs[refIdxLx].is_lt;
92 int col_lt = refPicList_col[listCol].isLongTerm[refidxCol];92 int col_lt = refPicList_col[listCol].refs[refidxCol].is_lt;
93 int col_poc_diff, cur_poc_diff;93 int col_poc_diff, cur_poc_diff;
94 94
95 if (cur_lt != col_lt) {95 if (cur_lt != col_lt) {
@@ -98,8 +98,8 @@ static int check_mvset(Mv *mvLXCol, Mv *mvCol, · 2 unmodified lines
98 return 0;98 return 0;
99 }99 }
100 100
101 col_poc_diff = colPic - refPicList_col[listCol].list[refidxCol];101 col_poc_diff = colPic - refPicList_col[listCol].refs[refidxCol].poc;
102 cur_poc_diff = poc - refPicList[X].list[refIdxLx];102 cur_poc_diff = poc - refPicList[X].refs[refIdxLx].poc;
103 103
104 mv_compression(mvCol);104 mv_compression(mvCol);
105 if (cur_lt || col_poc_diff == cur_poc_diff) {105 if (cur_lt || col_poc_diff == cur_poc_diff) {
@@ -126,7 +126,7 @@ int ff_vvc_no_backward_pred_flag(const VVCLocalContext *lc) · 20 unmodified lines
126 126
127 for (j = 0; j < 2; j++) {127 for (j = 0; j < 2; j++) {
128 for (i = 0; i < lc->sc->sh.r->num_ref_idx_active[j]; i++) {128 for (i = 0; i < lc->sc->sh.r->num_ref_idx_active[j]; i++) {
129 if (rpl[j].list[i] > lc->fc->ps.ph.poc) {129 if (rpl[j].refs[i].poc > lc->fc->ps.ph.poc) {
130 check_diffpicount++;130 check_diffpicount++;
131 break;131 break;
132 }132 }
@@ -1059,9 +1059,9 @@ static int sb_temporal_luma_motion_data(const VVCLocalContext *lc, const MvField · 926 unmodified lines
1059 colPic = ref->poc;1059 colPic = ref->poc;
1060 1060
1061 if (a1) {1061 if (a1) {
1062 if ((a1->pred_flag & PF_L0) && colPic == rpl[0].list[a1->ref_idx[0]])1062 if ((a1->pred_flag & PF_L0) && colPic == rpl[L0].refs[a1->ref_idx[L0]].poc)
1063 *temp_mv = a1->mv[0];1063 *temp_mv = a1->mv[0];
1064 else if ((a1->pred_flag & PF_L1) && colPic == rpl[1].list[a1->ref_idx[1]])1064 else if ((a1->pred_flag & PF_L1) && colPic == rpl[L1].refs[a1->ref_idx[L1]].poc)
1065 *temp_mv = a1->mv[1];1065 *temp_mv = a1->mv[1];
1066 ff_vvc_round_mv(temp_mv, 0, 4);1066 ff_vvc_round_mv(temp_mv, 0, 4);
1067 }1067 }
@@ -1418,16 +1418,16 @@ static int mvp_candidate(const VVCLocalContext *lc, const int x_cand, const int · 350 unmodified lines
1418 const MvField* tab_mvf = fc->tab.mvf;1418 const MvField* tab_mvf = fc->tab.mvf;
1419 const MvField *mvf = &TAB_MVF(x_cand, y_cand);1419 const MvField *mvf = &TAB_MVF(x_cand, y_cand);
1420 const PredFlag maskx = lx + 1;1420 const PredFlag maskx = lx + 1;
1421 const int poc = rpl[lx].list[ref_idx[lx]];1421 const int poc = rpl[lx].refs[ref_idx[lx]].poc;
1422 int available = 0;1422 int available = 0;
1423 1423
1424 if ((mvf->pred_flag & maskx) && rpl[lx].list[mvf->ref_idx[lx]] == poc) {1424 if ((mvf->pred_flag & maskx) && rpl[lx].refs[mvf->ref_idx[lx]].poc == poc) {
1425 available = 1;1425 available = 1;
1426 *mv = mvf->mv[lx];1426 *mv = mvf->mv[lx];
1427 } else {1427 } else {
1428 const int ly = !lx;1428 const int ly = !lx;
1429 const PredFlag masky = ly + 1;1429 const PredFlag masky = ly + 1;
1430 if ((mvf->pred_flag & masky) && rpl[ly].list[mvf->ref_idx[ly]] == poc) {1430 if ((mvf->pred_flag & masky) && rpl[ly].refs[mvf->ref_idx[ly]].poc == poc) {
1431 available = 1;1431 available = 1;
1432 *mv = mvf->mv[ly];1432 *mv = mvf->mv[ly];
1433 }1433 }
@@ -1450,15 +1450,15 @@ static int affine_mvp_candidate(const VVCLocalContext *lc, · 16 unmodified lines
1450 const MvField *mvf = &TAB_MVF(x_nb, y_nb);1450 const MvField *mvf = &TAB_MVF(x_nb, y_nb);
1451 RefPicList* rpl = lc->sc->rpl;1451 RefPicList* rpl = lc->sc->rpl;
1452 const PredFlag maskx = lx + 1;1452 const PredFlag maskx = lx + 1;
1453 const int poc = rpl[lx].list[ref_idx[lx]];1453 const int poc = rpl[lx].refs[ref_idx[lx]].poc;
1454 1454
1455 if ((mvf->pred_flag & maskx) && rpl[lx].list[mvf->ref_idx[lx]] == poc) {1455 if ((mvf->pred_flag & maskx) && rpl[lx].refs[mvf->ref_idx[lx]].poc == poc) {
1456 available = 1;1456 available = 1;
1457 affine_cps_from_nb(lc, x_nb, y_nb, nbw, nbh, lx, cps, num_cp);1457 affine_cps_from_nb(lc, x_nb, y_nb, nbw, nbh, lx, cps, num_cp);
1458 } else {1458 } else {
1459 const int ly = !lx;1459 const int ly = !lx;
1460 const PredFlag masky = ly + 1;1460 const PredFlag masky = ly + 1;
1461 if ((mvf->pred_flag & masky) && rpl[ly].list[mvf->ref_idx[ly]] == poc) {1461 if ((mvf->pred_flag & masky) && rpl[ly].refs[mvf->ref_idx[ly]].poc == poc) {
1462 available = 1;1462 available = 1;
1463 affine_cps_from_nb(lc, x_nb, y_nb, nbw, nbh, ly, cps, num_cp);1463 affine_cps_from_nb(lc, x_nb, y_nb, nbw, nbh, ly, cps, num_cp);
1464 }1464 }
@@ -1550,7 +1550,7 @@ static int mvp_history_candidates(const VVCLocalContext *lc, · 85 unmodified lines
1550{1550{
1551 const EntryPoint* ep = lc->ep;1551 const EntryPoint* ep = lc->ep;
1552 const RefPicList* rpl = lc->sc->rpl;1552 const RefPicList* rpl = lc->sc->rpl;
1553 const int poc = rpl[lx].list[ref_idx];1553 const int poc = rpl[lx].refs[ref_idx].poc;
1554 1554
1555 if (ep->num_hmvp == 0)1555 if (ep->num_hmvp == 0)
1556 return 0;1556 return 0;
@@ -1559,7 +1559,7 @@ static int mvp_history_candidates(const VVCLocalContext *lc, · 2 unmodified lines
1559 for (int j = 0; j < 2; j++) {1559 for (int j = 0; j < 2; j++) {
1560 const int ly = (j ? !lx : lx);1560 const int ly = (j ? !lx : lx);
1561 PredFlag mask = PF_L0 + ly;1561 PredFlag mask = PF_L0 + ly;
1562 if ((h->pred_flag & mask) && poc == rpl[ly].list[h->ref_idx[ly]]) {1562 if ((h->pred_flag & mask) && poc == rpl[ly].refs[h->ref_idx[ly]].poc) {
1563 if (mvp_lx_flag == num_cands) {1563 if (mvp_lx_flag == num_cands) {
1564 *mv = h->mv[ly];1564 *mv = h->mv[ly];
1565 ff_vvc_round_mv(mv, amvr_shift, amvr_shift);1565 ff_vvc_round_mv(mv, amvr_shift, amvr_shift);
@@ -1725,14 +1725,14 @@ static int affine_mvp_constructed_cp(NeighbourContext *ctx, · 159 unmodified lines
1725 if (check_available(n, ctx->lc, 0)) {1725 if (check_available(n, ctx->lc, 0)) {
1726 const PredFlag maskx = lx + 1;1726 const PredFlag maskx = lx + 1;
1727 const MvField* mvf = &TAB_MVF(n->x, n->y);1727 const MvField* mvf = &TAB_MVF(n->x, n->y);
1728 const int poc = rpl[lx].list[ref_idx];1728 const int poc = rpl[lx].refs[ref_idx].poc;
1729 if ((mvf->pred_flag & maskx) && rpl[lx].list[mvf->ref_idx[lx]] == poc) {1729 if ((mvf->pred_flag & maskx) && rpl[lx].refs[mvf->ref_idx[lx]].poc == poc) {
1730 available = 1;1730 available = 1;
1731 *cp = mvf->mv[lx];1731 *cp = mvf->mv[lx];
1732 } else {1732 } else {
1733 const int ly = !lx;1733 const int ly = !lx;
1734 const PredFlag masky = ly + 1;1734 const PredFlag masky = ly + 1;
1735 if ((mvf->pred_flag & masky) && rpl[ly].list[mvf->ref_idx[ly]] == poc) {1735 if ((mvf->pred_flag & masky) && rpl[ly].refs[mvf->ref_idx[ly]].poc == poc) {
1736 available = 1;1736 available = 1;
1737 *cp = mvf->mv[ly];1737 *cp = mvf->mv[ly];
1738 }1738 }
libavcodec/vvc/refs.c+6−5
@@ -352,7 +352,8 @@ static VVCFrame *generate_missing_ref(VVCContext *s, VVCFrameContext *fc, int po · 351 unmodified lines
352static int add_candidate_ref(VVCContext *s, VVCFrameContext *fc, RefPicList *list,352static int add_candidate_ref(VVCContext *s, VVCFrameContext *fc, RefPicList *list,
353 int poc, int ref_flag, uint8_t use_msb)353 int poc, int ref_flag, uint8_t use_msb)
354{354{
355 VVCFrame *ref = find_ref_idx(s, fc, poc, use_msb);355 VVCFrame *ref = find_ref_idx(s, fc, poc, use_msb);
356 VVCRefPic *refp = &list->refs[list->nb_refs];
356 357
357 if (ref == fc->ref || list->nb_refs >= VVC_MAX_REF_ENTRIES)358 if (ref == fc->ref || list->nb_refs >= VVC_MAX_REF_ENTRIES)
358 return AVERROR_INVALIDDATA;359 return AVERROR_INVALIDDATA;
@@ -363,9 +364,9 @@ static int add_candidate_ref(VVCContext *s, VVCFrameContext *fc, RefPicList *lis · 4 unmodified lines
363 return AVERROR(ENOMEM);364 return AVERROR(ENOMEM);
364 }365 }
365 366
366 list->list[list->nb_refs] = poc;367 refp->poc = poc;
367 list->ref[list->nb_refs] = ref;368 refp->ref = ref;
368 list->isLongTerm[list->nb_refs] = ref_flag & VVC_FRAME_FLAG_LONG_REF;369 refp->is_lt = ref_flag & VVC_FRAME_FLAG_LONG_REF;
369 list->nb_refs++;370 list->nb_refs++;
370 371
371 mark_ref(ref, ref_flag);372 mark_ref(ref, ref_flag);
@@ -463,7 +464,7 @@ int ff_vvc_slice_rpl(VVCContext *s, VVCFrameContext *fc, SliceContext *sc) · 91 unmodified lines
463 }464 }
464 if ((!rsh->sh_collocated_from_l0_flag) == lx &&465 if ((!rsh->sh_collocated_from_l0_flag) == lx &&
465 rsh->sh_collocated_ref_idx < rpl->nb_refs)466 rsh->sh_collocated_ref_idx < rpl->nb_refs)
466 fc->ref->collocated_ref = rpl->ref[rsh->sh_collocated_ref_idx];467 fc->ref->collocated_ref = rpl->refs[rsh->sh_collocated_ref_idx].ref;
467 }468 }
468 return 0;469 return 0;
469}470}
libavcodec/vvc/thread.c+1−1
@@ -294,7 +294,7 @@ static void schedule_inter(VVCContext *s, VVCFrameContext *fc, const SliceContex · 293 unmodified lines
294 for (int lx = 0; lx < 2; lx++) {294 for (int lx = 0; lx < 2; lx++) {
295 for (int i = 0; i < sh->r->num_ref_idx_active[lx]; i++) {295 for (int i = 0; i < sh->r->num_ref_idx_active[lx]; i++) {
296 const int y = ctu->max_y[lx][i];296 const int y = ctu->max_y[lx][i];
297 VVCFrame *ref = sc->rpl[lx].ref[i];297 VVCFrame *ref = sc->rpl[lx].refs[i].ref;
298 if (ref && y >= 0)298 if (ref && y >= 0)
299 add_progress_listener(ref, &t->listener[lx][i], t, s, VVC_PROGRESS_PIXEL, y + LUMA_EXTRA_AFTER);299 add_progress_listener(ref, &t->listener[lx][i], t, s, VVC_PROGRESS_PIXEL, y + LUMA_EXTRA_AFTER);
300 }300 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t