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
                Fr0
                Else
                mlog22seed
                Fr get the next m bits from vecFrac.
                Fr  Fr+1
                End If
xiseed2+Fr
        End If
        cntcnt1
        End Do
Flag not Flag
End Do