2 * Copyright (c) 2001-2003, David Janssens
3 * Copyright (c) 2002-2003, Yannick Verschueren
4 * Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
5 * Copyright (c) 2005, Hervé Drolon, FreeImage Team
6 * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
35 @brief Implementation of a discrete wavelet transform (DWT)
37 The functions in DWT.C have for goal to realize forward and inverse discret wavelet
38 transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in
39 DWT.C are used by some function in TCD.C.
42 /** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
46 /** @name Exported functions */
48 /* ----------------------------------------------------------------------- */
50 Forward 5-3 wavelet tranform in 2-D.
51 Apply a reversible DWT transform to a component of an image.
52 @param tilec Tile component information (current tile)
54 void dwt_encode(opj_tcd_tilecomp_t * tilec);
56 Inverse 5-3 wavelet tranform in 2-D.
57 Apply a reversible inverse DWT transform to a component of an image.
58 @param tilec Tile component information (current tile)
59 @param stop FIXME Number of decoded resolution levels ?
61 void dwt_decode(opj_tcd_tilecomp_t * tilec, int stop);
63 Get the gain of a subband for the reversible 5-3 DWT.
64 @param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
65 @return Returns 0 if orient = 0, returns 1 if orient = 1 or 2, returns 2 otherwise
67 int dwt_getgain(int orient);
69 Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
70 @param level Level of the wavelet function
71 @param orient Band of the wavelet function
72 @return Returns the norm of the wavelet function
74 double dwt_getnorm(int level, int orient);
76 Forward 9-7 wavelet transform in 2-D.
77 Apply an irreversible DWT transform to a component of an image.
78 @param tilec Tile component information (current tile)
80 void dwt_encode_real(opj_tcd_tilecomp_t * tilec);
82 Inverse 9-7 wavelet transform in 2-D.
83 Apply an irreversible inverse DWT transform to a component of an image.
84 @param tilec Tile component information (current tile)
85 @param stop FIXME Number of decoded resolution levels ?
87 void dwt_decode_real(opj_tcd_tilecomp_t * tilec, int stop);
89 Get the gain of a subband for the irreversible 9-7 DWT.
90 @param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)
91 @return Returns the gain of the 9-7 wavelet transform
93 int dwt_getgain_real(int orient);
95 Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT
96 @param level Level of the wavelet function
97 @param orient Band of the wavelet function
98 @return Returns the norm of the 9-7 wavelet
100 double dwt_getnorm_real(int level, int orient);
106 void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec);
107 /* ----------------------------------------------------------------------- */