Home | History | Annotate | Download | only in lodepng

Lines Matching defs:bp

362     size_t bp = 0, pos = 0; //bit pointer and byte pointer
368 size_t bpstart = bp;
369 if(bp >> 3 >= in.size()) { error = 52; return; } //error, bit pointer will jump past memory
370 BFINAL = readBitFromStream(bp, &in[inpos]);
371 unsigned long BTYPE = readBitFromStream(bp, &in[inpos]); BTYPE += 2 * readBitFromStream(bp, &in[inpos]);
375 else if(BTYPE == 0) inflateNoCompression(out, &in[inpos], bp, pos, in.size());
376 else inflateHuffmanBlock(out, &in[inpos], bp, pos, in.size(), BTYPE);
378 zlibinfo->back().compressedbits = bp - bpstart;
394 unsigned long huffmanDecodeSymbol(const unsigned char* in, size_t& bp, const HuffmanTree& codetree, size_t inlength)
400 if((bp & 0x07) == 0 && (bp >> 3) > inlength) { error = 10; return 0; } //error: end reached without endcode
401 error = codetree.decode(decoded, ct, treepos, readBitFromStream(bp, in));
408 const unsigned char* in, size_t& bp, size_t inlength)
410 size_t bpstart = bp;
413 if(bp >> 3 >= inlength - 2) { error = 49; return; } //the bit pointer is or will go past the memory
414 size_t HLIT = readBitsFromStream(bp, in, 5) + 257; //number of literal/length codes + 257
415 size_t HDIST = readBitsFromStream(bp, in, 5) + 1; //number of dist codes + 1
416 size_t HCLEN = readBitsFromStream(bp, in, 4) + 4; //number of code length codes + 4
421 for(size_t i = 0; i < 19; i++) codelengthcode[CLCL[i]] = (i < HCLEN) ? readBitsFromStream(bp, in, 3) : 0;
428 unsigned long code = huffmanDecodeSymbol(in, bp, codelengthcodetree, inlength); if(error) return;
433 if(bp >> 3 >= inlength) { error = 50; return; } //error, bit pointer jumps past memory
434 replength = 3 + readBitsFromStream(bp, in, 2);
446 if(bp >> 3 >= inlength) { error = 50; return; } //error, bit pointer jumps past memory
447 replength = 3 + readBitsFromStream(bp, in, 3);
457 if(bp >> 3 >= inlength) { error = 50; return; } //error, bit pointer jumps past memory
458 replength = 11 + readBitsFromStream(bp, in, 7);
473 zlibinfo->back().treebits = bp - bpstart;
481 const unsigned char* in, size_t& bp, size_t& pos, size_t inlength, unsigned long btype)
485 else if(btype == 2) { getTreeInflateDynamic(codetree, codetreeD, in, bp, inlength); if(error) return; }
488 unsigned long code = huffmanDecodeSymbol(in, bp, codetree, inlength); if(error) return;
507 if((bp >> 3) >= inlength) { error = 51; return; } //error, bit pointer will jump past memory
508 length += readBitsFromStream(bp, in, numextrabits);
509 unsigned long codeD = huffmanDecodeSymbol(in, bp, codetreeD, inlength); if(error) return;
512 if((bp >> 3) >= inlength) { error = 51; return; } //error, bit pointer will jump past memory
513 dist += readBitsFromStream(bp, in, numextrabitsD);
534 const unsigned char* in, size_t& bp, size_t& pos, size_t inlength)
536 while((bp & 0x7) != 0) bp++; //go to first boundary of byte
537 size_t p = bp / 8;
547 bp = p * 8;