Compute fast inverse wavelet transform of all 4 subbands of given level and stores result in LL subband of level - 1.
{
ASSERT(srcLevel > 0 && srcLevel <
m_nLevels);
const int destLevel = srcLevel - 1;
UINT32 width, height;
if (!destBand->
AllocMemory())
return InsufficientMemory;
DataT *dest = destBand->
GetBuffer(), *origin = dest, *row0, *row1, *row2, *row3;
#ifdef __PGFROISUPPORT__
PGFRect destROI = destBand->GetROI();
const UINT32 destWidth = width;
const UINT32 destHeight = height;
origin += destWidth;
height--;
}
origin++;
width--;
}
UINT32 left = (destROI.
left >> 1) -
m_subband[srcLevel][i].GetROI().left;
UINT32 top = (destROI.
top >> 1) -
m_subband[srcLevel][i].GetROI().top;
}
#else
PGFRect destROI(0, 0, width, height);
const UINT32 destWidth = width;
const UINT32 destHeight = height;
}
#endif
row0 = origin; row1 = row0 + destWidth;
for (UINT32 k=0; k < width; k++) {
row0[k] -= ((row1[k] +
c1) >> 1);
}
row2 = row1 + destWidth; row3 = row2 + destWidth;
for (UINT32 i=destROI.
top + 2; i < destROI.
bottom - 1; i += 2) {
for (UINT32 k=0; k < width; k++) {
row2[k] -= ((row1[k] + row3[k] +
c2) >> 2);
row1[k] += ((row0[k] + row2[k] +
c1) >> 1);
}
row0 = row2; row1 = row3; row2 = row1 + destWidth; row3 = row2 + destWidth;
}
if (height & 1) {
for (UINT32 k=0; k < width; k++) {
row2[k] -= ((row1[k] +
c1) >> 1);
row1[k] += ((row0[k] + row2[k] +
c1) >> 1);
}
row0 = row1; row1 = row2; row2 += destWidth;
} else {
for (UINT32 k=0; k < width; k++) {
row1[k] += row0[k];
}
row0 = row1; row1 += destWidth;
}
} else {
row0 = origin; row1 = row0 + destWidth;
for (UINT32 k=0; k < height; k += 2) {
row0 += destWidth << 1; row1 += destWidth << 1;
}
if (height & 1) {
}
}
}
*w = destWidth;
*h = height;
*data = dest;
return NoError;
}