Skip to content

Add custom interpolation support per sample for scalar tracks #526

@nfrechette

Description

@nfrechette

At a bare minimum, we need to support constant scalar samples that do not interpolate with their neighbours. Something like a stepped curve where the value changes in discrete steps in some parts but not all of the curve.

We need to store this extra bit within the data format to be efficient. In the track metadata, we can store 1 bit (free) to denote whether it contains any constant keys, and if it does, each key will have an extra bit of packed data. This way, tracks without constant keys do not need to store the overhead AND when decompressing a single keyframe, every bit we'll read will be contiguous.

This extra bit per key can later be extended to a custom header per key to support bezier (or other cubic) interpolation.

How to support this on the raw data side? We need to specify per track/sample which ones are constant. Perhaps we need a new track type for curves where each sample has extra information. Alternatively, a track could have optional metadata per sample that lives alongside it. This later approach would allow mixed usage in a track array since curves that have constant samples and those that do not could live together with a single type. This is probably a better approach as with a separate type, we would be forced to compress them into a separate blob leading to the common scenario where we'll have those with and without. In practice, at decompression we do not care how things interpolate internally as long as we get the correct result out. Interpolation then becomes a property of the track that is preserved through the compression process.

That would later allow for us to automatically sample bezier curves to convert them into linear interpolation as needed during compression. However, care must be taken with bezier interpolation because the speed of ACL comes from the fact that samples are uniform. If the raw data contains beziers, samples will not be uniform. However, we can still support constant samples as long as they align with our sample rate/keyframes.

Progress:

  • Add extended sample support to raw tracks
  • Add sjson clip writer support for extended samples
  • Add sjson clip reader support for extended samples
  • Add unit test for extended samples
  • Add compression support for extended samples
  • Add decompression support for extended samples
  • Add conversion support for extended samples
  • Add regression test for extended samples
  • Add pre-process support for extended samples
  • Update documentation

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions