diff options
author | m-holger <m-holger@kubitscheck.org> | 2024-01-26 21:56:21 +0100 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2024-01-26 21:56:21 +0100 |
commit | b7abb12f55ec2bd45eb8b20c2c058395c289111b (patch) | |
tree | 83444d6e7bdffb0cddd7b1b79c6ea7f20d082ebe /libqpdf | |
parent | c01fc3c2ae3a6487d310f807bc25499d5d517c61 (diff) | |
download | qpdf-b7abb12f55ec2bd45eb8b20c2c058395c289111b.tar.zst |
In Pl_TIFFPredictor::processRow remove special case for first column
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/Pl_TIFFPredictor.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libqpdf/Pl_TIFFPredictor.cc b/libqpdf/Pl_TIFFPredictor.cc index 8820f4bc..5454d13a 100644 --- a/libqpdf/Pl_TIFFPredictor.cc +++ b/libqpdf/Pl_TIFFPredictor.cc @@ -6,8 +6,6 @@ #include <climits> #include <stdexcept> -#include <vector> -#include <iostream> Pl_TIFFPredictor::Pl_TIFFPredictor( char const* identifier, @@ -62,14 +60,9 @@ Pl_TIFFPredictor::processRow() QTC::TC("libtests", "Pl_TIFFPredictor processRow", (action == a_decode ? 0 : 1)); BitWriter bw(p_next); BitStream in(cur_row.data(), cur_row.size()); - previous.clear(); - for (unsigned int i = 0; i < this->samples_per_pixel; ++i) { - long long sample = in.getBitsSigned(this->bits_per_sample); - bw.writeBitsSigned(sample, this->bits_per_sample); - previous.push_back(sample); - } - for (unsigned int col = 1; col < this->columns; ++col) { - for (auto& prev : previous) { + previous.assign(samples_per_pixel, 0); + for (unsigned int col = 0; col < this->columns; ++col) { + for (auto& prev: previous) { long long sample = in.getBitsSigned(this->bits_per_sample); long long new_sample = sample; if (action == a_encode) { |