| Algorithm 2. Pseudocode for the compressor part of the proposed lossless compression. | |
|
Input: // hyperspectral data Outputs: vecRice, // a vector that stores the calculated seed values. vecFrac, // a vector that stores the calculated fractions. vecRLE, // a vector that holds the counts of consecutive runs of zero and nonzero values. vecUnary. // a vector that holds the variable unary codes corresponding to the number of bits of each count. Initializations: . , // initialize the first nonzero value with 0. , // counts the number of consecutive runs. , // to calculate the required number of bits for each run. , // the required number of bits for each run. . For all Do 1. Preprocessing // perform exclusive-or operation. If Then 2. Calculation of the integral part ) 3. Calculation of the fractional part // The fraction encoded as the distance between the xored value and the squared value of the seed If Then Else End If ) Else End If 4. Run length encoding of If Then If Then 1 End If Else ) ) End If End Do If done Then ) ) End If |