FFmpeg
Data Structures | Macros | Typedefs | Functions
ops_chain.h File Reference
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "ops_internal.h"

Go to the source code of this file.

Data Structures

union  SwsOpPriv
 Private data for each kernel. More...
 
struct  SwsOpImpl
 
struct  SwsOpChain
 Compiled "chain" of operations, which can be dispatched efficiently. More...
 
struct  SwsImplParams
 
struct  SwsImplResult
 
struct  SwsUOpEntry
 
struct  SwsUOpTable
 Copyright (C) 2025 Niklas Haas. More...
 

Macros

#define SWS_MAX_OPS   16
 

Typedefs

typedef void(* SwsFuncPtr) (void)
 Per-kernel execution context. More...
 

Functions

SwsOpChainff_sws_op_chain_alloc (void)
 
void ff_sws_op_chain_free_cb (void *chain)
 
static void ff_sws_op_chain_free (SwsOpChain *chain)
 
int ff_sws_op_chain_append (SwsOpChain *chain, SwsFuncPtr func, void(*free)(SwsOpPriv *), const SwsOpPriv *priv)
 
int ff_sws_setup_scale (const SwsImplParams *params, SwsImplResult *out)
 
int ff_sws_setup_clamp (const SwsImplParams *params, SwsImplResult *out)
 
int ff_sws_setup_clear (const SwsImplParams *params, SwsImplResult *out)
 
int ff_sws_setup_scalar (const SwsImplParams *params, SwsImplResult *out)
 
int ff_sws_setup_vec4 (const SwsImplParams *params, SwsImplResult *out)
 
static void ff_op_priv_free (SwsOpPriv *priv)
 
static void ff_op_priv_unref (SwsOpPriv *priv)
 
int ff_sws_uop_lookup (SwsContext *ctx, const SwsUOpTable *const tables[], int num_tables, const SwsUOp *uop, const int block_size, SwsOpChain *chain)
 "Compile" a single uop by looking it up in a list of fixed size uop tables, in decreasing order of preference. More...
 

Macro Definition Documentation

◆ SWS_MAX_OPS

#define SWS_MAX_OPS   16

Definition at line 85 of file ops_chain.h.

Typedef Documentation

◆ SwsFuncPtr

typedef void(* SwsFuncPtr) (void)

Per-kernel execution context.

Note: This struct is hard-coded in assembly, so do not change the layout.

Definition at line 70 of file ops_chain.h.

Function Documentation

◆ ff_sws_op_chain_alloc()

SwsOpChain* ff_sws_op_chain_alloc ( void  )

Definition at line 29 of file ops_chain.c.

Referenced by aarch64_compile(), and compile().

◆ ff_sws_op_chain_free_cb()

void ff_sws_op_chain_free_cb ( void *  chain)

Definition at line 34 of file ops_chain.c.

Referenced by aarch64_compile(), compile(), and ff_sws_op_chain_free().

◆ ff_sws_op_chain_free()

static void ff_sws_op_chain_free ( SwsOpChain chain)
inlinestatic

Definition at line 96 of file ops_chain.h.

Referenced by aarch64_compile(), and compile().

◆ ff_sws_op_chain_append()

int ff_sws_op_chain_append ( SwsOpChain chain,
SwsFuncPtr  func,
void(*)(SwsOpPriv *)  free,
const SwsOpPriv priv 
)

Definition at line 48 of file ops_chain.c.

Referenced by aarch64_compile(), and ff_sws_uop_lookup().

◆ ff_sws_setup_scale()

int ff_sws_setup_scale ( const SwsImplParams params,
SwsImplResult out 
)

Definition at line 65 of file ops_chain.c.

Referenced by aarch64_setup().

◆ ff_sws_setup_clamp()

int ff_sws_setup_clamp ( const SwsImplParams params,
SwsImplResult out 
)

Definition at line 80 of file ops_chain.c.

Referenced by aarch64_setup().

◆ ff_sws_setup_clear()

int ff_sws_setup_clear ( const SwsImplParams params,
SwsImplResult out 
)

Definition at line 97 of file ops_chain.c.

Referenced by aarch64_setup().

◆ ff_sws_setup_scalar()

int ff_sws_setup_scalar ( const SwsImplParams params,
SwsImplResult out 
)

Definition at line 185 of file ops_chain.c.

◆ ff_sws_setup_vec4()

int ff_sws_setup_vec4 ( const SwsImplParams params,
SwsImplResult out 
)

Definition at line 200 of file ops_chain.c.

◆ ff_op_priv_free()

static void ff_op_priv_free ( SwsOpPriv priv)
inlinestatic

◆ ff_op_priv_unref()

static void ff_op_priv_unref ( SwsOpPriv priv)
inlinestatic

Definition at line 149 of file ops_chain.h.

Referenced by DECL_SETUP(), and setup_dither().

◆ ff_sws_uop_lookup()

int ff_sws_uop_lookup ( SwsContext ctx,
const SwsUOpTable *const  tables[],
int  num_tables,
const SwsUOp uop,
const int  block_size,
SwsOpChain chain 
)

"Compile" a single uop by looking it up in a list of fixed size uop tables, in decreasing order of preference.

Returns 0 or a negative error code.

Definition at line 116 of file ops_chain.c.

Referenced by compile().