Commit 542eb18f authored by Richard Bosworth's avatar Richard Bosworth
Browse files

Import of PublicDecompWT.zip at version 2.06 from svn+ssh://svn@tcsvn/SOURCES/trunk/.

The zip file was unzipped to provide the full set of sources as a source tree.
README.md was created automatically by gitlab at the point of creating the project.
parent d7092e52
# Microsoft Developer Studio Project File - Name="COMP" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=COMP - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "COMP.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "COMP.mak" CFG="COMP - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "COMP - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "COMP - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "COMP - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GR /GX /O1 /I ".\inc" /I "..\DISE" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D _WIN32_WINNT=0x0400 /YX /FD /c
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "COMP - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm- /GR /GX /ZI /Od /I ".\inc" /I "..\DISE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D _WIN32_WINNT=0x0400 /YX /FD /GZ /c
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "COMP - Win32 Release"
# Name "COMP - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Src\CBuffer.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\CImage.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\CQualityMeasures.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\Inc\Bitlevel.h
# End Source File
# Begin Source File
SOURCE=.\Inc\CBlock.h
# End Source File
# Begin Source File
SOURCE=.\Inc\CBuffer.h
# End Source File
# Begin Source File
SOURCE=.\Inc\CImage.h
# End Source File
# Begin Source File
SOURCE=.\Inc\Compress.h
# End Source File
# Begin Source File
SOURCE=.\Inc\CQualityInfo.h
# End Source File
# Begin Source File
SOURCE=.\Inc\CQualityMeasures.h
# End Source File
# Begin Source File
SOURCE=.\Inc\RMAErrorHandling.h
# End Source File
# End Group
# End Target
# End Project
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: COMP - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\dahl\LOCALS~1\Temp\RSP576.tmp" with contents
[
/nologo /MLd /W3 /GR /GX /ZI /Od /I ".\inc" /I "..\DISE" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D _WIN32_WINNT=0x0400 /Fp"Debug/COMP.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"E:\TestCode\XRitDecomp\COMP\Src\CBuffer.cpp"
"E:\TestCode\XRitDecomp\COMP\Src\CImage.cpp"
"E:\TestCode\XRitDecomp\COMP\Src\CQualityMeasures.cpp"
]
Creating command line "cl.exe @C:\DOCUME~1\dahl\LOCALS~1\Temp\RSP576.tmp"
Creating command line "link.exe -lib /nologo /out:"Debug\COMP.lib" .\Debug\CBuffer.obj .\Debug\CImage.obj .\Debug\CQualityMeasures.obj "
<h3>Output Window</h3>
Compiling...
CBuffer.cpp
WINDOWS BUILD
cl.exe terminated at user request.
</pre>
</body>
</html>
#ifndef BitLevel_included
#define BitLevel_included
/*******************************************************************************
TYPE:
Free functions
PURPOSE:
interface for the bit-mask functions
FUNCTION:
These functions make the bit-masks used in the Huffman coding/decoding process
INTERFACES:
See 'INTERFACES' in the module declaration below
RESOURCES:
Stack memory (>2K).
REFERENCE:
None
PROCESSING:
All the possibles masks are stored into local tables for each function
DATA:
None
LOGIC:
*******************************************************************************/
#include "ErrorHandling.h"
#include "RMAErrorHandling.h"
namespace COMP
{
// Description: Produce a 32 bits mask with 'length' bits set to 1 followed by 'start' (lsb) bits set to 0
// Returns: the produced mask
inline unsigned __int32 speed_mask
(
const unsigned int &i_length, // number of bits set to 1
const unsigned int &i_start // number of lsb bits set to 0
)
{
COMP_TRYTHIS_SPEED
// makes a bit string with 'i_length' ms 1bits followed by 'i_start' ls 0bits
static const unsigned __int32 ref_mask[33] = {
0x00000000,
0x00000001, 0x00000003, 0x00000007, 0x0000000F,
0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF,
0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF,
0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF,
0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF,
0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF
};
#ifdef _DEBUG
Assert (i_length < 33 && i_start < 32, Util::CParamException());
#endif
return (ref_mask[i_length] << i_start);
COMP_CATCHTHIS_SPEED
}
// Description: returns a '000011....11' 16 bits mask with 'length' bits set to 1
// Returns: the produced mask
inline unsigned __int16 speed_mask16_lsb
(
const unsigned int &i_length // number of '1' bits
)
{
COMP_TRYTHIS_SPEED
// makes a 000011....11' 16 bits mask with 'length' 1 bits
static const unsigned __int16 ref_mask[17] = {
0x0000,
0x0001, 0x0003, 0x0007, 0x000F,
0x001F, 0x003F, 0x007F, 0x00FF,
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF
};
#ifdef _DEBUG
Assert (i_length < 17, Util::CParamException());
#endif
return ref_mask[i_length];
COMP_CATCHTHIS_SPEED
}
// Description: returns a '11..100000' 16 bits mask with 'length' bits set to 1
// Returns: the produced mask
inline unsigned __int16 speed_mask16_msb
(
const unsigned int &i_length // number of '1' bits
)
{
COMP_TRYTHIS_SPEED
// Returns a '11..100000' 16 bits mask with 'length' 1 bits
static const unsigned __int16 ref_mask[17] = {
0x0000,
0x8000, 0xC000, 0xE000, 0xF000,
0xF800, 0xFC00, 0xFE00, 0xFF00,
0xFF80, 0xFFC0, 0xFFE0, 0xFFF0,
0xFFF8, 0xFFFC, 0xFFFE, 0xFFFF
};
#ifdef _DEBUG
Assert (i_length < 17, Util::CParamException());
#endif
return ref_mask[i_length];
COMP_CATCHTHIS_SPEED
}
// Description: returns a '11..100000' 32 bits mask with 'length' bits set to 1
// Returns: the produced mask
inline unsigned __int32 speed_mask32_msb
(
const unsigned int &i_length // number of '1' bits
)
{
COMP_TRYTHIS_SPEED
// Returns a '11..100000' 32 bits mask with 'length' 1 bits
static const unsigned __int32 ref_mask[33] = {
0x00000000,
0x80000000, 0xC0000000, 0xE0000000, 0xF0000000,
0xF8000000, 0xFC000000, 0xFE000000, 0xFF000000,
0xFF800000, 0xFFC00000, 0xFFE00000, 0xFFF00000,
0xFFF80000, 0xFFFC0000, 0xFFFE0000, 0xFFFF0000,
0xFFFF8000, 0xFFFFC000, 0xFFFFE000, 0xFFFFF000,
0xFFFFF800, 0xFFFFFC00, 0xFFFFFE00, 0xFFFFFF00,
0xFFFFFF80, 0xFFFFFFC0, 0xFFFFFFE0, 0xFFFFFFF0,
0xFFFFFFF8, 0xFFFFFFFC, 0xFFFFFFFE, 0xFFFFFFFF
};
#ifdef _DEBUG
Assert (i_length < 33, Util::CParamException());
#endif
return ref_mask[i_length];
COMP_CATCHTHIS_SPEED
}
// Description: returns a '000011....11' 32 bits mask with 'length' bits set to 1
// Returns: the produced mask
inline unsigned __int32 speed_mask32_lsb
(
const unsigned int &i_length // number of '1' bits
)
{
COMP_TRYTHIS_SPEED
// Returns a '11..100000' 32 bits mask with 'length' 1 bits
static const unsigned __int32 ref_mask[33] = {
0x00000000,
0x00000001, 0x00000003, 0x00000007, 0x0000000F,
0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF,
0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF,
0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF,
0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF,
0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF
};
#ifdef _DEBUG
Assert (i_length < 33, Util::CParamException());
#endif
return ref_mask[i_length];
COMP_CATCHTHIS_SPEED
}
// Description: return a 16 bits mask with the 'bit' set to 1
// bit=0 is the lsb
// Returns: the produced mask
inline unsigned __int16 speed_bit16
(
const unsigned int &i_bit // the bit number to set to 1
)
{
COMP_TRYTHIS_SPEED
// set the specified bit to 1
static const unsigned __int16 ref_mask[17] = {
0x0000,
0x0001, 0x0002, 0x0004, 0x0008,
0x0010, 0x0020, 0x0040, 0x0080,
0x0100, 0x0200, 0x0400, 0x0800,
0x1000, 0x2000, 0x4000, 0x8000
};
#ifdef _DEBUG
Assert (i_bit < 17, Util::CParamException());
#endif
return ref_mask[i_bit];
COMP_CATCHTHIS_SPEED
}
// Description: return a 32 bits mask with the 'bit' set to 1
// bit=0 is the lsb
// Returns: the produced mask
inline unsigned __int32 speed_bit32
(
const unsigned int &i_bit // the bit number to set to 1
)
{
COMP_TRYTHIS_SPEED
// set the specified bit to 1
static const unsigned __int32 ref_mask[33] = {
0x00000000,
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x00000100, 0x00000200, 0x00000400, 0x00000800,
0x00001000, 0x00002000, 0x00004000, 0x00008000,
0x00010000, 0x00020000, 0x00040000, 0x00080000,
0x00100000, 0x00200000, 0x00400000, 0x00800000,
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000
};
#ifdef _DEBUG
Assert (i_bit < 33, Util::CParamException());
#endif
return ref_mask[i_bit];
COMP_CATCHTHIS_SPEED
}
// Description: maps a coefficient to a SSSS value
// SSSS is the number of bits needed to express the coef in binary
// Returns: SSSS
inline unsigned int speed_csize
(
__int32 i_coeff // coefficient value
)
{
COMP_TRYTHIS_SPEED
static const unsigned int lut[1024] = {
0,
1,
2, 2,
3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
};
// maps a coefficient to a SSSS value
if (i_coeff < 0L) i_coeff = -i_coeff;
if (i_coeff < 1024L) return lut[i_coeff];
if (! (i_coeff >>= 11)) return 11U;
unsigned int n = 12U;
while ((i_coeff >>= 1)) n++;
return n;
COMP_CATCHTHIS_SPEED
}
} // end namespace
#endif
#ifndef CBlock_included
#define CBlock_included
/*******************************************************************************
TYPE:
Concrete Class
PURPOSE:
Handle generic 8*8 matrix block
FUNCTION:
This class provides functions to store and access a generic 8*8 elements matrix
INTERFACES:
See 'INTERFACES' in the module declaration below
RESOURCES:
Heap Memory (>2K).
REFERENCE:
None
PROCESSING:
class CBlock:
CBlock () : constructs one block without initializing its elements
CBlock (T &) contructs one block and initializes all the elements with the specified value
CBlock (const CBlock<T>&) copy constructor
operator [] : return the element at the specified linear position
operator () : return the element at the specified 2D position
Cget () : return the value of the element at the specified 2D position
Cset () : set the value of the element at the specified 2D position
DATA:
See 'DATA :' in the class header below.
LOGIC:
*******************************************************************************/
#include "RMAErrorHandling.h"
namespace COMP
{
template <class T> class CBlock
{
protected :
// DATA :
T m_data[64]; // contains the 64 data elements
public :
// INTERFACES :
// Description: default constructor
// Return: Nothing
inline CBlock()
{
}
// Description: constructor and initialization of all the data elements with the given value
// Return: Nothing
inline CBlock
(
const T &i_val // initialization value
)
{
COMP_TRYTHIS
for (int i=0 ; i<64 ; i++) m_data[i] = i_val;
COMP_CATCHTHIS
}
// Description: copy constructor
// Return: Nothing
inline CBlock
(
const CBlock<T> &i_copy // object to be copied
)
{
COMP_TRYTHIS
for (int i=0 ; i<64 ; i++) m_data[i] = i_copy.m_data[i];
COMP_CATCHTHIS
}
// Description: destructor
// Return: Nothing
inline ~CBlock
(
)
{
}
// Description: gets a reference of the specified element
// Returns: the reference to the specified element
inline T & operator[]
(
const unsigned int &i_index // 1D index of the element
)
{
COMP_TRYTHIS_SPEED
#ifdef _DEBUG
Assert (i_index < 64, Util::CParamException());
#endif
return m_data[i_index];
COMP_CATCHTHIS_SPEED
}
// Description: gets a reference to the 2D specified element [1D index=8*i_y+i_x]
// Returns: the reference to the specified element
inline T & operator()
(
const unsigned int &i_y, // line index
const unsigned int &i_x // column index
)
{
COMP_TRYTHIS_SPEED
#ifdef _DEBUG
Assert (i_y < 8 && i_x < 8, Util::CParamException());
#endif
return m_data[(i_y << 3) + i_x];
COMP_CATCHTHIS_SPEED
}
// Description: gets the value of the 2D specified element [1D index=8*i_y+i_x]
// Returns: the value of the specified element
inline T Cget
(
const unsigned int &i_y, // line index
const unsigned int &i_x // column index
)
const
{
COMP_TRYTHIS_SPEED
#ifdef _DEBUG
Assert (i_y < 8 && i_x < 8, Util::CParamException());
#endif
return m_data[(i_y << 3) + i_x];
COMP_CATCHTHIS_SPEED
}
// Description: gets the value of the specified element [1D index=i_k]
// Returns: the value of the specified element
inline T Cget
(
const unsigned int &i_k // linear index
)
const
{