Fix typos in comments and string
[openjpeg.git] / src / lib / openjp3d / dwt.h
1 /*
2  * The copyright in this software is being made available under the 2-clauses 
3  * BSD License, included below. This software may be subject to other third 
4  * party and contributor rights, including patent rights, and no such rights
5  * are granted under this license.
6  *
7  * Copyright (c) 2001-2003, David Janssens
8  * Copyright (c) 2002-2003, Yannick Verschueren
9  * Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
10  * Copyright (c) 2005, Herve Drolon, FreeImage Team
11  * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
12  * Copyrigth (c) 2006, M�nica D�ez, LPI-UVA, Spain
13  * All rights reserved.
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  * 1. Redistributions of source code must retain the above copyright
19  *    notice, this list of conditions and the following disclaimer.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the distribution.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
25  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  */
36
37 #ifndef __DWT_H
38 #define __DWT_H
39 /**
40 @file dwt.h
41 @brief Implementation of a discrete wavelet transform (DWT)
42
43 The functions in DWT.C have for goal to realize forward and inverse discret wavelet
44 transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in
45 DWT.C are used by some function in TCD.C.
46 */
47
48 /** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
49 /*@{*/
50
51 /**
52 DCCS-LIWT properties
53 */
54
55
56 typedef struct opj_wtfilt {
57         double *LPS;
58         int lenLPS;
59         double *HPS;
60         int lenHPS;
61 } opj_wtfilt_t;
62 /** @name Funciones generales */
63 /*@{*/
64 /* ----------------------------------------------------------------------- */
65 /**
66 Forward 5-3 wavelet transform in 3-D.
67 Apply a reversible DWT transform to a component of an volume.
68 @param tilec Tile component information (current tile)
69 @param dwtid Number of identification of wavelet kernel(s) used in DWT in each direction
70 */
71 void dwt_encode(opj_tcd_tilecomp_t * tilec, int dwtid[3]);
72 /**
73 Inverse 5-3 wavelet transform in 3-D.
74 Apply a reversible inverse DWT transform to a component of an volume.
75 @param tilec Tile component information (current tile)
76 @param stops Number of decoded resolution levels in each dimension
77 @param dwtid Number of identification of wavelet kernel(s) used in DWT in each dimension
78 */
79 void dwt_decode(opj_tcd_tilecomp_t * tilec, int stops[3], int dwtid[3]);
80 /* ----------------------------------------------------------------------- */
81 /**
82 Get the gain of a subband for the reversible 3-D DWT.
83 @param orient Number that identifies the subband (0->LLL, 1->HLL, 2->LHL, 3->HHL, 4->LLH, 5->HLH, 6->LHH, 7->HHH)
84 @param reversible Wavelet transformation type
85 @return Returns 0 if orient = 0, returns 1 if orient = 1,2 or 4, returns 2 if orient = 3,5 or 6, returns 3 otherwise
86 */
87 int dwt_getgain(int orient, int reversible);
88 /**
89 Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT or irreversible 9-7 in 3-D.
90 @param orient Band of the wavelet function
91 @param level Levels of the wavelet function in X,Y,Z axis
92 @param dwtid Wavelet transformation identifier
93 @return Returns the norm of the wavelet function
94 */
95 double dwt_getnorm(int orient, int level[3], int dwtid[3]);
96 /* ----------------------------------------------------------------------- */
97 /**
98 Calcula el valor del escal�n de cuantificaci�n correspondiente a cada subbanda.
99 @param tccp Tile component coding parameters
100 @param prec Precision of data
101 */
102 void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec);
103 /*@}*/
104 /*@}*/
105
106 #endif /* __DWT_H */