CCSDS 124.0-B-1 C 1.0.0
CCSDS 124.0-B-1 Lossless Compression
Loading...
Searching...
No Matches
mask.c File Reference

CCSDS 124.0-B-1 mask update logic. More...

#include "ccsds124.h"

Go to the source code of this file.

Functions

Build Vector Functions

Implements CCSDS 124.0-B-1 Section 4 (Mask Update):

  • Build Vector Update (Equation 6)
  • Mask Vector Update (Equation 7)
  • Change Vector Computation (Equation 8)
Authors
Georges Labrèche georg.nosp@m.es@t.nosp@m.anagr.nosp@m.aspa.nosp@m.ce.co.nosp@m.mhttps://georges.fyi
Claude Code (Anthropic) norep.nosp@m.ly@a.nosp@m.nthro.nosp@m.pic..nosp@m.com
See also
https://ccsds.org/Pubs/124x0b1.pdf CCSDS 124.0-B-1 Standard

CCSDS Equation 6:

  • Bₜ = (Iₜ XOR Iₜ₋₁) OR Bₜ₋₁ (if t > 0 and ṗₜ = 0)
  • Bₜ = 0 (otherwise: t=0 or ṗₜ=1)

The build vector accumulates bits that have changed over time. When new_mask_flag is set, the build is used to replace the mask and is then reset to zero.

void ccsds124_update_build (bitvector_t *build, const bitvector_t *input, const bitvector_t *prev_input, int new_mask_flag, size_t t)
 Update build vector (CCSDS Equation 6).
 
Mask Vector Functions

CCSDS Equation 7:

  • Mₜ = (Iₜ XOR Iₜ₋₁) OR Mₜ₋₁ (if ṗₜ = 0)
  • Mₜ = (Iₜ XOR Iₜ₋₁) OR Bₜ₋₁ (if ṗₜ = 1)

The mask tracks which bits are unpredictable. When new_mask_flag is set, the mask is replaced with the build vector.

void ccsds124_update_mask (bitvector_t *mask, const bitvector_t *input, const bitvector_t *prev_input, const bitvector_t *build_prev, int new_mask_flag)
 Update mask vector (CCSDS Equation 7).
 
Change Vector Functions

CCSDS Equation 8:

  • Dₜ = Mₜ XOR Mₜ₋₁

The change vector tracks which mask bits changed between time steps. This is used in encoding to communicate mask updates.

At t=0, the caller sets Mₜ₋₁ = M₀ so that D₀ = M₀ XOR M₀ = 0 (no change at initialization).

void ccsds124_compute_change (bitvector_t *change, const bitvector_t *mask, const bitvector_t *prev_mask, size_t t)
 Compute change vector (CCSDS Equation 8).
 

Detailed Description

CCSDS 124.0-B-1 mask update logic.

Definition in file mask.c.