From: Jiawei <jiawei@iscas.ac.cn> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] gcc: Remove auto-vectorization limitation. Date: Wed, 21 May 2025 18:14:04 +0800 Message-ID: <ab7eefc9-7f91-4cba-82f6-3a8917c4d533@iscas.ac.cn> (raw) > > -----原始邮件----- > > 发件人: "Nicolas George" <george@nsup.org> > > 发送时间: 2025-05-21 14:52:12 (星期三) > > 收件人: "FFmpeg development discussions and patches" > <ffmpeg-devel@ffmpeg.org> > > 抄送: > > 主题: Re: [FFmpeg-devel] gcc: Remove auto-vectorization limitation. > > > > Jiawei (HE12025-05-21): > > > particularly improving > > > performance on x86_64 (AVX), ARM64 (SVE) and RISC-V(RVV) > architectures. > > > > Benchmark needed. > > > > Regards, > > > > -- > > Nicolas George Hi Nicolas, Since I am a gcc developer, I'm not so familiar with the FFmpeg test flow, here is my test process, if there exists anything uncorrect, please point me out: 1. Download the video bbb_sunflower_2160p_30fps_normal.mp4.zip <https://download.blender.org/demo/movies/BBB/bbb_sunflower_2160p_30fps_normal.mp4.zip> from https://download.blender.org/demo/movies/BBB/, ``` ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -t 60 -vf "scale=1920:1080" -c:v libx265 -c:a libmp3lame 1080p_hevc_mp3.mp4 ``` get the 1080p video as Benchmark test video 2. Build two version of FFmpeg, one with the modify, another without the patch modif, using the gcc 13.3 release version, verified with Intel(R) Core(TM) Ultra 9 285HX Using patch: ``` ./ffmpeg -benchmark -i ~/mp/1080p_hevc_mp3.mp4 -f null - ffmpeg version N-119636-g96518c8d8d Copyright (c) 2000-2025 the FFmpeg developers built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04) configuration: --prefix=/home/pz9115/ffpo --disable-ffplay --arch=x64 --extra-cflags=-O3 --enable-static --target-os=linux libavutil 60. 2.100 / 60. 2.100 libavcodec 62. 3.101 / 62. 3.101 libavformat 62. 0.102 / 62. 0.102 libavdevice 62. 0.100 / 62. 0.100 libavfilter 11. 0.100 / 11. 0.100 libswscale 9. 0.100 / 9. 0.100 libswresample 6. 0.100 / 6. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pz9115/mp/1080p_hevc_mp3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure encoder : Lavf60.16.100 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net genre : Animation Duration: 00:01:00.00, start: 0.000000, bitrate: 1564 kb/s Stream #0:0[0x1](und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1429 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 libx265 Stream #0:1[0x2](und): Audio: mp3 (mp3float) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure genre : Animation comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net encoder : Lavf62.0.102 Stream #0:0(und): Video: wrapped_avframe, yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default) Metadata: encoder : Lavc62.3.101 wrapped_avframe handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default) Metadata: encoder : Lavc62.3.101 pcm_s16le handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] [out#0/null @ 0x565233669eb0] video:731KiB audio:11250KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 1800 fps=635 q=-0.0 Lsize=N/A time=00:01:00.00 bitrate=N/A speed=21.2x elapsed=0:00:02.83 bench: utime=11.324s stime=0.290s rtime=2.834s bench: maxrss=186556KiB ``` Without patch(here I add the fno-tree-vectorize directly): ./ffmpeg -benchmark -i ~/mp/1080p_hevc_mp3.mp4 -f null - ffmpeg version N-119636-g96518c8d8d Copyright (c) 2000-2025 the FFmpeg developers built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04) configuration: --prefix=/home/pz9115/ffpo --disable-ffplay --arch=x64 --extra-cflags='-O3 -fno-tree-vectorize' --enable-static --target-os=linux libavutil 60. 2.100 / 60. 2.100 libavcodec 62. 3.101 / 62. 3.101 libavformat 62. 0.102 / 62. 0.102 libavdevice 62. 0.100 / 62. 0.100 libavfilter 11. 0.100 / 11. 0.100 libswscale 9. 0.100 / 9. 0.100 libswresample 6. 0.100 / 6. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pz9115/mp/1080p_hevc_mp3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure encoder : Lavf60.16.100 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net genre : Animation Duration: 00:01:00.00, start: 0.000000, bitrate: 1564 kb/s Stream #0:0[0x1](und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1429 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 libx265 Stream #0:1[0x2](und): Audio: mp3 (mp3float) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure genre : Animation comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net encoder : Lavf62.0.102 Stream #0:0(und): Video: wrapped_avframe, yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default) Metadata: encoder : Lavc62.3.101 wrapped_avframe handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default) Metadata: encoder : Lavc62.3.101 pcm_s16le handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] [out#0/null @ 0x55eb196b7eb0] video:731KiB audio:11250KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 1800 fps=509 q=-0.0 Lsize=N/A time=00:01:00.00 bitrate=N/A speed= 17x elapsed=0:00:03.53 bench: utime=21.544s stime=0.349s rtime=3.536s bench: maxrss=181580KiB And I also tested on a RISC-V develop board MUSE Pi Pro, Here following is the configure and result: Using patch: root@spacemit-k1-x-MUSE-Pi-Pro-board:~# ./ffpv/bin/ffmpeg -benchmark -i 1080p_hevc_mp3.mp4 -f null - ffmpeg version n6.1.2 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 16.0.0 (g3fc902e738b) 20250519 (experimental) configuration: --prefix=/home/pz9115/ffpv --disable-ffplay --arch=riscv --extra-cflags='-march=rv64gcv_zba_zbb_zbs -O3 -ffast-math' --cross-prefix=/home/pz9115/rvv/bin/riscv64-unknown-linux-gnu- --cc=/home/pz9115/rvv/bin/riscv64-unknown-linux-gnu-gcc --cxx=/home/pz9115/rvv/bin/riscv64-unknown-linux-gnu-g++ --enable-static --enable-cross-compile --target-os=linux --disable-rvv libavutil 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat 60. 16.100 / 60. 16.100 libavdevice 60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080p_hevc_mp3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure encoder : Lavf60.16.100 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net genre : Animation Duration: 00:01:00.00, start: 0.000000, bitrate: 1564 kb/s Stream #0:0[0x1](und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1429 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 libx265 Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Odd rotation angle. If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)Output #0, null, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure genre : Animation comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net encoder : Lavf60.16.100 Stream #0:0(und): Video: wrapped_avframe, yuv420p(tv, progressive), 1080x1920 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s, 30 fps, 30 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 wrapped_avframe Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 pcm_s16le [out#0/null @ 0x28a82e0] video:844kB audio:11250kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown frame= 1800 fps= 42 q=-0.0 Lsize=N/A time=00:00:59.97 bitrate=N/A speed=1.41x bench: utime=207.150s stime=5.319s rtime=42.608s bench: maxrss=162160kB Without patch(same added the fno-tree-vectorize directly): ./ffp/bin/ffmpeg -benchmark -i 1080p_hevc_mp3.mp4 -f null - ffmpeg version n6.1.2 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 16.0.0 (g38163c874a3-dirty) 20250515 (experimental) configuration: --prefix=/home/pz9115/ffp --disable-ffplay --arch=riscv --sysroot=/home/pz9115/rv/sysroot --extra-cflags='-march=rv64gcv_zba_zbb_zbc_zbs_zca_zcd -mabi=lp64d -O3 -fno-tree-vectorize -static' --extra-ldflags=-static --cross-prefix=/home/pz9115/rv/bin/riscv64-unknown-linux-gnu- --enable-static --enable-cross-compile --target-os=linux --disable-rvv libavutil 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat 60. 16.100 / 60. 16.100 libavdevice 60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1080p_hevc_mp3.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure encoder : Lavf60.16.100 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net genre : Animation Duration: 00:01:00.00, start: 0.000000, bitrate: 1564 kb/s Stream #0:0[0x1](und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1429 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 libx265 Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native)) Stream #0:1 -> #0:1 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure genre : Animation comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net encoder : Lavf60.16.100 Stream #0:0(und): Video: wrapped_avframe, yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default) Metadata: handler_name : GPAC ISO Video Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 wrapped_avframe Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default) Metadata: handler_name : GPAC ISO Audio Handler vendor_id : [0][0][0][0] encoder : Lavc60.31.102 pcm_s16le [out#0/null @ 0x2729630] video:844kB audio:11250kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown frame= 1800 fps= 30 q=-0.0 Lsize=N/A time=00:00:59.97 bitrate=N/A speed= 1x bench: utime=321.145s stime=2.475s rtime=59.960s bench: maxrss=131532kB > > _______________________________________________ > > 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". _______________________________________________ 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".
next reply other threads:[~2025-05-21 10:14 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-05-21 10:14 Jiawei [this message] -- strict thread matches above, loose matches on Subject: below -- 2025-05-21 10:08 Jiawei 2025-05-21 6:17 Jiawei 2025-05-21 6:52 ` Nicolas George 2025-05-21 10:17 ` Jiawei 2025-05-21 18:21 ` Frank Plowman 2025-05-22 6:32 ` Jiawei 2025-05-24 1:46 ` Kieran Kunhya via ffmpeg-devel 2025-05-24 4:10 ` Jiawei 2025-05-24 16:10 ` Rémi Denis-Courmont 2025-05-25 21:37 ` Michael Niedermayer 2025-05-26 8:43 ` Rémi Denis-Courmont 2025-05-30 0:46 ` Michael Niedermayer 2025-05-30 6:58 ` Rémi Denis-Courmont 2025-05-31 13:39 ` Michael Niedermayer 2025-06-03 16:14 ` Niklas Haas 2025-06-04 11:13 ` Rémi Denis-Courmont 2025-05-21 7:46 ` Michael Niedermayer 2025-05-21 10:32 ` Jiawei 2025-05-21 11:09 ` Michael Niedermayer 2025-05-21 9:04 ` Zhao Zhili 2025-05-21 10:26 ` Jiawei 2025-05-21 10:33 ` Andreas Rheinhardt 2025-05-21 12:09 ` Martin Storsjö 2025-05-21 12:14 ` Andreas Rheinhardt 2025-05-21 12:22 ` Martin Storsjö 2025-05-21 18:12 ` softworkz . 2025-05-24 12:00 ` Rémi Denis-Courmont
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ab7eefc9-7f91-4cba-82f6-3a8917c4d533@iscas.ac.cn \ --to=jiawei@iscas.ac.cn \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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