Skip to main content
. 2024 Apr 5;26(4):316. doi: 10.3390/e26040316
Algorithm 3. Pseudocode for the decompressor part of the proposed lossless compression.
Inputs: vecRice, vecFrac, vecRLE, vecUnary.
Output: x // reconstructed hyperspectral data.
Initializations:
nVar← the number of bits derived from the next unary code in vecUnary.
cnt← the run length obtained by interpreting the next nVar bits from vecRLE.
Flag← 0

For all cnt in vecRLE Do
        While cnt>0 Do
        If Flag=0 Then
        xi ← 0
        Else
        riceCode ← get the next rice code from vecRice.
        seed← decode (riceCode)
                If seed=0 Then
                seed← the value of the next unary code from vecFrac
                Fr←0
                Else
                m←log2⁡2⋅seed
                Fr← get the next m bits from vecFrac.
                Fr ← Fr+1
                End If
xi←seed2+Fr
        End If
        cnt←cnt−1
        End Do
Flag ←not Flag
End Do