1 #ifndef DYSCO_WEIGHT_BLOCK_ENCODER_H
2 #define DYSCO_WEIGHT_BLOCK_ENCODER_H
27 size_t blockRow)
const {
30 const unsigned int *rowBuffer = &symbolBuffer[blockRow *
_nChannels];
32 float value = *rowBuffer * scaleValue;
41 unsigned int *symbolBuffer)
const {
46 float weight = *visPtr;
48 if (visPtr[p] < weight) weight = visPtr[p];
49 if (weight > maxValue) maxValue = weight;
52 if (maxValue == 0.0) maxValue = 1.0;
53 metaBuffer[0] = maxValue;
55 double scaleValue = double(
_quantCount - 1) / maxValue;
60 float weight = *visPtr;
62 if (visPtr[p] < weight) weight = visPtr[p];
64 *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
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
std::vector< data_t > visibilities