MCPcopy Create free account
hub / github.com/creatale/node-dv / addPaddingBits

Function addPaddingBits

deps/lodepng/lodepng.cpp:5498–5518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5496}
5497
5498static void addPaddingBits(unsigned char* out, const unsigned char* in,
5499 size_t olinebits, size_t ilinebits, unsigned h)
5500{
5501 /*The opposite of the removePaddingBits function
5502 olinebits must be >= ilinebits*/
5503 unsigned y;
5504 size_t diff = olinebits - ilinebits;
5505 size_t obp = 0, ibp = 0; /*bit pointers*/
5506 for(y = 0; y != h; ++y)
5507 {
5508 size_t x;
5509 for(x = 0; x < ilinebits; ++x)
5510 {
5511 unsigned char bit = readBitFromReversedStream(&ibp, in);
5512 setBitOfReversedStream(&obp, out, bit);
5513 }
5514 /*obp += diff; --> no, fill in some value in the padding bits too, to avoid
5515 "Use of uninitialised value of size ###" warning from valgrind*/
5516 for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0);
5517 }
5518}
5519
5520/*
5521in: non-interlaced image with size w*h

Callers 1

preProcessScanlinesFunction · 0.85

Calls 2

setBitOfReversedStreamFunction · 0.85

Tested by

no test coverage detected