FFmpeg
Data Structures | Macros | Functions | Variables
ops_impl.c File Reference
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "ops_impl.h"

Go to the source code of this file.

Data Structures

struct  ParamField
 The following structure is used to describe one field from SwsAArch64OpImplParams. More...
 

Macros

#define PARAM_FIELD(name)   #name, offsetof(SwsAArch64OpImplParams, name), sizeof(((SwsAArch64OpImplParams *) 0)->name)
 
#define MAX_LEVELS   8
 

Functions

static const char * aarch64_pixel_type (SwsAArch64PixelType fmt)
 
static const char * aarch64_pixel_type_name (SwsAArch64PixelType fmt)
 
static const char * aarch64_op_type (SwsAArch64OpType op)
 
static const char * aarch64_op_type_name (SwsAArch64OpType op)
 
 av_printf_format (3, 4)
 
static void print_op_name (char **pbuf, size_t *prem, void *p)
 
static void print_op_val (char **pbuf, size_t *prem, void *p)
 
static int cmp_op (void *pa, void *pb)
 
static void print_pixel_name (char **pbuf, size_t *prem, void *p)
 
static void print_pixel_val (char **pbuf, size_t *prem, void *p)
 
static int cmp_pixel (void *pa, void *pb)
 
static void print_u8_name (char **pbuf, size_t *prem, void *p)
 
static void print_u8_val (char **pbuf, size_t *prem, void *p)
 
static int cmp_u8 (void *pa, void *pb)
 
static void print_u16_name (char **pbuf, size_t *prem, void *p)
 
static void print_u16_val (char **pbuf, size_t *prem, void *p)
 
static int cmp_u16 (void *pa, void *pb)
 
static void print_u40_name (char **pbuf, size_t *prem, void *p)
 
static void print_u40_val (char **pbuf, size_t *prem, void *p)
 
static int cmp_u40 (void *pa, void *pb)
 

Variables

static const char pixel_types [AARCH64_PIXEL_TYPE_NB][32]
 This file is used both by sws_ops_aarch64 to generate ops_entries.c and by the standalone build-time tool that generates the static assembly functions (aarch64/ops_asmgen). More...
 
static const char pixel_type_names [AARCH64_PIXEL_TYPE_NB][4]
 
static const char op_types [AARCH64_SWS_OP_TYPE_NB][32]
 
static const char op_type_names [AARCH64_SWS_OP_TYPE_NB][16]
 
static const ParamField field_op = { PARAM_FIELD(op), print_op_name, print_op_val, cmp_op }
 
static const ParamField field_mask = { PARAM_FIELD(mask), print_u16_name, print_u16_val, cmp_u16 }
 
static const ParamField field_type = { PARAM_FIELD(type), print_pixel_name, print_pixel_val, cmp_pixel }
 
static const ParamField field_block_size = { PARAM_FIELD(block_size), print_u8_name, print_u8_val, cmp_u8 }
 
static const ParamField field_shift = { PARAM_FIELD(shift), print_u8_name, print_u8_val, cmp_u8 }
 
static const ParamField field_swizzle = { PARAM_FIELD(swizzle), print_u16_name, print_u16_val, cmp_u16 }
 
static const ParamField field_pack = { PARAM_FIELD(pack), print_u16_name, print_u16_val, cmp_u16 }
 
static const ParamField field_to_type = { PARAM_FIELD(to_type), print_pixel_name, print_pixel_val, cmp_pixel }
 
static const ParamField field_linear_mask = { PARAM_FIELD(linear.mask), print_u40_name, print_u40_val, cmp_u40 }
 
static const ParamField field_linear_fmla = { PARAM_FIELD(linear.fmla), print_u8_name, print_u8_val, cmp_u8 }
 
static const ParamField field_dither_y_offset = { PARAM_FIELD(dither.y_offset), print_u16_name, print_u16_val, cmp_u16 }
 
static const ParamField field_dither_size_log2 = { PARAM_FIELD(dither.size_log2), print_u8_name, print_u8_val, cmp_u8 }
 
static const ParamFieldop_fields [AARCH64_SWS_OP_TYPE_NB][MAX_LEVELS]
 

Macro Definition Documentation

◆ PARAM_FIELD

