CN117354534A - Adaptive image lossless compression method, device and storage medium - Google Patents

Adaptive image lossless compression method, device and storage medium Download PDF

Info

Publication number
CN117354534A
CN117354534A CN202311640583.XA CN202311640583A CN117354534A CN 117354534 A CN117354534 A CN 117354534A CN 202311640583 A CN202311640583 A CN 202311640583A CN 117354534 A CN117354534 A CN 117354534A
Authority
CN
China
Prior art keywords
total length
golomb
image
data block
rice
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.)
Granted
Application number
CN202311640583.XA
Other languages
Chinese (zh)
Other versions
CN117354534B (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.)
Shanghai Fairsion Photoelectric Technology Co ltd
Original Assignee
Shanghai Fairsion Photoelectric Technology Co ltd
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 Shanghai Fairsion Photoelectric Technology Co ltd filed Critical Shanghai Fairsion Photoelectric Technology Co ltd
Priority to CN202311640583.XA priority Critical patent/CN117354534B/en
Publication of CN117354534A publication Critical patent/CN117354534A/en
Application granted granted Critical
Publication of CN117354534B publication Critical patent/CN117354534B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • 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
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • H04N19/426Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements using memory downsizing methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a self-adaptive image lossless compression method, equipment and a storage medium, wherein the method comprises the following steps: setting the Golomb-Rice parameter as k, and calculating Golomb-Rice coding digits corresponding to different k values; dividing an image into a plurality of secondary data blocks according to a pixel output sequence; calculating the k ' value corresponding to the shortest total length L (k ') of the Golomb-Rice coding length of the secondary data block when the total length L (k ') is not compressed; forming a primary data block by the secondary data blocks with the k' value of t and the number of not more than 32 when the total length is shortest; and using the t value as a Golomb-Rice parameter to perform compression coding on the primary data block and then transmitting the primary data block. The invention divides the image into data blocks composed of certain pixels, calculates the optimal parameters for each data block in real time and compresses, thereby reducing the compression output delay and selecting the locally optimal parameters for compression coding.

Description

Adaptive image lossless compression method, device and storage medium
Technical Field
The present invention relates to the field of image processing technology of machine vision, and in particular, to a method, apparatus and storage medium for lossless compression of adaptive images.
Background
Bandwidth resources of industrial cameras are particularly valuable, and images can be compressed using a specific interface in order to be able to transfer data faster with limited bandwidth. Since industrial camera images are used for subsequent machine vision algorithms, image quality cannot be lost during compression, lossless compression algorithms are typically employed.
The prediction residual is calculated for the image and then Golomb-Rice coding is a current, more efficient lossless compression coding method. However, this method must choose appropriate parameters to optimize Golomb-Rice coding for a particular input symbol probability model, otherwise the compression rate may deviate from the optimal compression rate and even produce data expansion, i.e., the amount of data after compression is greater than before compression.
Generally, a method of calculating probability distribution of prediction residual errors in an image after the whole frame of image is output and selecting appropriate parameters to perform Golomb-Rice coding can be adopted, but compression output delay is increased, and the selected parameters are specific to different areas of the whole frame of image, such as different characteristics of areas of the image, such as textured areas, smooth areas and the like, and one parameter cannot achieve optimal compression effect when applied to the whole frame of image.
Disclosure of Invention
In order to solve the technical problems, the invention provides an image lossless compression method which is suitable for being realized by an FPGA and automatically selects the optimal parameters of Golomb-Rice.
Specifically, the technical scheme of the invention is as follows:
the invention provides a self-adaptive image lossless compression method, which comprises the following steps:
setting the Golomb-Rice parameter as k, wherein k is a natural number, k is more than or equal to 0 and less than or equal to 6, and calculating Golomb-Rice coding bits corresponding to different k values according to pixel transformation prediction residual errors of the image;
dividing an image into a plurality of secondary data blocks according to a pixel output sequence;
calculating the total length L (k) of Golomb-Rice codes corresponding to different k values and the total length L (7) when not compressed as L (k '), wherein k' is 7, and setting the k value or the k 'value corresponding to the shortest length of the first Golomb-Rice code total length L (k) and the second total length L (k') as t;
calculating the total length of Golomb-Rice codes corresponding to different k values and the total length L (k ') when not compressed to form L' (k '), and determining the k' value corresponding to the shortest total length L '(k') for the next two-level data block;
if the k ' value corresponding to the shortest third total length L ' (k ') is equal to t, continuing to process the next secondary data blocks until the k ' value corresponding to the shortest third total length L ' (k ') is not equal to t, or the number of secondary data blocks corresponding to the shortest third total length k ' value equal to t reaches 32;
forming a primary data block by the secondary data block with the k' value of t when the total length is shortest, and directly transmitting the data of the primary data block if t=7; otherwise, the t value is used as a Golomb-Rice parameter to carry out compression coding on the data of the primary data block and then the data is sent.
In some embodiments, the pixel transformed prediction residual of the image is determined according to the following: and calculating a pixel prediction residual of the image, and carrying out unilateral transformation on the pixel prediction residual to form a pixel transformation prediction residual.
In some embodiments, the calculating the pixel prediction residual of the image specifically includes: and selecting a prediction residual calculation model, determining the number of image lines to be stored, and calculating pixel prediction residues.
In some embodiments, the calculation of Golomb-Rice coding bits corresponding to different k values from the pixel transformed prediction residual is based on the following formula:
b(k)=E(e)>>k+1+k;
where b (k) is the Golomb-Rice coding bit number and E (E) is the transformed prediction residual.
In some implementations, the dividing the image into two-level data blocks in pixel output order includes: the images are output in pixel order every 2 i The pixels form a two-level data block, i is not greater than5。
In some embodiments, the total length L (k') =2 when the secondary data block is not compressed i ×8。
In some embodiments, the calculation is performed on the Golomb-Rice encoded total length and the total length L (k ') without compression, which correspond to different k values, to form a third total length L ' (k '), and the following formula is adopted:
when k '=t, L' (k ')=l (k');
when k '+.t, L' (k ')=l (k')+8.
In some embodiments, before the sending the data of the primary data block in S600, the method further includes: and transmitting one byte of block information, wherein the block information comprises a Golomb-Rice coding parameter t value of the primary data block and the number of secondary data blocks contained in the primary data block.
The invention also provides an electronic device comprising a memory and a processor, the memory having stored thereon a computer program that is loaded and executed by the processor to implement the adaptive image lossless compression method as described above.
The present invention also provides a computer readable storage medium storing a computer program for implementing the adaptive image lossless compression method as described above when executed by a processor.
Compared with the prior art, the invention has at least one of the following beneficial effects:
1. the invention divides the image into data blocks composed of certain pixels, calculates the optimal parameters for each data block in real time and compresses, thereby reducing the compression output delay and selecting the locally optimal parameters for compression coding.
2. The invention blocks the image according to the pixel output sequence, reduces the delay of the data block coding output, and reduces the occupation of the FPGA storage resource.
3. In the process of determining the optimal Golomb-Rice coding parameters, the method only calculates the Golomb-Rice coding length of the data block, and compared with the method for directly performing the Golomb-Rice coding on the data block, the method occupies much less FPGA storage resources.
Drawings
The foregoing features, technical features, advantages and implementation of an adaptive image lossless compression method, apparatus and storage medium will be further described with reference to the accompanying drawings in a clear and understandable manner.
Fig. 1 is a flowchart of an adaptive image lossless compression method according to an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will explain the specific embodiments of the present invention with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
For simplicity of the drawing, only the parts relevant to the invention are schematically shown in each drawing, and they do not represent the actual structure thereof as a product. Additionally, in order to simplify the drawing for ease of understanding, components having the same structure or function in some of the drawings are shown schematically with only one of them, or only one of them is labeled. Herein, "a" means not only "only this one" but also "more than one" case.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
In this context, it should be noted that the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, unless explicitly stated or limited otherwise; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In addition, in the description of the present application, the terms "first," "second," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Standard Golomb-Rice coding can be achieved as follows:
for a non-negative integer n and a positive integer divisor m, the Golomb-Rice code Gm (n) of n for m is a combination of a unary code of the quotient and a binary representation of the remainder. Wherein m=2 k K is a natural number, we call the Golomb-Rice parameter. Assuming that the quotient is q, q is equal to n shifted left by k bits, whose unary code is q 1 s followed by 0 s. Assuming the remainder is p, p is the lowest k bits of the binary of n.
In one embodiment, referring to fig. 1 of the specification, the adaptive lossless image compression method provided by the invention comprises the following steps:
the first step: setting the Golomb-Rice parameter k as a natural number, wherein k is more than or equal to 0 and less than or equal to 6, and calculating Golomb-Rice coding bits corresponding to different k values according to pixel transformation prediction residual errors of the image.
Using a Golomb-Rice parameter of 6, i.e., G 64 (n) encoding n, the theoretically best compression ratio is about 99.6%. And using a Golomb-Rice parameter of 7 as-is G 128 (n) encoding n, the theoretically best compression rate is about 109.2%, which has created data redundancy and is no longer suitable for compression. The Golomb-Rice parameter is defined to be at most 6 in order to prevent redundancy of parameter data.
Calculating Golomb-Rice coding bits corresponding to different k values according to pixel transformation prediction residues of an image comprises the following processes:
first, a prediction residual calculation model is selected, and the minimum required number of image lines j, which are typically 1 or 2, are stored according to the prediction residual model, and a prediction residual e is calculated for these intra-line pixels.
There are many kinds of prediction residual calculation models, and the number of image lines to be stored for selecting different prediction residual calculation models is also different. The following is illustrated with two calculation models: (1) The prediction residual of a pixel is equal to the pixel minus the pixel to the left, and it is sufficient to store only one line to calculate the prediction residual, i.e., j=1; (2) The prediction residual of a pixel is equal to the average value of this pixel minus the left, upper pixel, and two rows, j=2, need to be stored to calculate the prediction residual.
Then, the prediction residual E is subjected to one-side transformation to form a transformed prediction residual E (E), and the E (E) is a non-negative integer.
Finally, golomb-Rice coding bit number b (k) corresponding to different k values is calculated:
b(k)=E(e)>>k+1+k。
and a second step of: the image is divided into a plurality of secondary data blocks according to the pixel output sequence.
One image is output in pixel order every 2 i The pixels form a two-level data block, wherein i is a natural number greater than 0, the number of the two-level data blocks is at most 32, and 2 i ×32<j rows of pixels.
Because the photosensitive chip of the industrial camera is generally output according to pixels and row by row, the image is segmented according to the pixel output sequence, so that the delay of data block coding output can be reduced, and meanwhile, the occupation of storage resources of the FPGA is reduced.
And a third step of: for the first two-level data block, calculating a first Golomb-Rice coding total length L (k) corresponding to different k values and a second total length L (k ') when not compressed, wherein k' is 7, and setting a k value or a k 'value corresponding to the shortest length of the first Golomb-Rice coding total length L (k) and the second total length L (k') as t; in another implementation manner, for the first two-level data block, a Golomb-Rice coding total length L (k) corresponding to different k values and a total length L (7) when not compressed are calculated, where k ' =k or 7, and a k ' value corresponding to the shortest total length L (k ') is set as t. The first Golomb-Rice coding total length L (k) is the Golomb-Rice coding bit number accumulated value of all pixel transform prediction residuals within the current secondary data block.
Calculating the correspondence of different k values of the first two-level data blockThe Golomb-Rice encoded total length L (0), L (1) … L (6), and the total length L (7) of the secondary data block when not compressed, are set to L (k '), i.e., k' =0, 1,2,3,4,5,6,7, where L (7) =2 i ×8。
And the k 'value corresponding to the shortest total length L (k') is the optimal Golomb-Rice coding parameter, and is set as t. In order to find out the optimal Golomb-Rice coding parameters, the Golomb-Rice coding length of the data block is calculated, and compared with the method of directly carrying out Golomb-Rice coding on the data block, the method occupies much less FPGA memory resources.
Fourth step: for the next two-level data block, calculating the total length of Golomb-Rice codes (namely the total length of the first Golomb-Rice codes) corresponding to different k values and the total length L (k ') (namely the second total length) when not compressed to form L ' (k ') (defined as a third total length), and determining the value of k ' corresponding to the shortest total length L ' (k '), wherein L ' (k ') is calculated by L (k ') by adopting the following formula:
when k '=t, L' (k ')=l (k').
When k '+.t, L' (k ')=l (k')+8.
The reason for adding 8 to the total length when k' +.t is that the method requires adding one byte (8 bits) of block identification before the data block when the parameters change.
Fifth step: if the value of k ' corresponding to the shortest third total length L ' (k ') in the second secondary data block is still equal to t, the next secondary data block is processed by the same method in the fourth step until the value of k ' corresponding to the shortest third total length L ' (k ') is not equal to t, or the number of secondary data blocks with the shortest total length including the first secondary data block and the value of k ' corresponding to t reaches 32.
Sixth step: forming a first-level data block by the second-level data block with the k' value equal to t when the third total length is shortest, if t=7, directly transmitting the data of the first-level data block, and directly transmitting the pixel value of the original image without compression coding the first-level data block; if t is not equal to 7, the t value is used as the Golomb-Rice parameter to perform compression coding on the data of the primary data block and then send the data.
Before transmitting data of a primary data block, transmitting a byte of block information, wherein the last three bits of the byte are compression parameters, 2' b111 indicates that the data block is original data, uncompressed, and the rest values indicate that the data block is Golomb-Rice compression encoded by using the parameters; the upper five bits plus 1 identify the number of secondary data blocks within the current primary data block, which is at most 2'b11111+2' b1=32.
Seventh step: and returning to the third step, and circularly executing the steps on the rest secondary data blocks until the whole image is processed.
During decoding, firstly, according to the first byte, determining the Golomb-Rice compression parameter of each primary data block and the number of secondary data blocks in the primary data block, and according to the information, decoding the data in the corresponding number of secondary data blocks to obtain a transformation prediction residual E (E), and further recovering the image.
Example 1
First, calculating the pixel prediction value of test-image
When x=0 or y=0,the method comprises the steps of carrying out a first treatment on the surface of the In the remaining case of the device, in the other case,wherein round represents rounding.
And calculating a prediction residual error:
according to the prediction residual calculation model selected in the present embodiment, j=2, two lines of images need to be stored.
Single-side transformation is carried out on the prediction residual to form E (E):
when E is ∈0, E (E) =2e.
When E <0, E (E) = -2*e-1.
Then, the test-image is formed into a two-level data block every 64 pixels in the pixel output order.
Calculating the Golomb-Rice coding total length L (k) corresponding to different k values of the first secondary data block and the total length L (7) when not compressed, setting the total length L (k ') as L (k '), and comparing to find that the total length is shortest when the k ' value is 1, namely t=1;
for the second two-level data block, finding out the shortest of the Golomb-Rice coding total length corresponding to different k values and the L '(k') formed by the calculation of the total length when not compressed:
L′(k′)=L(k′)+8,k′=0,2,3,4,5,6,7。
L′(k′)=L(k′),k′=1。
the shortest is found that k' =0, i.e. different from the Golomb-Rice coding parameter of the last secondary data block, the first secondary data block is packed into the first primary data block, and the first primary data block is compression-coded and transmitted by using 1 as the Golomb-Rice parameter.
Before transmitting the data of the first primary data block, transmitting one byte of block information, wherein the last three bits of the byte are compression parameters, and 2' b001 indicates that the data block is subjected to Golomb-Rice compression coding by using 1 as a parameter; the upper five bits are 2' b00000 and the upper five bits plus 1 are the number of secondary data blocks, indicating that the number of secondary data blocks within the present primary data block is 1.
Since the second secondary data block of the entire image is not packed into the first secondary data block, it is then taken as the first secondary data block within the second primary data block, where t=0.
For the third two-level data block of the whole image, the shortest of the Golomb-Rice coding total length corresponding to different k values and the L ' (k ') formed by the total length after operation without compression is found out to be k ' =0.
For the fourth two-level data block of the whole image, the shortest of the Golomb-Rice coding total length corresponding to different k values and the L ' (k ') formed by the calculation of the total length when not compressed is found to be k ' =1, namely, the value is different from the Golomb-Rice coding parameter of the last two-level data block, the second and third two-level data blocks of the whole image are packed into the second one-level data block, and the second one-level data block is compressed and coded by using 0 as the Golomb-Rice parameter and transmitted.
Before transmitting the data of the second primary data block, firstly transmitting one byte of block information, wherein the last three bits of the byte are compression parameters, and 2' b000 represents that the data block is subjected to Golomb-Rice compression coding by using 0 as a parameter; the upper five bits are 2' b00001 and the upper five bits plus 1 are the number of secondary data blocks, indicating that the number of secondary data blocks within the present primary data block is 2.
The above steps are cyclically performed, and the whole image is processed in the same manner.
During decoding, firstly, according to the first byte, it is determined that the first primary data block contains 1 secondary data block, golomb-Rice compression coding is performed by using 1 as a parameter, corresponding data is decoded accordingly, and finally, the image of the first primary data block is restored, and so on until the whole image is restored.
The compression rate achieved by the image test-image is 42.89%. If the whole image is Golomb-Rice compression encoded using the same parameter, k=2 is most suitable, at which time the compression rate is 53.46%. Therefore, the method can reduce the compression output delay and select the locally optimal parameters for compression coding. And the method requires little computing resources and memory space, and can be realized by using an FPGA device.
In one embodiment, the invention provides an electronic device comprising a memory and a processor, the memory having stored thereon a computer program that is loaded and executed by the processor to implement the adaptive image lossless compression method as described above, the processor being a CPU, controller, microcontroller, microprocessor, or other data processing chip.
In one embodiment, the present invention provides a computer readable storage medium storing a computer program for implementing the adaptive image lossless compression method as described above when executed by a processor. The aspects of the present invention, in essence or contributing to the prior art or portions of the aspects, may be embodied in the form of a software product stored in a storage medium, comprising instructions for causing a computer device (which may be a personal computer, a server, a programmed computer or a network device, etc.) to perform all or part of the steps of the methods described in the various method embodiments of the present invention. The computer readable storage medium includes a usb disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), and other various media capable of carrying computer program code.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the parts of a certain embodiment that are not described or depicted in detail may be referred to in the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It should be noted that the above embodiments can be freely combined as needed. The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. An adaptive lossless image compression method, comprising the steps of:
setting the Golomb-Rice parameter as k, wherein k is a natural number, k is more than or equal to 0 and less than or equal to 6, and calculating Golomb-Rice coding bits corresponding to different k values according to pixel transformation prediction residual errors of the image;
dividing the image into a plurality of secondary data blocks according to the pixel output sequence;
for the first two-level data block, calculating a first Golomb-Rice coding total length L (k) corresponding to different k values and a second total length L (k ') when not compressed, wherein k' is 7, and setting a k value or a k 'value corresponding to the shortest length in the first Golomb-Rice coding total length L (k) and the second total length L (k') as t;
calculating the total length of the first Golomb-Rice codes corresponding to different k values and the second total length L (k ') when not compressed to form a third total length L' (k '), and determining the k' value corresponding to the shortest third total length L '(k');
if the k ' value corresponding to the shortest third total length L ' (k ') is equal to t, continuing to process the next secondary data blocks until the k ' value corresponding to the shortest third total length L ' (k ') is not equal to t, or the number of secondary data blocks corresponding to the shortest third total length k ' value is equal to t reaches 32;
forming a primary data block by the secondary data block with the k' value of t when the third total length is shortest, and directly transmitting the data of the primary data block if t=7; otherwise, using the t value as the Golomb-Rice parameter to perform compression coding on the data of the primary data block and then transmitting the data.
2. The adaptive image lossless compression method according to claim 1, wherein the pixel transform prediction residual of the image is determined according to the following manner: and calculating a pixel prediction residual of the image, and carrying out unilateral transformation on the pixel prediction residual to form a pixel transformation prediction residual.
3. The adaptive image lossless compression method according to claim 2, wherein said calculating the pixel prediction residual of the image comprises: and selecting a prediction residual calculation model, determining the number of image lines to be stored, and calculating the pixel prediction residual.
4. A method of lossless compression of an adaptive image according to any one of claims 1 to 3, wherein the calculation of Golomb-Rice coding bits corresponding to different k values from pixel transformed prediction residuals of the image is based on the following formula:
b(k)=E(e)>>k+1+k;
wherein b (k) is the Golomb-Rice coding bit number and E (E) is the transformed prediction residual.
5. The adaptive image lossless compression method according to claim 1, wherein the dividing the image into a plurality of secondary data blocks in pixel output order comprises: the images are output in pixel order every 2 i The pixels form one of said two-level data blocks, i being not greater than 5.
6. The adaptive image lossless compression method according to claim 5, wherein the second total length L (k') =2 when the secondary data block is not compressed i ×8。
7. The adaptive image lossless compression method according to claim 1, wherein the calculation is performed on the first Golomb-Rice encoded total length corresponding to different k values and the second total length L (k ') when not compressed to form a third total length L ' (k '), and the following formula is adopted:
when k '=t, L' (k ')=l (k');
when k '+.t, L' (k ')=l (k')+8.
8. The adaptive image lossless compression method according to claim 1, wherein if t=7, before directly transmitting the data of the primary data block, further comprising: and transmitting one byte of block information, wherein the block information comprises a Golomb-Rice coding parameter t value of the primary data block and the number of secondary data blocks contained in the primary data block.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program that is loaded and executed by the processor to implement the adaptive image lossless compression method of any of claims 1-8.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program for implementing the adaptive image lossless compression method according to any one of claims 1-8 when executed by a processor.
CN202311640583.XA 2023-12-04 2023-12-04 Adaptive image lossless compression method, device and storage medium Active CN117354534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311640583.XA CN117354534B (en) 2023-12-04 2023-12-04 Adaptive image lossless compression method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311640583.XA CN117354534B (en) 2023-12-04 2023-12-04 Adaptive image lossless compression method, device and storage medium

Publications (2)

Publication Number Publication Date
CN117354534A true CN117354534A (en) 2024-01-05
CN117354534B CN117354534B (en) 2024-02-02

Family

ID=89365236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311640583.XA Active CN117354534B (en) 2023-12-04 2023-12-04 Adaptive image lossless compression method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117354534B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013067101A1 (en) * 2011-11-04 2013-05-10 Dolby Laboratories Licensing Corporation Layer decomposition in hierarchical vdr coding
WO2014189236A1 (en) * 2013-05-22 2014-11-27 세종대학교 산학협력단 Lossless image compression and restoration method and apparatus performing same
CN104221288A (en) * 2012-04-13 2014-12-17 佳能株式会社 Method, apparatus and system for encoding and decoding subset of transform units of encoded video data
US20150201220A1 (en) * 2014-01-10 2015-07-16 Sony Corporation Conditional golomb based adaptive entropy coding
CN107026652A (en) * 2017-02-28 2017-08-08 北京交通大学 Positive integer sequence compaction method based on subregion
CN109379598A (en) * 2018-09-12 2019-02-22 合肥埃科光电科技有限公司 A kind of Lossless Image Compression Algorithm method realized based on FPGA
CN110691242A (en) * 2019-09-16 2020-01-14 华中科技大学 Large-format remote sensing image lossless compression method
WO2021059652A1 (en) * 2019-09-25 2021-04-01 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method, and decoding method
WO2021130754A1 (en) * 2019-12-23 2021-07-01 Ariel Scientific Innovations Ltd. Systems and methods of data compression
CN116647673A (en) * 2021-11-11 2023-08-25 杭州海康威视数字技术股份有限公司 Video encoding and decoding method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013067101A1 (en) * 2011-11-04 2013-05-10 Dolby Laboratories Licensing Corporation Layer decomposition in hierarchical vdr coding
CN104221288A (en) * 2012-04-13 2014-12-17 佳能株式会社 Method, apparatus and system for encoding and decoding subset of transform units of encoded video data
WO2014189236A1 (en) * 2013-05-22 2014-11-27 세종대학교 산학협력단 Lossless image compression and restoration method and apparatus performing same
US20150201220A1 (en) * 2014-01-10 2015-07-16 Sony Corporation Conditional golomb based adaptive entropy coding
CN107026652A (en) * 2017-02-28 2017-08-08 北京交通大学 Positive integer sequence compaction method based on subregion
CN109379598A (en) * 2018-09-12 2019-02-22 合肥埃科光电科技有限公司 A kind of Lossless Image Compression Algorithm method realized based on FPGA
CN110691242A (en) * 2019-09-16 2020-01-14 华中科技大学 Large-format remote sensing image lossless compression method
WO2021059652A1 (en) * 2019-09-25 2021-04-01 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Encoding device, decoding device, encoding method, and decoding method
WO2021130754A1 (en) * 2019-12-23 2021-07-01 Ariel Scientific Innovations Ltd. Systems and methods of data compression
CN116647673A (en) * 2021-11-11 2023-08-25 杭州海康威视数字技术股份有限公司 Video encoding and decoding method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JAESHIN LEE等: "An Effective Algorithm and Architecture for the High-Throughput Lossless Compression of High-Resolution Images", IEEE ACCESS, pages 138803 - 138815 *
李俊廷: "基于分区的倒排索引压缩算法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑 (2017 年 第06期)》, pages 1 - 60 *

Also Published As

Publication number Publication date
CN117354534B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN111093081B (en) Lossless image compression method and system
JP5221047B2 (en) CABAC encoding method and apparatus using improved context model selection for improved compression ratio, and CABAC decoding method and apparatus
JP5461419B2 (en) Pixel predicted value generation procedure automatic generation method, image encoding method, image decoding method, apparatus thereof, program thereof, and recording medium on which these programs are recorded
US20070233477A1 (en) Lossless Data Compression Using Adaptive Context Modeling
JPH0793586B2 (en) Data compression model selection method and system
CN111758254B (en) Efficient context model computational design in transform coefficient coding
JPH09135358A (en) Image encoding device using arithmetic code
JP4797009B2 (en) Prediction mode information encoding method, prediction mode information decoding method, these devices, their programs, and computer-readable recording media
CN103188494A (en) Apparatus and method for encoding depth image by skipping discrete cosine transform (DCT), and apparatus and method for decoding depth image by skipping DCT
JP2798172B2 (en) Image encoding / decoding device
CN111050176B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, computer device, and storage medium
JP5101962B2 (en) Image coding apparatus, control method therefor, and computer program
US20130343662A1 (en) Moving picture encoding apparatus, moving picture encoding method, and moving picture encoding program, and moving picture decoding apparatus, moving picture decoding method, and moving picture decoding program
CN117354534B (en) Adaptive image lossless compression method, device and storage medium
JP2021072540A (en) Image encoding device, decoding device, transmission system, and control method for the same
Manohar et al. An SMVQ-based reversible data hiding technique exploiting side match distortion
CN110545435A (en) desktop pixel coding method and device based on probability model and storage medium
US8411745B2 (en) Method and apparatus for coding and decoding using bit-precision
US20130279818A1 (en) Image encoding apparatus and method, image decoding apparatus and method, and non-transitory computer readable medium
JP4462359B2 (en) Image compression device
US9420292B2 (en) Content adaptive compression system
US9426481B2 (en) Method and apparatus for encoding image, and method and apparatus for decoding image
CN113099269A (en) String matching prediction method, encoding and decoding method, related equipment and device
EP2810371B1 (en) Binary arithmetic coding scheme
JP4694462B2 (en) Encoding apparatus, encoding method, program, and recording medium thereof

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