CCSDS 124.0-B-1 C 1.0.0
CCSDS 124.0-B-1 Lossless Compression
Loading...
Searching...
No Matches
Mask Update API

CCSDS Section 4: Mask vector update equations. More...

Functions

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).
 
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).
 
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 Section 4: Mask vector update equations.

These functions implement the core mask prediction logic that identifies which bits are predictable vs. unpredictable.

Function Documentation

◆ ccsds124_compute_change()

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).

Dₜ = Mₜ XOR Mₜ₋₁. The caller sets prev_mask = mask before calling at t=0 so that D₀ = 0 (no change at initialization).

Parameters
[out]changeChange vector Dₜ
[in]maskCurrent mask Mₜ
[in]prev_maskPrevious mask Mₜ₋₁
[in]tTime index (unused, kept for API compatibility)

Definition at line 125 of file mask.c.

References bitvector_xor().

Referenced by ccsds124_compress_packet().

◆ ccsds124_update_build()

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).

The build vector accumulates XOR differences between consecutive packets to track which bits have changed.

Parameters
[out]buildUpdated build vector Bₜ
[in]inputCurrent input Iₜ
[in]prev_inputPrevious input Iₜ₋₁
[in]new_mask_flagṗₜ flag (1 = reset build)
[in]tTime index (0 = first packet)

Definition at line 43 of file mask.c.

References bitvector_init(), bitvector_or(), bitvector_xor(), bitvector_zero(), and bitvector::length.

Referenced by ccsds124_compress_packet().

◆ ccsds124_update_mask()

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).

The mask vector identifies unpredictable bits (1 = unpredictable).

Parameters
[out]maskUpdated mask vector Mₜ
[in]inputCurrent input Iₜ
[in]prev_inputPrevious input Iₜ₋₁
[in]build_prevPrevious build vector Bₜ₋₁
[in]new_mask_flagṗₜ flag (1 = update from build)

Definition at line 85 of file mask.c.

References bitvector_init(), bitvector_or(), bitvector_xor(), and bitvector::length.

Referenced by ccsds124_compress_packet().