#define PARAM_FIELD (   name)    #name, offsetof(SwsAArch64OpImplParams, name), sizeof(((SwsAArch64OpImplParams *) 0)->name)

Definition at line 199 of file ops_impl.c.

◆ MAX_LEVELS

#define MAX_LEVELS   8

Definition at line 326 of file ops_impl.c.

Function Documentation

◆ aarch64_pixel_type()

static const char* aarch64_pixel_type ( SwsAArch64PixelType  fmt)
static

Definition at line 51 of file ops_impl.c.

Referenced by print_pixel_val().

◆ aarch64_pixel_type_name()

static const char* aarch64_pixel_type_name ( SwsAArch64PixelType  fmt)
static

Definition at line 67 of file ops_impl.c.

Referenced by print_pixel_name().

◆ aarch64_op_type()

static const char* aarch64_op_type ( SwsAArch64OpType  op)
static

Definition at line 105 of file ops_impl.c.

Referenced by print_op_val().

◆ aarch64_op_type_name()

static const char* aarch64_op_type_name ( SwsAArch64OpType  op)
static

Definition at line 142 of file ops_impl.c.

Referenced by print_op_name().

◆ av_printf_format()

av_printf_format ( ,
 
)

Definition at line 156 of file ops_impl.c.

◆ print_op_name()

static void print_op_name ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 201 of file ops_impl.c.

◆ print_op_val()

static void print_op_val ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 207 of file ops_impl.c.

◆ cmp_op()

static int cmp_op ( void *  pa,
void *  pb 
)
static

Definition at line 213 of file ops_impl.c.

◆ print_pixel_name()

static void print_pixel_name ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 223 of file ops_impl.c.

◆ print_pixel_val()

static void print_pixel_val ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 229 of file ops_impl.c.

◆ cmp_pixel()

static int cmp_pixel ( void *  pa,
void *  pb 
)
static

Definition at line 235 of file ops_impl.c.

◆ print_u8_name()

static void print_u8_name ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 245 of file ops_impl.c.

◆ print_u8_val()

static void print_u8_val ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 251 of file ops_impl.c.

◆ cmp_u8()

static int cmp_u8 ( void *  pa,
void *  pb 
)
static

Definition at line 257 of file ops_impl.c.

◆ print_u16_name()

static void print_u16_name ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 267 of file ops_impl.c.

◆ print_u16_val()

static void print_u16_val ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 273 of file ops_impl.c.

◆ cmp_u16()

static int cmp_u16 ( void *  pa,
void *  pb 
)
static

Definition at line 279 of file ops_impl.c.

◆ print_u40_name()

static void print_u40_name ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 289 of file ops_impl.c.

◆ print_u40_val()

static void print_u40_val ( char **  pbuf,
size_t *  prem,
void *  p 
)
static

Definition at line 295 of file ops_impl.c.

◆ cmp_u40()

static int cmp_u40 ( void *  pa,
void *  pb 
)
static

Definition at line 301 of file ops_impl.c.

Variable Documentation

◆ pixel_types

const char pixel_types[AARCH64_PIXEL_TYPE_NB][32]
static
Initial value:
= {
[AARCH64_PIXEL_U8 ] = "AARCH64_PIXEL_U8",
[AARCH64_PIXEL_U16] = "AARCH64_PIXEL_U16",
[AARCH64_PIXEL_U32] = "AARCH64_PIXEL_U32",
[AARCH64_PIXEL_F32] = "AARCH64_PIXEL_F32",
}

This file is used both by sws_ops_aarch64 to generate ops_entries.c and by the standalone build-time tool that generates the static assembly functions (aarch64/ops_asmgen).

Therefore, it must not depend on internal FFmpeg libraries. NOTE: ops_asmgen contains header redefinitions to provide av_assert0 while not depending on internal FFmpeg libraries.

Definition at line 44 of file ops_impl.c.

Referenced by aarch64_pixel_type().

◆ pixel_type_names

const char pixel_type_names[AARCH64_PIXEL_TYPE_NB][4]
static
Initial value:
= {
[AARCH64_PIXEL_U8 ] = "u8",
[AARCH64_PIXEL_U16] = "u16",
[AARCH64_PIXEL_U32] = "u32",
[AARCH64_PIXEL_F32] = "f32",
}

Definition at line 60 of file ops_impl.c.

Referenced by aarch64_pixel_type_name().

