CN101494788B - Method and apparatus for compressing and decompressing video image - Google Patents

Method and apparatus for compressing and decompressing video image Download PDF

Info

Publication number
CN101494788B
CN101494788B CN 200910105281 CN200910105281A CN101494788B CN 101494788 B CN101494788 B CN 101494788B CN 200910105281 CN200910105281 CN 200910105281 CN 200910105281 A CN200910105281 A CN 200910105281A CN 101494788 B CN101494788 B CN 101494788B
Authority
CN
China
Prior art keywords
pixel point
color component
pixel
value
component value
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
CN 200910105281
Other languages
Chinese (zh)
Other versions
CN101494788A (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.)
JUCAI MICRO DEVICES (SHENZHEN) CO Ltd
Original Assignee
JUCAI MICRO DEVICES (SHENZHEN) 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 JUCAI MICRO DEVICES (SHENZHEN) CO Ltd filed Critical JUCAI MICRO DEVICES (SHENZHEN) CO Ltd
Priority to CN 200910105281 priority Critical patent/CN101494788B/en
Publication of CN101494788A publication Critical patent/CN101494788A/en
Application granted granted Critical
Publication of CN101494788B publication Critical patent/CN101494788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention is applied to the image processing technology, provides an image pixel point compression/decompression method and device. The image pixel point compression method includes: acquiring the color component value of the current pixel point and color component values pf the adjacent pixel points; comparing the color component value of the current pixel point and color component values pf the adjacent pixel points, to yield a comparative result; determining the corresponding compression mode of the current pixel point based on the comparative result; compressing the color component value of the current pixel point based on the corresponding compression mode of the current pixel point, to complete the compression of pixel points in the image. The image pixel point decompression method obtains the color component value of the current pixel point based on the compressing value and mode value of the current pixel point and the color component value of the adjacent pixel points, to complete the decompression of pixel points in the image. The invention realizes the line-by-line lossless compression and decompression of frames, for greatly diminishing the required band-width of system when applied to the image display system, and then hardware realizes low cost and low-power consumption.

Description

The compressing/decompressing method of video image and device
Technical field
The invention belongs to technical field of video image processing, relate in particular to the compressing/decompressing method and the device of video image pixel.
Background technology
Video compression technology is applied in many products, comprise digital versatile disc (DigitalVersatile Disc, DVD), Digital Television, personal video recorder, internet video, multimedia automatic record player, shooting mobile phone, personal digital assistant (Personal Digital Assistant, PDA) and video camera etc.
Present stage maturation the image/video compress technique in, compression method mainly comprises dual mode: based on the compress mode of macro block with based on the compress mode of scan line, Joint Photographics Expert Group JPEG (JointPhotographic Experts Group for example, JPEG), h264 is based on the compression method of macro block, but can not realize real-time output, and JPEG (joint photographic experts group)-lossless format (Joint Photographic Experts GroupLossless, JPEG-LS), lossless image coding (Context-Based, Adaptive, Lossless ImageCoding, CALIC) though etc. can realize real-time output based on the compression method of scan line, generally need 2 row or the above row cache of 2 row, code used method is variable-length encoding, and need prediction in the cataloged procedure, process is complicated, needs a large amount of computings, no matter from central processing unit (Central ProcessingUnit, CPU) realization or special hardware are realized, all need high hardware cost and power consumption cost.
Be example with JPEG-LS specifically, the JPEG-LS cataloged procedure mainly comprises prediction, context modeling and entropy coding.In the JPEG-LS compression algorithm, need obtain four neighbor pixels line correlation of going forward side by side to the compressed encoding of a pixel calculates, and cataloged procedure need depend on context, when realizing, hardware generally needs 2 row or the above row cache of 2 row, process is complicated, operand is bigger, and hardware implementation cost is higher.
In addition, in the process of Computer Image Processing, in internal memory, have a slice special region, be responsible for the buffering of image output specially, be commonly called as frame buffer (frame buffer).In traditional way, because frame buffer need realize that the scan line of real-time refreshes output, frame buffer can not be carried out compression and handle, the required demonstration broader bandwidth of conventional method when this moment, high-definition image showed.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of compressing/decompressing method that is used for video decompression system video image pixel, be intended to realize that image compresses back output in real time line by line, and the hardware implementation cost low-power consumption is little, and the average bandwidth that image is shown reduces.
The embodiment of the invention is to realize like this, a kind of compression method that is used for pixel in the video decompression system video image, described image comprises a plurality of pixels, the current point that compresses processing is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Described method is used for judging the compress mode of described current pixel point by the color component value of the described pixel in the described image, thereby finishes the compression to described image; Said method comprising the steps of: obtain the color component value of current pixel point and the color component value of neighbor pixel thereof; The color component value of more described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result; According to described comparative result, judge the compact model of current pixel point correspondence; Compact model according to described current pixel point correspondence compresses the color component value of described current pixel point, obtains the compressed value of described current pixel point, finishes the compression to pixel in the described image;
Wherein:
Described color component value is red color component value, green component values and the blue component value of pixel; The color component value of described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result and comprise:
When described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
When described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
When described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
Described compact model is 2 compact models, 8 compact models or 12 compact models or zero compression pattern, and is described according to described comparative result, judges that the compact model of current pixel point correspondence comprises:
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
The red color component value of described current pixel point equals the red color component value of described neighbor pixel; The blue component value of described current pixel point equals the blue component value of described neighbor pixel simultaneously; And the green component values of described current pixel point equals the green component values of described neighbor pixel;
The compact model of then described current pixel point correspondence is 2 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If it is non-vanishing that the red color component value of described current pixel point deducts the result that red color component value drew of described neighbor pixel, and more than or equal to-2, smaller or equal to 1; It is non-vanishing that simultaneously the blue component value of described current pixel point deducts the result that the blue component value of described neighbor pixel drawn, and more than or equal to-2, smaller or equal to 1; And it is non-vanishing that the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel, and more than or equal to-4, smaller or equal to 3;
The compact model of then described current pixel point correspondence is 8 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If the result that red color component value drew that the red color component value of described current pixel point deducts described neighbor pixel is more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; Simultaneously the blue component value of described current pixel point deducts result that the blue component value of described neighbor pixel drawn more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; And the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel more than or equal to-8, less than-4, or greater than 3, smaller or equal to 7;
The compact model of then described current pixel point correspondence is 12 compact models;
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, if the compact model of described current pixel point correspondence is not 2 compact models or 8 compact models or 12 compact models, the compact model of then described current pixel point correspondence is the zero compression pattern;
The described compressed value that obtains described current pixel point comprises: when the compact model of described current pixel point correspondence was 2 compact models, the compressed value of described current pixel point was empty; When the compact model of described current pixel point correspondence was 8 compact models, the compressed value of described current pixel point was the resulting difference of color component value that the color component value of described current pixel point deducts described neighbor pixel; When the compact model of described current pixel point correspondence was 12 compact models, the compressed value of described current pixel point was the resulting difference of color component value that the color component value of described current pixel point deducts described neighbor pixel; When the compact model of described current pixel point correspondence was the zero compression pattern, the compressed value of described current pixel point was the color component value of described current pixel point.Further, described compact model is 2 compact models, 8 compact models or 12 compact models or zero compression pattern.
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, if the compact model of described current pixel point correspondence is not 2 compact models or 8 compact models or 12 compact models, the compact model of then described current pixel point correspondence is the zero compression pattern.
Further, when there was not described neighbor pixel in described current pixel point, the described compact model of then described current pixel point correspondence was described zero compression pattern.After described compact model according to described current pixel point correspondence compresses the color component value of described current pixel point, obtain the compressed value and the mode value of described current pixel point.
Another purpose of the embodiment of the invention is to provide a kind of compression set that is used for the pixel in the video decompression system video image, be intended to realize that image compresses back output in real time line by line, and hardware implementation cost is low, power consumption is little, the particularly important is, the embodiment of the invention has greatly reduced the size of image slices vegetarian refreshments, thereby has reduced the size of image, and the average bandwidth that image is shown reduces.
For this reason, the embodiment of the invention provides a kind of compression set that is used for pixel in the video decompression system video image, described image comprises a plurality of pixels, described color component value is red color component value, green component values and the blue component value of pixel, the current point that compresses processing is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Described compression set is used for judging the compress mode of described current pixel point by the color component value of the described pixel in the described image, thereby finishes the compression to described image; Described compression set comprises: the color component value acquiring unit, be used to obtain the color component value of described pixel and the color component value of described neighbor pixel, and the color component value of the color component value of the described current pixel point that will obtain and described neighbor pixel sends to color component value comparing unit and compression unit; The color component value comparing unit is used for the color component value of more described current pixel point and the color component value of described neighbor pixel, and draws comparative result; The compact model judging unit is used for the comparative result according to described color component value comparing unit, judges the compact model of described current pixel point correspondence; Compression unit is used for according to the compact model of described current pixel point correspondence the color component value of described current pixel point being compressed;
Wherein:
Described color component value comparing unit comprises: top pixel color component value comparing unit, left pixel color component value comparing unit and top pixel, left pixel and upper left pixel point color component value comparing unit;
Described top pixel color component value comparing unit, be used for when described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
Described left pixel color component value comparing unit, be used for when described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
Described top pixel, left pixel and upper left pixel point color component value comparing unit, being used for working as described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result; If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
The compact model that described compact model judging unit is judged is 2 compact models, 8 compact models or 12 compact models or zero compression pattern; Described compact model judging unit judges that according to the comparative result of described color component value comparing unit the process of the compact model of described current pixel point correspondence is specially:
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
The red color component value of described current pixel point equals the red color component value of described neighbor pixel; The blue component value of described current pixel point equals the blue component value of described neighbor pixel simultaneously; And the green component values of described current pixel point equals the green component values of described neighbor pixel;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 2 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If it is non-vanishing that the red color component value of described current pixel point deducts the result that red color component value drew of described neighbor pixel, and more than or equal to-2, smaller or equal to 1; It is non-vanishing that simultaneously the blue component value of described current pixel point deducts the result that the blue component value of described neighbor pixel drawn, and more than or equal to-2, smaller or equal to 1; And it is non-vanishing that the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel, and more than or equal to-4, smaller or equal to 3;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 8 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If the result that red color component value drew that the red color component value of described current pixel point deducts described neighbor pixel is more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; Simultaneously the blue component value of described current pixel point deducts result that the blue component value of described neighbor pixel drawn more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; And the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel more than or equal to-8, less than-4, or greater than 3, smaller or equal to 7;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 12 compact models;
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, if the compact model of described current pixel point correspondence is not 2 compact models or 8 compact models or 12 compact models, the compact model of the described current pixel point correspondence of then described compact model judgment unit judges is the zero compression pattern;
After described compression unit compresses the color component value of described current pixel point according to the compact model of described current pixel point correspondence, obtain the compressed value of described current pixel point, detailed process is:
When the compact model of described current pixel point correspondence was 2 compact models, described compression unit obtained the compressed value of described current pixel point for empty;
When the compact model of described current pixel point correspondence was 8 compact models, the compressed value that described compression unit obtains described current pixel point was the resulting difference of color component value that the color component value of described current pixel point deducts described neighbor pixel;
When the compact model of described current pixel point correspondence was 12 compact models, the compressed value that described compression unit obtains described current pixel point was the resulting difference of color component value that the color component value of described current pixel point deducts described neighbor pixel;
When the compact model of described current pixel point correspondence was the zero compression pattern, the compressed value that described compression unit obtains described current pixel point was the color component value of described current pixel point.
Further, the compact model judged of compact model judging unit is 2 compact models, 8 compact models or 12 compact models or zero compression pattern.
Further, also comprise the zero compression mode determination: described zero compression mode determination is used for when there is not described neighbor pixel in described current pixel point, and the described compact model of judging described current pixel point correspondence is described zero compression pattern.
Further, after compression unit compresses the color component value of described current pixel point according to the compact model of described current pixel point correspondence, obtain the compressed value and the mode value of described current pixel point.
A purpose again of the embodiment of the invention is to provide a kind of decompression method that is used for the pixel in the video decompression system video image, be intended to realize will be after overcompression data decompression.
For this reason, the embodiment of the invention provides a kind of decompression method that is used for pixel in the video decompression system video image, described image comprises a plurality of pixels, described pixel has color component value, the current point that carries out decompression is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Said method comprising the steps of:
Obtain the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel, be specially: when described neighbor pixel is the adjacent top pixel of current pixel point, obtain the color component value of the adjacent top pixel of current pixel point; When described neighbor pixel is the adjacent left pixel of current pixel point, obtain the color component value of the adjacent left pixel of current pixel point; When described neighbor pixel is the adjacent top pixel of current pixel point, left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h more than or equal to described color component difference value diff_v, then obtains the color component value of the adjacent left pixel of current pixel point; If described color component difference value diff_h is less than described color component difference value diff_v, then obtain the color component value of the adjacent top pixel of current pixel point, wherein said diff_h is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel; Described diff_v is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel, when there was not neighbor pixel in described current pixel point, then the color component value of described neighbor pixel was 0;
According to the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel, obtain the color component value of described current pixel point, finish decompress(ion) to described current pixel point; Specifically comprise: when the mode value of described current pixel point was the mode value of 2 compact model correspondences, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains; When the mode value of current pixel point was the mode value of 8 or 12 or zero compression pattern correspondence, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains and the compressed value sum of described current pixel point.
Further, according to the mode value of obtaining described current pixel point, determine the compact model of described current pixel point; Described compact model is 2 compact models or 8 compact models or 12 compact models or zero compression pattern.
Further, when there was not neighbor pixel in described current pixel point, then the color component value of described neighbor pixel was 0.
A purpose again of the embodiment of the invention is to provide a kind of decompressing device that is used for the pixel in the video decompression system video image, be intended to realize will be after overcompression data decompression.
For this reason, the embodiment of the invention provides a kind of decompressing device that is used for pixel in the video decompression system video image, described image comprises a plurality of pixels, described pixel has color component value, the current point that carries out decompression is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Described device comprises:
Current pixel point compressed value and mode value acquiring unit are used to receive the compressed value and the mode value of described current pixel point, and the compact model of described mode value correspondence is 2 compact models or 8 compact models or 12 compact models or zero compression pattern; Neighbor pixel color component value acquiring unit is used to obtain the color component value of the neighbor pixel of current pixel point; Decompression unit, be used for compressed value and mode value according to described current pixel point, and the color component value of neighbor pixel, specifically obtain the color component value of described current pixel point: when the mode value of described current pixel point is the mode value of 2 compact model correspondences by following process, the color component value of the described neighbor pixel that described decompression unit will receive is as the color component value of current pixel point; When the mode value of described current pixel point is the mode value of 8 or 12 or zero compression pattern correspondence, the compressed value sum of the color component value of the described neighbor pixel that described decompression unit will receive and described current pixel point is as the color component value of current pixel point.
Described device also comprises: the color component value judging unit, be used for when there is not neighbor pixel in described current pixel point, and the color component value of judging described neighbor pixel is 0.
Lossless Image Compression, decompression method and the device of the present invention by providing, the compression line by line of image and output have in real time been realized, and required hardware cost is low, easily realize, power consumption is little, has significantly reduced shared memory headroom and the shared system bandwidth of output procedure for displaying of frame buffer when being used for image display system.
Described and other purpose, feature and advantage of the present invention can be seen clearlyer from following detailed description of carrying out with reference to accompanying drawing.
Description of drawings
Fig. 1 is the compression method flow chart of the image slices vegetarian refreshments that provides of the embodiment of the invention;
Fig. 2 is that the pixel and the left pixel thereof of the parts of images that provides of the embodiment of the invention, the position of going up pixel and top left pixel point concern schematic diagram;
Fig. 3 is the structure chart of the compression set of the image slices vegetarian refreshments that provides of the embodiment of the invention;
Fig. 4 is the decompression method flow chart of the image slices vegetarian refreshments that provides of the embodiment of the invention;
Fig. 5 is the structure chart of the decompressing device of the image slices vegetarian refreshments that provides of the embodiment of the invention;
Fig. 6 is the transmission schematic diagram of packed data in the image slices vegetarian refreshments decompression process that provides of the embodiment of the invention;
Fig. 7 is that the mode value in the packed data that provides of the embodiment of the invention is obtained schematic diagram;
Compressed value obtained schematic diagram when Fig. 8 (a) was corresponding 8 compact models of the mode value in the packed data that provides of the embodiment of the invention;
Compressed value obtained schematic diagram when Fig. 8 (b) was corresponding 12 compact models of the mode value in the packed data that provides of the embodiment of the invention;
Fig. 9 is the calculated for pixel values schematic diagram that the embodiment of the invention provides.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention, a kind of method of the compression based on consecutive points has been proposed, in compression process, the color component value by obtaining current pixel point and the color component value of neighbor pixel thereof.The color component value of more described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result.According to described comparative result, judge the compact model of current pixel point correspondence.Compact model according to described current pixel point correspondence compresses the color component value of described current pixel point, finishes the compression to pixel in the described image.Simultaneously, the embodiment of the invention has also proposed the method that a kind of packed data that obtains at this compression method decompresses, in decompression process, and by compressed value and the mode value of obtaining described current pixel point, and the color component value of neighbor pixel; And according to the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel obtains the color component value of described current pixel point, finishes the decompress(ion) to described current pixel point.The color component value of pixel is the rgb value of pixel.
Fig. 1 shows the handling process of the compression of pixel in the image that the embodiment of the invention provides.
This compression method that is used for pixel in the video decompression system video image, described image comprises a plurality of pixels, the current point that compresses processing is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Described method is used for judging the compress mode of described current pixel point by the color component value of the described pixel in the described image, thereby finishes the compression to described image;
In step S101, obtain current pixel point and neighbor pixel thereof, and obtain the color component value of current pixel point and the color component value of neighbor pixel thereof simultaneously.
In embodiments of the present invention, the neighbor pixel of pixel comprise left pixel or go up pixel or top left pixel point in any one or a plurality of, the left pixel of pixel is in the left of going together and being adjacent with pixel; The top that the last pixel of pixel is in the pixel same column and is adjacent; The top left pixel point of pixel is in the left pixel same column of current pixel point and the top that is adjacent, and perhaps is in the left of going together and being adjacent with the last pixel of pixel.The neighbor pixel of pixel can comprise left pixel, last pixel and top left pixel point, for example when pixel for not being in the pixel of the 1st row or footline or first row or last row, perhaps the neighbor pixel of pixel can include only left pixel, for example working as pixel is the pixel that is in the 1st row the 2nd row, perhaps the neighbor pixel of pixel can include only pixel, for example working as pixel is the pixel that is in the 2nd row the 1st row, perhaps there is not neighbor pixel in pixel, and for example working as pixel is the pixel that is in first row, first row.
Fig. 2 show the parts of images that the embodiment of the invention provides pixel and left pixel thereof, go up the schematic diagram that pixel and top left pixel point position concern.
The size of this parts of images is 2*3, pixel P 1,1There is not neighbor pixel; Pixel P 1,2Neighbor pixel be P 1,2Left pixel P 1,1Pixel P 2,1Neighbor pixel be P 2,1Last pixel P 1,1Pixel P 2,2Neighbor pixel be pixel P 2,2Left pixel P 2,1, go up pixel P 1,2With top left pixel point P 1,1Pixel P 3,1Neighbor pixel be the last pixel P of pixel 2,1Pixel P 3,2Neighbor pixel be pixel P 3,2Left pixel P 3,1, go up pixel P 2,2With top left pixel point P 2,1
In step S102, the color component value of more described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result.
When described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result; Promptly obtain the difference of the rgb value of current pixel point and adjacent top pixel.
The rgb value of adjacent top pixel is up.r, up.g, up.b, and it represents red color component value, green component values and the blue component value of adjacent top pixel respectively.The rgb value of current pixel point be c.r, c.g, c.b its represent red color component value, green component values and the blue component value of current pixel point respectively.
Comparative result is c.r-up.r, c.g-up.g, c.b-up.b so.
When described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result.Promptly obtain the difference of the rgb value of current pixel point and adjacent left pixel.
The rgb value of adjacent left pixel is left.r, left.g, left.b, and it represents red color component value, green component values and the blue component value of adjacent top pixel respectively.The rgb value of current pixel point be c.r, c.g, c.b its represent red color component value, green component values and the blue component value of current pixel point respectively.
Comparative result is c.r-left.r, c.g-left.g, c.b-left.b so.
When described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result; Promptly obtain the difference of the rgb value of current pixel point and adjacent left pixel.The rgb value of adjacent left pixel is left.r, left.g, left.b, and it represents red color component value, green component values and the blue component value of adjacent top pixel respectively.The rgb value of current pixel point be c.r, c.g, c.b its represent red color component value, green component values and the blue component value of current pixel point respectively.
Comparative result is c.r-left.r, c.g-left.g, c.b-left.b so.
If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result.Promptly obtain the difference of the rgb value of current pixel point and adjacent top pixel.The rgb value of adjacent top pixel is up.r, up.g, up.b, and it represents red color component value, green component values and the blue component value of adjacent top pixel respectively.The rgb value of current pixel point be c.r, c.g, c.b its represent red color component value, green component values and the blue component value of current pixel point respectively.
Comparative result is c.r-up.r, c.g-up.g, c.b-up.b so.
Wherein, the color component difference value diff_h of described upper left pixel point and described top pixel is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel;
The color component difference value diff_v of described upper left pixel point and described left pixel is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel.
The RGB component value that is the left pixel of current pixel point is left.r, left.g, left.b, the RGB component value of last pixel is up.r, up.g, up.b, the RGB component value of top left pixel point is 1_u.r, 1_u.g, 1_u.b, when the neighbor pixel of current pixel point comprises left pixel, when last pixel and top left pixel point, according to the level error score value diff_h of formula diff_h=|l_u.r-up.r|*2+|l_u.g-up.g|+|l_u.b-up.b|*2 calculating pixel point, according to the vertical difference score value diff_v of formula diff_v=|l_u.r-left.r|*2+|l_u.g-left.g|+|l_u.b-left.b|*2 calculating pixel point.
When there was not neighbor pixel in current pixel point, the rgb value of the comparative result of current pixel point gained equaled 0.
In step S103,, judge the compact model of current pixel point correspondence according to described comparative result;
In embodiments of the present invention, judge that according to comparative result the compact model of current pixel point correspondence is: 2 compact models or 8 compact models or 12 compact models or zero compression pattern.
When the value of comparative result gained is 0, then current pixel point uses 2 compact models to compress, when the value of comparative result gained is bigger, current pixel point is used the zero compression pattern, when the difference of the rgb value of comparative result gained is less, current pixel point is used 8 compact models or 12 compact models according to the different of size of the difference of the degree of both associations and rgb value.
Concrete steps comprise: the rgb value of establishing current pixel point is (c.r, c.g, c.b), when the neighbor pixel of comparing with current pixel point was the left pixel, then the RGB component value of left pixel correspondence was (left.r, left.g, left.b), if comparative result satisfies c.r=left.r, c.g=left.g, c.b=left.b, then the compact model of current pixel point correspondence is 2 compact models; If comparative result does not satisfy c.r=left.r, c.g=left.g, c.b=left.b, it satisfies-2<=c.r-left.r<=1 again simultaneously,-4<=c.g-left.g<=3 ,-2<=c.b-left.b<=1, then the compact model of current pixel point correspondence is 8 compact models; If comparative result does not satisfy-2<=c.r-left.r<=1,-4<=c.g-left.g<=3,-2<=c.b-left.b<=1, it satisfies-4<=c.r-left.r<=3 again simultaneously,-8<=c.g-left.g<=7,-4<=c.b-left.b<=3, then the compact model of current pixel point correspondence is 12 compact models; When there was not neighbor pixel in current pixel point, the compact model of current pixel point correspondence was the zero compression pattern.
Concrete steps comprise: the rgb value of establishing current pixel point is (c.r, c.g, c.b), when the neighbor pixel of comparing with current pixel point was the top pixel, then the RGB component value of top pixel correspondence was (up.r, up.g, up.b), if comparative result satisfies c.r=up.r, c.g=up.g, c.b=up.b, then the compact model of current pixel point correspondence is 2 compact models; If comparative result does not satisfy c.r=up.r, c.g=up.g, c.b=up.b, it satisfies-2<=c.r-up.r<=1 again simultaneously ,-4<=c.g-up.g<=3 ,-2<=c.b-up.b<=1, then the compact model of current pixel point correspondence is 8 compact models; If comparative result does not satisfy-2<=c.r-up.r<=1,-4<=c.g-up.g<=3,-2<=c.b-up.b<=1, it satisfies-4<=c.r-up.r<=3 again simultaneously,-8<=c.g-up.g<=7,-4<=c.b-up.b<=3, then the compact model of current pixel point correspondence is 12 compact models; When there was not neighbor pixel in current pixel point, the compact model of current pixel point correspondence was the zero compression pattern.
In the above-described embodiments, the execution sequence of above-mentioned steps is not strict with, and two steps also can be carried out simultaneously.
In step S104, according to the compact model of described current pixel point correspondence the color component value of described current pixel point is compressed, finish compression to pixel in the described image.
The packed data of pixel comprises mode value and compressed value, in embodiments of the present invention, mode value can be provided with as required, also can obtain according to the fixed mode value of compact model correspondence, set the corresponding different compact model of different mode value, compact model according to the current pixel point correspondence, and the detailed process of preserving the packed data of current pixel point comprises: when the compact model of current pixel point correspondence is 2 compact models, the mode value of current pixel point is the mode value of 2 compact model correspondences, and compressed value is empty; When the compact model of current pixel point correspondence was 10 compact models, the mode value of current pixel point was the mode value of 10 compact model correspondences, and compressed value is the difference of the rgb value of the rgb value of the current pixel point difference basic point that deducts current pixel point; When the compact model of current pixel point correspondence was 12 compact models, the mode value of current pixel point was the mode value of 12 compact model correspondences, and compressed value is the difference of the rgb value of the rgb value of the current pixel point difference basic point that deducts current pixel point; When the compact model of current pixel point correspondence was the zero compression pattern, the mode value of current pixel point was the mode value of zero compression pattern correspondence, and compressed value is the rgb value of current pixel point.
In embodiments of the present invention, about the calculating and the storage of rgb value is that 2 system forms are carried out, the 2 system numerical representations of 2bit have 00,01,10,11, and the scope of corresponding value is-2~1 integer; The 2 system numerical representations of 3bit have 000,001,010,011,100,101,110,111, and the scope of corresponding value is-3~4 integer; The 2 system numerical representations of 4bit have 0000,0001, and 0010,0011,0100,0101,0110,0111,1000,10001,1010,1011,1100,1101, the scope of the value of 1110,1111 correspondences is the integers for-8~7; The value that 2 systems of 5bit are counted correspondence is 0~31 integer, and the scope that 2 systems of 6bit are counted the value of correspondence is 0~63 integer.In embodiments of the present invention, the storage format of the rgb value of the pixel of image is 565 forms, when the difference of rgb value that deducts the difference basic point of pixel when the rgb value of pixel is 0, then the compact model of pixel correspondence is 2 compact models, the data of pixel occupy the 2bit space, wherein mode value occupies 2bit, represents with 2 systems several 11, and compressed value is empty; The difference of rgb value that deducts the difference basic point of pixel when the rgb value of pixel is not 0 and the numerical value of R, the G of difference correspondence, B component difference all can show with the 2 system numerical tables of 2bit the time, then the compact model of pixel correspondence is 8 compact models, the data of pixel occupy the 10bit space, wherein mode value occupies 2bit, represent with 2 systems several 10, compressed value occupies 8bit, and compressed value is the 2 system numbers of difference correspondence of the rgb value of the rgb value of the pixel difference basic point that deducts pixel; R, G, the B component difference of difference correspondence of rgb value of difference basic point that deducts pixel when the rgb value of pixel be not in the 2 system numeric representation scopes at 2bit, in the time of respectively in the 2 system numeric representation scopes of 3bit, 4bit, 3bit, then the compact model of pixel correspondence is 12 compact models, the packed data of pixel occupies the 12bit space, mode value 2bit wherein, represent with 2 systems several 01, compressed value occupies 10bit, and compressed value is the 2 system numbers of difference correspondence of the rgb value of the rgb value of the pixel difference basic point that deducts pixel; When there is not the difference basic point in pixel, then the compact model of pixel correspondence is the zero compression pattern, the packed data of pixel occupies the 18bit space, wherein mode value occupies 2bit, represent with system several 00, compressed value occupies 16bit, and compressed value is 2 system numbers of the rgb value correspondence of pixel, and R, G, B component occupy 5bit, 6bit, 5bit respectively.In embodiments of the present invention, the mode value or the compressed value that show with 2 system numerical tables are man-to-man corresponding relations, but are not unique corresponding relation, also can represent by 2 systems several 10 such as 2 bit pattern values, 8 bit pattern values also can be represented with 2 systems several 01, specifically repeat no more.
Fig. 3 is the composition structure of the compression set of the image slices vegetarian refreshments that provides of the embodiment of the invention.
In embodiments of the present invention, the compressibility of image slices vegetarian refreshments comprises color component value acquiring unit 31, color component value comparing unit 32, compact model judging unit 33 and compression unit 34.
Color component value acquiring unit 31 is used to obtain the color component value of described pixel; It obtains the rgb value of current pixel point, the rgb value of neighbor pixel, and send above-mentioned rgb value to color component value comparing unit 32.
This compression set also comprises neighbor pixel recognition unit 35, is used to discern the neighbor pixel of described current pixel point; When described current pixel point did not exist adjacent left pixel and upper left pixel point, the adjacent top pixel of described neighbor pixel recognition unit identification current pixel point was described neighbor pixel; When described current pixel point did not exist adjacent top pixel and upper left pixel point, the adjacent left pixel of described neighbor pixel recognition unit identification current pixel point was described neighbor pixel; When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, adjacent top pixel, left pixel and the upper left pixel point of described neighbor pixel recognition unit identification current pixel point is described neighbor pixel.
Color component value comparing unit 32 comprises: top pixel color component value comparing unit 321, left pixel color component value comparing unit 322, and top pixel, left pixel and upper left pixel point color component value comparing unit 323.
Top pixel color component value comparing unit 321, be used for when described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result; Comparative result is c.r-up.r, c.g-up.g, c.b-up.b so.
Left pixel color component value comparing unit 322, be used for when described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result; Comparative result is c.r-left.r, c.g-left.g, c.b-left.b so.
The top pixel, left pixel and upper left pixel point color component value comparing unit 323, being used for working as described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result, comparative result is c.r-left.r, c.g-left.g, c.b-left.b so.
If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result, comparative result is c.r-up.r, c.g-up.g, c.b-up.b so.
Color component value comparing unit 32 also comprises diff_h acquiring unit 324 and diff_v325 acquiring unit;
Described diff_h acquiring unit 324, be used to obtain the color component difference value diff_h of described upper left pixel point and described top pixel, described color component difference value diff_h is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel;
Described diff_v acquiring unit 325, be used to obtain the color component difference value diff_v of described upper left pixel point and described top pixel, described color component difference value diff_v is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel.
The RGB component value that is the left pixel of current pixel point is left.r, left.g, left.b, the RGB component value of last pixel is up.r, up.g, up.b, the RGB component value of top left pixel point is 1_u.r, l_u.g, 1_u.b, when the neighbor pixel of current pixel point comprises left pixel, when last pixel and top left pixel point, according to the level error score value diff_h of formula diff_h=|l_u.r-up.r|*2+|l_u.g-up.g|+|l_u.b-up.b|*2 calculating pixel point, according to the vertical difference score value diff_v of formula diff_v=|l_u.r-left.r|*2+|l_u.g-left.g|+|l_u.b-left.b|*2 calculating pixel point.
Compact model judging unit 33 is used for the comparative result according to described color component value comparing unit, judges the compact model of described current pixel point correspondence; Detailed process repeats no more.
This compression set also comprises the zero compression mode determination: described zero compression mode determination is used for when there is not described neighbor pixel in described current pixel point, and the described compact model of judging described current pixel point correspondence is described zero compression pattern.
After compression unit 34 compresses the color component value of described current pixel point according to the compact model of described current pixel point correspondence, obtain the compressed value and the mode value of described current pixel point.Detailed process repeats no more.
In embodiments of the present invention, if h*w is the size of image, N1, N2, it is 2 compact models that N3, N4 are respectively compact model, 8 compact models, 12 compact models, the number of the pixel of zero compression pattern, the computing formula of compression ratio is (N1*2+N2*8+N3*12+N4*16)/(h*w*16), utilizes the compression method gained of the embodiment of the invention, especially at some such as figure image, in the application of game image, compression efficiency is higher, and compression ratio can reach 30%, even when compression efficiency is low, still have the compression ratio below 70%.
Fig. 4 shows the handling process of the decompression of the image slices vegetarian refreshments that the embodiment of the invention provides.
The embodiment of the invention provides the decompression method of pixel in a kind of image, described image comprises a plurality of pixels, the current point that carries out decompression is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; The packed data of pixel comprises the compressed value and the mode value of described current pixel point in the described image; The method is divided into S401 and S402, totally 2 steps:
In step S401, obtain the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel.
In embodiments of the present invention, obtain the compressed value that compression process produced and the mode value of pixel in image.Obtain the color component value of neighbor pixel simultaneously.
The color component value of its neighbor pixel is obtained the color component value of the adjacent top pixel of current pixel point when when described neighbor pixel being the adjacent top pixel of current pixel point; When described neighbor pixel is the adjacent left pixel of current pixel point, obtain the color component value of the adjacent left pixel of current pixel point; When described neighbor pixel is the adjacent top pixel of current pixel point, left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h more than or equal to described color component difference value diff_v, then obtains the color component value of the adjacent left pixel of current pixel point; If described color component difference value diff_h less than described color component difference value diff_v, then obtains the color component value of the adjacent top pixel of current pixel point.
Wherein, color component difference value diff_h=|l_u.r-up.r|*2+|l_u.g-up.g|+|l_u.b-up.b|*2; Color component difference value diff_v=|l_u.r-left.r|*2+|l_u.g-left.g|+|l_u.b-left.b|*2.
When there was not neighbor pixel in described current pixel point, then the color component value of described neighbor pixel was 0.All the other detailed processes of this step repeat no more.
In step S402, according to the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel, obtain the color component value of described current pixel point, finish decompress(ion) to described current pixel point.
In embodiments of the present invention, the packed data of the pixel that obtains in the decompression process of image slices vegetarian refreshments is with consistent with the packed data of the pixel preserved in the compression process of image slices vegetarian refreshments, the packed data of pixel comprises mode value and compressed value, since in the decompression process of image slices vegetarian refreshments in the compression process of the compact model of the mode value correspondence of pixel and image slices vegetarian refreshments the mode value of the compact model correspondence of pixel consistent, can obtain the mode value of pixel according to packed data, the compact model of mode value correspondence comprises 2 compact models or 8 compact models or 12 compact models or zero compression pattern.
Can calculate the rgb value of current pixel point according to the rgb value of the packed data of the current pixel point of obtaining and neighbor pixel, realize the decompression of packed data, concrete steps comprise: when the mode value of described current pixel point was the mode value of 2 compact model correspondences, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains; When the mode value of current pixel point was the mode value of 8 or 12 or zero compression pattern correspondence, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains and the compressed value sum of described current pixel point.
In embodiments of the present invention, when the packed data that obtains when the decompression process of image slices vegetarian refreshments used 2 system numerical tables to show, the process of rgb value that 2 system forms are obtained current pixel point was similar with the compression process of image slices vegetarian refreshments, specifically repeats no more.
Fig. 5 shows the structure of the decompressing device of the image slices vegetarian refreshments that the embodiment of the invention provides.
The decompressing device of image slices vegetarian refreshments comprises current pixel point compressed value and mode value acquiring unit 51, is used to receive the compressed value and the mode value of described current pixel point; Neighbor pixel color component value acquiring unit 52 is used to obtain the color component value of the neighbor pixel of current pixel point; Decompression unit 53 is used for compressed value and mode value according to described current pixel point, and the color component value of neighbor pixel, obtains the color component value of described current pixel point.
Current pixel point compressed value and mode value acquiring unit 51 obtaining mode values, the compact model of this mode value correspondence are 2 compact models or 8 compact models or 12 compact models or zero compression pattern.Comprise packed data acquisition module 511, serializing module 512 and delivery module 513, packed data acquisition module 511 obtains the packed data of current pixel point, the compressed data sequences of the current pixel point that serializing module 512 is obtained packed data acquisition module 511 turns to data flow and sends to delivery module 513, and delivery module 513 transmits packed datas to decompression unit 53.Packed data comprises mode value and compressed value.
Neighbor pixel color component value acquiring unit 52 comprises:
Top pixel color component value acquiring unit 521 is used for obtaining the color component value of the adjacent top pixel of current pixel point when described neighbor pixel is the adjacent top pixel of current pixel point;
Left pixel color component value acquiring unit 522 is used for obtaining the color component value of the adjacent left pixel of current pixel point when described neighbor pixel is the adjacent left pixel of current pixel point;
The top pixel, left pixel and upper left pixel point color component value acquiring unit 523, being used for working as described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h more than or equal to described color component difference value diff_v, then obtains the color component value of the adjacent left pixel of current pixel point; If described color component difference value diff_h less than described color component difference value diff_v, then obtains the color component value of the adjacent top pixel of current pixel point.
Neighbor pixel color component value acquiring unit 52 also comprises diff_h acquiring unit 524 and diff_v525 acquiring unit;
Described diff_h acquiring unit 524, be used to obtain the color component difference value diff_h of described upper left pixel point and described top pixel, described color component difference value diff_h is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel;
Described diff_v acquiring unit 525, be used to obtain the color component difference value diff_v of described upper left pixel point and described top pixel, described color component difference value diff_v is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel.
Be diff_h=|l_u.r-up.r|*2+|l_u.g-up.g|+|l_u.b-up.b|*2;
diff_v=|l_u.r-left.r|*2+|l_u.g-left.g|+|l_u.b-left.b|*2。
Decompression unit 53, compressed value and mode value according to the described current pixel point that receives current pixel point compressed value and 51 transmission of mode value acquiring unit, and the color component value of the neighbor pixel that transmits by neighbor pixel color component value acquiring unit 52, obtain the color component value of described current pixel point.
The specific implementation process repeats no more.
In embodiments of the present invention, the last pixel of current pixel point and top left pixel point are in the lastrow of the row of living in of current pixel point, the left pixel of current pixel point is in the left side of current pixel point row of living in, in order to export the rgb value of current pixel point in real time, need obtain last pixel, the top left pixel point of the current pixel point of the lastrow that is in current pixel point, and the rgb value of the left pixel of the current pixel point of going together with current pixel point.
In embodiments of the present invention, for the rgb value of real-time output pixel point line by line, packed data receiving element 51 can also comprise the transmission control module, counting module and row cache module, delivery module line by line and every row transmit the packed data of pixel from left to right, transmit the transmission progress of packed data in the control module control delivery module, the row cache module is the packed data of the pixel of the lastrow of buffer memory current line line by line, counting module is counted the packed data of the pixel of buffer memory in the row cache module, obtain the last pixel of current pixel point and the position of top left pixel point, make the last pixel of the current pixel point that pixel value and left pixel value acquisition module 521 obtain according to counting unit and the position of top left pixel point obtain the last pixel of preceding pixel point and the rgb value of top left pixel point.Left side pixel value acquisition module 522 can be a time delay module, the rgb value of buffer memory current pixel point, rgb value as the left pixel of next pixel, like this, the rgb value of last pixel, top left pixel point and the left pixel of the current pixel point that pixel value calculating unit is obtained according to last pixel value and left pixel value acquisition module 521 and left pixel value acquisition module 522 calculates the rgb value of current pixel point, and detailed process does not repeat them here.
Fig. 6 shows the transmission schematic diagram that the embodiment of the invention provides packed data in the image slices vegetarian refreshments decompression process.
In embodiments of the present invention, in the decompression process of image slices vegetarian refreshments, the packed data of the pixel that obtains is stored with 2 system number form formulas, delivery module is 2 grade of 18 bit register, transmit control unit tranmitting data register signal, control the 18 bit registers 18bit packed data that the first order 18 bit register receiving sequence modules transmit after receiving a clock signal and export original 18bit packed data to the second level 18 bit registers, the second level 18 bit registers receive the 18bit packed data of the first order 18 bit registers transmission and export to decompression unit 53.
In embodiments of the present invention, the mode value data segment of current pixel point can only obtain in 18 bit registers of the second level, and it is as follows to the detailed process of the displacement of packed data stream to control delivery module control: stride 18 bit registers or a bit just generation when the first order 18 bit registers begin to store down at the packed data of current pixel point.Packed data stream comprises pixel Pn, Pn+1, the packed data of Pn+2......, the mode value data segment of 2bit remarked pixel point wherein, the compressed value data segment of clear band remarked pixel point, the mode value data segment of Pn are in 18 bit registers of the second level, and packed data stream does not need to move; When handling the Pn+1 point, because its mode value data segment is 18 bit registers in the second level, the compressed value data segment has striden across the first order 18 bit registers and has arrived the second level 18 bit registers, so after the mode value data segment that Pn+1 is ordered is obtained by pixel value calculating unit, when pixel value calculating unit is obtained compressed value, 2 grade of 18 bit register carries out the data flow displacement, the packed data that moves is 18bit, then the packed data of the first order 18 bit registers imports in 18 bit registers of the second level, and the first order 18 bit registers continue to read in new 18bit packed data flow data from front end, so repeatedly, no longer describe in detail.
Fig. 7 shows the schematic diagram that the embodiment of the invention is obtained mode value in the packed data.
In embodiments of the present invention, the mode value data segment of current pixel point can only obtain in 18 bit registers of the second level.The data of 2 grades of 18bit delay register output 36bit are to pixel value calculating unit, and can obtaining then, the sample range of mode value data segment is 0~17 bit; Again because the space that the packed data of the pixel of different compact models occupies is the even numbers number of bits, be spaced apart 2 bits between the mode value data segment, choosing of 3~18 bits can not appear.
When Fig. 8 (a) and (b) show corresponding 8,12 compact models of mode value in the packed data respectively, the schematic diagram that obtains compressed value in the packed data that the embodiment of the invention provides.
In embodiments of the present invention, when decompression unit 53 obtained compressed value, when 2 compact models of the mode value correspondence in the packed data (scheming not shown), the compressed value data segment did not take up space; When 8 compact models of the mode value correspondence in the packed data, the compressed value data segment occupies 6bit, and R, G, B component occupy the 2bit space respectively, and the scope that may exist during sampling is at 2~23 bits; When 12 compact models of the mode value correspondence in the packed data, the compressed value data segment occupies the 10bit space, and wherein R, G, B component occupy 3bit, 4bit, 3bit space respectively, and the scope that may exist during sampling is at 2~27 bits; When the zero compression pattern of the mode value correspondence in the packed data (scheming not shown), the compressed value data segment occupies the 16bit space, and the scope that R, G, B component may exist when occupying 5bit, 6bit, 5bit spatial sampling respectively is at 2~33 bits.
Fig. 9 shows the schematic diagram of the calculated for pixel values that the embodiment of the invention provides.
Diff_h acquiring unit 901 is according to the level error score value diff_h of the rgb value calculating pixel point of the top left pixel point of current pixel point of input and last pixel, Diff_v acquiring unit 902 is according to the vertical difference score value diff_v of the rgb value calculating pixel point of the top left pixel point of pixel and left pixel, level error score value and vertical difference score value input comparison module compare, when level error score value the time greater than the vertical difference score value, neighbor pixel color component value acquiring unit 903 is selected the rgb value of the left pixel of current pixel point, otherwise then selects the rgb value of the last pixel of current pixel point.Current pixel point compressed value and mode value acquiring unit 904 extract the mode value and the compressed value of packed data respectively, the 905 pairs of employed patterns of data decompress(ion) of mode value decision decompression unit that extract, when the compact model of mode value correspondence was the zero compression pattern, decompression unit 905 was selected the rgb value of the compressed value of packed data as current pixel point; When the compact model of mode value correspondence is 2 compact models, the rgb value of the neighbor pixel of decompression unit 905 selection neighbor pixel color component value acquiring units 903 inputs is as the rgb value of current pixel point, when the compact model of mode value correspondence is 8 compact models or 12 or zero compression pattern, decompression unit 905 is selected the rgb value of the neighbor pixel of neighbor pixel color component value acquiring unit 903 inputs, with the compressed value of current pixel point compressed value and 904 inputs of mode value acquiring unit, sum of the two is as the rgb value of current pixel point.
In the embodiment of the invention, a kind of harmless method of compression and decompression line by line of image slices vegetarian refreshments has been proposed, code used method is variable-length encoding, only need the single file buffer memory to realize, the display system that Lossless Image Compression and decompression method are used for image is display image in real time, only need at display system input compressed image frame and buffer memory, output gets final product its decompression, significantly reduced shared memory headroom and the shared system bandwidth of output procedure for displaying of frame buffer, the required hardware cost of compression and decompression is low, realize that easily power consumption is little.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (14)

