include/it/interleaver.h

Go to the documentation of this file.
00001 /*
00002    libit - Library for basic source and channel coding functions
00003    Copyright (C) 2005-2008 Francois Cayre, 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   Interleavers 
00022   Copyright (C) 2005 Herve Jegou
00023 */
00024 
00025 #ifndef __it_interleaver_h
00026 #define __it_interleaver_h
00027 
00028 #include <it/vec.h>
00029 #include <it/mat.h>
00030 
00031 /*---------------------------------------------------------------------------*/
00032 /*! \defgroup itlv Interleaver                                               */
00033 /* @{                                                                        */
00034 /*---------------------------------------------------------------------------*/
00035 
00036 /* Block interleaving. The vector v is intearleaved.
00037    The block interleaver is defined by the width of the block */
00038 
00039 Vec  __Vec_interleave_block (Vec v, size_t width);
00040 vec  __vec_interleave_block (vec v, size_t width);
00041 ivec __ivec_interleave_block (ivec v, size_t width);
00042 bvec __bvec_interleave_block (bvec v, size_t width);
00043 
00044 #define Vec_interleave_block( v, width )  do v = __Vec_interleave_block( v , width ); while( 0 )
00045 #define vec_interleave_block( v, width )  do v = __vec_interleave_block( v , width ); while( 0 )
00046 #define ivec_interleave_block( v, width ) do v = __ivec_interleave_block( v , width ); while( 0 )
00047 #define bvec_interleave_block( v, width ) do v = __bvec_interleave_block( v , width ); while( 0 )
00048 
00049 Vec  __Vec_deinterleave_block (Vec v, size_t width);
00050 vec  __vec_deinterleave_block (vec v, size_t width);
00051 ivec __ivec_deinterleave_block (ivec v, size_t width);
00052 bvec __bvec_deinterleave_block (bvec v, size_t width);
00053 
00054 #define Vec_deinterleave_block( v, width )  do v = __Vec_deinterleave_block( v , width ); while( 0 )
00055 #define vec_deinterleave_block( v, width )  do v = __vec_deinterleave_block( v , width ); while( 0 )
00056 #define ivec_deinterleave_block( v, width ) do v = __ivec_deinterleave_block( v , width ); while( 0 )
00057 #define bvec_deinterleave_block( v, width ) do v = __bvec_deinterleave_block( v , width ); while( 0 )
00058 
00059 Vec  Vec_new_interleave_block (Vec v, size_t width);
00060 vec  vec_new_interleave_block (vec v, size_t width);
00061 ivec ivec_new_interleave_block (ivec v, size_t width);
00062 bvec bvec_new_interleave_block (bvec v, size_t width);
00063 
00064 Vec  Vec_new_deinterleave_block (Vec v, size_t width);
00065 vec  vec_new_deinterleave_block (vec v, size_t width);
00066 ivec ivec_new_deinterleave_block (ivec v, size_t width);
00067 bvec bvec_new_deinterleave_block (bvec v, size_t width);
00068 
00069 
00070 /* Interleave the row of a matrix according to a block interleaver */
00071 Mat  __Mat_interleave_block (Mat m, size_t width);
00072 #define Mat_interleave_block( m, width ) __Mat_interleave_block( (Mat) m, width)
00073 mat  mat_interleave_block (mat m, size_t width);
00074 imat imat_interleave_block (imat m, size_t width);
00075 bmat bmat_interleave_block (bmat m, size_t width);
00076 
00077 Mat  __Mat_deinterleave_block (Mat m, size_t width);
00078 #define  Mat_deinterleave_block( m, width ) __Mat_deinterleave_block( (Mat) m, width)
00079 mat  mat_deinterleave_block (mat m, size_t width);
00080 imat imat_deinterleave_block (imat m, size_t width);
00081 bmat bmat_deinterleave_block (bmat m, size_t width);
00082 
00083 Mat  __Mat_new_interleave_block (Mat m, size_t width);
00084 #define  Mat_new_interleave_block( m, width ) __Mat_new_interleave_block( (Mat) m, width)
00085 mat  mat_new_interleave_block (mat m, size_t width);
00086 imat imat_new_interleave_block (imat m, size_t width);
00087 bmat bmat_new_interleave_block (bmat m, size_t width);
00088 
00089 Mat  __Mat_new_deinterleave_block (Mat m, size_t width);
00090 #define  Mat_new_deinterleave_block( m, width ) __Mat_new_deinterleave_block( (Mat) m, width)
00091 mat  mat_new_deinterleave_block (mat m, size_t width);
00092 imat imat_new_deinterleave_block (imat m, size_t width);
00093 bmat bmat_new_deinterleave_block (bmat m, size_t width);
00094 
00095 /* @} */
00096 
00097 
00098 #endif

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