libsstvenc
Asynchronous Analogue SSTV encoder
|
Topics | |
SSTV Encoder Phases | |
SSTV frequency specifications. | |
SSTV mode specifications. | |
RGB to YUV conversions (and vice versa). | |
SSTV VIS header bits | |
SSTV scan line segments | |
Macros | |
#define | SSTVENC_ENCODER_FSK_SEGMENT_BEGIN (0) |
#define | SSTVENC_ENCODER_FSK_SEGMENT_PREAMBLE (1) |
#define | SSTVENC_ENCODER_FSK_SEGMENT_ID (2) |
#define | SSTVENC_ENCODER_FSK_SEGMENT_TAIL (3) |
#define | SSTVENC_ENCODER_FSK_SEGMENT_DONE (4) |
Typedefs | |
typedef void | sstvenc_encoder_callback(struct sstvenc_encoder *const enc) |
This is an asynchronous SSTV encoder that emits frequency/duration pairs to be used with an oscillator (see Oscillator implementation) to produce actual audio samples.
Depending on the SSTV mode it will expect a framebuffer with one of the following forms:
uint8_t
s measuring sstvenc_mode::width times sstvenc_mode::height. Each element represents the pixel's monochromatic brightness level.uint8_t
s measuring sstvenc_mode::width times sstvenc_mode::height times 3. Every 3 elements represents a pixel's RGB colour in the order: red, green, blue.uint8_t
s measuring sstvenc_mode::width times sstvenc_mode::height times 3. Every 3 elements represents a pixel's YUV colour in the order: Y (luminance), U (R-Y), V (B-Y).The routines in RGB to YUV conversions (and vice versa). may be useful for converting between RGB and YUV or monochrome modes in your application.
Calling code initialises a context by calling sstvenc_encoder_init then repeatedly calling sstvenc_encoder_next_pulse to compute each SSTV image pulse. Calling code may conclude the state machine is finished when sstvenc_encoder::phase reaches SSTVENC_ENCODER_PHASE_DONE or when sstvenc_encoder_next_pulse returns NULL.
struct sstvenc_encoder |
SSTV encoder data structure. This encodes the state of the encoder and all the necessary oscillator and pulse shaper structures.
Data Fields | ||
---|---|---|
const uint8_t * | framebuffer |
The framebuffer holding the image to be sent. The image is assumed to be in the correct format for the SSTV mode, i.e. correct dimensions, channel count and colour space. For colour SSTV modes, the values are interleaved for each channel, so c0, c1, c2; for the first pixel, then c0, c1, c2 for the second, etc. Use SSTVENC_MODE_GET_CH to determine what channel is what. |
const char * | fsk_id |
The FSK-ID to be appended to the end. NULL for no FSK ID |
const struct sstvenc_mode * | mode |
The SSTV mode being used for encoding. |
uint8_t | phase |
The transmission phase we are in. |
struct sstvenc_encoder_pulse | pulse |
The current pulse being emitted |
const struct sstvenc_encoder_pulse * | seq |
The current pulse sequence being emitted |
sstvenc_encoder_callback * | seq_done_cb |
What to do if the sequence is done? |
union sstvenc_encoder_phase_data | vars |
union sstvenc_encoder::sstvenc_encoder_phase_data |
Data Fields | ||
---|---|---|
struct sstvenc_encoder_phase_fsk_data | fsk | |
struct sstvenc_encoder_phase_scan_data | scan | |
struct sstvenc_encoder_phase_vis_data | vis |
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data |
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data |
Data Fields | ||
---|---|---|
uint8_t | segment |
Scanline segment being emitted |
uint16_t | x |
The current image X position being scanned |
uint16_t | y |
The current image Y position being scanned |
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data |
#define SSTVENC_ENCODER_FSK_SEGMENT_BEGIN (0) |
Definition at line 892 of file sstv.c.
Referenced by sstvenc_encoder_begin_fsk(), and sstvenc_encoder_fsk_load_next().
#define SSTVENC_ENCODER_FSK_SEGMENT_DONE (4) |
Definition at line 896 of file sstv.c.
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
#define SSTVENC_ENCODER_FSK_SEGMENT_ID (2) |
Definition at line 894 of file sstv.c.
Referenced by sstvenc_encoder_fsk_load_next().
#define SSTVENC_ENCODER_FSK_SEGMENT_PREAMBLE (1) |
Definition at line 893 of file sstv.c.
Referenced by sstvenc_encoder_fsk_load_next().
#define SSTVENC_ENCODER_FSK_SEGMENT_TAIL (3) |
Definition at line 895 of file sstv.c.
Referenced by sstvenc_encoder_fsk_load_next().
typedef void sstvenc_encoder_callback(struct sstvenc_encoder *const enc) |
|
static |
Set up the state machine to begin sending the back-porch sync pulses at the end of the scan line.
[in,out] | enc | SSTV encoder instance |
Definition at line 714 of file sstv.c.
References sstvenc_mode::backporch, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_seq(), sstvenc_encoder_next_scan_seg(), SSTVENC_ENCODER_SCAN_SEGMENT_BACKPORCH, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Set up the state machine for transmitting the given channel of the current scan line.
[in,out] | enc | SSTV encoder instance |
[in] | ch | SSTV scan line channel being emitted (0-3 inclusive) |
Definition at line 586 of file sstv.c.
References sstvenc_encoder_pulse::duration_ns, sstvenc_encoder::mode, sstvenc_encoder::pulse, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_mode::scanline_period_ns, sstvenc_encoder_next_scan_seg(), sstvenc_encoder::vars, sstvenc_mode::width, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::x, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Set up the state machine to begin sending the front-porch sync pulses at the beginning of the scan line.
[in,out] | enc | SSTV encoder instance |
Definition at line 677 of file sstv.c.
References sstvenc_mode::frontporch, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_seq(), sstvenc_encoder_next_scan_seg(), SSTVENC_ENCODER_SCAN_SEGMENT_FRONTPORCH, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_begin_scanline().
|
static |
Set up the state machine for sending the FSK ID.
[in,out] | enc | SSTV encoder instance |
Definition at line 976 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bit, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::byte, sstvenc_encoder::sstvenc_encoder_phase_data::fsk, sstvenc_encoder::fsk_id, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::segment, sstvenc_encoder_fsk_load_next(), SSTVENC_ENCODER_FSK_SEGMENT_BEGIN, SSTVENC_ENCODER_FSK_SEGMENT_DONE, sstvenc_encoder_new_phase(), SSTVENC_ENCODER_PHASE_FSK, and sstvenc_encoder::vars.
Referenced by sstvenc_encoder_on_finalseq_done().
|
static |
Set up the state machine to begin sending the sync pulses that separate channels 0 and 1.
[in,out] | enc | SSTV encoder instance |
Definition at line 686 of file sstv.c.
References sstvenc_mode::gap01, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_seq(), sstvenc_encoder_next_scan_seg(), SSTVENC_ENCODER_SCAN_SEGMENT_GAP01, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Set up the state machine to begin sending the sync pulses that separate channels 1 and 2.
[in,out] | enc | SSTV encoder instance |
Definition at line 695 of file sstv.c.
References sstvenc_mode::gap12, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_seq(), sstvenc_encoder_next_scan_seg(), SSTVENC_ENCODER_SCAN_SEGMENT_GAP12, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Set up the state machine to begin sending the sync pulses that separate channels 2 and 3.
[in,out] | enc | SSTV encoder instance |
Definition at line 704 of file sstv.c.
References sstvenc_mode::gap23, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_seq(), sstvenc_encoder_next_scan_seg(), SSTVENC_ENCODER_SCAN_SEGMENT_GAP23, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Set up the state machine for the beginning of the image scan.
[in,out] | enc | SSTV encoder instance |
Definition at line 569 of file sstv.c.
References sstvenc_encoder::phase, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_scanline(), SSTVENC_ENCODER_PHASE_SCAN, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_pulse(), and sstvenc_encoder_on_initseq_done().
|
static |
Set up the state machine for the beginning of a single scan line.
[in,out] | enc | SSTV encoder instance |
Definition at line 579 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder_begin_frontporch(), sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_begin_image(), and sstvenc_encoder_next_image_pulse().
|
static |
Begin a pulse sequence.
[in,out] | enc | SSTV encoder instance |
[in] | seq | Pulse sequence, terminated with a 0ns "pulse". |
[in] | on_done | Callback to run when the pulse sequence ends. |
Definition at line 402 of file sstv.c.
References sstvenc_encoder_pulse::duration_ns, sstvenc_encoder::seq, and sstvenc_encoder::seq_done_cb.
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), and sstvenc_encoder_next_pulse().
|
static |
Start sending the VIS header.
[in,out] | enc | SSTV encoder instance |
Definition at line 453 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data::bit, sstvenc_encoder::phase, SSTVENC_ENCODER_PHASE_VIS, SSTVENC_VIS_BIT_START1, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::vis.
Referenced by sstvenc_encoder_next_pulse().
|
static |
Determine the value of the next (6-bit) FSK byte to transmit and load it into the state machine.
[in,out] | enc | SSTV encoder instance |
Definition at line 900 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bit, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bv, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::byte, sstvenc_encoder::sstvenc_encoder_phase_data::fsk, sstvenc_encoder::fsk_id, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::seg_sz, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::segment, sstvenc_encoder_fsk_preamble, SSTVENC_ENCODER_FSK_SEGMENT_BEGIN, SSTVENC_ENCODER_FSK_SEGMENT_DONE, SSTVENC_ENCODER_FSK_SEGMENT_ID, SSTVENC_ENCODER_FSK_SEGMENT_PREAMBLE, SSTVENC_ENCODER_FSK_SEGMENT_TAIL, sstvenc_encoder_fsk_tail, and sstvenc_encoder::vars.
Referenced by sstvenc_encoder_begin_fsk(), and sstvenc_encoder_next_fsk_pulse().
void sstvenc_encoder_init | ( | struct sstvenc_encoder *const | enc, |
const struct sstvenc_mode * | mode, | ||
const char * | fsk_id, | ||
const uint8_t * | framebuffer ) |
Initialise the SSTV encoder with the given parameters.
[in,out] | enc | SSTV encoder context to initialise |
[in] | mode | SSTV mode to encode |
[in] | fsk_id | FSK ID to send at the end, NULL to disable. |
[in] | framebuffer | Framebuffer data representing the image. |
Definition at line 392 of file sstv.c.
References sstvenc_encoder::framebuffer, sstvenc_encoder::fsk_id, sstvenc_encoder::mode, sstvenc_encoder::phase, and SSTVENC_ENCODER_PHASE_INIT.
Referenced by sstvenc_modulator_init().
|
static |
Transition the encoder to the next phase. Used as a debugging attachment point in development.
[out] | enc | SSTV encoder context |
[in] | phase | New phase, SSTV Encoder Phases |
Definition at line 384 of file sstv.c.
References sstvenc_encoder::phase.
Referenced by sstvenc_encoder_begin_fsk(), and sstvenc_encoder_next_pulse().
|
static |
Compute the frequency of the next pulse for the current pixel in the indicated scan line.
[in,out] | enc | SSTV encoder instance |
[in] | ch | Scan line channel (0-3 inclusive) |
NULL | End of scan segment. |
Definition at line 605 of file sstv.c.
References sstvenc_mode::colour_space_order, sstvenc_encoder::framebuffer, sstvenc_encoder_pulse::frequency, sstvenc_encoder::mode, sstvenc_encoder::pulse, sstvenc_encoder::sstvenc_encoder_phase_data::scan, SSTVENC_CSO_CH_B, SSTVENC_CSO_CH_G, SSTVENC_CSO_CH_NONE, SSTVENC_CSO_CH_R, SSTVENC_CSO_CH_U, SSTVENC_CSO_CH_V, SSTVENC_CSO_CH_Y, SSTVENC_CSO_CH_Y2, SSTVENC_CSO_MASK_MODE, SSTVENC_CSO_MODE_YUV2, sstvenc_get_pixel_posn(), sstvenc_level_freq(), SSTVENC_MODE_GET_CH, sstvenc_encoder::vars, sstvenc_mode::width, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::x, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_image_pulse().
|
static |
Compute the frequency of the next pulse for the FSK ID according to the state machine.
[in,out] | enc | SSTV encoder instance |
NULL | End of FSK ID. |
Definition at line 996 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bit, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bv, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::byte, sstvenc_encoder_pulse::duration_ns, sstvenc_encoder_pulse::frequency, sstvenc_encoder::sstvenc_encoder_phase_data::fsk, sstvenc_encoder::pulse, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::segment, sstvenc_encoder_fsk_load_next(), SSTVENC_ENCODER_FSK_SEGMENT_DONE, SSTVENC_FREQ_FSKID_BIT0, SSTVENC_FREQ_FSKID_BIT1, SSTVENC_PERIOD_FSKID_BIT, and sstvenc_encoder::vars.
Referenced by sstvenc_encoder_next_pulse().
|
static |
Compute the frequency of the next pulse for the image according to the state machine.
[in,out] | enc | SSTV encoder instance |
NULL | End of image scan. |
Definition at line 740 of file sstv.c.
References sstvenc_mode::colour_space_order, sstvenc_mode::height, sstvenc_encoder::mode, sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::segment, SSTVENC_CSO_MASK_MODE, SSTVENC_CSO_MODE_YUV2, sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), sstvenc_encoder_begin_scanline(), sstvenc_encoder_next_channel_pulse(), sstvenc_encoder_next_scan_seg(), sstvenc_encoder_next_seq_pulse(), SSTVENC_ENCODER_SCAN_SEGMENT_BACKPORCH, SSTVENC_ENCODER_SCAN_SEGMENT_CH0, SSTVENC_ENCODER_SCAN_SEGMENT_CH1, SSTVENC_ENCODER_SCAN_SEGMENT_CH2, SSTVENC_ENCODER_SCAN_SEGMENT_CH3, SSTVENC_ENCODER_SCAN_SEGMENT_FRONTPORCH, SSTVENC_ENCODER_SCAN_SEGMENT_GAP01, SSTVENC_ENCODER_SCAN_SEGMENT_GAP12, SSTVENC_ENCODER_SCAN_SEGMENT_GAP23, SSTVENC_ENCODER_SCAN_SEGMENT_NEXT, sstvenc_encoder::vars, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::x, and sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y.
Referenced by sstvenc_encoder_next_pulse().
const struct sstvenc_encoder_pulse * sstvenc_encoder_next_pulse | ( | struct sstvenc_encoder *const | enc | ) |
Compute the next pulse to be emitted. This value returns NULL when there are no more pulses to transmit.
Definition at line 1032 of file sstv.c.
References sstvenc_mode::finalseq, sstvenc_mode::initseq, sstvenc_encoder::mode, sstvenc_encoder::phase, sstvenc_encoder_begin_image(), sstvenc_encoder_begin_seq(), sstvenc_encoder_begin_vis(), sstvenc_encoder_new_phase(), sstvenc_encoder_next_fsk_pulse(), sstvenc_encoder_next_image_pulse(), sstvenc_encoder_next_seq_pulse(), sstvenc_encoder_next_vis_pulse(), sstvenc_encoder_on_finalseq_done(), sstvenc_encoder_on_initseq_done(), SSTVENC_ENCODER_PHASE_DONE, SSTVENC_ENCODER_PHASE_FINALSEQ, SSTVENC_ENCODER_PHASE_FSK, SSTVENC_ENCODER_PHASE_INIT, SSTVENC_ENCODER_PHASE_INITSEQ, SSTVENC_ENCODER_PHASE_SCAN, and SSTVENC_ENCODER_PHASE_VIS.
Referenced by sstvenc_modulator_next_tone().
|
static |
Initialise the state for the next scan segment. Used as a debugging attachment point in development.
[in,out] | enc | SSTV encoder instance |
[in] | next_segment | The next scan line segment. SSTV scan line segments |
Definition at line 723 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::scan, sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::segment, and sstvenc_encoder::vars.
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), and sstvenc_encoder_next_image_pulse().
|
static |
Emit the next pulse in the pulse sequence. If there are no more pulses, call the call-back function (if defined).
[in,out] | enc | SSTV encoder instance |
NULL | No more pulses in the sequence. |
Definition at line 426 of file sstv.c.
References sstvenc_encoder_pulse::duration_ns, sstvenc_encoder::seq, and sstvenc_encoder::seq_done_cb.
Referenced by sstvenc_encoder_next_image_pulse(), and sstvenc_encoder_next_pulse().
|
static |
Determine and emit the next VIS header pulse to be sent.
[in,out] | enc | SSTV encoder instance |
NULL | End of VIS header. |
Definition at line 488 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data::bit, sstvenc_encoder_pulse::duration_ns, sstvenc_encoder_pulse::frequency, sstvenc_encoder::pulse, sstvenc_encoder_vis_data_freq(), sstvenc_encoder_vis_parity_freq(), SSTVENC_FREQ_SYNC, SSTVENC_FREQ_VIS_START, SSTVENC_PERIOD_VIS_BIT, SSTVENC_PERIOD_VIS_START, SSTVENC_PERIOD_VIS_SYNC, SSTVENC_VIS_BIT_DATA1, SSTVENC_VIS_BIT_DATA2, SSTVENC_VIS_BIT_DATA3, SSTVENC_VIS_BIT_DATA4, SSTVENC_VIS_BIT_DATA5, SSTVENC_VIS_BIT_DATA6, SSTVENC_VIS_BIT_DATA7, SSTVENC_VIS_BIT_PARITY, SSTVENC_VIS_BIT_START1, SSTVENC_VIS_BIT_START2, SSTVENC_VIS_BIT_START3, SSTVENC_VIS_BIT_START4, SSTVENC_VIS_BIT_STOP, sstvenc_encoder::vars, and sstvenc_encoder::sstvenc_encoder_phase_data::vis.
Referenced by sstvenc_encoder_next_pulse().
|
static |
Handle the end of the end-of-image pulse sequence. This triggers a transition to sending the FSK ID.
[in,out] | enc | SSTV encoder instance |
Definition at line 732 of file sstv.c.
References sstvenc_encoder_begin_fsk().
Referenced by sstvenc_encoder_next_pulse().
|
static |
End of initialisation pulse sequence. This signals the beginning of the image scan.
[in,out] | enc | SSTV encoder instance |
Definition at line 562 of file sstv.c.
References sstvenc_encoder_begin_image().
Referenced by sstvenc_encoder_next_pulse().
|
static |
Compute the frequency for the next VIS data bit.
[in,out] | enc | SSTV encoder instance |
Definition at line 462 of file sstv.c.
References sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data::bit, sstvenc_encoder::mode, SSTVENC_FREQ_VIS_BIT0, SSTVENC_FREQ_VIS_BIT1, SSTVENC_VIS_BIT_DATA1, sstvenc_encoder::vars, sstvenc_encoder::sstvenc_encoder_phase_data::vis, and sstvenc_mode::vis_code.
Referenced by sstvenc_encoder_next_vis_pulse().
|
static |
Compute the frequency for the VIS parity bit. The 8th bit of the VIS header is used to invert the parity for modes that require it.
[in,out] | enc | SSTV encoder instance |
Definition at line 472 of file sstv.c.
References sstvenc_encoder::mode, SSTVENC_FREQ_VIS_BIT0, SSTVENC_FREQ_VIS_BIT1, and sstvenc_mode::vis_code.
Referenced by sstvenc_encoder_next_vis_pulse().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bit |
The current bit of the byte being sent
Definition at line 173 of file sstv.h.
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data::bit |
The current bit being sent
Definition at line 129 of file sstv.h.
Referenced by sstvenc_encoder_begin_vis(), sstvenc_encoder_next_vis_pulse(), and sstvenc_encoder_vis_data_freq().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::bv |
The current byte value being sent
Definition at line 168 of file sstv.h.
Referenced by sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::byte |
The current byte position being sent
Definition at line 163 of file sstv.h.
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
const uint8_t* sstvenc_encoder::framebuffer |
The framebuffer holding the image to be sent. The image is assumed to be in the correct format for the SSTV mode, i.e. correct dimensions, channel count and colour space.
For colour SSTV modes, the values are interleaved for each channel, so c0, c1, c2; for the first pixel, then c0, c1, c2 for the second, etc. Use SSTVENC_MODE_GET_CH to determine what channel is what.
Definition at line 115 of file sstv.h.
Referenced by sstvenc_encoder_init(), and sstvenc_encoder_next_channel_pulse().
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data sstvenc_encoder::sstvenc_encoder_phase_data::fsk |
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
const char* sstvenc_encoder::fsk_id |
The FSK-ID to be appended to the end. NULL for no FSK ID
Definition at line 103 of file sstv.h.
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_init().
const struct sstvenc_mode* sstvenc_encoder::mode |
The SSTV mode being used for encoding.
Definition at line 100 of file sstv.h.
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), sstvenc_encoder_init(), sstvenc_encoder_next_channel_pulse(), sstvenc_encoder_next_image_pulse(), sstvenc_encoder_next_pulse(), sstvenc_encoder_vis_data_freq(), and sstvenc_encoder_vis_parity_freq().
uint8_t sstvenc_encoder::phase |
The transmission phase we are in.
Definition at line 180 of file sstv.h.
Referenced by main(), sstvenc_encoder_begin_image(), sstvenc_encoder_begin_vis(), sstvenc_encoder_init(), sstvenc_encoder_new_phase(), sstvenc_encoder_next_pulse(), sstvenc_modulator_next_hold_sample(), and sstvenc_modulator_next_tone().
struct sstvenc_encoder_pulse sstvenc_encoder::pulse |
The current pulse being emitted
Definition at line 124 of file sstv.h.
Referenced by sstvenc_encoder_begin_channel(), sstvenc_encoder_next_channel_pulse(), sstvenc_encoder_next_fsk_pulse(), and sstvenc_encoder_next_vis_pulse().
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data sstvenc_encoder::sstvenc_encoder_phase_data::scan |
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), sstvenc_encoder_begin_image(), sstvenc_encoder_begin_scanline(), sstvenc_encoder_next_channel_pulse(), sstvenc_encoder_next_image_pulse(), and sstvenc_encoder_next_scan_seg().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::seg_sz |
The current segment length
Definition at line 158 of file sstv.h.
Referenced by sstvenc_encoder_fsk_load_next().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_fsk_data::segment |
The current byte segment being sent
Definition at line 153 of file sstv.h.
Referenced by sstvenc_encoder_begin_fsk(), sstvenc_encoder_fsk_load_next(), and sstvenc_encoder_next_fsk_pulse().
uint8_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::segment |
Scanline segment being emitted
Definition at line 146 of file sstv.h.
Referenced by sstvenc_encoder_next_image_pulse(), and sstvenc_encoder_next_scan_seg().
const struct sstvenc_encoder_pulse* sstvenc_encoder::seq |
The current pulse sequence being emitted
Definition at line 118 of file sstv.h.
Referenced by sstvenc_encoder_begin_seq(), and sstvenc_encoder_next_seq_pulse().
sstvenc_encoder_callback* sstvenc_encoder::seq_done_cb |
What to do if the sequence is done?
Definition at line 121 of file sstv.h.
Referenced by sstvenc_encoder_begin_seq(), and sstvenc_encoder_next_seq_pulse().
|
static |
Definition at line 897 of file sstv.c.
Referenced by sstvenc_encoder_fsk_load_next().
|
static |
union sstvenc_encoder::sstvenc_encoder_phase_data sstvenc_encoder::vars |
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_fsk(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), sstvenc_encoder_begin_image(), sstvenc_encoder_begin_scanline(), sstvenc_encoder_begin_vis(), sstvenc_encoder_fsk_load_next(), sstvenc_encoder_next_channel_pulse(), sstvenc_encoder_next_fsk_pulse(), sstvenc_encoder_next_image_pulse(), sstvenc_encoder_next_scan_seg(), sstvenc_encoder_next_vis_pulse(), and sstvenc_encoder_vis_data_freq().
struct sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_vis_data sstvenc_encoder::sstvenc_encoder_phase_data::vis |
Referenced by sstvenc_encoder_begin_vis(), sstvenc_encoder_next_vis_pulse(), and sstvenc_encoder_vis_data_freq().
uint16_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::x |
The current image X position being scanned
Definition at line 136 of file sstv.h.
Referenced by sstvenc_encoder_begin_channel(), sstvenc_encoder_next_channel_pulse(), and sstvenc_encoder_next_image_pulse().
uint16_t sstvenc_encoder::sstvenc_encoder_phase_data::sstvenc_encoder_phase_scan_data::y |
The current image Y position being scanned
Definition at line 141 of file sstv.h.
Referenced by sstvenc_encoder_begin_backporch(), sstvenc_encoder_begin_channel(), sstvenc_encoder_begin_frontporch(), sstvenc_encoder_begin_gap01(), sstvenc_encoder_begin_gap12(), sstvenc_encoder_begin_gap23(), sstvenc_encoder_begin_image(), sstvenc_encoder_begin_scanline(), sstvenc_encoder_next_channel_pulse(), and sstvenc_encoder_next_image_pulse().