1. video image compressing method that is used for video compression system, described image comprises a plurality of pixels, the current point that compresses processing is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; It is characterized in that, said method comprising the steps of:
Obtain current pixel point and neighbor pixel thereof, and obtain the color component value of current pixel point and the color component value of neighbor pixel thereof simultaneously;
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result;
According to described comparative result, judge the compact model of current pixel point correspondence;
Compact model according to described current pixel point correspondence compresses the color component value of described current pixel point, obtains the compressed value of described current pixel point, finishes the compression to pixel in the described image;
Wherein:
Described color component value is red color component value, green component values and the blue component value of pixel; The color component value of described current pixel point and the color component value of neighbor pixel thereof, and draw comparative result and comprise:
When described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
When described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
When described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
The color component difference value diff_h of described upper left pixel point and described top pixel is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel;
The color component difference value diff_v of described upper left pixel point and described left pixel is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel;
Described compact model is 2 compact models, 8 compact models or 12 compact models or zero compression pattern, and is described according to described comparative result, judges that the compact model of current pixel point correspondence comprises:
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
The red color component value of described current pixel point equals the red color component value of described neighbor pixel; The blue component value of described current pixel point equals the blue component value of described neighbor pixel simultaneously; And the green component values of described current pixel point equals the green component values of described neighbor pixel;
The compact model of then described current pixel point correspondence is 2 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If it is non-vanishing that the red color component value of described current pixel point deducts the result that red color component value drew of described neighbor pixel, and more than or equal to-2, smaller or equal to 1; It is non-vanishing that simultaneously the blue component value of described current pixel point deducts the result that the blue component value of described neighbor pixel drawn, and more than or equal to-2, smaller or equal to 1; And it is non-vanishing that the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel, and more than or equal to-4, smaller or equal to 3;
The compact model of then described current pixel point correspondence is 8 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If the result that red color component value drew that the red color component value of described current pixel point deducts described neighbor pixel is more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; Simultaneously the blue component value of described current pixel point deducts result that the blue component value of described neighbor pixel drawn more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; And the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel more than or equal to-8, less than-4, or greater than 3, smaller or equal to 7;
The compact model of then described current pixel point correspondence is 12 compact models;
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, if the compact model of described current pixel point correspondence is not 2 compact models or 8 compact models or 12 compact models, the compact model of then described current pixel point correspondence is the zero compression pattern;
The described compressed value that obtains described current pixel point comprises: when the compact model of described current pixel point correspondence was 2 compact models, the compressed value of described current pixel point was empty; When the compact model of described current pixel point correspondence is 8 compact models, the compressed value of described current pixel point is that the color component value of described current pixel point deducts in the color component value of described current pixel point and the color component value of neighbor pixel thereof, and draws the resulting difference of color component value of the described neighbor pixel that subtracts each other with current pixel point in the comparative result step; When the compact model of described current pixel point correspondence is 12 compact models, the compressed value of described current pixel point is that the color component value of described current pixel point deducts in the color component value of described current pixel point and the color component value of neighbor pixel thereof, and draws the resulting difference of color component value of the described neighbor pixel that subtracts each other with current pixel point in the comparative result step; When the compact model of described current pixel point correspondence was the zero compression pattern, the compressed value of described current pixel point was the color component value of described current pixel point.
2. compression method as claimed in claim 1 is characterized in that, the described step of obtaining current pixel point and neighbor pixel thereof comprises:
When described current pixel point did not exist adjacent left pixel and upper left pixel point, described neighbor pixel was the adjacent top pixel of current pixel point;
When described current pixel point did not exist adjacent top pixel and upper left pixel point, described neighbor pixel was the adjacent left pixel of current pixel point;
When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, described neighbor pixel is the adjacent top pixel of current pixel point, left pixel and upper left pixel point.
3. compression method as claimed in claim 1 is characterized in that, described method further comprises:
When there was not neighbor pixel in described current pixel point, the described compact model of then described current pixel point correspondence was described zero compression pattern.
4. compression method as claimed in claim 1 is characterized in that, after described compact model according to described current pixel point correspondence compresses the color component value of described current pixel point, also obtains the mode value of described current pixel point.
5. video image compression device that is used for video compression system, described image comprises a plurality of pixels, described pixel has color component value, described color component value is red color component value, green component values and the blue component value of pixel, the current point that compresses processing is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; Described compression set comprises color component value acquiring unit, color component value comparing unit, compact model judging unit and compression unit, it is characterized in that:
Described color component value acquiring unit, be used to obtain the color component value of described current pixel point and the color component value of described neighbor pixel, and the color component value of the color component value of the described current pixel point that will obtain and described neighbor pixel sends to color component value comparing unit and compression unit;
Described color component value comparing unit, the color component value of the described current pixel point that the described color component value acquiring unit that is used for relatively receiving is sent and the color component value of described neighbor pixel, and the comparative result that draws sent to the compact model judging unit;
Described compact model judging unit, be used for comparative result according to the described color component value comparing unit that receives from described color component value comparing unit, judge the compact model of described current pixel point correspondence, and the described compact model that will draw sends to compression unit;
Described compression unit is used for according to the described color component value of described color component value acquiring unit transmission and the described compact model of described compact model judging unit transmission the color component value of described current pixel point being compressed;
Wherein:
Described color component value comparing unit comprises: top pixel color component value comparing unit, left pixel color component value comparing unit and top pixel, left pixel and upper left pixel point color component value comparing unit;
Described top pixel color component value comparing unit, be used for when described neighbor pixel is the adjacent top pixel of current pixel point, the color component value of the color component value of more described current pixel point and described top pixel, the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
Described left pixel color component value comparing unit, be used for when described neighbor pixel is the adjacent left pixel of current pixel point, the color component value of the color component value of more described current pixel point and described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result;
Described top pixel, left pixel and upper left pixel point color component value comparing unit, being used for working as described neighbor pixel is the adjacent top pixel of current pixel point, when left pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h is more than or equal to described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described left pixel, the red color component value of described current pixel point is deducted the red color component value of described left pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described left pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described left pixel, draw comparative result; If described color component difference value diff_h is less than described color component difference value diff_v, then compare the color component value of current pixel point and the color component value of described top pixel, then the red color component value of described current pixel point is deducted the red color component value of described top pixel, draw comparative result; Simultaneously the blue component value of described current pixel point is deducted the blue component value of described top pixel, draw comparative result; And the green component values of described current pixel point is deducted the green component values of described top pixel, draw comparative result;
Described color component value comparing unit also comprises:
The diff_h acquiring unit, be used to obtain the color component difference value diff_h of described upper left pixel point and described top pixel, described color component difference value diff_h is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel;
The diff_v acquiring unit, be used to obtain the color component difference value diff_v of described upper left pixel point and described left pixel, described color component difference value diff_v is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel;
The compact model that described compact model judging unit is judged is 2 compact models, 8 compact models or 12 compact models or zero compression pattern; Described compact model judging unit judges that according to the comparative result of described color component value comparing unit the process of the compact model of described current pixel point correspondence is specially:
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
The red color component value of described current pixel point equals the red color component value of described neighbor pixel; The blue component value of described current pixel point equals the blue component value of described neighbor pixel simultaneously; And the green component values of described current pixel point equals the green component values of described neighbor pixel;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 2 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If it is non-vanishing that the red color component value of described current pixel point deducts the result that red color component value drew of described neighbor pixel, and more than or equal to-2, smaller or equal to 1; It is non-vanishing that simultaneously the blue component value of described current pixel point deducts the result that the blue component value of described neighbor pixel drawn, and more than or equal to-2, smaller or equal to 1; And it is non-vanishing that the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel, and more than or equal to-4, smaller or equal to 3;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 8 compact models;
If described current pixel point and a described neighbor pixel compare, the comparative result that draws satisfies following three conditions:
If the result that red color component value drew that the red color component value of described current pixel point deducts described neighbor pixel is more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; Simultaneously the blue component value of described current pixel point deducts result that the blue component value of described neighbor pixel drawn more than or equal to-4, less than-2, or greater than 1, smaller or equal to 3; And the green component values of described current pixel point deducts the result that green component values drew of described neighbor pixel more than or equal to-8, less than-4, or greater than 3, smaller or equal to 7;
The compact model of the described current pixel point correspondence of then described compact model judgment unit judges is 12 compact models;
The color component value of more described current pixel point and the color component value of neighbor pixel thereof, if the compact model of described current pixel point correspondence is not 2 compact models or 8 compact models or 12 compact models, the compact model of the described current pixel point correspondence of then described compact model judgment unit judges is the zero compression pattern;
After described compression unit compresses the color component value of described current pixel point according to the compact model of described current pixel point correspondence, obtain the compressed value of described current pixel point, detailed process is:
When the compact model of described current pixel point correspondence was 2 compact models, described compression unit obtained the compressed value of described current pixel point for empty;
When the compact model of described current pixel point correspondence was 8 compact models, the compressed value that described compression unit obtains described current pixel point was the color component value of described current pixel point deducts the described neighbor pixel that subtracts each other with current pixel point in described color component value comparing unit the resulting difference of color component value;
When the compact model of described current pixel point correspondence was 12 compact models, the compressed value that described compression unit obtains described current pixel point was the color component value of described current pixel point deducts the described neighbor pixel that subtracts each other with current pixel point in described color component value comparing unit the resulting difference of color component value;
When the compact model of described current pixel point correspondence was the zero compression pattern, the compressed value that described compression unit obtains described current pixel point was the color component value of described current pixel point.
6. compression set as claimed in claim 5, it is characterized in that, described device also comprises the neighbor pixel recognition unit, is used to discern the neighbor pixel of described current pixel point, and the neighbor dot information of the described current pixel point that will identify sends to described color component value acquiring unit;
When described current pixel point did not exist adjacent left pixel and upper left pixel point, the adjacent top pixel of described neighbor pixel recognition unit identification current pixel point was described neighbor pixel;
When described current pixel point did not exist adjacent top pixel and upper left pixel point, the adjacent left pixel of described neighbor pixel recognition unit identification current pixel point was described neighbor pixel;
When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, adjacent top pixel, left pixel and the upper left pixel point of described neighbor pixel recognition unit identification current pixel point is described neighbor pixel.
7. compression set as claimed in claim 5 is characterized in that, described device comprises the zero compression mode determination:
Described zero compression mode determination is used for when there is not neighbor pixel in described current pixel point, and the described compact model of judging described current pixel point correspondence is described zero compression pattern.
8. compression set as claimed in claim 5 is characterized in that, after described compression unit compresses the color component value of described current pixel point according to the compact model of described current pixel point correspondence, also obtains the mode value of described current pixel point.
9. video image decompression method that is used for video decompression system, described image comprises a plurality of pixels, described pixel has color component value, described color component value is red color component value, green component values and the blue component value of pixel, the current point that carries out decompression is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; The packed data of described current pixel point comprises compressed value and mode value, it is characterized in that, said method comprising the steps of:
Obtain the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel, wherein, the described color component value of obtaining neighbor pixel is specially: when described current pixel point does not exist adjacent left pixel and upper left pixel point, obtain the color component value of the adjacent top pixel of current pixel point; When described current pixel point does not exist adjacent top pixel and upper left pixel point, obtain the color component value of the adjacent left pixel of current pixel point; When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h more than or equal to described color component difference value diff_v, then obtains the color component value of the adjacent left pixel of current pixel point; If described color component difference value diff_h is less than described color component difference value diff_v, then obtain the color component value of the adjacent top pixel of current pixel point, wherein said diff_h is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel; Described diff_v is following three's sum: 2 times of the absolute value of the difference of the red color component value of described upper left pixel point and described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel, when there was not neighbor pixel in described current pixel point, then the color component value of described neighbor pixel was 0;
According to the compressed value and the mode value of described current pixel point, and the color component value of neighbor pixel, obtain the color component value of described current pixel point, finish decompress(ion) to described current pixel point; Specifically comprise: when the mode value of described current pixel point was the mode value of 2 compact model correspondences, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains; When the mode value of current pixel point was the mode value of 8 compact models or 12 compact models or zero compression pattern correspondence, the color component value of current pixel point was the color component value of the described neighbor pixel that obtains and the compressed value sum of described current pixel point.
10. decompression method as claimed in claim 9 is characterized in that:
When described current pixel point did not exist adjacent left pixel and upper left pixel point, described neighbor pixel was the adjacent top pixel of current pixel point;
When described current pixel point did not exist adjacent top pixel and upper left pixel point, described neighbor pixel was the adjacent left pixel of current pixel point;
When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, described neighbor pixel is the adjacent top pixel of current pixel point, left pixel and upper left pixel point.
11. decompression method as claimed in claim 9 is characterized in that, according to the mode value of the described current pixel point of obtaining, determines the compact model of described current pixel point; Described compact model is 2 compact models or 8 compact models or 12 compact models or zero compression pattern.
12. decompressing device that is used for the video decompression system video image, described image comprises a plurality of pixels, described pixel has color component value, described color component value is red color component value, green component values and the blue component value of pixel, the current point that carries out decompression is a current pixel point in the described pixel, with described current pixel point adjacent pixels point be neighbor pixel, described neighbor pixel comprises one or more in left pixel, top pixel and the upper left pixel point adjacent with current pixel point; It is characterized in that described device comprises:
Current pixel point compressed value and mode value acquiring unit are used to receive the compressed value and the mode value of described current pixel point, and described compressed value and mode value are sent to decompression unit; The compact model of described mode value correspondence is 2 compact models or 8 compact models or 12 compact models or zero compression pattern;
Neighbor pixel color component value acquiring unit is used to obtain the color component value of the neighbor pixel of current pixel point;
Decompression unit, be used for compressed value and mode value according to the described current pixel point that receives from described current pixel point compressed value and mode value acquiring unit, and the color component value of the neighbor pixel that receives from described neighbor pixel color component value acquiring unit, specifically obtain the color component value of described current pixel point: when the mode value of described current pixel point is the mode value of 2 compact model correspondences by following process, the color component value of the described neighbor pixel that described decompression unit will receive is as the color component value of current pixel point; When the mode value of described current pixel point is the mode value of 8 compact models or 12 compact models or zero compression pattern correspondence, the compressed value sum of the color component value of the described neighbor pixel that described decompression unit will receive and described current pixel point is as the color component value of current pixel point; Wherein, described neighbor pixel color component value acquiring unit comprises:
Top pixel color component value acquiring unit is used for obtaining the color component value of the adjacent top pixel of current pixel point when described current pixel point does not exist adjacent left pixel and upper left pixel point;
Left pixel color component value acquiring unit is used for obtaining the color component value of the adjacent left pixel of current pixel point when described current pixel point does not exist adjacent top pixel and upper left pixel point;
The top pixel, left pixel and upper left pixel point color component value acquiring unit, be used for having adjacent left pixel when described current pixel point, when top pixel and upper left pixel point, obtain the color component difference value diff_h of described upper left pixel point and described top pixel, and obtain the color component difference value diff_v of described upper left pixel point and described left pixel, if described color component difference value diff_h more than or equal to described color component difference value diff_v, then obtains the color component value of the adjacent left pixel of current pixel point; If described color component difference value diff_h less than described color component difference value diff_v, then obtains the color component value of the adjacent top pixel of current pixel point;
Described neighbor pixel color component value acquiring unit also comprises:
The diff_h acquiring unit, be used for obtaining 2 times of absolute value of described upper left pixel point and the difference of the red color component value of described top pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described top pixel, the absolute value of the difference of the green component values of described upper left pixel point and described top pixel; And definite three's sum is the color component difference value diff_h of described upper left pixel point and described top pixel;
The diff_v acquiring unit, be used for obtaining 2 times of absolute value of described upper left pixel point and the difference of the red color component value of described left pixel, 2 times of the absolute value of the difference of the blue component value of described upper left pixel point and described left pixel, the absolute value of the difference of the green component values of described upper left pixel point and described left pixel; And definite three's sum is the color component difference value diff_v of described upper left pixel point and described left pixel.
13. decompressing device as claimed in claim 12 is characterized in that:
When described current pixel point did not exist adjacent left pixel and upper left pixel point, described neighbor pixel was the adjacent top pixel of current pixel point;
When described current pixel point did not exist adjacent top pixel and upper left pixel point, described neighbor pixel was the adjacent left pixel of current pixel point;
When there is adjacent left pixel in described current pixel point, when top pixel and upper left pixel point, described neighbor pixel is the adjacent top pixel of current pixel point, left pixel and upper left pixel point.
14. decompressing device as claimed in claim 12 is characterized in that, described device comprises:
The color component value judging unit is used for when there is not neighbor pixel in described current pixel point, and the color component value of judging described neighbor pixel is 0.
CN 200910105281 2009-01-23 2009-01-23 Method and apparatus for compressing and decompressing video image Active CN101494788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910105281 CN101494788B (en) 2009-01-23 2009-01-23 Method and apparatus for compressing and decompressing video image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910105281 CN101494788B (en) 2009-01-23 2009-01-23 Method and apparatus for compressing and decompressing video image

Publications (2)

Publication Number Publication Date
CN101494788A CN101494788A (en) 2009-07-29
CN101494788B true CN101494788B (en) 2011-07-27

Family

ID=40925144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910105281 Active CN101494788B (en) 2009-01-23 2009-01-23 Method and apparatus for compressing and decompressing video image

Country Status (1)

Country Link
CN (1) CN101494788B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986385B (en) * 2010-11-15 2012-11-14 深圳市洲明科技股份有限公司 Compressing and decompressing method of image of light emitting diode (LED) display screen
CN103096049A (en) * 2011-11-02 2013-05-08 华为技术有限公司 Video processing method and system and associated equipment
US8805069B2 (en) * 2012-06-12 2014-08-12 Kyocera Document Solutions Inc. Cell-based compression of digital images
CN103686330B (en) * 2013-12-30 2018-04-10 深圳Tcl新技术有限公司 The transfer approach and intelligent terminal of image between intelligent terminal
CN104869327A (en) * 2015-05-28 2015-08-26 惠州Tcl移动通信有限公司 High-definition display screen image file rapid display method and system
CN109743578B (en) * 2018-12-29 2021-08-10 惠科股份有限公司 Data processing method and data processing system
CN111614901A (en) * 2020-05-27 2020-09-01 惠州Tcl移动通信有限公司 Image shooting method and device, storage medium and terminal
CN115918104A (en) * 2020-06-05 2023-04-04 Oppo广东移动通信有限公司 Target image data generation method, electronic device, and non-transitory computer-readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5164819A (en) * 1991-04-03 1992-11-17 Music John D Method and system for coding and compressing color video signals
US6256347B1 (en) * 1996-12-17 2001-07-03 Thomson Licensing S.A. Pixel block compression apparatus in an image processing system
CN101060629A (en) * 2007-04-27 2007-10-24 华为技术有限公司 Image compression/decompression method and image coder/decoder and decoding circuit
CN101087415A (en) * 2007-06-08 2007-12-12 北京中星微电子有限公司 An image compression method and device
CN101106709A (en) * 2006-07-10 2008-01-16 逐点半导体(上海)有限公司 Image compression method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5164819A (en) * 1991-04-03 1992-11-17 Music John D Method and system for coding and compressing color video signals
US6256347B1 (en) * 1996-12-17 2001-07-03 Thomson Licensing S.A. Pixel block compression apparatus in an image processing system
CN101106709A (en) * 2006-07-10 2008-01-16 逐点半导体(上海)有限公司 Image compression method
CN101060629A (en) * 2007-04-27 2007-10-24 华为技术有限公司 Image compression/decompression method and image coder/decoder and decoding circuit
CN101087415A (en) * 2007-06-08 2007-12-12 北京中星微电子有限公司 An image compression method and device

Also Published As

Publication number Publication date
CN101494788A (en) 2009-07-29

Similar Documents

Publication Publication Date Title
CN101494788B (en) Method and apparatus for compressing and decompressing video image
US8902992B2 (en) Decoder for selectively decoding predetermined data units from a coded bit stream
US20020106019A1 (en) Method and apparatus for implementing motion detection in video compression
CN103636204A (en) Selective lossless-lossy compression of image data based on bit budget
CN101335897B (en) Image compression/decoding method and system
US20130021350A1 (en) Apparatus and method for decoding using coefficient compression
US20190082185A1 (en) Efficient lossless compression of captured raw image information systems and methods
CN106170922B (en) The source code of data and decoded device and method
US9894371B2 (en) Video decoder memory bandwidth compression
CN109889846B (en) Method and device for compressing and decompressing Demura table data and coding and decoding system
CN101142821A (en) New compression format and apparatus using the new compression format for temporarily storing image data in a frame memory
US20130251257A1 (en) Image encoding device and image encoding method
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
US6584226B1 (en) Method and apparatus for implementing motion estimation in video compression
CN104093027B (en) Joint scalar embedded graphics coding for coloured image
US20210250575A1 (en) Image processing device
CN101951524A (en) JPEG (Joint Photographic Experts Group) compression method and device of color digital image
US20090304073A1 (en) Systems and Methods for the Bandwidth Efficient Processing of Data
CN101406034B (en) Compression scheme using qualifier watermarking and apparatus using the compression scheme for temporarily storing image data in a frame memory
US9819969B2 (en) Generalization of methods and systems for image compression while encoding at least one extra bit
CN1246019A (en) System for producing decode low-resolution video signal from code high-resolution video signal
CN106296754B (en) Show data compression method and display data processing system
US9384410B2 (en) Method and system for image compression while encoding at least one extra bit
CN115150370B (en) Image processing method
US11962951B2 (en) Image signal processor, method of operating the image signal processor and image processing system including the image signal processor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant