Difference between revisions of "Applications/Libjpeg-turbo"

From HPC
Jump to: navigation , search
(Created page with "__TOC__ ==Application Details== *Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, AVX2, NEON, AltiVec) to accelerate baseline JPEG comp...")
 
m (Further Information)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
 
==Application Details==
 
==Application Details==
*Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, AVX2, NEON, AltiVec) to accelerate baseline JPEG compression .
+
*Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, AVX2, NEON, AltiVec) to accelerate baseline JPEG compression. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface.  
 
*Version: 1.5.1 (compiled with gcc)
 
*Version: 1.5.1 (compiled with gcc)
 
*Module: gcc/1.5.1
 
*Module: gcc/1.5.1
 
*Licence: GNU
 
*Licence: GNU
 +
  
 
==Usage Examples==
 
==Usage Examples==
  
 
===Module===
 
===Module===
 +
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 +
 
[username@login01 ~]$ module add libjpeg-turbo/gcc/1.5.1
 
[username@login01 ~]$ module add libjpeg-turbo/gcc/1.5.1
 +
 
</pre>
 
</pre>
  
Line 46: Line 50:
  
 
Compilation is carried out below, in this example the '''gcc''' compiler is used. However, the applies similarly to the Intel compiler too.
 
Compilation is carried out below, in this example the '''gcc''' compiler is used. However, the applies similarly to the Intel compiler too.
 +
  
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
Line 54: Line 59:
  
  
 +
==Further Information==
  
 +
* [http://www.libjpeg-turbo.org/ http://www.libjpeg-turbo.org/]
  
==Further Information==
+
{{Librariespagenav}}
 
 
[http://www.libjpeg-turbo.org/ http://www.libjpeg-turbo.org/]
 

Latest revision as of 11:06, 16 November 2022

Application Details

  • Description: libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, AVX2, NEON, AltiVec) to accelerate baseline JPEG compression. libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface.
  • Version: 1.5.1 (compiled with gcc)
  • Module: gcc/1.5.1
  • Licence: GNU


Usage Examples

Module


[username@login01 ~]$ module add libjpeg-turbo/gcc/1.5.1

Compilation

Libjpeg-turbo is a library for use either with a compiled binary that requires it, or it could be required at compilation time also.

A typical code snippet (C++) requiring is shown below:


#include <turbojpeg.h>

const int JPEG_QUALITY = 85;
const int COLOR_COMPONENTS = 3;
int _width = 640;
int _height = 720;
long unsigned int _jpegSize = 0;
unsigned char* _compressedImage = NULL;
unsigned char buffer[_width*_height*COLOR_COMPONENTS];

tjhandle _jpegCompressor = tjInitCompress();

tjCompress2(_jpegCompressor, buffer, _width, 0, _height, TJPF_RGB,
          &_compressedImage, &_jpegSize, TJSAMP_444, JPEG_QUALITY,
          TJFLAG_FASTDCT);

tjDestroy(_jpegCompressor);

//to free the memory allocated by TurboJPEG 

tjFree(&_compressedImage);

Compilation is carried out below, in this example the gcc compiler is used. However, the applies similarly to the Intel compiler too.



gcc -o tjIMAGE tjIMAGE.cpp -lm -ljpeg


Further Information





Libraries | Main Page | Further Topics