FIASCO—An Open-Source Fractal Image and Sequence Codec
The coding method of FIASCO is basically a straightforward generalization of the JPEG method. The JPEG algorithm subdivides an image into a set of image blocks of 8x8 pixels. Each of these blocks is then independently encoded by a linear combination of 64 basis images (the cosine basis, see Resources for details) as shown in Figure 2. The coefficients of these block approximations are then quantized and stored in the output file.
In Figure 2 the image is subdivided into 8x8 pixel blocks. Each of them is approximated by a linear combination of the cosine basis. The approximation coefficients (a and b in the figure) are then quantized and stored in the JPEG file. FIASCO extends this concept in the following ways:
The image is adaptively subdivided into subblocks (squares or rectangles) of different size. Smaller blocks than those used in smooth regions are used in difficult areas.
Each image block is approximated by image blocks of a dynamic dictionary. The dictionary not only contains a fixed set of basis images (e.g., the well-known JPEG cosine images) but also all previously encoded image blocks. This method is related to text compression algorithms, which also use dynamically generated dictionaries (e.g., LZW compression).
When coding videos, only the difference between subsequent frames is encoded by hierarchical motion compensation.
FIASCO exploits self-similarities within single pictures, and also sequences of pictures, to remove spatial, spectral and temporal redundancies, making it a typical fractal coding method.
The FIASCO package is released under the terms of the GNU General Public License and is built up of command line applications and a library to compress, decode and visualize images and videos. You just have to run the typical GNU build process (./configure;make;make install) to compile and install the FIASCO package. FIASCO is entirely written in ANSI C and should compile on most UNIX platforms.
Usage of the commandline FIASCO coder and decoder is similar to the cjpeg and djpeg applications of the IJPEG package (Independent JPEG group), which should be part of every Linux distribution.
cfiasco --quality=10 --output=video.fco frame0*.ppm
The above encodes the given video files (in raw PNM format) with quality ten, writing a single FIASCO file video.fco. Please note that you cannot compare the quality settings of FIASCO with JPEG. The typical quality range of FIASCO is 1-100, which corresponds to a JPEG quality less than five. FIASCO is intended for very low bit rates only; i.e., you cannot compute compressed images that correspond to a JPEG quality of 75.
dfiasco, the FIASCO decoder, is also used like djpeg:
dfiasco --output=image.ppm image.fco
This decodes the given FIASCO file and writes a new image in PNM format. But dfiasco also contains a display module to show video frames in an X11 window. Currently, only an Xlib-based window with the typical set of control buttons is available (play, stop, forward, etc.). Hopefully, this simple decoder and the FIASCO library provides a good starting point for developers to support the FIASCO format in their favorite image and video programs (Mozilla, GIMP, etc.). Please visit the home page of FIASCO to get some compressed images and videos (see Resources).
The coding and decoding functionality of FIASCO is available in a shared library. Data type definitions and function prototypes are provided by the include file fiasco.h, which is installed in the $prefix/include directory.
You can simply compress images or videos in your application by a function call:
fiasco_coder (image_names, fiasco_name, quality, NULL)
This call compresses the image file(s) given by the array image_names with the predefined approximation quality (1.0-100.0) and creates the new FIASCO output file fiasco_name. Several advanced compression parameters can be adjusted by using an optional parameter object which I don't describe here, see the FIASCO manual pages for details.
In order to decode a FIASCO file in your application, you have to instantiate an object of the decoder class fiasco_decoder_t with a call of the constructor function fiasco_decoder_new (fiasco_name, NULL). fiasco_name specifies the file to decode whereas the second parameter is an optional parameter object to adjust the behavior of the decoder.
Individual frames are then decoded by subsequent calls of the method fiasco_decoder_get_frame. These frames are returned in an internal FIASCO format, which then can be rendered in different ways to fit the needs of your application. For more information about the compression library, refer to the manual pages shipped with FIASCO.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Chris Birchall's Re-Engineering Legacy Software (Manning Publications)
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- ServersCheck's Thermal Imaging Camera Sensor
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Privacy and the New Math
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide