Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
@ 2025-01-25 14:25 Shreesh Adiga
  2025-01-25 14:33 ` James Almer
  2025-01-25 22:27 ` Ronald S. Bultje
  0 siblings, 2 replies; 7+ messages in thread
From: Shreesh Adiga @ 2025-01-25 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
---
 libswscale/x86/rgb2rgb.c     | 21 +++++++++++++++++++++
 libswscale/x86/rgb_2_rgb.asm | 28 ++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index 6790551a38..4cbed54b35 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -2364,6 +2364,16 @@ void ff_shuffle_bytes_2013_avx2(const uint8_t *src, uint8_t *dst, int src_size);
 void ff_shuffle_bytes_2130_avx2(const uint8_t *src, uint8_t *dst, int src_size);
 void ff_shuffle_bytes_1203_avx2(const uint8_t *src, uint8_t *dst, int src_size);
 
+void ff_shuffle_bytes_2103_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_0321_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_1230_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_3012_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_3210_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_3102_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_2013_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_2130_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+void ff_shuffle_bytes_1203_avx512icl(const uint8_t *src, uint8_t *dst, int src_size);
+
 void ff_uyvytoyuv422_sse2(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
                           const uint8_t *src, int width, int height,
                           int lumStride, int chromStride, int srcStride);
@@ -2454,6 +2464,17 @@ av_cold void rgb2rgb_init_x86(void)
         shuffle_bytes_2130 = ff_shuffle_bytes_2130_avx2;
         shuffle_bytes_1203 = ff_shuffle_bytes_1203_avx2;
     }
+    if (EXTERNAL_AVX512ICL(cpu_flags)) {
+        shuffle_bytes_0321 = ff_shuffle_bytes_0321_avx512icl;
+        shuffle_bytes_2103 = ff_shuffle_bytes_2103_avx512icl;
+        shuffle_bytes_1230 = ff_shuffle_bytes_1230_avx512icl;
+        shuffle_bytes_3012 = ff_shuffle_bytes_3012_avx512icl;
+        shuffle_bytes_3210 = ff_shuffle_bytes_3210_avx512icl;
+        shuffle_bytes_3102 = ff_shuffle_bytes_3102_avx512icl;
+        shuffle_bytes_2013 = ff_shuffle_bytes_2013_avx512icl;
+        shuffle_bytes_2130 = ff_shuffle_bytes_2130_avx512icl;
+        shuffle_bytes_1203 = ff_shuffle_bytes_1203_avx512icl;
+    }
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         uyvytoyuv422 = ff_uyvytoyuv422_avx2;
 #endif
diff --git a/libswscale/x86/rgb_2_rgb.asm b/libswscale/x86/rgb_2_rgb.asm
index b468beb12d..64b0988c4a 100644
--- a/libswscale/x86/rgb_2_rgb.asm
+++ b/libswscale/x86/rgb_2_rgb.asm
@@ -64,6 +64,18 @@ cglobal shuffle_bytes_%1%2%3%4, 3, 5, 2, src, dst, w, tmp, x
     add        dstq, wq
     neg          wq
 
+%if mmsize == 64
+    and xq, mmsize-4
+    shr xq, 2
+    mov tmpd, -1
+    shlx tmpd, tmpd, xd
+    not tmpd
+    kmovw k7, tmpw
+    vmovdqu32 m1{k7}{z}, [srcq + wq]
+    pshufb         m1, m0
+    vmovdqu32 [dstq + wq]{k7}, m1
+    lea wq, [wq + 4 * xq]
+%else
 ;calc scalar loop
     and xq, mmsize-4
     je .loop_simd
@@ -80,6 +92,7 @@ cglobal shuffle_bytes_%1%2%3%4, 3, 5, 2, src, dst, w, tmp, x
    add            wq, 4
    sub            xq, 4
    jg .loop_scalar
+%endif
 
 ;check if src_size < mmsize
 cmp wq, 0
@@ -122,6 +135,21 @@ SHUFFLE_BYTES 1, 2, 0, 3
 %endif
 %endif
 
