mac 下移植 x264 使用 neon 多线程加速
来源:互联网 发布:淘宝店花呗怎么开通 编辑:程序博客网 时间:2024/06/13 22:07
mac 下移植 x264 使用 neon加速
1.获取x264源码
git clone http://git.videolan.org/git/x264.git
2. 再x264上级目录创建build_x264.sh
sudo chmod 777 build_x264.sh
3.更改build_x264.sh的内容
#!/bin/shCONFIGURE_FLAGS="--enable-static --enable-pic --disable-cli"ARCHS="arm64 x86_64 i386 armv7 armv7s"# directoriesSOURCE="x264"FAT="x264-iOS"SCRATCH="scratch-x264"# must be an absolute pathTHIN=/Users/chenglong/Documents/x264-ios-master/"thin-x264"# the one included in x264 does not work; specify full path to working oneGAS_PREPROCESSOR=/usr/local/bin/gas-preprocessor.plCOMPILE="y"LIPO="y"if [ "$*" ]thenif [ "$*" = "lipo" ]then# skip compileCOMPILE=elseARCHS="$*"if [ $# -eq 1 ]then# skip lipoLIPO=fififiif [ "$COMPILE" ]thenCWD=/Users/chenglong/Documents/x264-ios-masterfor ARCH in $ARCHSdoecho "building $ARCH..."mkdir -p "$SCRATCH/$ARCH"cd "$SCRATCH/$ARCH"CFLAGS="-arch $ARCH" ASFLAGS=if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]then PLATFORM="iPhoneSimulator" CPU= if [ "$ARCH" = "x86_64" ] then CFLAGS="$CFLAGS -mios-simulator-version-min=7.0" HOST= else CFLAGS="$CFLAGS -mios-simulator-version-min=5.0"HOST="--host=i386-apple-darwin" fielse PLATFORM="iPhoneOS" if [ $ARCH = "arm64" ] then HOST="--host=aarch64-apple-darwin"XARCH="-arch aarch64" else HOST="--host=arm-apple-darwin"XARCH="-arch arm" fi CFLAGS="$CFLAGS -fembed-bitcode -mios-version-min=7.0" ASFLAGS="$CFLAGS"fiXCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`CC="xcrun -sdk $XCRUN_SDK clang"if [ $PLATFORM = "iPhoneOS" ]then export AS="gas-preprocessor.pl $XARCH -- $CC"else export -n ASfiCXXFLAGS="$CFLAGS"LDFLAGS="$CFLAGS"CC=$CC $CWD/$SOURCE/configure \ $CONFIGURE_FLAGS \ $HOST \ --extra-cflags="$CFLAGS" \ --extra-asflags="$ASFLAGS" \ --extra-ldflags="$LDFLAGS" \ --prefix="$THIN/$ARCH" || exit 1mkdir extrasln -s $GAS_PREPROCESSOR extrasmake -j3 install || exit 1cd $CWDdonefiif [ "$LIPO" ]thenecho "building fat binaries..."mkdir -p $FAT/libset - $ARCHSCWD=`pwd`cd $THIN/$1/libfor LIB in *.adocd $CWDlipo -create `find $THIN -name $LIB` -output $FAT/lib/$LIBdonecd $CWDcp -rf $THIN/$1/include $FATfi
4. 下载 gas-preprocessor.pl
https://github.com/libav/gas-preprocessor.git
把gas-preprocessor.pl放到/usr/local/bin/ 目录下
cp gas-preprocessor.pl /usr/local/bin/
platform: AARCH64byte order: little-endiansystem: MACOSXcli: nolibx264: internalshared: nostatic: yesasm: yesinterlaced: yesavs: nolavf: noffms: nomp4: nogpl: yesthread: posixopencl: yesfilters: crop select_every lto: nodebug: nogprof: nostrip: noPIC: yesbit depth: 8chroma format: all从上边可以看出来开启asm加速,开启多线程加速
6. 最终会再x264-iOS 文件夹打包好的lib
7.放到工程里边输出信息
[libx264 @ 0x1408b9400] using cpu capabilities: ARMv8 NEON[libx264 @ 0x1408b9400] profile High, level 3.0说x264再ios能够正常的跑
阅读全文
0 0
- mac 下移植 x264 使用 neon 多线程加速
- mac 下移植 ffmpeg 支持x264 faac lame png 开启asm neon 加速
- 不同平台下移植x264
- windows下使用vs2008编译x264支持多线程
- windows下使用vs2008编译x264支持多线程
- Mac 下为将ffmepg +x264移植到android中(2)
- 【ARM】【NEON加速介绍】
- Neon加速测试
- ARM NEON 编程系列3——使用ARM NEON Intrinsics加速Video Codec
- Mac 下为将ffmepg +x264移植到android中,解决libx264.so.148 库cannot find问题
- mac 下移植 faac
- Windows下编译X264多线程版本
- Windows下编译X264多线程版本
- ARM与NEON指令加速
- neon加速图像转置
- 神经网络arm neon加速实现
- 【亲测】centos7下caffe使用openblas-openmp(多线程版本)多线程加速
- mac下加速ndk代码编译速度
- jfinal数据库连接txt文档
- dfs序详解
- c++实验6-矩阵求和
- 两种复合数列排序方式
- Chapter3.1.2 函数的调用
- mac 下移植 x264 使用 neon 多线程加速
- 【笔记】shiro中的验证码设置:
- Chapter3.1.4python函数的参数
- 如何在frgament里边添加Tabhost
- 系统程序员成长计划
- mysql分数占百分比查询
- Inception V3 的 tensorflow 实现
- 项目经理那些事、一:客户需求是个坑
- 分布式消息系统:Kafka