swscale/ops_memcpy: move early-skip block before unrelated variable declarations

This will let us rework and merge the memset/memcpy blocks.
This commit is contained in:
Ramiro Polla committed 2026-11-05 19:43:24 +00:00
1 parent f2274f8316
commit f5fd844e9b
1 file changed
+6 -3
+6 -3
View File
@@ -51,6 +51,12 @@ static void process_memcpy(const SwsOpExec *exec, const void *priv,
const int idx = p->index[i];
const uint8_t *in = (idx >= 0) ? exec->in[idx] : NULL;
const ptrdiff_t in_stride = (idx >= 0) ? exec->in_stride[idx] : 0;
if (out == in) {
av_assert1(out_stride == in_stride);
continue; /* plane was already ref'd */
}
const int bytes = x_end * exec->block_size_out[i];
const int use_loop = out_stride < 0 ||
out_stride > bytes + SWS_MAX_PADDING;
@@ -62,9 +68,6 @@ static void process_memcpy(const SwsOpExec *exec, const void *priv,
memset(out, p->clear_value[i], bytes);
out += out_stride;
}
} else if (out == in) {
av_assert1(out_stride == in_stride);
continue; /* plane was already ref'd */
} else if (out_stride == in_stride && !use_loop) {
memcpy(out, in, span);
} else {