[77a22a]: src / wavelets.h  Maximize  Restore  History

Download this file

143 lines (97 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef WAVELETS_H
#define WAVELETS_H
#include <string.h>
#include "config.h"
#include "fftw3.h"
#include "ltfat.h"
#define ONEOVERSQRT2 0.707106781186548 \
//#define WORDBITSM1 (sizeof(int)*8)-1
#define LTFAT_H_REAL double
#define LTFAT_H_COMPLEX ltfat_complex
#define LTFAT_H_NAME(name) name
#define LTFAT_H_FFTW(name) fftw_ ## name
// common basic routines
LTFAT_EXTERN
void LTFAT_H_NAME(extend_left)(const LTFAT_H_REAL *in,int inLen, LTFAT_H_REAL *buffer, int buffLen, int filtLen, int type, int a);
LTFAT_EXTERN
void LTFAT_H_NAME(extend_right)(const LTFAT_H_REAL *in,int inLen, LTFAT_H_REAL *buffer, int filtLen, int type, int a);
LTFAT_EXTERN
void LTFAT_H_NAME(conv_td_sub)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int sub, int skip, int ext, int filtUps);
LTFAT_EXTERN
void LTFAT_H_NAME(up_conv_td)(LTFAT_H_REAL *in[], int inLen, LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, int skip, int ext, int filtUps);
// additional common basic routines
LTFAT_EXTERN
void LTFAT_H_NAME(up_conv_sub)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out, int outLen, LTFAT_H_REAL *filt, int fLen, int up, int sub, int skip, int ext);
LTFAT_EXTERN
void LTFAT_H_NAME(up_conv_sub_1toN)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int sub, int skip, int ext);
LTFAT_EXTERN
void LTFAT_H_NAME(up_conv_sub_Nto1)(const LTFAT_H_REAL *in[], int inLen, LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, int skip, int ext);
// execution routines
// FORWARD TRANSFORMS
LTFAT_EXTERN
void LTFAT_H_NAME(dyadic_dwt_exp)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen[], const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int subFac, const int J, int ext);
LTFAT_EXTERN
void LTFAT_H_NAME(dyadic_dwt_per)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen[], const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int subFac, const int J);
LTFAT_EXTERN
void LTFAT_H_NAME(undec_dwt_exp)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen[], const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int subFac, const int J, int ext);
LTFAT_EXTERN
void LTFAT_H_NAME(undec_dwt_per)(const LTFAT_H_REAL *in, int inLen, LTFAT_H_REAL *out[], const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int subFac, const int J);
// execution routines
// INVERSE TRANSFORMS
LTFAT_EXTERN
void LTFAT_H_NAME(dyadic_idwt_exp)(LTFAT_H_REAL *in[], int inLen[], LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, const int J);
LTFAT_EXTERN
void LTFAT_H_NAME(dyadic_idwt_per)(LTFAT_H_REAL *in[], int inLen[], LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, const int J);
LTFAT_EXTERN
void LTFAT_H_NAME(undec_idwt_exp)(LTFAT_H_REAL *in[], int inLen[], LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, const int J);
LTFAT_EXTERN
void LTFAT_H_NAME(undec_idwt_per)(LTFAT_H_REAL *in[], int inLen, LTFAT_H_REAL *out, const int outLen, const LTFAT_H_REAL *filts[], int fLen, int noOfFilts, int up, const int J);
#undef LTFAT_H_REAL
#undef LTFAT_H_COMPLEX
#undef LTFAT_H_NAME
#undef LTFAT_H_FFTW
static inline int pow2(int x){
return ((1)<<(x));
}
static inline int modPow2(int x,int pow2var){
return ((x)&(pow2var-1));
}
static inline int nextPow2(int x){
x--;
(x) = ((x)>>1) | (x);
(x) = ((x)>>2) | (x);
(x) = ((x)>>4) | (x);
(x) = ((x)>>8) | (x);
(x) = ((x)>>16) | (x);
(x)++;
return x;
}
static inline int isPow2(int x){
return x==nextPow2(x);
}
static inline int log2(int x){
int tmp = 0;
while (x >>= 1) ++tmp;
return tmp;
}
static inline int imin(int x,int y){
//return x-(((x-y)>>(WORDBITSM1))&(x-y));
return x>y?y:x;
}
static inline int imax(int x,int y){
return x>y?x:y;
}
// integer power by squaring
static inline int ipow(int base, int exp)
{
int result = 1;
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}
return result;
}
#endif

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks