Merge pull request #10 from podarok/add_mpp_ffmpeg_arm64

feat: add arm64 optimisations
This commit is contained in:
Andrii Podanenko 2023-03-24 17:09:41 +02:00 committed by GitHub
commit 4ea972c649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 5 deletions

View File

@ -56,7 +56,7 @@ ARCH=$(uname -m)
CC_OPT="-O3 -Wno-error=implicit-fallthrough"
if [ "$ARCH" = "aarch64" ]; then
CC_OPT="${CC_OPT} -march=armv8-a+crc"
CC_OPT="${CC_OPT} -march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
./configure --prefix=/usr/local/nginx \

View File

@ -29,7 +29,17 @@ cd /tmp
git clone https://github.com/rockchip-linux/mpp.git
cd mpp
mkdir build || true && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../
ARCH=$(uname -m)
EXTRA_CFLAGS=""
EXTRA_CXXFLAGS=""
if [ "$ARCH" = "aarch64" ]; then
EXTRA_CFLAGS="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
EXTRA_CXXFLAGS="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_FLAGS="${EXTRA_CFLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_CXXFLAGS}" ../
make -j$(nproc)
make install
ldconfig
@ -53,10 +63,18 @@ cd /tmp
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
ARCH=$(uname -m)
EXTRA_CFLAGS="-I/usr/local/include"
EXTRA_LDFLAGS="-L/usr/local/lib"
if [ "$ARCH" = "aarch64" ]; then
EXTRA_CFLAGS="${EXTRA_CFLAGS} -march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
--enable-rkmpp \
--extra-cflags="-I/usr/local/include" \
--extra-ldflags="-L/usr/local/lib" \
--extra-cflags="${EXTRA_CFLAGS}" \
--extra-ldflags="${EXTRA_LDFLAGS}" \
--extra-libs="-lpthread -lm -latomic" \
--arch=arm64 \
--enable-gmp \
@ -75,7 +93,6 @@ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
--enable-libsoxr \
--enable-libssh \
--enable-libvorbis \
--enable-libvpx \
--enable-libzimg \
--enable-libwebp \
--enable-libx264 \