| 5636 | } |
| 5637 | |
| 5638 | static void addPaddingBits(unsigned char* out, const unsigned char* in, |
| 5639 | size_t olinebits, size_t ilinebits, unsigned h) { |
| 5640 | /*The opposite of the removePaddingBits function |
| 5641 | olinebits must be >= ilinebits*/ |
| 5642 | unsigned y; |
| 5643 | size_t diff = olinebits - ilinebits; |
| 5644 | size_t obp = 0, ibp = 0; /*bit pointers*/ |
| 5645 | for(y = 0; y != h; ++y) { |
| 5646 | size_t x; |
| 5647 | for(x = 0; x < ilinebits; ++x) { |
| 5648 | unsigned char bit = readBitFromReversedStream(&ibp, in); |
| 5649 | setBitOfReversedStream(&obp, out, bit); |
| 5650 | } |
| 5651 | /*obp += diff; --> no, fill in some value in the padding bits too, to avoid |
| 5652 | "Use of uninitialised value of size ###" warning from valgrind*/ |
| 5653 | for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0); |
| 5654 | } |
| 5655 | } |
| 5656 | |
| 5657 | /* |
| 5658 | in: non-interlaced image with size w*h |
no test coverage detected