◆ op_types

const char op_types[AARCH64_SWS_OP_TYPE_NB][32]
static
Initial value:
= {
[AARCH64_SWS_OP_NONE ] = "AARCH64_SWS_OP_NONE",
[AARCH64_SWS_OP_PROCESS ] = "AARCH64_SWS_OP_PROCESS",
[AARCH64_SWS_OP_PROCESS_RETURN] = "AARCH64_SWS_OP_PROCESS_RETURN",
[AARCH64_SWS_OP_READ_BIT ] = "AARCH64_SWS_OP_READ_BIT",
[AARCH64_SWS_OP_READ_NIBBLE ] = "AARCH64_SWS_OP_READ_NIBBLE",
[AARCH64_SWS_OP_READ_PACKED ] = "AARCH64_SWS_OP_READ_PACKED",
[AARCH64_SWS_OP_READ_PLANAR ] = "AARCH64_SWS_OP_READ_PLANAR",
[AARCH64_SWS_OP_WRITE_BIT ] = "AARCH64_SWS_OP_WRITE_BIT",
[AARCH64_SWS_OP_WRITE_NIBBLE ] = "AARCH64_SWS_OP_WRITE_NIBBLE",
[AARCH64_SWS_OP_WRITE_PACKED ] = "AARCH64_SWS_OP_WRITE_PACKED",
[AARCH64_SWS_OP_WRITE_PLANAR ] = "AARCH64_SWS_OP_WRITE_PLANAR",
[AARCH64_SWS_OP_SWAP_BYTES ] = "AARCH64_SWS_OP_SWAP_BYTES",
[AARCH64_SWS_OP_SWIZZLE ] = "AARCH64_SWS_OP_SWIZZLE",
[AARCH64_SWS_OP_UNPACK ] = "AARCH64_SWS_OP_UNPACK",
[AARCH64_SWS_OP_PACK ] = "AARCH64_SWS_OP_PACK",
[AARCH64_SWS_OP_LSHIFT ] = "AARCH64_SWS_OP_LSHIFT",
[AARCH64_SWS_OP_RSHIFT ] = "AARCH64_SWS_OP_RSHIFT",
[AARCH64_SWS_OP_CLEAR ] = "AARCH64_SWS_OP_CLEAR",
[AARCH64_SWS_OP_CONVERT ] = "AARCH64_SWS_OP_CONVERT",
[AARCH64_SWS_OP_EXPAND ] = "AARCH64_SWS_OP_EXPAND",
[AARCH64_SWS_OP_MIN ] = "AARCH64_SWS_OP_MIN",
[AARCH64_SWS_OP_MAX ] = "AARCH64_SWS_OP_MAX",
[AARCH64_SWS_OP_SCALE ] = "AARCH64_SWS_OP_SCALE",
[AARCH64_SWS_OP_LINEAR ] = "AARCH64_SWS_OP_LINEAR",
[AARCH64_SWS_OP_DITHER ] = "AARCH64_SWS_OP_DITHER",
}

Definition at line 77 of file ops_impl.c.

Referenced by aarch64_op_type().

◆ op_type_names

const char op_type_names[AARCH64_SWS_OP_TYPE_NB][16]
static
Initial value:
= {
[AARCH64_SWS_OP_NONE ] = "none",
[AARCH64_SWS_OP_PROCESS ] = "process",
[AARCH64_SWS_OP_PROCESS_RETURN] = "process_return",
[AARCH64_SWS_OP_READ_BIT ] = "read_bit",
[AARCH64_SWS_OP_READ_NIBBLE ] = "read_nibble",
[AARCH64_SWS_OP_READ_PACKED ] = "read_packed",
[AARCH64_SWS_OP_READ_PLANAR ] = "read_planar",
[AARCH64_SWS_OP_WRITE_BIT ] = "write_bit",
[AARCH64_SWS_OP_WRITE_NIBBLE ] = "write_nibble",
[AARCH64_SWS_OP_WRITE_PACKED ] = "write_packed",
[AARCH64_SWS_OP_WRITE_PLANAR ] = "write_planar",
[AARCH64_SWS_OP_SWAP_BYTES ] = "swap_bytes",
[AARCH64_SWS_OP_SWIZZLE ] = "swizzle",
[AARCH64_SWS_OP_UNPACK ] = "unpack",
[AARCH64_SWS_OP_PACK ] = "pack",
[AARCH64_SWS_OP_LSHIFT ] = "lshift",
[AARCH64_SWS_OP_RSHIFT ] = "rshift",
[AARCH64_SWS_OP_CLEAR ] = "clear",
[AARCH64_SWS_OP_CONVERT ] = "convert",
[AARCH64_SWS_OP_EXPAND ] = "expand",
[AARCH64_SWS_OP_MIN ] = "min",
[AARCH64_SWS_OP_MAX ] = "max",
[AARCH64_SWS_OP_SCALE ] = "scale",
[AARCH64_SWS_OP_LINEAR ] = "linear",
[AARCH64_SWS_OP_DITHER ] = "dither",
}

