Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd912ba1

Browse files
committed
vvc_thread: report mv progress in parser if we do not have dmvr
1 parentcc98cae commitd912ba1

File tree

4 files changed

+49
-39
lines changed

4 files changed

+49
-39
lines changed

‎libavcodec/vvc/vvc_ctu.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ static CodingUnit* add_cu(VVCLocalContext *lc, const int x0, const int y0,
12161216
cu->ciip_flag=0;
12171217
cu->coded_flag=1;
12181218
cu->num_intra_subpartitions=1;
1219+
cu->pu.dmvr_flag=0;
12191220

12201221
set_cb_pos(fc,cu);
12211222
returncu;
@@ -1643,7 +1644,6 @@ static void derive_dmvr_bdof_flag(const VVCLocalContext *lc, PredictionUnit *pu)
16431644
constCodingUnit*cu=lc->cu;
16441645
constPredWeightTable*w=pps->r->pps_wp_info_in_ph_flag ?&fc->ps.ph.pwt :&sh->pwt;
16451646

1646-
pu->dmvr_flag=0;
16471647
pu->bdof_flag=0;
16481648

16491649
if (mi->pred_flag==PF_BI&&
@@ -1681,6 +1681,20 @@ static void refine_regular_subblock(const VVCLocalContext *lc)
16811681
}
16821682
}
16831683

1684+
staticvoidfill_dmvr_info(constVVCFrameContext*fc,constintx0,constinty0,
1685+
constintwidth,constintheight)
1686+
{
1687+
constVVCPPS*pps=fc->ps.pps;
1688+
constintw=width >>MIN_PU_LOG2;
1689+
1690+
for (inty=y0 >>MIN_PU_LOG2;y< (y0+height) >>MIN_PU_LOG2;y++) {
1691+
constintidx=pps->min_pu_width*y+ (x0 >>MIN_PU_LOG2);
1692+
constMvField*mvf=fc->tab.mvf+idx;
1693+
MvField*dmvr_mvf=fc->ref->tab_dmvr_mvf+idx;
1694+
memcpy(dmvr_mvf,mvf,sizeof(MvField)*w);
1695+
}
1696+
}
1697+
16841698
staticintinter_data(VVCLocalContext*lc)
16851699
{
16861700
constCodingUnit*cu=lc->cu;
@@ -1704,6 +1718,8 @@ static int inter_data(VVCLocalContext *lc)
17041718
refine_regular_subblock(lc);
17051719
ff_vvc_update_hmvp(lc,mi);
17061720
}
1721+
if (!pu->dmvr_flag)
1722+
fill_dmvr_info(lc->fc,cu->x0,cu->y0,cu->cb_width,cu->cb_height);
17071723
returnret;
17081724
}
17091725

@@ -2339,7 +2355,7 @@ static void cu_get_max_y(const CodingUnit *cu, int max_y[2][VVC_MAX_REF_ENTRIES]
23392355
}
23402356
}
23412357

