50-vvenc.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. SCRIPT_REPO="https://github.com/fraunhoferhhi/vvenc.git"
  3. SCRIPT_COMMIT="bde56fd61d5d6fcd8fac4bab0faa4da813928bb3"
  4. ffbuild_enabled() {
  5. [[ $TARGET != *32 ]] || return -1
  6. (( $(ffbuild_ffver) > 700 )) || return -1
  7. # vvenc force-enabled avx2 and equivalent compiler options, and uses a static initializer that promptly
  8. # runs such instructions. Making resulting binaries malfunction on any but the very latest CPUs.
  9. # Until upstream fixes this behaviour, force-disable vvenc.
  10. return -1
  11. }
  12. ffbuild_dockerbuild() {
  13. mkdir build && cd build
  14. local armsimd=()
  15. if [[ $TARGET == *arm* ]]; then
  16. armsimd+=( -DVVENC_ENABLE_ARM_SIMD=ON )
  17. if [[ "$CC" != *clang* ]]; then
  18. export CFLAGS="$CFLAGS -fpermissive -Wno-error=uninitialized -Wno-error=maybe-uninitialized"
  19. export CXXFLAGS="$CXXFLAGS -fpermissive -Wno-error=uninitialized -Wno-error=maybe-uninitialized"
  20. fi
  21. fi
  22. cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DCMAKE_BUILD_TYPE=Release \
  23. -DBUILD_SHARED_LIBS=OFF -DVVENC_LIBRARY_ONLY=ON -DVVENC_ENABLE_LINK_TIME_OPT=OFF -DEXTRALIBS="-lstdc++" "${armsimd[@]}" ..
  24. make -j$(nproc)
  25. make install
  26. }
  27. ffbuild_configure() {
  28. echo --enable-libvvenc
  29. }
  30. ffbuild_unconfigure() {
  31. (( $(ffbuild_ffver) > 700 )) || return 0
  32. echo --disable-libvvenc
  33. }