This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 57ca4d2ae330e5acfd0486b01c1dc6c5f817ba6d Author: Ramiro Polla <[email protected]> AuthorDate: Wed Jun 17 17:04:14 2026 +0200 Commit: Ramiro Polla <[email protected]> CommitDate: Sun Jul 19 15:07:03 2026 +0200 swscale/aarch64/ops: use SwsClearUOp for SwsAArch64OpImplParams.clear This is one more step to eventually replace the parameter fields in SwsAArch64OpImplParams by generic structs from libswscale/uops.h. The function names and ordering in ops_entries.c is maintained to simplify the gradual move to uops.h. Sponsored-by: Sovereign Tech Fund Signed-off-by: Ramiro Polla <[email protected]> --- libswscale/aarch64/ops_asmgen.c | 12 ++---- libswscale/aarch64/ops_entries.c | 86 +++++++++++++++++++------------------- libswscale/aarch64/ops_impl.h | 8 +--- libswscale/aarch64/ops_impl_conv.c | 7 +--- libswscale/tests/sws_ops_aarch64.c | 28 ++++++++++--- 5 files changed, 73 insertions(+), 68 deletions(-) diff --git a/libswscale/aarch64/ops_asmgen.c b/libswscale/aarch64/ops_asmgen.c index 06f1a028a7..a0a660adb5 100644 --- a/libswscale/aarch64/ops_asmgen.c +++ b/libswscale/aarch64/ops_asmgen.c @@ -804,21 +804,17 @@ static void emit_clear(SwsAArch64Context *s, const SwsAArch64OpImplParams *p, { RasmContext *r = s->rctx; RasmOp clear_vec = s->vt[0]; - switch (MASK_GET(p->clear, i)) { - case 0: + if (p->clear.zero & SWS_COMP(i)) { i_movi(r, vx[i], IMM(0)); CMTF("%s[%u] = 0;", vx_str, i); - break; - case 1: + } else if (p->clear.one & SWS_COMP(i)) { if (p->block_size * ff_sws_pixel_type_size(p->type) == 8) { i_movi(r, v_8b (vx[i]), IMM(0xff)); } else { i_movi(r, v_16b(vx[i]), IMM(0xff)); } CMTF("%s[%u] = UINT_MAX;", vx_str, i); - break; - default: + } else { i_dup (r, vx[i], a64op_elem(clear_vec, i)); CMTF("%s[%u] = broadcast(clear_vec[%u]);", vx_str, i, i); - break; } } @@ -835,7 +831,7 @@ static void asmgen_op_clear(SwsAArch64Context *s, const SwsAArch64OpImplParams * bool load_priv = false; LOOP_MASK(p, i) { - if (MASK_GET(p->clear, i) == 0xf) + if (!((p->clear.zero | p->clear.one) & SWS_COMP(i))) load_priv = true; } if (load_priv) { diff --git a/libswscale/aarch64/ops_entries.c b/libswscale/aarch64/ops_entries.c index 66f9044c98..75f7261527 100644 --- a/libswscale/aarch64/ops_entries.c +++ b/libswscale/aarch64/ops_entries.c @@ -315,49 +315,49 @@ ENTRY(ff_sws_rshift_4_16_u16_0111_neon, { .uop = SWS_UOP_RSHIFT, .shift = { .amo ENTRY(ff_sws_rshift_6_8_u16_0001_neon, { .uop = SWS_UOP_RSHIFT, .shift = { .amount = 6 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0001 }) ENTRY(ff_sws_rshift_6_8_u16_0111_neon, { .uop = SWS_UOP_RSHIFT, .shift = { .amount = 6 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0111 }) ENTRY(ff_sws_rshift_6_16_u16_0111_neon, { .uop = SWS_UOP_RSHIFT, .shift = { .amount = 6 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0111 }) -ENTRY(ff_sws_clear_0fff_8_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1000 }) -ENTRY(ff_sws_clear_0fff_8_u8_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1011 }) -ENTRY(ff_sws_clear_0fff_8_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1000 }) -ENTRY(ff_sws_clear_0fff_8_u16_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1101 }) -ENTRY(ff_sws_clear_0fff_16_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x1000 }) -ENTRY(ff_sws_clear_0fff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x0fff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) -ENTRY(ff_sws_clear_1fff_8_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1000 }) -ENTRY(ff_sws_clear_1fff_8_u8_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1011 }) -ENTRY(ff_sws_clear_1fff_8_u8_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1101 }) -ENTRY(ff_sws_clear_1fff_8_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1000 }) -ENTRY(ff_sws_clear_1fff_16_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x1000 }) -ENTRY(ff_sws_clear_1fff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0x1fff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) -ENTRY(ff_sws_clear_ff1f_8_u8_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xff1f, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0010 }) -ENTRY(ff_sws_clear_ff1f_8_u16_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xff1f, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0010 }) -ENTRY(ff_sws_clear_ff1f_16_u8_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xff1f, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0010 }) -ENTRY(ff_sws_clear_ff1f_16_u16_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xff1f, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0010 }) -ENTRY(ff_sws_clear_fff0_8_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff0, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff0_16_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff0, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff1_8_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff1_8_u8_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1101 }) -ENTRY(ff_sws_clear_fff1_8_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff1_8_u16_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1101 }) -ENTRY(ff_sws_clear_fff1_16_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff1_16_u8_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0111 }) -ENTRY(ff_sws_clear_fff1_16_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0001 }) -ENTRY(ff_sws_clear_fff1_16_u16_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xfff1, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0111 }) -ENTRY(ff_sws_clear_ffff_8_u8_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0011 }) -ENTRY(ff_sws_clear_ffff_8_u8_0101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0101 }) -ENTRY(ff_sws_clear_ffff_8_u8_1100_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1100 }) -ENTRY(ff_sws_clear_ffff_8_u16_1100_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1100 }) -ENTRY(ff_sws_clear_ffff_8_u32_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0001 }) -ENTRY(ff_sws_clear_ffff_8_u32_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0010 }) -ENTRY(ff_sws_clear_ffff_8_u32_0101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0101 }) -ENTRY(ff_sws_clear_ffff_8_u32_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1000 }) -ENTRY(ff_sws_clear_ffff_8_u32_1010_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1010 }) -ENTRY(ff_sws_clear_ffff_8_u32_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1011 }) -ENTRY(ff_sws_clear_ffff_8_u32_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1101 }) -ENTRY(ff_sws_clear_ffff_16_u8_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0011 }) -ENTRY(ff_sws_clear_ffff_16_u8_0110_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0110 }) -ENTRY(ff_sws_clear_ffff_16_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0001 }) -ENTRY(ff_sws_clear_ffff_16_u16_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0011 }) -ENTRY(ff_sws_clear_ffff_16_u16_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0111 }) -ENTRY(ff_sws_clear_ffff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = 0xffff, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) +ENTRY(ff_sws_clear_0fff_8_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1000 }) +ENTRY(ff_sws_clear_0fff_8_u8_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1011 }) +ENTRY(ff_sws_clear_0fff_8_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1000 }) +ENTRY(ff_sws_clear_0fff_8_u16_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1101 }) +ENTRY(ff_sws_clear_0fff_16_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x1000 }) +ENTRY(ff_sws_clear_0fff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x8 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) +ENTRY(ff_sws_clear_1fff_8_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1000 }) +ENTRY(ff_sws_clear_1fff_8_u8_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1011 }) +ENTRY(ff_sws_clear_1fff_8_u8_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1101 }) +ENTRY(ff_sws_clear_1fff_8_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1000 }) +ENTRY(ff_sws_clear_1fff_16_u8_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x1000 }) +ENTRY(ff_sws_clear_1fff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x8, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) +ENTRY(ff_sws_clear_ff1f_8_u8_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x2, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0010 }) +ENTRY(ff_sws_clear_ff1f_8_u16_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x2, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0010 }) +ENTRY(ff_sws_clear_ff1f_16_u8_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x2, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0010 }) +ENTRY(ff_sws_clear_ff1f_16_u16_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x2, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0010 }) +ENTRY(ff_sws_clear_fff0_8_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x1 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff0_16_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x1 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff1_8_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff1_8_u8_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1101 }) +ENTRY(ff_sws_clear_fff1_8_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff1_8_u16_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1101 }) +ENTRY(ff_sws_clear_fff1_16_u8_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff1_16_u8_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0111 }) +ENTRY(ff_sws_clear_fff1_16_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0001 }) +ENTRY(ff_sws_clear_fff1_16_u16_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x1, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0111 }) +ENTRY(ff_sws_clear_ffff_8_u8_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0011 }) +ENTRY(ff_sws_clear_ffff_8_u8_0101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x0101 }) +ENTRY(ff_sws_clear_ffff_8_u8_1100_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U8, .mask = 0x1100 }) +ENTRY(ff_sws_clear_ffff_8_u16_1100_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U16, .mask = 0x1100 }) +ENTRY(ff_sws_clear_ffff_8_u32_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0001 }) +ENTRY(ff_sws_clear_ffff_8_u32_0010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0010 }) +ENTRY(ff_sws_clear_ffff_8_u32_0101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x0101 }) +ENTRY(ff_sws_clear_ffff_8_u32_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1000 }) +ENTRY(ff_sws_clear_ffff_8_u32_1010_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1010 }) +ENTRY(ff_sws_clear_ffff_8_u32_1011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1011 }) +ENTRY(ff_sws_clear_ffff_8_u32_1101_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 8, .type = SWS_PIXEL_U32, .mask = 0x1101 }) +ENTRY(ff_sws_clear_ffff_16_u8_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0011 }) +ENTRY(ff_sws_clear_ffff_16_u8_0110_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U8, .mask = 0x0110 }) +ENTRY(ff_sws_clear_ffff_16_u16_0001_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0001 }) +ENTRY(ff_sws_clear_ffff_16_u16_0011_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0011 }) +ENTRY(ff_sws_clear_ffff_16_u16_0111_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x0111 }) +ENTRY(ff_sws_clear_ffff_16_u16_1000_neon, { .uop = SWS_UOP_CLEAR, .clear = { .one = 0x0, .zero = 0x0 }, .block_size = 16, .type = SWS_PIXEL_U16, .mask = 0x1000 }) ENTRY(ff_sws_linear_000000000f_8_f32_0001_neon, { .uop = SWS_UOP_LINEAR, .linear.mask = 0x000000000fULL, .block_size = 8, .type = SWS_PIXEL_F32, .mask = 0x0001 }) ENTRY(ff_sws_linear_00000000fc_8_f32_0001_neon, { .uop = SWS_UOP_LINEAR, .linear.mask = 0x00000000fcULL, .block_size = 8, .type = SWS_PIXEL_F32, .mask = 0x0001 }) ENTRY(ff_sws_linear_00000000ff_8_f32_0001_neon, { .uop = SWS_UOP_LINEAR, .linear.mask = 0x00000000ffULL, .block_size = 8, .type = SWS_PIXEL_F32, .mask = 0x0001 }) diff --git a/libswscale/aarch64/ops_impl.h b/libswscale/aarch64/ops_impl.h index 3e3fa13b73..5b9046807c 100644 --- a/libswscale/aarch64/ops_impl.h +++ b/libswscale/aarch64/ops_impl.h @@ -30,12 +30,6 @@ /* Each nibble in the mask corresponds to one component. */ typedef uint16_t SwsAArch64OpMask; -/** - * Each nibble in the mask specifies whether to clear by all 0s (0), - * all 1s (1), or another value (f). - */ -typedef uint16_t SwsAArch64ClearMask; - /* Each byte is an LSB src|dst pair until 00 is reached. */ typedef uint64_t SwsAArch64MoveOp; #define AARCH64_MOVE_TMP 0xf @@ -70,7 +64,7 @@ typedef struct SwsAArch64OpImplParams { uint8_t block_size; union { SwsShiftUOp shift; - SwsAArch64ClearMask clear; + SwsClearUOp clear; SwsAArch64MoveOp move; SwsAArch64OpMask pack; SwsAArch64LinearOp linear; diff --git a/libswscale/aarch64/ops_impl_conv.c b/libswscale/aarch64/ops_impl_conv.c index 73b4a9dcb2..f3eb3e8535 100644 --- a/libswscale/aarch64/ops_impl_conv.c +++ b/libswscale/aarch64/ops_impl_conv.c @@ -264,22 +264,19 @@ static int convert_to_aarch64_impl(SwsContext *ctx, const SwsOpList *ops, int n, break; case SWS_UOP_CLEAR: out->mask = 0; - out->clear = 0; for (int i = 0; i < 4; i++) { - int mask_val = 0xf; if (op->clear.mask & SWS_COMP(i)) { MASK_SET(out->mask, i, 1); if (op->clear.value[i].num == 0) { - mask_val = 0; + out->clear.zero |= SWS_COMP(i); } else { uint32_t val = op->clear.value[i].num / op->clear.value[i].den; if ((op->type == SWS_PIXEL_U8 && val == UINT8_MAX) || (op->type == SWS_PIXEL_U16 && val == UINT16_MAX) || (op->type == SWS_PIXEL_U32 && val == UINT32_MAX)) - mask_val = 1; + out->clear.one |= SWS_COMP(i); } } - MASK_SET(out->clear, i, mask_val); } break; case SWS_UOP_LINEAR: diff --git a/libswscale/tests/sws_ops_aarch64.c b/libswscale/tests/sws_ops_aarch64.c index 10034016bb..03166b673c 100644 --- a/libswscale/tests/sws_ops_aarch64.c +++ b/libswscale/tests/sws_ops_aarch64.c @@ -38,6 +38,21 @@ #endif /*********************************************************************/ +static uint16_t clear_to_mask(const SwsClearUOp *clear) +{ + uint16_t mask = 0; + for (int i = 0; i < 4; i++) { + if (clear->zero & SWS_COMP(i)) { + /* no-op */ + } else if (clear->one & SWS_COMP(i)) { + MASK_SET(mask, i, 1); + } else { + MASK_SET(mask, i, 0xf); + } + } + return mask; +} + static int aarch64_op_impl_cmp(const void *a, const void *b) { const SwsAArch64OpImplParams *pa = (const SwsAArch64OpImplParams *) a; @@ -62,10 +77,13 @@ static int aarch64_op_impl_cmp(const void *a, const void *b) if (pa->shift.amount != pb->shift.amount) return (int) pa->shift.amount - pb->shift.amount; break; - case SWS_UOP_CLEAR: - if (pa->clear != pb->clear) - return (int) pa->clear - pb->clear; + case SWS_UOP_CLEAR: { + uint16_t ia = clear_to_mask(&pa->clear); + uint16_t ib = clear_to_mask(&pb->clear); + if (ia != ib) + return (int) ia - ib; break; + } case SWS_UOP_LINEAR: case SWS_UOP_LINEAR_FMA: if (pa->linear.mask != pb->linear.mask) @@ -238,7 +256,7 @@ static void impl_func_name(AVBPrint *bp, const SwsAArch64OpImplParams *params) av_bprintf(bp, "_%u", params->shift.amount); break; case SWS_UOP_CLEAR: - av_bprintf(bp, "_%04x", params->clear); + av_bprintf(bp, "_%04x", clear_to_mask(¶ms->clear)); break; case SWS_UOP_LINEAR: case SWS_UOP_LINEAR_FMA: @@ -308,7 +326,7 @@ static void serialize_op(AVBPrint *bp, const SwsAArch64OpImplParams *params) av_bprintf(bp, ", .shift = { .amount = %u }", params->shift.amount); break; case SWS_UOP_CLEAR: - av_bprintf(bp, ", .clear = 0x%04x", params->clear); + av_bprintf(bp, ", .clear = { .one = 0x%0x, .zero = 0x%0x }", params->clear.one, params->clear.zero); break; case SWS_UOP_LINEAR: case SWS_UOP_LINEAR_FMA: _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
