1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
diff -r 486075d14769 -r d53918598fbf libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJP2File.cpp
--- libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJP2File.cpp Wed Sep 30 11:55:26 2009 +0100
+++ libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJP2File.cpp Wed Sep 30 12:20:09 2009 +0100
@@ -137,7 +137,7 @@
m_bCodestreamOnly = false;
m_eCompressionOrder = CNCSJPCProgressionOrderType::RPCL;
- m_nDecompressionLayers = CNCSJPCBuffer::MAXUINT16;
+ m_nDecompressionLayers = CNCSJPCBuffer::NCS_MAXUINT16;
m_nNextLine = 0;
//Default geodata usage - was JP2_GEODATA_USE_WLD_GML_PCS
diff -r 486075d14769 -r d53918598fbf libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCBuffer.cpp
--- libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCBuffer.cpp Wed Sep 30 11:55:26 2009 +0100
+++ libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCBuffer.cpp Wed Sep 30 12:20:09 2009 +0100
@@ -26,19 +26,19 @@
//void * memcpy_amd(void *dest, const void *src, size_t n);
-const UINT32 CNCSJPCBuffer::MAXUINT8 = (unsigned)0xff;
-const UINT32 CNCSJPCBuffer::MAXUINT16 = (unsigned)0xffff;
-const UINT32 CNCSJPCBuffer::MAXUINT32 = (unsigned)0xffffffff;
-const UINT32 CNCSJPCBuffer::MINUINT8 = 0;
-const UINT32 CNCSJPCBuffer::MINUINT16 = 0;
-const UINT32 CNCSJPCBuffer::MINUINT32 = 0;
+const UINT32 CNCSJPCBuffer::NCS_MAXUINT8 = (unsigned)0xff;
+const UINT32 CNCSJPCBuffer::NCS_MAXUINT16 = (unsigned)0xffff;
+const UINT32 CNCSJPCBuffer::NCS_MAXUINT32 = (unsigned)0xffffffff;
+const UINT32 CNCSJPCBuffer::NCS_MINUINT8 = 0;
+const UINT32 CNCSJPCBuffer::NCS_MINUINT16 = 0;
+const UINT32 CNCSJPCBuffer::NCS_MINUINT32 = 0;
-const UINT32 CNCSJPCBuffer::MAXINT8 = 0x7f;
-const UINT32 CNCSJPCBuffer::MAXINT16 = 0x7fff;
-const UINT32 CNCSJPCBuffer::MAXINT32 = 0x7fffffff;
-const INT32 CNCSJPCBuffer::MININT8 = (-1 * (signed)CNCSJPCBuffer::MAXINT8 - 1);
-const INT32 CNCSJPCBuffer::MININT16 = (-1 * (signed)CNCSJPCBuffer::MAXINT16 - 1);
-const INT32 CNCSJPCBuffer::MININT32 = (-1 * (signed)CNCSJPCBuffer::MAXINT32 - 1);
+const UINT32 CNCSJPCBuffer::NCS_MAXINT8 = 0x7f;
+const UINT32 CNCSJPCBuffer::NCS_MAXINT16 = 0x7fff;
+const UINT32 CNCSJPCBuffer::NCS_MAXINT32 = 0x7fffffff;
+const INT32 CNCSJPCBuffer::NCS_MININT8 = (-1 * (signed)CNCSJPCBuffer::NCS_MAXINT8 - 1);
+const INT32 CNCSJPCBuffer::NCS_MININT16 = (-1 * (signed)CNCSJPCBuffer::NCS_MAXINT16 - 1);
+const INT32 CNCSJPCBuffer::NCS_MININT32 = (-1 * (signed)CNCSJPCBuffer::NCS_MAXINT32 - 1);
const UINT32 CNCSJPCBuffer::AT_OWNER = (1 << 0);
const UINT32 CNCSJPCBuffer::AT_CHILD = (1 << 1);
@@ -308,27 +308,27 @@
switch(m_eType) {
case CNCSJPCBuffer::BT_INT16:
// Optimise some common cases
- if(nMin == MINUINT8 && nMax == MAXUINT8) {
+ if(nMin == NCS_MINUINT8 && nMax == NCS_MAXUINT8) {
// UINT8 range
for(x = 0; x < nWidth; x++) {
INT16 v = ((INT16*)m_pBuffer)[x];
if(v & 0xff00) { // Top bit is sign bit, so this tests for both >nMax & <nMin in one
- if(v > (INT16)MAXUINT8) {
- ((INT16*)m_pBuffer)[x] = MAXUINT8;
- } else if(v < (INT16)MINUINT8) {
- ((INT16*)m_pBuffer)[x] = MINUINT8;
+ if(v > (INT16)NCS_MAXUINT8) {
+ ((INT16*)m_pBuffer)[x] = NCS_MAXUINT8;
+ } else if(v < (INT16)NCS_MINUINT8) {
+ ((INT16*)m_pBuffer)[x] = NCS_MINUINT8;
}
}
}
- } else if(nMin == MININT8 && nMax == MAXINT8) {
+ } else if(nMin == NCS_MININT8 && nMax == NCS_MAXINT8) {
// INT8 range
for(x = 0; x < nWidth; x++) {
INT16 v = ((INT16*)m_pBuffer)[x];
if(v & 0xff80) { // Top bit is sign bit, so this tests for both >nMax & <nMin in one
- if(v > (INT16)MAXINT8) {
- ((INT16*)m_pBuffer)[x] = MAXINT8;
- } else if(v < (INT16)MININT8) {
- ((INT16*)m_pBuffer)[x] = MININT8;
+ if(v > (INT16)NCS_MAXINT8) {
+ ((INT16*)m_pBuffer)[x] = NCS_MAXINT8;
+ } else if(v < (INT16)NCS_MININT8) {
+ ((INT16*)m_pBuffer)[x] = NCS_MININT8;
}
}
}
@@ -345,27 +345,27 @@
break;
case CNCSJPCBuffer::BT_INT32:
// Optimise some common cases
- if(nMin == MINUINT16 && nMax == MAXUINT16) {
+ if(nMin == NCS_MINUINT16 && nMax == NCS_MAXUINT16) {
// UINT16 range
for(x = 0; x < nWidth; x++) {
INT32 v = ((INT32*)m_pBuffer)[x];
if(v & 0xffff0000) { // Top bit is sign bit, so this tests for both >nMax & <nMin in one
- if(v > (INT32)MAXUINT16) {
- ((INT32*)m_pBuffer)[x] = MAXUINT16;
- } else if(v < (INT32)MINUINT16) {
- ((INT32*)m_pBuffer)[x] = MINUINT16;
+ if(v > (INT32)NCS_MAXUINT16) {
+ ((INT32*)m_pBuffer)[x] = NCS_MAXUINT16;
+ } else if(v < (INT32)NCS_MINUINT16) {
+ ((INT32*)m_pBuffer)[x] = NCS_MINUINT16;
}
}
}
- } else if(nMin == MININT16 && nMax == MAXINT16) {
+ } else if(nMin == NCS_MININT16 && nMax == NCS_MAXINT16) {
// INT16 range
for(x = 0; x < nWidth; x++) {
INT32 v = ((INT32*)m_pBuffer)[x];
if(v & 0xffff8000) { // Top bit is sign bit, so this tests for both >nMax & <nMin in one
- if(v > (INT32)MAXINT16) {
- ((INT32*)m_pBuffer)[x] = MAXINT16;
- } else if(v < (INT32)MININT16) {
- ((INT32*)m_pBuffer)[x] = MININT16;
+ if(v > (INT32)NCS_MAXINT16) {
+ ((INT32*)m_pBuffer)[x] = NCS_MAXINT16;
+ } else if(v < (INT32)NCS_MININT16) {
+ ((INT32*)m_pBuffer)[x] = NCS_MININT16;
}
}
}
@@ -403,13 +403,13 @@
return(Clip(NCSCeil(fMin), NCSFloor(fMax)));
break;
case CNCSJPCBuffer::BT_IEEE4:
- if(fMin == MINUINT8 && fMax == MAXUINT8) {
+ if(fMin == NCS_MINUINT8 && fMax == NCS_MAXUINT8) {
for(x = 0; x < nWidth; x++) {
IEEE4 v = ((IEEE4*)m_pBuffer)[x];
- if(v > MAXUINT8) {
- ((IEEE4*)m_pBuffer)[x] = MAXUINT8;
- } else if(v < MINUINT8) {
- ((IEEE4*)m_pBuffer)[x] = MINUINT8;
+ if(v > NCS_MAXUINT8) {
+ ((IEEE4*)m_pBuffer)[x] = NCS_MAXUINT8;
+ } else if(v < NCS_MINUINT8) {
+ ((IEEE4*)m_pBuffer)[x] = NCS_MINUINT8;
}
}
} else {
diff -r 486075d14769 -r d53918598fbf libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCPLTMarker.cpp
--- libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCPLTMarker.cpp Wed Sep 30 11:55:26 2009 +0100
+++ libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCPLTMarker.cpp Wed Sep 30 12:20:09 2009 +0100
@@ -173,7 +173,7 @@
nPrevHeaderLength = TMP.m_nHeaderLength;
TMP.m_nHeaderLength += (UINT32)nTotalHeaderLength;
}
- if(nTotalHeaderLength > CNCSJPCBuffer::MAXUINT32) {
+ if(nTotalHeaderLength > CNCSJPCBuffer::NCS_MAXUINT32) {
// Too big to store cumulated length in the PacketLength struct, so
// set it back to false and reparse the entire PLT
m_bCumulativeLengths = false;
@@ -202,7 +202,7 @@
nPrevHeaderLength = TMP.m_nHeaderLength;
TMP.m_nHeaderLength += nTotalHeaderLength;
}
- if(nTotalHeaderLength > CNCSJPCBuffer::MAXUINT32) {
+ if(nTotalHeaderLength > CNCSJPCBuffer::NCS_MAXUINT32) {
// Too big to store cumulated length in the PacketLength struct, so
// set it back to false and reparse the entire PLT
m_bCumulativeLengths = false;
diff -r 486075d14769 -r d53918598fbf libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCT1Coder.cpp
--- libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCT1Coder.cpp Wed Sep 30 11:55:26 2009 +0100
+++ libecwj2-3.3/Source/C/NCSEcw/NCSJP2/NCSJPCT1Coder.cpp Wed Sep 30 12:20:09 2009 +0100
@@ -917,7 +917,7 @@
int passno=0;
int passtype;
- INT32 nMax = CNCSJPCBuffer::MININT32;
+ INT32 nMax = CNCSJPCBuffer::NCS_MININT32;
UINT32 nWidth = pDecBuf->GetWidth();
UINT32 nHeight = pDecBuf->GetHeight();
@@ -956,7 +956,7 @@
UINT32 nSubWidth = nWidth / 8;
__m128 mm7 = _mm_set1_ps(fRatio);
- __m128i mm4 = _mm_set1_epi16((short)CNCSJPCBuffer::MININT16);
+ __m128i mm4 = _mm_set1_epi16((short)CNCSJPCBuffer::NCS_MININT16);
for(UINT32 y = 0; y < nHeight; y++) {
INT16 *pSrc = (INT16*)pDecBuf->GetPtr() + y * nDecStep;
@@ -1008,7 +1008,7 @@
UINT32 nSubWidth = nWidth / 4;
__m128 mm7 = _mm_set1_ps(fRatio);
- __m64 mm4 = _mm_set1_pi16((short)CNCSJPCBuffer::MININT16);
+ __m64 mm4 = _mm_set1_pi16((short)CNCSJPCBuffer::NCS_MININT16);
for(UINT32 y = 0; y < nHeight; y++) {
INT16 *pSrc = (INT16*)pDecBuf->GetPtr() + y * nDecStep;
diff -r 486075d14769 -r d53918598fbf libecwj2-3.3/Source/include/NCSJPCBuffer.h
--- libecwj2-3.3/Source/include/NCSJPCBuffer.h Wed Sep 30 11:55:26 2009 +0100
+++ libecwj2-3.3/Source/include/NCSJPCBuffer.h Wed Sep 30 12:20:09 2009 +0100
@@ -48,30 +48,30 @@
class NCSJPC_EXPORT_ALL CNCSJPCBuffer: public CNCSJPCRect {
public:
/** Maximum UINT8 value */
- static const UINT32 MAXUINT8;
+ static const UINT32 NCS_MAXUINT8;
/** Maximum UINT16 value */
- static const UINT32 MAXUINT16;
+ static const UINT32 NCS_MAXUINT16;
/** Maximum UINT32 value */
- static const UINT32 MAXUINT32;
+ static const UINT32 NCS_MAXUINT32;
/** Minimum UINT8 value */
- static const UINT32 MINUINT8;
+ static const UINT32 NCS_MINUINT8;
/** Minimum UINT16 value */
- static const UINT32 MINUINT16;
+ static const UINT32 NCS_MINUINT16;
/** Minimum UINT32 value */
- static const UINT32 MINUINT32;
+ static const UINT32 NCS_MINUINT32;
/** Maximum INT8 value */
- static const UINT32 MAXINT8;
+ static const UINT32 NCS_MAXINT8;
/** Maximum INT16 value */
- static const UINT32 MAXINT16;
+ static const UINT32 NCS_MAXINT16;
/** Maximum INT32 value */
- static const UINT32 MAXINT32;
+ static const UINT32 NCS_MAXINT32;
/** Minimum INT8 value */
- static const INT32 MININT8;
+ static const INT32 NCS_MININT8;
/** Minimum INT16 value */
- static const INT32 MININT16;
+ static const INT32 NCS_MININT16;
/** Minimum INT32 value */
- static const INT32 MININT32;
+ static const INT32 NCS_MININT32;
/**
* SystemInfo class - Some basic system capabilities we care about.
|