X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libopenjpeg%2Fdwt.h;h=c2ed90fff7ecec52c7f7184f32e878b7dd0da6d5;hb=6561d70664fff4c714a4656f590121bdf056e51b;hp=ec9860b6b11e682dc5c27bffcfb738253c0bc067;hpb=ec9bd9f6a455a83da8c2c77f5b2628b416cca18f;p=openjpeg.git diff --git a/libopenjpeg/dwt.h b/libopenjpeg/dwt.h index ec9860b6..c2ed90ff 100644 --- a/libopenjpeg/dwt.h +++ b/libopenjpeg/dwt.h @@ -1,7 +1,10 @@ /* - * Copyright (c) 2001-2002, David Janssens + * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2007, Professor Benoit Macq + * Copyright (c) 2001-2003, David Janssens * Copyright (c) 2002-2003, Yannick Verschueren - * Copyright (c) 2002-2003, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium + * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe + * Copyright (c) 2005, Herve Drolon, FreeImage Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,76 +29,99 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "tcd.h" - #ifndef __DWT_H #define __DWT_H +/** +@file dwt.h +@brief Implementation of a discrete wavelet transform (DWT) -/* - * Apply a reversible DWT transform to a component of an image - * a: samples of the component - * w: width of the component - * h: height of the component - * tilec : tile component information (present tile) - * l: number of decomposition levels in the DWT - */ -/* void dwt_encode(int* a, int w, int h, int l); */ -void dwt_encode(int *a, int w, int h, tcd_tilecomp_t * tilec, int l); -/* - * Apply a reversible inverse DWT transform to a component of an image - * a: samples of the component - * w: width of the component - * h: height of the component - * tilec : tile component information (present tile) - * l: number of decomposition levels in the DWT - * row_tilec : tile component information (previous tile on the same row) - * col_tilec : tile component information (previous tile on the same column) - */ -void dwt_decode(int *a, int w, int h, tcd_tilecomp_t * tilec, int l, - int stop); +The functions in DWT.C have for goal to realize forward and inverse discret wavelet +transform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in +DWT.C are used by some function in TCD.C. +*/ -/* - * Get the gain of a subband for the reversible DWT - * orient: number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH) - */ +/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */ +/*@{*/ + + +/** @name Exported functions */ +/*@{*/ +/* ----------------------------------------------------------------------- */ +/** +Forward 5-3 wavelet tranform in 2-D. +Apply a reversible DWT transform to a component of an image. +@param tilec Tile component information (current tile) +*/ +void dwt_encode(opj_tcd_tilecomp_t * tilec); +/** +Inverse 5-3 wavelet tranform in 2-D. +Apply a reversible inverse DWT transform to a component of an image. +@param tilec Tile component information (current tile) +@param numres Number of resolution levels to decode +*/ +#ifdef OPJ_V1 +void dwt_decode(opj_tcd_tilecomp_t* tilec, int numres); +#endif +opj_bool dwt_decode(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres); + +opj_bool dwt_decode_v2(opj_tcd_tilecomp_v2_t* tilec, OPJ_UINT32 numres); + +/** +Get the gain of a subband for the reversible 5-3 DWT. +@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH) +@return Returns 0 if orient = 0, returns 1 if orient = 1 or 2, returns 2 otherwise +*/ int dwt_getgain(int orient); -/* - * Get the norm of a wavelet function of a subband at a specified level for the reversible DWT - * level: level of the wavelet function - * orient: band of the wavelet function - */ +OPJ_UINT32 dwt_getgain_v2(OPJ_UINT32 orient) ; +/** +Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT. +@param level Level of the wavelet function +@param orient Band of the wavelet function +@return Returns the norm of the wavelet function +*/ double dwt_getnorm(int level, int orient); +/** +Forward 9-7 wavelet transform in 2-D. +Apply an irreversible DWT transform to a component of an image. +@param tilec Tile component information (current tile) +*/ +void dwt_encode_real(opj_tcd_tilecomp_t * tilec); +/** +KEEP TRUNK VERSION + return type of v2 because rev557 +Inverse 9-7 wavelet transform in 2-D. +Apply an irreversible inverse DWT transform to a component of an image. +@param tilec Tile component information (current tile) +@param numres Number of resolution levels to decode +*/ +// V1 void dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres); +opj_bool dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres); -/* - * Apply an irreversible DWT transform to a component of an image - * a: samples of the component - * w: width of the component - * h: height of the component - * l: number of decomposition levels in the DWT - */ -void dwt_encode_real(int *a, int w, int h, tcd_tilecomp_t * tilec, int l); +opj_bool dwt_decode_real_v2(opj_tcd_tilecomp_v2_t* restrict tilec, OPJ_UINT32 numres); -/* - * Apply an irreversible inverse DWT transform to a component of an image - * a: samples of the component - * w: width of the component - * h: height of the component - * l: number of decomposition levels in the DWT - */ -void dwt_decode_real(int *a, int w, int h, tcd_tilecomp_t * tilec, int l, - int stop); -/* - * Get the gain of a subband for the irreversible DWT - * orient: number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH) - */ +/** +Get the gain of a subband for the irreversible 9-7 DWT. +@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH) +@return Returns the gain of the 9-7 wavelet transform +*/ int dwt_getgain_real(int orient); - -/* - * Get the norm of a wavelet function of a subband at a specified level for the irreversible DWT - * level: level of the wavelet function - * orient: band of the wavelet function - */ +OPJ_UINT32 dwt_getgain_real_v2(OPJ_UINT32 orient); +/** +Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT +@param level Level of the wavelet function +@param orient Band of the wavelet function +@return Returns the norm of the 9-7 wavelet +*/ double dwt_getnorm_real(int level, int orient); +/** +Explicit calculation of the Quantization Stepsizes +@param tccp Tile-component coding parameters +@param prec Precint analyzed +*/ +void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec); +/* ----------------------------------------------------------------------- */ +/*@}*/ -#endif +/*@}*/ + +#endif /* __DWT_H */