Go to the source code of this file.
|
#define | DECL_ENTRY(TYPE, NAME, ...) |
| Copyright (C) 2025 Niklas Haas. More...
|
|
#define | DECL_ASM(TYPE, NAME, ...) |
|
#define | DECL_PATTERN(TYPE, NAME, X, Y, Z, W, ...) |
|
#define | REF_PATTERN(NAME, X, Y, Z, W) &op_p##X##Y##Z##W##_##NAME |
|
#define | DECL_COMMON_PATTERNS(TYPE, NAME, ...) |
|
#define | REF_COMMON_PATTERNS(NAME) |
|
#define | DECL_RW(EXT, TYPE, NAME, OP, ELEMS, PACKED, FRAC) |
|
#define | DECL_PACKED_RW(EXT, DEPTH) |
|
#define | DECL_PACK_UNPACK(EXT, TYPE, X, Y, Z, W) |
|
#define | DECL_SWAP_BYTES(EXT, TYPE, X, Y, Z, W) |
|
#define | DECL_CLEAR_ALPHA(EXT, IDX) |
|
#define | DECL_CLEAR_ZERO(EXT, IDX) |
|
#define | DECL_CLEAR(EXT, X, Y, Z, W) |
|
#define | DECL_SWIZZLE(EXT, X, Y, Z, W) |
|
#define | DECL_CONVERT(EXT, FROM, TO) |
|
#define | DECL_EXPAND(EXT, FROM, TO) |
|
#define | DECL_SHIFT16(EXT) |
|
#define | DECL_MIN_MAX(EXT) |
|
#define | DECL_SCALE(EXT) |
|
#define | DECL_DITHER(EXT, SIZE) |
|
#define | DECL_LINEAR(EXT, NAME, MASK) |
|
#define | DECL_FUNCS_8(SIZE, EXT, FLAG) |
|
#define | DECL_FUNCS_16(SIZE, EXT, FLAG) |
|
#define | DECL_FUNCS_32(SIZE, EXT, FLAG) |
|
#define | ASSIGN_SHUFFLE_FUNC(IN, OUT, EXT) |
|
#define | ASSIGN_PROCESS_FUNC(NAME) |
|
|
static int | setup_swap_bytes (const SwsOp *op, SwsOpPriv *out) |
|
static int | setup_clear (const SwsOp *op, SwsOpPriv *out) |
|
static int | setup_shift (const SwsOp *op, SwsOpPriv *out) |
|
static int | setup_dither (const SwsOp *op, SwsOpPriv *out) |
|
static int | setup_linear (const SwsOp *op, SwsOpPriv *out) |
|
static av_const int | get_mmsize (const int cpu_flags) |
|
static bool | op_is_type_invariant (const SwsOp *op) |
| Returns true if the operation's implementation only depends on the block size, and not the underlying pixel type. More...
|
|
static int | solve_shuffle (const SwsOpList *ops, int mmsize, SwsCompiledOp *out) |
|
static void | normalize_clear (SwsOp *op) |
|
static int | compile (SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out) |
|
◆ DECL_ENTRY
#define DECL_ENTRY |
( |
|
TYPE, |
|
|
|
NAME, |
|
|
|
... |
|
) |
| |
Value:
Copyright (C) 2025 Niklas Haas.
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Definition at line 28 of file ops.c.
◆ DECL_ASM
#define DECL_ASM |
( |
|
TYPE, |
|
|
|
NAME, |
|
|
|
... |
|
) |
| |
Value: void ff_##NAME(void); \
__VA_ARGS__)
Definition at line 34 of file ops.c.
◆ DECL_PATTERN
#define DECL_PATTERN |
( |
|
TYPE, |
|
|
|
NAME, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W, |
|
|
|
... |
|
) |
| |
Value:
.unused = { !
X, !
Y, !Z, !
W }, \
__VA_ARGS__ \
)
Definition at line 40 of file ops.c.
◆ REF_PATTERN
#define REF_PATTERN |
( |
|
NAME, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W |
|
) |
| &op_p##X##Y##Z##W##_##NAME |
Definition at line 46 of file ops.c.
◆ DECL_COMMON_PATTERNS
#define DECL_COMMON_PATTERNS |
( |
|
TYPE, |
|
|
|
NAME, |
|
|
|
... |
|
) |
| |
Value:
DECL_PATTERN(
TYPE, NAME, 1, 0, 0, 1, __VA_ARGS__); \
DECL_PATTERN(
TYPE, NAME, 1, 1, 1, 0, __VA_ARGS__); \
DECL_PATTERN(
TYPE, NAME, 1, 1, 1, 1, __VA_ARGS__) \
Definition at line 49 of file ops.c.
◆ REF_COMMON_PATTERNS
#define REF_COMMON_PATTERNS |
( |
|
NAME | ) |
|
Value:
REF_PATTERN(NAME, 1, 0, 0, 1), \
REF_PATTERN(NAME, 1, 1, 1, 0), \
REF_PATTERN(NAME, 1, 1, 1, 1)
Definition at line 55 of file ops.c.
◆ DECL_RW
#define DECL_RW |
( |
|
EXT, |
|
|
|
TYPE, |
|
|
|
NAME, |
|
|
|
OP, |
|
|
|
ELEMS, |
|
|
|
PACKED, |
|
|
|
FRAC |
|
) |
| |
Value:
.rw = { .elems =
ELEMS, .packed = PACKED, .frac = FRAC }, \
);
Definition at line 61 of file ops.c.
◆ DECL_PACKED_RW
#define DECL_PACKED_RW |
( |
|
EXT, |
|
|
|
DEPTH |
|
) |
| |
Value:
Definition at line 67 of file ops.c.
◆ DECL_PACK_UNPACK
#define DECL_PACK_UNPACK |
( |
|
EXT, |
|
|
|
TYPE, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W |
|
) |
| |
Value:
.pack.pattern = {X, Y, Z, W}, \
.pack.pattern = {X, Y, Z, W}, \
); \
Definition at line 75 of file ops.c.
◆ DECL_SWAP_BYTES
#define DECL_SWAP_BYTES |
( |
|
EXT, |
|
|
|
TYPE, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W |
|
) |
| |
Value:
.unused = { !
X, !
Y, !Z, !
W }, \
.func = ff_p##
X##
Y##Z##
W##_shuffle##EXT, \
);
Definition at line 94 of file ops.c.
◆ DECL_CLEAR_ALPHA
#define DECL_CLEAR_ALPHA |
( |
|
EXT, |
|
|
|
IDX |
|
) |
| |
Value:
.clear_value = -1, \
.unused[IDX] = true, \
); \
Definition at line 102 of file ops.c.
◆ DECL_CLEAR_ZERO
#define DECL_CLEAR_ZERO |
( |
|
EXT, |
|
|
|
IDX |
|
) |
| |
Value:
.clear_value = 0, \
.unused[IDX] = true, \
);
Definition at line 109 of file ops.c.
◆ DECL_CLEAR
#define DECL_CLEAR |
( |
|
EXT, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W |
|
) |
| |
Value:
Definition at line 123 of file ops.c.
◆ DECL_SWIZZLE
#define DECL_SWIZZLE |
( |
|
EXT, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
Z, |
|
|
|
W |
|
) |
| |
Value:
.swizzle.in = {X, Y, Z, W}, \
);
Definition at line 130 of file ops.c.
◆ DECL_CONVERT
#define DECL_CONVERT |
( |
|
EXT, |
|
|
|
FROM, |
|
|
|
TO |
|
) |
| |
Value:
Definition at line 136 of file ops.c.
◆ DECL_EXPAND
#define DECL_EXPAND |
( |
|
EXT, |
|
|
|
FROM, |
|
|
|
TO |
|
) |
| |
Value:
.convert.expand = true, \
);
Definition at line 142 of file ops.c.
◆ DECL_SHIFT16
#define DECL_SHIFT16 |
( |
|
EXT | ) |
|
Value:
.flexible = true, \
.flexible = true, \
);
Definition at line 155 of file ops.c.
◆ DECL_MIN_MAX
#define DECL_MIN_MAX |
( |
|
EXT | ) |
|
Value:
.flexible = true, \
.flexible = true, \
);
Definition at line 168 of file ops.c.
◆ DECL_SCALE
#define DECL_SCALE |
( |
|
EXT | ) |
|
Value:
Definition at line 181 of file ops.c.
◆ DECL_DITHER
#define DECL_DITHER |
( |
|
EXT, |
|
|
|
SIZE |
|
) |
| |
Value:
Definition at line 205 of file ops.c.
◆ DECL_LINEAR
#define DECL_LINEAR |
( |
|
EXT, |
|
|
|
NAME, |
|
|
|
MASK |
|
) |
| |
Value:
Definition at line 227 of file ops.c.
◆ DECL_FUNCS_8
#define DECL_FUNCS_8 |
( |
|
SIZE, |
|
|
|
EXT, |
|
|
|
FLAG |
|
) |
| |
◆ DECL_FUNCS_16
#define DECL_FUNCS_16 |
( |
|
SIZE, |
|
|
|
EXT, |
|
|
|
FLAG |
|
) |
| |
◆ DECL_FUNCS_32
#define DECL_FUNCS_32 |
( |
|
SIZE, |
|
|
|
EXT, |
|
|
|
FLAG |
|
) |
| |
◆ ASSIGN_SHUFFLE_FUNC
#define ASSIGN_SHUFFLE_FUNC |
( |
|
IN, |
|
|
|
OUT, |
|
|
|
EXT |
|
) |
| |
Value:do { \
SWS_DECL_FUNC(ff_packed_shuffle##
IN##
_##
OUT##
_##EXT); \
if (in_total ==
IN && out_total ==
OUT) \
out->func = ff_packed_shuffle##
IN##
_##
OUT##
_##EXT; \
} while (0)
◆ ASSIGN_PROCESS_FUNC
#define ASSIGN_PROCESS_FUNC |
( |
|
NAME | ) |
|
Value: do { \
SWS_DECL_FUNC(NAME); \
void NAME##_return(void); \
out->func = NAME; \
} while (0)
◆ setup_swap_bytes()
Definition at line 86 of file ops.c.
◆ setup_clear()
◆ setup_shift()
◆ setup_dither()
◆ setup_linear()
◆ get_mmsize()
static av_const int get_mmsize |
( |
const int |
cpu_flags | ) |
|
|
static |
◆ op_is_type_invariant()
static bool op_is_type_invariant |
( |
const SwsOp * |
op | ) |
|
|
static |
Returns true if the operation's implementation only depends on the block size, and not the underlying pixel type.
Definition at line 526 of file ops.c.
Referenced by compile().
◆ solve_shuffle()
◆ normalize_clear()
static void normalize_clear |
( |
SwsOp * |
op | ) |
|
|
static |
◆ compile()
◆ backend_x86
Initial value:
Definition at line 720 of file ops.c.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
static int setup_linear(const SwsOp *op, SwsOpPriv *out)
static void convert(float y, float u, float v, float *b, float *g, float *r)
#define DECL_RW(EXT, TYPE, NAME, OP, ELEMS, PACKED, FRAC)
static int setup_dither(const SwsOp *op, SwsOpPriv *out)
int ff_sws_setup_q(const SwsOp *op, SwsOpPriv *out)
#define DECL_ENTRY(TYPE, NAME,...)
Copyright (C) 2025 Niklas Haas.
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
#define DECL_ASM(TYPE, NAME,...)
static int compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out)
static int setup_swap_bytes(const SwsOp *op, SwsOpPriv *out)
int ff_sws_setup_q4(const SwsOp *op, SwsOpPriv *out)
#define OP(gb, pixel, count)
static int setup_shift(const SwsOp *op, SwsOpPriv *out)
#define REF_PATTERN(NAME, X, Y, Z, W)
#define DECL_COMMON_PATTERNS(TYPE, NAME,...)
#define DECL_PATTERN(TYPE, NAME, X, Y, Z, W,...)
int ff_sws_op_chain_append(SwsOpChain *chain, SwsFuncPtr func, void(*free)(void *), SwsOpPriv priv)
static int setup_clear(const SwsOp *op, SwsOpPriv *out)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Copyright (C) 2025 Niklas Haas.
static uint32_t BS_FUNC() read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.
static const uint8_t dither[8][8]