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