2342-
staticvoidpred_get_max_y(VVCLocalContext*lc,constintrs)
2358+
staticvoidctu_get_pred(VVCLocalContext*lc,constintrs)
23432359
{
23442360
constVVCFrameContext*fc=lc->fc;
23452361
constH266RawSliceHeader*rsh=lc->sc->sh.r;
@@ -2353,8 +2369,10 @@ static void pred_get_max_y(VVCLocalContext *lc, const int rs)
23532369
memset(ctu->max_y[lx],-1,sizeof(ctu->max_y[0][0])*rsh->num_ref_idx_active[lx]);
23542370

23552371
while (cu) {
2356-
if (has_inter_luma(cu))
2372+
if (has_inter_luma(cu)) {
23572373
cu_get_max_y(cu,ctu->max_y,fc);
2374+
ctu->has_dmvr |=cu->pu.dmvr_flag;
2375+
}
23582376
cu=cu->next;
23592377
}
23602378
ctu->max_y_idx[0]=ctu->max_y_idx[1]=0;
@@ -2386,7 +2404,7 @@ int ff_vvc_coding_tree_unit(VVCLocalContext *lc,
23862404
ret=hls_coding_tree_unit(lc,x_ctb,y_ctb,ctu_idx,rx,ry);
23872405
if (ret<0)
23882406
returnret;
2389-
pred_get_max_y(lc,rs);
2407+
ctu_get_pred(lc,rs);
23902408

23912409
return0;
23922410
}

‎libavcodec/vvc/vvc_ctu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ typedef struct CTU {
328328
CodingUnit*cus;
329329
intmax_y[2][VVC_MAX_REF_ENTRIES];
330330
intmax_y_idx[2];
331+
inthas_dmvr;
331332
}CTU;
332333

333334
typedefstructReconstructedArea {

‎libavcodec/vvc/vvc_inter.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -761,20 +761,6 @@ static void set_dmvr_info(VVCFrameContext *fc, const int x0, const int y0,
761761
}
762762
}
763763

764-
staticvoidfill_dmvr_info(constVVCFrameContext*fc,constintx0,constinty0,
765-
constintwidth,constintheight)
766-
{
767-
constVVCPPS*pps=fc->ps.pps;
768-
constintw=width >>MIN_PU_LOG2;
769-
770-
for (inty=y0 >>MIN_PU_LOG2;y< (y0+height) >>MIN_PU_LOG2;y++) {
771-
constintidx=pps->min_pu_width*y+ (x0 >>MIN_PU_LOG2);
772-
constMvField*mvf=fc->tab.mvf+idx;
773-
MvField*dmvr_mvf=fc->ref->tab_dmvr_mvf+idx;
774-
memcpy(dmvr_mvf,mvf,sizeof(MvField)*w);
775-
}
776-
}
777-
778764
staticvoidderive_sb_mv(VVCLocalContext*lc,MvField*mv,MvField*orig_mv,int*sb_bdof_flag,
779765
constintx0,constinty0,constintsbw,constintsbh)
780766
{
@@ -899,8 +885,6 @@ static void predict_inter(VVCLocalContext *lc)
899885
else
900886
pred_regular_blk(lc,1);//intra block is not ready yet, skip ciip
901887

902-
if (!pu->dmvr_flag)
903-
fill_dmvr_info(fc,cu->x0,cu->y0,cu->cb_width,cu->cb_height);
904888
if (lc->sc->sh.r->sh_lmcs_used_flag&& !cu->ciip_flag) {
905889
uint8_t*dst0=POS(0,cu->x0,cu->y0);
906890
fc->vvcdsp.lmcs.filter(dst0,fc->frame->linesize[LUMA],cu->cb_width,cu->cb_height,fc->ps.lmcs.fwd_lut);

‎libavcodec/vvc/vvc_thread.c

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -376,27 +376,11 @@ static int task_priority_higher(const AVTask *_a, const AVTask *_b)
376376
returna->ry<b->ry;
377377
}
378378

379-
staticintrun_parse(VVCContext*s,VVCLocalContext*lc,VVCTask*t)
380-
{
381-
intret,rs;
382-
383-
lc->sc=t->sc;
384-
lc->ep=t->ep;
385-
386-
rs=t->sc->sh.ctb_addr_in_curr_slice[t->ctu_idx];
387-
ret=ff_vvc_coding_tree_unit(lc,t->ctu_idx,rs,t->rx,t->ry);
388-
if (ret<0)
389-
returnret;
390-
391-
return0;
392-
}
393-
394379
staticvoidreport_frame_progress(VVCFrameContext*fc,
395-
constintry,constVVCTaskTypetype)
380+
constintry,constVVCProgressidx)
396381
{
397382
VVCFrameThread*ft=fc->ft;
398383
constintctu_size=ft->ctu_size;
399-
constintidx=type==VVC_TASK_TYPE_INTER ?VVC_PROGRESS_MV :VVC_PROGRESS_PIXEL;
400384
intold;
401385

402386
if (atomic_fetch_add(&ft->rows[ry].progress[idx],1)==ft->ctu_width-1) {
@@ -414,18 +398,41 @@ static void report_frame_progress(VVCFrameContext *fc,
414398
}
415399
}
416400

401+
staticintrun_parse(VVCContext*s,VVCLocalContext*lc,VVCTask*t)
402+
{
403+
intret;
404+
VVCFrameContext*fc=lc->fc;
405+
constintrs=t->sc->sh.ctb_addr_in_curr_slice[t->ctu_idx];
406+
constCTU*ctu=fc->tab.ctus+rs;
407+
408+
lc->sc=t->sc;
409+
lc->ep=t->ep;
410+
411+
ret=ff_vvc_coding_tree_unit(lc,t->ctu_idx,rs,t->rx,t->ry);
412+
if (ret<0)
413+
returnret;
414+
415+
if (!ctu->has_dmvr)
416+
report_frame_progress(lc->fc,t->ry,VVC_PROGRESS_MV);
417+
418+
return0;
419+
}
420+
417421
staticintrun_inter(VVCContext*s,VVCLocalContext*lc,VVCTask*t)
418422
{
419423
VVCFrameContext*fc=lc->fc;
420424
VVCFrameThread*ft=fc->ft;
421425
constintrs=t->ry*ft->ctu_width+t->rx;
426+
constCTU*ctu=fc->tab.ctus+rs;
422427
constintslice_idx=fc->tab.slice_idx[rs];
423428

424429
if (slice_idx!=-1) {
425430
lc->sc=fc->slices[slice_idx];
426431
ff_vvc_predict_inter(lc,rs);
427432
}
428-
report_frame_progress(fc,t->ry,VVC_TASK_TYPE_INTER);
433+
434+
if (ctu->has_dmvr)
435+
report_frame_progress(fc,t->ry,VVC_PROGRESS_MV);
429436

430437
return0;
431438
}
@@ -544,7 +551,7 @@ static int run_alf(VVCContext *s, VVCLocalContext *lc, VVCTask *t)
544551
ff_vvc_alf_filter(lc,x0,y0);
545552
}
546553
}
547-
report_frame_progress(fc,t->ry,VVC_TASK_TYPE_ALF);
554+
report_frame_progress(fc,t->ry,VVC_PROGRESS_PIXEL);
548555

549556
return0;
550557
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp