FFmpeg
Loading...
Searching...
No Matches
uops_tmpl.c File Reference
#include <libavutil/bswap.h>
#include "uops_tmpl.h"

Go to the source code of this file.

Data Structures

struct  fn
 

Macros

#define BIT_DEPTH   8
 Copyright (C) 2026 Niklas Haas.
 
#define DECL_CAST(DST, dst)
 
#define LIN_VAL(I, J, val)
 
#define LIN_ROW(I, var)
 

Functions

 DECL_READ (read_planar, const SwsCompMask mask)
 
 DECL_READ (read_packed, const SwsCompMask mask)
 
 DECL_WRITE (write_planar, const SwsCompMask mask)
 
 DECL_WRITE (write_packed, const SwsCompMask mask)
 
 DECL_SETUP (setup_filter_v, params, out)
 
 DECL_READ (read_planar_fv, const SwsCompMask mask, const SwsPixelType type)
 
 DECL_SETUP (setup_filter_h, params, out)
 
 DECL_READ (read_planar_fh, const SwsCompMask mask, const SwsPixelType type)
 
 DECL_FUNC (permute, const SwsCompMask mask, int num_moves, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t d4, int8_t d5, int8_t s0, int8_t s1, int8_t s2, int8_t s3, int8_t s4, int8_t s5)
 
 DECL_FUNC (copy, const SwsCompMask mask, int num_moves, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t d4, int8_t d5, int8_t s0, int8_t s1, int8_t s2, int8_t s3, int8_t s4, int8_t s5)
 
 DECL_FUNC (lshift, const SwsCompMask mask, const uint8_t amount)
 
 DECL_FUNC (rshift, const SwsCompMask mask, const uint8_t amount)
 
 DECL_FUNC (unpack, const SwsCompMask mask, const uint8_t bx, const uint8_t by, const uint8_t bz, const uint8_t bw)
 
 DECL_FUNC (pack, const SwsCompMask mask, const uint8_t bx, const uint8_t by, const uint8_t bz, const uint8_t bw)
 
 DECL_FUNC (scale, const SwsCompMask mask)
 
 DECL_FUNC (add, const SwsCompMask mask)
 
 DECL_FUNC (min, const SwsCompMask mask)
 
 DECL_FUNC (max, const SwsCompMask mask)
 
 DECL_SETUP (setup_dither, params, out)
 
 DECL_FUNC (dither, const SwsCompMask mask, const uint8_t off0, const uint8_t off1, const uint8_t off2, const uint8_t off3, const uint8_t size_log2)
 
 DECL_SETUP (setup_linear, params, out)
 
 DECL_FUNC (linear, const SwsCompMask mask, const uint32_t one, const uint32_t zero)
 Fully general case for a 5x5 linear affine transformation.
 
 DECL_SETUP (setup_lut3d, params, out)
 

Macro Definition Documentation

◆ BIT_DEPTH

#define BIT_DEPTH   8

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

Definition at line 26 of file uops_tmpl.c.

◆ DECL_CAST

