Skip to content

acl/compression/transform_error_metrics.h

#include "acl/compression/transform_error_metrics.h"

The legacy transform error metrics, which are deprecated.

itransform_error_metric

class itransform_error_metric

Interface for all skeletal error metrics. An error metric is responsible for a few things:

  • applying local space rtm::vqvf transforms on top of rtm::vqvf base transforms (optional)
  • converting from rtm::vqvf into whatever transform type the metric uses (optional)
  • transforming local space transforms into object space
  • evaluating the error function

Most functions require two implementations: with and without scale support. This is entirely for performance reasons as most clips do not have any scale.

Deprecated

Use the transform adapters and the transform metrics instead, to be removed in v2.3

Properties

itransform_error_metric::get_name
virtual const char* get_name() const =0

Returns the unique name of the error metric.

itransform_error_metric::get_hash
virtual uint32_t get_hash() const

Returns a unique hash to represent the error metric.

itransform_error_metric::get_transform_size
virtual size_t get_transform_size(bool has_scale) const =0

Returns the transform size used by the error metric.

itransform_error_metric::needs_conversion
virtual bool needs_conversion(bool has_scale) const

Returns whether or not the error metric uses a transform that isn't rtm::vqvf. If this is the case, we need to convert from rtm::vqvf into the transform type used by the error metric.

itransform_error_metric::supports_bit_rate_algorithm_v2
virtual bool supports_bit_rate_algorithm_v2() const

Whether or not this error metric supports the new bit rate algorithm v2 See: [Bit Rate Optimization Algorithm]

Conversion

itransform_error_metric::convert_transforms
virtual void convert_transforms(
    const convert_transforms_args& args,
    void* out_transforms) const

Converts from rtm::vqvf into the transform type used by the error metric. Called when needs_conversion returns true.

itransform_error_metric::convert_transforms_no_scale
virtual void convert_transforms_no_scale(
    const convert_transforms_args& args,
    void* out_transforms) const

Converts from rtm::vqvf into the transform type used by the error metric. Called when needs_conversion returns true.

Object space

itransform_error_metric::local_to_object_space
virtual void local_to_object_space(
    const local_to_object_space_args& args,
    void* out_object_transforms) const

Takes local space transforms into object space.

itransform_error_metric::local_to_object_space_no_scale
virtual void local_to_object_space_no_scale(
    const local_to_object_space_args& args,
    void* out_object_transforms) const

Takes local space transforms into object space.

Additive base

itransform_error_metric::apply_additive_to_base
virtual void apply_additive_to_base(
    const apply_additive_to_base_args& args,
    void* out_transforms) const

Applies local space transforms on top of base transforms. This is called when a clip has an additive base. The input and output transforms are in rtm::vqvf format. ACL calls this function before convert_transforms, thus the additive applies to the source transforms.

itransform_error_metric::apply_additive_to_base_no_scale
virtual void apply_additive_to_base_no_scale(
    const apply_additive_to_base_args& args,
    void* out_transforms) const

Applies local space transforms on top of base transforms. This is called when a clip has an additive base. The input and output transforms are in rtm::vqvf format. ACL calls this function before convert_transforms_no_scale, thus the additive applies to the source transforms.

Error

itransform_error_metric::calculate_error
rtm::scalarf calculate_error(const calculate_error_args& args) const

Measures the error between a raw and lossy transform.

itransform_error_metric::calculate_error_squared
virtual rtm::scalarf calculate_error_squared(const calculate_error_args& args) const =0

Measures the squared error between a raw and lossy transform.

itransform_error_metric::calculate_error_no_scale
rtm::scalarf calculate_error_no_scale(const calculate_error_args& args) const

Measures the error between a raw and lossy transform.

itransform_error_metric::calculate_error_squared_no_scale
virtual rtm::scalarf calculate_error_squared_no_scale(
    const calculate_error_args& args) const =0

Measures the squared error between a raw and lossy transform.

itransform_error_metric::convert_transforms_args

struct itransform_error_metric::convert_transforms_args

Input arguments for the convert_transforms* functions.

itransform_error_metric::convert_transforms_args::dirty_transform_indices

const uint32_t* dirty_transform_indices;

A list of transform indices that are dirty and need conversion.

itransform_error_metric::convert_transforms_args::num_dirty_transforms

uint32_t num_dirty_transforms;

The number of dirty transforms that need conversion.

itransform_error_metric::convert_transforms_args::transforms

const rtm::vqvf* transforms;

The input transforms in rtm::vqvf format to be converted.

itransform_error_metric::convert_transforms_args::num_transforms

uint32_t num_transforms;

The number of transforms in the input and output buffers.

itransform_error_metric::convert_transforms_args::sample_index

uint32_t sample_index;

The index in the clip of the sample these transforms come from.

itransform_error_metric::convert_transforms_args::is_lossy

bool is_lossy;

True if these transforms are being converted from lossy data. False if these transforms are being converted from the original uncompressed data.

itransform_error_metric::convert_transforms_args::is_additive_base

bool is_additive_base;

ACL applies the additive base pose before the conversion and does not convert the base pose. Thus this value is always false.

itransform_error_metric::local_to_object_space_args

struct itransform_error_metric::local_to_object_space_args

Input arguments for the local_to_object_space* functions.

itransform_error_metric::local_to_object_space_args::dirty_transform_indices

const uint32_t* dirty_transform_indices;

A list of transform indices that are dirty and need transformation.

itransform_error_metric::local_to_object_space_args::num_dirty_transforms

uint32_t num_dirty_transforms;

The number of dirty transforms that need transformation.

itransform_error_metric::local_to_object_space_args::parent_transform_indices

const uint32_t* parent_transform_indices;

A list of parent transform indices for every transform. An index of 0xFFFF represents a root transform with no parent.

itransform_error_metric::local_to_object_space_args::local_transforms

const void* local_transforms;

The input transforms in the type expected by the error metric to be transformed.

itransform_error_metric::local_to_object_space_args::num_transforms

uint32_t num_transforms;

The number of transforms in the input and output buffers.

itransform_error_metric::apply_additive_to_base_args

struct itransform_error_metric::apply_additive_to_base_args

Input arguments for the apply_additive_to_base* functions.

itransform_error_metric::apply_additive_to_base_args::dirty_transform_indices

const uint32_t* dirty_transform_indices;

A list of transform indices that are dirty and need the base applied.

itransform_error_metric::apply_additive_to_base_args::num_dirty_transforms

uint32_t num_dirty_transforms;

The number of dirty transforms that need the base applied.

itransform_error_metric::apply_additive_to_base_args::local_transforms

const void* local_transforms;

The input local space transforms in rtm::vqvf format.

itransform_error_metric::apply_additive_to_base_args::base_transforms

const void* base_transforms;

The input base transforms in rtm::vqvf format.

itransform_error_metric::apply_additive_to_base_args::num_transforms

uint32_t num_transforms;

The number of transforms in the input and output buffers.

itransform_error_metric::calculate_error_args

struct itransform_error_metric::calculate_error_args

Input arguments for the calculate_error* functions.

itransform_error_metric::calculate_error_args::shell_point_x

rtm::vector4f shell_point_x;

A point on our rigid shell along the X axis.

itransform_error_metric::calculate_error_args::shell_point_y

rtm::vector4f shell_point_y;

A point on our rigid shell along the Y axis.

itransform_error_metric::calculate_error_args::shell_point_z

rtm::vector4f shell_point_z;

A point on our rigid shell along the Z axis.

itransform_error_metric::calculate_error_args::shell_points_xxxx

rtm::vector4f shell_points_xxxx;

Points on our rigid shell stored transposed.

itransform_error_metric::calculate_error_args::shell_points_yyyy

rtm::vector4f shell_points_yyyy;

Points on our rigid shell stored transposed.

itransform_error_metric::calculate_error_args::shell_points_zzzz

rtm::vector4f shell_points_zzzz;

Points on our rigid shell stored transposed.

itransform_error_metric::calculate_error_args::transform0

const void* transform0;

The first transform used to measure the error. In the type expected by the error metric. Could be in local or object space (same space as lossy).

itransform_error_metric::calculate_error_args::transform1

const void* transform1;

The second transform used to measure the error. In the type expected by the error metric. Could be in local or object space (same space as raw).

itransform_error_metric::calculate_error_args::construct_sphere_shell

void construct_sphere_shell(float shell_distance)

We measure the error on a rigid shell around each transform. This shell takes the form of a sphere at a certain distance. When no scale is present, measuring any two points is sufficient but when there is scale, measuring all three is necessary. See ./docs/error_metrics.md for details.

vqvf_transform_error_metric

class vqvf_transform_error_metric : public acl::itransform_error_metric

Uses rtm::vqvf arithmetic for local and object space error. Note that this can cause inaccuracy when dealing with shear/skew.

Deprecated

Use the transform adapters and the transform metrics instead, to be removed in v2.3

vqvf_transform_error_metric::get_name

virtual const char* get_name() const override

Returns the unique name of the error metric.

vqvf_transform_error_metric::get_transform_size

virtual size_t get_transform_size(bool has_scale) const override

Returns the transform size used by the error metric.

vqvf_transform_error_metric::needs_conversion

virtual bool needs_conversion(bool has_scale) const override

Returns whether or not the error metric uses a transform that isn't rtm::vqvf. If this is the case, we need to convert from rtm::vqvf into the transform type used by the error metric.

vqvf_transform_error_metric::supports_bit_rate_algorithm_v2

virtual bool supports_bit_rate_algorithm_v2() const override

Whether or not this error metric supports the new bit rate algorithm v2 See: [Bit Rate Optimization Algorithm]

vqvf_transform_error_metric::local_to_object_space

virtual void local_to_object_space(
    const local_to_object_space_args& args,
    void* out_object_transforms) const override

Takes local space transforms into object space.

vqvf_transform_error_metric::local_to_object_space_no_scale

virtual void local_to_object_space_no_scale(
    const local_to_object_space_args& args,
    void* out_object_transforms) const override

Takes local space transforms into object space.

vqvf_transform_error_metric::calculate_error_squared

virtual rtm::scalarf calculate_error_squared(
    const calculate_error_args& args) const override

Measures the squared error between a raw and lossy transform.

vqvf_transform_error_metric::calculate_error_squared_no_scale

virtual rtm::scalarf calculate_error_squared_no_scale(
    const calculate_error_args& args) const override

Measures the squared error between a raw and lossy transform.

vqvf_precise_transform_error_metric

class vqvf_precise_transform_error_metric : public acl::vqvf_transform_error_metric

Uses an analytical computation for the exact error introduced. This is as precise as it gets when no scale is present. We fallback to the normal vqvf approximation when scale is present. This computes the error on the point most impacted by the lossy transform which guarantees that all other points see the same or a lower error.

Deprecated

Use the transform adapters and the transform metrics instead, to be removed in v2.3

vqvf_precise_transform_error_metric::get_name

virtual const char* get_name() const override

Returns the unique name of the error metric.

vqvf_precise_transform_error_metric::calculate_error_squared_no_scale

virtual rtm::scalarf calculate_error_squared_no_scale(
    const calculate_error_args& args) const override

Measures the squared error between a raw and lossy transform.

vqvf_matrix3x4f_transform_error_metric

class vqvf_matrix3x4f_transform_error_metric : public acl::vqvf_transform_error_metric

Uses a mix of rtm::vqvf and rtm::matrix3x4f arithmetic. The local space error is always calculated with rtm::vqvf arithmetic. The object space error is calculated with rtm::vqvf arithmetic if there is no scale and with rtm::matrix3x4f arithmetic if there is scale. Note that this can cause inaccuracy issues if there are very large or very small scale values.

Deprecated

Use the transform adapters and the transform metrics instead, to be removed in v2.3

vqvf_matrix3x4f_transform_error_metric::get_name

virtual const char* get_name() const override

Returns the unique name of the error metric.

vqvf_matrix3x4f_transform_error_metric::get_transform_size

virtual size_t get_transform_size(bool has_scale) const override

Returns the transform size used by the error metric.

vqvf_matrix3x4f_transform_error_metric::needs_conversion

virtual bool needs_conversion(bool has_scale) const override

Returns whether or not the error metric uses a transform that isn't rtm::vqvf. If this is the case, we need to convert from rtm::vqvf into the transform type used by the error metric.

vqvf_matrix3x4f_transform_error_metric::supports_bit_rate_algorithm_v2

virtual bool supports_bit_rate_algorithm_v2() const override

Whether or not this error metric supports the new bit rate algorithm v2 See: [Bit Rate Optimization Algorithm]

vqvf_matrix3x4f_transform_error_metric::convert_transforms

virtual void convert_transforms(
    const convert_transforms_args& args,
    void* out_transforms) const override

Converts from rtm::vqvf into the transform type used by the error metric. Called when needs_conversion returns true.

vqvf_matrix3x4f_transform_error_metric::local_to_object_space

virtual void local_to_object_space(
    const local_to_object_space_args& args,
    void* out_object_transforms) const override

Takes local space transforms into object space.

vqvf_matrix3x4f_transform_error_metric::calculate_error_squared

virtual rtm::scalarf calculate_error_squared(
    const calculate_error_args& args) const override

Measures the squared error between a raw and lossy transform.

additive_vqvf_transform_error_metric

template<additive_clip_format8 additive_format>
class additive_vqvf_transform_error_metric : public acl::vqvf_transform_error_metric

Uses rtm::vqvf arithmetic for local and object space error. This error metric should be used whenever a clip is additive or relative. Note that this can cause inaccuracy when dealing with shear/skew.

Deprecated

Use the transform adapters and the transform metrics instead, to be removed in v2.3

additive_vqvf_transform_error_metric::get_name

virtual const char* get_name() const override

Returns the unique name of the error metric.

additive_vqvf_transform_error_metric::apply_additive_to_base

virtual void apply_additive_to_base(
    const apply_additive_to_base_args& args,
    void* out_transforms) const override

Applies local space transforms on top of base transforms. This is called when a clip has an additive base. The input and output transforms are in rtm::vqvf format. ACL calls this function before convert_transforms, thus the additive applies to the source transforms.

additive_vqvf_transform_error_metric::apply_additive_to_base_no_scale

virtual void apply_additive_to_base_no_scale(
    const apply_additive_to_base_args& args,
    void* out_transforms) const override

Applies local space transforms on top of base transforms. This is called when a clip has an additive base. The input and output transforms are in rtm::vqvf format. ACL calls this function before convert_transforms_no_scale, thus the additive applies to the source transforms.