37 , m_ROIs(0), m_dataWidth(0)
58 #ifdef __PGFROISUPPORT__
71 #ifdef __PGFROISUPPORT__
76 ASSERT(m_dataWidth > 0);
113 if (quantParam > 0) {
115 for (UINT32 i=0; i <
m_size; i++) {
130 if (quantParam > 0) {
131 int threshold = ((1 << quantParam) * 7)/5;
133 for (UINT32 i=0; i <
m_size; i++) {
134 if (
m_data[i] < -threshold) {
136 }
else if (
m_data[i] > threshold) {
159 if (quantParam > 0) {
160 for (UINT32 i=0; i <
m_size; i++) {
175 #ifdef __PGFROISUPPORT__
178 UINT32 xPos, yPos, w, h;
179 TilePosition(tileX, tileY, xPos, yPos, w, h);
182 encoder.Partition(
this, w, h, xPos + yPos*m_width, m_width);
187 encoder.Partition(
this, m_width, m_height, 0, m_width);
201 if (!AllocMemory()) ReturnWithError(InsufficientMemory);
204 if (m_orientation ==
LL) {
205 quantParam -= m_level + 1;
206 }
else if (m_orientation ==
HH) {
207 quantParam -= m_level - 1;
209 quantParam -= m_level;
211 if (quantParam < 0) quantParam = 0;
213 #ifdef __PGFROISUPPORT__
216 const PGFRect& roi = m_ROIs->GetROI(m_level);
217 UINT32 xPos, yPos, w, h;
218 TilePosition(tileX, tileY, xPos, yPos, w, h);
221 decoder.Partition(
this, quantParam, w, h, (xPos - roi.
left) + (yPos - roi.
top)*m_dataWidth, m_dataWidth);
226 decoder.Partition(
this, quantParam, m_width, m_height, 0, m_width);
232 #ifdef __PGFROISUPPORT__
241 void CSubband::TilePosition(UINT32 tileX, UINT32 tileY, UINT32& xPos, UINT32& yPos, UINT32& w, UINT32& h)
const {
253 UINT32 nTiles = m_ROIs->GetNofTiles(
m_level);
254 ASSERT(tileX < nTiles); ASSERT(tileY < nTiles);
256 UINT32 left = 0, right = nTiles;
257 UINT32 top = 0, bottom = nTiles;
266 m = (left + right) >> 1;
268 xPos += (w + 1) >> 1;
276 m = (top + bottom) >> 1;
278 yPos += (h + 1) >> 1;