libsstvenc
Asynchronous Analogue SSTV encoder
|
Topics | |
Colour Space/Order bitmap | |
Data Structures | |
struct | sstvenc_encoder_pulse |
struct | sstvenc_mode |
Macros | |
#define | SSTVENC_PERIOD_VIS_START (300000u) |
#define | SSTVENC_PERIOD_VIS_SYNC (10000u) |
#define | SSTVENC_PERIOD_VIS_BIT (30000u) |
#define | SSTVENC_PERIOD_FSKID_BIT (22000u) |
#define | SSTVENC_PASOKON_P3_TIMEUNIT (1000000000.0 / 4800.0) |
#define | SSTVENC_PASOKON_P5_TIMEUNIT (1000000000.0 / 3200.0) |
#define | SSTVENC_PASOKON_P7_TIMEUNIT (1000000000.0 / 2400.0) |
#define | SSTVENC_PASOKON_SYNC(unit) |
#define | SSTVENC_PASOKON_GAP(unit) |
#define | SSTVENC_PASOKON_SCAN(unit) |
Functions | |
uint8_t | sstvenc_get_mode_count () |
const struct sstvenc_mode * | sstvenc_get_mode_by_idx (uint8_t idx) |
const struct sstvenc_mode * | sstvenc_get_mode_by_name (const char *name) |
uint64_t | sstvenc_pulseseq_get_txtime (const struct sstvenc_encoder_pulse *seq) |
uint64_t | sstvenc_mode_get_txtime (const struct sstvenc_mode *const mode, const char *fsk_id) |
size_t | sstvenc_mode_get_fb_sz (const struct sstvenc_mode *const mode) |
uint32_t | sstvenc_get_pixel_posn (const struct sstvenc_mode *const mode, uint16_t x, uint16_t y) |
struct sstvenc_encoder_pulse |
Convenience structure, encodes the duration and frequency of a pulse.
Definition at line 141 of file sstvmode.h.
Data Fields | ||
---|---|---|
uint32_t | duration_ns |
The duration of the pulse in nanoseconds. A duration of 0ns is used to terminate an array of pulse definitions. |
uint32_t | frequency |
The pulse frequency in hertz. |
struct sstvenc_mode |
Description of a SSTV mode. This encodes all of the specifications of a given mode.
Definition at line 155 of file sstvmode.h.
Data Fields | ||
---|---|---|
const struct sstvenc_encoder_pulse * | backporch |
Back-porch sync pulses after channel 2 (or after channel 0 for mono SSTV modes). May be NULL if there's no backporch at the end of a scan line. |
uint16_t | colour_space_order |
The colour space mode and order used. This is a bitmap, see SSTVENC_MODE_ORDER |
const char * | description |
Human-readable description of a mode, e.g. Martin M1 |
const struct sstvenc_encoder_pulse * | finalseq |
Final sequence pulses following last scan line. May be NULL if there is no final pulse sequence after the final scan line. |
const struct sstvenc_encoder_pulse * | frontporch |
Front-porch sync pulses that happen before channel 0 is sent. An array terminated with a 0Hz 0sec "pulse". May be NULL if there are no start-of-scan pulses before channel 0. |
const struct sstvenc_encoder_pulse * | gap01 |
Sync pulses between channel 0 and channel 1. May be NULL if there are no pulses between channels 0 and 1. |
const struct sstvenc_encoder_pulse * | gap12 |
Sync pulses between channel 1 and channel 2. May be NULL if there are no pulses between channels 1 and 2. |
const struct sstvenc_encoder_pulse * | gap23 |
Sync pulses between channel 2 and channel 3. May be NULL if there are no pulses between channels 2 and 3. |
uint16_t | height |
Height of the SSTV image sent in pixels. |
const struct sstvenc_encoder_pulse * | initseq |
Initial sequence pulses prior to first scan line. May be NULL if the mode does not include pulses prior to the first scan line. |
const char * | name |
Short-hand name of a SSTV mode, e.g. M1 |
uint32_t | scanline_period_ns[4] |
Scanline periods for each of the three channels. For mono modes, only the first is used. |
uint8_t | vis_code |
The VIS code sent at the start of the SSTV transmission. |
uint16_t | width |
Width of the SSTV image sent in pixels. |
#define SSTVENC_PASOKON_GAP | ( | unit | ) |
Definition at line 93 of file sstvmode.c.
#define SSTVENC_PASOKON_P3_TIMEUNIT (1000000000.0 / 4800.0) |
Definition at line 88 of file sstvmode.c.
#define SSTVENC_PASOKON_P5_TIMEUNIT (1000000000.0 / 3200.0) |
Definition at line 89 of file sstvmode.c.
#define SSTVENC_PASOKON_P7_TIMEUNIT (1000000000.0 / 2400.0) |
Definition at line 90 of file sstvmode.c.
#define SSTVENC_PASOKON_SCAN | ( | unit | ) |
Definition at line 94 of file sstvmode.c.
#define SSTVENC_PASOKON_SYNC | ( | unit | ) |
Definition at line 92 of file sstvmode.c.
#define SSTVENC_PERIOD_FSKID_BIT (22000u) |
Definition at line 24 of file sstvmode.h.
Referenced by sstvenc_encoder_next_fsk_pulse(), and sstvenc_mode_get_txtime().
#define SSTVENC_PERIOD_VIS_BIT (30000u) |
Definition at line 22 of file sstvmode.h.
Referenced by sstvenc_encoder_next_vis_pulse(), and sstvenc_mode_get_txtime().
#define SSTVENC_PERIOD_VIS_START (300000u) |
Definition at line 20 of file sstvmode.h.
Referenced by sstvenc_encoder_next_vis_pulse(), and sstvenc_mode_get_txtime().
#define SSTVENC_PERIOD_VIS_SYNC (10000u) |
Definition at line 21 of file sstvmode.h.
Referenced by sstvenc_encoder_next_vis_pulse(), and sstvenc_mode_get_txtime().
const struct sstvenc_mode * sstvenc_get_mode_by_idx | ( | uint8_t | idx | ) |
Return the Nth SSTV mode. Returns NULL if we're off the end of the array.
Definition at line 585 of file sstvmode.c.
References sstvenc_get_mode_count(), and sstvenc_sstv_modes.
Referenced by show_modes().
const struct sstvenc_mode * sstvenc_get_mode_by_name | ( | const char * | name | ) |
Return the SSTV mode whose name matches this. Returns NULL if no such matching mode is found.
Definition at line 593 of file sstvmode.c.
References sstvenc_mode::name, sstvenc_get_mode_count(), and sstvenc_sstv_modes.
Referenced by main().
uint8_t sstvenc_get_mode_count | ( | ) |
Return the number of SSTV modes defined.
Definition at line 581 of file sstvmode.c.
References sstvenc_sstv_modes.
Referenced by sstvenc_get_mode_by_idx(), and sstvenc_get_mode_by_name().
uint32_t sstvenc_get_pixel_posn | ( | const struct sstvenc_mode *const | mode, |
uint16_t | x, | ||
uint16_t | y ) |
Fetch the offset into the framebuffer for the given pixel.
[in] | mode | SSTV mode in use |
[in] | x,y | Pixel co-ordinates |
Definition at line 704 of file sstvmode.c.
References sstvenc_mode::colour_space_order, sstvenc_mode::height, SSTVENC_CSO_MASK_MODE, SSTVENC_CSO_MODE_MONO, and sstvenc_mode::width.
Referenced by main(), and sstvenc_encoder_next_channel_pulse().
size_t sstvenc_mode_get_fb_sz | ( | const struct sstvenc_mode *const | mode | ) |
Return the size of the framebuffer needed for this mode in bytes.
Definition at line 692 of file sstvmode.c.
References sstvenc_mode::colour_space_order, sstvenc_mode::height, SSTVENC_CSO_MASK_MODE, SSTVENC_CSO_MODE_MONO, and sstvenc_mode::width.
uint64_t sstvenc_mode_get_txtime | ( | const struct sstvenc_mode *const | mode, |
const char * | fsk_id ) |
Compute the transmission time of the specified mode in nanoseconds.
[in] | mode | The SSTV mode being computed |
[in] | fsk_id | The FSK ID being transmitted, for length calculations. If no FSK is enabled, set this to NULL. |
Definition at line 614 of file sstvmode.c.
References sstvenc_mode::backporch, sstvenc_mode::colour_space_order, sstvenc_mode::finalseq, sstvenc_mode::frontporch, sstvenc_mode::gap01, sstvenc_mode::gap12, sstvenc_mode::gap23, sstvenc_mode::height, sstvenc_mode::initseq, sstvenc_mode::scanline_period_ns, SSTVENC_CSO_CH_NONE, SSTVENC_CSO_MASK_MODE, SSTVENC_CSO_MODE_YUV2, SSTVENC_MODE_GET_CH, SSTVENC_PERIOD_FSKID_BIT, SSTVENC_PERIOD_VIS_BIT, SSTVENC_PERIOD_VIS_START, SSTVENC_PERIOD_VIS_SYNC, and sstvenc_pulseseq_get_txtime().
Referenced by show_modes().
uint64_t sstvenc_pulseseq_get_txtime | ( | const struct sstvenc_encoder_pulse * | seq | ) |
Compute the transmission time of a given pulse sequence.
Definition at line 603 of file sstvmode.c.
References sstvenc_encoder_pulse::duration_ns.
Referenced by sstvenc_mode_get_txtime().
|
static |
Definition at line 75 of file sstvmode.c.
|
static |
Definition at line 81 of file sstvmode.c.
|
static |
Definition at line 164 of file sstvmode.c.
Referenced by sstvenc_get_mode_by_idx(), sstvenc_get_mode_by_name(), and sstvenc_get_mode_count().
|
static |
Definition at line 96 of file sstvmode.c.
|
static |
Definition at line 104 of file sstvmode.c.
|
static |
Definition at line 110 of file sstvmode.c.
|
static |
Definition at line 118 of file sstvmode.c.
|
static |
Definition at line 124 of file sstvmode.c.
|
static |
Definition at line 132 of file sstvmode.c.
|
static |
Definition at line 139 of file sstvmode.c.
|
static |
Definition at line 21 of file sstvmode.c.
|
static |
Definition at line 27 of file sstvmode.c.
|
static |
Definition at line 33 of file sstvmode.c.
|
static |
Definition at line 39 of file sstvmode.c.
|
static |
Definition at line 45 of file sstvmode.c.
|
static |
Definition at line 15 of file sstvmode.c.
|
static |
Definition at line 69 of file sstvmode.c.
|
static |
Definition at line 52 of file sstvmode.c.
|
static |
Definition at line 57 of file sstvmode.c.
|
static |
Definition at line 62 of file sstvmode.c.
|
static |
Definition at line 152 of file sstvmode.c.
|
static |
Definition at line 146 of file sstvmode.c.
|
static |
Definition at line 158 of file sstvmode.c.