summaryrefslogtreecommitdiff
path: root/lib/jxl/quantizer_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jxl/quantizer_test.cc')
-rw-r--r--lib/jxl/quantizer_test.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/jxl/quantizer_test.cc b/lib/jxl/quantizer_test.cc
index d570bf6..aff19f4 100644
--- a/lib/jxl/quantizer_test.cc
+++ b/lib/jxl/quantizer_test.cc
@@ -5,12 +5,12 @@
#include "lib/jxl/quantizer.h"
-#include "gtest/gtest.h"
#include "lib/jxl/base/span.h"
-#include "lib/jxl/common.h"
#include "lib/jxl/dec_bit_reader.h"
+#include "lib/jxl/enc_fields.h"
#include "lib/jxl/image_ops.h"
#include "lib/jxl/image_test_utils.h"
+#include "lib/jxl/testing.h"
namespace jxl {
namespace {
@@ -39,7 +39,8 @@ TEST(QuantizerTest, BitStreamRoundtripSameQuant) {
ImageI raw_quant_field(qxsize, qysize);
quantizer1.SetQuant(0.17f, 0.17f, &raw_quant_field);
BitWriter writer;
- EXPECT_TRUE(quantizer1.Encode(&writer, 0, nullptr));
+ QuantizerParams params = quantizer1.GetParams();
+ EXPECT_TRUE(WriteQuantizerParams(params, &writer, 0, nullptr));
writer.ZeroPadToByte();
const size_t bits_written = writer.BitsWritten();
Quantizer quantizer2(&dequant);
@@ -63,7 +64,8 @@ TEST(QuantizerTest, BitStreamRoundtripRandomQuant) {
RandomFillImage(&qf, 0.0f, 1.0f);
quantizer1.SetQuantField(quant_dc, qf, &raw_quant_field);
BitWriter writer;
- EXPECT_TRUE(quantizer1.Encode(&writer, 0, nullptr));
+ QuantizerParams params = quantizer1.GetParams();
+ EXPECT_TRUE(WriteQuantizerParams(params, &writer, 0, nullptr));
writer.ZeroPadToByte();
const size_t bits_written = writer.BitsWritten();
Quantizer quantizer2(&dequant);