mirror of
https://github.com/team-charls/charls
synced 2025-03-28 21:03:13 +00:00
64 bit support
This commit is contained in:
parent
c06d34c370
commit
241254c715
12
CharLS.sln
12
CharLS.sln
@ -1,5 +1,5 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CharLS", "CharLS.vcproj", "{524BE26D-FC60-4BC4-9100-128A0502FFF7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{3E349E7B-30C2-4791-81B7-1108014291B7}"
|
||||
@ -10,17 +10,27 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Debug|x64.Build.0 = Debug|x64
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Release|Win32.Build.0 = Release|Win32
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Release|x64.ActiveCfg = Release|x64
|
||||
{524BE26D-FC60-4BC4-9100-128A0502FFF7}.Release|x64.Build.0 = Release|x64
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Debug|x64.Build.0 = Debug|x64
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Release|Win32.Build.0 = Release|Win32
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Release|x64.ActiveCfg = Release|x64
|
||||
{3E349E7B-30C2-4791-81B7-1108014291B7}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
213
CharLS.vcproj
213
CharLS.vcproj
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="CharLS"
|
||||
ProjectGUID="{524BE26D-FC60-4BC4-9100-128A0502FFF7}"
|
||||
RootNamespace="jpegls"
|
||||
@ -12,6 +12,9 @@
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
@ -201,6 +204,193 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
UseOfMFC="0"
|
||||
UseOfATL="0"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
InlineFunctionExpansion="1"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JPEGLS_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="3"
|
||||
BufferSecurityCheck="true"
|
||||
DisableLanguageExtensions="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
WarnAsError="true"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="2"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/charls.dll"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/jpegls.pdb"
|
||||
SubSystem="2"
|
||||
OptimizeForWindows98="0"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary="$(OutDir)/CharLS.lib"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
UseOfMFC="0"
|
||||
UseOfATL="0"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JPEGLS_EXPORTS"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="1"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
DisableLanguageExtensions="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
CallingConvention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/charls.dll"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
OptimizeForWindows98="0"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary="$(OutDir)/CharLS.lib"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
@ -241,6 +431,27 @@
|
||||
EnableFunctionLevelLinking="false"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
EnableIntrinsicFunctions="true"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
BasicRuntimeChecks="0"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
@ -23,9 +23,9 @@ public:
|
||||
{}
|
||||
|
||||
virtual void SetPresets(const JlsCustomParameters& presets) = 0;
|
||||
virtual int DecodeScan(void* pvoidOut, const Size& size, int cline, const void* pvoidIn, int cbyte, bool bCheck) = 0;
|
||||
virtual size_t DecodeScan(void* pvoidOut, const Size& size, int cline, const void* pvoidIn, size_t cbyte, bool bCheck) = 0;
|
||||
|
||||
void Init(BYTE* pbyteCompressed, int cbyte)
|
||||
void Init(BYTE* pbyteCompressed, size_t cbyte)
|
||||
{
|
||||
_cbitValid = 0;
|
||||
_valcurrent = 0;
|
||||
@ -59,17 +59,24 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef size_t bufType;
|
||||
|
||||
enum {
|
||||
bufferbits = sizeof( bufType ) * 8,
|
||||
};
|
||||
|
||||
|
||||
|
||||
void MakeValid()
|
||||
{
|
||||
int cbitValid = _cbitValid;
|
||||
BYTE* pbyteCompressed = _pbyteCompressed;
|
||||
UINT valcurrent = 0;
|
||||
bufType valcurrent = 0;
|
||||
|
||||
while (cbitValid <= 24)
|
||||
while (cbitValid <= bufferbits - 8)
|
||||
{
|
||||
UINT valnew = *pbyteCompressed;
|
||||
valcurrent |= valnew << (24 - cbitValid);
|
||||
bufType valnew = *pbyteCompressed;
|
||||
valcurrent |= valnew << (bufferbits - 8 - cbitValid);
|
||||
pbyteCompressed += 1;
|
||||
cbitValid += 8;
|
||||
|
||||
@ -113,7 +120,8 @@ public:
|
||||
}
|
||||
|
||||
ASSERT(length != 0 && length <= _cbitValid);
|
||||
UINT result = _valcurrent >> (32 - length);
|
||||
ASSERT(length < 32);
|
||||
UINT result = UINT(_valcurrent >> (bufferbits - length));
|
||||
Skip(length);
|
||||
return result;
|
||||
}
|
||||
@ -126,7 +134,7 @@ public:
|
||||
MakeValid();
|
||||
}
|
||||
|
||||
return _valcurrent >> 24;
|
||||
return _valcurrent >> (bufferbits - 8);
|
||||
}
|
||||
|
||||
|
||||
@ -138,7 +146,7 @@ public:
|
||||
MakeValid();
|
||||
}
|
||||
|
||||
bool bSet = (_valcurrent & 0x80000000) != 0;
|
||||
bool bSet = (_valcurrent & (1LL << (bufferbits - 1))) != 0;
|
||||
Skip(1);
|
||||
return bSet;
|
||||
}
|
||||
@ -151,11 +159,11 @@ public:
|
||||
{
|
||||
MakeValid();
|
||||
}
|
||||
UINT valTest = _valcurrent;
|
||||
bufType valTest = _valcurrent;
|
||||
|
||||
for (int cbit = 0; cbit < 16; cbit++)
|
||||
{
|
||||
if ((valTest & 0x80000000) != 0)
|
||||
if ((valTest & (1LL << (bufferbits - 1))) != 0)
|
||||
return cbit;
|
||||
|
||||
valTest <<= 1;
|
||||
@ -198,9 +206,9 @@ public:
|
||||
private:
|
||||
// decoding
|
||||
int _cbitValid;
|
||||
UINT _valcurrent;
|
||||
bufType _valcurrent;
|
||||
BYTE* _pbyteCompressed;
|
||||
int _cbyteCompressed;
|
||||
size_t _cbyteCompressed;
|
||||
};
|
||||
|
||||
|
||||
|
@ -38,11 +38,11 @@ public:
|
||||
|
||||
virtual void SetPresets(const JlsCustomParameters& presets) = 0;
|
||||
|
||||
virtual int EncodeScan(const void* pvoid, const Size& size, int ccomp, void* pvoidOut, int cbyte, void* pvoidCompare) = 0;
|
||||
virtual size_t EncodeScan(const void* pvoid, const Size& size, int ccomp, void* pvoidOut, size_t cbyte, void* pvoidCompare) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
void Init(BYTE* pbyteCompressed, int cbyte)
|
||||
void Init(BYTE* pbyteCompressed, size_t cbyte)
|
||||
{
|
||||
bitpos = 32;
|
||||
valcurrent = 0;
|
||||
@ -114,7 +114,7 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
int GetLength()
|
||||
size_t GetLength()
|
||||
{
|
||||
return _cbyteWritten - (bitpos -32)/8;
|
||||
};
|
||||
@ -131,13 +131,13 @@ private:
|
||||
|
||||
UINT valcurrent;
|
||||
// encoding
|
||||
int _cbyteCompressed;
|
||||
size_t _cbyteCompressed;
|
||||
|
||||
// encoding
|
||||
int bitpos;
|
||||
BYTE* _pbyteCompressed;
|
||||
bool _bFFWritten;
|
||||
int _cbyteWritten;
|
||||
size_t _cbyteWritten;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -134,7 +134,7 @@ void JLSOutputStream::Init(Size size, int cbpp, int ccomp)
|
||||
//
|
||||
// Write()
|
||||
//
|
||||
int JLSOutputStream::Write(BYTE* pdata, int cbyteLength)
|
||||
size_t JLSOutputStream::Write(BYTE* pdata, size_t cbyteLength)
|
||||
{
|
||||
_pdata = pdata;
|
||||
_cbyteLength = cbyteLength;
|
||||
@ -222,7 +222,7 @@ void JLSInputStream::ReadHeader()
|
||||
|
||||
BYTE marker = (BYTE)ReadByte();
|
||||
|
||||
int cbyteStart = _cbyteOffset;
|
||||
size_t cbyteStart = _cbyteOffset;
|
||||
int cbyteMarker = ReadWord();
|
||||
|
||||
switch (marker)
|
||||
@ -408,7 +408,7 @@ public:
|
||||
int ccompInterleaved = _ilv == ILV_LINE ? _ccompScan : 1;
|
||||
|
||||
std::auto_ptr<EncoderStrategy> qcodec(JlsCodecFactory<EncoderStrategy>().GetCodec(info, _presets));
|
||||
int cbyteWritten = qcodec->EncodeScan((BYTE*)_pvoidRaw, _size, ccompInterleaved, pstream->GetPos(), pstream->GetLength(), pstream->_bCompare ? pstream->GetPos() : NULL);
|
||||
size_t cbyteWritten = qcodec->EncodeScan((BYTE*)_pvoidRaw, _size, ccompInterleaved, pstream->GetPos(), pstream->GetLength(), pstream->_bCompare ? pstream->GetPos() : NULL);
|
||||
pstream->Seek(cbyteWritten);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ JLS_ERROR CheckInput(const void* pdataCompressed, int cbyteCompressed, const voi
|
||||
extern "C"
|
||||
{
|
||||
|
||||
JLS_ERROR __declspec(dllexport) JpegLsEncode(void* pdataCompressed, int cbyteBuffer, int* pcbyteWritten, const void* pdataUncompressed, int cbyteUncompressed, const JlsParamaters* pparams)
|
||||
JLS_ERROR __declspec(dllexport) JpegLsEncode(void* pdataCompressed, int cbyteBuffer, size_t* pcbyteWritten, const void* pdataUncompressed, int cbyteUncompressed, const JlsParamaters* pparams)
|
||||
{
|
||||
|
||||
JLS_ERROR parameterError = CheckInput(pdataCompressed, cbyteBuffer, pdataUncompressed, cbyteUncompressed, pparams);
|
||||
|
@ -58,7 +58,7 @@ struct JlsParamaters
|
||||
|
||||
extern "C"
|
||||
{
|
||||
CHARLS_IMEXPORT JLS_ERROR JpegLsEncode(void* pdataCompressed, int cbyteBuffer, int* pcbyteWritten, const void* pdataUncompressed, int cbyteUncompressed, const JlsParamaters* pparams);
|
||||
CHARLS_IMEXPORT JLS_ERROR JpegLsEncode(void* pdataCompressed, int cbyteBuffer, size_t* pcbyteWritten, const void* pdataUncompressed, int cbyteUncompressed, const JlsParamaters* pparams);
|
||||
CHARLS_IMEXPORT JLS_ERROR JpegLsDecode(void* pdataUncompressed, int cbyteUncompressed, const void* pdataCompressed, int cbyteCompressed);
|
||||
CHARLS_IMEXPORT JLS_ERROR JpegLsReadHeader(const void* pdataUncompressed, int cbyteUncompressed, JlsParamaters* pparams);
|
||||
CHARLS_IMEXPORT JLS_ERROR JpegLsVerifyEncode(const void* pdataUncompressed, int cbyteUncompressed, const void* pdataCompressed, int cbyteCompressed);
|
||||
|
14
scan.h
14
scan.h
@ -191,14 +191,14 @@ public:
|
||||
|
||||
void DoLine(SAMPLE* pdummy);
|
||||
void DoLine(Triplet* pdummy);
|
||||
void DoScan(PIXEL* ptype, BYTE* pbyteCompressed, int cbyteCompressed);
|
||||
void DoScan(PIXEL* ptype, BYTE* pbyteCompressed, size_t cbyteCompressed);
|
||||
|
||||
public:
|
||||
void InitDefault();
|
||||
void InitParams(int t1, int t2, int t3, int nReset);
|
||||
|
||||
int EncodeScan(const void* pvoid, const Size& size, int components, void* pvoidOut, int cbyte, void* pvoidCompare);
|
||||
int DecodeScan(void* pvoidOut, const Size& size, int components, const void* pvoidIn, int cbyte, bool bCompare);
|
||||
size_t EncodeScan(const void* pvoid, const Size& size, int components, void* pvoidOut, size_t cbyte, void* pvoidCompare);
|
||||
size_t DecodeScan(void* pvoidOut, const Size& size, int components, const void* pvoidIn, size_t cbyte, bool bCompare);
|
||||
|
||||
protected:
|
||||
// compression context
|
||||
@ -704,7 +704,7 @@ void JlsCodec<TRAITS,STRATEGY>::DoLine(Triplet*)
|
||||
|
||||
|
||||
template<class TRAITS, class STRATEGY>
|
||||
void JlsCodec<TRAITS,STRATEGY>::DoScan(PIXEL* ptype, BYTE* pbyteCompressed, int cbyteCompressed)
|
||||
void JlsCodec<TRAITS,STRATEGY>::DoScan(PIXEL* ptype, BYTE* pbyteCompressed, size_t cbyteCompressed)
|
||||
{
|
||||
STRATEGY::Init(pbyteCompressed, cbyteCompressed);
|
||||
|
||||
@ -743,7 +743,7 @@ void JlsCodec<TRAITS,STRATEGY>::DoScan(PIXEL* ptype, BYTE* pbyteCompressed, int
|
||||
|
||||
|
||||
template<class TRAITS, class STRATEGY>
|
||||
int JlsCodec<TRAITS,STRATEGY>::EncodeScan(const void* pvoid, const Size& size, int components, void* pvoidOut, int cbyte, void* pvoidCompare)
|
||||
size_t JlsCodec<TRAITS,STRATEGY>::EncodeScan(const void* pvoid, const Size& size, int components, void* pvoidOut, size_t cbyte, void* pvoidCompare)
|
||||
{
|
||||
_size = size;
|
||||
_components = components;
|
||||
@ -770,7 +770,7 @@ int JlsCodec<TRAITS,STRATEGY>::EncodeScan(const void* pvoid, const Size& size, i
|
||||
|
||||
|
||||
template<class TRAITS, class STRATEGY>
|
||||
int JlsCodec<TRAITS,STRATEGY>::DecodeScan(void* pvoidOut, const Size& size, int components, const void* pvoidIn, int cbyte, bool bCompare)
|
||||
size_t JlsCodec<TRAITS,STRATEGY>::DecodeScan(void* pvoidOut, const Size& size, int components, const void* pvoidIn, size_t cbyte, bool bCompare)
|
||||
{
|
||||
PIXEL* ptypeOut = static_cast<PIXEL*>(pvoidOut);
|
||||
BYTE* pbyteCompressed = const_cast<BYTE*>(static_cast<const BYTE*>(pvoidIn));
|
||||
@ -790,7 +790,7 @@ int JlsCodec<TRAITS,STRATEGY>::DecodeScan(void* pvoidOut, const Size& size, int
|
||||
_size = size;
|
||||
_components = components;
|
||||
|
||||
DoScan(const_cast<PIXEL*>(ptypeOut), pbyteCompressed + cbyteRead, cbyte);
|
||||
DoScan(const_cast<PIXEL*>(ptypeOut), pbyteCompressed + cbyteRead, (int)cbyte);
|
||||
|
||||
return STRATEGY::GetCurBytePos() - pbyteCompressed;
|
||||
}
|
||||
|
18
streams.h
18
streams.h
@ -28,13 +28,13 @@ public:
|
||||
void Init(Size size, int cbpp, int ccomp);
|
||||
void AddScan(const void* pbyteComp, const JlsParamaters* pparams);
|
||||
void AddLSE(const JlsCustomParameters* pcustom);
|
||||
int GetBytesWritten()
|
||||
size_t GetBytesWritten()
|
||||
{ return _cbyteOffset; }
|
||||
|
||||
int GetLength()
|
||||
size_t GetLength()
|
||||
{ return _cbyteLength - _cbyteOffset; }
|
||||
|
||||
int Write(BYTE* pdata, int cbyteLength);
|
||||
size_t Write(BYTE* pdata, size_t cbyteLength);
|
||||
|
||||
void EnableCompare(bool bCompare)
|
||||
{ _bCompare = bCompare; };
|
||||
@ -64,15 +64,15 @@ private:
|
||||
}
|
||||
|
||||
|
||||
void Seek(int cbyte)
|
||||
void Seek(size_t cbyte)
|
||||
{ _cbyteOffset += cbyte; }
|
||||
|
||||
bool _bCompare;
|
||||
|
||||
private:
|
||||
BYTE* _pdata;
|
||||
int _cbyteOffset;
|
||||
int _cbyteLength;
|
||||
size_t _cbyteOffset;
|
||||
size_t _cbyteLength;
|
||||
int _icompLast;
|
||||
std::vector<JpegSegment*> _segments;
|
||||
};
|
||||
@ -101,7 +101,7 @@ class JLSInputStream
|
||||
public:
|
||||
JLSInputStream(const BYTE* pdata, int cbyteLength);
|
||||
|
||||
int GetBytesRead()
|
||||
size_t GetBytesRead()
|
||||
{ return _cbyteOffset; }
|
||||
|
||||
const JlsParamaters& GetMetadata() const
|
||||
@ -127,8 +127,8 @@ private:
|
||||
|
||||
private:
|
||||
const BYTE* _pdata;
|
||||
int _cbyteOffset;
|
||||
int _cbyteLength;
|
||||
size_t _cbyteOffset;
|
||||
size_t _cbyteLength;
|
||||
bool _bCompare;
|
||||
JlsParamaters _info;
|
||||
};
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><ItemProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Properties><Property><Name>svn:ignore</Name><Value>Debug
|
||||
mars
|
||||
Release
|
||||
</Value></Property><Property><Name>svn:ignore</Name><Value>Debug
|
||||
mars
|
||||
Release
|
||||
*.user
|
||||
</Value></Property></Properties></ItemProperties>
|
@ -108,7 +108,7 @@ void TestRoundTrip(const char* strName, const BYTE* rgbyteRaw, Size size, int cb
|
||||
params.width = size.cx;
|
||||
params.ilv = ccomp == 3 ? ILV_SAMPLE : ILV_NONE;
|
||||
|
||||
int cbyteCompressed;
|
||||
size_t cbyteCompressed;
|
||||
JpegLsEncode(&rgbyteCompressed[0], rgbyteCompressed.size(), &cbyteCompressed, rgbyteRaw, rgbyteOut.size(), ¶ms);
|
||||
|
||||
double dwtimeEncodeComplete = getTime();
|
||||
@ -338,7 +338,6 @@ void TestSmallBuffer()
|
||||
|
||||
void TestDamagedBitStream()
|
||||
{
|
||||
|
||||
std::vector<BYTE> rgbyteCompressed;
|
||||
ReadFile("..\\test\\lena8b.jls", &rgbyteCompressed, 0);
|
||||
|
||||
|
182
test/test.vcproj
182
test/test.vcproj
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="test"
|
||||
ProjectGUID="{3E349E7B-30C2-4791-81B7-1108014291B7}"
|
||||
RootNamespace="test"
|
||||
@ -12,6 +12,9 @@
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
@ -175,6 +178,167 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/test.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="$(OutDir)"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/test.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="..\$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
OmitFramePointers="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/test.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="$(OutDir)"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="1"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
@ -202,6 +366,22 @@
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="test.cpp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user