基于Linux编译libyuv库

在极致化使用硬件设备的今天,每个AI算法工程师都也是希望将硬件资源压榨干净,算法的实现是第一阶段,而算法的进一步加速便提上了日程

这里要介绍的是libyuv库,它是实现YUV格式簇转RGB和预处理图片的一个高效工具。

1.下载libyuv源码

https://github.com/lemenkov/libyuv

2.解压和编译

unzip libyuv && cd libyuv && mkdir build && cd build

cmake -DCMAKE_INSTALL_PREFIX={your install path}/libyuv -DCMAKE_BUILD_TYPE="Release" ..

#如果报警告:
#CMake Warning (dev) at CMakeLists.txt:45 (if):
#Policy CMP0064 is not set: Support new TEST if() operator.  Run #"cmake #  --help-policy CMP0064" for policy details.  Use the #cmake_policy #command to set the policy and suppress this #warning.
#将CMakeLists.txt的最小cmake版本由2.8设置为3.4,重新清除、编译

cmake --build . --target install --config Release

cd {your install path}/include

cp libyuv.h libyuv

编译完成!

猜你喜欢

转载自www.cnblogs.com/nanmi/p/13390468.html