Skip to main content
. 2024 Apr 5;26(4):316. doi: 10.3390/e26040316
Algorithm 5. Pseudocode for the compressor part of the proposed near-lossless compression.
Input: x // hyperspectral data.
Outputs: vecSeed, vecUnary.
Initialization: n the number of bits required to represent x.
For all xi in x Do
        1. Seed generation
        MSH  the leftmost n/2 bits of xi
        Q2n/2
        seed  (MSH+Q)1
        2. Quadrature-based square rooting
        BCseed
        CDxBC
        M0.5(BC+CD)
        CMBCM
        sinθCM/M
        3. Preparing the compressed stream
        index102sinθ
        order  the corresponding order of the seed value within the lookup table of the index (Table A1).
        m  the number of bits that correspond to index (Table 4).
        varCode the least significant m bits of order.
        vecSeed.add(varCode) // add the encoded seed to vecSeed vector.
        unary  the corresponding unary code of the index value.
        vecUnary.add(unary) // add unary code to vecUnary vector.
End Do