#include <godwt.h>
#include <gosignal3d.h>
#include <gosignalmacros.h>
#include <time.h>
#include <iostream>
#include <gorandom.h>
#define TYPE goFloat
int main()
{
clock_t t1,t2;
int i,j,k;
{
{
{
*block.
getPtr(k,j,i) = goRandom();
}
}
}
std::cout << "Original block first x/y slice: " << std::endl;
std::cout << "-------------------------------" << std::endl;
{
{
std::cout << *block.getPtr(j,i,0) << " ";
}
std::cout << std::endl;
}
std::cout << std::endl;
t1 = clock();
t2 = clock();
std::cout << "Time for transform: " << (t2-t1) / (float)CLOCKS_PER_SEC << "s" << std::endl;
std::cout << "DWT block first x/y slice: " << std::endl;
std::cout << "--------------------------" << std::endl;
{
{
std::cout << *block.getPtr(j,i,0) << " ";
}
std::cout << std::endl;
}
std::cout << std::endl;
t1 = clock();
t2 = clock();
std::cout << "Time for reverse transform: " << (t2-t1) / (float)CLOCKS_PER_SEC << "s" << std::endl;
std::cout << "iDWT block first x/y slice: " << std::endl;
std::cout << "--------------------------" << std::endl;
{
{
std::cout << *block.getPtr(j,i,0) << " ";
}
std::cout << std::endl;
}
std::cout << std::endl;
std::cout << "block";
goDouble var = 0.0f;
if (block == block2)
{
std::cout << " == ";
}
else
{
std::cout << " != ";
{
{
{
var += fabs(*block.getPtr(i,j,k) - *block2.getPtr(i,j,k));
}
}
}
var /= (float)(i * j * k);
}
std::cout << "block2" << std::endl;
std::cout << "Mean error: " << var << std::endl;
std::cout << "Memory usage" << std::endl;
std::cout << "------------" << std::endl;
std::cout <<
"block: " << block.
getSize() <<
" bytes" << std::endl;
exit(1);
}