include/it/wavelet2D.h

Go to the documentation of this file.
00001 /*
00002    libit - Library for basic source and channel coding functions
00003    Copyright (C) 2005-2005 Vivien Chappelier, Herve Jegou
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public
00016    License along with this library; if not, write to the Free
00017    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 /*
00021   Separable 2D wavelet transform using lifting.
00022   Copyright (C) 2005 Vivien Chappelier, Herve Jegou
00023 */
00024 
00025 #ifndef __it_wavelet2D_h
00026 #define __it_wavelet2D_h
00027 
00028 #include <it/types.h>
00029 #include <it/mat.h>
00030 #include <it/wavelet.h>
00031 #include <it/transform2D.h>
00032 
00033 /*---------------------------------------------------------------------------*/
00034 /*! \addtogroup transform                                                    */
00035 /* @{                                                                        */
00036 /*---------------------------------------------------------------------------*/
00037 
00038 typedef struct _it_wavelet2D_ {
00039   it_extends (it_transform2D_t);
00040 
00041   it_wavelet_lifting_t *lifting;
00042   int  level;     /* current decomposition level */
00043   int  levels;    /* number of decomposition levels */
00044   int  width, height;   /* widthxheight of the original frame */
00045   vec  buffer;
00046 
00047   void (*it_overloaded (destructor)) (it_object_t * it_this);
00048 
00049   int  (*copy) (struct _it_wavelet2D_ * it_this,
00050     struct _it_wavelet2D_ * source);
00051 
00052 } it_wavelet2D_t;
00053 
00054 #define IT_WAVELET2D(x) IT_CAST(it_wavelet2D_t, x)
00055 
00056 it_instanciate (it_wavelet2D_t);
00057 
00058 static inline it_wavelet2D_t *it_wavelet2D_new (it_wavelet_lifting_t const
00059             *lifting, int level) {
00060   return (it_new_va (it_wavelet2D_t) (it_va, lifting, level));
00061 }
00062 #define it_wavelet2D_copy(a, b)  a->copy(a, b)
00063 /* 2D wavelet transform and inverse transform */
00064 #define it_wavelet2D_transform(t, m) ((mat) it_transform2D(IT_WAVELET2D(t), m))
00065 #define it_wavelet2D_itransform(t, m) ((mat) it_itransform2D(IT_WAVELET2D(t), m))
00066 /* same thing with internal object construction/destruction */
00067 mat it_dwt2D (mat m, it_wavelet_lifting_t const *lifting, int levels);
00068 mat  it_idwt2D (mat t, it_wavelet_lifting_t const *lifting, int levels);
00069 
00070 /*--------------------------------------------------------------------*/
00071 /* Split a matrix containing all wavelet components into several matrices. 
00072    All the memory is allocated inside.                                      */
00073 mat *it_wavelet2D_split (mat wav, int nb_levels);
00074 mat  it_wavelet2D_merge (mat * subbands, int nb_level);
00075 
00076 /* @} */
00077 
00078 #endif

Hosted by
Copyright (C) 2005-2006 Hervé Jégou
Vivien Chappelier
Francois Cayre
libit logo courtesy of Jonathan Delhumeau