acl/decompression/decompression_settings.h¶
#include "acl/decompression/decompression_settings.h"
The settings that control which code decompression keeps.
rotation_normalization_policy_t¶
enum class rotation_normalization_policy_t
{
never = 0,
lerp_only = 1,
always = 2,
};
Describes when rotations should be normalized during decompression. When lossy rotations are unpacked, the quaternions are typically very close to having a length of 1.0 but this can deviate due to square root precision. When strict normalization is required, make sure to always normalize. Rotations can also drift considerably following linear interpolation and as such it is recommended to always normalize lerp outputs. Normalization should only be disabled if the caller handles it outside ACL explicitly.
| Value | Description |
|---|---|
never |
Never normalize rotations. |
lerp_only |
Only normalize following linear interpolation (recommended default value). |
always |
Always normalize rotations. |
decompression_settings¶
struct decompression_settings
Deriving from this struct and overriding these constexpr functions allow you to control which code is stripped for maximum performance. With these, you can:
- Support only a subset of the formats and statically strip the rest
- Force a single format and statically strip the rest
- Etc.
By default, all formats are supported.
decompression_settings::clamp_sample_time¶
static constexpr bool clamp_sample_time()
Whether or not to clamp the sample time when seek(..) is called. Defaults to true. Must be static constexpr!
decompression_settings::is_track_type_supported¶
static constexpr bool is_track_type_supported(track_type8)
Whether or not the specified track type is supported. Defaults to true. If a track type is statically known not to be supported, the compiler can strip the associated code. Must be static constexpr!
decompression_settings::disable_fp_exeptions¶
static constexpr bool disable_fp_exeptions()
Whether to explicitly disable floating point exceptions during decompression. This has a cost, exceptions are usually disabled globally and do not need to be explicitly disabled during decompression. We assume that floating point exceptions are already disabled by the caller. Must be static constexpr!
decompression_settings::version_supported¶
static constexpr compressed_tracks_version16 version_supported()
Which version we should optimize for. If any is specified, the decompression context will support every single version with full backwards compatibility. Using a specific version allows the compiler to statically strip code for all other versions. This allows the creation of context objects specialized for specific versions which yields optimal performance. Must be static constexpr!
decompression_settings::skip_initialize_safety_checks¶
static constexpr bool skip_initialize_safety_checks()
Whether safety checks are performed when we initialize our context. When safety checks are disabled, initialization never fails even if it is invalid. This is meant as a performance optimization for shipping executables with all unnecessary checks removed. ENABLE AT YOUR OWN RISK! Disabled by default for safety. Must be static constexpr!
decompression_settings::is_wrapping_supported¶
static constexpr bool is_wrapping_supported()
Whether or not to enable support for the wrap looping policy. When wrapping isn't supported, we will use the clamp policy. Required when loops are optimized during compression. See sample_looping_policy for details. Enabled by default. Must be static constexpr!
decompression_settings::is_per_track_rounding_supported¶
static constexpr bool is_per_track_rounding_supported()
Whether or not to enable sample_rounding_policy::per_track support. If support is disabled and that value is provided to the seek(..) function, the runtime will assert. See sample_rounding_policy for details. Enabled by default. Must be static constexpr!
decompression_settings::is_rotation_format_supported¶
static constexpr bool is_rotation_format_supported(rotation_format8)
Whether the specified rotation/translation/scale format are supported or not. Use this to strip code related to formats you do not need. Must be static constexpr!
decompression_settings::is_translation_format_supported¶
static constexpr bool is_translation_format_supported(vector_format8)
Whether the specified rotation/translation/scale format are supported or not. Use this to strip code related to formats you do not need. Must be static constexpr!
decompression_settings::is_scale_format_supported¶
static constexpr bool is_scale_format_supported(vector_format8)
Whether the specified rotation/translation/scale format are supported or not. Use this to strip code related to formats you do not need. Must be static constexpr!
decompression_settings::normalize_rotations¶
static constexpr bool normalize_rotations()
Whether rotations should be normalized before being output or not. Some animation runtimes will normalize in a separate step and do not need the explicit normalization. Enabled by default for safety. Must be static constexpr!
Deprecated
Override get_rotation_normalization_policy instead; to be removed in v3.0
decompression_settings::get_rotation_normalization_policy¶
static constexpr rotation_normalization_policy_t get_rotation_normalization_policy()
The rotation normalization policy controls when rotations are normalized by ACL. By default, we always normalize to ensure safe output no matter what. Must be static constexpr!
decompression_settings::database_settings_type¶
using database_settings_type = null_database_settings;
The database settings to use when decompressing. By default, the database isn't supported.
decompression_settings::are_extended_samples_supported¶
static constexpr bool are_extended_samples_supported()
Whether or not to enable support for extended samples. Extended samples can be used to select per sample how to interpolate (e.g. constant, linear, etc). See track_extended_sample_t for details. Enabled by default. Must be static constexpr!
debug_scalar_decompression_settings¶
struct debug_scalar_decompression_settings : public acl::decompression_settings
These are debug settings, everything is enabled and nothing is stripped. It will have the worst performance but allows every feature.
debug_scalar_decompression_settings::is_track_type_supported¶
static constexpr bool is_track_type_supported(track_type8 type)
Only support scalar tracks.
debug_transform_decompression_settings¶
struct debug_transform_decompression_settings : public acl::decompression_settings
These are debug settings, everything is enabled and nothing is stripped. It will have the worst performance but allows every feature.
debug_transform_decompression_settings::is_track_type_supported¶
static constexpr bool is_track_type_supported(track_type8 type)
Only support transform tracks: vqvf, vqf, and vqsf.
default_scalar_decompression_settings¶
struct default_scalar_decompression_settings : public acl::decompression_settings
These are the default settings. Only the generally optimal settings are enabled and will offer the overall best performance. Supports every version.
default_scalar_decompression_settings::is_track_type_supported¶
static constexpr bool is_track_type_supported(track_type8 type)
Only support scalar tracks.
default_scalar_decompression_settings::is_per_track_rounding_supported¶
static constexpr bool is_per_track_rounding_supported()
Disabled by default since it is an uncommon feature.
default_transform_decompression_settings¶
struct default_transform_decompression_settings : public acl::decompression_settings
These are the default settings. Only the generally optimal settings are enabled and will offer the overall best performance. Supports every version.
default_transform_decompression_settings::is_track_type_supported¶
static constexpr bool is_track_type_supported(track_type8 type)
Only support transform tracks: vqvf, vqf, and vqsf.
default_transform_decompression_settings::is_rotation_format_supported¶
static constexpr bool is_rotation_format_supported(rotation_format8 format)
By default, we only support the variable bit rates as they are generally optimal.
default_transform_decompression_settings::is_translation_format_supported¶
static constexpr bool is_translation_format_supported(vector_format8 format)
By default, we only support the variable bit rates as they are generally optimal.
default_transform_decompression_settings::is_scale_format_supported¶
static constexpr bool is_scale_format_supported(vector_format8 format)
By default, we only support the variable bit rates as they are generally optimal.
default_transform_decompression_settings::get_rotation_normalization_policy¶
static constexpr rotation_normalization_policy_t get_rotation_normalization_policy()
By default, we only normalize following linear interpolation as this is the biggest source of deviation. Non interpolated values will typically be normalized for all intents and purposes. If safety is required, override this value.
default_transform_decompression_settings::is_per_track_rounding_supported¶
static constexpr bool is_per_track_rounding_supported()
Disabled by default since it is an uncommon feature.