/usr/include/CharLS/lookuptable.h is in libcharls-dev 1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | //
// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use.
//
#ifndef CHARLS_LOOKUPTABLE
#define CHARLS_LOOKUPTABLE
// Tables for fast decoding of short Golomb Codes.
struct Code
{
Code()
{
}
Code(LONG value, LONG length) :
_value(value),
_length(length)
{
}
LONG GetValue() const
{ return _value; }
LONG GetLength() const
{ return _length; }
LONG _value;
LONG _length;
};
class CTable
{
public:
enum { cbit = 8 } ;
CTable()
{
::memset(rgtype, 0, sizeof(rgtype));
}
void AddEntry(BYTE bvalue, Code c);
inlinehint const Code& Get(LONG value)
{ return rgtype[value]; }
private:
Code rgtype[1 << cbit];
};
//
// AddEntry
//
void CTable::AddEntry(BYTE bvalue, Code c)
{
LONG length = c.GetLength();
ASSERT(length <= cbit);
for (LONG i = 0; i < LONG(1) << (cbit - length); ++i)
{
ASSERT(rgtype[(bvalue << (cbit - length)) + i].GetLength() == 0);
rgtype[(bvalue << (cbit - length)) + i] = c;
}
}
#endif
|