65 #ifdef __PGFROISUPPORT__
80 #ifdef __PGFROISUPPORT__
81 m_size = BufferWidth()*m_ROI.Height();
116 if (quantParam > 0) {
118 for (UINT32 i=0; i <
m_size; i++) {
133 if (quantParam > 0) {
134 int threshold = ((1 << quantParam) * 7)/5;
136 for (UINT32 i=0; i <
m_size; i++) {
137 if (
m_data[i] < -threshold) {
139 }
else if (
m_data[i] > threshold) {
162 if (quantParam > 0) {
163 for (UINT32 i=0; i <
m_size; i++) {
178 #ifdef __PGFROISUPPORT__
181 UINT32 xPos, yPos, w, h;
182 TilePosition(tileX, tileY, xPos, yPos, w, h);
205 if (!
AllocMemory()) ReturnWithError(InsufficientMemory);
215 if (quantParam < 0) quantParam = 0;
217 #ifdef __PGFROISUPPORT__
219 UINT32 xPos, yPos, w, h;
222 TilePosition(tileX, tileY, xPos, yPos, w, h);
224 ASSERT(xPos >= m_ROI.left && yPos >= m_ROI.top);
225 decoder.
Partition(
this, quantParam, w, h, (xPos - m_ROI.left) + (yPos - m_ROI.top)*BufferWidth(), BufferWidth());
237 #ifdef __PGFROISUPPORT__
238 void CSubband::SetAlignedROI(
const PGFRect& roi) {
257 void CSubband::TilePosition(UINT32 tileX, UINT32 tileY, UINT32& xPos, UINT32& yPos, UINT32& w, UINT32& h)
const {
258 ASSERT(tileX < m_nTiles); ASSERT(tileY < m_nTiles);
270 UINT32 nTiles = m_nTiles;
272 UINT32 left = 0, right = nTiles;
273 UINT32 top = 0, bottom = nTiles;
282 m = left + ((right - left) >> 1);
284 xPos += (w + 1) >> 1;
292 m = top + ((bottom - top) >> 1);
294 yPos += (h + 1) >> 1;
309 void CSubband::TileIndex(
bool topLeft, UINT32 xPos, UINT32 yPos, UINT32& tileX, UINT32& tileY, UINT32& x, UINT32& y)
const {
311 UINT32 left = 0, right =
m_width;
313 UINT32 nTiles = m_nTiles;
323 m = left + ((right - left + 1) >> 1);
333 ASSERT(tileX >= 0 && tileX < m_nTiles);
340 m = top + ((bottom - top + 1) >> 1);
350 ASSERT(tileY >= 0 && tileY < m_nTiles);
357 m = left + ((right - left + 1) >> 1);
367 ASSERT(tileX > 0 && tileX <= m_nTiles);
374 m = top + ((bottom - top + 1) >> 1);
384 ASSERT(tileY > 0 && tileY <= m_nTiles);