13 int nibble = value & 0x7;
14 if (value >>= 3) nibble |= 0x8;
28 int value = 0, bits = 29;
34 nibble =
word_ & 0xf0000000;
35 value |= (nibble << 1) >> bits;
39 }
while (nibble & 0x80000000);
47 const unsigned short* end = input + numPixels;
48 unsigned short previous = 0;
49 while (input != end) {
50 int zeros = 0, nonzeros = 0;
51 for (; (input != end) && !*input; input++, zeros++)
54 for (
const unsigned short* p = input; (p != end) && *p++; nonzeros++)
57 for (
int i = 0; i < nonzeros; i++) {
58 unsigned short current = *input++;
59 int delta = current - previous;
60 int positive = (delta << 1) ^ (delta >> 31);
72 buffer_ =
pBuffer_ =
const_cast<int*
>(
reinterpret_cast<const int*
>(input));
74 unsigned short current, previous = 0;
75 int numPixelsToDecode = numPixels;
76 while (numPixelsToDecode) {
78 numPixelsToDecode -= zeros;
79 for (; zeros; zeros--) *output++ = 0;
81 numPixelsToDecode -= nonzeros;
82 for (; nonzeros; nonzeros--) {
84 int delta = (positive >> 1) ^ -(positive & 1);
85 current = previous + delta;
void EncodeVLE(int value)
void DecompressRVL(const unsigned char *input, unsigned short *output, int numPixels)
int CompressRVL(const unsigned short *input, unsigned char *output, int numPixels)