官方源码:http://code.google.com/p/libyuv/
简介:
1 2 3 4 5 6 7 8 |
libyuv is an open source project that includes YUV scaling and conversion functionality. Scale YUV to prepare content for compression, with point, bilinear or box filter. Convert to YUV from webcam formats. Convert from YUV to formats for rendering/effects. Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode. Optimized for SSE2/SSSE3/AVX2 on x86/x64. <strong>Optimized for Neon on Arm.</strong> Optimized for DSP R2 on Mips. |
YUV层的缩放,色彩空间转换(nv21/nv12 to i420,i420 to rgb565/rgb888),针对ARMv7使用NEON指令集优化.实际项目使用中测试,缩放/转换性能秒杀ffmpeg的libswscale
按官方的编译方法太麻烦,需要装depot tools,ninja
这里直接用android make 方便的多.
默认编译为so动态库,通过LOCAL_SHARED_LIBRARIES在Android.mk中引入,并且需要在java接口种System.loadLibrary(“yuv”); 加载
也可以修改Android.mk最后一行为include $(BUILD_STATIC_LIBRARY)编译为.a静态库直接链接
也可以加入到你的jni项目中一起编译.
github:https://github.com/illuspas/libyuv-android
原创文章,转载请注明: 转载自贝壳博客
本文链接地址: 使用 NDK 编译 libyuv
楼主,只对nv21图像做旋转和裁剪的操作,libyuv性能比libswscale好吗
如果单做x86平台的话 建议用libswscale
如果做ARM,x86多平台,用libyuv
不错!!!!