Skip to content

acl/compression/transform_base_adapter.h

#include "acl/compression/transform_base_adapter.h"

The interface that combines a transform with its base when the base format is custom.

itransform_base_adapter_t

class itransform_base_adapter_t

Interface for a custom base format. A base adapter combines each transform of a clip sample with the base, when the base format is custom. See additive_clip_format8::custom and transform_base_desc_t.

Compression puts the base in the transform space of the clip first. Thus the base transform and the clip transform that the adapter receives are in the same space. Then compression puts the combined transforms in object space with the transform space of the clip. The adapter combines one transform at a time: it does not use the transform hierarchy.

Compression calls apply_base in its inner loops, with the raw samples and with the lossy samples. The same input must always give the same output.

itransform_base_adapter_t::get_name

virtual const char* get_name() const =0

Returns the unique name of the base adapter.

itransform_base_adapter_t::get_hash

virtual uint32_t get_hash() const

Returns a unique hash to represent the base adapter.

itransform_base_adapter_t::get_default_scale

virtual float get_default_scale() const

Returns the default scale of the clip samples: 0.0 or 1.0. A track without scale (for example, a vqf track) gives this scale to each of its samples. Decompression returns this scale when the compressed tracks have no scale. The compressed data keeps one bit for the default scale, thus other values are not valid.

Defaults to 1.0.

itransform_base_adapter_t::apply_base

virtual rtm::vqvf apply_base(
    uint32_t transform_index,
    const rtm::vqvf& base_transform,
    const rtm::vqvf& transform) const =0

Combines a transform of a clip sample with its base transform and returns the result.

  • transform_index: the index of the transform in the clip
  • base_transform: the base transform, in the transform space of the clip
  • transform: the transform of the clip sample, in the transform space of the clip Compression and the error measurement use the result as is: they do not normalize its rotation. Thus the measured error is the error of your runtime when it combines the transforms with the same function and does not normalize the result. If your runtime normalizes the result, normalize it here.