|
| 1 | +--- |
| 2 | +layout: learningpathall |
| 3 | +title: Build and run vvenc (H.266 encoder) on Arm servers |
| 4 | +weight: 2 |
| 5 | +--- |
| 6 | + |
| 7 | +## Install necessary software packages |
| 8 | + |
| 9 | +`vvenc` is an open-source H.266/VVC encoder that offers very high compression efficiency and performance. There have been significant efforts ongoing to optimize the open-source implementation of the H.266 encoder on Arm Neoverse platforms which supports Neon and SVE/SVE2 instructions. The optimized code is available on [Github](https://github.com/fraunhoferhhi/vvenc) |
| 10 | + |
| 11 | +Install `Cmake` and other dependencies: |
| 12 | +```bash |
| 13 | +sudo apt install git wget cmake p7zip-full -y |
| 14 | +``` |
| 15 | +Install llvm compiler to compile the C++ code: |
| 16 | +```bash |
| 17 | +wget https://apt.llvm.org/llvm.sh |
| 18 | +chmod +x llvm.sh |
| 19 | +sudo ./llvm.sh 18 all |
| 20 | +``` |
| 21 | + |
| 22 | +## Download and build vvenc source |
| 23 | + |
| 24 | +```bash |
| 25 | +git clone https://github.com/fraunhoferhhi/vvenc.git |
| 26 | +cd vvenc |
| 27 | +CXX=clang++-18 CC=clang-18 cmake -S . -B build/release-static -DVVENC_ENABLE_ARM_SIMD_SVE=1 -DVVENC_ENABLE_ARM_SIMD_SVE2=1 |
| 28 | +``` |
| 29 | +Make sure sve/sve2 has been enabled in the Makefile: |
| 30 | +```output |
| 31 | +root@iZuf61ixurqifmpxuji4viZ:~/vvenc-1.13.0# CXX=clang++-18 CC=clang-18 cmake -S . -B build/release-static -DVVENC_ENABLE_ARM_SIMD_SVE=1 -DVVENC_ENABLE_ARM_SIMD_SVE2=1 |
| 32 | +-- The C compiler identification is Clang 18.1.8 |
| 33 | +-- The CXX compiler identification is Clang 18.1.8 |
| 34 | +-- Detecting C compiler ABI info |
| 35 | +-- Detecting C compiler ABI info - done |
| 36 | +-- Check for working C compiler: /usr/bin/clang-18 - skipped |
| 37 | +-- Detecting C compile features |
| 38 | +-- Detecting C compile features - done |
| 39 | +-- Detecting CXX compiler ABI info |
| 40 | +-- Detecting CXX compiler ABI info - done |
| 41 | +-- Check for working CXX compiler: /usr/bin/clang++-18 - skipped |
| 42 | +-- Detecting CXX compile features |
| 43 | +-- Detecting CXX compile features - done |
| 44 | +-- CMAKE_MODULE_PATH: updating module path to: /root/vvenc-1.13.0/cmake/modules |
| 45 | +-- normalized target architecture: AARCH64 |
| 46 | +-- Performing Test SUPPORTED_Werror_unused_command_line_argument |
| 47 | +-- Performing Test SUPPORTED_Werror_unused_command_line_argument - Success |
| 48 | +-- Performing Test SUPPORTED_march=armv8_2_a+sve |
| 49 | +-- Performing Test SUPPORTED_march=armv8_2_a+sve - Success |
| 50 | +-- Performing Test SVE_COMPILATION_C_TEST_COMPILED |
| 51 | +-- Performing Test SVE_COMPILATION_C_TEST_COMPILED - Success |
| 52 | +-- Performing Test SVE_COMPILATION_CXX_TEST_COMPILED |
| 53 | +-- Performing Test SVE_COMPILATION_CXX_TEST_COMPILED - Success |
| 54 | +-- Performing Test SVE_HEADER_C_TEST_COMPILED |
| 55 | +-- Performing Test SVE_HEADER_C_TEST_COMPILED - Success |
| 56 | +-- Performing Test SVE_HEADER_CXX_TEST_COMPILED |
| 57 | +-- Performing Test SVE_HEADER_CXX_TEST_COMPILED - Success |
| 58 | +-- Performing Test SUPPORTED_march=armv9_a+sve2 |
| 59 | +-- Performing Test SUPPORTED_march=armv9_a+sve2 - Success |
| 60 | +-- Performing Test SUPPORTED_msse4_1 |
| 61 | +-- Performing Test SUPPORTED_msse4_1 - Failed |
| 62 | +-- Performing Test SUPPORTED_mavx |
| 63 | +-- Performing Test SUPPORTED_mavx - Failed |
| 64 | +-- Performing Test HAVE_INTRIN_mm_storeu_si16 |
| 65 | +-- Performing Test HAVE_INTRIN_mm_storeu_si16 - Success |
| 66 | +-- Performing Test HAVE_INTRIN_mm_storeu_si32 |
| 67 | +-- Performing Test HAVE_INTRIN_mm_storeu_si32 - Success |
| 68 | +-- Performing Test HAVE_INTRIN_mm_storeu_si64 |
| 69 | +-- Performing Test HAVE_INTRIN_mm_storeu_si64 - Success |
| 70 | +-- Performing Test HAVE_INTRIN_mm_loadu_si32 |
| 71 | +-- Performing Test HAVE_INTRIN_mm_loadu_si32 - Success |
| 72 | +-- Performing Test HAVE_INTRIN_mm_loadu_si64 |
| 73 | +-- Performing Test HAVE_INTRIN_mm_loadu_si64 - Success |
| 74 | +-- Performing Test HAVE_INTRIN_mm_cvtsi128_si64 |
| 75 | +-- Performing Test HAVE_INTRIN_mm_cvtsi128_si64 - Success |
| 76 | +-- Performing Test HAVE_INTRIN_mm_cvtsi64_si128 |
| 77 | +-- Performing Test HAVE_INTRIN_mm_cvtsi64_si128 - Success |
| 78 | +-- Performing Test HAVE_INTRIN_mm_extract_epi64 |
| 79 | +-- Performing Test HAVE_INTRIN_mm_extract_epi64 - Success |
| 80 | +-- Performing Test HAVE_INTRIN_mm256_zeroupper |
| 81 | +-- Performing Test HAVE_INTRIN_mm256_zeroupper - Failed |
| 82 | +-- Performing Test HAVE_INTRIN_mm256_loadu2_m128i |
| 83 | +-- Performing Test HAVE_INTRIN_mm256_loadu2_m128i - Success |
| 84 | +-- Performing Test HAVE_INTRIN_mm256_set_m128i |
| 85 | +-- Performing Test HAVE_INTRIN_mm256_set_m128i - Success |
| 86 | +-- x86 SIMD intrinsics enabled (using SIMDE for non-x86 targets) |
| 87 | +-- AArch64 Neon intrinsics enabled |
| 88 | +-- AArch64 SVE intrinsics enabled |
| 89 | +-- AArch64 SVE2 intrinsics enabled |
| 90 | +-- Looking for pthread.h |
| 91 | +-- Looking for pthread.h - found |
| 92 | +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD |
| 93 | +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success |
| 94 | +-- Found Threads: TRUE |
| 95 | +-- Performing Test SUPPORTED_mxsave |
| 96 | +-- Performing Test SUPPORTED_mxsave - Failed |
| 97 | +-- Performing Test SUPPORTED_msse4_2 |
| 98 | +-- Performing Test SUPPORTED_msse4_2 - Failed |
| 99 | +-- Performing Test SUPPORTED_mavx2 |
| 100 | +-- Performing Test SUPPORTED_mavx2 - Failed |
| 101 | +-- Configuring done |
| 102 | +-- Generating done |
| 103 | +-- Build files have been written to: /root/vvenc-1.13.0/build/release-static |
| 104 | +``` |
| 105 | +Start the build process: |
| 106 | +```bash |
| 107 | +cmake --build build/release-static -j |
| 108 | +``` |
| 109 | + |
| 110 | +## Download video streams to run vvenc on and measure the performance |
| 111 | + |
| 112 | +To benchmark the compression efficiency and performance of `vvenc`, you will need a set of video streams to run the codec on. |
| 113 | + |
| 114 | +Download the `1080P` video files: |
| 115 | +```bash |
| 116 | +cd ../video |
| 117 | +wget http://ultravideo.cs.tut.fi/video/Bosphorus_1920x1080_120fps_420_8bit_YUV_Y4M.7z |
| 118 | +7z -x Bosphorus_1920x1080_120fps_420_8bit_YUV_Y4M.7z |
| 119 | +``` |
| 120 | + |
| 121 | +## Run vvenc on the sample video files |
| 122 | + |
| 123 | +To benchmark the performance of `vvenc` over 100 frames of the `1080P` video file, run the command: |
| 124 | +```console |
| 125 | +numactl -C 0-3 bin/release-static/vvencFFapp --preset faster --BitstreamFile stream.266 --Threads 4 --InputFile ~/video/Bosphorus_1920x1080_120fps_420_8bit_YUV.y4m --InputBitDepth 8 --InputChromaFormat 420 --fps 30 --FramesToBeEncoded 100 --SourceWidth 1920 --SourceHeight 1080 --Qp 22 --IntraPeriod 256 --NumPasses 1 --InternalBitDepth 10 --stats 1 --Verbosity 3 --pools ',' |
| 126 | +``` |
| 127 | + |
| 128 | +You can vary the preset settings and measure the impact on performance. |
| 129 | + |
| 130 | + |
| 131 | +## View Results |
| 132 | + |
| 133 | +The encoding Frame Rate (Frames per second) for the video files is output at the end of each run. |
| 134 | + |
| 135 | +Shown below is example output from running the vvenc h.266 encoding on the 1080P sample video file: |
| 136 | + |
| 137 | +```output |
| 138 | +vvencFFapp: VVenC, the Fraunhofer H.266/VVC Encoder, version 1.13.0 [Linux][clang 18.1.8][64 bit][SIMD=SVE2] |
| 139 | +vvencFFapp [info]: started @ Wed Dec 25 16:06:03 2024 |
| 140 | +vvenc [info]: Input File : /root/video/Bosphorus_1920x1080_120fps_420_8bit_YUV.y4m |
| 141 | +vvenc [info]: Bitstream File : stream.266 |
| 142 | +vvenc [info]: Real Format : 1920x1080 yuv420p 30 Hz SDR 600 frames |
| 143 | +vvenc [info]: Frames : encode 100 frames |
| 144 | +vvenc [info]: Internal format : 1920x1080 30 Hz SDR |
| 145 | +vvenc [info]: Threads : 4 (parallel frames: 4) |
| 146 | +vvenc [info]: Rate control : QP 22 |
| 147 | +vvenc [info]: Perceptual optimization : Disabled |
| 148 | +vvenc [info]: Intra period (keyframe) : 256 |
| 149 | +vvenc [info]: Decoding refresh type : CRA |
| 150 | +
|
| 151 | +vvenc [info]: stats: 30.0% frame= 30/100 fps= 4.7 avg_fps= 4.7 bitrate= 3174.97 kbps avg_bitrate= 3174.97 kbps elapsed= 00h:00m:07s left= 00h:00mvvenc [info]: stats: 60.0% frame= 60/100 fps= 7.2 avg_fps= 5.7 bitrate= 2405.72 kbps avg_bitrate= 2790.34 kbps elapsed= 00h:00m:11s left= 00h:00mvvenc [info]: stats: 90.0% frame= 90/100 fps= 7.2 avg_fps= 6.1 bitrate= 2445.71 kbps avg_bitrate= 2675.47 kbps elapsed= 00h:00m:15s left= 00h:00mvvenc [info]: stats: 100.0% frame= 100/100 fps= 6.6 avg_fps= 6.6 bitrate= 2490.95 kbps avg_bitrate= 2490.95 kbps elapsed= 00h:00m:16s left= 00h:00m:00s |
| 152 | +vvenc [info]: stats summary: frame= 100/100 avg_fps= 6.6 avg_bitrate= 2490.95 kbps |
| 153 | +vvenc [info]: stats summary: frame I: 1, kbps: 32874.48, AvgQP: 17.00 |
| 154 | +vvenc [info]: stats summary: frame P: 0, kbps: nan, AvgQP: nan |
| 155 | +vvenc [info]: stats summary: frame B: 99, kbps: 2184.04, AvgQP: 27.42 |
| 156 | +
|
| 157 | +
|
| 158 | +vvenc [info]: Total Frames | Bitrate Y-PSNR U-PSNR V-PSNR YUV-PSNR |
| 159 | +vvenc [info]: 100 a 2490.9480 43.7378 48.7096 47.9283 44.7472 |
| 160 | +
|
| 161 | +vvencFFapp [info]: finished @ Wed Dec 25 16:06:19 2024 |
| 162 | +vvencFFapp [info]: Total Time: 58.962 sec. [user] 15.209 sec. [elapsed] |
| 163 | +``` |
0 commit comments