CN102215384B - Image compressing method and system - Google Patents

Image compressing method and system Download PDF

Info

Publication number
CN102215384B
CN102215384B CN201010142134.9A CN201010142134A CN102215384B CN 102215384 B CN102215384 B CN 102215384B CN 201010142134 A CN201010142134 A CN 201010142134A CN 102215384 B CN102215384 B CN 102215384B
Authority
CN
China
Prior art keywords
pixel
code length
pixels
block
huffman code
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.)
Expired - Fee Related
Application number
CN201010142134.9A
Other languages
Chinese (zh)
Other versions
CN102215384A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to CN201010142134.9A priority Critical patent/CN102215384B/en
Publication of CN102215384A publication Critical patent/CN102215384A/en
Application granted granted Critical
Publication of CN102215384B publication Critical patent/CN102215384B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses an image compressing method and system, wherein the image compressing method comprises the following steps of: acquiring the Huffman coding length of a 8*8 pixel block under a horizontal compression mode and the Huffman coding length of the 8*8 pixel block under a vertical compression mode; if the Huffman coding length of the 8*8 pixel block under the horizontal compression mode is longer than the Huffman coding length of the 8*8 pixel block under the vertical compression mode, taking a Huffman coding result of the 8*8 pixel block under the vertical compression mode as an image compression result of the 8*8 pixel block; and if not, taking the Huffman coding result of the 8*8 pixel block under the horizontal compression mode as the image compression result of the 8*8 pixel block.

Description

Method for compressing image and system
Technical field
The present invention relates to image processing field, relate more specifically to a kind of method for compressing image and system.
Background technology
Current, there are a lot of method for compressing image.What wherein, be most widely used is method for compressing image under Joint Photographic Experts Group and the method for compressing image under mpeg standard.
In the method for compressing image under Joint Photographic Experts Group, any one 8*8 block of pixels of needs compression is carried out to discrete cosine transform (DCT), so that the concentration of energy in this 8*8 block of pixels is being represented on the DCT coefficient of the pixel that this 8*8 block of pixels medium frequency is lower.To the compression of a 8*8 block of pixels, be that the DCT coefficient that represents the pixel of the upper frequency outside visible-range in this 8*8 block of pixels by abandoning is realized.In addition, in the method for compressing image under Joint Photographic Experts Group, also to retain DCT coefficient be quantized, to reduce their amplitude, finally adopt Run-Length Coding or Huffman coding to encode further to improve compression ratio to retained DCT coefficient.
In mpeg standard, there are three kinds of method for compressing image of intraframe coding, forward predictive coded and bi-directional predictive coding (latter two is referred to as interframe encode).Wherein, for an image frame (I frame) that need to carry out intraframe coding, inner frame coding method is by compressing it by the 8*8 block of pixels of this image frame self.For an image frame (P frame) that need to carry out forward predictive coded, forward predictive coded method is by being used the residual error between this image frame and its reference frame (previous I frame or P frame) to compress it.And for an image frame (B frame) that need to carry out bi-directional predictive coding, bi-directional predictive coding method is by being used the residual error between this frame picture and the reference frame (previous I frame or P frame and next P frame or I frame) of its former and later two directions to compress it.
Fig. 1 shows the logic diagram of the image encoding system under mpeg standard.As shown in Figure 1, the image encoding system under mpeg standard comprises intraprediction unit 102, inter prediction unit 104, DCT unit 106, quantifying unit 108, inverse quantization unit 110, inverse discrete cosine transformation (IDCT) unit 112 and variable length code (VLC) unit 114.
Each unit as shown in fig. 1, when I frame or P frame are encoded, the intraprediction unit use current block left side is that the pixel of top piece is predicted the block of pixels of input, inter prediction unit is used the reference frame in reference frame storing device to predict, resulting prediction piece and input block of pixels are subtracted each other the residual block data that obtain and are converted through DCT unit, quantifying unit quantizes, then by VLC, is encoded into code stream and exports.In the process of coding, comprising decode procedure, the data that quantize to obtain are through inverse quantization unit, the residual error data that IDCT unit obtains and prediction piece are added and obtain the block of pixels of rebuilding, and the block of pixels of reconstruction is stored in reference frame storing device the reference frame for interframe encode.While encoding for B frame, the block of pixels of reconstruction does not need as storing with reference to frame.
Wherein, to carrying out an image frame of interframe encode while encoding, the image encoding system shown in Fig. 1 need to be usually located at its outside memory from one and read the reference frame that this need to carry out the image frame of interframe encode.Because the data volume of the reference frame in memory is conventionally all larger, so when writing or reading these reference frames between memory and image encoding system, will bring a large amount of memory spendings and heavy burden to bandwidth of memory.
For current application, high definition video image becomes a kind of trend, and the video encoding standard being most widely used such as MPEG-2, H.264, AVS is all similar to employing image encoding system as above high definition video image is encoded.In this case, the burden of the bandwidth cost aspect of memory will be more heavy, thus the coding rate of impact to image frame.
Summary of the invention
One or more problems in view of the above, the invention provides a kind of method for compressing image and system.
According to a kind of method for compressing image of the embodiment of the present invention, comprise: obtain the Huffman code length of 8*8 block of pixels under horizontal compression pattern and the Huffman code length under vertical shrink mode; If the Huffman code length of 8*8 block of pixels under horizontal compression pattern is greater than its Huffman code length under vertical shrink mode, using 8*8 block of pixels the Huffman coding result under vertical shrink mode as the image compression result of 8*8 block of pixels, otherwise using 8*8 block of pixels the Huffman coding result under horizontal compression pattern as the image compression result of 8*8 block of pixels.
According to a kind of image compression system of the embodiment of the present invention, comprise: code length acquiring unit, is configured to obtain the Huffman code length of 8*8 block of pixels under horizontal compression pattern and the Huffman code length under vertical shrink mode; Compression result selected cell, if be configured to the Huffman code length of 8*8 block of pixels under horizontal compression pattern, be greater than the Huffman code length of 8*8 block of pixels under vertical shrink mode, using 8*8 block of pixels the Huffman coding result under vertical shrink mode as the image compression result of 8*8 block of pixels, otherwise using 8*8 block of pixels the Huffman coding result under horizontal compression pattern as the image compression result of 8*8 block of pixels.
By the present invention, can compress reference frame, thereby reduce the capacity of memory and reduce bandwidth.
Accompanying drawing explanation
Below in conjunction with accompanying drawing in the description of the specific embodiment of the present invention, the present invention may be better understood, wherein:
Fig. 1 shows the logic diagram of the image encoding system under mpeg standard;
Fig. 2 shows the example of high-definition screen frame and basic coding unit wherein;
Fig. 3 shows according to the block diagram of the image compression system of the embodiment of the present invention;
Fig. 4 shows according to the flow chart of the method for compressing image of the embodiment of the present invention;
Fig. 5 shows the flow chart that obtains the processing of the Huffman code length of any one-row pixels in 8*8 block of pixels according to the embodiment of the present invention;
Fig. 6 shows according to the schematic diagram of the process of the first difference pixel value of each pixel in any one-row pixels in the 8*8 block of pixels of the embodiment of the present invention;
Fig. 7 shows the flow chart that obtains the processing of the Huffman code length of any row pixel in 8*8 block of pixels according to the embodiment of the present invention;
Fig. 8 shows the schematic diagram that obtains the process of the first difference pixel value of each pixel in any row pixel in 8*8 block of pixels according to the embodiment of the present invention; And
Fig. 9 shows according to the block diagram of the realization example of the image compression system of the embodiment of the present invention.
Embodiment
Feature and the exemplary embodiment of various aspects of the present invention will be described in detail below.Many details have been contained in description below, to complete understanding of the present invention is provided.But, it will be apparent to one skilled in the art that the present invention can be in the situation that do not need some details in these details to implement.Below the description of embodiment is only used to provide the clearer understanding to the present invention by example of the present invention is shown.The present invention is never limited to any concrete configuration and the algorithm proposing below, but has covered under the premise of without departing from the spirit of the present invention any modification, replacement and the improvement of coherent element, parts and algorithm.
For to carrying out the current image frame of interframe encode while carrying out interframe encode, from storing memory reference frame, in image encoding system outside of current image frame, read quickly and efficiently the reference frame of current image frame, the present invention proposes first reference frame is compressed, the thought of then reference frame storing after compression being used in the process for interframe encode in memory.According to the method for compressing image/system of the embodiment of the present invention, be mainly used in reference frame to compress.But, it should be appreciated by those skilled in the art that compression method of the invention process goes for any image to compress equally, rather than only limit to reference frame.
Fig. 2 shows the example of high-definition screen frame and basic coding unit wherein.As shown in Figure 2, this high-definition screen frame comprises 1920 * 1080 pixels, and basic coding unit is wherein 8*8 block of pixels.When the image frame reference frame to as another image frame, shown in Fig. 2 carries out image compression, according to the method for compressing image/system of the embodiment of the present invention, pass through the basic coding unit in this image frame (that is, 8*8 block of pixels) to process one by one to realize the compression to whole image frame.
Below in conjunction with Fig. 3 and Fig. 4, the process of any one basic coding unit execution compression being processed according to the image compression system of the embodiment of the present invention is described.Wherein, Fig. 3 shows according to the block diagram of the image compression system of the embodiment of the present invention; Fig. 4 shows according to the flow chart of the method for compressing image of the embodiment of the present invention.
As shown in Figure 3, according to the image compression system of the embodiment of the present invention, comprise code length acquiring unit 302 and compression result selected cell 304.Wherein, code length acquiring unit 302 obtains the Huffman code length of 8*8 block of pixels under horizontal compression pattern and the Huffman code length under vertical shrink mode (that is, execution step S402).If the Huffman code length of 8*8 block of pixels under horizontal compression pattern is greater than the Huffman code length of 8*8 block of pixels under vertical shrink mode, compression result selected cell 304 using 8*8 block of pixels the Huffman coding result under vertical shrink mode as the image compression result of 8*8 block of pixels.If the Huffman code length of 8*8 block of pixels under horizontal compression pattern is less than the Huffman code length of 8*8 block of pixels under vertical shrink mode, compression result selected cell 304 using 8*8 block of pixels the Huffman coding result under horizontal compression pattern as the image compression result of 8*8 block of pixels.That is to say, compression result selected cell 304 is the Huffman code length under horizontal and vertical compact model according to 8*8 block of pixels, select one of 8*8 block of pixels Huffman coding result under horizontal and vertical compact model as the image compression result (that is, execution step S404) of 8*8 block of pixels.
Next, description encoding length acquiring unit 302 obtains the processing of the Huffman code length of 8*8 block of pixels under horizontal compression pattern.Particularly, the processing that code length acquiring unit 302 obtains the Huffman code length of 8*8 block of pixels under horizontal compression pattern comprises: first, obtain the Huffman code length of each row pixel in 8*8 block of pixels; Then, using the stack result of the Huffman code length of each row pixel in 8*8 block of pixels as 8*8 block of pixels the Huffman code length under horizontal compression pattern.
Below, describe the processing of the Huffman code length that obtains (for example) the capable pixel of i in 8*8 block of pixels in detail.Fig. 5 shows the flow chart that obtains the processing of the Huffman code length of any a line (for example, i is capable) pixel in 8*8 block of pixels according to the embodiment of the present invention.The processing of as shown in Figure 5, obtaining the Huffman code length of the capable pixel of i in 8*8 block of pixels comprises:
S502, obtains the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1), wherein i and j are integer, and 0≤i≤7,0≤j≤6.Fig. 6 shows according to the schematic diagram of the process of the first difference pixel value of each pixel in any one-row pixels in the 8*8 block of pixels of the embodiment of the present invention.As shown in Figure 6, the pixel value P of the 0th pixel in the capable pixel of i i, 0remain unchanged, and the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1) is by by the pixel value P of j+1 pixel in the capable pixel of i i, j+1pixel value P with j pixel in the capable pixel of i i, jsubtract each other and obtain, that is, and diff 1(i, j+1)=P i, j+1-P i, j;
S504, obtains the pixel value P of the 0th pixel in the capable pixel of i i, 0the first difference pixel value diff of j+1 pixel during with each integer value in j gets 0 to 6 in the capable pixel of i 1the absolute value Abs_min (i) of a value of absolute value minimum in (i, j+1);
S506, utilizes the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1) and absolute value Abs_min (i), calculate the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1).Particularly, if the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1) > 0, passes through the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1) and absolute value Abs_min (i) subtract each other to obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of i 2(i, j+1), that is, and diff 2(i, j+1)=diff 1(i, j+1)-Abs_min (i), otherwise pass through the first difference pixel value diff of j+1 pixel in the capable pixel of i 1(i, j+1) and absolute value Abs_min (i) phase Calais obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of i 2(i, j+1), that is, and diff 2(i, j+1)=diff 1(i, j+1)-Abs_min (i);
S508, by by the pixel value P of the 0th pixel in the capable pixel of i i, 0huffman code length (8 bit), each integer value in j gets 0 to 6 time j+1 pixel in i capable pixel second order difference pixel value diff 2the Huffman code length Huf_H of (i, j+1) i, j+1, and the Huffman code length Abs_H (i) of absolute value Abs_min (i) be added, obtain the Huffman code length Sum_H (i) of the capable pixel of i,
Figure GSA00000056731300061
Shown in Fig. 5 obtain 8*8 block of pixels in the process of Huffman code length of the capable pixel of i, can think the pixel value P of the 0th pixel in the capable pixel of i i, 0first difference pixel value and the second order difference pixel value of the 0th pixel in the capable pixel of i.In this case, can think that absolute value Abs_min (i) is the least absolute value in the absolute value of the first difference pixel value of all pixels in the capable pixel of i in 8*8 block of pixels, and think that the Huffman code length Sum_H (i) of the capable pixel of i is the Huffman code length sum of Huffman code length and the absolute value Abs_min (i) of the second order difference pixel value of all pixels in the capable pixel of i.
Next, description encoding length acquiring unit 302 obtains the processing of the Huffman code length of 8*8 block of pixels under vertical shrink mode.Particularly, the processing that code length acquiring unit 302 obtains the Huffman code length of 8*8 block of pixels under vertical shrink mode comprises: first, obtain the Huffman code length of each row pixel in 8*8 block of pixels; Then, using the stack result of the Huffman code length of each row pixel in 8*8 block of pixels as 8*8 block of pixels the Huffman code length under vertical shrink mode.
Below, describe the processing of the Huffman code length that obtains (for example) the i row pixel in 8*8 block of pixels in detail.Fig. 7 for example shows, according to the flow chart of the processing of the Huffman code length that obtains any row in 8*8 block of pixels (, i row) pixel of the embodiment of the present invention.The processing of as shown in Figure 7, obtaining the Huffman code length of i row pixel in 8*8 block of pixels comprises:
S702, obtains the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i), wherein i and j are integer, and 0≤i≤7,0≤j≤6.Fig. 8 shows according to the schematic diagram of the process of the first difference pixel value of each pixel in any row pixel in the 8*8 block of pixels of the embodiment of the present invention.As shown in Figure 8, the pixel value P of the 0th pixel in i row pixel 0, iremain unchanged, and the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i) is by by the pixel value P of j+1 pixel in i row pixel j+1, ipixel value P with j pixel in i row pixel j, isubtract each other to obtain, that is, and diff 1(j+1, i)=P j+1, i-P j, i;
S704, obtains the pixel value P of the 0th pixel in i row pixel 0, ithe first difference pixel value diff of j+1 pixel during with each integer value in j gets 0 to 6 in i row pixel 1the absolute value Abs_min (i) ' of a value of absolute value minimum in (j+1, i);
S706, utilizes the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i) and absolute value Abs_min (i) ', the second order difference pixel value diff of j+1 pixel in calculating i row pixel 2(j+1, i).Particularly, if the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i) > 0, code length acquiring unit 302 passes through the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i) and absolute value Abs_min (i) ' subtract each other to obtain the second order difference pixel value diff of j+1 pixel in i row pixel 2(j+1, i), that is, and diff 2(j+1, i)=diff 1(j+1, i)-Abs_min (i) ', otherwise code length acquiring unit 302 passes through the first difference pixel value diff of j+1 pixel in i row pixel 1(j+1, i) and absolute value Abs_min (i) ' phase Calais obtains the second order difference pixel value diff of j+1 pixel in i row pixel 2(j+1, i), that is, and diff 2(j+1, i)=diff 1(j+1, i)+Abs_min (i) ';
S708, by by the pixel value P of the 0th pixel in i row pixel 0, ihuffman code length (8 bit), each integer value in j gets 0 to 6 time j+1 pixel in i row pixels second order difference pixel value diff 2the Huffman code length Huf_H of (j+1, i) j+1, i, and the Huffman code length Abs_V (i) of absolute value Abs_min (i) ' be added, obtain the Huffman code length Sum_V (i) of i row pixel,
Figure GSA00000056731300071
Shown in Fig. 7 obtain 8*8 block of pixels in the process of Huffman code length of i row pixel, can think the pixel value P of the 0th pixel in i row pixel 0, ifirst difference pixel value and the second order difference pixel value of the 0th pixel in i row pixel.In this case, can think that absolute value Abs_min (i) ' is the least absolute value in the absolute value of the first difference pixel value of all pixels in i row pixel in 8*8 block of pixels, and think that the Huffman code length Sum_V (i) of i row pixel is the Huffman code length sum of Huffman code length and the absolute value Abs_min (i) ' of the second order difference pixel value of all pixels in i row pixel.
Fig. 9 shows according to the block diagram of the realization example of the image compression system of the embodiment of the present invention.As shown in Figure 9, code length acquiring unit 302 comprises horizontal direction code length acquiring unit 3022 and vertical direction code length acquiring unit 3024.Wherein, in horizontal and vertical direction encoding length acquiring unit, all comprise first difference unit, second order difference unit, pixel value memory cell and coding unit.
In the horizontal direction in code length acquiring unit, step S502 in first difference unit execution graph 5, step S504 and S506 in second order difference unit execution graph 5, the pixel value of the 0th pixel in the capable pixel of pixel value cell stores i, coding unit is encoded to the second order difference pixel value of the pixel value of the 0th pixel in the capable pixel of i and 1st~7 pixels in the capable pixel of i.
In the vertical direction in code length acquiring unit, step S702 in first difference unit execution graph 7, step S704 and S706 in second order difference unit execution graph 7, the pixel value of the 0th pixel in pixel value cell stores i row pixel, coding unit is encoded to the second order difference pixel value of the pixel value of the 0th pixel in i row pixel and 1st~7 pixels in i row pixel.
By the present invention, can be compressed to reference to frame the 30%-50% of original data volume, thereby reduce capacity and reduction bandwidth for the memory of reference frame.
Below with reference to specific embodiments of the invention, the present invention has been described, but those skilled in the art all understand, can carry out various modifications, combination and change to these specific embodiments, and can not depart from the spirit and scope of the present invention that limited by claims or its equivalent.
Can perform step with hardware or software as required.Note, without departing from the scope of the invention, can add step, therefrom remove step or revise step wherein to the flow chart providing in this specification.In general, flow chart is just used to refer to a kind of possible sequence for the basic operation of practical function.
Embodiments of the invention can utilize programming general purpose digital computer, utilize application-specific integrated circuit (ASIC), programmable logic device, field programmable gate array, light, chemistry, biological, system quantum or nanometer engineering, assembly and mechanism to realize.In general, function of the present invention can be realized by any means known in the art.Can use distributed or networked system, assembly and circuit.The communication of data or to transmit can be wired, wireless or by any other means.
Also will recognize, according to the needs of application-specific, one or more can the realization by more separated or more integrated mode in the key element shown in accompanying drawing, or be removed even in some cases or be deactivated.The journey logic bomb that realization can be stored in machine readable media is carried out above-mentioned any method with permission computer, also within the spirit and scope of the present invention.
In addition, it is only exemplary that any signal arrows in accompanying drawing should be considered to, rather than restrictive, unless separately there is concrete indication.When term is also contemplated as when the ability of separation or combination is not known, the combination of assembly or step also will be considered to record.

Claims (10)

1. a method for compressing image, comprising:
Obtain the Huffman code length of 8*8 block of pixels under horizontal compression pattern and the Huffman code length under vertical shrink mode;
If the Huffman code length of described 8*8 block of pixels under described horizontal compression pattern is greater than the Huffman code length of described 8*8 block of pixels under described vertical shrink mode, using described 8*8 block of pixels the Huffman coding result under described vertical shrink mode as the image compression result of described 8*8 block of pixels, otherwise the Huffman coding result using described 8*8 block of pixels under described horizontal compression pattern is as the image compression result of described 8*8 block of pixels, wherein
The processing of obtaining the Huffman code length of described 8*8 block of pixels under described horizontal compression pattern comprises:
Obtain the Huffman code length of each row pixel in described 8*8 block of pixels;
Using the stack result of the Huffman code length of each row pixel in described 8*8 block of pixels as described 8*8 block of pixels the Huffman code length under described horizontal compression pattern,
The processing of obtaining the Huffman code length of the capable pixel of i in described 8*8 block of pixels comprises:
By by the pixel value P of j+1 pixel in the capable pixel of described i i, j+1pixel value P with j pixel in the capable pixel of described i i, jsubtract each other, obtain the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1), wherein i and j are integer, and 0≤i≤7,0≤j≤6;
Obtain the pixel value P of the 0th pixel in the capable pixel of described i i, 0the first difference pixel value diff of j+1 pixel described in during with each integer value in j gets 0 to 6 in the capable pixel of i 1the absolute value Abs_min (i) of a value of absolute value minimum in (i, j+1);
Utilize the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i), calculate the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1); And
By by the pixel value P of the 0th pixel in the capable pixel of described i i, 0huffman code length, each integer value in j gets 0 to 6 time described in the second order difference pixel value diff of j+1 pixel in the capable pixel of i 2the Huffman code length of the Huffman code length of (i, j+1) and described absolute value Abs_min (i) is added, and obtains the Huffman code length of the capable pixel of described i.
2. method for compressing image according to claim 1, is characterized in that,
If the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) > 0, passes through the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i) subtract each other to obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1);
If the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1)≤0, passes through the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i) phase Calais obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1).
3. method for compressing image according to claim 1, is characterized in that, the processing of obtaining the Huffman code length of described 8*8 block of pixels under described vertical shrink mode comprises:
Obtain the Huffman code length of each row pixel in described 8*8 block of pixels;
Using the stack result of the Huffman code length of each row pixel in described 8*8 block of pixels as described 8*8 block of pixels the Huffman code length under described vertical shrink mode.
4. method for compressing image according to claim 3, is characterized in that, the processing of obtaining the Huffman code length of the i row pixel in described 8*8 block of pixels comprises:
By by the pixel value P of j+1 pixel in described i row pixel j+1, ipixel value P with j pixel in described i row pixel j, isubtract each other, obtain the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i), wherein i and j are integer, and 0≤i≤7,0≤j≤6;
Obtain the pixel value P of the 0th pixel in described i row pixel 0, ithe first difference pixel value diff of j+1 pixel described in during with each integer value in j gets 0 to 6 in i row pixel 1the absolute value Abs_min (i) ' of a value of absolute value minimum in (j+1, i);
Utilize the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ', calculate the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i); And
By by the pixel value P of the 0th pixel in described i row pixel 0, ihuffman code length, each integer value in j gets 0 to 6 time described in the second order difference pixel value diff of j+1 pixel in i row pixel 2the Huffman code length of the Huffman code length of (j+1, i) and described absolute value Abs_min (i) ' is added, and obtains the Huffman code length of described i row pixel.
5. method for compressing image according to claim 4, is characterized in that,
If the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) > 0, passes through the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ' subtract each other to obtain the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i);
If the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i)≤0, passes through the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ' phase Calais obtain the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i).
6. an image compression system, comprising:
Code length acquiring unit, is configured to obtain the Huffman code length of 8*8 block of pixels under horizontal compression pattern and the Huffman code length under vertical shrink mode;
Compression result selected cell, if be configured to the Huffman code length of described 8*8 block of pixels under described horizontal compression pattern, be greater than the Huffman code length of described 8*8 block of pixels under described vertical shrink mode, using described 8*8 block of pixels the Huffman coding result under described vertical shrink mode as the image compression result of described 8*8 block of pixels, otherwise the Huffman coding result using described 8*8 block of pixels under described horizontal compression pattern is as the image compression result of described 8*8 block of pixels, wherein
The processing that described code length acquiring unit obtains the Huffman code length of described 8*8 block of pixels under described horizontal compression pattern comprises:
Obtain the Huffman code length of each row pixel in described 8*8 block of pixels;
Using the stack result of the Huffman code length of each row pixel in described 8*8 block of pixels as described 8*8 block of pixels the Huffman code length under described horizontal compression pattern,
The processing that described code length acquiring unit obtains the Huffman code length of the capable pixel of i in described 8*8 block of pixels comprises:
By by the pixel value P of j+1 pixel in the capable pixel of described i i, j+1pixel value P with j pixel in the capable pixel of described i i, jsubtract each other, obtain the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1), wherein i and j are integer, and 0≤i≤7,0≤j≤6;
Obtain the pixel value P of the 0th pixel in the capable pixel of described i i, 0the first difference pixel value diff of j+1 pixel described in during with each integer value in j gets 0 to 6 in the capable pixel of i 1the absolute value Abs_min (i) of a value of absolute value minimum in (i, j+1);
Utilize the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i), calculate the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1); And
By by the pixel value P of the 0th pixel in the capable pixel of described i i, 0huffman code length, each integer value in j gets 0 to 6 time described in the second order difference pixel value diff of j+1 pixel in the capable pixel of i 2the Huffman code length of the Huffman code length of (i, j+1) and described absolute value Abs_min (i) is added, and obtains the Huffman code length of the capable pixel of described i.
7. image compression system according to claim 6, is characterized in that,
If the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) > 0, described code length acquiring unit passes through the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i) subtract each other to obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1);
If the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1)≤0, described code length acquiring unit passes through the first difference pixel value diff of j+1 pixel in the capable pixel of described i 1(i, j+1) and described absolute value Abs_min (i) phase Calais obtain the second order difference pixel value diff of j+1 pixel in the capable pixel of described i 2(i, j+1).
8. image compression system according to claim 6, is characterized in that, the processing that described code length acquiring unit obtains the Huffman code length of described 8*8 block of pixels under described vertical shrink mode comprises:
Obtain the Huffman code length of each row pixel in described 8*8 block of pixels;
Using the stack result of the Huffman code length of each row pixel in described 8*8 block of pixels as described 8*8 block of pixels the Huffman code length under described vertical shrink mode.
9. image compression system according to claim 8, is characterized in that, the processing that described code length acquiring unit obtains the Huffman code length of the i row pixel in described 8*8 block of pixels comprises:
By by the pixel value P of j+1 pixel in described i row pixel j+1, ipixel value P with j pixel in described i row pixel j, isubtract each other, obtain the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i), wherein i and j are integer, and 0≤i≤7,0≤j≤6;
Obtain the pixel value P of the 0th pixel in described i row pixel 0, ithe first difference pixel value diff of j+1 pixel described in during with each integer value in j gets 0 to 6 in i row pixel 1the absolute value Abs_min (i) ' of a value of absolute value minimum in (j+1, i);
Utilize the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ', calculate the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i); And
By by the pixel value P of the 0th pixel in described i row pixel 0, ihuffman code length, each integer value in j gets 0 to 6 time described in the second order difference pixel value diff of j+1 pixel in i row pixel 2the Huffman code length of the Huffman code length of (j+1, i) and described absolute value Abs_min (i) ' is added, and obtains the Huffman code length of described i row pixel.
10. image compression system according to claim 9, is characterized in that,
If the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) > 0, described code length acquiring unit passes through the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ' subtract each other to obtain the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i);
If the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i)≤0, described code length acquiring unit passes through the first difference pixel value diff of j+1 pixel in described i row pixel 1(j+1, i) and described absolute value Abs_min (i) ' phase Calais obtain the second order difference pixel value diff of j+1 pixel in described i row pixel 2(j+1, i).
CN201010142134.9A 2010-04-02 2010-04-02 Image compressing method and system Expired - Fee Related CN102215384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010142134.9A CN102215384B (en) 2010-04-02 2010-04-02 Image compressing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010142134.9A CN102215384B (en) 2010-04-02 2010-04-02 Image compressing method and system

