swscale/ops: stop nuking output pad metadata on unused output pads

This cleanly separates the forwards and backwards passes - output pad
metadata is set if it *would* be valid, and whether or not it's needed is
tracked explicitly in `dep_out` instead of by resetting these components.

Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas authored and Niklas Haas committed 2026-10-20 21:33:01 +00:00
1 parent 7c15cb8b34
commit 791bf247f3
1 file changed
+4 -7
+4 -7
View File
@@ -615,6 +615,9 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
memcpy(prev, op->outputs, sizeof(prev));
}
#undef FORWARD
#undef RESET
/* Backwards pass, solves for output component dependencies */
SwsCompMask need_out[4] = {0};
@@ -622,11 +625,8 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
SwsOp *op = &ops->ops[n];
SwsCompMask need_in[4] = {0};
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 4; i++)
op->outputs[i].dep_out = need_out[i];
if (!need_out[i])
RESET(i);
}
switch (op->op) {
case SWS_OP_READ:
@@ -684,9 +684,6 @@ void ff_sws_op_list_update_comps(SwsOpList *ops)
memcpy(need_out, need_in, sizeof(need_in));
}
#undef FORWARD
#undef RESET
}
static void op_uninit(SwsOp *op)