CN115022628B - JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method - Google Patents

JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method Download PDF

Info

Publication number
CN115022628B
CN115022628B CN202210930753.7A CN202210930753A CN115022628B CN 115022628 B CN115022628 B CN 115022628B CN 202210930753 A CN202210930753 A CN 202210930753A CN 115022628 B CN115022628 B CN 115022628B
Authority
CN
China
Prior art keywords
pixel
coded
coding
image
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210930753.7A
Other languages
Chinese (zh)
Other versions
CN115022628A (en
Inventor
杨方超
马德
朱国权
凡军海
金孝飞
孙世春
何煜坤
章明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Zhejiang Lab
Original Assignee
Zhejiang University ZJU
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU, Zhejiang Lab filed Critical Zhejiang University ZJU
Priority to CN202210930753.7A priority Critical patent/CN115022628B/en
Publication of CN115022628A publication Critical patent/CN115022628A/en
Application granted granted Critical
Publication of CN115022628B publication Critical patent/CN115022628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/93Run-length coding

Abstract

The invention discloses a high-throughput lossless image compression method based on JPEG-LS, which comprises the following steps: accessing an image memory, reading an image, and constructing a causal template of pixels to be coded of the read image; step two, calculating local gradient values between adjacent image pixels of the pixels to be coded, if the absolute value of the local gradient values is less than or equal to near-lossless degree, performing run-length coding on the pixels to be coded, otherwise performing conventional coding after quantizing, sign correcting and combining the local gradient values; and step three, outputting a code stream after the coding of the step two, completing the compression coding of the read image, and returning to the step one for compression coding again if the compression coding of the read image is not completed. The invention can reduce the complexity of hardware realization and effectively improve the clock frequency and the throughput rate of the image compression algorithm.

Description

JPEG-LS (joint photographic experts group-lossless standard) -based high-throughput lossless image compression method
Technical Field
The invention belongs to the technical field of image compression, and particularly relates to a high-throughput-rate lossless image compression method based on JPEG-LS.
Background
The JPEG-LS algorithm is based on LOCO-I (Low COmplexity COmpression for Images) algorithm developed by Hewlett-packard laboratory, and provides LOssless COmpression and near LOssless COmpression functions. Due to the moderate complexity of the algorithm, only subtraction and shift of data and other similar and simple processing processes are needed to be realized, the complexity and the efficiency have good balance, the hardware implementation is easy, and the algorithm is widely applied to the fields of medical images, artificial intelligence, remote sensing detection and the like.
When the traditional JPEG-LS hardware algorithm is realized, the pixel value to be coded and other four pixel values around the pixel value are required to be read for multiple times during context modeling, so that the reading efficiency is low; secondly, in a local gradient merging module, multiplication operation and overlong combinational logic operation are very likely to become a key path, so that the clock frequency and the throughput rate of an encoder are limited; finally, in the Golomb-granny coding algorithm of the conventional coding module, the Golomb-granny coding of variable length coding increases the implementation complexity of hardware, so that the coding efficiency is reduced, thereby affecting the clock frequency and throughput rate of the coder.
Therefore, it is necessary to optimize the algorithm, remove the multiplication operations in the encoder algorithm as much as possible, and optimize the combinational logic and Golomb coding rules, thereby implementing a high-throughput, high-efficiency JPEG-LS-based lossless image compression method.
Disclosure of Invention
In order to solve the technical problems in the prior art, the invention provides a high-throughput-rate lossless image compression method based on JPEG-LS, which is suitable for the real-time application field of JPEG-LS lossless image compression coding standard algorithm and has the following specific technical scheme:
a high-throughput lossless image compression method based on JPEG-LS comprises the following steps:
accessing an image memory, reading an image, and constructing a causal template of pixels to be coded of the read image;
step two, calculating local gradient values between adjacent image pixels of the pixels to be coded, if the absolute value of the local gradient values is less than or equal to near-lossless degree, performing run-length coding on the pixels to be coded, otherwise performing conventional coding after quantizing, sign correcting and combining the local gradient values;
and step three, outputting a code stream after the coding of the step two, completing the compression coding of the read image, and returning to the step one for compression coding again if the compression coding of the read image is not completed.
Further, the first step specifically comprises: and only reading the pixel Ix to be coded and 1 new adjacent pixel Rd of the pixel Ix to be coded for the read image by using the causal template of the last coded pixel and the value of the last row of coded pixels, and directly acquiring the remaining 3 adjacent pixels Ra, rb and Rc from the last coded pixel register or the last row of image pixel register, thereby completing the construction of the causal template of the pixel to be coded.
Further, the using the causal template of the last encoded pixel and the last row of encoded pixel values specifically includes: when reading non-first-column image pixels, respectively assigning a pixel Ix00 at a position x, a pixel Rb at a position b and a pixel Rd at a position d of a last encoded pixel cause and effect template to a pixel Ra at a position a, a pixel Rc at a position c and a pixel Rb at a position b of the pixel to be encoded;
when reading the image pixels of the first column, assigning the stored pixel Ix00 at the position x, the pixel Ra at the position a and the pixel Ix01 at the position x of the coded pixel cause and effect template of the first column on the upper row to the pixel Rb at the position b, the pixel Rc at the position c and the pixel Rd at the position d of the pixel cause and effect template of the pixel to be coded respectively.
Further, if the pixel to be encoded is in the first row of the read image, the values of the adjacent three pixels are all equal to 0; if the pixel to be coded is in the last column of the image, the pixel value Rd = Rb.
Further, the calculating a local gradient value between pixels of an image adjacent to the pixel to be encoded specifically includes: and sequentially carrying out difference on every two of the four pixel values adjacent to the pixel to be coded to obtain a local gradient value.
Further, the run-length encoding specifically includes: firstly, scanning the run length of pixels to be coded; then judging the reason of run length scanning termination, if the last pixel of the line is scanned, the run length is coded and then the run coding mode is switched out, otherwise the run interruption coding is carried out on the difference pixel after the run length is coded; then calculating the predicted value of the difference pixel; calculating, correcting and subtracting the prediction error; then calculating a context parameter, a mapping coefficient and a Golomb Gramb coding parameter; then mapping the prediction error, and continuing to perform Golomb Gramb coding on the mapped prediction error; and finally updating the context parameters, and exiting the run-length coding mode after the variable is updated.
Further, the performing quantization, symbol correction, and combination on the local gradient values and then performing conventional encoding specifically includes: quantizing the local gradient values
Figure DEST_PATH_IMAGE002
And then are combined into 9 integers: Q1-Q9, the expression is as follows:
Figure DEST_PATH_IMAGE004
wherein i belongs to 1 \ 82309, and T1, T2 and T3 are threshold values of local gradient value quantization; the quantizers of the local gradient values are symmetric about 0 difference, the quantized local gradient values with opposite signs are combined, and then conventional encoding is carried out;
the conventional coding is specifically: firstly, edge detection is carried out on a current pixel to be coded to obtain a predicted value of the current pixel to be coded, then the predicted value is corrected and normalized, then a prediction error of the current pixel to be coded is calculated, the prediction error is corrected and reduced in a mode, then Golomb Gramb encoding parameters are calculated, then the prediction error is mapped, and finally Golomb Gramb encoding is carried out on the mapped prediction error.
Further, the local gradient value merging process adopts shift operation, specifically: optimization is performed based on the gradient value merge function Q = (Q1 × 9+ q2) × 9+ q3, a temporary variable temp = Q1< <3+ q1+ q2 is defined and rewritten as Q = temp < <3+ temp + q3, then the combinational logic path of the merge process has 4 levels, and the optimization continues to be Q = ((Q1 + Q2) + (Q3 + (Q2 < < 3)) + ((Q1 < < 4) + (Q1 < < 6)), and the combinational logic is shortened to 3 levels.
Further, the method of Golomb granny coding adopts a median search method for optimization, and specifically comprises the following steps: firstly, feeding N [ Q ] into a shift register to shift left by 3 bits, if (N [ Q ] < < 3) < A [ Q ] is met, feeding N [ Q ] into the shift register to shift left by 5 bits, if (N [ Q ] < < 5) < A [ Q ] is met, feeding N [ Q ] into the shift register to shift left by 6 bits, otherwise, shifting left by 4 bits; if (N [ Q ] < < 6) < a [ Q ] is satisfied, the granny coding parameter k =7, otherwise k =6; k =5 if (N [ Q ] < < 4) < a [ Q ] is satisfied, otherwise k =4; if (N [ Q ] < < 3) > A [ Q ] is satisfied, sending N [ Q ] into the shift register for left shift by 1 bit, if (N [ Q ] < < 1) < A [ Q ] is satisfied, sending N [ Q ] into the shift register for left 2 bits, otherwise, not carrying out shift operation; k =3 if (N [ Q ] < < 2) < a [ Q ] is satisfied, otherwise k =2; if (N [ Q ]) < a [ Q ] is satisfied, k =1, otherwise k =0; where N [ Q ] and A [ Q ] are variables indexed by Q.
Further, the Golomb granny code is implemented by a method based on a lookup table, which specifically comprises the following steps: for 8-bit images, the range of different k values obtained by calculation is 0 to 7, the range of a mapping error MERrval is 0 to 255, and the maximum code length LIMIT is 32 bits; storing a Golomb Gramb code table in 8 memories in advance according to different k values, wherein the bit width is 37 bits, the first 5 bits represent the length of actual codes, and the second 32 bits represent actual code values; the Golomb code value can be obtained in a reading period by taking the Golomb code parameter k as a chip selection signal of the memory bank.
Has the beneficial effects that:
according to the method, the causal template of the last coded pixel and the last column of coded pixel values are utilized, so that the causal template construction can be completed only by accessing the image memory for 2 times for all pixels to be coded, and the throughput rate of image compression is effectively improved; secondly, when the local gradient values are combined, a multiplier of a combining function Q = (Q1 multiplied by 9+ Q2) multiplied by 9+ Q3 is optimized and replaced by shift and addition, so that hardware implementation is facilitated; and finally, optimizing the calculation method of the Golomb Gramb coding parameter k by using a median search method, and in addition, because the Golomb Gramb coding is variable length coding, realizing the coding by using a method of a lookup table to replace a direct calculation method, reducing the complexity of hardware realization and effectively improving the clock frequency and the throughput rate of the image compression algorithm.
Drawings
FIG. 1 is a flow chart of a high throughput lossless image compression method based on JPEG-LS according to the present invention;
FIG. 2 is a block diagram of a detailed process of a JPEG-LS based high throughput lossless image compression method according to an embodiment of the present invention;
FIG. 3a is a schematic diagram illustrating a causal template construction when reading non-first-column image pixels according to an embodiment of the present invention;
FIG. 3b is a schematic diagram illustrating a causal template construction for reading a first row of image pixels according to an embodiment of the present invention;
FIG. 4 is a block diagram of a local gradient value merging process according to an embodiment of the present invention;
FIG. 5 is a schematic process diagram of a method for optimizing Golomb Gramb encoding based on median search according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an overall process of implementing Golomb Gramb coding by a lookup table-based method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a JPEG-LS based high-throughput lossless image compression apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and technical effects of the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples.
The invention discloses a high-throughput-rate lossless image compression method based on JPEG-LS, which mainly comprises the following steps: firstly, reading in an image and constructing a causal template of pixels to be coded; and then, calculating gradient values between adjacent pixels, if the gradient values are less than or equal to Near lossless Near, performing run-length coding, otherwise, performing quantization, symbol correction and combination on local gradient values, and performing conventional coding. In each causal template construction process, pixel values are read from an image memory 5 times, which is inefficient.
The method is improved, and all pixels to be coded can finish the construction of the causal template only by accessing the image memory for 2 times by utilizing the causal template of the last coded pixel and the last column of coded pixel values, so that the throughput rate of image compression is effectively improved; secondly, when the local gradient values are combined, the multiplier of the combining function Q = (Q1 multiplied by 9+ Q2) × 9+ Q3 is optimized and replaced by shift and addition, which is convenient for hardware implementation. Finally, optimizing a computing method of a Golomb coding parameter k by using a median search method; in addition, because the Golomb Gramb code is variable length code, the code is realized by using a method of a lookup table to replace a direct calculation method, the complexity of hardware realization can be reduced, and the clock frequency and the throughput rate of the image compression algorithm can be effectively improved.
As shown in fig. 1 and fig. 2, the high-throughput lossless image compression method based on JPEG-LS of the present invention includes the following steps:
accessing an image memory and reading an image, and constructing a causal template of pixels to be coded of the read image.
And based on the causal template of the last coded pixel and the value of the last row of coded pixels, completing the construction of the causal template of the pixels to be coded of the read image after accessing the image memory.
In general, when reading a compressed image pixel from an image memory, it is necessary to access the image memory 5 times, read and register a pixel Ix to be encoded and four adjacent pixels Ra, rb, rc, and Rd thereof, respectively, and thus the reading efficiency is low.
In the embodiment of the invention, by using the causal template of the last coded pixel and the value of the last row of coded pixels, the pixel Ix to be coded and 1 new adjacent pixel Rd thereof are only needed to be read for reading the image, and the remaining 3 adjacent pixels Ra, rb and Rc are directly obtained from the last coded pixel register or the last row of image pixel register, that is, only 2 times of image memory access is needed, and compared with the method that 5 times of image memory access is needed each time, the access time of 3 times is saved.
In more detail, as shown in fig. 3a, when reading a non-first column of image pixels, assigning a pixel Ix00 at a position x, a pixel Rb at a position b, and a pixel Rd at a position d of a last encoded pixel causal template to a pixel Ra at a position a, a pixel Rc at a position c, and a pixel Rb at a position b of a current pixel to be encoded causal template, respectively. As shown in fig. 3b, when reading the image pixels in the first column, assigning the stored pixel Ix00 at the position x, ra at the position a and Ix01 at the position x of the encoded pixel in the first column in the previous row to the pixel Rb at the position b, rc at the position c and Rd at the position d of the causal template of the current pixel to be encoded respectively. By the method, the reading time of all image pixels is shortened from 5 times to 2 times, and the coding frequency and the throughput rate are improved.
In one embodiment of the present invention, if the current pixel to be encoded is in the first row of the image, the adjacent three pixel values Rb = Rc = Rd =0; if the current pixel to be encoded is in the last column of the image, the pixel value Rd = Rb.
And step two, calculating local gradient values between adjacent image pixels of the pixels to be coded, if the absolute value of the local gradient values is less than or equal to near-lossless degree, performing run-length coding on the pixels to be coded, otherwise, performing quantization, sign correction and combination on the local gradient values, and performing conventional coding.
Specifically, the local gradient values D1, D2 and D3 are obtained by sequentially performing a difference between every two of the four pixel values adjacent to the pixel to be encoded.
And if the absolute values of the local gradient values are all less than or equal to the Near-lossless degree Near, the current pixel to be coded enters a run coding mode, otherwise, the current pixel to be coded enters a local gradient value quantization mode.
The local gradient value quantization mode specifically comprises the following steps: to avoid generating a large amount of context data, the local gradient values are further processed, the local gradient values having similar characteristics
Figure 323071DEST_PATH_IMAGE002
Quantized and combined into 9 integers: q1~ Q9, the operation and statistics of being convenient for, the expression is as follows:
Figure DEST_PATH_IMAGE005
wherein i belongs to 1 \ 82309, and T1, T2 and T3 are threshold values of local gradient value quantization; the quantizer of the local gradient values is symmetric about 0 difference, and reduces the maximum possible 729 vector data to 365 by combining the local gradient values with opposite signs after quantization; and then carrying out conventional coding, specifically: firstly, edge detection is carried out on a current pixel to be coded to obtain a predicted value of the current pixel to be coded, then the predicted value is corrected and normalized, then a prediction error of the current pixel to be coded is calculated, the prediction error is corrected and reduced in a mode, then Golomb Gramb encoding parameters are calculated, then the prediction error is mapped, and finally Golomb Gramb encoding is carried out on the mapped prediction error.
The run-length encoding specifically comprises: firstly, scanning the run length of pixels to be coded; then judging the reason of run length scanning termination, if the last pixel of the line is scanned, the run length is coded and then the run coding mode is switched out, otherwise the run interruption coding is carried out on the difference pixel after the run length is coded; then calculating the predicted value of the difference pixel; calculating, correcting and subtracting the prediction error; then calculating a context parameter, a mapping coefficient and a Golomb Gramb coding parameter; then mapping the prediction error, and continuing to perform Golomb Gramb coding on the mapped prediction error; and finally updating the context parameters, and exiting the run-length coding mode after the variable is updated.
In one embodiment of the present invention, the Near lossless degree Near is 0 in the lossless mode.
As shown in fig. 4, in the hardware implementation process of the function Q = (Q1 × 9+ q2) × 9+ q3 expression of the local gradient value combination, the multiplier not only occupies more logic resources, but also consumes a plurality of clock cycles once for calculation, so a shift operation is adopted to replace a multiplication operation, a temporary variable temp = Q1< <3+ q1+ q2 is defined and the formula is rewritten as Q = temp < <3+ temp + q3, then the combinational logic path of the combination process has 4 levels, and is continuously optimized as Q = ((Q1 + Q2) + (Q2 < < 3)) + ((Q1 < < 4) + (Q1 < < 6)), the combinational logic is shortened to 3 levels, the clock frequency of the image compression algorithm is effectively improved, and the throughput rate of the image compression algorithm is ensured.
As shown in fig. 5, the Golomb granny coding method adopts median search optimization, and reduces 7 shifting and comparing operations in the sequential comparison method to 3 shifting and comparing operations, specifically: firstly, N [ Q ] is fed into a shift register and is shifted to the left by 3 bits, if (N [ Q ] < < 3) < A [ Q ] is met, the N [ Q ] is fed into the shift register and is shifted to the left by 5 bits, if (N [ Q ] < < 5) < A [ Q ] is met, the N [ Q ] is fed into the shift register and is shifted to the left by 6 bits, otherwise, the N [ Q ] is shifted to the left by 4 bits; if (N [ Q ] < < 6) < a [ Q ] is satisfied, then the granumber coding parameter k =7, otherwise k =6; k =5 if (N [ Q ] < < 4) < a [ Q ] is satisfied, otherwise k =4; if (N [ Q ] < < 3) > A [ Q ] is satisfied, then N [ Q ] is sent to the left of the shift register and shifted by 1 bit, if (N [ Q ] < < 1) < A [ Q ] is satisfied, then N [ Q ] is sent to the left 2 bits of the shift register, otherwise, no shift operation is carried out; k =3 if (N [ Q ] < < 2) < a [ Q ] is satisfied, otherwise k =2; if (N [ Q ]) < a [ Q ] is satisfied, k =1, otherwise k =0. Where N [ Q ] and A [ Q ] are variables indexed by Q.
In an embodiment of the present invention, as shown in fig. 6, a method based on a lookup table replaces a direct calculation method to implement Golomb granny codes, which specifically includes:
for 8-bit images, the range of different k values obtained by calculation is 0 to 7, the range of a mapping error MERrval is 0 to 255, and the maximum code length LIMIT is 32 bits; storing a Golomb Gramb code table in 8 memories in advance according to different k values, wherein the bit width is 37 bits, the first 5 bits represent the length of actual codes, and the second 32 bits represent actual code values; and taking the parameter k as a chip selection signal of the memory group, so that a Golomb Gramb code value can be obtained in a reading period.
And step three, outputting a code stream after the coding of the step two, completing the compression coding of the read image, and returning to the step one for compression coding again if the compression coding of the read image is not completed.
Corresponding to the embodiment of the high-throughput lossless image compression method based on JPEG-LS, the invention also provides an embodiment of a high-throughput lossless image compression device based on JPEG-LS.
Referring to fig. 7, a high-throughput lossless image compression apparatus based on JPEG-LS according to an embodiment of the present invention includes one or more processors, which are configured to implement the high-throughput lossless image compression method based on JPEG-LS in the foregoing embodiment.
The embodiment of the high-throughput lossless image compression apparatus based on JPEG-LS of the present invention can be applied to any data processing-capable device, such as a computer or other like apparatus or device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a device in a logical sense, a processor of any device with data processing capability reads corresponding computer program instructions in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 7, a hardware structure diagram of an arbitrary device with data processing capability in which the JPEG-LS based lossless image compression apparatus according to the present invention is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, in the embodiment, the arbitrary device with data processing capability in which the apparatus is located may generally include other hardware according to the actual function of the arbitrary device with data processing capability, which is not described again.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. One of ordinary skill in the art can understand and implement it without inventive effort.
Embodiments of the present invention further provide a computer-readable storage medium, on which a program is stored, where the program, when executed by a processor, implements the JPEG-LS based high throughput lossless image compression method in the above embodiments.
The computer readable storage medium may be an internal storage unit, such as a hard disk or a memory, of any data processing capability device described in any of the foregoing embodiments. The computer readable storage medium may also be an external storage device of the wind turbine, such as a plug-in hard disk, a Smart Media Card (SMC), an SD Card, a Flash memory Card (Flash Card), and the like, provided on the device. Further, the computer readable storage medium may include both an internal storage unit and an external storage device of any data processing capable device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the arbitrary data processing-capable device, and may also be used for temporarily storing data that has been output or is to be output.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way. Although the foregoing has described the practice of the present invention in detail, it will be apparent to those skilled in the art that modifications may be made to the practice of the invention as described in the foregoing examples, or that certain features may be substituted in the practice of the invention. All changes, equivalents and the like which come within the spirit and principles of the invention are desired to be protected.

Claims (9)

1. A high-throughput lossless image compression method based on JPEG-LS is characterized by comprising the following steps:
accessing an image memory, reading an image, and constructing a causal template of pixels to be coded of the read image, wherein the causal template specifically comprises the following steps: only reading a pixel Ix to be coded and 1 new adjacent pixel Rd of the pixel Ix to be coded by using a causal template of a last coded pixel and a last row of coded pixel values of a read image, and directly acquiring the remaining 3 adjacent pixels Ra, rb and Rc from a last coded pixel register or a last row of image pixel registers so as to complete the construction of the causal template of the pixel to be coded;
step two, calculating local gradient values between adjacent image pixels of pixels to be coded in the causal template, if the absolute value of the local gradient values is less than or equal to near-lossless degree, performing run-length coding on the pixels to be coded, otherwise performing conventional coding after quantizing, sign correcting and combining the local gradient values;
the conventional coding is specifically: firstly, performing edge detection on a current pixel to be coded to obtain a predicted value of the current pixel to be coded, then correcting and regularizing the predicted value, then calculating a prediction error of the current pixel to be coded, correcting and modulo reducing the prediction error, then calculating a Golomb Gramb coding parameter, then mapping the prediction error, and finally performing Golomb Gramb coding on the mapped prediction error;
and step three, outputting a code stream after the coding of the step two, completing the compression coding of the read image, and returning to the step one for compression coding again if the compression coding of the read image is not completed.
2. The JPEG-LS based high throughput lossless image compression method as claimed in claim 1, wherein said causal template for the last encoded pixel and the last line of encoded pixel values are used, and specifically: when reading non-first-column image pixels, respectively assigning a pixel Ix00 at a position x, a pixel Rb at a position b and a pixel Rd at a position d of a last encoded pixel cause and effect template to a pixel Ra at a position a, a pixel Rc at a position c and a pixel Rb at a position b of the pixel cause and effect template to be encoded;
when reading the image pixels of the first column, assigning the stored pixel Ix00 at the position x, the pixel Ra at the position a and the pixel Ix01 at the position x of the coded pixel cause and effect template of the first column on the upper row to the pixel Rb at the position b, the pixel Rc at the position c and the pixel Rd at the position d of the pixel cause and effect template of the pixel to be coded respectively.
3. The JPEG-LS based high throughput lossless image compression method as claimed in claim 2, wherein if the pixel to be encoded is in the first row of the read image, the adjacent three pixel values are all equal to 0; if the pixel to be coded is in the last column of the image, the pixel value Rd = Rb.
4. The JPEG-LS based high throughput lossless image compression method as claimed in claim 2, wherein the calculating the local gradient values between the neighboring image pixels of the pixel to be encoded is specifically as follows: and sequentially carrying out difference on every two of the four pixel values adjacent to the pixel to be coded to obtain a local gradient value.
5. The JPEG-LS based high throughput lossless image compression method of claim 4, wherein the run length coding is specifically: firstly, scanning the run length of pixels to be coded; then judging the reason of run length scanning termination, if the last pixel of the line is scanned, the run length is coded and then the run coding mode is switched out, otherwise the run interruption coding is carried out on the difference pixel after the run length is coded; then calculating the predicted value of the difference pixel; calculating, correcting and subtracting the prediction error; computing context parameters, mapping coefficients and Golomb Gramb encoding parameters; then mapping the prediction error, and continuing to perform Golomb Gramb coding on the mapped prediction error; and finally updating the context parameters, and exiting the run-length coding mode after the variable is updated.
6. The JPEG-LS based high throughput lossless image compression method according to claim 4, wherein the local gradient values are quantized, sign corrected and combined and then are encoded conventionally, specifically: quantizing the local gradient values
Figure 352485DEST_PATH_IMAGE001
And then are combined into 9 integers: Q1-Q9, the expression is as follows:
Figure 663381DEST_PATH_IMAGE002
wherein i belongs to 1, 82309, and T1, T2 and T3 are threshold values for local gradient value quantization; the quantizers of the local gradient values are symmetric about 0 difference, and the quantized local gradient values with opposite signs are combined and then subjected to conventional encoding.
7. The JPEG-LS based high throughput lossless image compression method as claimed in claim 6, wherein the local gradient value combination process employs a shift operation, specifically: optimization is performed based on the gradient value combining function Q = (Q1 × 9+ q2) × 9+ q3, a temporary variable temp = Q1< <3+ q1+ q2 is defined and rewritten as Q = temp < <3+ temp + q3, then the combinational logic path of the combining process has 4 levels, and the optimization continues to be Q = ((Q1 + Q2) + (Q3 + (Q2 < < 3)) + ((Q1 < < 4) + (Q1 < < 6)), and the combinational logic is shortened to 3 levels.
8. The JPEG-LS based high-throughput lossless image compression method according to claim 6, wherein the Golomb Gramb coding method is optimized by a median search method, and specifically comprises the following steps: firstly, N [ Q ] is fed into a shift register and is shifted to the left by 3 bits, if (N [ Q ] < < 3) < A [ Q ] is met, the N [ Q ] is fed into the shift register and is shifted to the left by 5 bits, if (N [ Q ] < < 5) < A [ Q ] is met, the N [ Q ] is fed into the shift register and is shifted to the left by 6 bits, otherwise, the N [ Q ] is shifted to the left by 4 bits; if (N [ Q ] < < 6) < a [ Q ] is satisfied, then the granumber coding parameter k =7, otherwise k =6; k =5 if (N [ Q ] < < 4) < a [ Q ] is satisfied, otherwise k =4; if (N [ Q ] < < 3) > A [ Q ] is satisfied, sending N [ Q ] into the shift register for left shift by 1 bit, if (N [ Q ] < < 1) < A [ Q ] is satisfied, sending N [ Q ] into the shift register for left 2 bits, otherwise, not carrying out shift operation; k =3 if (N [ Q ] < < 2) < a [ Q ] is satisfied, otherwise k =2; if (N [ Q ]) < a [ Q ] is satisfied, k =1, otherwise k =0; where N [ Q ] and A [ Q ] are variables indexed by Q.
9. The JPEG-LS based high throughput lossless image compression method according to claim 8, wherein the Golomb Gramb coding is implemented by a lookup table based method, specifically comprising: for 8-bit images, the range of different k values obtained by calculation is 0 to 7, the range of a mapping error MERrval is 0 to 255, and the maximum code length LIMIT is 32 bits; storing a Golomb Gramb code table in 8 memories in advance according to different k values, wherein the bit width is 37 bits, the first 5 bits represent the length of actual codes, and the second 32 bits represent actual code values; the Golomb code value can be obtained in a reading period by taking the Golomb code parameter k as a chip selection signal of the memory bank.
CN202210930753.7A 2022-08-04 2022-08-04 JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method Active CN115022628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210930753.7A CN115022628B (en) 2022-08-04 2022-08-04 JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210930753.7A CN115022628B (en) 2022-08-04 2022-08-04 JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method

Publications (2)

Publication Number Publication Date
CN115022628A CN115022628A (en) 2022-09-06
CN115022628B true CN115022628B (en) 2022-12-13

Family

ID=83066351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210930753.7A Active CN115022628B (en) 2022-08-04 2022-08-04 JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method

Country Status (1)

Country Link
CN (1) CN115022628B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5903676A (en) * 1994-11-10 1999-05-11 The Chinese University Of Hong Kong Context-based, adaptive, lossless image codec
CN101534373A (en) * 2009-04-24 2009-09-16 北京空间机电研究所 Remote sensing image near-lossless compression hardware realization method based on improved JPEG-LS algorithm
CN102801981A (en) * 2012-08-30 2012-11-28 西安空间无线电技术研究所 Multipath compressed kernel parallel encoding control method on basis of JPEG-LS (Joint Pho-tographic Experts Group-Lossless Standard) algorithm
CN105828070A (en) * 2016-03-23 2016-08-03 华中科技大学 Anti-error code propagation JPEG-LS image lossless/near-lossless compression algorithm hardware realization method
CN110049333A (en) * 2019-04-23 2019-07-23 东南大学 A kind of JPEG_LS compression of images exports coding code stream splicing system and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7321623B2 (en) * 2002-10-01 2008-01-22 Avocent Corporation Video compression system
US7177479B2 (en) * 2003-04-25 2007-02-13 Stmicroelectronics S.R.L. Loss-less compression of still images at enhanced speed
US20130124631A1 (en) * 2011-11-04 2013-05-16 Fidelus Technologies, Llc. Apparatus, system, and method for digital communications driven by behavior profiles of participants

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5903676A (en) * 1994-11-10 1999-05-11 The Chinese University Of Hong Kong Context-based, adaptive, lossless image codec
CN101534373A (en) * 2009-04-24 2009-09-16 北京空间机电研究所 Remote sensing image near-lossless compression hardware realization method based on improved JPEG-LS algorithm
CN102801981A (en) * 2012-08-30 2012-11-28 西安空间无线电技术研究所 Multipath compressed kernel parallel encoding control method on basis of JPEG-LS (Joint Pho-tographic Experts Group-Lossless Standard) algorithm
CN105828070A (en) * 2016-03-23 2016-08-03 华中科技大学 Anti-error code propagation JPEG-LS image lossless/near-lossless compression algorithm hardware realization method
CN110049333A (en) * 2019-04-23 2019-07-23 东南大学 A kind of JPEG_LS compression of images exports coding code stream splicing system and method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Experimental study on JPEG-LS algorithm;Radhika Amashi,et al.;《2017 IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI)》;20180621;全文 *
Implementation of JPEG-LS compression algorithm for real time applications;Fidha Nazar,et al.;《 2016 International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT)》;20161124;全文 *
JPEG-LS图像压缩算法的研究与实现;牛慧卓等;《中国铁路》;20130430(第04期);全文 *
JPEG-LS图像无损压缩的IP固核设计;韩俊萍等;《太原理工大学学报》;20101130(第06期);全文 *
图像无损压缩算法JPEG-LS实现及性能研究;宋鸿梅等.;《光学仪器》;20141230;全文 *

Also Published As

Publication number Publication date
CN115022628A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
US6677869B2 (en) Arithmetic coding apparatus and image processing apparatus
US20180167083A1 (en) Lossless data compression
US8306108B2 (en) Adaptive canonical Huffman decoder and method thereof and video decoder
CN109379598B (en) Image lossless compression method based on FPGA
KR20060013021A (en) Context adaptive binary arithmetic decoder method and apparatus
JPS62261230A (en) Method of compressing multiplexed level signal
CN101951516A (en) Parallel encoding realization circuit and encoding method based on CABAC (Context-based Adaptive Binary Arithmetic Coding) in H.264/AVC (Advanced Video Coding)
Papadonikolakis et al. Efficient high-performance ASIC implementation of JPEG-LS encoder
CN103929642A (en) Method for rapidly calculating deviation value of entropy coding context model of HEVC transformation coefficients
JP3621512B2 (en) Digital information encoding apparatus, digital information decoding apparatus, digital information encoding / decoding apparatus, digital information encoding method, and digital information decoding method
CN110049333B (en) JPEG _ LS image compression output coding code stream splicing system and method
CN115022628B (en) JPEG-LS (joint photographic experts group-LS) -based high-throughput lossless image compression method
JPH09298668A (en) Digital information coder, digital information decoder, digital information coding/decoding device, digital information coding method and digital information decoding method
CN110191341B (en) Depth data coding method and decoding method
JP3929312B2 (en) Arithmetic coding apparatus and image processing apparatus
US10559093B2 (en) Selecting encoding options
CN103428502B (en) Decoding method and decoding system
CN117097905B (en) Lossless image block compression method, lossless image block compression equipment and storage medium
JP2001189661A (en) Encoding device and decoding device
JPH104551A (en) Image processing unit, method for the unit and storage medium storing the method
JPS6360952B2 (en)
GB2593691A (en) Efficient encoding methods
CN116828196A (en) Implementation method of JPEG-LS encoder based on FPGA
TWI491261B (en) Image coding method for facilitating run length coding and image encoding device thereof
JPH06121172A (en) Picture encoder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant