Series
Guide
build requirements
Build Requirements
- cmake 2.8
- NASM 2.13
- Visual Studio 2015
- libjpeg-turbo 1.5.4
If using
NASM, 2.05 or later is required for an x86-64 build.nasm.exe/yasm.exeshould be in your PATH.
download
1 | git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git |
install nasm
1 | wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.03rc1/win64/nasm-2.13.03rc1-installer-x64.exe |
add
C:\Program Files\NASMto env path.
compile libjpeg
1 | cmake-gui .. |
with options
CMAKE_BUILD_TYPE = Release
ENABLE_SHARED = ON
CMAKE_INSTALL_PREFIX = d:/libjpeg-turbo64
NASM = C:/Program Files/NASM/nasm.exe
configure and generate sln, compile with visual studio 2015 and install.
usage with cmake
libjpegturbo-config.cmake
1 | set(LIBJPEGTURBO_FOUND TRUE) # auto |
CMakeLists.txt
1 | find_package(LIBJPEGTURBO REQUIRED) |
Example Code
jpeglib vs turbojpeg
jpeglib
- include:
#include "jpeglib.h" - lib:
jpeg.lib - dll:
jpeg62.dll
turbojpeg
- include:
#include "turbojpeg.h" - lib:
turbojpeg.lib - dll:
turbojpeg.dll
turbojpeg is (3-5x) faster than jpeglib.
jpeglib
see jpeglib.cpp
turbojpeg
see turbojpeg.cpp
Reference
- example.c
- building
- turbo offical doc
- compress and decompress jpeg
- opencv imdecode to libjpeg-turbo (good)
- tjcompress and tjdecompress
History
- 20180201: created.
- 20180202: add example code.