This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 1dae8f89b2 swscale/uops: generate more specific masks for unpack when
translating
1dae8f89b2 is described below
commit 1dae8f89b24ff23565be29b689c061a2d499bbeb
Author: Ramiro Polla <[email protected]>
AuthorDate: Fri Jun 12 02:41:09 2026 +0200
Commit: Ramiro Polla <[email protected]>
CommitDate: Thu Jul 16 08:46:11 2026 +0000
swscale/uops: generate more specific masks for unpack when translating
Unused components weren't being taken into consideration.
---
libswscale/uops.c | 3 ++-
libswscale/uops_macros.h | 12 ++++++++----
tests/ref/fate/sws-ops-list | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/libswscale/uops.c b/libswscale/uops.c
index c25da89957..da1757b499 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -593,7 +593,8 @@ static int translate_op(SwsContext *ctx, SwsUOpList *uops,
SwsUOpFlags flags,
uop.mask = 0;
for (int i = 0; i < 4 && op->pack.pattern[i]; i++) {
uop.par.pack.pattern[i] = op->pack.pattern[i];
- uop.mask |= SWS_COMP(i);
+ if (op->op == SWS_OP_PACK || SWS_OP_NEEDED(op, i))
+ uop.mask |= SWS_COMP(i);
}
break;
case SWS_OP_LSHIFT:
diff --git a/libswscale/uops_macros.h b/libswscale/uops_macros.h
index 6359a7c376..fc96df9ef4 100644
--- a/libswscale/uops_macros.h
+++ b/libswscale/uops_macros.h
@@ -752,11 +752,15 @@
#define SWS_FOR_U32_MAX(MACRO, ...)
#define SWS_FOR_STRUCT_U32_MAX(MACRO, ...)
#define SWS_FOR_U32_UNPACK(MACRO, ...) \
- MACRO(__VA_ARGS__, u32_unpack_xyzw_2aaa ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0xf, 2, 10, 10, 10) \
- MACRO(__VA_ARGS__, u32_unpack_xyzw_aaa2 ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0xf, 10, 10, 10, 2)
+ MACRO(__VA_ARGS__, u32_unpack_y_aaa2 ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0x2, 10, 10, 10, 2) \
+ MACRO(__VA_ARGS__, u32_unpack_z_2aaa ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0x4, 2, 10, 10, 10) \
+ MACRO(__VA_ARGS__, u32_unpack_xyz_aaa2 ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0x7, 10, 10, 10, 2) \
+ MACRO(__VA_ARGS__, u32_unpack_yzw_2aaa ,
SWS_PIXEL_U32, SWS_UOP_UNPACK , 0xe, 2, 10, 10, 10)
#define SWS_FOR_STRUCT_U32_UNPACK(MACRO, ...) \
- MACRO(__VA_ARGS__, u32_unpack_xyzw_2aaa , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0xf, .par.pack.pattern
= {2, 10, 10, 10}) \
- MACRO(__VA_ARGS__, u32_unpack_xyzw_aaa2 , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0xf, .par.pack.pattern
= {10, 10, 10, 2})
+ MACRO(__VA_ARGS__, u32_unpack_y_aaa2 , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0x2, .par.pack.pattern
= {10, 10, 10, 2}) \
+ MACRO(__VA_ARGS__, u32_unpack_z_2aaa , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0x4, .par.pack.pattern
= {2, 10, 10, 10}) \
+ MACRO(__VA_ARGS__, u32_unpack_xyz_aaa2 , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0x7, .par.pack.pattern
= {10, 10, 10, 2}) \
+ MACRO(__VA_ARGS__, u32_unpack_yzw_2aaa , .type =
SWS_PIXEL_U32, .uop = SWS_UOP_UNPACK , .mask = 0xe, .par.pack.pattern
= {2, 10, 10, 10})
#define SWS_FOR_U32_PACK(MACRO, ...) \
MACRO(__VA_ARGS__, u32_pack_xyzw_2aaa ,
SWS_PIXEL_U32, SWS_UOP_PACK , 0xf, 2, 10, 10, 10) \
MACRO(__VA_ARGS__, u32_pack_xyzw_aaa2 ,
SWS_PIXEL_U32, SWS_UOP_PACK , 0xf, 10, 10, 10, 2)
diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list
index 09fbccd2a7..0fb88d65da 100644
--- a/tests/ref/fate/sws-ops-list
+++ b/tests/ref/fate/sws-ops-list
@@ -1 +1 @@
-8333b0aad3a2234c999febc709128779
+3a8f3bccd7c1f8407ee7c40fd26d86cc
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]