xref: /aosp_15_r20/external/pdfium/third_party/libopenjpeg/dwt.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1*3ac0a46fSAndroid Build Coastguard Worker /*
2*3ac0a46fSAndroid Build Coastguard Worker  * The copyright in this software is being made available under the 2-clauses
3*3ac0a46fSAndroid Build Coastguard Worker  * BSD License, included below. This software may be subject to other third
4*3ac0a46fSAndroid Build Coastguard Worker  * party and contributor rights, including patent rights, and no such rights
5*3ac0a46fSAndroid Build Coastguard Worker  * are granted under this license.
6*3ac0a46fSAndroid Build Coastguard Worker  *
7*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
8*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2002-2014, Professor Benoit Macq
9*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2001-2003, David Janssens
10*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2002-2003, Yannick Verschueren
11*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2003-2007, Francois-Olivier Devaux
12*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2003-2014, Antonin Descampe
13*3ac0a46fSAndroid Build Coastguard Worker  * Copyright (c) 2005, Herve Drolon, FreeImage Team
14*3ac0a46fSAndroid Build Coastguard Worker  * All rights reserved.
15*3ac0a46fSAndroid Build Coastguard Worker  *
16*3ac0a46fSAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
17*3ac0a46fSAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions
18*3ac0a46fSAndroid Build Coastguard Worker  * are met:
19*3ac0a46fSAndroid Build Coastguard Worker  * 1. Redistributions of source code must retain the above copyright
20*3ac0a46fSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer.
21*3ac0a46fSAndroid Build Coastguard Worker  * 2. Redistributions in binary form must reproduce the above copyright
22*3ac0a46fSAndroid Build Coastguard Worker  *    notice, this list of conditions and the following disclaimer in the
23*3ac0a46fSAndroid Build Coastguard Worker  *    documentation and/or other materials provided with the distribution.
24*3ac0a46fSAndroid Build Coastguard Worker  *
25*3ac0a46fSAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
26*3ac0a46fSAndroid Build Coastguard Worker  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27*3ac0a46fSAndroid Build Coastguard Worker  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28*3ac0a46fSAndroid Build Coastguard Worker  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29*3ac0a46fSAndroid Build Coastguard Worker  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30*3ac0a46fSAndroid Build Coastguard Worker  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31*3ac0a46fSAndroid Build Coastguard Worker  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32*3ac0a46fSAndroid Build Coastguard Worker  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33*3ac0a46fSAndroid Build Coastguard Worker  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34*3ac0a46fSAndroid Build Coastguard Worker  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35*3ac0a46fSAndroid Build Coastguard Worker  * POSSIBILITY OF SUCH DAMAGE.
36*3ac0a46fSAndroid Build Coastguard Worker  */
37*3ac0a46fSAndroid Build Coastguard Worker 
38*3ac0a46fSAndroid Build Coastguard Worker #ifndef OPJ_DWT_H
39*3ac0a46fSAndroid Build Coastguard Worker #define OPJ_DWT_H
40*3ac0a46fSAndroid Build Coastguard Worker /**
41*3ac0a46fSAndroid Build Coastguard Worker @file dwt.h
42*3ac0a46fSAndroid Build Coastguard Worker @brief Implementation of a discrete wavelet transform (DWT)
43*3ac0a46fSAndroid Build Coastguard Worker 
44*3ac0a46fSAndroid Build Coastguard Worker The functions in DWT.C have for goal to realize forward and inverse discret wavelet
45*3ac0a46fSAndroid Build Coastguard Worker transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in
46*3ac0a46fSAndroid Build Coastguard Worker DWT.C are used by some function in TCD.C.
47*3ac0a46fSAndroid Build Coastguard Worker */
48*3ac0a46fSAndroid Build Coastguard Worker 
49*3ac0a46fSAndroid Build Coastguard Worker /** @defgroup DWT DWT - Implementation of a discrete wavelet transform */
50*3ac0a46fSAndroid Build Coastguard Worker /*@{*/
51*3ac0a46fSAndroid Build Coastguard Worker 
52*3ac0a46fSAndroid Build Coastguard Worker 
53*3ac0a46fSAndroid Build Coastguard Worker /** @name Exported functions */
54*3ac0a46fSAndroid Build Coastguard Worker /*@{*/
55*3ac0a46fSAndroid Build Coastguard Worker /* ----------------------------------------------------------------------- */
56*3ac0a46fSAndroid Build Coastguard Worker /**
57*3ac0a46fSAndroid Build Coastguard Worker Forward 5-3 wavelet transform in 2-D.
58*3ac0a46fSAndroid Build Coastguard Worker Apply a reversible DWT transform to a component of an image.
59*3ac0a46fSAndroid Build Coastguard Worker @param p_tcd TCD handle
60*3ac0a46fSAndroid Build Coastguard Worker @param tilec Tile component information (current tile)
61*3ac0a46fSAndroid Build Coastguard Worker */
62*3ac0a46fSAndroid Build Coastguard Worker OPJ_BOOL opj_dwt_encode(opj_tcd_t *p_tcd,
63*3ac0a46fSAndroid Build Coastguard Worker                         opj_tcd_tilecomp_t * tilec);
64*3ac0a46fSAndroid Build Coastguard Worker 
65*3ac0a46fSAndroid Build Coastguard Worker /**
66*3ac0a46fSAndroid Build Coastguard Worker Inverse 5-3 wavelet transform in 2-D.
67*3ac0a46fSAndroid Build Coastguard Worker Apply a reversible inverse DWT transform to a component of an image.
68*3ac0a46fSAndroid Build Coastguard Worker @param p_tcd TCD handle
69*3ac0a46fSAndroid Build Coastguard Worker @param tilec Tile component information (current tile)
70*3ac0a46fSAndroid Build Coastguard Worker @param numres Number of resolution levels to decode
71*3ac0a46fSAndroid Build Coastguard Worker */
72*3ac0a46fSAndroid Build Coastguard Worker OPJ_BOOL opj_dwt_decode(opj_tcd_t *p_tcd,
73*3ac0a46fSAndroid Build Coastguard Worker                         opj_tcd_tilecomp_t* tilec,
74*3ac0a46fSAndroid Build Coastguard Worker                         OPJ_UINT32 numres);
75*3ac0a46fSAndroid Build Coastguard Worker 
76*3ac0a46fSAndroid Build Coastguard Worker /**
77*3ac0a46fSAndroid Build Coastguard Worker Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
78*3ac0a46fSAndroid Build Coastguard Worker @param level Level of the wavelet function
79*3ac0a46fSAndroid Build Coastguard Worker @param orient Band of the wavelet function
80*3ac0a46fSAndroid Build Coastguard Worker @return Returns the norm of the wavelet function
81*3ac0a46fSAndroid Build Coastguard Worker */
82*3ac0a46fSAndroid Build Coastguard Worker OPJ_FLOAT64 opj_dwt_getnorm(OPJ_UINT32 level, OPJ_UINT32 orient);
83*3ac0a46fSAndroid Build Coastguard Worker /**
84*3ac0a46fSAndroid Build Coastguard Worker Forward 9-7 wavelet transform in 2-D.
85*3ac0a46fSAndroid Build Coastguard Worker Apply an irreversible DWT transform to a component of an image.
86*3ac0a46fSAndroid Build Coastguard Worker @param p_tcd TCD handle
87*3ac0a46fSAndroid Build Coastguard Worker @param tilec Tile component information (current tile)
88*3ac0a46fSAndroid Build Coastguard Worker */
89*3ac0a46fSAndroid Build Coastguard Worker OPJ_BOOL opj_dwt_encode_real(opj_tcd_t *p_tcd,
90*3ac0a46fSAndroid Build Coastguard Worker                              opj_tcd_tilecomp_t * tilec);
91*3ac0a46fSAndroid Build Coastguard Worker /**
92*3ac0a46fSAndroid Build Coastguard Worker Inverse 9-7 wavelet transform in 2-D.
93*3ac0a46fSAndroid Build Coastguard Worker Apply an irreversible inverse DWT transform to a component of an image.
94*3ac0a46fSAndroid Build Coastguard Worker @param p_tcd TCD handle
95*3ac0a46fSAndroid Build Coastguard Worker @param tilec Tile component information (current tile)
96*3ac0a46fSAndroid Build Coastguard Worker @param numres Number of resolution levels to decode
97*3ac0a46fSAndroid Build Coastguard Worker */
98*3ac0a46fSAndroid Build Coastguard Worker OPJ_BOOL opj_dwt_decode_real(opj_tcd_t *p_tcd,
99*3ac0a46fSAndroid Build Coastguard Worker                              opj_tcd_tilecomp_t* OPJ_RESTRICT tilec,
100*3ac0a46fSAndroid Build Coastguard Worker                              OPJ_UINT32 numres);
101*3ac0a46fSAndroid Build Coastguard Worker 
102*3ac0a46fSAndroid Build Coastguard Worker /**
103*3ac0a46fSAndroid Build Coastguard Worker Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT
104*3ac0a46fSAndroid Build Coastguard Worker @param level Level of the wavelet function
105*3ac0a46fSAndroid Build Coastguard Worker @param orient Band of the wavelet function
106*3ac0a46fSAndroid Build Coastguard Worker @return Returns the norm of the 9-7 wavelet
107*3ac0a46fSAndroid Build Coastguard Worker */
108*3ac0a46fSAndroid Build Coastguard Worker OPJ_FLOAT64 opj_dwt_getnorm_real(OPJ_UINT32 level, OPJ_UINT32 orient);
109*3ac0a46fSAndroid Build Coastguard Worker /**
110*3ac0a46fSAndroid Build Coastguard Worker Explicit calculation of the Quantization Stepsizes
111*3ac0a46fSAndroid Build Coastguard Worker @param tccp Tile-component coding parameters
112*3ac0a46fSAndroid Build Coastguard Worker @param prec Precint analyzed
113*3ac0a46fSAndroid Build Coastguard Worker */
114*3ac0a46fSAndroid Build Coastguard Worker void opj_dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, OPJ_UINT32 prec);
115*3ac0a46fSAndroid Build Coastguard Worker /* ----------------------------------------------------------------------- */
116*3ac0a46fSAndroid Build Coastguard Worker /*@}*/
117*3ac0a46fSAndroid Build Coastguard Worker 
118*3ac0a46fSAndroid Build Coastguard Worker /*@}*/
119*3ac0a46fSAndroid Build Coastguard Worker 
120*3ac0a46fSAndroid Build Coastguard Worker #endif /* OPJ_DWT_H */
121