Publications (2)

Publication Number Publication Date
CN102215384A CN102215384A (en) 2011-10-12
CN102215384B true CN102215384B (en) 2014-03-26

Family

ID=44746481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010142134.9A Expired - Fee Related CN102215384B (en) 2010-04-02 2010-04-02 Image compressing method and system

Country Status (1)

Country Link
CN (1) CN102215384B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517068B (en) * 2012-06-21 2016-12-07 富士通株式会社 Method for compressing image and device
WO2021120067A1 (en) * 2019-12-18 2021-06-24 深圳市大疆创新科技有限公司 Data encoding method, data decoding method, data processing method, encoder, decoder, system, movable platform, and computer-readable medium
CN114640857B (en) * 2022-05-06 2023-05-12 江苏游隼微电子有限公司 Image compression method and 3D noise reduction method based on improved Huffman coding

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1124025C (en) * 1998-11-27 2003-10-08 无敌科技(西安)有限公司 Bidirectional image compression method
KR20060008523A (en) * 2004-07-21 2006-01-27 삼성전자주식회사 Method and apparatus for intra prediction of video data
JP5074924B2 (en) * 2004-09-16 2012-11-14 トムソン ライセンシング Fast mode decision method and apparatus for interframe
KR100727969B1 (en) * 2005-08-27 2007-06-14 삼성전자주식회사 Apparatus for encoding and decoding image, and method theroff, and a recording medium storing program to implement the method
AU2006320064B2 (en) * 2005-11-30 2010-09-09 Kabushiki Kaisha Toshiba Image encoding/image decoding method and image encoding/image decoding apparatus
CN101247525B (en) * 2008-03-24 2010-06-02 北京邮电大学 Method for improving image intraframe coding velocity
CN101610417B (en) * 2009-07-09 2013-06-12 华为技术有限公司 Image filling method, device and equipment
CN101640802B (en) * 2009-08-28 2012-06-20 北京工业大学 Video inter-frame compression coding method based on macroblock features and statistical properties

Also Published As

Publication number Publication date
CN102215384A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
US8351502B2 (en) Method and apparatus for adaptively selecting context model for entropy coding
CA2842551C (en) Signal processing and inheritance in a tiered signal quality hierarchy
CN109246436B (en) Method and apparatus for encoding or decoding image, and storage medium
US11006149B2 (en) Non-transform coding
TWI650012B (en) Apparatus, method, and storage medium for data encoding and decoding
US20080089413A1 (en) Moving Image Encoding Apparatus And Moving Image Encoding Method
CA2543947A1 (en) Method and apparatus for adaptively selecting context model for entropy coding
CN104038762A (en) Video Encoder, Method Of Detecting Scene Change And Method Of Controlling Video Encoder
KR20180069818A (en) Entropy Coding Techniques for Display Stream Compression (DSC) of Non-4: 4: 4 Chroma Sub-Sampling
CN104919798A (en) Method and apparatus of quantization matrix coding
CN104350752A (en) In-loop filtering for lossless coding mode in high efficiency video coding
CN111684810A (en) Data encoding and decoding
CN104104967A (en) Image processing apparatus and image processing method
JP2015170994A (en) Image processor and method, image encoder and method, and image decoder and method
US20130077886A1 (en) Image decoding apparatus, image coding apparatus, image decoding method, image coding method, and program
CN102215384B (en) Image compressing method and system
US7020342B1 (en) Scalable coding
CN102342107A (en) Image Processing Device And Method
CN102026002A (en) Downsampling transcoding method and device of frame rate, vector reconstruction method and device thereof
US10536697B2 (en) Method for re-encoding image and apparatus therefor
CN115567710A (en) Data encoding method and apparatus, and method and apparatus for decoding data stream
US20080095240A1 (en) Method for interpolating chrominance signal in video encoder and decoder
US20090067492A1 (en) Method and Device for Minimizing a Quantization Errror
US11558609B2 (en) Image data encoding and decoding
US6577773B1 (en) Method and arrangement for quantizing data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140326

Termination date: 20180402