FFmpeg
Loading...
Searching...
No Matches
uops_tmpl.h File Reference
#include <assert.h>
#include <float.h>
#include <stdint.h>
#include "libavutil/attributes.h"
#include "ops_chain.h"
#include "uops_macros.h"

Go to the source code of this file.

Data Structures

union  block_t
 
struct  SwsOpIter
 Internal context holding per-iter execution data. More...
 

Macros

#define SWS_BLOCK_SIZE   32
 Copyright (C) 2026 Niklas Haas.
 
#define SIZEOF_BLOCK   (sizeof(pixel_t) * SWS_BLOCK_SIZE)
 
#define SWS_LOOP   AV_PRAGMA(GCC ivdep)
 
#define bitfn2(name, ext)
 
#define bitfn(name, ext)
 
#define fn(name)
 
#define bump_ptr(ptr, bump)
 
#define X   SWS_COMP_TEST(mask, 0)
 
#define Y   SWS_COMP_TEST(mask, 1)
 
#define Z   SWS_COMP_TEST(mask, 2)
 
#define W   SWS_COMP_TEST(mask, 3)
 
#define DECL_FUNC(NAME, ...)
 
#define DECL_READ(NAME, ...)
 
#define DECL_WRITE(NAME, ...)
 
#define CALL(NAME, ...)
 
#define CONTINUE(...)
 
#define DECL_SETUP(NAME, PARAMS, OUT)
 
#define DECL_IMPL(FUNC, NAME, TYPE, UOP, ...)
 
#define DECL_IMPL_READ(...)
 
#define DECL_IMPL_WRITE(...)
 
#define REF_ENTRY(DUMMY, NAME, ...)
 
#define DECL_ENTRY(SETUP, NAME, ...)
 

Macro Definition Documentation

◆ SWS_BLOCK_SIZE

#define SWS_BLOCK_SIZE   32

Copyright (C) 2026 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 Helper macros for the C-based backend.

To use these macros, pixel_t should be defined as the type of pixels.

Definition at line 40 of file uops_tmpl.h.

Referenced by compile_uops_c(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_READ(), DECL_READ(), DECL_READ(), DECL_READ(), DECL_SETUP(), DECL_WRITE(), DECL_WRITE(), and process().

◆ SIZEOF_BLOCK

#define SIZEOF_BLOCK   (sizeof(pixel_t) * SWS_BLOCK_SIZE)

Definition at line 50 of file uops_tmpl.h.

Referenced by DECL_READ(), DECL_READ(), DECL_READ(), DECL_WRITE(), and DECL_WRITE().

◆ SWS_LOOP

◆ bitfn2

#define bitfn2 ( name,
ext )
Value:
name ## _ ## ext
#define _
const char * name
Definition qsvenc.c:142

Definition at line 74 of file uops_tmpl.h.

◆ bitfn

#define bitfn ( name,
ext )
Value:
bitfn2(name, ext)
#define bitfn2(name, ext)
Definition uops_tmpl.h:74

Definition at line 75 of file uops_tmpl.h.

◆ fn

#define fn ( name)
Value:
bitfn(name, PX)
#define bitfn(name, ext)
Definition uops_tmpl.h:75

Definition at line 76 of file uops_tmpl.h.

◆ bump_ptr

#define bump_ptr ( ptr,
bump )
Value:
((pixel_t *) ((uintptr_t) (ptr) + (bump)))

Definition at line 78 of file uops_tmpl.h.

Referenced by DECL_READ(), and DECL_READ().

◆ X

#define X   SWS_COMP_TEST(mask, 0)

Definition at line 81 of file uops_tmpl.h.

◆ Y

#define Y   SWS_COMP_TEST(mask, 1)

Definition at line 82 of file uops_tmpl.h.

◆ Z

◆ W

#define W   SWS_COMP_TEST(mask, 3)

Definition at line 84 of file uops_tmpl.h.

◆ DECL_FUNC

#define DECL_FUNC ( NAME,
... )
Value:
av_always_inline static void \
fn(NAME)(SwsOpIter *restrict iter, const SwsOpImpl *restrict impl, \
pixel_t *restrict x, pixel_t *restrict y, \
pixel_t *restrict z, pixel_t *restrict w, \
__VA_ARGS__)
#define av_always_inline
Definition attributes.h:72
uint8_t w
Definition llvidencdsp.c:39
Internal context holding per-iter execution data.
Definition uops_tmpl.h:56

Definition at line 87 of file uops_tmpl.h.

Referenced by DECL_FUNC(), and DECL_FUNC().

◆ DECL_READ

#define DECL_READ ( NAME,
... )
Value:
DECL_FUNC(NAME, __VA_ARGS__, \
const pixel_t *restrict in0, const pixel_t *restrict in1, \
const pixel_t *restrict in2, const pixel_t *restrict in3) \
#define DECL_FUNC(NAME,...)
Definition uops_tmpl.h:87

Definition at line 94 of file uops_tmpl.h.

◆ DECL_WRITE

#define DECL_WRITE ( NAME,
... )
Value:
DECL_FUNC(NAME, __VA_ARGS__, \
pixel_t *restrict out0, pixel_t *restrict out1, \
pixel_t *restrict out2, pixel_t *restrict out3) \

Definition at line 99 of file uops_tmpl.h.

◆ CALL

#define CALL ( NAME,
... )
Value:
fn(NAME)(iter, impl, x, y, z, w, __VA_ARGS__)
#define fn(a)

Definition at line 104 of file uops_tmpl.h.

◆ CONTINUE

#define CONTINUE ( ...)
Value:
((void (*)(SwsOpIter *, const SwsOpImpl *, \
void *restrict x, void *restrict y, \
void *restrict z, void *restrict w)) impl->cont) \
(iter, &impl[1], __VA_ARGS__)

Definition at line 107 of file uops_tmpl.h.

Referenced by DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_FUNC(), DECL_READ(), DECL_READ(), DECL_READ(), DECL_READ(), and process().

◆ DECL_SETUP

#define DECL_SETUP ( NAME,
PARAMS,
OUT )
Value:
av_unused static int fn(NAME)(const SwsImplParams *PARAMS, \
#define OUT(n)
#define av_unused
Definition attributes.h:164
#define PARAMS(...)
Definition vf_drawvg.c:259

Definition at line 114 of file uops_tmpl.h.

Referenced by DECL_SETUP(), DECL_SETUP(), and DECL_SETUP().

◆ DECL_IMPL

#define DECL_IMPL ( FUNC,
NAME,
TYPE,
UOP,
... )
Value:
av_flatten static void NAME##_c(SwsOpIter *restrict iter, \
const SwsOpImpl *restrict impl, \
void *restrict x, void *restrict y, \
void *restrict z, void *restrict w) \
{ \
CALL(FUNC, __VA_ARGS__); \
}
#define FUNC(a)
#define av_flatten
Definition attributes.h:123

Definition at line 119 of file uops_tmpl.h.

◆ DECL_IMPL_READ

#define DECL_IMPL_READ ( ...)
Value:
DECL_IMPL(__VA_ARGS__, \
(const pixel_t *) iter->in[0], (const pixel_t *) iter->in[1], \
(const pixel_t *) iter->in[2], (const pixel_t *) iter->in[3])
#define DECL_IMPL(FUNC, NAME, TYPE, UOP,...)
Definition uops_tmpl.h:119

Definition at line 128 of file uops_tmpl.h.

◆ DECL_IMPL_WRITE

#define DECL_IMPL_WRITE ( ...)
Value:
DECL_IMPL(__VA_ARGS__, \
(pixel_t *) iter->out[0], (pixel_t *) iter->out[1], \
(pixel_t *) iter->out[2], (pixel_t *) iter->out[3])

Definition at line 133 of file uops_tmpl.h.

◆ REF_ENTRY

#define REF_ENTRY ( DUMMY,
NAME,
... )
Value:
&uop_##NAME,

Definition at line 138 of file uops_tmpl.h.

◆ DECL_ENTRY

#define DECL_ENTRY ( SETUP,
NAME,
... )
Value:
static const SwsUOpEntry uop_##NAME = { \
.func = (SwsFuncPtr) NAME##_c, \
__VA_ARGS__, \
};
void(* SwsFuncPtr)(void)
Per-kernel execution context.
Definition ops_chain.h:70
@ SETUP
Definition rtspcodes.h:133

Definition at line 139 of file uops_tmpl.h.

Referenced by SWS_DECL_FUNC().