#include "aom/aom_image.h"
#include "config/aom_config.h"
#include "config/aom_scale_rtcd.h"
#include "aom_dsp/aom_dsp_common.h"
#include "aom_dsp/txfm_common.h"
#include "aom_mem/aom_mem.h"
#include "aom_util/aom_pthread.h"
#include "aom_util/aom_thread.h"
#include "av1/common/av1_loopfilter.h"
#include "av1/common/blockd.h"
#include "av1/common/cdef.h"
#include "av1/common/entropymode.h"
#include "av1/common/enums.h"
#include "av1/common/thread_common.h"
#include "av1/common/reconinter.h"
#include "av1/common/reconintra.h"
#include "av1/common/restoration.h"
static inline int get_sync_range(int width) { … }
static inline int get_lr_sync_range(int width) { … }
void av1_loop_filter_alloc(AV1LfSync *lf_sync, AV1_COMMON *cm, int rows,
int width, int num_workers) { … }
void av1_loop_filter_dealloc(AV1LfSync *lf_sync) { … }
void av1_alloc_cdef_sync(AV1_COMMON *const cm, AV1CdefSync *cdef_sync,
int num_workers) { … }
void av1_free_cdef_sync(AV1CdefSync *cdef_sync) { … }
static inline void cdef_row_mt_sync_read(AV1CdefSync *const cdef_sync,
int row) { … }
static inline void cdef_row_mt_sync_write(AV1CdefSync *const cdef_sync,
int row) { … }
static inline void sync_read(AV1LfSync *const lf_sync, int r, int c,
int plane) { … }
static inline void sync_write(AV1LfSync *const lf_sync, int r, int c,
const int sb_cols, int plane) { … }
void av1_thread_loop_filter_rows(
const YV12_BUFFER_CONFIG *const frame_buffer, AV1_COMMON *const cm,
struct macroblockd_plane *planes, MACROBLOCKD *xd, int mi_row, int plane,
int dir, int lpf_opt_level, AV1LfSync *const lf_sync,
struct aom_internal_error_info *error_info,
AV1_DEBLOCKING_PARAMETERS *params_buf, TX_SIZE *tx_buf,
int num_mis_in_lpf_unit_height_log2) { … }
void av1_set_vert_loop_filter_done(AV1_COMMON *cm, AV1LfSync *lf_sync,
int num_mis_in_lpf_unit_height_log2) { … }
static inline void sync_lf_workers(AVxWorker *const workers,
AV1_COMMON *const cm, int num_workers) { … }
static int loop_filter_row_worker(void *arg1, void *arg2) { … }
static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
MACROBLOCKD *xd, int start, int stop,
const int planes_to_lf[MAX_MB_PLANE],
AVxWorker *workers, int num_workers,
AV1LfSync *lf_sync, int lpf_opt_level) { … }
static void loop_filter_rows(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
MACROBLOCKD *xd, int start, int stop,
const int planes_to_lf[MAX_MB_PLANE],
int lpf_opt_level) { … }
void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
MACROBLOCKD *xd, int plane_start, int plane_end,
int partial_frame, AVxWorker *workers,
int num_workers, AV1LfSync *lf_sync,
int lpf_opt_level) { … }
static inline void lr_sync_read(void *const lr_sync, int r, int c, int plane) { … }
static inline void lr_sync_write(void *const lr_sync, int r, int c,
const int sb_cols, int plane) { … }
void av1_loop_restoration_alloc(AV1LrSync *lr_sync, AV1_COMMON *cm,
int num_workers, int num_rows_lr,
int num_planes, int width) { … }
void av1_loop_restoration_dealloc(AV1LrSync *lr_sync) { … }
static void enqueue_lr_jobs(AV1LrSync *lr_sync, AV1LrStruct *lr_ctxt,
AV1_COMMON *cm) { … }
static AV1LrMTInfo *get_lr_job_info(AV1LrSync *lr_sync) { … }
static void set_loop_restoration_done(AV1LrSync *const lr_sync,
FilterFrameCtxt *const ctxt) { … }
static int loop_restoration_row_worker(void *arg1, void *arg2) { … }
static inline void sync_lr_workers(AVxWorker *const workers,
AV1_COMMON *const cm, int num_workers) { … }
static void foreach_rest_unit_in_planes_mt(AV1LrStruct *lr_ctxt,
AVxWorker *workers, int num_workers,
AV1LrSync *lr_sync, AV1_COMMON *cm,
int do_extend_border) { … }
void av1_loop_restoration_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
AV1_COMMON *cm, int optimized_lr,
AVxWorker *workers, int num_workers,
AV1LrSync *lr_sync, void *lr_ctxt,
int do_extend_border) { … }
static inline void reset_cdef_job_info(AV1CdefSync *const cdef_sync) { … }
static inline void launch_cdef_workers(AVxWorker *const workers,
int num_workers) { … }
static inline void sync_cdef_workers(AVxWorker *const workers,
AV1_COMMON *const cm, int num_workers) { … }
static void update_cdef_row_next_job_info(AV1CdefSync *const cdef_sync,
const int nvfb) { … }
static inline int get_cdef_row_next_job(AV1CdefSync *const cdef_sync,
volatile int *cur_fbr, const int nvfb) { … }
static void set_cdef_init_fb_row_done(AV1CdefSync *const cdef_sync, int nvfb) { … }
static int cdef_sb_row_worker_hook(void *arg1, void *arg2) { … }
static void prepare_cdef_frame_workers(
AV1_COMMON *const cm, MACROBLOCKD *xd, AV1CdefWorkerData *const cdef_worker,
AVxWorkerHook hook, AVxWorker *const workers, AV1CdefSync *const cdef_sync,
int num_workers, cdef_init_fb_row_t cdef_init_fb_row_fn,
int do_extend_border) { … }
void av1_cdef_init_fb_row_mt(const AV1_COMMON *const cm,
const MACROBLOCKD *const xd,
CdefBlockInfo *const fb_info,
uint16_t **const linebuf, uint16_t *const src,
struct AV1CdefSyncData *const cdef_sync, int fbr) { … }
void av1_cdef_frame_mt(AV1_COMMON *const cm, MACROBLOCKD *const xd,
AV1CdefWorkerData *const cdef_worker,
AVxWorker *const workers, AV1CdefSync *const cdef_sync,
int num_workers, cdef_init_fb_row_t cdef_init_fb_row_fn,
int do_extend_border) { … }
int av1_get_intrabc_extra_top_right_sb_delay(const AV1_COMMON *cm) { … }