Definition at line 114 of file ops_impl.c.

Referenced by aarch64_op_type_name().

◆ field_op

const ParamField field_op = { PARAM_FIELD(op), print_op_name, print_op_val, cmp_op }
static

Definition at line 312 of file ops_impl.c.

◆ field_mask

const ParamField field_mask = { PARAM_FIELD(mask), print_u16_name, print_u16_val, cmp_u16 }
static

Definition at line 313 of file ops_impl.c.

◆ field_type

Definition at line 314 of file ops_impl.c.

Referenced by deint_d3d12_configure_processor().

◆ field_block_size

const ParamField field_block_size = { PARAM_FIELD(block_size), print_u8_name, print_u8_val, cmp_u8 }
static

Definition at line 315 of file ops_impl.c.

◆ field_shift

const ParamField field_shift = { PARAM_FIELD(shift), print_u8_name, print_u8_val, cmp_u8 }
static

Definition at line 316 of file ops_impl.c.

◆ field_swizzle

const ParamField field_swizzle = { PARAM_FIELD(swizzle), print_u16_name, print_u16_val, cmp_u16 }
static

Definition at line 317 of file ops_impl.c.

◆ field_pack

const ParamField field_pack = { PARAM_FIELD(pack), print_u16_name, print_u16_val, cmp_u16 }
static

Definition at line 318 of file ops_impl.c.

◆ field_to_type

const ParamField field_to_type = { PARAM_FIELD(to_type), print_pixel_name, print_pixel_val, cmp_pixel }
static

Definition at line 319 of file ops_impl.c.

◆ field_linear_mask

const ParamField field_linear_mask = { PARAM_FIELD(linear.mask), print_u40_name, print_u40_val, cmp_u40 }
static

Definition at line 320 of file ops_impl.c.

◆ field_linear_fmla

const ParamField field_linear_fmla = { PARAM_FIELD(linear.fmla), print_u8_name, print_u8_val, cmp_u8 }
static

Definition at line 321 of file ops_impl.c.

◆ field_dither_y_offset

const ParamField field_dither_y_offset = { PARAM_FIELD(dither.y_offset), print_u16_name, print_u16_val, cmp_u16 }
static

Definition at line 322 of file ops_impl.c.

◆ field_dither_size_log2

const ParamField field_dither_size_log2 = { PARAM_FIELD(dither.size_log2), print_u8_name, print_u8_val, cmp_u8 }
static

Definition at line 323 of file ops_impl.c.

◆ op_fields

const ParamField* op_fields[AARCH64_SWS_OP_TYPE_NB][MAX_LEVELS]
static
Initial value:
= {
}

Definition at line 327 of file ops_impl.c.

Referenced by aarch64_op_impl_cmp(), aarch64_op_impl_lookup_str(), impl_func_name(), and serialize_op().

