/src/libjxl/lib/jxl/base/override.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) the JPEG XL Project Authors. All rights reserved. |
2 | | // |
3 | | // Use of this source code is governed by a BSD-style |
4 | | // license that can be found in the LICENSE file. |
5 | | |
6 | | #ifndef LIB_JXL_BASE_OVERRIDE_H_ |
7 | | #define LIB_JXL_BASE_OVERRIDE_H_ |
8 | | |
9 | | #include <cstdint> |
10 | | |
11 | | // 'Trool' for command line arguments: force enable/disable, or use default. |
12 | | |
13 | | namespace jxl { |
14 | | |
15 | | // No effect if kDefault, otherwise forces a feature (typically a FrameHeader |
16 | | // flag) on or off. |
17 | | enum class Override : int8_t { kOn = 1, kOff = 0, kDefault = -1 }; |
18 | | |
19 | 0 | static inline Override OverrideFromBool(bool flag) { |
20 | 0 | return flag ? Override::kOn : Override::kOff; |
21 | 0 | } Unexecuted instantiation: encode.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_ans.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_lz77.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_fast_lossless.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_frame.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_modular.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_patch_dictionary.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_dot_dictionary.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_detect_dots.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_debug_image.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_quant_weights.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_heuristics.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_adaptive_quantization.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_cache.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_group.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_chroma_from_luma.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_ac_strategy.cc:jxl::OverrideFromBool(bool) Unexecuted instantiation: enc_jpeg_data.cc:jxl::OverrideFromBool(bool) |
22 | | |
23 | 1.70k | static inline bool ApplyOverride(Override o, bool default_condition) { |
24 | 1.70k | if (o == Override::kOn) return true; |
25 | 1.70k | if (o == Override::kOff) return false; |
26 | 1.31k | return default_condition; |
27 | 1.70k | } Unexecuted instantiation: encode.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_ans.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_lz77.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_fast_lossless.cc:jxl::ApplyOverride(jxl::Override, bool) enc_frame.cc:jxl::ApplyOverride(jxl::Override, bool) Line | Count | Source | 23 | 1.14k | static inline bool ApplyOverride(Override o, bool default_condition) { | 24 | 1.14k | if (o == Override::kOn) return true; | 25 | 1.14k | if (o == Override::kOff) return false; | 26 | 855 | return default_condition; | 27 | 1.14k | } |
Unexecuted instantiation: enc_modular.cc:jxl::ApplyOverride(jxl::Override, bool) enc_patch_dictionary.cc:jxl::ApplyOverride(jxl::Override, bool) Line | Count | Source | 23 | 372 | static inline bool ApplyOverride(Override o, bool default_condition) { | 24 | 372 | if (o == Override::kOn) return true; | 25 | 372 | if (o == Override::kOff) return false; | 26 | 275 | return default_condition; | 27 | 372 | } |
Unexecuted instantiation: enc_dot_dictionary.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_detect_dots.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_debug_image.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_quant_weights.cc:jxl::ApplyOverride(jxl::Override, bool) enc_heuristics.cc:jxl::ApplyOverride(jxl::Override, bool) Line | Count | Source | 23 | 186 | static inline bool ApplyOverride(Override o, bool default_condition) { | 24 | 186 | if (o == Override::kOn) return true; | 25 | 186 | if (o == Override::kOff) return false; | 26 | 186 | return default_condition; | 27 | 186 | } |
Unexecuted instantiation: enc_adaptive_quantization.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_cache.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_group.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_chroma_from_luma.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_ac_strategy.cc:jxl::ApplyOverride(jxl::Override, bool) Unexecuted instantiation: enc_jpeg_data.cc:jxl::ApplyOverride(jxl::Override, bool) |
28 | | |
29 | | } // namespace jxl |
30 | | |
31 | | #endif // LIB_JXL_BASE_OVERRIDE_H_ |