summaryrefslogtreecommitdiff
path: root/tools/benchmark/benchmark_args.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/benchmark/benchmark_args.cc')
-rw-r--r--tools/benchmark/benchmark_args.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/benchmark/benchmark_args.cc b/tools/benchmark/benchmark_args.cc
index 2bd3eb8..cc2504a 100644
--- a/tools/benchmark/benchmark_args.cc
+++ b/tools/benchmark/benchmark_args.cc
@@ -16,12 +16,13 @@
#include "lib/extras/dec/color_description.h"
#include "lib/jxl/base/status.h"
#include "lib/jxl/color_encoding_internal.h"
-#include "lib/jxl/color_management.h"
-#include "tools/benchmark/benchmark_codec_jpeg.h" // for AddCommand..
+#include "tools/benchmark/benchmark_codec_custom.h" // for AddCommand..
+#include "tools/benchmark/benchmark_codec_jpeg.h" // for AddCommand..
#include "tools/benchmark/benchmark_codec_jxl.h"
-#if JPEGXL_ENABLE_APNG
+
+#ifdef BENCHMARK_PNG
#include "tools/benchmark/benchmark_codec_png.h"
-#endif
+#endif // BENCHMARK_PNG
#ifdef BENCHMARK_WEBP
#include "tools/benchmark/benchmark_codec_webp.h"
@@ -31,7 +32,8 @@
#include "tools/benchmark/benchmark_codec_avif.h"
#endif // BENCHMARK_AVIF
-namespace jxl {
+namespace jpegxl {
+namespace tools {
std::vector<std::string> SplitString(const std::string& s, char c) {
std::vector<std::string> result;
@@ -128,6 +130,7 @@ Status BenchmarkArgs::AddCommandLineOptions() {
AddDouble(&mul_output, "mul_output",
"If nonzero, multiplies linear sRGB by this and clamps to 255",
0.0);
+ AddFlag(&save_heatmap, "save_heatmap", "Saves the heatmap images.", true);
AddDouble(&heatmap_good, "heatmap_good",
"If greater than zero, use this as the good "
"threshold for creating heatmap images.",
@@ -143,6 +146,11 @@ Status BenchmarkArgs::AddCommandLineOptions() {
"Base64-encode the images in the HTML report rather than use "
"external file names. May cause very large HTML data size.",
false);
+ AddFlag(&html_report_use_decompressed, "html_report_use_decompressed",
+ "Show the compressed image as decompressed to --output_extension.",
+ true);
+ AddFlag(&html_report_add_heatmap, "html_report_add_heatmap",
+ "Add heatmaps to the image comparisons.", false);
AddFlag(
&markdown, "markdown",
@@ -186,13 +194,6 @@ Status BenchmarkArgs::AddCommandLineOptions() {
AddDouble(&error_pnorm, "error_pnorm",
"smallest p norm for pooling butteraugli values", 3.0);
- AddFloat(&ba_params.hf_asymmetry, "hf_asymmetry",
- "Multiplier for weighting HF artefacts more than features "
- "being smoothed out. 1.0 means no HF asymmetry. 0.3 is "
- "a good value to start exploring for asymmetry.",
- 0.8f);
- AddFlag(&profiler, "profiler", "If true, print profiler results.", false);
-
AddFlag(&show_progress, "show_progress",
"Show activity dots per completed file during benchmark.", false);
@@ -210,13 +211,13 @@ Status BenchmarkArgs::AddCommandLineOptions() {
"Distance numbers and compression speeds shown in the table are invalid.",
false);
+ if (!AddCommandLineOptionsCustomCodec(this)) return false;
if (!AddCommandLineOptionsJxlCodec(this)) return false;
-#ifdef BENCHMARK_JPEG
if (!AddCommandLineOptionsJPEGCodec(this)) return false;
-#endif // BENCHMARK_JPEG
-#if JPEGXL_ENABLE_APNG
+
+#ifdef BENCHMARK_PNG
if (!AddCommandLineOptionsPNGCodec(this)) return false;
-#endif
+#endif // BENCHMARK_PNG
#ifdef BENCHMARK_WEBP
if (!AddCommandLineOptionsWebPCodec(this)) return false;
#endif // BENCHMARK_WEBP
@@ -228,13 +229,12 @@ Status BenchmarkArgs::AddCommandLineOptions() {
}
Status BenchmarkArgs::ValidateArgs() {
- size_t bits_per_sample = 0; // unused
if (input.empty()) {
fprintf(stderr, "Missing --input filename(s).\n");
return false;
}
- if (extras::CodecFromExtension(output_extension, &bits_per_sample) ==
- extras::Codec::kUnknown) {
+ if (jxl::extras::CodecFromPath(output_extension) ==
+ jxl::extras::Codec::kUnknown) {
JXL_WARNING("Unrecognized output_extension %s, try .png",
output_extension.c_str());
return false; // already warned
@@ -245,14 +245,13 @@ Status BenchmarkArgs::ValidateArgs() {
if (!output_description.empty()) {
// Validate, but also create the profile (only needs to happen once).
JxlColorEncoding output_encoding_external;
- if (!ParseDescription(output_description, &output_encoding_external)) {
+ if (!jxl::ParseDescription(output_description, &output_encoding_external)) {
JXL_WARNING("Unrecognized output_description %s, try RGB_D65_SRG_Rel_Lin",
output_description.c_str());
return false; // already warned
}
- JXL_RETURN_IF_ERROR(jxl::ConvertExternalToInternalColorEncoding(
- output_encoding_external, &output_encoding));
- JXL_RETURN_IF_ERROR(output_encoding.CreateICC());
+ JXL_RETURN_IF_ERROR(output_encoding.FromExternal(output_encoding_external));
+ JXL_RETURN_IF_ERROR(!output_encoding.ICC().empty());
}
JXL_RETURN_IF_ERROR(ValidateArgsJxlCodec(this));
@@ -278,4 +277,5 @@ Status BenchmarkArgs::ValidateArgs() {
return true;
}
-} // namespace jxl
+} // namespace tools
+} // namespace jpegxl