|
FFmpeg
|
#include "libavutil/attributes.h"#include "libavutil/avassert.h"#include "libavutil/avstring.h"#include "libavutil/bprint.h"#include "libavutil/bswap.h"#include "libavutil/mem.h"#include "libavutil/rational.h"#include "libavutil/refstruct.h"#include "format.h"#include "ops.h"#include "ops_internal.h"Go to the source code of this file.
Macros | |
| #define | DUMMY_SIZE 16 |
Enumerations | |
| enum | { SWS_COMP_IDENTITY, SWS_COMP_DIRTY = ~(SWS_COMP_COPY | SWS_COMP_CONST) } |
Functions | |
| const char * | ff_sws_pixel_type_name (SwsPixelType type) |
| int | ff_sws_pixel_type_size (SwsPixelType type) |
| bool | ff_sws_pixel_type_is_int (SwsPixelType type) |
| const char * | ff_sws_op_type_name (SwsOpType op) |
| SwsCompMask | ff_sws_comp_mask_q4 (const AVRational q[4]) |
| void | ff_sws_comp_mask_swizzle (SwsCompMask *mask, const SwsSwizzleOp *swiz) |
| SwsCompMask | ff_sws_comp_mask_needed (const SwsOp *op) |
| int | ff_sws_rw_op_planes (const SwsOp *op) |
| Return the number of planes involved in a read/write operation. More... | |
| static AVRational | av_min_q (AVRational a, AVRational b) |
| static AVRational | av_max_q (AVRational a, AVRational b) |
| void | ff_sws_apply_op_q (const SwsOp *op, AVRational x[4]) |
| Apply an operation to an AVRational. More... | |
| static SwsCompFlags | merge_comp_flags (SwsCompFlags a, SwsCompFlags b) |
| static void | apply_filter_weights (SwsComps *comps, const SwsComps *prev, const SwsFilterWeights *weights) |
| void | ff_sws_op_list_update_comps (SwsOpList *ops) |
| Infer + propagate known information about components. More... | |
| static void | op_uninit (SwsOp *op) |
| SwsOpList * | ff_sws_op_list_alloc (void) |
| void | ff_sws_op_list_free (SwsOpList **p_ops) |
| SwsOpList * | ff_sws_op_list_duplicate (const SwsOpList *ops) |
Returns a duplicate of ops, or NULL on OOM. More... | |
| const SwsOp * | ff_sws_op_list_input (const SwsOpList *ops) |
| Returns the input operation for a given op list, or NULL if there is none (e.g. More... | |
| const SwsOp * | ff_sws_op_list_output (const SwsOpList *ops) |
| Returns the output operation for a given op list, or NULL if there is none. More... | |
| void | ff_sws_op_list_remove_at (SwsOpList *ops, int index, int count) |
| int | ff_sws_op_list_insert_at (SwsOpList *ops, int index, SwsOp *op) |
| int | ff_sws_op_list_append (SwsOpList *ops, SwsOp *op) |
These will take over ownership of op and set it to {0}, even on failure. More... | |
| bool | ff_sws_op_list_is_noop (const SwsOpList *ops) |
| Returns whether an op list represents a true no-op operation, i.e. More... | |
| int | ff_sws_op_list_max_size (const SwsOpList *ops) |
Returns the size of the largest pixel type used in ops. More... | |
| uint32_t | ff_sws_linear_mask (const SwsLinearOp *c) |
| static char | describe_comp_flags (SwsCompFlags flags) |
| static void | print_q (AVBPrint *bp, const AVRational q) |
| static void | print_q4 (AVBPrint *bp, const AVRational q4[4], SwsCompMask mask) |
| void | ff_sws_op_desc (AVBPrint *bp, const SwsOp *op) |
| Describe an operation in human-readable form. More... | |
| static void | desc_plane_order (AVBPrint *bp, int nb_planes, const uint8_t *order) |
| void | ff_sws_op_list_print (void *log, int lev, int lev_extra, const SwsOpList *ops) |
| Print out the contents of an operation list. More... | |
| static int | enum_ops_fmt (SwsContext *ctx, void *opaque, enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt, int(*cb)(SwsContext *ctx, void *opaque, SwsOpList *ops)) |
| int | ff_sws_enum_op_lists (SwsContext *ctx, void *opaque, enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt, int(*cb)(SwsContext *ctx, void *opaque, SwsOpList *ops)) |
Helper function to enumerate over all possible (optimized) operation lists, under the current set of options in ctx, and run the given callback on each list. More... | |
Variables | |
| const SwsOpBackend | backend_c |
| Copyright (C) 2025 Niklas Haas. More... | |
| const SwsOpBackend | backend_murder |
| const SwsOpBackend | backend_aarch64 |
| const SwsOpBackend | backend_x86 |
| const SwsOpBackend *const | ff_sws_op_backends [] |
| static const char *const | rw_mode_names [] |
| const char* ff_sws_pixel_type_name | ( | SwsPixelType | type | ) |
Definition at line 62 of file ops.c.
Referenced by ff_sws_op_desc(), ff_sws_op_list_print(), and ff_sws_uop_name().
| int ff_sws_pixel_type_size | ( | SwsPixelType | type | ) |
Definition at line 77 of file ops.c.
Referenced by check_cast(), check_clear(), check_filter_fma(), check_scale(), compile(), convert_to_aarch64_impl(), ff_sws_apply_op_q(), ff_sws_op_list_max_size(), ff_sws_op_list_optimize(), ff_sws_pixel_expand(), ff_sws_solve_shuffle(), get_planar_fmt(), pixel_is_1s(), pixel_type_to_int(), rndq(), rw_pixel_bits(), setup_filter_h(), and setup_filter_h_4x4().
| bool ff_sws_pixel_type_is_int | ( | SwsPixelType | type | ) |
Definition at line 92 of file ops.c.
Referenced by check_cast(), check_dither(), check_filter_fma(), check_linear(), check_scale(), exact_prod(), ff_sws_apply_op_q(), ff_sws_op_list_optimize(), ff_sws_op_list_update_comps(), ff_sws_uops_macros_gen(), op_commute_filter(), and rndq().
| const char* ff_sws_op_type_name | ( | SwsOpType | op | ) |
Definition at line 109 of file ops.c.
Referenced by ff_sws_op_desc().
| SwsCompMask ff_sws_comp_mask_q4 | ( | const AVRational | q[4] | ) |
Definition at line 137 of file ops.c.
Referenced by ff_sws_op_desc(), ff_sws_op_list_print(), and translate_op().
| void ff_sws_comp_mask_swizzle | ( | SwsCompMask * | mask, |
| const SwsSwizzleOp * | swiz | ||
| ) |
Definition at line 147 of file ops.c.
Referenced by op_commute_clear().
| SwsCompMask ff_sws_comp_mask_needed | ( | const SwsOp * | op | ) |
Definition at line 160 of file ops.c.
Referenced by ff_sws_op_desc(), ff_sws_op_list_optimize(), ff_sws_op_list_print(), translate_move(), translate_op(), and translate_swizzle().
| int ff_sws_rw_op_planes | ( | const SwsOp * | op | ) |
Return the number of planes involved in a read/write operation.
Definition at line 170 of file ops.c.
Referenced by aarch64_compile(), compile(), ff_sws_op_list_is_noop(), ff_sws_op_list_print(), ff_sws_solve_shuffle(), and rw_data_planes().
|
static |
Definition at line 184 of file ops.c.
Referenced by ff_sws_apply_op_q().
|
static |
Definition at line 189 of file ops.c.
Referenced by ff_sws_apply_op_q().
| void ff_sws_apply_op_q | ( | const SwsOp * | op, |
| AVRational | x[4] | ||
| ) |
Apply an operation to an AVRational.
No-op for read/write operations.
Definition at line 194 of file ops.c.
Referenced by ff_sws_op_list_update_comps(), and op_commute_clear().
|
static |
Definition at line 316 of file ops.c.
Referenced by ff_sws_op_list_update_comps().
|
static |
Definition at line 323 of file ops.c.
Referenced by ff_sws_op_list_update_comps().
| void ff_sws_op_list_update_comps | ( | SwsOpList * | ops | ) |
Infer + propagate known information about components.
Called automatically when needed by the optimizer and compiler.
Don't mark packed or fractional reads as a copy, because the read operation implicitly unpacks the data into separate components. The only case in which op lists involving such reads can be refcopies is in the case of a true noop, which is already covered by the no-op check.
Definition at line 342 of file ops.c.
Referenced by compile_backend(), and ff_sws_op_list_optimize().
|
static |
Definition at line 614 of file ops.c.
Referenced by ff_sws_op_list_free(), ff_sws_op_list_insert_at(), and ff_sws_op_list_remove_at().
| void ff_sws_op_list_free | ( | SwsOpList ** | p_ops | ) |
Definition at line 645 of file ops.c.
Referenced by compile_backend(), compile_subpass(), enum_ops_fmt(), ff_sws_compile_pass(), ff_sws_op_list_split_at(), and ff_sws_op_list_split_planes().
Returns a duplicate of ops, or NULL on OOM.
Definition at line 659 of file ops.c.
Referenced by compile_backend(), ff_sws_op_list_split_at(), ff_sws_op_list_split_planes(), print_passes(), and register_all_uops().
Returns the input operation for a given op list, or NULL if there is none (e.g.
for a pure CLEAR-only operation list).
This will always be an op of type SWS_OP_READ.
Definition at line 696 of file ops.c.
Referenced by aarch64_compile(), compile(), compile_single(), ff_sws_op_list_is_noop(), ff_sws_solve_shuffle(), and get_input_size().
Returns the output operation for a given op list, or NULL if there is none.
This will always be an op of type SWS_OP_WRITE.
Definition at line 705 of file ops.c.
Referenced by aarch64_compile(), compile(), compile_single(), ff_sws_compile_pass(), ff_sws_op_list_is_noop(), and ff_sws_op_list_split_planes().
| void ff_sws_op_list_remove_at | ( | SwsOpList * | ops, |
| int | index, | ||
| int | count | ||
| ) |
Definition at line 714 of file ops.c.
Referenced by ff_sws_op_list_optimize(), and ff_sws_op_list_split_at().
Definition at line 725 of file ops.c.
Referenced by ff_sws_op_list_append(), ff_sws_op_list_optimize(), ff_sws_op_list_split_at(), and select_planes().
These will take over ownership of op and set it to {0}, even on failure.
Definition at line 739 of file ops.c.
Referenced by ff_sws_op_list_split_at().
| bool ff_sws_op_list_is_noop | ( | const SwsOpList * | ops | ) |
Returns whether an op list represents a true no-op operation, i.e.
may be eliminated entirely from an execution graph.
Note that this check is unlikely to ever be hit in practice, since it would imply the existence of planar formats with different plane orders between them, e.g. rgbap <-> gbrap, which doesn't currently exist. However, the check is cheap and lets me sleep at night.
Definition at line 744 of file ops.c.
Referenced by compile_subpass(), ff_sws_compile_pass(), and print_passes().
| int ff_sws_op_list_max_size | ( | const SwsOpList * | ops | ) |
Returns the size of the largest pixel type used in ops.
Definition at line 774 of file ops.c.
Referenced by aarch64_optimize(), compile(), and register_op().
| uint32_t ff_sws_linear_mask | ( | const SwsLinearOp * | c | ) |
Definition at line 785 of file ops.c.
Referenced by check_linear(), extract_swizzle(), and ff_sws_op_list_optimize().
|
static |
Definition at line 797 of file ops.c.
Referenced by ff_sws_op_list_print().
|
static |
Definition at line 815 of file ops.c.
Referenced by ff_sws_op_desc(), and print_q4().
|
static |
Definition at line 828 of file ops.c.
Referenced by ff_sws_op_desc(), and ff_sws_op_list_print().
| void ff_sws_op_desc | ( | AVBPrint * | bp, |
| const SwsOp * | op | ||
| ) |
Describe an operation in human-readable form.
Definition at line 849 of file ops.c.
Referenced by ff_sws_op_list_print().
|
static |
Definition at line 942 of file ops.c.
Referenced by ff_sws_op_list_print().
| void ff_sws_op_list_print | ( | void * | log, |
| int | lev, | ||
| int | lev_extra, | ||
| const SwsOpList * | ops | ||
| ) |
Print out the contents of an operation list.
Definition at line 956 of file ops.c.
Referenced by add_ops_convert_pass(), compile_backend(), compile_subpass(), ff_sws_compile_pass(), and print_ops().
|
static |
Definition at line 1009 of file ops.c.
Referenced by ff_sws_enum_op_lists().
| int ff_sws_enum_op_lists | ( | SwsContext * | ctx, |
| void * | opaque, | ||
| enum AVPixelFormat | src_fmt, | ||
| enum AVPixelFormat | dst_fmt, | ||
| int(*)(SwsContext *ctx, void *opaque, SwsOpList *ops) | cb | ||
| ) |
Helper function to enumerate over all possible (optimized) operation lists, under the current set of options in ctx, and run the given callback on each list.
| src_fmt | If set (not AV_PIX_FMT_NONE), constrain the source format |
| dst_fmt | If set (not AV_PIX_FMT_NONE), constrain the destination format |
ops belongs to ff_sws_enum_op_lists(), but may be mutated by cb. Definition at line 1054 of file ops.c.
Referenced by ff_sws_uops_macros_gen(), and main().
| const SwsOpBackend backend_c |
Copyright (C) 2025 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 193 of file uops_backend.c.
| const SwsOpBackend backend_murder |
Definition at line 144 of file ops_memcpy.c.
| const SwsOpBackend backend_aarch64 |
| const SwsOpBackend backend_x86 |
| const SwsOpBackend* const ff_sws_op_backends[] |
Definition at line 45 of file ops.c.
Referenced by check_ops(), and ff_sws_ops_compile().
|
static |
Definition at line 843 of file ops.c.
Referenced by ff_sws_op_desc().
1.8.17