diff options
author | Victorien Le Couviour--Tuffet <victorien@videolan.org> | 2021-01-22 13:59:20 +0300 |
---|---|---|
committer | Victorien Le Couviour--Tuffet <victorien@videolan.org> | 2021-01-28 17:08:10 +0300 |
commit | 549086e4d3024410c6145c89266b37c916808b04 (patch) | |
tree | 682b65586b2368d6606e165cd4a87c95a48ed8cf /src/internal.h | |
parent | 4db73f115e39c6e33f20905d4ba281ab96db16b6 (diff) |
Add post-filters threading model
Diffstat (limited to 'src/internal.h')
-rw-r--r-- | src/internal.h | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/internal.h b/src/internal.h index ea29d8f..0a71420 100644 --- a/src/internal.h +++ b/src/internal.h @@ -35,6 +35,8 @@ typedef struct Dav1dFrameContext Dav1dFrameContext; typedef struct Dav1dTileState Dav1dTileState; typedef struct Dav1dTileContext Dav1dTileContext; +typedef struct Dav1dPostFilterContext Dav1dPostFilterContext; +typedef struct Dav1dTask Dav1dTask; #include "common/attributes.h" @@ -76,6 +78,9 @@ struct Dav1dContext { Dav1dFrameContext *fc; unsigned n_fc; + Dav1dPostFilterContext *pfc; + unsigned n_pfc; + // cache of OBUs that make up a single frame before we submit them // to a frame worker to be decoded struct Dav1dTileGroup *tile; @@ -99,15 +104,23 @@ struct Dav1dContext { // decoded output picture queue Dav1dData in; Dav1dPicture out; + // dummy is a pointer to prevent compiler errors about atomic_load() + // not taking const arguments + atomic_int flush_mem, *flush; struct { Dav1dThreadPicture *out_delayed; unsigned next; - // dummy is a pointer to prevent compiler errors about atomic_load() - // not taking const arguments; the const attribute is not taken - // from pointers - atomic_int flush_mem, *flush; } frame_thread; + // postfilter threading (refer to pfc[] for per_thread thingies) + struct PostFilterThreadData { + pthread_mutex_t lock; + pthread_cond_t cond; + struct Dav1dTask *tasks; + int frame_cnt; + int inited; + } postfilter_thread; + // reference/entropy state Dav1dMemPool *segmap_pool; Dav1dMemPool *refmvs_pool; @@ -182,6 +195,10 @@ struct Dav1dFrameContext { recon_b_intra_fn recon_b_intra; recon_b_inter_fn recon_b_inter; filter_sbrow_fn filter_sbrow; + filter_sbrow_fn filter_sbrow_deblock; + filter_sbrow_fn filter_sbrow_cdef; + filter_sbrow_fn filter_sbrow_resize; + filter_sbrow_fn filter_sbrow_lr; backup_ipred_edge_fn backup_ipred_edge; read_coef_blocks_fn read_coef_blocks; } bd_fn; @@ -238,6 +255,16 @@ struct Dav1dFrameContext { pixel *p[3], *sr_p[3]; Av1Filter *mask_ptr, *prev_mask_ptr; int restore_planes; // enum LrRestorePlanes + + struct { + pthread_cond_t cond; + struct PostFilterThreadData *pftd; + struct Dav1dTask *tasks; + int num_tasks; + int npf; + int done; + int inited; + } thread; } lf; // threading (refer to tc[] for per-thread things) @@ -353,4 +380,11 @@ struct Dav1dTileContext { } tile_thread; }; +struct Dav1dPostFilterContext { + Dav1dContext *c; + struct thread_data td; + int flushed; + int die; +}; + #endif /* DAV1D_SRC_INTERNAL_H */ |