#define DECL_CAST ( DST,
dst )
Value:
DECL_FUNC(to_##dst, const SwsCompMask mask) \
{ \
block_t xx, yy, zz, ww; \
\
SWS_LOOP \
for (int i = 0; i < SWS_BLOCK_SIZE; i++) { \
if (X) xx.dst[i] = x[i]; \
if (Y) yy.dst[i] = y[i]; \
if (Z) zz.dst[i] = z[i]; \
if (W) ww.dst[i] = w[i]; \
} \
\
CONTINUE(&xx, &yy, &zz, &ww); \
} \
\
SWS_FOR(PX, TO_##DST, DECL_IMPL, to_##dst) \
SWS_FOR_STRUCT(PX, TO_##DST, DECL_ENTRY)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define Y
Definition boxblur.h:37
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define X
Definition f_ebur128.c:157
#define W(a, i, v)
Definition jpegls.h:119
uint8_t w
Definition llvidencdsp.c:39
static const uint16_t mask[17]
Definition lzw.c:38
uint8_t SwsCompMask
Bit-mask of components.
Definition uops.h:93
#define Z
Definition uops_tmpl.h:83
#define DECL_FUNC(NAME,...)
Definition uops_tmpl.h:87
#define DECL_IMPL(FUNC, NAME, TYPE, UOP,...)
Definition uops_tmpl.h:119
#define SWS_BLOCK_SIZE
Copyright (C) 2026 Niklas Haas.
Definition uops_tmpl.h:40
#define DECL_ENTRY(SETUP, NAME,...)
Definition uops_tmpl.h:139
#define DST(x, y)

Definition at line 418 of file uops_tmpl.c.

◆ LIN_VAL

#define LIN_VAL ( I,
J,
val )
Value:
((one & SWS_MASK(I, J)) ? (val) : c.m[I][J] * (val))
static double val(void *priv, double ch)
Definition aeval.c:77
#define SWS_MASK(I, J)
Definition uops.h:231
static double c[64]

◆ LIN_ROW

#define LIN_ROW ( I,
var )
Value:
do { \
var[i] = (zero & SWS_MASK(I, 4)) ? 0 : c.k[I]; \
if (!(zero & SWS_MASK(I, 0))) var[i] += LIN_VAL(I, 0, xx); \
if (!(zero & SWS_MASK(I, 1))) var[i] += LIN_VAL(I, 1, yy); \
if (!(zero & SWS_MASK(I, 2))) var[i] += LIN_VAL(I, 2, zz); \
if (!(zero & SWS_MASK(I, 3))) var[i] += LIN_VAL(I, 3, ww); \
} while (0)
if(svq3)
static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
#define LIN_VAL(I, J, val)

Referenced by DECL_FUNC().

Function Documentation

◆ DECL_READ() [1/4]

DECL_READ ( read_planar ,
const SwsCompMask mask )

Definition at line 64 of file uops_tmpl.c.

◆ DECL_READ() [2/4]

DECL_READ ( read_packed ,
const SwsCompMask mask )

Definition at line 82 of file uops_tmpl.c.

◆ DECL_WRITE() [1/2]

DECL_WRITE ( write_planar ,
const SwsCompMask mask )

Definition at line 98 of file uops_tmpl.c.

◆ DECL_WRITE() [2/2]

DECL_WRITE ( write_packed ,
const SwsCompMask mask )

Definition at line 114 of file uops_tmpl.c.

◆ DECL_SETUP() [1/5]

DECL_SETUP ( setup_filter_v ,
params ,
out  )

Definition at line 241 of file uops_tmpl.c.

◆ DECL_READ() [3/4]

DECL_READ ( read_planar_fv ,
const SwsCompMask mask,
const SwsPixelType type )

Definition at line 265 of file uops_tmpl.c.

◆ DECL_SETUP() [2/5]

DECL_SETUP ( setup_filter_h ,
params ,
out  )

Definition at line 304 of file uops_tmpl.c.

◆ DECL_READ() [4/4]

DECL_READ ( read_planar_fh ,
const SwsCompMask mask,
const SwsPixelType type )

Definition at line 317 of file uops_tmpl.c.

◆ DECL_FUNC() [1/12]

DECL_FUNC ( permute ,
const SwsCompMask mask,
int num_moves,
int8_t d0,
int8_t d1,
int8_t d2,
int8_t d3,
int8_t d4,
int8_t d5,
int8_t s0,
int8_t s1,
int8_t s2,
int8_t s3,
int8_t s4,
int8_t s5 )

Definition at line 364 of file uops_tmpl.c.

◆ DECL_FUNC() [2/12]

DECL_FUNC ( copy ,
const SwsCompMask mask,
int num_moves,
int8_t d0,
int8_t d1,
int8_t d2,
int8_t d3,
int8_t d4,
int8_t d5,
int8_t s0,
int8_t s1,
int8_t s2,
int8_t s3,
int8_t s4,
int8_t s5 )

Definition at line 384 of file uops_tmpl.c.

◆ DECL_FUNC() [3/12]

DECL_FUNC ( lshift ,
const SwsCompMask mask,
const uint8_t amount )

Definition at line 447 of file uops_tmpl.c.

◆ DECL_FUNC() [4/12]

DECL_FUNC ( rshift ,
const SwsCompMask mask,
const uint8_t amount )

Definition at line 460 of file uops_tmpl.c.

◆ DECL_FUNC() [5/12]

DECL_FUNC ( unpack ,
const SwsCompMask mask,
const uint8_t bx,
const uint8_t by,
const uint8_t bz,
const uint8_t bw )

Definition at line 557 of file uops_tmpl.c.

◆ DECL_FUNC() [6/12]

DECL_FUNC ( pack ,
const SwsCompMask mask,
const uint8_t bx,
const uint8_t by,
const uint8_t bz,
const uint8_t bw )

Definition at line 583 of file uops_tmpl.c.

◆ DECL_FUNC() [7/12]

DECL_FUNC ( scale ,
const SwsCompMask mask )

Definition at line 645 of file uops_tmpl.c.

◆ DECL_FUNC() [8/12]

DECL_FUNC ( add ,
const SwsCompMask mask )

Definition at line 660 of file uops_tmpl.c.

◆ DECL_FUNC() [9/12]

DECL_FUNC ( min ,
const SwsCompMask mask )

Definition at line 673 of file uops_tmpl.c.

◆ DECL_FUNC() [10/12]

DECL_FUNC ( max ,
const SwsCompMask mask )

Definition at line 686 of file uops_tmpl.c.

◆ DECL_SETUP() [3/5]

DECL_SETUP ( setup_dither ,
params ,
out  )

Definition at line 712 of file uops_tmpl.c.

◆ DECL_FUNC() [11/12]

DECL_FUNC ( dither ,
const SwsCompMask mask,
const uint8_t off0,
const uint8_t off1,
const uint8_t off2,
const uint8_t off3,
const uint8_t size_log2 )

Definition at line 746 of file uops_tmpl.c.

◆ DECL_SETUP() [4/5]

DECL_SETUP ( setup_linear ,
params ,
out  )

Definition at line 787 of file uops_tmpl.c.

◆ DECL_FUNC() [12/12]

DECL_FUNC ( linear ,
const SwsCompMask mask,
const uint32_t one,
const uint32_t zero )

Fully general case for a 5x5 linear affine transformation.

Should never be called without constant mask. This function will compile down to the appropriately optimized version for the required subset of operations when called with a constant mask.

Definition at line 809 of file uops_tmpl.c.

◆ DECL_SETUP() [5/5]

DECL_SETUP ( setup_lut3d ,
params ,
out  )

Definition at line 847 of file uops_tmpl.c.