#include #include #include #include #include #include #include /*#include "dwt_cuda/dwt.h" #include "dwt_cuda/common.h" #include "dwt.h" #include "common.h" */ #include "common.h" #include "dwt.h" #include "common.h" inline void fdwt(float *in, float *out, int width, int height, int levels) { dwt_cuda::fdwt97(in, out, width, height, levels); } inline void fdwt(int *in, int *out, int width, int height, int levels) { dwt_cuda::fdwt53(in, out, width, height, levels); } inline void rdwt(float *in, float *out, int width, int height, int levels) { dwt_cuda::rdwt97(in, out, width, height, levels); } inline void rdwt(int *in, int *out, int width, int height, int levels) { dwt_cuda::rdwt53(in, out, width, height, levels); } template int nStage2dDWT(T * in, T * out, T * backup, int pixWidth, int pixHeight, int stages, bool forward) { //need add segments } template int nStage2dDWT(float*, float*, float*, int, int, int, bool); template int nStage2dDWT(int*, int*, int*, int, int, int, bool); void samplesToChar(unsigned char * dst, float * src, int samplesNum) { int i; for(i = 0; i < samplesNum; i++) { float r = (src[i]+0.5f) * 255; if (r > 255) r = 255; if (r < 0) r = 0; dst[i] = (unsigned char)r; } } void samplesToChar(unsigned char * dst, int * src, int samplesNum) { int i; for(i = 0; i < samplesNum; i++) { int r = src[i]+128; if (r > 255) r = 255; if (r < 0) r = 0; dst[i] = (unsigned char)r; } } ///* Write output linear orderd*/ template int writeLinear(T *component_cuda, int pixWidth, int pixHeight, const char * filename, const char * suffix) { //need add segments } template int writeLinear(float *component_cuda, int pixWidth, int pixHeight, const char * filename, const char * suffix); template int writeLinear(int *component_cuda, int pixWidth, int pixHeight, const char * filename, const char * suffix); /* Write output visual ordered */ template int writeNStage2DDWT(T *component_cuda, int pixWidth, int pixHeight, int stages, const char * filename, const char * suffix) { //need add segments } template int writeNStage2DDWT(float *component_cuda, int pixWidth, int pixHeight, int stages, const char * filename, const char * suffix); template int writeNStage2DDWT(int *component_cuda, int pixWidth, int pixHeight, int stages, const char * filename, const char * suffix);