5 #include "compressed_depth_image_transport/rvl_codec.h"
17 int nibble = value & 0x7;
34 int value = 0, bits = 29;
42 nibble =
word_ & 0xf0000000;
43 value |= (nibble << 1) >> bits;
47 }
while (nibble & 0x80000000);
55 const unsigned short* end = input + numPixels;
56 unsigned short previous = 0;
59 int zeros = 0, nonzeros = 0;
60 for (; (input != end) && !*input; input++, zeros++)
63 for (
const unsigned short* p = input; (p != end) && *p++; nonzeros++)
66 for (
int i = 0; i < nonzeros; i++)
68 unsigned short current = *input++;
69 int delta = current - previous;
70 int positive = (delta << 1) ^ (delta >> 31);
82 buffer_ =
pBuffer_ =
const_cast<int*
>(
reinterpret_cast<const int*
>(input));
84 unsigned short current, previous = 0;
85 int numPixelsToDecode = numPixels;
86 while (numPixelsToDecode)
89 numPixelsToDecode -= zeros;
90 for (; zeros; zeros--)
93 numPixelsToDecode -= nonzeros;
94 for (; nonzeros; nonzeros--)
97 int delta = (positive >> 1) ^ -(positive & 1);
98 current = previous + delta;