[ffmpeg] branch master updated (145f6e5878 -> c9977acbc6)
This is an automated email from the git hooks/post-receive script. Git pushed a change to branch master in repository ffmpeg. from 145f6e5878 avcodec/cbs_h2645: split into separate files per module new c7c8c31302 swscale/tests/sws_ops: print range values in the output new 9fbb03f428 swscale/tests/sws_ops: don't print unused components in the output new c9977acbc6 swscale/ops: clear range values SWS_OP_{MIN,MAX} The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: libswscale/graph.c | 4 ++-- libswscale/ops.c | 56 +++++++++++++++++++++++++++++++++------------ libswscale/ops.h | 3 ++- libswscale/tests/sws_ops.c | 2 +- tests/ref/fate/sws-ops-list | 2 +- 5 files changed, 47 insertions(+), 20 deletions(-)
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit c7c8c313025157c1123adac6762b28f3ccd5c96b Author: Ramiro Polla <ramiro.polla@gmail.com> AuthorDate: Thu Feb 19 22:54:32 2026 +0100 Commit: Ramiro Polla <ramiro.polla@gmail.com> CommitDate: Tue Feb 24 19:27:51 2026 +0100 swscale/tests/sws_ops: print range values in the output This gives more information about each operation and helps catch issues earlier on. Sponsored-by: Sovereign Tech Fund Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com> --- libswscale/graph.c | 4 ++-- libswscale/ops.c | 9 +++++---- libswscale/ops.h | 3 ++- libswscale/tests/sws_ops.c | 2 +- tests/ref/fate/sws-ops-list | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libswscale/graph.c b/libswscale/graph.c index 0829022bc4..e6843a7752 100644 --- a/libswscale/graph.c +++ b/libswscale/graph.c @@ -575,10 +575,10 @@ static int add_convert_pass(SwsGraph *graph, SwsFormat src, SwsFormat dst, av_get_pix_fmt_name(src.format), av_get_pix_fmt_name(dst.format)); av_log(ctx, AV_LOG_DEBUG, "Unoptimized operation list:\n"); - ff_sws_op_list_print(ctx, AV_LOG_DEBUG, ops); + ff_sws_op_list_print(ctx, AV_LOG_DEBUG, AV_LOG_TRACE, ops); av_log(ctx, AV_LOG_DEBUG, "Optimized operation list:\n"); ff_sws_op_list_optimize(ops); - ff_sws_op_list_print(ctx, AV_LOG_VERBOSE, ops); + ff_sws_op_list_print(ctx, AV_LOG_VERBOSE, AV_LOG_TRACE, ops); ret = ff_sws_compile_pass(graph, ops, 0, dst, input, output); if (ret < 0) diff --git a/libswscale/ops.c b/libswscale/ops.c index 900077584a..e7dfface03 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -689,7 +689,8 @@ static const char *print_q(const AVRational q, char buf[], int buf_len) #define PRINTQ(q) print_q(q, (char[32]){0}, sizeof(char[32])) -void ff_sws_op_list_print(void *log, int lev, const SwsOpList *ops) +void ff_sws_op_list_print(void *log, int lev, int lev_extra, + const SwsOpList *ops) { if (!ops->num_ops) { av_log(log, lev, " (empty)\n"); @@ -804,7 +805,7 @@ void ff_sws_op_list_print(void *log, int lev, const SwsOpList *ops) op->comps.max[0].den || op->comps.max[1].den || op->comps.max[2].den || op->comps.max[3].den) { - av_log(log, AV_LOG_TRACE, " min: {%s, %s, %s, %s}, max: {%s, %s, %s, %s}\n", + av_log(log, lev_extra, " min: {%s, %s, %s, %s}, max: {%s, %s, %s, %s}\n", PRINTQ(op->comps.min[0]), PRINTQ(op->comps.min[1]), PRINTQ(op->comps.min[2]), PRINTQ(op->comps.min[3]), PRINTQ(op->comps.max[0]), PRINTQ(op->comps.max[1]), @@ -841,7 +842,7 @@ int ff_sws_ops_compile_backend(SwsContext *ctx, const SwsOpBackend *backend, backend->name, av_err2str(ret)); if (rest.num_ops != ops->num_ops) { av_log(ctx, msg_lev, "Uncompiled remainder:\n"); - ff_sws_op_list_print(ctx, msg_lev, &rest); + ff_sws_op_list_print(ctx, msg_lev, AV_LOG_TRACE, &rest); } } else { *out = compiled; @@ -866,7 +867,7 @@ int ff_sws_ops_compile(SwsContext *ctx, const SwsOpList *ops, SwsCompiledOp *out } av_log(ctx, AV_LOG_WARNING, "No backend found for operations:\n"); - ff_sws_op_list_print(ctx, AV_LOG_WARNING, ops); + ff_sws_op_list_print(ctx, AV_LOG_WARNING, AV_LOG_TRACE, ops); return AVERROR(ENOTSUP); } diff --git a/libswscale/ops.h b/libswscale/ops.h index 9f93c12fa8..7b79fdc69d 100644 --- a/libswscale/ops.h +++ b/libswscale/ops.h @@ -271,7 +271,8 @@ void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count); /** * Print out the contents of an operation list. */ -void ff_sws_op_list_print(void *log_ctx, int log_level, const SwsOpList *ops); +void ff_sws_op_list_print(void *log_ctx, int log_level, int log_level_extra, + const SwsOpList *ops); /** * Infer + propagate known information about components. Called automatically diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c index bf84128291..a558c07119 100644 --- a/libswscale/tests/sws_ops.c +++ b/libswscale/tests/sws_ops.c @@ -60,7 +60,7 @@ static int run_test(SwsContext *const ctx, AVFrame *frame, if (ff_sws_op_list_is_noop(ops)) av_log(NULL, AV_LOG_INFO, " (no-op)\n"); else - ff_sws_op_list_print(NULL, AV_LOG_INFO, ops); + ff_sws_op_list_print(NULL, AV_LOG_INFO, AV_LOG_INFO, ops); fail: /* silently skip unsupported formats */ diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list index af3cf2f4e9..aa97811bbe 100644 --- a/tests/ref/fate/sws-ops-list +++ b/tests/ref/fate/sws-ops-list @@ -1 +1 @@ -3505d38dc669faf6f14036516b6caf61 +2cf9d8a755726bc80f60ca9f4dc31380
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit 9fbb03f4284be528037a98b11ef238e2739bda69 Author: Ramiro Polla <ramiro.polla@gmail.com> AuthorDate: Tue Feb 24 20:16:29 2026 +0100 Commit: Ramiro Polla <ramiro.polla@gmail.com> CommitDate: Tue Feb 24 20:22:12 2026 +0100 swscale/tests/sws_ops: don't print unused components in the output Clean up the output by not printing the flags and range values of unused components in ff_sws_op_list_print(). rgb24 -> gray16le: [ u8 XXXX -> +++X] SWS_OP_READ : 3 elem(s) packed >> 0 - min: {0, 0, 0, nan}, max: {255, 255, 255, nan} + min: {0, 0, 0, _}, max: {255, 255, 255, _} [ u8 ...X -> +++X] SWS_OP_CONVERT : u8 -> f32 - min: {0, 0, 0, nan}, max: {255, 255, 255, nan} - [f32 ...X -> .++X] SWS_OP_LINEAR : dot3 [[76.843000 150.859000 29.298000 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0]] - min: {0, 0, 0, nan}, max: {65535, 255, 255, nan} - [f32 .XXX -> +++X] SWS_OP_CONVERT : f32 -> u16 - min: {0, 0, 0, nan}, max: {65535, 255, 255, nan} - [u16 .XXX -> +++X] SWS_OP_WRITE : 1 elem(s) planar >> 0 - min: {0, 0, 0, nan}, max: {65535, 255, 255, nan} + min: {0, 0, 0, _}, max: {255, 255, 255, _} + [f32 ...X -> .XXX] SWS_OP_LINEAR : dot3 [[76.843000 150.859000 29.298000 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0]] + min: {0, _, _, _}, max: {65535, _, _, _} + [f32 .XXX -> +XXX] SWS_OP_CONVERT : f32 -> u16 + min: {0, _, _, _}, max: {65535, _, _, _} + [u16 .XXX -> +XXX] SWS_OP_WRITE : 1 elem(s) planar >> 0 + min: {0, _, _, _}, max: {65535, _, _, _} (X = unused, z = byteswapped, + = exact, 0 = zero) Sponsored-by: Sovereign Tech Fund Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com> --- libswscale/ops.c | 21 +++++++++++++-------- tests/ref/fate/sws-ops-list | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/libswscale/ops.c b/libswscale/ops.c index e7dfface03..f6fccd0688 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -699,6 +699,7 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra, for (int i = 0; i < ops->num_ops; i++) { const SwsOp *op = &ops->ops[i]; + const SwsOp *next = i + 1 < ops->num_ops ? &ops->ops[i + 1] : op; char buf[32]; av_log(log, lev, " [%3s %c%c%c%c -> %c%c%c%c] ", @@ -707,10 +708,10 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra, op->comps.unused[1] ? 'X' : '.', op->comps.unused[2] ? 'X' : '.', op->comps.unused[3] ? 'X' : '.', - describe_comp_flags(op->comps.flags[0]), - describe_comp_flags(op->comps.flags[1]), - describe_comp_flags(op->comps.flags[2]), - describe_comp_flags(op->comps.flags[3])); + next->comps.unused[0] ? 'X' : describe_comp_flags(op->comps.flags[0]), + next->comps.unused[1] ? 'X' : describe_comp_flags(op->comps.flags[1]), + next->comps.unused[2] ? 'X' : describe_comp_flags(op->comps.flags[2]), + next->comps.unused[3] ? 'X' : describe_comp_flags(op->comps.flags[3])); switch (op->op) { case SWS_OP_INVALID: @@ -806,10 +807,14 @@ void ff_sws_op_list_print(void *log, int lev, int lev_extra, op->comps.max[2].den || op->comps.max[3].den) { av_log(log, lev_extra, " min: {%s, %s, %s, %s}, max: {%s, %s, %s, %s}\n", - PRINTQ(op->comps.min[0]), PRINTQ(op->comps.min[1]), - PRINTQ(op->comps.min[2]), PRINTQ(op->comps.min[3]), - PRINTQ(op->comps.max[0]), PRINTQ(op->comps.max[1]), - PRINTQ(op->comps.max[2]), PRINTQ(op->comps.max[3])); + next->comps.unused[0] ? "_" : PRINTQ(op->comps.min[0]), + next->comps.unused[1] ? "_" : PRINTQ(op->comps.min[1]), + next->comps.unused[2] ? "_" : PRINTQ(op->comps.min[2]), + next->comps.unused[3] ? "_" : PRINTQ(op->comps.min[3]), + next->comps.unused[0] ? "_" : PRINTQ(op->comps.max[0]), + next->comps.unused[1] ? "_" : PRINTQ(op->comps.max[1]), + next->comps.unused[2] ? "_" : PRINTQ(op->comps.max[2]), + next->comps.unused[3] ? "_" : PRINTQ(op->comps.max[3])); } } diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list index aa97811bbe..5233a822e9 100644 --- a/tests/ref/fate/sws-ops-list +++ b/tests/ref/fate/sws-ops-list @@ -1 +1 @@ -2cf9d8a755726bc80f60ca9f4dc31380 +7feeffb2210933bab6f7dcd6641014cf
This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg. commit c9977acbc6b49cb6b1eef5601e1e1608c23b14e6 Author: Ramiro Polla <ramiro.polla@gmail.com> AuthorDate: Thu Feb 19 23:20:08 2026 +0100 Commit: Ramiro Polla <ramiro.polla@gmail.com> CommitDate: Tue Feb 24 20:25:59 2026 +0100 swscale/ops: clear range values SWS_OP_{MIN,MAX} This gives partial range values on conversions with floats, after the values have been clamped. gbrpf32be -> rgb8: [f32 XXXX -> zzzX] SWS_OP_READ : 3 elem(s) planar >> 0 [f32 ...X -> ...X] SWS_OP_SWAP_BYTES [f32 ...X -> ...X] SWS_OP_SWIZZLE : 2013 [f32 ...X -> ...X] SWS_OP_LINEAR : diag3 [[7 0 0 0 0] [0 7 0 0 0] [0 0 3 0 0] [0 0 0 1 0]] [f32 ...X -> ...X] SWS_OP_DITHER : 16x16 matrix + {0 3 2 5} [f32 ...X -> ...X] SWS_OP_MAX : {0 0 0 0} <= x + min: {0, 0, 0, _}, max: {nan, nan, nan, _} [f32 ...X -> ...X] SWS_OP_MIN : x <= {7 7 3 _} + min: {0, 0, 0, _}, max: {7, 7, 3, _} [f32 ...X -> +++X] SWS_OP_CONVERT : f32 -> u8 + min: {0, 0, 0, _}, max: {7, 7, 3, _} [ u8 ...X -> +XXX] SWS_OP_PACK : {3 3 2 0} - min: {0, _, _, _}, max: {0, _, _, _} + min: {0, _, _, _}, max: {255, _, _, _} [ u8 .XXX -> +XXX] SWS_OP_WRITE : 1 elem(s) packed >> 0 - min: {0, _, _, _}, max: {0, _, _, _} + min: {0, _, _, _}, max: {255, _, _, _} (X = unused, z = byteswapped, + = exact, 0 = zero) Sponsored-by: Sovereign Tech Fund Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com> --- libswscale/ops.c | 26 +++++++++++++++++++++++--- tests/ref/fate/sws-ops-list | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/libswscale/ops.c b/libswscale/ops.c index f6fccd0688..2889e95d12 100644 --- a/libswscale/ops.c +++ b/libswscale/ops.c @@ -221,6 +221,22 @@ static unsigned merge_comp_flags(unsigned a, unsigned b) return ((a & b) & flags_and) | ((a | b) & flags_or); } +/* Linearly propagate flags per component */ +static void propagate_flags(SwsOp *op, const SwsComps *prev) +{ + for (int i = 0; i < 4; i++) + op->comps.flags[i] = prev->flags[i]; +} + +/* Clear undefined values in dst with src */ +static void clear_undefined_values(AVRational dst[4], const AVRational src[4]) +{ + for (int i = 0; i < 4; i++) { + if (dst[i].den == 0) + dst[i] = src[i]; + } +} + /* Infer + propagate known information about components */ void ff_sws_op_list_update_comps(SwsOpList *ops) { @@ -276,11 +292,15 @@ void ff_sws_op_list_update_comps(SwsOpList *ops) /* fall through */ case SWS_OP_LSHIFT: case SWS_OP_RSHIFT: + propagate_flags(op, &prev); + break; case SWS_OP_MIN: + propagate_flags(op, &prev); + clear_undefined_values(op->comps.max, op->c.q4); + break; case SWS_OP_MAX: - /* Linearly propagate flags per component */ - for (int i = 0; i < 4; i++) - op->comps.flags[i] = prev.flags[i]; + propagate_flags(op, &prev); + clear_undefined_values(op->comps.min, op->c.q4); break; case SWS_OP_DITHER: /* Strip zero flag because of the nonzero dithering offset */ diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list index 5233a822e9..9f85a106ed 100644 --- a/tests/ref/fate/sws-ops-list +++ b/tests/ref/fate/sws-ops-list @@ -1 +1 @@ -7feeffb2210933bab6f7dcd6641014cf +86c2335d1adad97dda299cbc6234ac57
participants (2)
-
ffmpeg-git -
Ramiro Polla