libjpeg-turbo static
Posted: Wed Mar 02, 2016 9:31 am
Has anyone here ever successfully used the static lib of libjpeg-turbo ?
I wanted to try it to see if it decodes jpeg much faster or not.
On both OSX and Linux I could use the pre-build static lib without much problems but on Windows 10 I get linker errors I don't know how to solve.
The unresolved external symbols are __ms_vsnprintf and _putenv .
Example code
I wanted to try it to see if it decodes jpeg much faster or not.
On both OSX and Linux I could use the pre-build static lib without much problems but on Windows 10 I get linker errors I don't know how to solve.
The unresolved external symbols are __ms_vsnprintf and _putenv .
Example code
Code: Select all
DataSection
jpeg_start:
IncludeBinary "MyImage.jpg"
jpeg_end:
EndDataSection
Enumeration
#TJPF_RGB
#TJPF_BGR
#TJPF_RGBX
#TJPF_BGRX
EndEnumeration
Enumeration
#TJSAMP_444
#TJSAMP_422
#TJSAMP_420
EndEnumeration
ImportC "libturbojpeg.a"
tjAlloc(bytes)
tjCompress2.l(handle, *srcBuf, width, pitch, height, pixelFormat, *p_jpegBuf, *jpegSize, jpegSubsamp, jpegQual, flags)
tjDecompress2.l(handle, *jpegBuf, jpegSize, *dstBuf, width, pitch, height, pixelFormat, flags)
tjDecompressHeader3.l(handle, *jpegBuf, jpegSize, *width, *height, *jpegSubsamp, *jpegColorspace)
tjFree(*buffer)
tjGetErrorStr()
tjInitCompress()
tjInitDecompress()
EndImport
handle = tjInitDecompress()
tjDecompressHeader3(handle, ?jpeg_start, ?jpeg_end - ?jpeg_start, @width, @height, @subsamp, @cs)
*m = AllocateMemory(width * height * 4, #PB_Memory_NoClear)
tjDecompress2(handle, ?jpeg_start, ?jpeg_end - ?jpeg_start, *m, width, 0, height, #TJPF_RGBX, 0)
End