Skip to main content

Module simd_manchester

Module simd_manchester 

Source
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 samples back to a bit stream.
manchester_encode_scalar
Scalar Manchester encoding — reference implementation.
manchester_encode_simd
Encode bits using Manchester coding, returning PCM audio samples.