Abstract
A decoder for images compressed by the JPEG algorithm is stated in the pure functional programming language Gofer. The program can be regarded as a mathematical specification of the decompression algorithm; the concise description (which is included almost in full) is very suitable for learning about the algorithm. At the same time the ‘specification’ is an executable program, which shows the usefulness of a functional programming language as a prototyping tool for graphics algorithms.
All functions are defined as much as possible at the function level, i.e., as compositions of other functions. A tutorial on the important concept of a ‘State Monad’, which plays an important role in the program, is included. From a functional programming theoretical point of view, the new technique of currying a state monad, which is introduced, and its application in the program, are interesting.
Keywords
- Discrete Cosine Transform
- State Function
- Discrete Cosine Transform Coefficient
- Functional Programming
- Inverse Discrete Cosine Transform
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Richard Bird and Philip Wadler. Introduction to functional programming. New York: Prentice Hall, 1988.
Pieter Hartel and Willem Vree. ‘Arrays in a lazy functional language — a case study: the Fast Fourier Transform’. In: 2nd Arrays, functional languages, and parallel systems (G. Hains, ed.). Montréal: Dept. d’informatique, Université de Montréal (publication 841), 1992, pp. 52–66.
Hudak and Fasel. ‘A gentle introduction to Haskell’. ACM Sigplan Notices 27, 5 (may 1992), pp. Tl—T53.
Mark P. Jones. ‘A system of constructor classes: overloading and implicit higher-order polymorphism’. In: FPCA ‘83: Conference on Functional Programming and Computer Architecture. New York: ACM Press, 1993. http://www.cs.nott.ac.uk/Department/Staff/mpj/fpca93.html
Mark P. Jones. Gofer 2.30 release notes. ftp.cs.nott.ac.uk/nott-fp/languages/gofer.
Mark P. Jones. ‘Functional programming with overloading and higher-order polymorphism’. In: Lecture Notes of the 1st International Spring School on Advanced Functional Programming Techniques (Johan Jeuring and Erik Meijer, eds). Berlin: Springer, 1995 (LNCS 925).
International Standards Organization. Digital compression and coding of continuous-tone still images. Draft International Standard DIS 10918–1. (reprinted in [8]).
William Pennebaker and Joan Mitchell. JPEG still image data compression standard. New York: Van Nostrand Reinhold, 1993.
Rinus Plasmeijer and Marko van Eekelen. Concurrent Clean Language Report. Nijmegen: Dept. of Computer Science, University of Nijmegen, the Netherlands, 1995 (to appear). ftp.cs.kun.nl/pub/Clean.
Philip Wadler. ‘The Essence of Functional Programming’. In: 19th Annual ACM SIGPLAN Symposium on Principles of Programming Languages. Santa Fe, 1992 (pp. 1–14 ). also: ftp.dcs.glasgow.ac.uk/pub/glasgow-fp/papers/essence-of-fp.ps.Z.
Gregory Wallace. ‘The JPEG still picture compression standard’. Communications of the ACM 34,4, 1991 (pp. 30 14). also: ftp.uu.net/graphics/jpeg/wallace.ps.gz.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1995 Springer-Verlag/Wien
About this paper
Cite this paper
Fokker, J. (1995). Functional Specification of JPEG Decompression, and an Implementation for Free. In: Veltkamp, R.C., Blake, E.H. (eds) Programming Paradigms in Graphics. Eurographics. Springer, Vienna. https://doi.org/10.1007/978-3-7091-9457-7_8
Download citation
DOI: https://doi.org/10.1007/978-3-7091-9457-7_8
Publisher Name: Springer, Vienna
Print ISBN: 978-3-211-82788-8
Online ISBN: 978-3-7091-9457-7
eBook Packages: Springer Book Archive