CN1904943A - Digital image data coding method - Google Patents
Digital image data coding method Download PDFInfo
- Publication number
- CN1904943A CN1904943A CN200610029692.8A CN200610029692A CN1904943A CN 1904943 A CN1904943 A CN 1904943A CN 200610029692 A CN200610029692 A CN 200610029692A CN 1904943 A CN1904943 A CN 1904943A
- Authority
- CN
- China
- Prior art keywords
- color
- coding
- data
- piece
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Color Television Systems (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
The invention relates to a digital image data coding method. It compresses original image data to image data of small data size. The feature of the invention is that: gathering 8*8 rectangle image data block from left to right and from up to down to original image, taking data coding to every data block by color table coding and bit coding, using the coding data of high coding efficiency as the final data according to coding result. The image data has three sections: block single color table section, color table section, and block coding section. the method would gain high compressing efficiency and is suited to 16bits, 24bits and 32bits digital image compressing.
Description
Technical field
The present invention relates to a kind of method of image coding technology field, specifically is a kind of digital image data coding method.
Background technology
Along with the fast development of multimedia and Internet, view data more and more is seen everywhere.Because the original data volume of digital picture all has very huge data volume usually, the digital picture of 32 looks of one fabric width 1024 high 768 needs word 3145728 joint capacity to store, so in order to improve storage and transmitted image data efficiency, the Image Data Compression technology is that image coding technique more and more seems important.JPEG, GIF, PNG, the coding techniques of images such as BMP are the still image coding technology of using always, MPEG, H264, DIVX, XVID etc. are the moving image encoding technology of using always.GIF, JPEG, the PNG image coding technique has very high compression efficiency, and the operand of encoding is relatively also bigger, though the coding techniques of BMP image coding operand is very little but Image Data Compression be there is no too many contribution; MPEG, H264, DIVX is though the XVID coding techniques has the huge problem of compression efficiency height operand equally.
Find through literature search prior art, Application No. is: US 6,396, and 955, patent name is: Image compression and expansion device, this patent has been described a kind of codec, and method is earlier view data to be carried out discrete cosine transform, handles through quantization respectively then, the position separating treatment, packet transaction is carried out encoding process at last, finally finishes the coding of view data; The decode procedure of view data is exactly an inverse operation process to cataloged procedure.This invention is compared with the present invention, weak point is, support has the higher requirement that compares to the hardware computing power when handling view data being carried out discrete cosine transform and quantization, computational resource is expended bigger, and distortion phenomenon is inevitable behind the image coding and decoding.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, a kind of digital image data coding method is provided, make it that raw image data is compressed into the less view data of data volume, by obtaining higher compression efficiency than the lower Item computing, be applicable to 16,24,32 chromatic number word image compressions.
The present invention is by the following technical programs, the present invention at first obtains pixel 8 * 8 rectangular image data blocks to original image by from top to bottom order from left to right, with 8 * 8 video data blocks as the coding elementary cell, adopt color table coding and position coding that each data block is carried out digital coding then respectively, for undergage 8 * 8 video data blocks, when using the color table coding, supply with the color value that pixel in this piece is maximum, when using the position coding, do not need to supply.According to two kinds of coding results, get the higher coded data of code efficiency as final data.Encoded image data is divided into three parts: the monochromatic matrix section of piece, and the color table part, the block encoding part, wherein each the block encoding data in the block encoding part comprise explanation byte and coded data.The monochromatic matrix section of piece is used to store maximum 126 color values, the code index when being used for 8 * 8 image blocks and being a kind of color value.Color table partly is used to store a color table coding or a color value that coding comes out, and color value is pressed the piece sequence order and preserved.The block encoding part promptly is used for preserving the data that 8 * 8 image blocks coding back is produced; Before the data that each piece 8 * 8 image blocks coding back produces an explanation byte is arranged all.
Described color table coding, only allowing has 8 kinds of colors at most in each 8 * 8 image block, and gets 8 kinds of maximum colors of appearance in the piece, and these 8 kinds of color values are put in the color table in order; Be replaced for the color pixel point value that has more, Substitution Rules are: at first by the quantity of the pixel of usefulness that color is gathered around from how to few ordering, last a kind of color value three-primary colours red (R) green (G) blue (B) is deducted the three-primary colours of several middle color values in front respectively, addition takes absolute value difference respectively, find then and be minimum that color, just all pixel numbers certificates with last a kind of color replace to the color value that this finds, and then repeat this operation by color ordering, until number of colors is less than and equals 8 kinds, at last to have the color that is less than 4 pixels also replaced equally; Color is less than and equals 4 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 2 (bit) data; Color equals 2 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 1 (bit) data; Color is more than 4 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 3 (bit) data.
Institute rheme coding, to the pixel in each 8 * 8 image block by the color statistics, and by pixel that every kind of color has from how to the color value that sorts less; And be saved in color value in the color table in order; Begin to do following coding by color one by one from the maximum color of pixel: piece from left to right from top to bottom, with pixel is 1 (bit) data of usefulness, 1 expression of current color, it or not usefulness 1 bit data (bit) 0 expression of current color, first kind of color and byte of second kind of per 8 usefulness of color coding are preserved, per seven of the third color and later color coding are saved among low seven an of byte, Gao Yiwei is that 1 expression is a kind of beginning of color coding data, is that 0 expression is with a kind of color with previous byte code data; After first kind of color coding finished, be encoded to 0 pixel number according to by from left to right from top to bottom order rearrange in order, repeat the cataloged procedure of front then, finally finish coding.
Respectively with color table coding and position coding, the piece number of colors is less than when equaling 8 kinds, gets the less coded data of coding back data volume to same 8 * 8 image blocks; Otherwise, calculate coding back, position gained coded data byte number and deduct color table coding back gained coded data byte number, the coded data that the result then preserves the position coding less than 16 bytes, otherwise the coded data of preserving the color table coding, the coded data of Bao Cuning does not abandon.
Each block encoding data all comprises explanation byte and coded data, illustrates byte is used to illustrate what how this blocks of data encoded; Most significant digit is 0, represents that this image block has only a kind of color, and all the other seven (bit) data values are not to represent the index of this piece color value in the monochromatic table of piece at 127 o'clock, and have only the explanation byte in the coded data, is this piece color value otherwise the presentation code data preserve; Most significant digit is 1, then sees the 7th (bit), and this position is 0, represents that this image block data encodes with color table, and this position is 1, and expression is preserved the number of colors that is had in these image blocks and subtracted 1 difference for all the other low 6 with the position coding.
Color table part can secondary coding in the coded data, and with compressed digital video to greatest extent, but the present invention no longer provides this coding method.With method coded digital image of the present invention, the coded data of decoded picture is exactly the inverse process of coding, and the present invention no longer provides detailed coding/decoding method.
Description of drawings
Fig. 1 is coded data storage configuration figure
Fig. 2 is color table coding process flow diagram
Fig. 3 is a position coding process flow diagram
Fig. 4 is the digital image coding process flow diagram
Specific implementation
For a more clear understanding of the present invention, the present invention is described in further detail below in conjunction with drawings and Examples.
As shown in Figure 4, at first original image is obtained pixel 8 * 8 rectangular image data blocks by from top to bottom order from left to right, with 8 * 8 video data blocks as the coding elementary cell, carry out color table coding and position coding respectively, after coding is finished, if no more than 8 kinds of the primitive color of this piece image, then preserve the few coded data of amount of coded data, if more than 8 kinds, calculating position amount of coded data loses lustre and shows the poor of group/cording quantity, if difference is no less than 16, then preserves the color table coded data, otherwise preserve the position coded data, the coded data that is not saved abandons.Detect then and continue to take off a view data, repeat as above encoding operation, finish until last piece picture coding.
As shown in Figure 2, be color table coding process flow diagram.At first to this piece image statistics color, and count the quantity that every kind of color has pixel, check whether this piece image has only a kind of color, if a kind of color is then finished this block encoding, otherwise continue to check that whether this piece image satisfies height wide all is 8 pixels, 8 pixels of less than, it is wide to supply 8 * 8 height with the maximum color of appearance in this piece.Whether detect color in this piece then more than 8 kinds, if more than 8 kinds, then by following three steps operation:
1) then sorts to color by the pixel quantity that is had;
2) pixel with the usefulness that color is thrown away that rolls into last place replaces;
3) detect color still whether more than 8 kinds, if more than 8 kinds, circulation was returned for the 1st step and is continued operation, otherwise withdrawed from circulation.
As above the 2nd) in the step, replacement pixel point need be followed following rule: the value that the value of the three-primary colours of last a kind of color red (R) green (G) blue (B) is deducted the three-primary colours of several middle colors in front respectively, addition takes absolute value difference respectively, find then and be minimum that color, with all pixel numbers of last a kind of color according to replacing to the color value that this finds.After as above operation is finished, then cycling as follows:
A. then sort to color by the pixel quantity that is had;
B. from less to more, detect whether the color that is less than 4 pixels is arranged,, then continue the following operation of operation,, then withdraw from circulation if do not have if having by pixel that color has;
C. replace all pixel number certificates of the color that is less than 4 pixels with the method for front, returned for the 1st step then;
After finishing as cocycle, detect the present number of colours of this piece image, then use 3 (bit) digital coding more than 4 kinds, be less than 4 kinds with 2 (bit) digital coding, equal 2 kinds with 1 (bit) digital coding, the position that the pixel in this image block is sorted in front according to basic color exactly, with 1,2 or 3 location indexs of representing it, location index are since 0 radix, and the color sequence number that promptly ranks the first is 0.Per 8 are kept in the byte, and according to preserving to a high position from low level, if current byte does not have enough spaces to preserve 3 bit data, then the high position data that will not preserve is saved in the next byte.Finally finish the color table coding of this piece image.
As shown in Figure 3, be position coding process flow diagram.At first to this piece image statistics color, and count the quantity that every kind of color has pixel, sort to color by the pixel quantity that is had then, then count initialized device count is 0, cycling as follows then:
1. the color of getting sequence number and be count is a reference point;
2. if count is greater than 1, then use 7 (bit) digital coding, otherwise with 8 (bit) digital coding;
3. after will encoding, non-ly press from left to right taking out in turn from top to bottom and reorganization in order with reference to color pixel; Counter count adds 1;
4. whether detection counter count is more than or equal to this piece number of colors, and if not, then step is returned in circulation, otherwise withdraws from circulation.
In the step 2, with 8 bit data codings, be about to the color of pixel with reference to color when identical, with 1 expression of 1 (bit) data, otherwise represent that with 1 (bit) data 0 per 8 are kept in the byte, according to position preservation from low to high, byte of less than is preserved with a byte; With 7 bit data codings, making most significant digit (bit) has outside the certain sense, other all with encode with 8 bit data one to.With 7 bit data coding, most significant digit (bit) data are 1 o'clock, represent that this byte is a kind of beginning of color coding data, are 0, represent that then the color of the pixel that this byte is coded is identical with previous byte.
The color table coding is added up two kinds of amount of coded data after finishing with the position coding.Color table coding, when piece is that monochrome is, data volume is 0, otherwise coded data is made up of color value and coded data after replacing on inspection, and data volume is exactly the two byte number sum.Position coding is then color value and coded data composition, and data volume is the two byte number sum.
As shown in Figure 1, be encoded data structure figure.When color table coded data amount is 0, promptly when piece is monochrome, in the monochromatic table of piece, inquire about whether same color value is arranged, if do not have, then in showing, the piece monochrome appends new color value; The index of the value of saving colors in the monochromatic table of piece in the byte is described, finishes coding and preserve; If if no more than 8 kinds of the primitive color of this piece image, then preserve the few coded data of amount of coded data, if more than 8 kinds, calculating position amount of coded data loses lustre and shows the poor of group/cording quantity, if difference is no less than 16, then preserve the color table coded data, otherwise preserve the position coded data, the coded data that is not saved abandons.When preserving coded data, the colour sequential of piece being arranged preface is saved in the color table in order, and each piece colour sequential all follows the preservation of lastblock closely.An each block encoding data all explanation of prefix byte data are described coded message.Illustrate that the byte most significant digit is 0, represent that this image block has only a kind of color, all the other seven (bit) data values are not to represent the index of this piece color value in the monochromatic table of piece at 127 o'clock, are this piece color value otherwise the presentation code data preserve; Most significant digit is 1, then sees the 7th (bit) data, and this position is 0, represents that this image block data encodes with color table, and this position is 1, and expression is with the position coding, all the other low 6 preserve in these image blocks have number of colors and subtract 1 difference.Coded message also is to preserve in order, and each block encoding data follows last preservation closely.
Claims (6)
1. digital image data coding method, raw image data is compressed into the view data of small data quantity, it is characterized in that: original image is obtained pixel 8 * 8 rectangular image data blocks by from top to bottom order from left to right, adopt color table coding and position coding that each data block is carried out digital coding then respectively, according to coding result; get the high coded data of code efficiency as final data; encoded image data is divided into three parts: the monochromatic matrix section of piece; color table part; block encoding part, wherein each the block encoding data in the block encoding part comprise explanation byte and coded data.
2. a kind of digital image data coding method as claimed in claim 1 is characterized in that: described color table coding, and only allowing has 8 kinds of colors at most in each 8 * 8 image block, and gets 8 kinds of maximum colors of appearance in the piece, and these 8 kinds of color values are put in the color table in order; Be replaced for the color pixel point that has more, Substitution Rules are: at first by the quantity of the pixel of usefulness that color is gathered around from how to few ordering, with the value of the three-primary colours RGB of last a kind of color deduct respectively the front several in the value of three-primary colours of colors, addition takes absolute value difference respectively, find then and be minimum that color, just all pixel numbers certificates with last a kind of color replace to the color value that this finds, and then repeat this operation by color ordering, until number of colors is less than and equals 8 kinds, at last to have the color that is less than 4 pixels also replaced equally; Color is less than and equals 4 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 2 bit data; Color equals 2 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 1 bit data; Color is more than 4 kinds in the piece, and then the pixel coding is represented its index in this piece colour sequential with 3 bit data.
3. a kind of digital image data coding method as claimed in claim 1 is characterized in that: institute rheme coding, to the pixel in each 8 * 8 image block by the color statistics, and by pixel that every kind of color has from how to the color value that sorts less; And be saved in color value in the color table in order; Begin to do following coding by color one by one from the maximum color of pixel: piece from left to right from top to bottom, with pixel is that usefulness 1 bit data 1 of current color is represented, usefulness 1 bit data 0 that is not current color is represented, first kind of color and byte of second kind of per 8 usefulness of color coding are preserved, per seven of the third color and later color coding are saved among low seven an of byte, Gao Yiwei is that 1 expression is a kind of beginning of color coding data, is that 0 expression is with a kind of color with previous byte code data; After first kind of color coding finished, with being encoded to 0 pixel number according to by from left to right rearranging reorganization from top to bottom in order, repeat the cataloged procedure of front then, cycling is until finishing this piece coded image data.
4. as described a kind of digital image data coding method of claim 2 or 3, it is characterized in that: respectively with color table coding and position coding, the piece number of colors is less than when equaling 8 kinds, gets the less coded data of coding back data volume to same 8 * 8 image blocks; Otherwise, calculate coding back, position gained coded data byte number and deduct color table coding back gained coded data byte number, the coded data that the result then preserves the position coding less than 16 bytes, otherwise the coded data of preserving the color table coding.
5. a kind of digital image data coding method as claimed in claim 1 is characterized in that: described monochromatic matrix section, the color value when being used for storing 8 * 8 image blocks and having only a kind of color is at most only preserved 126 kinds of color values.
6. a kind of digital image data coding method as claimed in claim 1 is characterized in that: described explanation byte is used to illustrate what how this blocks of data encoded; Most significant digit is 0, represents that this image block has only a kind of color, and all the other seven bit data value are not to represent the index of this piece color value in the monochromatic table of piece at 127 o'clock, is this piece color value otherwise the presentation code data preserve; Most significant digit is 1, then sees the 7th bit data, and this position is 0, represents that this image block data encodes with color table, and this position is 1, and expression is with the position coding, all the other low 6 preserve in these image blocks have number of colors and subtract 1 difference.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100296928A CN100405403C (en) | 2006-08-03 | 2006-08-03 | Digital image data coding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100296928A CN100405403C (en) | 2006-08-03 | 2006-08-03 | Digital image data coding method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1904943A true CN1904943A (en) | 2007-01-31 |
CN100405403C CN100405403C (en) | 2008-07-23 |
Family
ID=37674201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100296928A Expired - Fee Related CN100405403C (en) | 2006-08-03 | 2006-08-03 | Digital image data coding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100405403C (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859511A (en) * | 2010-04-01 | 2010-10-13 | 浙江大学 | Environmental atmosphere lamp system and control method thereof |
CN102957904A (en) * | 2011-08-24 | 2013-03-06 | 上海山景集成电路技术有限公司 | Method, system and device for compressed encoding of image information |
CN105229695A (en) * | 2013-06-20 | 2016-01-06 | 英特尔公司 | The compression and decompression based on subset of graph data |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08320945A (en) * | 1995-05-25 | 1996-12-03 | Toshiba Corp | Moving image editing system and moving image reproducing system |
US6396955B1 (en) * | 1998-06-25 | 2002-05-28 | Asahi Kogaku Kogyo Kabushiki Kaisha | Image compression and expansion device |
CN1142524C (en) * | 2000-07-20 | 2004-03-17 | 南开大学 | Dynamic difference coding and decoding method |
JP2003061097A (en) * | 2001-08-09 | 2003-02-28 | Sony Corp | Image encoder and image-encoding method, recording medium and program |
CN1320809C (en) * | 2001-08-29 | 2007-06-06 | 佳能株式会社 | Picture processing device and method, and computer program and storage medium |
EP1355484B1 (en) * | 2002-04-17 | 2017-03-01 | Canon Kabushiki Kaisha | Image compression method and apparatus, and image coding method and apparatus |
-
2006
- 2006-08-03 CN CNB2006100296928A patent/CN100405403C/en not_active Expired - Fee Related
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101859511A (en) * | 2010-04-01 | 2010-10-13 | 浙江大学 | Environmental atmosphere lamp system and control method thereof |
CN102957904A (en) * | 2011-08-24 | 2013-03-06 | 上海山景集成电路技术有限公司 | Method, system and device for compressed encoding of image information |
CN105229695A (en) * | 2013-06-20 | 2016-01-06 | 英特尔公司 | The compression and decompression based on subset of graph data |
CN105229695B (en) * | 2013-06-20 | 2021-06-25 | 英特尔公司 | Subset-based compression and decompression of graphics data |
Also Published As
Publication number | Publication date |
---|---|
CN100405403C (en) | 2008-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100566122B1 (en) | Method of compressing still pictures for mobile devices | |
CN102378991B (en) | Compressed domain system and method for compression gains in encoded data | |
US8902992B2 (en) | Decoder for selectively decoding predetermined data units from a coded bit stream | |
JP2017184250A (en) | Apparatus and method for decoding using coefficient compression | |
CN107864379B (en) | Compression method applied to video coding and decoding | |
CN101068350A (en) | Image coding and decoding processing method based on picture element st atistical characteristic and visual characteristic | |
CN105933708B (en) | A kind of method and apparatus of data compression and decompression | |
EP1917813A2 (en) | Image data processing | |
CN101971633A (en) | A video coding system with reference frame compression | |
CN1165456A (en) | Method and apparatus for generating chrominance shape information of video object plane in video signal | |
CN101494788B (en) | Method and apparatus for compressing and decompressing video image | |
US10110896B2 (en) | Adaptive motion JPEG encoding method and system | |
CN106791858A (en) | A kind of high sampling rate rgb video data lossless compression method | |
CN1859576A (en) | Top sampling method and its system for space layered coding video image | |
CN100405403C (en) | Digital image data coding method | |
CN1301620C (en) | Method of video compression that accommodates scene changes | |
CN105472388B (en) | A kind of decoding method of color filter array image, device and system | |
CN104093027B (en) | Joint scalar embedded graphics coding for coloured image | |
CN1696977A (en) | Method for compressing image | |
CN200962655Y (en) | A motive image compression system for mobile device | |
CN116156185A (en) | Image compression and restoration method based on incremental optimization | |
CN100379251C (en) | Encoding method for static image compression | |
CN108282654A (en) | A kind of compression of digital video and decompression method | |
CN108184113B (en) | Image compression coding method and system based on inter-image reference | |
CN106296754B (en) | Show data compression method and display data processing system |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080723 Termination date: 20150803 |
|
EXPY | Termination of patent right or utility model |