This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit dcfe3d3b904076afeb9aedb5387ea6b758bd160f Author: Niklas Haas <[email protected]> AuthorDate: Sun May 17 13:08:00 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Tue Jun 9 01:10:49 2026 +0200 Revert "swscale/tests/sws_ops: add option for summarizing all operation patterns" This reverts commit f76aa4e4087569f99af1b4d87c04f160fb2378ce. This is no longer needed once we switch to uops_macros.h, which will do the same thing except better. --- libswscale/tests/sws_ops.c | 107 +++++---------------------------------------- 1 file changed, 11 insertions(+), 96 deletions(-) diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c index ab9d99907b..bc353df8cb 100644 --- a/libswscale/tests/sws_ops.c +++ b/libswscale/tests/sws_ops.c @@ -18,11 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/avassert.h" -#include "libavutil/avstring.h" -#include "libavutil/mem.h" #include "libavutil/pixdesc.h" -#include "libavutil/tree.h" #include "libswscale/ops.h" #include "libswscale/ops_dispatch.h" #include "libswscale/format.h" @@ -87,73 +83,6 @@ static int print_passes(SwsContext *ctx, void *graph, SwsOpList *ops) pass_idx = 0; return ff_sws_compile_pass(graph, &backend_print, ©, 0, NULL, NULL); } - -static int cmp_str(const void *a, const void *b) -{ - return strcmp(a, b); -} - -static int register_op(SwsContext *ctx, void *opaque, SwsOp *op) -{ - struct AVTreeNode **root = opaque; - AVBPrint bp; - char *desc; - - /* Strip irrelevant constant data from some operations */ - switch (op->op) { - case SWS_OP_LINEAR: - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 5; j++) - op->lin.m[i][j] = (AVRational) { 0, 1 }; - } - break; - case SWS_OP_SCALE: - op->scale.factor = (AVRational) { 0, 1 }; - break; - case SWS_OP_MIN: - case SWS_OP_MAX: - for (int i = 0; i < 4; i++) - op->clamp.limit[i] = (AVRational) { 0, 1 }; - break; - case SWS_OP_CLEAR: - for (int i = 0; i < 4; i++) - op->clear.value[i] = (AVRational) { 0, SWS_COMP_TEST(op->clear.mask, i) }; - break; - case SWS_OP_DITHER: - /* Strip arbitrary offset */ - for (int i = 0; i < 4; i++) - op->dither.y_offset[i] = op->dither.y_offset[i] >= 0 ? 0 : -1; - break; - } - - av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); - ff_sws_op_desc(&bp, op); - int ret = av_bprint_finalize(&bp, &desc); - if (ret < 0) - return ret; - - struct AVTreeNode *node = av_tree_node_alloc(); - if (!node) { - av_free(desc); - return AVERROR(ENOMEM); - } - - av_tree_insert(root, desc, cmp_str, &node); - if (node) { - av_free(node); - av_free(desc); - } - return ret; -} - -static int print_and_free_summary(void *opaque, void *key) -{ - char *desc = key; - av_log(opaque, AV_LOG_INFO, "%s\n", desc); - av_free(desc); - return 0; -} - static void log_stdout(void *avcl, int level, const char *fmt, va_list vl) { if (level != AV_LOG_INFO) { @@ -167,7 +96,6 @@ int main(int argc, char **argv) { enum AVPixelFormat src_fmt = AV_PIX_FMT_NONE; enum AVPixelFormat dst_fmt = AV_PIX_FMT_NONE; - bool summarize = false; int ret = 1; #ifdef _WIN32 @@ -186,8 +114,6 @@ int main(int argc, char **argv) " Only test the specified source pixel format\n" " -v <level>\n" " Enable log verbosity at given level\n" - " -summarize\n" - " Summarize operation types, instead of printing op lists\n" ); return 0; } @@ -214,8 +140,6 @@ int main(int argc, char **argv) goto bad_option; av_log_set_level(atoi(argv[i + 1])); i++; - } else if (!strcmp(argv[i], "-summarize")) { - summarize = true; } else { bad_option: fprintf(stderr, "bad option or argument missing (%s) see -help\n", argv[i]); @@ -230,27 +154,18 @@ bad_option: av_log_set_callback(log_stdout); - if (summarize) { - struct AVTreeNode *root = NULL; - ret = ff_sws_enum_ops(ctx, &root, src_fmt, dst_fmt, register_op); - if (ret < 0) - goto fail; - av_tree_enumerate(root, NULL, NULL, print_and_free_summary); - av_tree_destroy(root); - } else { - /* Allocate dummy graph and context for ff_sws_compile_pass() */ - SwsGraph *graph = ff_sws_graph_alloc(); - if (!graph) { - ret = AVERROR(ENOMEM); - goto fail; - } - graph->ctx = ctx; - - ret = ff_sws_enum_op_lists(ctx, graph, src_fmt, dst_fmt, print_passes); - ff_sws_graph_free(&graph); - if (ret < 0) - goto fail; + /* Allocate dummy graph and context for ff_sws_compile_pass() */ + SwsGraph *graph = ff_sws_graph_alloc(); + if (!graph) { + ret = AVERROR(ENOMEM); + goto fail; } + graph->ctx = ctx; + + ret = ff_sws_enum_op_lists(ctx, graph, src_fmt, dst_fmt, print_passes); + ff_sws_graph_free(&graph); + if (ret < 0) + goto fail; ret = 0; fail: _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
