diff mbox series

[FFmpeg-devel,v2,10/19] swscale/x86: use dedicated int for self-modifying MMX dstW

Message ID 20241014134354.180848-11-ffmpeg@haasn.xyz
State New
Headers show
Series swscale: major refactoring and new API | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Niklas Haas Oct. 14, 2024, 1:37 p.m. UTC
From: Niklas Haas <git@haasn.dev>

I want to pull options out of SwsInternal, so we need to make this field
a dedicated int that gets updated as appropriate in ff_swscale().

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
---
 libswscale/swscale.c          | 1 +
 libswscale/swscale_internal.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index c368c68fea..e0a9e0279f 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -488,6 +488,7 @@  int ff_swscale(SwsInternal *c, const uint8_t *const src[], const int srcStride[]
 
 #if HAVE_MMX_INLINE
         ff_updateMMXDitherTables(c, dstY);
+        c->dstW_mmx = c->dstW;
 #endif
         if (should_dither) {
             c->chrDither8 = ff_dither_8x8_128[chrDstY & 7];
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index bdcbfc8ffb..654d8de09d 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -352,6 +352,7 @@  struct SwsInternal {
     SwsFunc convert_unscaled;
     int srcW;                     ///< Width  of source      luma/alpha planes.
     int srcH;                     ///< Height of source      luma/alpha planes.
+    int dstW;                     ///< Width  of destination luma/alpha planes.
     int dstH;                     ///< Height of destination luma/alpha planes.
     int chrSrcW;                  ///< Width  of source      chroma     planes.
     int chrSrcH;                  ///< Height of source      chroma     planes.
@@ -541,7 +542,7 @@  struct SwsInternal {
     DECLARE_ALIGNED(8, uint64_t, vOffset);
     int32_t lumMmxFilter[4 * MAX_FILTER_SIZE];
     int32_t chrMmxFilter[4 * MAX_FILTER_SIZE];
-    int dstW;                     ///< Width  of destination luma/alpha planes.
+    int dstW_mmx;
     DECLARE_ALIGNED(8, uint64_t, esp);
     DECLARE_ALIGNED(8, uint64_t, vRounder);
     DECLARE_ALIGNED(8, uint64_t, u_temp);