1#ifndef DYSCO_WEIGHT_BLOCK_ENCODER_H
2#define DYSCO_WEIGHT_BLOCK_ENCODER_H
21 size_t blockRow)
const {
24 const unsigned int *rowBuffer = &symbolBuffer[blockRow *
_nChannels];
26 float value = *rowBuffer * scaleValue;
39 float weight = *visPtr;
41 if (visPtr[p] < weight) weight = visPtr[p];
42 if (weight > maxValue) maxValue = weight;
45 if (maxValue == 0.0) maxValue = 1.0;
46 metaBuffer[0] = maxValue;
48 double scaleValue = double(
_quantCount - 1) / maxValue;
53 float weight = *visPtr;
55 if (visPtr[p] < weight) weight = visPtr[p];
57 *symbolBuffer = roundf(
double(weight) * scaleValue);
const std::vector< DataRow > & GetVector() const
void InitializeDecode(const float *metaBuffer)
size_t MetaDataFloatCount() const
void Encode(TimeBlockBuffer< float > &buffer, float *metaBuffer, unsigned int *symbolBuffer) const
void Decode(TimeBlockBuffer< float > &buffer, const unsigned int *symbolBuffer, size_t blockRow) const
WeightBlockEncoder(size_t nPolarizations, size_t nChannels, size_t quantCount)
const size_t _nPolarizations
size_t SymbolCount(size_t nRowsInBlock) const
std::vector< data_t > visibilities