AARCH64_SWS_OP_MIN
@ AARCH64_SWS_OP_MIN
Definition: ops_impl.h:59
field_dither_y_offset
static const ParamField field_dither_y_offset
Definition: ops_impl.c:322
field_linear_fmla
static const ParamField field_linear_fmla
Definition: ops_impl.c:321
AARCH64_SWS_OP_SWIZZLE
@ AARCH64_SWS_OP_SWIZZLE
Definition: ops_impl.h:51
field_to_type
static const ParamField field_to_type
Definition: ops_impl.c:319
AARCH64_SWS_OP_CLEAR
@ AARCH64_SWS_OP_CLEAR
Definition: ops_impl.h:56
AARCH64_SWS_OP_NONE
@ AARCH64_SWS_OP_NONE
Definition: ops_impl.h:39
field_mask
static const ParamField field_mask
Definition: ops_impl.c:313
AARCH64_SWS_OP_READ_NIBBLE
@ AARCH64_SWS_OP_READ_NIBBLE
Definition: ops_impl.h:43
AARCH64_SWS_OP_PACK
@ AARCH64_SWS_OP_PACK
Definition: ops_impl.h:53
AARCH64_SWS_OP_SWAP_BYTES
@ AARCH64_SWS_OP_SWAP_BYTES
Definition: ops_impl.h:50
AARCH64_SWS_OP_READ_BIT
@ AARCH64_SWS_OP_READ_BIT
Definition: ops_impl.h:42
AARCH64_SWS_OP_MAX
@ AARCH64_SWS_OP_MAX
Definition: ops_impl.h:60
field_shift
static const ParamField field_shift
Definition: ops_impl.c:316
field_type
static const ParamField field_type
Definition: ops_impl.c:314
AARCH64_SWS_OP_WRITE_NIBBLE
@ AARCH64_SWS_OP_WRITE_NIBBLE
Definition: ops_impl.h:47
AARCH64_SWS_OP_DITHER
@ AARCH64_SWS_OP_DITHER
Definition: ops_impl.h:63
AARCH64_SWS_OP_RSHIFT
@ AARCH64_SWS_OP_RSHIFT
Definition: ops_impl.h:55
AARCH64_SWS_OP_LINEAR
@ AARCH64_SWS_OP_LINEAR
Definition: ops_impl.h:62
AARCH64_SWS_OP_CONVERT
@ AARCH64_SWS_OP_CONVERT
Definition: ops_impl.h:57
AARCH64_SWS_OP_PROCESS
@ AARCH64_SWS_OP_PROCESS
Definition: ops_impl.h:40
AARCH64_PIXEL_F32
@ AARCH64_PIXEL_F32
Definition: ops_impl.h:33
field_op
static const ParamField field_op
Definition: ops_impl.c:312
AARCH64_SWS_OP_SCALE
@ AARCH64_SWS_OP_SCALE
Definition: ops_impl.h:61
AARCH64_SWS_OP_READ_PACKED
@ AARCH64_SWS_OP_READ_PACKED
Definition: ops_impl.h:44
field_dither_size_log2
static const ParamField field_dither_size_log2
Definition: ops_impl.c:323
AARCH64_SWS_OP_WRITE_PLANAR
@ AARCH64_SWS_OP_WRITE_PLANAR
Definition: ops_impl.h:49
AARCH64_SWS_OP_LSHIFT
@ AARCH64_SWS_OP_LSHIFT
Definition: ops_impl.h:54
field_linear_mask
static const ParamField field_linear_mask
Definition: ops_impl.c:320
AARCH64_SWS_OP_WRITE_BIT
@ AARCH64_SWS_OP_WRITE_BIT
Definition: ops_impl.h:46
AARCH64_SWS_OP_READ_PLANAR
@ AARCH64_SWS_OP_READ_PLANAR
Definition: ops_impl.h:45
AARCH64_SWS_OP_EXPAND
@ AARCH64_SWS_OP_EXPAND
Definition: ops_impl.h:58
AARCH64_SWS_OP_UNPACK
@ AARCH64_SWS_OP_UNPACK
Definition: ops_impl.h:52
field_block_size
static const ParamField field_block_size
Definition: ops_impl.c:315
AARCH64_PIXEL_U8
@ AARCH64_PIXEL_U8
Definition: ops_impl.h:30
field_swizzle
static const ParamField field_swizzle
Definition: ops_impl.c:317
AARCH64_PIXEL_U32
@ AARCH64_PIXEL_U32
Definition: ops_impl.h:32
field_pack
static const ParamField field_pack
Definition: ops_impl.c:318
AARCH64_SWS_OP_WRITE_PACKED
@ AARCH64_SWS_OP_WRITE_PACKED
Definition: ops_impl.h:48
AARCH64_SWS_OP_PROCESS_RETURN
@ AARCH64_SWS_OP_PROCESS_RETURN
Definition: ops_impl.h:41
AARCH64_PIXEL_U16
@ AARCH64_PIXEL_U16
Definition: ops_impl.h:31