Expand description
SIMD-accelerated Manchester encoding and decoding for LTC bitstreams.
Manchester coding maps each data bit to two half-bit audio periods:
- Bit
0: high half-period followed by low half-period - Bit
1: low half-period followed by high half-period
The audio samples are i16: HIGH_LEVEL and LOW_LEVEL.
§SIMD strategy
On x86_64 targets with the avx2 CPU feature available at runtime,
manchester_encode_simd processes 32 input bytes (= 256 bits) per
iteration using _mm256_movemask_epi8 to extract the sign bit of each
byte, then expands each bit into two i16 samples. All other targets (and
AVX2-capable targets without the feature at runtime) fall back to a pure
scalar path that produces identical output.
Constants§
- HIGH_
LEVEL - PCM level for the high half-period.
- LOW_
LEVEL - PCM level for the low half-period.
Functions§
- manchester_
decode_ scalar - Scalar Manchester decoding — reference implementation.
- manchester_
decode_ simd - Decode Manchester-coded audio
samplesback to a bit stream. - manchester_
encode_ scalar - Scalar Manchester encoding — reference implementation.
- manchester_
encode_ simd - Encode
bitsusing Manchester coding, returning PCM audio samples.