2 * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3 * Copyright (c) 2002-2007, Professor Benoit Macq
4 * Copyright (c) 2001-2003, David Janssens
5 * Copyright (c) 2002-2003, Yannick Verschueren
6 * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
7 * Copyright (c) 2005, Herve Drolon, FreeImage Team
8 * Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
9 * Copyright (c) 2012, CS Systemes d'Information, France
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
38 @brief Implementation of a multi-component transforms (MCT)
40 The functions in MCT.C have for goal to realize reversible and irreversible multicomponent
41 transform. The functions in MCT.C are used by some function in TCD.C.
44 /** @defgroup MCT MCT - Implementation of a multi-component transform */
47 /** @name Exported functions */
49 /* ----------------------------------------------------------------------- */
51 Apply a reversible multi-component transform to an image
52 @param c0 Samples for red component
53 @param c1 Samples for green component
54 @param c2 Samples blue component
55 @param n Number of samples for each component
57 void opj_mct_encode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
59 Apply a reversible multi-component inverse transform to an image
60 @param c0 Samples for luminance component
61 @param c1 Samples for red chrominance component
62 @param c2 Samples for blue chrominance component
63 @param n Number of samples for each component
65 void opj_mct_decode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
67 Get norm of the basis function used for the reversible multi-component transform
68 @param compno Number of the component (0->Y, 1->U, 2->V)
71 OPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno);
74 Apply an irreversible multi-component transform to an image
75 @param c0 Samples for red component
76 @param c1 Samples for green component
77 @param c2 Samples blue component
78 @param n Number of samples for each component
80 void opj_mct_encode_real(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
82 Apply an irreversible multi-component inverse transform to an image
83 @param c0 Samples for luminance component
84 @param c1 Samples for red chrominance component
85 @param c2 Samples for blue chrominance component
86 @param n Number of samples for each component
88 void opj_mct_decode_real(OPJ_FLOAT32* c0, OPJ_FLOAT32* c1, OPJ_FLOAT32* c2, OPJ_UINT32 n);
90 Get norm of the basis function used for the irreversible multi-component transform
91 @param compno Number of the component (0->Y, 1->U, 2->V)
94 OPJ_FLOAT64 opj_mct_getnorm_real(OPJ_UINT32 compno);
98 @param p_coding_data MCT data
99 @param n size of components
100 @param p_data components
101 @param p_nb_comp nb of components (i.e. size of p_data)
102 @param is_signed tells if the data is signed
103 @return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise
105 OPJ_BOOL opj_mct_encode_custom(
106 OPJ_BYTE * p_coding_data,
109 OPJ_UINT32 p_nb_comp,
110 OPJ_UINT32 is_signed);
113 @param pDecodingData MCT data
114 @param n size of components
115 @param pData components
116 @param pNbComp nb of components (i.e. size of p_data)
117 @param isSigned tells if the data is signed
118 @return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise
120 OPJ_BOOL opj_mct_decode_custom(
121 OPJ_BYTE * pDecodingData,
125 OPJ_UINT32 isSigned);
128 @param pNorms MCT data
129 @param p_nb_comps size of components
130 @param pMatrix components
133 void opj_calculate_norms( OPJ_FLOAT64 * pNorms,
134 OPJ_UINT32 p_nb_comps,
135 OPJ_FLOAT32 * pMatrix);
139 const OPJ_FLOAT64 * opj_mct_get_mct_norms (void);
143 const OPJ_FLOAT64 * opj_mct_get_mct_norms_real (void);
144 /* ----------------------------------------------------------------------- */