FFmpeg
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
vvc_thread.c File Reference
#include <stdatomic.h>
#include "libavutil/executor.h"
#include "libavutil/thread.h"
#include "vvc_thread.h"
#include "vvc_ctu.h"
#include "vvc_filter.h"
#include "vvc_inter.h"
#include "vvc_intra.h"
#include "vvc_refs.h"

Go to the source code of this file.

Data Structures

struct  ProgressListener
 
struct  VVCTask
 
struct  VVCRowThread
 
struct  VVCFrameThread
 

Macros

#define ADD(dx, dy, stage)   frame_thread_add_score(s, ft, t->rx + (dx), t->ry + (dy), stage)
 
#define CHECK(a, b)
 
#define VVC_THREAD_DEBUG
 

Typedefs

typedef int(* run_func) (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 

Enumerations

enum  VVCTaskStage {
  VVC_TASK_STAGE_PARSE, VVC_TASK_STAGE_INTER, VVC_TASK_STAGE_RECON, VVC_TASK_STAGE_LMCS,
  VVC_TASK_STAGE_DEBLOCK_V, VVC_TASK_STAGE_DEBLOCK_H, VVC_TASK_STAGE_SAO, VVC_TASK_STAGE_ALF,
  VVC_TASK_STAGE_LAST
}
 

Functions

static void add_task (VVCContext *s, VVCTask *t)
 
static void task_init (VVCTask *t, VVCTaskStage stage, VVCFrameContext *fc, const int rx, const int ry)
 
static void task_init_parse (VVCTask *t, SliceContext *sc, EntryPoint *ep, const int ctu_idx)
 
static uint8_t task_add_score (VVCTask *t, const VVCTaskStage stage)
 
static uint8_t task_get_score (VVCTask *t, const VVCTaskStage stage)
 
static int is_first_row (const VVCFrameContext *fc, const int rx, const int ry)
 
static int task_has_target_score (VVCTask *t, const VVCTaskStage stage, const uint8_t score)
 
static void frame_thread_add_score (VVCContext *s, VVCFrameThread *ft, const int rx, const int ry, const VVCTaskStage stage)
 
static void sheduled_done (VVCFrameThread *ft, atomic_int *scheduled)
 
static void progress_done (VVCProgressListener *_l, const int type)
 
static void pixel_done (VVCProgressListener *l)
 
static void mv_done (VVCProgressListener *l)
 
static void listener_init (ProgressListener *l, VVCTask *t, VVCContext *s, const VVCProgress vp, const int y)
 
static void add_progress_listener (VVCFrame *ref, ProgressListener *l, VVCTask *t, VVCContext *s, const VVCProgress vp, const int y)
 
static void schedule_next_parse (VVCContext *s, VVCFrameContext *fc, const SliceContext *sc, const VVCTask *t)
 
static void schedule_inter (VVCContext *s, VVCFrameContext *fc, const SliceContext *sc, VVCTask *t, const int rs)
 
static void parse_task_done (VVCContext *s, VVCFrameContext *fc, const int rx, const int ry)
 
static void task_stage_done (const VVCTask *t, VVCContext *s)
 
static int task_is_stage_ready (VVCTask *t, int add)
 
static int task_ready (const AVTask *_t, void *user_data)
 
static int task_priority_higher (const AVTask *_a, const AVTask *_b)
 
static void report_frame_progress (VVCFrameContext *fc, const int ry, const VVCProgress idx)
 
static int run_parse (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_inter (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_recon (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_lmcs (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_deblock_v (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_deblock_h (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_sao (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static int run_alf (VVCContext *s, VVCLocalContext *lc, VVCTask *t)
 
static void task_run_stage (VVCTask *t, VVCContext *s, VVCLocalContext *lc)
 
static int task_run (AVTask *_t, void *local_context, void *user_data)
 
AVExecutorff_vvc_executor_alloc (VVCContext *s, const int thread_count)
 
void ff_vvc_executor_free (AVExecutor **e)
 
void ff_vvc_frame_thread_free (VVCFrameContext *fc)
 
static void frame_thread_init_score (VVCFrameContext *fc)
 
int ff_vvc_frame_thread_init (VVCFrameContext *fc)
 
static void check_colocation (VVCContext *s, VVCTask *t)
 
static void submit_entry_point (VVCContext *s, VVCFrameThread *ft, SliceContext *sc, EntryPoint *ep)
 
void ff_vvc_frame_submit (VVCContext *s, VVCFrameContext *fc)
 
int ff_vvc_frame_wait (VVCContext *s, VVCFrameContext *fc)
 

Variables

const static char * task_name []
 

Macro Definition Documentation

◆ ADD

#define ADD (   dx,
  dy,
  stage 
)    frame_thread_add_score(s, ft, t->rx + (dx), t->ry + (dy), stage)

◆ CHECK

#define CHECK (   a,
  b 
)
Value:
do { \
if ((a) != (b)) \
return (a) < (b); \
} while (0)

Definition at line 366 of file vvc_thread.c.

◆ VVC_THREAD_DEBUG

#define VVC_THREAD_DEBUG

Definition at line 568 of file vvc_thread.c.

Typedef Documentation

◆ run_func

typedef int(* run_func) (VVCContext *s, VVCLocalContext *lc, VVCTask *t)

Definition at line 582 of file vvc_thread.c.

Enumeration Type Documentation

◆ VVCTaskStage

Enumerator
VVC_TASK_STAGE_PARSE 
VVC_TASK_STAGE_INTER 
VVC_TASK_STAGE_RECON 
VVC_TASK_STAGE_LMCS 
VVC_TASK_STAGE_DEBLOCK_V 
VVC_TASK_STAGE_DEBLOCK_H 
VVC_TASK_STAGE_SAO 
VVC_TASK_STAGE_ALF 
VVC_TASK_STAGE_LAST 

Definition at line 41 of file vvc_thread.c.

Function Documentation

◆ add_task()

static void add_task ( VVCContext s,
VVCTask t 
)
static

Definition at line 104 of file vvc_thread.c.

Referenced by frame_thread_add_score().

◆ task_init()

static void task_init ( VVCTask t,
VVCTaskStage  stage,
VVCFrameContext fc,
const int  rx,
const int  ry 
)
static

Definition at line 113 of file vvc_thread.c.

Referenced by ff_vvc_frame_thread_init(), and frame_thread_init_score().

◆ task_init_parse()

static void task_init_parse ( VVCTask t,
SliceContext sc,
EntryPoint ep,
const int  ctu_idx 
)
static

Definition at line 126 of file vvc_thread.c.

Referenced by ff_vvc_frame_submit().

◆ task_add_score()

static uint8_t task_add_score ( VVCTask t,
const VVCTaskStage  stage 
)
static

Definition at line 133 of file vvc_thread.c.

Referenced by frame_thread_add_score().

◆ task_get_score()

static uint8_t task_get_score ( VVCTask t,
const VVCTaskStage  stage 
)
static

Definition at line 138 of file vvc_thread.c.

Referenced by task_is_stage_ready().

◆ is_first_row()

static int is_first_row ( const VVCFrameContext fc,
const int  rx,
const int  ry 
)
static

Definition at line 144 of file vvc_thread.c.

Referenced by decode_cell_data(), schedule_next_parse(), and task_has_target_score().

◆ task_has_target_score()

static int task_has_target_score ( VVCTask t,
const VVCTaskStage  stage,
const uint8_t  score 
)
static

Definition at line 156 of file vvc_thread.c.

Referenced by frame_thread_add_score(), and task_is_stage_ready().

◆ frame_thread_add_score()

static void frame_thread_add_score ( VVCContext s,
VVCFrameThread ft,
const int  rx,
const int  ry,
const VVCTaskStage  stage 
)
static

◆ sheduled_done()

static void sheduled_done ( VVCFrameThread ft,
atomic_int scheduled 
)
static

Definition at line 203 of file vvc_thread.c.

Referenced by progress_done(), and task_run().

◆ progress_done()

static void progress_done ( VVCProgressListener _l,
const int  type 
)
static

Definition at line 212 of file vvc_thread.c.

Referenced by mv_done(), and pixel_done().

◆ pixel_done()

static void pixel_done ( VVCProgressListener l)
static

Definition at line 222 of file vvc_thread.c.

Referenced by listener_init().

◆ mv_done()

static void mv_done ( VVCProgressListener l)
static

Definition at line 227 of file vvc_thread.c.

Referenced by filter_mb_dir(), and listener_init().

◆ listener_init()

static void listener_init ( ProgressListener l,
VVCTask t,
VVCContext s,
const VVCProgress  vp,
const int  y 
)
static

Definition at line 232 of file vvc_thread.c.

Referenced by add_progress_listener().

◆ add_progress_listener()

static void add_progress_listener ( VVCFrame ref,
ProgressListener l,
VVCTask t,
VVCContext s,
const VVCProgress  vp,
const int  y 
)
static

Definition at line 245 of file vvc_thread.c.

Referenced by check_colocation(), and schedule_inter().

◆ schedule_next_parse()

static void schedule_next_parse ( VVCContext s,
VVCFrameContext fc,
const SliceContext sc,
const VVCTask t 
)
static

Definition at line 255 of file vvc_thread.c.

Referenced by parse_task_done().

◆ schedule_inter()

static void schedule_inter ( VVCContext s,
VVCFrameContext fc,
const SliceContext sc,
VVCTask t,
const int  rs 
)
static

Definition at line 281 of file vvc_thread.c.

Referenced by parse_task_done().

◆ parse_task_done()

static void parse_task_done ( VVCContext s,
VVCFrameContext fc,
const int  rx,
const int  ry 
)
static

Definition at line 298 of file vvc_thread.c.

Referenced by task_stage_done().

◆ task_stage_done()

static void task_stage_done ( const VVCTask t,
VVCContext s 
)
static

Definition at line 310 of file vvc_thread.c.

Referenced by frame_thread_init_score(), and task_run_stage().

◆ task_is_stage_ready()

static int task_is_stage_ready ( VVCTask t,
int  add 
)
static

Definition at line 349 of file vvc_thread.c.

Referenced by task_ready(), and task_run().

◆ task_ready()

static int task_ready ( const AVTask _t,
void *  user_data 
)
static

Definition at line 359 of file vvc_thread.c.

Referenced by ff_vvc_executor_alloc().

◆ task_priority_higher()

static int task_priority_higher ( const AVTask _a,
const AVTask _b 
)
static

Definition at line 372 of file vvc_thread.c.

Referenced by ff_vvc_executor_alloc().

◆ report_frame_progress()

static void report_frame_progress ( VVCFrameContext fc,
const int  ry,
const VVCProgress  idx 
)
static

Definition at line 390 of file vvc_thread.c.

Referenced by run_alf(), run_inter(), and run_parse().

◆ run_parse()

static int run_parse ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 412 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_inter()

static int run_inter ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 432 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_recon()

static int run_recon ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 451 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_lmcs()

static int run_lmcs ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 465 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_deblock_v()

static int run_deblock_v ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 483 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_deblock_h()

static int run_deblock_h ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 504 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_sao()

static int run_sao ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 527 of file vvc_thread.c.

Referenced by task_run_stage().

◆ run_alf()

static int run_alf ( VVCContext s,
VVCLocalContext lc,
VVCTask t 
)
static

Definition at line 547 of file vvc_thread.c.

Referenced by task_run_stage().

◆ task_run_stage()

static void task_run_stage ( VVCTask t,
VVCContext s,
VVCLocalContext lc 
)
static

Definition at line 584 of file vvc_thread.c.

Referenced by task_run().

◆ task_run()

static int task_run ( AVTask _t,
void *  local_context,
void *  user_data 
)
static

Definition at line 623 of file vvc_thread.c.

Referenced by ff_vvc_executor_alloc().

◆ ff_vvc_executor_alloc()

AVExecutor* ff_vvc_executor_alloc ( VVCContext s,
const int  thread_count 
)

Definition at line 645 of file vvc_thread.c.

Referenced by vvc_decode_init().

◆ ff_vvc_executor_free()

void ff_vvc_executor_free ( AVExecutor **  e)

Definition at line 657 of file vvc_thread.c.

Referenced by vvc_decode_free().

◆ ff_vvc_frame_thread_free()

void ff_vvc_frame_thread_free ( VVCFrameContext fc)

Definition at line 662 of file vvc_thread.c.

Referenced by ff_vvc_frame_thread_init(), and frame_context_free().

◆ frame_thread_init_score()

static void frame_thread_init_score ( VVCFrameContext fc)
static

Definition at line 676 of file vvc_thread.c.

Referenced by ff_vvc_frame_thread_init().

◆ ff_vvc_frame_thread_init()

int ff_vvc_frame_thread_init ( VVCFrameContext fc)

Definition at line 702 of file vvc_thread.c.

Referenced by frame_start().

◆ check_colocation()

static void check_colocation ( VVCContext s,
VVCTask t 
)
static

Definition at line 767 of file vvc_thread.c.

Referenced by ff_vvc_frame_submit().

◆ submit_entry_point()

static void submit_entry_point ( VVCContext s,
VVCFrameThread ft,
SliceContext sc,
EntryPoint ep 
)
static

Definition at line 784 of file vvc_thread.c.

Referenced by ff_vvc_frame_submit().

◆ ff_vvc_frame_submit()

void ff_vvc_frame_submit ( VVCContext s,
VVCFrameContext fc 
)

Definition at line 792 of file vvc_thread.c.

Referenced by submit_frame().

◆ ff_vvc_frame_wait()

int ff_vvc_frame_wait ( VVCContext s,
VVCFrameContext fc 
)

Definition at line 812 of file vvc_thread.c.

Referenced by wait_delayed_frame().

Variable Documentation

◆ task_name

const static char* task_name[]
static
Initial value:
= {
"P",
"I",
"R",
"L",
"V",
"H",
"S",
"A"
}

Definition at line 570 of file vvc_thread.c.

Referenced by task_run_stage().

b
#define b
Definition: input.c:41
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41