FFmpeg
Macros | Functions | Variables
uops_macros_gen.c File Reference
#include <string.h>
#include "libavutil/bprint.h"
#include "libavutil/error.h"
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/pixfmt.h"
#include "libavutil/tree.h"
#include "ops.h"
#include "ops_dispatch.h"
#include "op_list_gen_template.c"
#include "swscale.h"
#include "uops.h"
#include "uops_list.h"

Go to the source code of this file.

Macros

#define UOP_NAME(OP, ABBR)   [OP] = { #OP, ABBR },
 
#define BPRINT_STR(str)   av_bprint_append_data(bp, str, strlen(str))
 

Functions

static int generate_entry_struct (void *opaque, void *key)
 
static int generate_entry_args (void *opaque, void *key)
 
static int register_uop (struct AVTreeNode **root, const SwsUOp *uop)
 
static int register_flags (SwsContext *ctx, const SwsOpList *ops, SwsUOpFlags flags)
 
static int register_uops (SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
 
static int register_all_uops (SwsContext *ctx, void *graph, SwsOpList *ops)
 
static int enum_type (void *opaque, void *elem)
 
static int free_uop_key (void *opaque, void *key)
 
static int sws_uops_macros_gen (char **out_str)
 Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating over all possible SwsUOps. More...
 
int main (int argc, char **argv)
 

Variables

struct {
   char   full [32]
 
   char   abbr [32]
 
uop_names [SWS_UOP_TYPE_NB]
 This file is part of FFmpeg. More...
 
struct {
   char   full [16]
 
   char   prefix [8]
 
pixel_types [SWS_PIXEL_TYPE_NB]
 
static const SwsUOpFlags uop_flags []
 
static const SwsOpBackend backend_uops
 
static const SwsFlags flags_list []
 

Macro Definition Documentation

◆ UOP_NAME

#define UOP_NAME (   OP,
  ABBR 
)    [OP] = { #OP, ABBR },

◆ BPRINT_STR

#define BPRINT_STR (   str)    av_bprint_append_data(bp, str, strlen(str))

Function Documentation

◆ generate_entry_struct()

static int generate_entry_struct ( void *  opaque,
void *  key 
)
static

Definition at line 58 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ generate_entry_args()

static int generate_entry_args ( void *  opaque,
void *  key 
)
static

Definition at line 124 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ register_uop()

static int register_uop ( struct AVTreeNode **  root,
const SwsUOp uop 
)
static

Definition at line 187 of file uops_macros_gen.c.

Referenced by register_flags(), and sws_uops_macros_gen().

◆ register_flags()

static int register_flags ( SwsContext ctx,
const SwsOpList ops,
SwsUOpFlags  flags 
)
static

Definition at line 208 of file uops_macros_gen.c.

Referenced by register_uops().

◆ register_uops()

static int register_uops ( SwsContext ctx,
const SwsOpList ops,
SwsCompiledOp out 
)
static

Definition at line 235 of file uops_macros_gen.c.

◆ register_all_uops()

static int register_all_uops ( SwsContext ctx,
void *  graph,
SwsOpList ops 
)
static

Definition at line 254 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ enum_type()

static int enum_type ( void *  opaque,
void *  elem 
)
static

Definition at line 273 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ free_uop_key()

static int free_uop_key ( void *  opaque,
void *  key 
)
static

Definition at line 283 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ sws_uops_macros_gen()

static int sws_uops_macros_gen ( char **  out_str)
static

Generate a set of boilerplate C preprocessor macros for describing and programmatically iterating over all possible SwsUOps.

This function can be quite slow as it iterates over every possible combination of pixel formats and flags.

Returns 0 or a negative error code. On success, an allocated string is returned via out_str, and must be av_free()'d by the caller.

Additionally make sure planar reads/writes are always available for all formats, because checkasm depends on them to be able to verify the input/output of any other operations.

Definition at line 299 of file uops_macros_gen.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 404 of file uops_macros_gen.c.

Variable Documentation

◆ full

char full[16]

Definition at line 40 of file uops_macros_gen.c.

Referenced by ff_avg_h264_qpel16_mc01_mmi(), ff_avg_h264_qpel16_mc02_mmi(), ff_avg_h264_qpel16_mc03_mmi(), ff_avg_h264_qpel16_mc11_mmi(), ff_avg_h264_qpel16_mc13_mmi(), ff_avg_h264_qpel16_mc31_mmi(), ff_avg_h264_qpel16_mc33_mmi(), ff_avg_h264_qpel4_mc01_mmi(), ff_avg_h264_qpel4_mc02_mmi(), ff_avg_h264_qpel4_mc03_mmi(), ff_avg_h264_qpel4_mc11_mmi(), ff_avg_h264_qpel4_mc12_mmi(), ff_avg_h264_qpel4_mc13_mmi(), ff_avg_h264_qpel4_mc31_mmi(), ff_avg_h264_qpel4_mc32_mmi(), ff_avg_h264_qpel4_mc33_mmi(), ff_avg_h264_qpel8_mc01_mmi(), ff_avg_h264_qpel8_mc02_mmi(), ff_avg_h264_qpel8_mc03_mmi(), ff_avg_h264_qpel8_mc11_mmi(), ff_avg_h264_qpel8_mc13_mmi(), ff_avg_h264_qpel8_mc31_mmi(), ff_avg_h264_qpel8_mc33_mmi(), ff_put_h264_qpel16_mc01_mmi(), ff_put_h264_qpel16_mc02_mmi(), ff_put_h264_qpel16_mc03_mmi(), ff_put_h264_qpel16_mc11_mmi(), ff_put_h264_qpel16_mc13_mmi(), ff_put_h264_qpel16_mc31_mmi(), ff_put_h264_qpel16_mc33_mmi(), ff_put_h264_qpel4_mc01_mmi(), ff_put_h264_qpel4_mc02_mmi(), ff_put_h264_qpel4_mc03_mmi(), ff_put_h264_qpel4_mc11_mmi(), ff_put_h264_qpel4_mc12_mmi(), ff_put_h264_qpel4_mc13_mmi(), ff_put_h264_qpel4_mc31_mmi(), ff_put_h264_qpel4_mc32_mmi(), ff_put_h264_qpel4_mc33_mmi(), ff_put_h264_qpel8_mc01_mmi(), ff_put_h264_qpel8_mc02_mmi(), ff_put_h264_qpel8_mc03_mmi(), ff_put_h264_qpel8_mc11_mmi(), ff_put_h264_qpel8_mc13_mmi(), ff_put_h264_qpel8_mc31_mmi(), ff_put_h264_qpel8_mc33_mmi(), ff_sws_op_list_split_planes(), filter_frame(), init(), map_idx_10_to_20(), map_idx_10_to_34(), map_idx_20_to_34(), map_idx_34_to_20(), parse_string(), remap20(), and remap34().

◆ abbr

char abbr[32]

Definition at line 41 of file uops_macros_gen.c.

◆ uop_names

const { ... } uop_names[SWS_UOP_TYPE_NB]
Initial value:
= {
#define UOP_NAME(OP, ABBR)
}

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

Referenced by generate_entry_args(), generate_entry_struct(), and sws_uops_macros_gen().

◆ prefix

char prefix[8]

◆ pixel_types

const { ... } pixel_types[SWS_PIXEL_TYPE_NB]
Initial value:
= {
[SWS_PIXEL_NONE] = { "SWS_PIXEL_NONE", "" },
[SWS_PIXEL_U8] = { "SWS_PIXEL_U8", "U8_" },
[SWS_PIXEL_U16] = { "SWS_PIXEL_U16", "U16_" },
[SWS_PIXEL_U32] = { "SWS_PIXEL_U32", "U32_" },
[SWS_PIXEL_F32] = { "SWS_PIXEL_F32", "F32_" },
}

Referenced by generate_entry_args(), generate_entry_struct(), and sws_uops_macros_gen().

◆ uop_flags

const SwsUOpFlags uop_flags[]
static
Initial value:

Definition at line 230 of file uops_macros_gen.c.

Referenced by register_uops().

◆ backend_uops

const SwsOpBackend backend_uops
static
Initial value:
= {
.name = "uops_gen",
.compile = register_uops,
}

Definition at line 249 of file uops_macros_gen.c.

Referenced by register_all_uops().

◆ flags_list

const SwsFlags flags_list[]
static
Initial value:

Definition at line 265 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

SWS_PIXEL_NONE
@ SWS_PIXEL_NONE
Definition: uops.h:39
SWS_BITEXACT
@ SWS_BITEXACT
Definition: swscale.h:180
register_uops
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)
Definition: uops_macros_gen.c:235
SWS_UOP_FLAG_MOVE
@ SWS_UOP_FLAG_MOVE
Definition: uops.h:98
SWS_PIXEL_U32
@ SWS_PIXEL_U32
Definition: uops.h:42
SWS_PIXEL_U8
@ SWS_PIXEL_U8
Definition: uops.h:40
SWS_PIXEL_F32
@ SWS_PIXEL_F32
Definition: uops.h:43
SWS_UOP_FLAG_FMA
@ SWS_UOP_FLAG_FMA
Definition: uops.h:97
SWS_ACCURATE_RND
@ SWS_ACCURATE_RND
Force bit-exact output.
Definition: swscale.h:179
SWS_PIXEL_U16
@ SWS_PIXEL_U16
Definition: uops.h:41