JuicyPixels-3.3.9: Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance)

Safe Haskell | None
Language | Haskell2010

Codec.Picture.Jpg.Internal.FastIdct

Description

Module providing a `fast` implementation of IDCT

inverse two dimensional DCT, Chen-Wang algorithm (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) 32-bit integer arithmetic (8 bit coefficients) 11 mults, 29 adds per DCT sE, 18.8.91

coefficients extended to 12 bit for IEEE1180-1990 compliance sE, 2.1.94

this code assumes >> to be a two's-complement arithmetic right shift: (-2)>>1 == -1 , (-3)>>1 == -2

Synopsis

- type MutableMacroBlock s a = STVector s a
- fastIdct :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- mutableLevelShift :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- createEmptyMutableMacroBlock :: (Storable a, Num a) => ST s (MutableMacroBlock s a)

# Documentation

type MutableMacroBlock s a = STVector s a #

Macroblock that can be transformed.

fastIdct :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

Algorithm to call to perform an IDCT, return the same block that the one given as input.

mutableLevelShift :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

Perform a Jpeg level shift in a mutable fashion.

createEmptyMutableMacroBlock :: (Storable a, Num a) => ST s (MutableMacroBlock s a) #

Create a new macroblock with the good array size