kzhsw / keyframe-resample-c

Resamples and optimizes keyframe data in pure C.
MIT License
0 stars 0 forks source link

normalize: size/stride based functions #2

Closed myfreeer closed 1 year ago

myfreeer commented 1 year ago

Currently denormalize/normalize are implemented using an optimized whole-buffer operation, but without interleaved buffer support. This proposal aims to add size/stride based functions which would operate on interleaved buffer, and use the whole-buffer impl if size == stride.

Proposal

API:

size_t normalize(float *ptr, const size_t size, const size_t stride,
    const size_t count, const component_type_t component_type);
size_t denormalize(float *ptr, const size_t size, const size_t stride,
    const size_t count, const component_type_t component_type);

Note: