10 #define encodePixel(predictor) \ 15 pp.predict(p, bpp, bpr, predictor::predict); \ 17 pix.forwardTransform(); \ 21 int nl = pix.numBits(); \ 22 cx = (cx << CONTEXT_BITS) + nl; \ 23 this->writeBits(dBits[cx & bitMask(2 * CONTEXT_BITS)], dCount[cx & bitMask(2 * CONTEXT_BITS)]); \ 24 pix.writeBits(*this, nl); \ 29 typename Predictor = Predictor3avgplane<>,
41 const int bpr = im.samplesPerLine();
42 const unsigned char *
p = im.data();
43 int size = im.width() * im.height();
44 const unsigned char *pend = p + bpp * size;
50 const unsigned char *endline = p + bpr - bpp;
51 while (p != endline) {
58 const unsigned char *endline = p + bpr - bpp;
59 while (p != endline) {
66 int w = im.
width() - 1;
static unsigned int numBits(unsigned int v)
void encodeImageSize(const Image<> &im)
unsigned int staticdBits[1<< (2 *CONTEXT_BITS)]
unsigned int dBits[1<< (2 *CONTEXT_BITS)]
void writeBits(unsigned int bits, unsigned int count)
const unsigned int staticdCount[1<< (2 *CONTEXT_BITS)]
void encodeImagePixels(const Image<> &im) __attribute__((always_inline))
unsigned int dCount[1<< (2 *CONTEXT_BITS)]
#define encodePixel(predictor)