swscale/ops_backend: simplify SWS_OP_CLEAR declarations

Mark the components to be cleared, not the components to be preserved.

Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-03-31 16:21:33 +02:00
parent 7a71a01a1b
commit 08707934cc
3 changed files with 29 additions and 29 deletions

View File

@@ -65,13 +65,13 @@ DECL_PATTERN(clear)
{
SWS_LOOP
for (int i = 0; i < SWS_BLOCK_SIZE; i++) {
if (!X)
if (X)
x[i] = impl->priv.px[0];
if (!Y)
if (Y)
y[i] = impl->priv.px[1];
if (!Z)
if (Z)
z[i] = impl->priv.px[2];
if (!W)
if (W)
w[i] = impl->priv.px[3];
}
@@ -84,22 +84,22 @@ DECL_IMPL(clear, clear##_##X##Y##Z##W, X, Y, Z, W)
DECL_ENTRY(clear##_##X##Y##Z##W, SWS_COMP_ALL, \
.setup = ff_sws_setup_clear, \
.op = SWS_OP_CLEAR, \
.clear.mask = SWS_COMP_MASK(!X, !Y, !Z, !W), \
.clear.mask = SWS_COMP_MASK(X, Y, Z, W), \
);
WRAP_CLEAR(1, 1, 1, 0) /* rgba alpha */
WRAP_CLEAR(0, 1, 1, 1) /* argb alpha */
WRAP_CLEAR(1, 0, 1, 1) /* ya alpha */
WRAP_CLEAR(0, 0, 0, 1) /* rgba alpha */
WRAP_CLEAR(1, 0, 0, 0) /* argb alpha */
WRAP_CLEAR(0, 1, 0, 0) /* ya alpha */
WRAP_CLEAR(0, 0, 1, 1) /* vuya chroma */
WRAP_CLEAR(1, 0, 0, 1) /* yuva chroma */
WRAP_CLEAR(1, 1, 0, 0) /* ayuv chroma */
WRAP_CLEAR(0, 1, 0, 1) /* uyva chroma */
WRAP_CLEAR(1, 0, 1, 0) /* xvyu chroma */
WRAP_CLEAR(1, 1, 0, 0) /* vuya chroma */
WRAP_CLEAR(0, 1, 1, 0) /* yuva chroma */
WRAP_CLEAR(0, 0, 1, 1) /* ayuv chroma */
WRAP_CLEAR(1, 0, 1, 0) /* uyva chroma */
WRAP_CLEAR(0, 1, 0, 1) /* xvyu chroma */
WRAP_CLEAR(1, 0, 0, 0) /* gray -> yuva */
WRAP_CLEAR(0, 1, 0, 0) /* gray -> ayuv */
WRAP_CLEAR(0, 0, 1, 0) /* gray -> vuya */
WRAP_CLEAR(0, 1, 1, 1) /* gray -> yuva */
WRAP_CLEAR(1, 0, 1, 1) /* gray -> ayuv */
WRAP_CLEAR(1, 1, 0, 1) /* gray -> vuya */
DECL_PATTERN(min)
{

View File

@@ -218,7 +218,7 @@ static const SwsOpTable fn(op_table_float) = {
REF_COMMON_PATTERNS(convert_uint16),
REF_COMMON_PATTERNS(convert_uint32),
&fn(op_clear_1110),
&fn(op_clear_0001),
REF_COMMON_PATTERNS(min),
REF_COMMON_PATTERNS(max),
REF_COMMON_PATTERNS(scale),
@@ -233,9 +233,9 @@ static const SwsOpTable fn(op_table_float) = {
&fn(op_dither7),
&fn(op_dither8),
&fn(op_clear_1110),
&fn(op_clear_0111),
&fn(op_clear_0011),
&fn(op_clear_0001),
&fn(op_clear_1000),
&fn(op_clear_1100),
&fn(op_linear_luma),
&fn(op_linear_alpha),

View File

@@ -554,17 +554,17 @@ static const SwsOpTable fn(op_table_int) = {
REF_COMMON_PATTERNS(scale),
REF_COMMON_PATTERNS(convert_float),
&fn(op_clear_1110),
&fn(op_clear_0111),
&fn(op_clear_0011),
&fn(op_clear_1011),
&fn(op_clear_1001),
&fn(op_clear_1100),
&fn(op_clear_0101),
&fn(op_clear_1010),
&fn(op_clear_0001),
&fn(op_clear_1000),
&fn(op_clear_1100),
&fn(op_clear_0100),
&fn(op_clear_0010),
&fn(op_clear_0110),
&fn(op_clear_0011),
&fn(op_clear_1010),
&fn(op_clear_0101),
&fn(op_clear_0111),
&fn(op_clear_1011),
&fn(op_clear_1101),
&fn(op_swizzle_3012),
&fn(op_swizzle_3021),