Received July 3, 2019, accepted July 24, 2019, date of publication July 26, 2019, date of current version August 13, 2019. Digital Object Identifier 10.1109/ACCESS.2019.2931442 A Novel Rate-Control for Predictive Image Coding With Constant Quality JOAN BARTRINA-RAPESTA 1 , MICHAEL W. MARCELLIN2 , (Fellow, IEEE), JOAN SERRA-SAGRISTÁ 1 , (Senior Member, IEEE), AND MIGUEL HERNÀNDEZ-CABRONERO 1 1 Department of Information and Communications Engineering, Universitat Autònoma de Barcelona, 08193 Barcelona, Spain 2 Department of Electrical and Computing Engineering, University of Arizona, Tucson, AZ 85721-0104, USA Corresponding author: Joan Bartrina-Rapesta (joan.bartrina@uab.cat) This work was supported in part by the Spanish Ministry of Science, Innovation, and Universities (MICIU), in part by the European Regional Development Fund (FEDER) under Grant RTI2018-095287-B-I00, in part by the Catalan Government under Grant 2017SGR-463, and in part by the Centre National d’Études Spatiales (CNES). ABSTRACT Predictive image coding systems yield a high-compression performance at low computational complexity, and are therefore popular in standards and prominent coding techniques for both lossless and near-lossless compression. However, few prediction-based coding techniques include rate-control approaches because of the difficulty in properly combining the prediction feedback loop and the quantization. None of the rate-control approaches for predictive image coding are focused on delivering homogeneous quality along the whole image. The main objective of this paper is to define a novel rate-control approach based on prediction that homogenises the quality over the entire image. The extensive experimental results, on medical, remote sensing, and natural images, suggest that our proposal attains more regular image quality and lower peak absolute error than the state-of-the-art approaches based on prediction and also transform- based techniques such as JPEG2000 and CCSDS-122. INDEX TERMS Prediction-based image coding, rate-control, constant-quality lossy compression. I. INTRODUCTION Space Data Systems (CCSDS) [5] (from now on, we refer to The vast amount of digital image data generated for ter- CCSDS-123.0-B-1 as CCSDS-123). rain analysis, military surveillance, personal use and other Predictive techniques are common for lossless, near- applications make compression techniques crucial for saving lossless and also for lossy compression, as witnessed by storage space and transmission time. Compression techniques the large amount of publications in the literature [6]–[20]. can be classified into transform- and prediction-based. Both Predictive lossless coding utilizes a causal predictor based on techniques have been employed in the last decade in image the original data followed by entropy coding of prediction compression standards and prominent coding techniques. residuals, often yielding high compression ratios [6]–[10]. Regarding prediction-based coding standards for loss- In predictive lossy and near-lossless coding, a similar archi- less image compression, JPEG-LS [1], proposed by the tecture is normally employed, although recovered sample Joint Photographic Experts Group [2], was the first stan- data are used to predict new samples [1], and prediction dard devised principally for lossless compression of con- residuals are quantized prior to entropy coding [11]–[17]. tinous tone images. Its use within the medical community A rate-control mechanism can be added to produce code- is widespread because it is included in the DICOM stan- streams for a given bit budget [21]. dard [3]. CCSDS-123.0-B-1 [4] is a recent standard designed The main problem of rate control methods in prediction- for predictive coding of multi- and hyper-spectral scenes based coding systems is the intricate mathematical relation defined by the Multispectral & Hyperspectral Data Com- between the rate and the quantized prediction residuals. pression Working Group of the Consultative Committee for Motivated by this issue, three distinct rate control methods that model the rate depending on the quantization step were The associate editor coordinating the review of this manuscript and recently proposed [18]–[20]. All three contributions have approving it for publication was Michele Nappi. been evaluated with coding systems based on CCSDS-123, This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ 103918 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality and the main difference among them is related to what type of The prediction residual (error) 3 is computed as quantization structure is employed: [18] quantizes the data on 3i,j,k = xi,j,k − e xi,j,k , (1) a block-by-block basis, [19] selects and applies the quantiza- tion step on a slice-by-slice basis, and [20] quantizes the data and then mapped to a non-negative integer λi,j,k . The entropy on a spectral-line-by-spectral-line basis –a spectral-line is a encoder produces a code that represents λi,j,k without loss. line (row) of pixels with all its co-registered bands–. Although In the CCSDS-123 standard, one can choose between a these three contributions yield similar rate-distortion perfor- sample- and a block-adaptive encoder. mance, the third one provides the best average performance. In that work, the first spectral-line is losslessly encoded, and B. ERROR CONTROL IN PREDICTIVE CODING SYSTEMS the quantization steps for the remaining spectral-lines are For the encoder described above, the decoder can repro- adapted dynamically to fit the constrained rate. This dynamic duce xi,j,k , without loss. The addition of a quantizer provides adjustment may lead to applying significantly different quan- higher compression ratios, but at the expense of some loss of tization steps in consecutive spectral-lines, potentially intro- fidelity in the decompressed image. ducing large differences in terms of quality in the decoded One of the simplest strategies to design a prediction- image. Similar artifacts can occur with [18] and [19], since based compression algorithm that controls the maximum different quantization steps can be applied at block or slice error produced is to quantize the prediction error 3i,j,k with level to reach the constrained rate. This effect is clearly a quantizer Q, resulting in quantized version 3 bi,j,k (and, illustrated in Section V, where decoded images encoded with in consequence, b λi,j,k ). The associated quantization index and Q Q the rate control proposed in [20] are depicted, along with its remapped version are denoted as 3i,j,k and λi,j,k , respec- those from the scheme proposed here. tively. Subsequent predictions e xi,j,k are calculated using pre- Our current work introduces a novel rate control method vious reconstructed (lossy) samples b xi,j,k , which are obtained designed to obtain homogeneous reconstruction quality in by implementing a decoder in the encoder [15], [22]. The all image regions. The new method is incorporated in decoder creates the reconstructed (lossy) image samples via: our previous contribution [17], which introduced a lossless and near-lossless coding system based on the predictor of xi,j,k = 3 b xi,j,k . bi,j,k + e (2) CCSDS-123 followed by a lightweight binary contextual Note that the errors in the reconstructed pixels are identical arithmetic encoder. The inclusion of the proposed rate control to the errors introduced by the quantizer in the prediction into [17] brings forward an original lossy compressor based xi,j,k = 3i,j,k − 3 errors. That is, xi,j,k −b bi,j,k . Thus, the errors on prediction. The proposed rate control strategy is evaluated in reconstructed pixels can be precisely controlled by con- against the state of the art [20] using images of different trolling individual quantization errors. This is the basis of nature and dynamic ranges from 8 to 16 bits. ‘‘near-lossless compression.’’ The rest of the paper is structured as follows: Section II reviews the CCSDS-123 coding system, a technique for con- C. LIGHTWEIGHT BINARY ARITHMETIC CODER trolling the error in a coding system based on prediction, WITH CONTEXT MODEL the arithmetic coder introduced in our previous contribu- In a previous contribution [17] we introduced a compression tion [17], and the problem of optimal rate control; Section III system based on the CCSDS-123 predictor and a binary arith- presents our rate control method; Section IV defines a metic encoder. The proposed entropy encoder works with new coding system that employs the new rate control; and binary symbols; let bni,j,k denote the n-th bit of the binary Section V provides the experimental results and discussion. Q representation of λi,j,k , with N −1 ≥ n ≥ 0. Here, N is chosen Finally, Section VI concludes this work. Q to provide a sufficient number of bits to represent all the λi,j,k , N −1 with bi,j,k being the most significant bit. The entropy encoder makes use of context model patterns obtained using a context window that contains symbols coded previously to the current FIGURE 1. CCSDS-123 encoding scheme. symbol. Further details can be found in [17]. D. RATE CONTROL II. BACKGROUND Bit allocation given a target bit-rate is a classical problem A. CCSDS-123 solved by rate control techniques [18]–[21], which distribute the bit budget for a collection of data elements in order to min- The purely lossless CCSDS-123 standard compressor imize the distortion D of the decoded image. If two elements is constituted by three stages: Predictor, Mapper and are constrained to be encoded with Rtarget bits, the optimal Entropy Encoder. Fig. 1 illustrates the encoding pipeline allocation problem is typically formulated as: of CCSDS-123. CCSDS-123 encodes a digital image x (I columns, J rows, and K bands). The predictor esti- argmin {D1 (Q1 ) + D2 (Q2 )} (3) mates the value of the current sample xi,j,k using previously Q1 ,Q2 scanned samples. This predicted sample is denoted by e xi,j,k . s.t. R1 (Q1 ) + R2 (Q2 ) ≤ Rtarget , (4) VOLUME 7, 2019 103919 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 2. Quantization structure comparison. Each gray intensity identifies a possibly different quantization step. where Di , Qi and Ri represent the distortion, the quantization step size and the bit-rate corresponding to the i-th element, respectively. This formulation assumes independent quan- tization. That is, the distortion (rate) of the first element depends only on Q1 , and the distortion (rate) of the second element depends only on Q2 . The problem of bit allocation given a target bit-rate for a dependent quantization coding system was proposed in [23] and was formulated as argmin {D1 (Q1 ) + D2 (Q1 , Q2 )} (5) Q1 ,Q2 FIGURE 3. Monotonicity property of a Rate-Distortion function. s.t. R1 (Q1 ) + R2 (Q1 , Q2 ) ≤ Rtarget. (6) spectral line j a quantization step Qj . Note that these works Note that the distortion (rate) of the first element only do not deal with ensuring constant error across all image depends on the quantization step employed for this element; regions since the quantization steps are set sequentially at while the distortion (rate) of the second element depends on the structure –block, band or spectral-line– level, employing the quantization step of the first and of the second element. a model function that relates the quantization steps with the A solution to (6) can be obtained through Lagrange Multi- rate, ignoring the image quality. Thus, adjacent structures are pliers by defining: often reconstructed with different quality producing annoy- J1 (Q1 ) = D1 (Q1 ) + λR1 (Q1 ) (7) ing quality irregularities. Section V provides examples of these irregularities. Figs. 2 (a), (b), and (c), depict the band- J2 (Q1 , Q2 ) = D2 (Q1 , Q2 ) + λR2 (Q1 , Q2 ) (8) by-band, block-by-block, and spectral-line-by-spectral-line and solving the following unconstrained minimization quantization, respectively. problem: In order to 1) homogenize the quality of the decoded image, 2) maximize the image quality at a given target bit-rate, argmin {J1 (Q1 ) + J2 (Q1 , Q2 )}, (9) and 3) accurately yield effective bit rates close to Rtarget , Q1 ,Q2 a new rate control algorithm is proposed. The objective of the and adjusting λ to satisfy (6). This can be extended to more algorithm is to code the current line, generating quantized and than two dependent elements in the obvious way. entropy-coded versions of lines choosing those quantization steps that minimize error variations between lines and fit with III. RATE-CONTROL HOMOGENIZING IMAGE QUALITY the target bit-rate once all lines are processed. Three rate control techniques have been recently designed For our proposed rate control algorithm, we smartly choose for predictive image coding systems and assessed with the quantization steps thanks to the monotonically increasing CCSDS-123 coding. The first is [18], which divides the input property between Q and D. This property relies on the fact image in blocks and applies different quantization steps to that if the quantization step is increased, i.e., Q1 < Q2 , each block. The second is [19], in which quantization steps then the distortion is also augmented, i.e., D1 < D2 . On the are determined band by band, instead of block by block. other hand, the relation between Q and R is monotonically The third and most recent contribution is [20], which works decreasing, for example, if the quantization step is increased, in a spectral-line-by-spectral-line mode, assigning at each i.e., Q1 < Q2 , then the rate is decreased, i.e., R1 > R2 . Fig. 3 103920 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality depicts the monotonic nature of a typical rate-distortion (RD) Algorithm 1 Proposed Rate-Control Algorithm function. Inputs: Rtarget , tolerance This property allows to employ an iterative method to choose the appropriate quantization steps for each line, since 1: R = ∞, Q0 = 0 we can set a quantization step for the first line Q0,0 and adapt 2: QSTEPS = {512, 256, 128, 64, 32, 16, 8, 4, 2, 1} the step size for the rest of the lines Qj,k with j > 0 and 3: for qstep = 0, . . . , QSTEPS.length − 1 do k > 0 in order to homogenize the quality. If the produced 4: if R < Rtarget then codestream has a rate different than the target rate, Q0,0 will 5: Q0 ← Q0 − QSTEPS[qstep] be adapted, and the Qj,k for j and k > 0 will be modified 6: else producing a reconstructed quality as close as possible to Q0,0 . 7: Q0 ← Q0 + QSTEPS[qstep] Thus, if the produced rate is higher or lower than the target 8: end if rate, then Q0,0 will be, respectively, increased or decreased. 9: for j = 0, . . . , J − 1 do To provide high image quality homogenization and rate 10: for k = 0, . . . , K − 1 do accuracy, the proposed method deals with lines instead of 11: if j = 0 and k = 0 then bands, blocks, or spectral-lines. Lines are visited following 12: 3 b0,0 = Predict(x0,0 , Q0,0 ) the band interleaved by line order. That is, given a multi-band 13: MSE0,0 = GetError(3 b0,0 ) image, the first line of the first band is visited followed by 14: R0,0 = Encode(30,0 ) b the first line of the second band and so on. Scanning then 15: else proceeds to the second line of the first band. 16: for qline = 0, . . . , QSTEPS.length − 1 do 17: if qline = 0 then A. RATE CONTROL ALGORITHM 18: Qj,k ← QSTEPS[qline] Algorithm 1 describes the proposed rate-control strategy 19: else assuming the monotonically increasing property. It is based 20: if MSEj,k > MSE0,0 then on three functional blocks: Predict(xj,k , Qj,k ), GetError(3bj,k ) 21: Qj,k ← Qj,k − QSTEPS[qline] and Encode(3j,k ). The Predict(xj,k , Qj,k ) function is in charge b 22: else of predicting the samples in line xj,k and quantizing the 23: Qj,k ← Qj,k + QSTEPS[qline] associated prediction error with a quantization step Qj,k , and 24: end if returning 3bj,k . The GetError(3 bj,k ) and Encode(3 bj,k ) func- 25: end if tions provide the error and the coding bit-rate and respectively 26: 3 bj,k = Predict(xj,k , Qj,k ) return values MSEj,k and Rj,k . The error measure saved in 27: MSEj,k = GetError(3 bj,k ) MSEj,k is the Mean Square Error (MSE), calculated as 28: Rj,k = Encode(3 bj,k ) I −1 29: end for 1X 30: end if MSEj,k = xi,j,k )2 . (xi,j,k − b (10) I 31: end for i=0 32: end for To recover an image with a very similar error among all the 33: R← K P −1 PJ −1 k=0 j=0 Rj,k lines, the quantization steps must be selected carefully. This 34: if |R − Rtarget | < tolerance then selection is introduced in the proposed algorithm through the 35: break execution following methodology: 36: end if 1) The error of the first line (k = 0 and j = 0) obtained 37: end for with a quantization step Q0,0 is stored in MSE0,0 (see lines 11-13). 2) For the remaining lines, Qj,k is adapted accordingly steps sizes determined by our rate-control method (middle), to obtain MSEj,k as close as possible to MSE0,0 . (see and a more detailed discrimination of the step sizes (right). lines 16-29). For the quantization steps plot, the vertical and horizontal 3) Once the quantization steps have been chosen for all the axis represent the row and QSTEPS, respectively. As can be lines, the total achieved rate R is computed (line 33). seen, our proposal applies larger step sizes to those regions 4) If R is close enough to the target rate – according to an containing regular textures (top areas) than those with greater error tolerance – the algorithm stops. intensity variations (bottom areas.) 5) Otherwise, the algorithm continues in line 2. In this It is worth noting that the proposed algorithm is devised case, the quantization step size of the first line is to determine the best solution in terms of constant quality, increased or decreased according to the target rate not to minimize computational load. However, some aspects and R, (see lines 4-7). can be considered to speed up the execution. The contents of After the Algorithm is finished, the set of quantization step QSTEPS are selected in order to have a step size large enough sizes Qj,k are employed to encode the image. Fig. 4 displays to achieve the desired target rate. For high bit-rates, the values a band of a remote sensing image (left), the quantization in QSTEPS can be reduced, containing only small step sizes. VOLUME 7, 2019 103921 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 4. Graphical illustration of how quantization step sizes vary depending on the line to be encoded. In addition, the higher the value of ‘‘tolerance,’’ the earlier Algorithm 2 Proposed Rate-Control Algorithm With High the execution can be stopped (see line 34). Rate Accuracy Inputs: Rtarget , stepinc , tolerance B. RATE ACCURACY The rate control described in Algorithm 1 prioritizes uniform 1: RealRate ← 0 reconstruction quality over target rate accuracy. This effect 2: for j = 0, . . . , J − 1 do is achieved by ensuring that all lines have similar quality 3: for k = 0, . . . , K − 1 do before the global rate is evaluated. We refer to this rate 4: Rtotal ← RealRate control as Mode 1. Unfortunately, at high rates the achievable 5: k∗ ← k codestream lengths become sparser than at low rates, making 6: for j0 = j, . . . , J − 1 do it difficult to generate a final bitstream with an accurate 7: for k 0 = k ∗ +, . . . , K − 1 do rate with Mode 1. With the goal of obtaining higher rate 8: Rtotal ← Rtotal + Rj0 ,k 0 accuracy, we introduce a variation in the algorithm referred 9: end for to as Mode 2. Mode 2 works during the entropy encoder 10: k∗ ← 0 and after the Algorithm 1 is executed. In particular, Mode 2 11: end for measures how many bits have been used to encode previous 12: if j = 0 and k = 0 then lines and how many will be employed for the rest of the lines 13: if |Rtotal − Rtarget | > tolerance then and adjusts the step sizes for the next lines to achieve the 14: Qj,k ← Qj,k − stepinc global target rate. This is detailed in Algorithm 2 below. 15: else Algorithm 2 tracks the current real rate, referred as 16: Qj,k ← Qj,k + stepinc RealRate, to adapt Qj,k of the coming line according to 17: end if the stepinc as follows: once the current line xj,k is pre- 18: else dicted and entropy coded, the final rate Rtotal is estimated 19: if |Rtotal − Rtarget | > tolerance then by the addition of RealRate –data already stored in the final 20: if Rtotal < Rtarget and MSE0,0 < MSEj,k then bitstream– and Rj0 ,k 0 , where j0 and k 0 refer to the remaining 21: Qj,k ← Qj,k − stepinc lines not yet processed (see lines 6-11); then, depending on 22: end if Rtotal and Rtarget , Qj,k is adapted according to stepinc (see 23: if Rtotal > Rtarget and MSE0,0 > MSEj,k then lines 13-17). So as not to excessively increase the error dif- 24: Qj,k ← Qj,k + stepinc ference between lines, stepinc is set to 1. 25: end if Although Mode 2 provides a finer rate accuracy, it can pro- 26: end if duce slight variations of the error between lines, not produced 27: end if with Mode 1. 28: 3 bj,k = Predict(xj,k , Qj,k ) 29: RealRate ← RealRate + Encode(3 bj,k ) IV. ADOPTED CODING APPROACH 30: MSEj,k = GetError(3 bj,k ) The novel rate control method may be incorporated in any 31: end for coding system based on prediction; here, we incorporate 32: end for it in the compressor pipeline of [17]. The new lossy and near-lossless coding system based on prediction is defined as follows. Once a line is scanned, predicted, and mapped to positive values, it is entropy encoded on a bitplane-by- coder. The rate control presented here uses the quantized and bitplane basis employing a lightweight contextual arithmetic dequantized predicted lines to know the current error of the 103922 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 5. Proposed coding scheme. V. EXPERIMENTAL RESULTS For the experiments conducted in this work, we have selected a set of varied data formed by remote sensing, medical and natural images. Their names and main features are listed in Table 1. The first order entropy represents the entropy of individual pixels, without accounting for any dependencies among pixels within or between bands. In [25], the impact of different CCSDS-123 parameters FIGURE 6. Illustration of context model used to encode bn i ,j ,k . bn i ,j −1,k is that control the operation of the prediction and the entropy used as contextual data to estimate the probability. encoder were evaluated, suggesting that a correct parameter selection has more impact on the predictor stage than in line, and the entropy coder to figure out the number of bits the entropy encoder stage. Concerning the prediction, local needed for the current line. Thus, the rate control can adapt sum type, prediction mode, number of prediction bands, and the step size to homogenize the image quality at a target bit- predictor adaption were the most critical parameters. Exten- rate. It is worth noting that the proposed rate control can be sive experimental evaluations were conducted to find suitable employed with any predictor, quantizer or entropy encoder. configurations. In the current manuscript, leaning on results Fig. 5 displays our proposed coding scheme. of [25] and after conducting also an extensive evaluation, The proposed coding scheme incorporates a Uniform experimental results are produced for the following parameter Scalar Deadzone Quantizer (USDQ) that quantizes 3i,j,k to configuration: predictor mode and local sum type depend obtain a quantized index according to on the acquisition sensor for the remote sensing images, whereas for medical and natural data the same configuration is utilized. When K > 1, the number of prediction bands P   Q |3i,j,k | 3i,j,k = sign(3i,j,k ) , (11) is set to 3, the predictor adaptation rate νmax is set to 3, since, Qj,k in general, it yields the best performance. where the quantization step is Q. The operation to reconstruct For the proposed rate control technique, the tolerance 3̂i,j,k from its quantization index is expressed as variable of Mode 1 and the stepinc of Mode 2 are fixed to 0.01 and 1, respectively. Q Q 3̂i,j,k = sign(3i,j,k )(Qj,k + δ)3i,j,k , (12) In order to yield a fair comparison between the proposed rate-control technique and the latest rate-control contribution with δ equal to 0.5 for Qj,k > 1. USDQ has been selected due designed for encoding systems based on prediction [20], to its straightforward implementation and excellent perfor- we substituted the rate-control technique (blue box) of the mance, e.g., in the JPEG 2000 standard [24]. USDQ partitions proposed coding scheme, depicted in Fig. 5, by the rate- the range of input values into intervals all of size Qj,k , except control technique proposed in [20]. In this way, assessment for the interval that contains zero, which is of size 2Qj,k . of both rate-control techniques is equitable since both employ This results in all absolute pixel errors | xi,j,k − b xi,j,k | being the same predictor, quantizer and entropy encoder. We named bounded above by Qj,k . this new method [20]0 . Like the entropy encoder presented in [17], we make use of To compare the proposed prediction-based coding system a context model to estimate the conditional probability with with transform-based coding systems, we also provide results which the current bit bni,j,k is encoded. According to [17], for JPEG2000 [26] and CCSDS-122 [27]. We have employed we only consider the sample above the bit to be encoded as the Reversible Karhunen-Loeve transform (RKLT) to decor- contextual information. This is indicated in Fig. 6. The initial relate the spectral dimension yielding as fair a comparison as probability model for the context is set to a value of 0.66. possible among the four evaluated coding techniques. Further details of the context model and conditional prob- The rest of this section appraises the performance of our ability estimation are described in [17]. proposal in terms of 1) rate accuracy, 2) minimization of the VOLUME 7, 2019 103923 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality TABLE 1. Data used in the experimental results. Image name, its abbreviation, bit-depth and first-order entropies (in bps). The last two columns indicate the predictor mode and the local sum used in the proposed coding system for each sensor. TABLE 2. Output Rates comparison between Mode 1 and Mode 2. For the that the algorithm performs equally well independently of guitar image the target rates are doubled. (*): Lossless. the image corpus, either remote sensing, medical or natural images. And, in addition, Mode 1 and Mode 2 produce a maximum error in the output rates of 14% –portrait at 4 bps– and 3% –CT30 at 1 bps–, respectively. B. CONSTANT QUALITY EVALUATION These experiments demonstrate that the bit budget allocated by our proposal produces homogeneous quality recovery. The first experiment reported is displayed in Fig. 7. This figure plots the MSE for each line and band employing a color scale. The horizontal and vertical axis denote bands and lines, respectively. The MSE is represented by a color scale, with yellow and black for, respectively, the highest and the lowest MSE values. Fig. 7 provides results at four different target bit-rates (one per column). The first three rows of the figure correspond to a remote sensing image, whereas the last three correspond to a medical image. For each bit-rate, results are reported for [20]0 , and our proposal employing either Mode 1 or Mode 2. Note that the color scale is different for each image and bit-rate but the same between schemes. From these results, we can appreciate that: error gap between lines, 3) rate-distortion performance; and 1) Mode 1 obtains the image quality with the highest 4) visual inspection. homogeneity. 2) Mode 1 and Mode 2 attain much lower MSE variation A. RATE ACCURACY EVALUATION than [20]0 . The large differences in [20]0 are produced These results serve to evaluate the accuracy of the rate control because in the rate control defined in [20], the first row in terms of output rate. This test is conducted for a set of (j = 0) is encoded without loss, then the quantization images from distinct scenarios and four different target bit- steps are adapted to reach the desired target bit rate. rates with Mode 1 and Mode 2. Table 2 reports the output 3) Mode 2 has a higher MSE fluctuation compared with rates achieved for four target bit-rates. Though Mode 1 is Mode 1. This is produced since Mode 2 sets the stepinc less accurate than Mode 2, it can still obtain output rates with to 1, adapting the quantization step with +/− 1 to suitable precision for most of the target rates. Mode 2 always achieve the target bit-rate with higher accuracy. Nev- has remarkably good accuracy due to the information col- ertheless, the error variation is still much lower than lected by the rate control algorithm in Rj,k , which permits to for [20]0 . adapt the current quantization step and better estimate future Equivalent results are obtained for the other types of images output rates. In Mode 2, larger stepinc values can produce tested in our experiments. output rates with higher accuracy, at the expense of generating The second experiment provides the Mean Unsigned Devi- major error differences between adjacent lines. It can be seen ation (MUD) of the MSE metric. MUD provides the average 103924 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 7. Error (in MSE) plotted for each row j and band k at target rates of 1, 2, 3, and 4 bps. Results are showed for [20]0 , Mode 1 and Mode 2. Plots from (a) to (l) and from (m) to (x) belong to yellowstoneU and Angio_1, respectively. VOLUME 7, 2019 103925 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality TABLE 3. MUD comparison of the row-by-row MSE between Mode 1, C. RATE-DISTORTION EVALUATION Mode 2, and [20]0 . For the bananas image the target rates are doubled. (*): Lossless. The tests reported in this section are aimed to evaluate the rate-distortion performance of Mode 1 and Mode 2 of our proposal with respect to the near-lossless coding technique introduced in [17]. Fig. 8 shows the rate SNR and rate MUD curves for a remote sensing and a medical image compressed with Mode 1, Mode 2 and [17]. As [17] is a near-lossless compressor, images are encoded and decoded at different quantization steps, then the rate and the SNR and MUD are computed and used to interpolate the curves. All results are produced using the same predictor and entropy encoder con- figuration. The following definition of SNR (SNR Energy) is employed in this work: PI −1 PJ −1 PK −1 2 i=0 j=0 k=0 xi,j,k SNR = 10 log10 PI −1 PJ −1 PK −1 , (15) i=0 j=0 xi,j,k )2 k=0 (xi,j,k − b measured in dB, where x and b x denote the original and reconstructed samples, respectively. From Fig. 8 we can see that: 1) Modes 1 and 2 pro- vide nearly the same rate-distortion performance as the near- lossless technique (Fig. 8 (a) and (c)). 2) For MUD plots (Fig. 8 (b) and (d)) Mode 1 obtains the best performance. 3) Again for MUD plots, for bit-rates larger than 1.5 and 0.5 bps for globalA and angio_1 images, respectively, all evaluated techniques produce almost the same performance. And, 4) the curves of Mode 1 and [17] for globalA at rates larger than 1.2 bps provide lossless recovery. This is produced because in [17] there is no control of the final rate, whereas for Mode 1 the selection of the quantization steps prioritizes the image quality instead of building code-streams with high-rate of the absolute MSE deviations from the mean MSE. It is accuracy, and with a target rate of 2 bps, lossless compression computed in a row-by-row way as is obtained. The last experiment in this section compares the per- J −1 K −1 1 XX formance of Mode 2 and [20]0 against wavelet transform MUD = |MSE − MSEj,k |, (13) coding techniques in terms of rate accuracy, Peak Absolute J ×K j=0 k=0 Error (PAE) and SNR quality metrics. Table 4 reports a comparison between Mode 2, [20]0 , RKLT+JPEG2000 and where MSEj,k is computed as (10) and MSE is computed as RKLT+CCSDS-122. The best results for PAE and SNR J −1 K −1 between the rate control proposed here and [20]0 are high- 1 XX lighted in bold font. This evaluates the same predictive MSE = MSEj,k . (14) J ×K coding employing different rate control techniques. The j=0 k=0 best results between our proposal, RKLT+JPEG2000 and For the MUD metric, lower is better. RKLT+CCSDS-122 are underlined. These results suggest Table 3 reports the MUD metric for images from different that: scenarios at different rates. It can be observed that: 1) Mode 2 yields the lowest PAE in all cases. For the gui- 1) Mode 1 obtains the lowest MUD value, followed by tar image, our proposal reaches gains superior to 300, Mode 2. 220, and 145 units compared with, respectively, [20]0 , 2) At lower bit-rates, the differences between the three RKLT+JPEG2000, and RKLT+CCSDS-122. techniques are larger than at higher bit-rates. This trend 2) Our proposal gets higher SNR than [20]0 for all rates is emphasized for images with higher entropy such as and images, achieving gains of more than 12 dB for yellowstoneU, angio_1, and guitar. globalA at 2 bps. 3) Although at higher rates the MUD differences between 3) Coding techniques based on transform produce better our proposal and [20]0 are reduced substantially, our SNR for most rates and images, but with significantly proposal gets the best results in all cases. larger PAE values than the proposed Mode 2. 103926 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 8. Rate SNR and Rate MUD-MSE curves for angio_1 ((a) and (b)), and globalA ((c) and (d)). TABLE 4. Output rates, PAE and SNR image quality comparison. Results are provided for Mode 2 of our proposal, [20]0 , RKLT+JPEG2000, and RKLT+CCSDS-1222. Target rates evaluated are 1, 2, 3 and 4 bps, except for guitar, where rates are doubled. D. VISUAL INSPECTION employed Mode 2 in this experiment to attain the best tar- The last experiment provides a visual comparison from an get bit-rate accuracy. The original image is portrayed as a image encoded at 0.25 bps with Mode 2 and [20]0 . Although reference. Fig. 9, Fig. 10, and Fig. 11 show a band for a Mode 1 provides better homogenized global error, we have remote sensing, a medical, and a natural image, respectively. VOLUME 7, 2019 103927 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality FIGURE 9. Visual comparison for the yellowstoneU image. (a) Original, (b) original (crop), (b) proposed approach - Mode 2 at 0.25 bps (SNR = 30.06 dB.), and (d) [20]0 at 0.25 bps (SNR = 28.54 dB.). FIGURE 10. Visual comparison for the angio_2 image. (a) Original, (b) original (crop), (c) proposed approach - Mode 2 at 0.25 bps (SNR = 36.56 dB.), and (d) [20]0 at 0.25 bps (SNR = 32.79 dB.). FIGURE 11. Visual comparison for the portrait image. (a) Original, (b) original (crop), (c) proposed approach - Mode 2 at 1.5 bps (SNR = 31.60 dB.), and (d) [20]0 at 1.5 bps (SNR = 29.81 dB.). The reader is invited to zoom in to see the specific visual images encoded with our proposal are hard to appreciate artifacts arising from the different compression methods. visually. On the other hand, we can appreciate visual vari- Although for the remote sensing and medical images ations between our proposal and [20]0 . These differences are we have encoded the images at low bit-rates, the differ- more relevant in the firsts lines –top of the image–, which is ence of Fig. 9 and Fig. 10 between the original and the motivated because of the adaptation of the quantization steps. 103928 VOLUME 7, 2019 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality For the natural image, reconstructions at 1.5 bps are por- [10] N. Amrani, J. Serra-Sagristà, V. Laparra, M. W. Marcellin, and J. Malo, trayed. Two different crop regions are showed. For the top- ‘‘Regression wavelet analysis for lossless coding of remote-sensing data,’’ IEEE Trans. Geosci. Remote Sens., vol. 54, no. 9, pp. 5616–5627, crop we can appreciate that [20]0 produces a degradation of Sep. 2016. the image quality, this behavior in the first lines forces [20]0 [11] E. Magli, G. Olmo, and E. Quacchio, ‘‘Optimized onboard lossless and to more aggressively quantize the coming lines –bottom- near-lossless compression of hyperspectral data using CALIC,’’ IEEE Geosci. Remote Sens. Lett., vol. 1, no. 1, pp. 21–25, Jan. 2004. crop– to achieve the target bit-rate. As seen, our proposal [12] G. Carvajal, B. Penna, and E. Magli, ‘‘Unified lossy and near-lossless recovers the full image with homogeneous quality, higher hyperspectral image compression based on JPEG 2000,’’ IEEE Geosci. fidelity and lower artifacts than [20]0 . Remote Sens. Lett., vol. 5, no. 4, pp. 593–597, Oct. 2008. [13] C.-W. Chen, T.-C. Lin, S.-H. Chen, and T.-K. Truong, ‘‘A near lossless wavelet-based compression scheme for satellite images,’’ in Proc. WRI VI. CONCLUSIONS World Congr. Comput. Sci. Inf. Eng., vol. 6. Mar. 2009, pp. 528–532. Though rate control techniques are easy to be enforced in [14] S.-C. Tai, T.-M. Kuo, C.-H. Ho, and T.-W. Liao, ‘‘A near-lossless compres- sion method based on CCSDS for satellite images,’’ in Proc. Int. Symp. transform coding techniques, this is not true in predictive Comput., Consum. Control, 2012, pp. 706–709. image coding systems because of the intricate mathemat- [15] I. Blanes, E. Magli, and J. Serra-Sagrista, ‘‘A tutorial on image compres- ical relation between the rate and the quantized residuals. sion for optical space imaging systems,’’ IEEE Geosci. Remote Sens. Mag., vol. 2, no. 3, pp. 8–26, Sep. 2014. There exist few contributions aimed at controlling the rate [16] J. Beerten, I. Blanes, and J. Serra-Sagristà, ‘‘A fully embedded two-stage for image predictive coding systems; they estimate the rate coder for hyperspectral near-lossless compression,’’ IEEE Geosci. Remote given a quantization step through a modeling function, how- Sens. Lett., vol. 12, no. 8, pp. 1775–1779, Aug. 2015. [17] J. Bartrina-Rapesta, I. Blanes, F. Aulí-Llinàs, J. Serra-Sagristà, V. Sanchez, ever they can not secure constant quality along the image. and M. W. Marcellin, ‘‘A lightweight contextual arithmetic coder for This manuscript introduces an iterative rate control algo- on-board remote sensing data compression,’’ IEEE Trans. Geosci. Remote rithm for image coding systems based on prediction with Sens., vol. 55, no. 8, pp. 4825–4835, May 2017. [18] D. Valsesia and E. Magli, ‘‘A novel rate control algorithm for onboard the main goal of yielding constant quality for the entire predictive coding of multispectral and hyperspectral images,’’ IEEE Trans. reconstructed image. To provide constant quality, we propose Geosci. Remote Sens., vol. 52, no. 10, pp. 6341–6355, Oct. 2014. an iterative rate control strategy that sets a quantization for [19] M. Conoscenti, R. Coppola, and E. Magli, ‘‘Constant SNR, rate control, and entropy coding for predictive lossy hyperspectral image compres- the first line and adapts the further steps to yield uniform sion,’’ IEEE Trans. Geosci. Remote Sens., vol. 54, no. 12, pp. 7431–7441, quality. In the case that the target bit-rate is not achieved, Dec. 2016. the step size of the first line is updated and the procedure is [20] D. Valsesia and E. Magli, ‘‘Fast and lightweight rate control for onboard predictive coding of hyperspectral images,’’ IEEE Geosci. Remote Sens. repeated. Our method obtains superior performance in terms Lett., vol. 14, no. 3, pp. 394–398, Mar. 2017. of constant quality Peak Absolute Error (PAE) compared [21] Y. Shoham and A. Gersho, ‘‘Efficient bit allocation for an arbitrary set of with the latest rate control technique for predictive image quantizers [speech coding],’’ IEEE Trans. Acoust., Speech, Signal Process., vol. 36, no. 9, pp. 1445–1453, Sep. 1988. coding systems [20] and compared with transform coding [22] N. S. Jayant and P. Noll, Digital Coding of Waveforms. Upper Saddle River, methods such as JPEG2000 and CCSDS-122 (both preceded NJ, USA: Prentice-Hall, 1984. by the Reversible Karhunen-Loeve transform). Furthermore, [23] K. Ramchandran, A. Ortega, and M. Vetterli, ‘‘Bit allocation for depen- dent quantization with applications to multiresolution and MPEG video our contribution provides higher Signal Noise Ratio (SNR) coders,’’ IEEE Trans. Image Process., vol. 3, no. 5, pp. 533–545, than [20] and, in some cases, it also outperforms JPEG2000 Sep. 1994. and CCSDS-122. [24] Information Technology—JPEG 2000 Image Coding System—Part 1: Core Coding System, Standard ISO/IEC 15444-1:2000, Dec. 2000. [25] E. Augé, J. E. Sánchez, A. B. Kiely, I. Blanes, and J. Serra-Sagrista, REFERENCES ‘‘Performance impact of parameter tuning on the CCSDS-123 lossless [1] JPEG-LS Lossless and Near-Lossless Compression for Continuous-Tone multi- and hyperspectral image compression standard,’’ J. Appl. Remote Still Images, Standard ISO/IEC 14495-2:2003, 1999. Sens., vol. 7, no. 1, 2013, Art. no. 074594. [26] D. S. Taubman and M. Marcellin, JPEG2000: Image Compression Funda- [2] Joint Photographic Experts Group (JPEG). Accessed: Jul. 2019. [Online]. mentals, Standards and Practice. Norwell, MA, USA: Kluwer, 2002. Available: http://www.jpeg.org [27] Image Data Compression, document CCSDS-122.0-B-1, Blue Book, [3] Digital Image and Communication in Medicine. (Jan. 2019). DICOM. Nov. 2005. [Online]. Available: http://medical.nema.org/ [4] Lossless Multispectral & Hyperspectral Image Compression, docu- ment CCSDS-123.0-B-1 Blue Book, May 2012. [5] Consultative Committee for Space Data Systems (CCSDS). Accessed: Jul. 2019. [Online]. Available: http://www.ccsds.org JOAN BARTRINA-RAPESTA received the B.Sc., [6] F. Rizzo, B. Carpentieri, G. Motta, and J. A. Storer, ‘‘Low-complexity lossless compression of hyperspectral imagery via linear prediction,’’ IEEE B.E., M.S., and Ph.D. degrees in computer sci- Signal Process. Lett., vol. 12, no. 2, pp. 138–141, Feb. 2005. ence from the Universitat Autònoma de Barcelona [7] J. Song, Z. Zhang, and X. Chen, ‘‘Lossless compression of hyperspectral (UAB), Spain, in 2002, 2004, 2006, and 2009, imagery via RLS filter,’’ Electron. Lett., vol. 49, no. 16, pp. 992–994, respectively. He received the M.S. and Ph.D. Aug. 2013. degrees (Hons.) from UAB. He has received a [8] W. Jiaji, K. Wanqiu, M. Jarno, and H. Bormin, ‘‘Lossless compression Doctoral Fellowship from UAB. He has coau- of hyperspectral imagery via clustered differential pulse code modulation thored numerous papers in journals and confer- with removal of local spectral outliers,’’ IEEE Signal Process. Lett., vol. 22, ences. He has guided Ph.D. students. Since 2012, no. 12, pp. 2194–2198, Dec. 2015. he has been an Associate Professor with the [9] F. Gao and S. Guo, ‘‘Lossless compression of hyperspectral images Department of Information and Communications Engineering, UAB. His using conventional recursive least-squares predictor with adaptive research interest includes a wide range of image coding topics, comput- prediction bands,’’ J. Appl. Remote Sens., vol. 10, no. 1, 2016, ing, and transmission. He participates as a Reviewer for magazines and Art. no. 015010. symposiums. VOLUME 7, 2019 103929 J. Bartrina-Rapesta et al.: Novel Rate-Control for Predictive Image Coding With Constant Quality MICHAEL W. MARCELLIN (S’81–M’87– MIGUEL HERNÀNDEZ-CABRONERO received SM’93–F’02) received the B.S. degree in electri- the B.Sc. degree in computer science in mathe- cal engineering from San Diego State University, matics from the Universitat Autónoma de Madrid, in 1983, and the M.S. and Ph.D. degrees in elec- in 2010, and the M.Sc. and Ph.D. degrees (cum trical engineering from Texas A&M University, laude) in computer science from the Universitat in 1985 and 1987, respectively. Since 1988, he has Autònoma de Barcelona (UAB), in 2011 and 2015, been with the University of Arizona, where he cur- respectively. He has carried Postdoctoral research rently holds the title of Regents’ Professor. He is stages with the University of Warwick, U.K., and also the International Foundation for Telemetering the University of Arizona, USA. He is currently Chaired Professor. His research interests include with the Department of Information and Com- digital communication and data storage systems, data compression, and munications Engineering, UAB. His research interests include data com- signal processing. He has authored or coauthored over 300 publications in pression, with a focus on task-oriented coding of visual contents, and his research areas. He has received numerous honors including ten teaching compression standards. He is an active contributor and a Reviewer in research awards. areas of knowledge. JOAN SERRA-SAGRISTÁ (S’97–M’05–SM’11) received the Ph.D. degree in computer science from the Universitat Autònoma de Barcelona (UAB), Spain, in 1999. He is currently an Asso- ciate Professor (Habilitation Full professor) with the Department of Information and Communi- cations Engineering, UAB. From 1997 to 1998, he was with the University of Bonn, Germany, sup- ported by the DAAD. His current research interests include data compression, with special attention to image coding for remote sensing applications. He has coauthored over 100 publications. He was a recipient of the Spanish Intensification Young Investigator Award, in 2006. He serves or has served as Associate Editor for the IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING and the IEEE TRANSACTIONS ON IMAGE PROCESSING. He has served as the Committee Chair for Data Compression Conference. 103930 VOLUME 7, 2019