Go to the documentation of this file.
24 # error Should only be included from ops_tmpl_*.c!
27 #define WRAP_CONVERT_UINT(N) \
28 DECL_PATTERN(convert_uint##N) \
30 u##N##block_t xu, yu, zu, wu; \
33 for (int i = 0; i < SWS_BLOCK_SIZE; i++) { \
44 CONTINUE(u##N##block_t, xu, yu, zu, wu); \
47 WRAP_COMMON_PATTERNS(convert_uint##N, \
48 .op = SWS_OP_CONVERT, \
49 .convert.to = SWS_PIXEL_U##N, \
60 #if BIT_DEPTH != 32 || defined(IS_FLOAT)
69 x[
i] = impl->priv.px[0];
71 y[
i] = impl->priv.px[1];
73 z[
i] = impl->priv.px[2];
75 w[
i] = impl->priv.px[3];
81 #define WRAP_CLEAR(X, Y, Z, W) \
82 DECL_IMPL(clear##_##X##Y##Z##W) \
84 CALL(clear, X, Y, Z, W); \
87 DECL_ENTRY(clear##_##X##Y##Z##W, \
88 .setup = ff_sws_setup_q4, \
91 .unused = { !X, !Y, !Z, !W }, \
113 x[
i] =
FFMIN(x[
i], impl->priv.px[0]);
115 y[
i] =
FFMIN(y[
i], impl->priv.px[1]);
117 z[
i] =
FFMIN(z[
i], impl->priv.px[2]);
130 x[
i] =
FFMAX(x[
i], impl->priv.px[0]);
132 y[
i] =
FFMAX(y[
i], impl->priv.px[1]);
134 z[
i] =
FFMAX(z[
i], impl->priv.px[2]);
180 const int bx_start,
const int y_start,
181 int bx_end,
int y_end)
190 for (iter->
y = y_start; iter->
y < y_end; iter->
y++) {
191 for (
int i = 0;
i < 4;
i++) {
192 iter->
in[
i] = exec->in[
i] + (iter->
y - y_start) * exec->in_stride[
i];
193 iter->
out[
i] = exec->out[
i] + (iter->
y - y_start) * exec->out_stride[
i];
#define WRAP_CLEAR(X, Y, Z, W)
Copyright (C) 2025 Niklas Haas.
#define WRAP_CONVERT_UINT(N)
Copyright (C) 2025 Niklas Haas.
WRAP_COMMON_PATTERNS(min,.op=SWS_OP_MIN,.setup=ff_sws_setup_q4,.flexible=true,)
int ff_sws_setup_q(const SwsOp *op, SwsOpPriv *out)
#define CONTINUE(TYPE,...)
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.
uint32_t u32block_t[SWS_BLOCK_SIZE]
SwsOpImpl impl[SWS_MAX_OPS+1]
#define SWS_BLOCK_SIZE
Copyright (C) 2025 Niklas Haas.
Copyright (C) 2026 Niklas Haas.
Compiled "chain" of operations, which can be dispatched efficiently.
#define i(width, name, range_min, range_max)
static void fn() process(const SwsOpExec *exec, const void *priv, const int bx_start, const int y_start, int bx_end, int y_end)
int ff_sws_setup_q4(const SwsOp *op, SwsOpPriv *out)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
The exact code depends on how similar the blocks are and how related they are to the block