Commit b7abb12f55ec2bd45eb8b20c2c058395c289111b
1 parent
c01fc3c2
In Pl_TIFFPredictor::processRow remove special case for first column
Showing
1 changed file
with
3 additions
and
10 deletions
libqpdf/Pl_TIFFPredictor.cc
| ... | ... | @@ -6,8 +6,6 @@ |
| 6 | 6 | |
| 7 | 7 | #include <climits> |
| 8 | 8 | #include <stdexcept> |
| 9 | -#include <vector> | |
| 10 | -#include <iostream> | |
| 11 | 9 | |
| 12 | 10 | Pl_TIFFPredictor::Pl_TIFFPredictor( |
| 13 | 11 | char const* identifier, |
| ... | ... | @@ -62,14 +60,9 @@ Pl_TIFFPredictor::processRow() |
| 62 | 60 | QTC::TC("libtests", "Pl_TIFFPredictor processRow", (action == a_decode ? 0 : 1)); |
| 63 | 61 | BitWriter bw(p_next); |
| 64 | 62 | BitStream in(cur_row.data(), cur_row.size()); |
| 65 | - previous.clear(); | |
| 66 | - for (unsigned int i = 0; i < this->samples_per_pixel; ++i) { | |
| 67 | - long long sample = in.getBitsSigned(this->bits_per_sample); | |
| 68 | - bw.writeBitsSigned(sample, this->bits_per_sample); | |
| 69 | - previous.push_back(sample); | |
| 70 | - } | |
| 71 | - for (unsigned int col = 1; col < this->columns; ++col) { | |
| 72 | - for (auto& prev : previous) { | |
| 63 | + previous.assign(samples_per_pixel, 0); | |
| 64 | + for (unsigned int col = 0; col < this->columns; ++col) { | |
| 65 | + for (auto& prev: previous) { | |
| 73 | 66 | long long sample = in.getBitsSigned(this->bits_per_sample); |
| 74 | 67 | long long new_sample = sample; |
| 75 | 68 | if (action == a_encode) { | ... | ... |