SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
majority_law.h File Reference

Functions to perform majority law between arrays or vectors of bytes. More...

#include "logger.h"
#include <cstdint>
#include <vector>

Go to the source code of this file.

Functions

std::vector< unsigned char > satdump::majority_law_vec (std::vector< std::vector< unsigned char > > input)
 Applies majority law between input elements on a bit level, returns a vector of the corrected value.
template<size_t array_count, size_t byte_count>
void satdump::majority_law (const uint8_t(&input)[array_count][byte_count], uint8_t *output)
 Applies majority law between N arrays on the bit level Defined here because cpp is stupid and needs the template definition in the header file.

Detailed Description

Functions to perform majority law between arrays or vectors of bytes.

Function Documentation

◆ majority_law()

template<size_t array_count, size_t byte_count>
void satdump::majority_law ( const uint8_t(&) input[array_count][byte_count],
uint8_t * output )

Applies majority law between N arrays on the bit level Defined here because cpp is stupid and needs the template definition in the header file.

Parameters
inputA 2D array that contains N [array_count] arrays with M [byte_count] bytes each
array_countThe amount of arrays in the input
byte_countThe count of bytes to apply the majority law to for each array
outputPointer to the output array to write to

◆ majority_law_vec()

std::vector< unsigned char > satdump::majority_law_vec ( std::vector< std::vector< unsigned char > > input)

Applies majority law between input elements on a bit level, returns a vector of the corrected value.

Parameters
inputA vector of vectors of bytes to apply majority law between. ALL ELEMENT VECTORS SHOULD BE THE SAME SIZE!!!
Returns
std::vector<unsigned char>