diff mbox series

[FFmpeg-devel,1/3] swscale/x86/swscale: Process yuv2yuvX tails using next largest register size

Message ID 20230714100821.473905-1-alankelly@google.com
State New
Headers show
Series [FFmpeg-devel,1/3] swscale/x86/swscale: Process yuv2yuvX tails using next largest register size | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Alan Kelly July 14, 2023, 10:08 a.m. UTC
---
 libswscale/x86/swscale.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alan Kelly Sept. 4, 2023, 12:30 p.m. UTC | #1
Hi,

Any issues with this patch or can it be merged?

Thanks,

Alan

On Fri, Jul 14, 2023 at 12:08 PM Alan Kelly <alankelly@google.com> wrote:

> ---
>  libswscale/x86/swscale.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
> index ff16398988..8c67bf4fab 100644
> --- a/libswscale/x86/swscale.c
> +++ b/libswscale/x86/swscale.c
> @@ -194,7 +194,7 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int
> filterSize, \
>      return; \
>  }
>
> -#define YUV2YUVX_FUNC(opt, step)  \
> +#define YUV2YUVX_FUNC(opt, step, tail)  \
>  void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int
> srcOffset, \
>                             uint8_t *dest, int dstW,  \
>                             const uint8_t *dither, int offset); \
> @@ -211,7 +211,7 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int
> filterSize, \
>      if(pixelsProcessed > 0) \
>          ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset,
> pixelsProcessed + offset, dither, offset); \
>      if(remainder > 0){ \
> -      ff_yuv2yuvX_mmxext(filter, filterSize - 1, pixelsProcessed, dest -
> offset, pixelsProcessed + remainder + offset, dither, offset); \
> +      yuv2yuvX_ ##tail(filter, filterSize, src, dest, dstW, dither,
> offset); \
>      } \
>      return; \
>  }
> @@ -220,10 +220,10 @@ static void yuv2yuvX_ ##opt(const int16_t *filter,
> int filterSize, \
>  YUV2YUVX_FUNC_MMX(mmxext, 16)
>  #endif
>  #if HAVE_SSE3_EXTERNAL
> -YUV2YUVX_FUNC(sse3, 32)
> +YUV2YUVX_FUNC(sse3, 32, mmxext)
>  #endif
>  #if HAVE_AVX2_EXTERNAL
> -YUV2YUVX_FUNC(avx2, 64)
> +YUV2YUVX_FUNC(avx2, 64, sse3)
>  #endif
>
>  #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
> --
> 2.41.0.255.g8b1d071c50-goog
>
>
Michael Niedermayer Sept. 4, 2023, 10:03 p.m. UTC | #2
On Mon, Sep 04, 2023 at 02:30:00PM +0200, Alan Kelly via ffmpeg-devel wrote:
> Hi,
> 
> Any issues with this patch or can it be merged?

are all cases covered by tests ?
if yes and the tests pass, it should be ok

thx

[...]
Alan Kelly Sept. 6, 2023, 2:26 p.m. UTC | #3
On Tue, Sep 5, 2023 at 12:03 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> On Mon, Sep 04, 2023 at 02:30:00PM +0200, Alan Kelly via ffmpeg-devel
> wrote:
> > Hi,
> >
> > Any issues with this patch or can it be merged?
>
> are all cases covered by tests ?
> if yes and the tests pass, it should be ok
>
> thx
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Observe your enemies, for they first find out your faults. -- Antisthenes
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>

All branches are tested. However, the third patch in this chain supersedes
this change since each version of yuv2yuvX now handles remainders. I have
sent the two other patches as a new chain so let's abandon this. Thanks
diff mbox series

Patch

diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..8c67bf4fab 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -194,7 +194,7 @@  static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
     return; \
 }
 
-#define YUV2YUVX_FUNC(opt, step)  \
+#define YUV2YUVX_FUNC(opt, step, tail)  \
 void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int srcOffset, \
                            uint8_t *dest, int dstW,  \
                            const uint8_t *dither, int offset); \
@@ -211,7 +211,7 @@  static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
     if(pixelsProcessed > 0) \
         ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \
     if(remainder > 0){ \
-      ff_yuv2yuvX_mmxext(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \
+      yuv2yuvX_ ##tail(filter, filterSize, src, dest, dstW, dither, offset); \
     } \
     return; \
 }
@@ -220,10 +220,10 @@  static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
 YUV2YUVX_FUNC_MMX(mmxext, 16)
 #endif
 #if HAVE_SSE3_EXTERNAL
-YUV2YUVX_FUNC(sse3, 32)
+YUV2YUVX_FUNC(sse3, 32, mmxext)
 #endif
 #if HAVE_AVX2_EXTERNAL
-YUV2YUVX_FUNC(avx2, 64)
+YUV2YUVX_FUNC(avx2, 64, sse3)
 #endif
 
 #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \