mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-09 15:12:35 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
*
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -28,7 +28,7 @@ namespace sstv {
|
|||
#define SSTV_SAMPLERATE 3072000
|
||||
#define SSTV_DELTA_COEF ((1ULL << 32) / SSTV_SAMPLERATE)
|
||||
|
||||
#define SSTV_F2D(f) (uint32_t)((f) * SSTV_DELTA_COEF)
|
||||
#define SSTV_F2D(f) (uint32_t)((f)*SSTV_DELTA_COEF)
|
||||
#define SSTV_MS2S(d) (uint32_t)((d) / 1000.0 * (float)SSTV_SAMPLERATE)
|
||||
|
||||
#define SSTV_VIS_SS SSTV_F2D(1200)
|
||||
|
@ -36,59 +36,59 @@ namespace sstv {
|
|||
#define SSTV_VIS_ONE SSTV_F2D(1100)
|
||||
|
||||
enum sstv_color_seq {
|
||||
SSTV_COLOR_RGB,
|
||||
SSTV_COLOR_GBR,
|
||||
SSTV_COLOR_YUV // Not supported for now
|
||||
SSTV_COLOR_RGB,
|
||||
SSTV_COLOR_GBR,
|
||||
SSTV_COLOR_YUV // Not supported for now
|
||||
};
|
||||
|
||||
#define SSTV_MODES_NB 6
|
||||
|
||||
// From http://www.graphics.stanford.edu/~seander/bithacks.html, nice !
|
||||
constexpr inline uint8_t sstv_parity(uint8_t code) {
|
||||
uint8_t out = code;
|
||||
out ^= code >> 4;
|
||||
out &= 0x0F;
|
||||
return (((0b0110100110010110 >> out) & 1) << 7) | code;
|
||||
uint8_t out = code;
|
||||
out ^= code >> 4;
|
||||
out &= 0x0F;
|
||||
return (((0b0110100110010110 >> out) & 1) << 7) | code;
|
||||
}
|
||||
|
||||
struct sstv_tone {
|
||||
uint32_t frequency;
|
||||
uint32_t duration;
|
||||
uint32_t frequency;
|
||||
uint32_t duration;
|
||||
};
|
||||
|
||||
struct sstv_scanline {
|
||||
sstv_tone start_tone;
|
||||
sstv_tone gap_tone;
|
||||
uint8_t luma[320];
|
||||
sstv_tone start_tone;
|
||||
sstv_tone gap_tone;
|
||||
uint8_t luma[320];
|
||||
};
|
||||
|
||||
struct sstv_mode {
|
||||
char name[16];
|
||||
uint8_t vis_code;
|
||||
bool color; // Unused for now
|
||||
sstv_color_seq color_sequence;
|
||||
uint16_t pixels;
|
||||
uint16_t lines;
|
||||
uint32_t samples_per_pixel;
|
||||
bool sync_on_first;
|
||||
uint8_t sync_index;
|
||||
bool gaps;
|
||||
uint32_t samples_per_sync;
|
||||
uint32_t samples_per_gap;
|
||||
//std::pair<uint16_t, uint16_t> luma_range;
|
||||
char name[16];
|
||||
uint8_t vis_code;
|
||||
bool color; // Unused for now
|
||||
sstv_color_seq color_sequence;
|
||||
uint16_t pixels;
|
||||
uint16_t lines;
|
||||
uint32_t samples_per_pixel;
|
||||
bool sync_on_first;
|
||||
uint8_t sync_index;
|
||||
bool gaps;
|
||||
uint32_t samples_per_sync;
|
||||
uint32_t samples_per_gap;
|
||||
// std::pair<uint16_t, uint16_t> luma_range;
|
||||
};
|
||||
|
||||
constexpr sstv_mode sstv_modes[SSTV_MODES_NB] = {
|
||||
{ "Scottie 1", sstv_parity(60), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.4320), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5) },
|
||||
{ "Scottie 2", sstv_parity(56), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.2752), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5) },
|
||||
{ "Scottie DX", sstv_parity(76), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(1.08), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5) },
|
||||
{ "Martin 1", sstv_parity(44), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.4576), false, 0, true, SSTV_MS2S(4.862), SSTV_MS2S(0.572) },
|
||||
{ "Martin 2", sstv_parity(40), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.2288), false, 0, true, SSTV_MS2S(4.862), SSTV_MS2S(0.572) },
|
||||
{ "SC2-180", sstv_parity(55), true, SSTV_COLOR_RGB, 320, 256, SSTV_MS2S(0.7344), false, 0, false, SSTV_MS2S(5.5225), SSTV_MS2S(0.5) },
|
||||
//{ "PASOKON 3", sstv_parity(113), true, SSTV_COLOR_RGB, 640, 496, SSTV_MS2S(0.2083), { 1500, 2300 } },
|
||||
//{ "PASOKON 7", sstv_parity(115), true, SSTV_COLOR_RGB, 640, 496, SSTV_MS2S(0.4167), { 1500, 2300 } }
|
||||
{"Scottie 1", sstv_parity(60), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.4320), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5)},
|
||||
{"Scottie 2", sstv_parity(56), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.2752), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5)},
|
||||
{"Scottie DX", sstv_parity(76), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(1.08), true, 2, true, SSTV_MS2S(9), SSTV_MS2S(1.5)},
|
||||
{"Martin 1", sstv_parity(44), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.4576), false, 0, true, SSTV_MS2S(4.862), SSTV_MS2S(0.572)},
|
||||
{"Martin 2", sstv_parity(40), true, SSTV_COLOR_GBR, 320, 256, SSTV_MS2S(0.2288), false, 0, true, SSTV_MS2S(4.862), SSTV_MS2S(0.572)},
|
||||
{"SC2-180", sstv_parity(55), true, SSTV_COLOR_RGB, 320, 256, SSTV_MS2S(0.7344), false, 0, false, SSTV_MS2S(5.5225), SSTV_MS2S(0.5)},
|
||||
//{ "PASOKON 3", sstv_parity(113), true, SSTV_COLOR_RGB, 640, 496, SSTV_MS2S(0.2083), { 1500, 2300 } },
|
||||
//{ "PASOKON 7", sstv_parity(115), true, SSTV_COLOR_RGB, 640, 496, SSTV_MS2S(0.4167), { 1500, 2300 } }
|
||||
};
|
||||
|
||||
} /* namespace sstv */
|
||||
|
||||
#endif/*__SSTV_H__*/
|
||||
#endif /*__SSTV_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue