FFmpeg
Loading...
Searching...
No Matches
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/thread.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.

Data Structures

struct  EnumPriv
 

Macros

#define UOP_NAME(OP, ABBR)
 
#define BPRINT_STR(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 EnumPriv *s, 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.
 
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.
 
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 )
Value:
[OP] = { #OP, ABBR },
#define OP(gb, pixel, count)

◆ BPRINT_STR

#define BPRINT_STR ( str)
Value:
av_bprint_append_data(bp, str, strlen(str))
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
Definition bprint.c:148

Referenced by sws_uops_macros_gen().

Function Documentation

◆ generate_entry_struct()

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

Definition at line 59 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 130 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().

◆ register_uop()

static int register_uop ( struct EnumPriv * s,
const SwsUOp * uop )
static

Definition at line 200 of file uops_macros_gen.c.

Referenced by register_flags().

◆ register_flags()

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

Definition at line 223 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 249 of file uops_macros_gen.c.

◆ register_all_uops()

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

Definition at line 268 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 287 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 297 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.

Definition at line 313 of file uops_macros_gen.c.

Referenced by main().

◆ main()

int main ( int argc,
char ** argv )

Definition at line 416 of file uops_macros_gen.c.

Variable Documentation

◆ full

char full[16]

Definition at line 41 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(), filter_frame(), 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 42 of file uops_macros_gen.c.

◆ [struct]

const struct { ... } 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

◆ prefix

◆ [struct]

const struct { ... } 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_" },
}
@ SWS_PIXEL_F32
Definition uops.h:44
@ SWS_PIXEL_U32
Definition uops.h:43
@ SWS_PIXEL_U16
Definition uops.h:42
@ SWS_PIXEL_NONE
Definition uops.h:40
@ SWS_PIXEL_U8
Definition uops.h:41

◆ uop_flags

const SwsUOpFlags uop_flags[]
static
Initial value:
= {
0,
}
@ SWS_UOP_FLAG_FMA
Definition uops.h:125
@ SWS_UOP_FLAG_PSHUFB
Definition uops.h:126

Definition at line 244 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,
}
static int register_uops(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out)

Definition at line 263 of file uops_macros_gen.c.

Referenced by register_all_uops().

◆ flags_list

const SwsFlags flags_list[]
static
Initial value:
= {
0,
}
@ SWS_BITEXACT
Definition swscale.h:178
@ SWS_ACCURATE_RND
Force bit-exact output.
Definition swscale.h:177

Definition at line 279 of file uops_macros_gen.c.

Referenced by sws_uops_macros_gen().