+%if ARCH_X86_64
+%if HAVE_AVX512ICL_EXTERNAL
+INIT_ZMM avx512icl
+SHUFFLE_BYTES 2, 1, 0, 3
+SHUFFLE_BYTES 0, 3, 2, 1
+SHUFFLE_BYTES 1, 2, 3, 0
+SHUFFLE_BYTES 3, 0, 1, 2
+SHUFFLE_BYTES 3, 2, 1, 0
+SHUFFLE_BYTES 3, 1, 0, 2
+SHUFFLE_BYTES 2, 0, 1, 3
+SHUFFLE_BYTES 2, 1, 3, 0
+SHUFFLE_BYTES 1, 2, 0, 3
+%endif
+%endif
+
 ;-----------------------------------------------------------------------------------------------
 ; uyvytoyuv422(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
 ;              const uint8_t *src, int width, int height,
-- 
2.45.3

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 14:25 [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes Shreesh Adiga
@ 2025-01-25 14:33 ` James Almer
  2025-01-25 15:11   ` Shreesh Adiga
  2025-01-25 22:27 ` Ronald S. Bultje
  1 sibling, 1 reply; 7+ messages in thread
From: James Almer @ 2025-01-25 14:33 UTC (permalink / raw)
  To: ffmpeg-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 522 bytes --]

On 1/25/2025 11:25 AM, Shreesh Adiga wrote:
> Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
> ---
>   libswscale/x86/rgb2rgb.c     | 21 +++++++++++++++++++++
>   libswscale/x86/rgb_2_rgb.asm | 28 ++++++++++++++++++++++++++++
>   2 files changed, 49 insertions(+)

Thanks for the patch. Could you please compile and run 
tests/checkasm/checkasm with "--test=sw_rgb --bench" and paste the 
results for the shuffle_bytes functions, to see if there's a speed up 
compared to the AVX2 implementation?


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 14:33 ` James Almer
@ 2025-01-25 15:11   ` Shreesh Adiga
  2025-01-25 15:39     ` James Almer
  0 siblings, 1 reply; 7+ messages in thread
From: Shreesh Adiga @ 2025-01-25 15:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

> Thanks for the patch. Could you please compile and run
> tests/checkasm/checkasm with "--test=sw_rgb --bench" and paste the
> results for the shuffle_bytes functions, to see if there's a speed up
> compared to the AVX2 implementation?

I ran the command "tests/checkasm/checkasm --test=sw_rgb --bench" and I see
the below output:
benchmarking with native FFmpeg timers
nop: 45.0
checkasm: using random seed 17575157
checkasm: bench runs 1024 (1 << 10)
SSE2:
 - sw_rgb.uyvytoyuv422       [OK]
 - sw_rgb.interleave_bytes   [OK]
 - sw_rgb.deinterleave_bytes [OK]
 - sw_rgb.rgb_to_y           [OK]
 - sw_rgb.rgb_to_uv          [OK]
SSSE3:
 - sw_rgb.shuffle_bytes_2103 [OK]
 - sw_rgb.shuffle_bytes_0321 [OK]
 - sw_rgb.shuffle_bytes_1230 [OK]
 - sw_rgb.shuffle_bytes_3012 [OK]
 - sw_rgb.shuffle_bytes_3210 [OK]
 - sw_rgb.rgb_to_y           [OK]
 - sw_rgb.rgb_to_uv          [OK]
AVX:
 - sw_rgb.uyvytoyuv422       [OK]
 - sw_rgb.deinterleave_bytes [OK]
 - sw_rgb.rgb_to_y           [OK]
 - sw_rgb.rgb_to_uv          [OK]
AVX2:
 - sw_rgb.shuffle_bytes_2103 [OK]
 - sw_rgb.shuffle_bytes_0321 [OK]
 - sw_rgb.shuffle_bytes_1230 [OK]
 - sw_rgb.shuffle_bytes_3012 [OK]
 - sw_rgb.shuffle_bytes_3210 [OK]
 - sw_rgb.uyvytoyuv422       [OK]
 - sw_rgb.rgb_to_y           [OK]
 - sw_rgb.rgb_to_uv          [OK]
AVX-512ICL:
 - sw_rgb.shuffle_bytes_2103 [OK]
 - sw_rgb.shuffle_bytes_0321 [OK]
 - sw_rgb.shuffle_bytes_1230 [OK]
 - sw_rgb.shuffle_bytes_3012 [OK]
 - sw_rgb.shuffle_bytes_3210 [OK]
checkasm: all 184 tests passed
shuffle_bytes_0321_c:                                   45.0 ( 1.00x)
shuffle_bytes_0321_ssse3:                               11.2 ( 4.00x)
shuffle_bytes_0321_avx2:                                11.2 ( 4.00x)
shuffle_bytes_0321_avx512icl:                           11.2 ( 4.00x)
shuffle_bytes_1230_c:                                   67.5 ( 1.00x)
shuffle_bytes_1230_ssse3:                               11.2 ( 6.00x)
shuffle_bytes_1230_avx2:                                11.2 ( 6.00x)
shuffle_bytes_1230_avx512icl:                            0.0 ( 0.00x)
shuffle_bytes_2103_c:                                   45.0 ( 1.00x)
shuffle_bytes_2103_ssse3:                               11.2 ( 4.00x)
shuffle_bytes_2103_avx2:                                 0.0 ( 0.00x)
shuffle_bytes_2103_avx512icl:                            0.0 ( 0.00x)
shuffle_bytes_3012_c:                                   67.5 ( 1.00x)
shuffle_bytes_3012_ssse3:                               11.2 ( 6.00x)
shuffle_bytes_3012_avx2:                                11.2 ( 6.00x)
shuffle_bytes_3012_avx512icl:                            0.0 ( 0.00x)
shuffle_bytes_3210_c:                                   67.5 ( 1.00x)
shuffle_bytes_3210_ssse3:                               11.2 ( 6.00x)
shuffle_bytes_3210_avx2:                                11.2 ( 6.00x)
shuffle_bytes_3210_avx512icl:                            0.0 ( 0.00x)

I've not included the other function printed by the bench command.
I'm not sure if I'm missing something, the output doesn't look consistent
to me.
There are many 0.0 and I don't see any difference between ssse3 and avx2
either.
I'm running this on AMD Ryzen 7950x Zen4 machine.

I've inspected the assembly output for one of the ssse3/avx2/avx512 and it
seems to be as per my expectation.
Therefore I'm not sure if the checkasm is accurately measuring here.
Please let me know if I'm missing something here, I'm new to FFmpeg
development and this is my first patch submission.

Thanks,
Shreesh
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 15:11   ` Shreesh Adiga
@ 2025-01-25 15:39     ` James Almer
  2025-01-25 15:50       ` Shreesh Adiga
  0 siblings, 1 reply; 7+ messages in thread
From: James Almer @ 2025-01-25 15:39 UTC (permalink / raw)
  To: ffmpeg-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 5263 bytes --]

On 1/25/2025 12:11 PM, Shreesh Adiga wrote:
>> Thanks for the patch. Could you please compile and run
>> tests/checkasm/checkasm with "--test=sw_rgb --bench" and paste the
>> results for the shuffle_bytes functions, to see if there's a speed up
>> compared to the AVX2 implementation?
> 
> I ran the command "tests/checkasm/checkasm --test=sw_rgb --bench" and I see
> the below output:
> benchmarking with native FFmpeg timers
> nop: 45.0
> checkasm: using random seed 17575157
> checkasm: bench runs 1024 (1 << 10)
> SSE2:
>   - sw_rgb.uyvytoyuv422       [OK]
>   - sw_rgb.interleave_bytes   [OK]
>   - sw_rgb.deinterleave_bytes [OK]
>   - sw_rgb.rgb_to_y           [OK]
>   - sw_rgb.rgb_to_uv          [OK]
> SSSE3:
>   - sw_rgb.shuffle_bytes_2103 [OK]
>   - sw_rgb.shuffle_bytes_0321 [OK]
>   - sw_rgb.shuffle_bytes_1230 [OK]
>   - sw_rgb.shuffle_bytes_3012 [OK]
>   - sw_rgb.shuffle_bytes_3210 [OK]
>   - sw_rgb.rgb_to_y           [OK]
>   - sw_rgb.rgb_to_uv          [OK]
> AVX:
>   - sw_rgb.uyvytoyuv422       [OK]
>   - sw_rgb.deinterleave_bytes [OK]
>   - sw_rgb.rgb_to_y           [OK]
>   - sw_rgb.rgb_to_uv          [OK]
> AVX2:
>   - sw_rgb.shuffle_bytes_2103 [OK]
>   - sw_rgb.shuffle_bytes_0321 [OK]
>   - sw_rgb.shuffle_bytes_1230 [OK]
>   - sw_rgb.shuffle_bytes_3012 [OK]
>   - sw_rgb.shuffle_bytes_3210 [OK]
>   - sw_rgb.uyvytoyuv422       [OK]
>   - sw_rgb.rgb_to_y           [OK]
>   - sw_rgb.rgb_to_uv          [OK]
> AVX-512ICL:
>   - sw_rgb.shuffle_bytes_2103 [OK]
>   - sw_rgb.shuffle_bytes_0321 [OK]
>   - sw_rgb.shuffle_bytes_1230 [OK]
>   - sw_rgb.shuffle_bytes_3012 [OK]
>   - sw_rgb.shuffle_bytes_3210 [OK]
> checkasm: all 184 tests passed
> shuffle_bytes_0321_c:                                   45.0 ( 1.00x)
> shuffle_bytes_0321_ssse3:                               11.2 ( 4.00x)
> shuffle_bytes_0321_avx2:                                11.2 ( 4.00x)
> shuffle_bytes_0321_avx512icl:                           11.2 ( 4.00x)
> shuffle_bytes_1230_c:                                   67.5 ( 1.00x)
> shuffle_bytes_1230_ssse3:                               11.2 ( 6.00x)
> shuffle_bytes_1230_avx2:                                11.2 ( 6.00x)
> shuffle_bytes_1230_avx512icl:                            0.0 ( 0.00x)
> shuffle_bytes_2103_c:                                   45.0 ( 1.00x)
> shuffle_bytes_2103_ssse3:                               11.2 ( 4.00x)
> shuffle_bytes_2103_avx2:                                 0.0 ( 0.00x)
> shuffle_bytes_2103_avx512icl:                            0.0 ( 0.00x)
> shuffle_bytes_3012_c:                                   67.5 ( 1.00x)
> shuffle_bytes_3012_ssse3:                               11.2 ( 6.00x)
> shuffle_bytes_3012_avx2:                                11.2 ( 6.00x)
> shuffle_bytes_3012_avx512icl:                            0.0 ( 0.00x)
> shuffle_bytes_3210_c:                                   67.5 ( 1.00x)
> shuffle_bytes_3210_ssse3:                               11.2 ( 6.00x)
> shuffle_bytes_3210_avx2:                                11.2 ( 6.00x)
> shuffle_bytes_3210_avx512icl:                            0.0 ( 0.00x)
> 
> I've not included the other function printed by the bench command.
> I'm not sure if I'm missing something, the output doesn't look consistent
> to me.
> There are many 0.0 and I don't see any difference between ssse3 and avx2
> either.
> I'm running this on AMD Ryzen 7950x Zen4 machine.
> 
> I've inspected the assembly output for one of the ssse3/avx2/avx512 and it
> seems to be as per my expectation.
> Therefore I'm not sure if the checkasm is accurately measuring here.
> Please let me know if I'm missing something here, I'm new to FFmpeg
> development and this is my first patch submission.

Try running it several times using the same seed, so 
"tests/checkasm/checkasm --test=sw_rgb --bench 17575157", and make sure 
no power saving feature is enabled (so the CPU frequency doesn't change 
based on load). That may help getting consistent results.

On my Intel Core i7 12700K for example i get

shuffle_bytes_0321_c:                                   27.8 ( 1.00x)
shuffle_bytes_0321_ssse3:                                8.3 ( 3.35x)
shuffle_bytes_0321_avx2:                                 6.3 ( 4.41x)
shuffle_bytes_1230_c:                                   51.8 ( 1.00x)
shuffle_bytes_1230_ssse3:                                8.3 ( 6.24x)
shuffle_bytes_1230_avx2:                                 6.3 ( 8.22x)
shuffle_bytes_2103_c:                                   28.8 ( 1.00x)
shuffle_bytes_2103_ssse3:                                8.3 ( 3.47x)
shuffle_bytes_2103_avx2:                                 6.3 ( 4.57x)
shuffle_bytes_3012_c:                                   52.8 ( 1.00x)
shuffle_bytes_3012_ssse3:                                8.3 ( 6.36x)
shuffle_bytes_3012_avx2:                                 6.3 ( 8.38x)
shuffle_bytes_3210_c:                                   51.8 ( 1.00x)
shuffle_bytes_3210_ssse3:                                8.3 ( 6.24x)
shuffle_bytes_3210_avx2:                                 5.8 ( 8.93x)

Otherwise, maybe someone else with an AVX512ICL enabled CPU can test it 
to confirm.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 15:39     ` James Almer
@ 2025-01-25 15:50       ` Shreesh Adiga
  2025-01-25 16:17         ` James Almer
  0 siblings, 1 reply; 7+ messages in thread
From: Shreesh Adiga @ 2025-01-25 15:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

> Try running it several times using the same seed, so
> "tests/checkasm/checkasm --test=sw_rgb --bench 17575157", and make sure
> no power saving feature is enabled (so the CPU frequency doesn't change
> based on load). That may help getting consistent results.

After running "echo performance | tee
/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" and
recompiling ffmpeg with "--enable-linux-perf", I am seeing the below
numbers:

shuffle_bytes_0321_c:                                   56.5 ( 1.00x)
shuffle_bytes_0321_ssse3:                               18.0 ( 3.14x)
shuffle_bytes_0321_avx2:                                10.0 ( 5.65x)
shuffle_bytes_0321_avx512icl:                            9.0 ( 6.28x)
shuffle_bytes_1230_c:                                   84.5 ( 1.00x)
shuffle_bytes_1230_ssse3:                               18.2 ( 4.63x)
shuffle_bytes_1230_avx2:                                22.2 ( 3.80x)
shuffle_bytes_1230_avx512icl:                           10.0 ( 8.45x)
shuffle_bytes_2103_c:                                   49.8 ( 1.00x)
shuffle_bytes_2103_ssse3:                               21.2 ( 2.34x)
shuffle_bytes_2103_avx2:                                17.5 ( 2.84x)
shuffle_bytes_2103_avx512icl:                            7.5 ( 6.63x)
shuffle_bytes_3012_c:                                   84.5 ( 1.00x)
shuffle_bytes_3012_ssse3:                               17.0 ( 4.97x)
shuffle_bytes_3012_avx2:                                16.0 ( 5.28x)
shuffle_bytes_3012_avx512icl:                           16.2 ( 5.20x)
shuffle_bytes_3210_c:                                   92.8 ( 1.00x)
shuffle_bytes_3210_ssse3:                               25.8 ( 3.60x)
shuffle_bytes_3210_avx2:                                14.0 ( 6.62x)
shuffle_bytes_3210_avx512icl:                            9.0 (10.31x)

Thanks,
Shreesh
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 15:50       ` Shreesh Adiga
@ 2025-01-25 16:17         ` James Almer
  0 siblings, 0 replies; 7+ messages in thread
From: James Almer @ 2025-01-25 16:17 UTC (permalink / raw)
  To: ffmpeg-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 2039 bytes --]

On 1/25/2025 12:50 PM, Shreesh Adiga wrote:
>> Try running it several times using the same seed, so
>> "tests/checkasm/checkasm --test=sw_rgb --bench 17575157", and make sure
>> no power saving feature is enabled (so the CPU frequency doesn't change
>> based on load). That may help getting consistent results.
> 
> After running "echo performance | tee
> /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor" and
> recompiling ffmpeg with "--enable-linux-perf", I am seeing the below
> numbers:
> 
> shuffle_bytes_0321_c:                                   56.5 ( 1.00x)
> shuffle_bytes_0321_ssse3:                               18.0 ( 3.14x)
> shuffle_bytes_0321_avx2:                                10.0 ( 5.65x)
> shuffle_bytes_0321_avx512icl:                            9.0 ( 6.28x)
> shuffle_bytes_1230_c:                                   84.5 ( 1.00x)
> shuffle_bytes_1230_ssse3:                               18.2 ( 4.63x)
> shuffle_bytes_1230_avx2:                                22.2 ( 3.80x)
> shuffle_bytes_1230_avx512icl:                           10.0 ( 8.45x)
> shuffle_bytes_2103_c:                                   49.8 ( 1.00x)
> shuffle_bytes_2103_ssse3:                               21.2 ( 2.34x)
> shuffle_bytes_2103_avx2:                                17.5 ( 2.84x)
> shuffle_bytes_2103_avx512icl:                            7.5 ( 6.63x)
> shuffle_bytes_3012_c:                                   84.5 ( 1.00x)
> shuffle_bytes_3012_ssse3:                               17.0 ( 4.97x)
> shuffle_bytes_3012_avx2:                                16.0 ( 5.28x)
> shuffle_bytes_3012_avx512icl:                           16.2 ( 5.20x)
> shuffle_bytes_3210_c:                                   92.8 ( 1.00x)
> shuffle_bytes_3210_ssse3:                               25.8 ( 3.60x)
> shuffle_bytes_3210_avx2:                                14.0 ( 6.62x)
> shuffle_bytes_3210_avx512icl:                            9.0 (10.31x)

Excellent. Will apply the patch later unless somebody objects.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
  2025-01-25 14:25 [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes Shreesh Adiga
  2025-01-25 14:33 ` James Almer
@ 2025-01-25 22:27 ` Ronald S. Bultje
  1 sibling, 0 replies; 7+ messages in thread
From: Ronald S. Bultje @ 2025-01-25 22:27 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi,

On Sat, Jan 25, 2025 at 9:26 AM Shreesh Adiga <16567adigashreesh@gmail.com>
wrote:

> @@ -64,6 +64,18 @@ cglobal shuffle_bytes_%1%2%3%4, 3, 5, 2, src, dst, w,
> tmp, x
>      add        dstq, wq
>      neg          wq
>
> +%if mmsize == 64
> +    and xq, mmsize-4
> +    shr xq, 2
> +    mov tmpd, -1
> +    shlx tmpd, tmpd, xd
> +    not tmpd
> +    kmovw k7, tmpw
> +    vmovdqu32 m1{k7}{z}, [srcq + wq]
> +    pshufb         m1, m0
> +    vmovdqu32 [dstq + wq]{k7}, m1
> +    lea wq, [wq + 4 * xq]
> +%else
>  ;calc scalar loop
>      and xq, mmsize-4
>      je .loop_simd
> @@ -80,6 +92,7 @@ cglobal shuffle_bytes_%1%2%3%4, 3, 5, 2, src, dst, w,
> tmp, x
>     add            wq, 4
>     sub            xq, 4
>     jg .loop_scalar
> +%endif


Would it be possible to fix up the indentation a little bit? This is quite
ugly.

Ronald
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-25 22:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-25 14:25 [FFmpeg-devel] [PATCH] swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes Shreesh Adiga
2025-01-25 14:33 ` James Almer
2025-01-25 15:11   ` Shreesh Adiga
2025-01-25 15:39     ` James Almer
2025-01-25 15:50       ` Shreesh Adiga
2025-01-25 16:17         ` James Almer
2025-01-25 22:27 ` Ronald S. Bultje

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git