Helper functions to decode sliced VBI data.
More...
Helper functions to decode sliced VBI data.
§ vbi_par()
void vbi_par |
( |
uint8_t * |
p, |
|
|
unsigned int |
n |
|
) |
| |
- Parameters
-
p | Array of unsigned bytes. |
n | Size of array. |
Of each byte of the array, changes the most significant bit to make the number of set bits odd.
- Since
- 0.2.12
Referenced by vbi_unpar8().
§ vbi_unpar()
int vbi_unpar |
( |
uint8_t * |
p, |
|
|
unsigned int |
n |
|
) |
| |
- Parameters
-
p | Array of unsigned bytes. |
n | Size of array. |
Tests the parity and clears the most significant bit of each byte of the array.
- Returns
- A negative value if any byte of the array had even parity (sum of bits modulo 2 is 0).
- Since
- 0.2.12
Referenced by vbi_unpar8().
§ vbi_ham24p()
void vbi_ham24p |
( |
uint8_t * |
p, |
|
|
unsigned int |
c |
|
) |
| |
- Parameters
-
p | A Hamming 24/18 protected 24 bit word will be stored here, last significant byte first, lsb first transmitted. |
c | Integer between 0 ... 1 << 18 - 1. |
Encodes an 18 bit word with Hamming 24/18 protection as specified in ETS 300 706, Section 8.3.
- Since
- 0.2.27
Referenced by vbi_unham16p().
§ vbi_unham24p()
int vbi_unham24p |
( |
const uint8_t * |
p | ) |
|
- Parameters
-
p | Pointer to a Hamming 24/18 protected 24 bit word, last significant byte first, lsb first transmitted. |
Decodes a Hamming 24/18 protected byte triplet as specified in ETS 300 706, Section 8.3.
- Returns
- Triplet data bits D18 [msb] ... D1 [lsb] or a negative value if the triplet contained uncorrectable errors.
- Since
- 0.2.12
Referenced by vbi_unham16p().
§ vbi_rev8()
_vbi_inline unsigned int vbi_rev8 |
( |
unsigned int |
c | ) |
|
§ vbi_rev16()
_vbi_inline unsigned int vbi_rev16 |
( |
unsigned int |
c | ) |
|
- Parameters
-
Reverses (or "reflects") the bits of the argument.
- Returns
- Data bits 0 [msb] ... 15 [lsb].
- Since
- 0.2.12
§ vbi_rev16p()
_vbi_inline unsigned int vbi_rev16p |
( |
const uint8_t * |
p | ) |
|
- Parameters
-
p | Pointer to a 16 bit word, last significant byte first. |
Reverses (or "reflects") the bits of the argument.
- Returns
- Data bits 0 [msb] ... 15 [lsb].
- Since
- 0.2.12
Referenced by vbi_decode_teletext_8301_cni().
§ vbi_par8()
_vbi_inline unsigned int vbi_par8 |
( |
unsigned int |
c | ) |
|
- Parameters
-
- Returns
- Changes the most significant bit of the byte to make the number of set bits odd.
- Since
- 0.2.12
Referenced by vbi_capture_sim_add_noise().
§ vbi_unpar8()
_vbi_inline int vbi_unpar8 |
( |
unsigned int |
c | ) |
|
- Parameters
-
- Returns
- If the byte has odd parity (sum of bits modulo 2 is 1) the byte AND 127, otherwise a negative value.
- Since
- 0.2.12
References vbi_par(), and vbi_unpar().
Referenced by vbi_xds_demux_feed().
§ vbi_ham8()
_vbi_inline unsigned int vbi_ham8 |
( |
unsigned int |
c | ) |
|
- Parameters
-
c | Integer between 0 ... 15. |
Encodes a nibble with Hamming 8/4 protection as specified in EN 300 706, Section 8.2.
- Returns
- Hamming encoded unsigned byte, lsb first transmitted.
- Since
- 0.2.12
§ vbi_unham8()
_vbi_inline int vbi_unham8 |
( |
unsigned int |
c | ) |
|
§ vbi_unham16p()
_vbi_inline int vbi_unham16p |
( |
const uint8_t * |
p | ) |
|