You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
swscale/uops: rename SwsOpTable/SwsOpEntry to SwsUOpTable/SwsUOpEntry
These structs are only used through ff_sws_uop_lookup() and are not part of the SwsOp dispatch path, so rename them to reflect their actual scope.
This commit is contained in:
@@ -113,12 +113,12 @@ int ff_sws_setup_clear(const SwsImplParams *params, SwsImplResult *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_sws_uop_lookup(SwsContext *ctx, const SwsOpTable *const tables[],
|
||||
int ff_sws_uop_lookup(SwsContext *ctx, const SwsUOpTable *const tables[],
|
||||
int num_tables, const SwsUOp *uop, const int block_size,
|
||||
SwsOpChain *chain)
|
||||
{
|
||||
const unsigned cpu_flags = av_get_cpu_flags();
|
||||
const SwsOpEntry *match = NULL;
|
||||
const SwsUOpEntry *match = NULL;
|
||||
int ret;
|
||||
|
||||
SwsImplParams params = {
|
||||
@@ -127,13 +127,13 @@ int ff_sws_uop_lookup(SwsContext *ctx, const SwsOpTable *const tables[],
|
||||
};
|
||||
|
||||
for (int n = 0; !match && n < num_tables; n++) {
|
||||
const SwsOpTable *table = params.table = tables[n];
|
||||
const SwsUOpTable *table = params.table = tables[n];
|
||||
if (table->block_size && table->block_size != block_size ||
|
||||
table->cpu_flags & ~cpu_flags)
|
||||
continue;
|
||||
|
||||
for (int i = 0; table->entries[i]; i++) {
|
||||
const SwsOpEntry *entry = table->entries[i];
|
||||
const SwsUOpEntry *entry = table->entries[i];
|
||||
const SwsUOp entry_uop = {
|
||||
.uop = entry->uop,
|
||||
.type = entry->type,
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
* that is an implementation detail of the specific backend.
|
||||
*/
|
||||
|
||||
typedef struct SwsOpTable SwsOpTable;
|
||||
typedef struct SwsUOpTable SwsUOpTable;
|
||||
|
||||
/**
|
||||
* Private data for each kernel.
|
||||
@@ -103,7 +103,7 @@ int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func,
|
||||
void (*free)(SwsOpPriv *), const SwsOpPriv *priv);
|
||||
|
||||
typedef struct SwsImplParams {
|
||||
const SwsOpTable *table;
|
||||
const SwsUOpTable *table;
|
||||
union {
|
||||
const SwsUOp *uop;
|
||||
const SwsOp *op;
|
||||
@@ -112,14 +112,14 @@ typedef struct SwsImplParams {
|
||||
} SwsImplParams;
|
||||
|
||||
typedef struct SwsImplResult {
|
||||
SwsFuncPtr func; /* overrides `SwsOpEntry.func` if non-NULL */
|
||||
SwsFuncPtr func; /* overrides `SwsUOpEntry.func` if non-NULL */
|
||||
SwsOpPriv priv; /* private data for this implementation instance */
|
||||
void (*free)(SwsOpPriv *priv); /* free function for `priv` */
|
||||
int over_read[4]; /* implementation over-reads input by this many bytes */
|
||||
int over_write[4]; /* implementation over-writes output by this many bytes */
|
||||
} SwsImplResult;
|
||||
|
||||
typedef struct SwsOpEntry {
|
||||
typedef struct SwsUOpEntry {
|
||||
/* Kernel metadata; reduced size subset of SwsUOp (sans data) */
|
||||
SwsUOpType uop;
|
||||
SwsPixelType type;
|
||||
@@ -130,7 +130,7 @@ typedef struct SwsOpEntry {
|
||||
SwsFuncPtr func;
|
||||
int (*setup)(const SwsImplParams *params, SwsImplResult *out); /* optional */
|
||||
bool (*check)(const SwsImplParams *params); /* optional, return true if supported */
|
||||
} SwsOpEntry;
|
||||
} SwsUOpEntry;
|
||||
|
||||
/* Setup helpers for common/trivial operation types */
|
||||
int ff_sws_setup_scale(const SwsImplParams *params, SwsImplResult *out);
|
||||
@@ -151,10 +151,10 @@ static inline void ff_op_priv_unref(SwsOpPriv *priv)
|
||||
av_refstruct_unref(&priv->ptr);
|
||||
}
|
||||
|
||||
struct SwsOpTable {
|
||||
struct SwsUOpTable {
|
||||
unsigned cpu_flags; /* required CPU flags for this table */
|
||||
int block_size; /* fixed block size of this table */
|
||||
const SwsOpEntry *entries[]; /* terminated by NULL */
|
||||
const SwsUOpEntry *entries[]; /* terminated by NULL */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -163,7 +163,7 @@ struct SwsOpTable {
|
||||
*
|
||||
* Returns 0 or a negative error code.
|
||||
*/
|
||||
int ff_sws_uop_lookup(SwsContext *ctx, const SwsOpTable *const tables[],
|
||||
int ff_sws_uop_lookup(SwsContext *ctx, const SwsUOpTable *const tables[],
|
||||
int num_tables, const SwsUOp *uop, const int block_size,
|
||||
SwsOpChain *chain);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
SWS_FOR(TYPE, DITHER, REF_ENTRY) \
|
||||
/* end of macro */
|
||||
|
||||
static const SwsOpTable op_table = {
|
||||
static const SwsUOpTable uop_table = {
|
||||
.block_size = SWS_BLOCK_SIZE,
|
||||
.entries = {
|
||||
REF_ALL_UOPS(U8)
|
||||
@@ -154,7 +154,7 @@ static int compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
|
||||
|
||||
av_assert0(uops->num_ops > 0);
|
||||
for (int i = 0; i < uops->num_ops; i++) {
|
||||
const SwsOpTable *table = &op_table;
|
||||
const SwsUOpTable *table = &uop_table;
|
||||
ret = ff_sws_uop_lookup(ctx, &table, 1, &uops->ops[i],
|
||||
SWS_BLOCK_SIZE, chain);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -135,9 +135,9 @@ typedef struct SwsOpIter {
|
||||
(pixel_t *) iter->out[0], (pixel_t *) iter->out[1], \
|
||||
(pixel_t *) iter->out[2], (pixel_t *) iter->out[3])
|
||||
|
||||
#define REF_ENTRY(DUMMY, NAME, ...) &op_##NAME,
|
||||
#define REF_ENTRY(DUMMY, NAME, ...) &uop_##NAME,
|
||||
#define DECL_ENTRY(SETUP, NAME, ...) \
|
||||
static const SwsOpEntry op_##NAME = { \
|
||||
static const SwsUOpEntry uop_##NAME = { \
|
||||
.func = (SwsFuncPtr) NAME##_c, \
|
||||
__VA_ARGS__, \
|
||||
SETUP \
|
||||
|
||||
+15
-15
@@ -297,10 +297,10 @@ static bool uop_is_type_invariant(const SwsUOpType uop)
|
||||
}
|
||||
}
|
||||
|
||||
#define REF_ENTRY(EXT, NAME, ...) &op_##NAME##EXT,
|
||||
#define REF_ENTRY(EXT, NAME, ...) &uop_##NAME##EXT,
|
||||
#define DECL_ENTRY(EXT, CHECK, SETUP, NAME, ...) \
|
||||
void ff_##NAME##EXT(void); \
|
||||
static const SwsOpEntry op_##NAME##EXT = { \
|
||||
static const SwsUOpEntry uop_##NAME##EXT = { \
|
||||
.func = (SwsFuncPtr) ff_##NAME##EXT, \
|
||||
.check = CHECK, \
|
||||
.setup = SETUP, \
|
||||
@@ -358,7 +358,7 @@ SWS_FOR_STRUCT(U8, READ_PLANAR, DECL_ENTRY, EXT, NULL, NULL)
|
||||
SWS_FOR_STRUCT(U8, WRITE_PLANAR, DECL_ENTRY, EXT, NULL, NULL) \
|
||||
SWS_FOR_STRUCT(U8, CLEAR, DECL_ENTRY, EXT, NULL, setup_clear) \
|
||||
\
|
||||
static const SwsOpTable ops_u8##EXT = { \
|
||||
static const SwsUOpTable uops_u8##EXT = { \
|
||||
.cpu_flags = AV_CPU_FLAG_##FLAG, \
|
||||
.block_size = SIZE, \
|
||||
.entries = { \
|
||||
@@ -376,7 +376,7 @@ SWS_FOR_STRUCT(U8, TO_U16, DECL_ENTRY, EXT, NULL, NULL)
|
||||
SWS_FOR_STRUCT(U16, TO_U8, DECL_ENTRY, EXT, NULL, NULL) \
|
||||
SWS_FOR_STRUCT(U8, EXPAND_PAIR, DECL_ENTRY, EXT, NULL, NULL) \
|
||||
\
|
||||
static const SwsOpTable ops_u16##EXT = { \
|
||||
static const SwsUOpTable uops_u16##EXT = { \
|
||||
.cpu_flags = AV_CPU_FLAG_##FLAG, \
|
||||
.block_size = SIZE, \
|
||||
.entries = { \
|
||||
@@ -396,7 +396,7 @@ SWS_FOR_STRUCT(U16, TO_U32, DECL_ENTRY, EXT, NULL, NULL)
|
||||
SWS_FOR_STRUCT(U32, TO_U16, DECL_ENTRY, EXT, NULL, NULL) \
|
||||
SWS_FOR_STRUCT(U8, EXPAND_QUAD, DECL_ENTRY, EXT, NULL, NULL) \
|
||||
\
|
||||
static const SwsOpTable ops_u32##EXT = { \
|
||||
static const SwsUOpTable uops_u32##EXT = { \
|
||||
.cpu_flags = AV_CPU_FLAG_##FLAG, \
|
||||
.block_size = SIZE, \
|
||||
.entries = { \
|
||||
@@ -432,7 +432,7 @@ SWS_FOR_STRUCT(U8, READ_PLANAR_FV_FMA, DECL_ENTRY, EXT, NULL, setup_filter_v)
|
||||
SWS_FOR_STRUCT(U16, READ_PLANAR_FV_FMA, DECL_ENTRY, EXT, NULL, setup_filter_v) \
|
||||
SWS_FOR_STRUCT(F32, READ_PLANAR_FV_FMA, DECL_ENTRY, EXT, NULL, setup_filter_v) \
|
||||
\
|
||||
static const SwsOpTable ops_f32##EXT = { \
|
||||
static const SwsUOpTable uops_f32##EXT = { \
|
||||
.cpu_flags = AV_CPU_FLAG_##FLAG, \
|
||||
.block_size = SIZE, \
|
||||
.entries = { \
|
||||
@@ -466,15 +466,15 @@ DECL_TABLE_U16(_m2_avx2, 32, AVX2)
|
||||
DECL_TABLE_U32(_m2_avx2, 16, AVX2)
|
||||
DECL_TABLE_F32(_m2_avx2, 16, AVX2)
|
||||
|
||||
static const SwsOpTable *const tables[] = {
|
||||
&ops_u8_m1_sse4,
|
||||
&ops_u8_m1_avx2, /* order before _m2_sse4 */
|
||||
&ops_u8_m2_sse4,
|
||||
&ops_u8_m2_avx2,
|
||||
&ops_u16_m1_avx2,
|
||||
&ops_u16_m2_avx2,
|
||||
&ops_u32_m2_avx2,
|
||||
&ops_f32_m2_avx2,
|
||||
static const SwsUOpTable *const tables[] = {
|
||||
&uops_u8_m1_sse4,
|
||||
&uops_u8_m1_avx2, /* order before _m2_sse4 */
|
||||
&uops_u8_m2_sse4,
|
||||
&uops_u8_m2_avx2,
|
||||
&uops_u16_m1_avx2,
|
||||
&uops_u16_m2_avx2,
|
||||
&uops_u32_m2_avx2,
|
||||
&uops_f32_m2_avx2,
|
||||
};
|
||||
|
||||
SWS_DECL_FUNC(ff_sws_process1_x86);
|
||||
|
||||
Reference in New Issue
Block a user