3.1.8.1.7 RLGR Entropy Encoding

Each 64 x 64-pixel tile contains an array of 4,096 coefficients. This coefficient array is losslessly entropy-encoded using the RLGR algorithm ([ARLGR] section 3). The three tile components are assembled into an encoded tile packet (section 2.2.2.3.4.1). RLGR is an algorithm that adaptively switches between Run-Length encoding of zeros and Golomb-Rice coding of nonzero coefficients. There are two variants of the RLGR algorithm that can be used, RLGR1 and RLGR3. The decoder endpoint specifies its preference through the capabilities negotiation (see the entropyBits field in section 2.2.1.1.1.1.1). The pseudocode that describes the complete RLGR1/RLGR3 algorithm in detail is given in section 3.1.8.1.7.3.