CN103167289A - Method and device for coding and decoding image - Google Patents

Method and device for coding and decoding image Download PDF

Info

Publication number
CN103167289A
CN103167289A CN2013100716939A CN201310071693A CN103167289A CN 103167289 A CN103167289 A CN 103167289A CN 2013100716939 A CN2013100716939 A CN 2013100716939A CN 201310071693 A CN201310071693 A CN 201310071693A CN 103167289 A CN103167289 A CN 103167289A
Authority
CN
China
Prior art keywords
pixel
prediction error
error value
color channel
coding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013100716939A
Other languages
Chinese (zh)
Other versions
CN103167289B (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.)
Analogix Semiconductor Beijing Inc
Analogix Semiconductor Inc
Analogix International LLC
Original Assignee
Analogix Semiconductor Beijing Inc
Analogix International LLC
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 Analogix Semiconductor Beijing Inc, Analogix International LLC filed Critical Analogix Semiconductor Beijing Inc
Priority to CN201310071693.9A priority Critical patent/CN103167289B/en
Publication of CN103167289A publication Critical patent/CN103167289A/en
Application granted granted Critical
Publication of CN103167289B publication Critical patent/CN103167289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for coding and decoding an image. The coding method comprises the following steps of: calculating the actual length of a first prediction error value of a color channel of pixels adjacent to pixels to be coded in the last row of pixels of the pixels to be coded in the image and the actual length of a second prediction error value of a color channel of the pixels to be coded; determining the used coding length according to the actual length of the first prediction error value and the actual length of the second prediction error value; and writing a coding rule tag corresponding to the coding length and the second prediction error value into code stream corresponding to the pixels to be coded according to the coding length. By adopting the method and the device, the problem that the compression algorithm for the image cannot simultaneously meet the design requirement of a hardware circuit with low complexity, low power consumption and high speed is solved, so that the performance of the image compression algorithm is improved.

Description

The coding of image, coding/decoding method and coding, decoding device
Technical field
The present invention relates to the communications field, relate in particular to a kind of coding, coding/decoding method and coding, decoding device of image.
Background technology
Image is the extremely important carrier of carry information in multimedia.But, the digital picture that uncompressed is processed, data volume is very huge.For the memory space of the information of saving and the efficiency of transmission of the information of raising, must compress a large amount of real data.
The compression algorithm of image is a lot.Generally need first image to be carried out decorrelation and process, and then encode.the mode that can be based on prediction or conversion is processed in decorrelation, such as, be used for the continuous tone still image based on the context adaptive harmless/closely harmless predictive coding system (Context-based Adaptive Lossless/Nearly-Lossless Coding, referred to as CALIC) and JPEG-LS(Joint Picture Expert Group-LS, be a kind of based on the context for the continuous tone still image of being formulated by JPEG (joint photographic experts group) adaptive harmless/closely harmless predictive coding) be based on the mode of prediction, JPEG (joint photographic experts group) compression standard (Joint Picture Expert Group, referred to as JPEG) and the Standard of image compression based on wavelet transformation (referred to as JPEG2000) formulated of JPEG (joint photographic experts group) be based on the mode of conversion.The method that coding can adopt also has a lot, such as: the Huffman(huffman coding), arithmetic, Run-Length Coding (being RunLen) etc.
Different compaction coding methods is fit to different occasions.Such as, at first Huffman and arithmetic coding need to know the statistical property of coded data, need to carry out two-pass scan to the packed data of image, although compression ratio is relatively high, its code efficiency is lower, is not suitable for real-time coding.In addition, some algorithm requires higher to memory space, and the contextual information that namely uses is a lot, be not suitable for the realization of digital circuit, such as, the coded system of multiple wavelet decomposition and discrete cosine transform (Discrete Cosine Transform is referred to as DCT) conversion.
As seen, the image compression algorithm in correlation technique can't satisfy simultaneously that complexity is low, power consumption is little, fireballing hardware circuit design requirement.Even the algorithm that JPEG-LS etc. simplify due to Existence dependency relationship between data before and after when the coding, also can be realized at most the compressed encoding of a pixel (pixel) in the clock cycle.
Compression algorithm for image in correlation technique can't satisfy the problem that complexity is low, power consumption is little, fireballing hardware circuit design requires simultaneously, not yet proposes at present effective solution.
Summary of the invention
Main purpose of the present invention is to provide a kind of coding and decoding scheme of image, can't satisfy simultaneously with the compression algorithm that solves image in correlation technique the problem that complexity is low, power consumption is little, fireballing hardware circuit design requires.
According to an aspect of the present invention, a kind of coding method of image is provided, has comprised: the second prediction error value of the Color Channel of the physical length of the first prediction error value of the Color Channel of the pixel adjacent with described pixel to be encoded and described pixel to be encoded in the lastrow pixel of pixel to be encoded in computed image; Determine selected code length according to the physical length of described the first prediction error value and the physical length of described the second prediction error value; And coding rule label that will be corresponding with described code length and described the second prediction error value write the code stream corresponding with described pixel to be encoded according to described code length.
Preferably, before determining selected code length according to the physical length of the physical length of described the first prediction error value and described the second prediction error value, described method also comprises: according to the physical length of described the first prediction error value, Color Channel corresponding to described the first prediction error value carried out ascending order or descending, and store putting in order of Color Channel corresponding to described the first prediction error value.
Preferably, according to the physical length of described the first prediction error value, Color Channel corresponding to described the first prediction error value carried out ascending order or descending comprises: the effective number of bits that calculates respectively pixel adjacent with described pixel to be encoded in the lastrow pixel that each Color Channel comprises described pixel to be encoded according to the physical length of described the first prediction error value; According to the described effective number of bits that calculates, Color Channel is carried out ascending order or descending.
Preferably, after storing the putting in order of Color Channel corresponding to described the first prediction error value, described method also comprises: the corresponding Color Channel that puts in order to described pixel to be encoded according to Color Channel corresponding to described the first prediction error value that stores sorts.
Preferably, coding rule label that will be corresponding with described code length and described the second prediction error value according to described code length write with code stream corresponding to described pixel to be encoded before, described method also comprises: the order of the Color Channel of the described pixel to be encoded with described second prediction error value of the Color Channel of described pixel to be encoded after according to sequence is carried out permutatation.
preferably, in the situation that the unit of described pixel to be encoded is continuous a plurality of pixels, coding rule label that will be corresponding with described code length and described the second prediction error value write with code stream corresponding to described pixel to be encoded according to described code length and comprise: will with described continuous a plurality of pixels in coding rule label corresponding to the described code length of each pixel and described second prediction error value of each pixel in described continuous a plurality of pixels, according to described continuous a plurality of pixels in the described code length of each pixel write the code stream corresponding with described continuous a plurality of pixels.
Preferably, before calculating the physical length and described the second prediction error value of described the first prediction error value, described method also comprises: described image is carried out color space conversion and data transformation, and the described image after described data transformation is predicted, obtain the prediction error value of the Color Channel of each pixel in described image.
According to another aspect of the present invention, a kind of coding/decoding method that uses after described coding method is encoded also is provided, has comprised: the physical length of the first prediction error value of the Color Channel of the pixel adjacent with described pixel to be decoded in the lastrow pixel that decodes of calculating pixel to be decoded; Obtain the coding rule label of described pixel to be decoded from the code stream after coding; Selected code length during each Color Channel coding of determining described pixel to be decoded according to physical length and the described coding rule label of described the first prediction error value; And selected code length reads the second prediction error value of the Color Channel of described pixel to be decoded from the code stream after described coding during according to each Color Channel coding of the described pixel to be decoded of determining, and the second prediction error value of the Color Channel by described pixel to be decoded restores the indicated image of described pixel to be decoded.
According to another aspect of the present invention, a kind of code device of image also is provided, comprise: computing module is used for the second prediction error value of the Color Channel of the physical length of the first prediction error value of Color Channel of pixel adjacent with described pixel to be encoded in the lastrow pixel of computed image pixel to be encoded and described pixel to be encoded; Determination module is used for determining selected code length according to the physical length of described the first prediction error value and the physical length of described the second prediction error value; And writing module, be used for will be corresponding with described code length coding rule label and described the second prediction error value write the code stream corresponding with described pixel to be encoded according to described code length.
According to another aspect of the present invention, a kind of decoding device that uses after described code device is encoded also is provided, comprise: computing module is used for calculating the physical length of the first prediction error value of the Color Channel of the lastrow pixel that decodes of the pixel to be decoded pixel adjacent with described pixel to be decoded; Acquisition module is used for the coding rule label that code stream after the coding obtains described pixel to be decoded; Matching module, selected code length during each Color Channel coding that is used for determining described pixel to be decoded according to physical length and the described coding rule label of described the first prediction error value; And processing module, when being used for each Color Channel coding according to the described pixel to be decoded of determining, the selected code length code stream after the described coding reads the second prediction error value of the Color Channel of described pixel to be decoded, and the second prediction error value of the Color Channel by described pixel to be decoded restores the indicated image of described pixel to be decoded.
according to technical scheme of the present invention, adopt the second prediction error value of the Color Channel of the physical length of the first prediction error value of Color Channel of pixel adjacent with pixel to be encoded in the lastrow pixel of pixel to be encoded in computed image and pixel to be encoded, determine selected code length according to the physical length of the first prediction error value and the physical length of the second prediction error value, and coding rule label that will be corresponding with this code length and the second prediction error value write mode with code stream corresponding to pixel to be encoded according to this code length, having solved in the correlation technique compression algorithm of image, can't to satisfy simultaneously complexity low, power consumption is little, the problem that fireballing hardware circuit design requires, improved the performance of image compression algorithm.
Description of drawings
Figure of description is used to provide a further understanding of the present invention, consists of the application's a part, and illustrative examples of the present invention and explanation thereof are used for explaining the present invention, do not consist of improper restriction of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart according to the coding method of the image of the embodiment of the present invention;
Fig. 2 is the flow chart according to the coding/decoding method of the embodiment of the present invention;
Fig. 3 is the structured flowchart according to the code device of the image of the embodiment of the present invention;
Fig. 4 is the structured flowchart according to the decoding device of the embodiment of the present invention;
Fig. 5 is the flow chart of the compaction coding method of coloured image according to the preferred embodiment of the invention;
Fig. 6 is the form schematic diagram of encoding code stream according to the preferred embodiment of the invention;
Fig. 7 is the neighbor schematic diagram of the compaction coding method of coloured image according to the preferred embodiment of the invention;
Fig. 8 is the information format schematic diagram of compaction coding method of the adaptive coding length of coloured image according to the preferred embodiment of the invention;
Fig. 9 is the form schematic diagram of the encoding code stream of two pixel parallel encodings of coloured image according to the preferred embodiment of the invention;
Figure 10 is the schematic flow sheet of adaptively selected compression algorithm according to the preferred embodiment of the invention.
Embodiment
Need to prove, in the situation that do not conflict, embodiment and the feature in embodiment in the application can make up mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
According to the embodiment of the present invention, provide a kind of coding method of image.Fig. 1 is the flow chart according to the coding method of the image of the embodiment of the present invention, and as shown in Figure 1, the method comprises the following steps:
Step S102, the second prediction error value of the Color Channel of the physical length of the first prediction error value of the Color Channel of the pixel adjacent with pixel to be encoded and this pixel to be encoded in the lastrow pixel of pixel to be encoded in computed image;
Step S104 determines selected code length according to the physical length of the first prediction error value and the physical length of the second prediction error value;
Step S106, coding rule label that will be corresponding with code length and the second prediction error value write the code stream corresponding with this pixel to be encoded according to code length.
pass through above-mentioned steps, adopt the second prediction error value of the Color Channel of the physical length of the first prediction error value of Color Channel of pixel adjacent with pixel to be encoded in the lastrow pixel of pixel to be encoded in computed image and this pixel to be encoded, determine selected code length according to the physical length of the first prediction error value and the physical length of the second prediction error value, coding rule label that will be corresponding with code length and the second prediction error value write mode with code stream corresponding to this pixel to be encoded according to code length, can be according to the code length of the adaptive selection prediction error value of the length needs of the prediction error value of each Color Channel of pixel in image, only need to carry out single pass in cataloged procedure, the complexity that realizes is low, and, because the dependence to contextual information is little, thereby can carry out parallel encoding to a plurality of pixels simultaneously, having solved in the correlation technique compression algorithm of image, can't to satisfy simultaneously complexity low, power consumption is little, the problem that fireballing hardware circuit design requires, thereby improved the performance of image compression algorithm.
Need to prove, above-mentioned adjacent pixel can have a plurality of; Generally speaking, can choose a upper pixel that is connected with pixel to be encoded in the lastrow pixel, and on this pixel left and right respectively symmetry choose many to pixel, on this pixel and choose many to pixel together as adjacent pixel.Choosing the principle that these pixels follow can be: completed coding, and with the location comparison of pixel to be encoded pixel near (namely having certain correlation), and, in case determined how to choose neighbor, when other pixels are encoded, also choose similarly the pixel of opposite position as the neighbor of other pixels.
Preferably, before step S104, can carry out ascending order or descending to Color Channel corresponding to the first prediction error value according to the physical length of the first prediction error value, and store putting in order of Color Channel corresponding to the first prediction error value.Adopt the method, the uniformity coefficient of the integral body of a plurality of Color Channel predicated errors that can be by treating near one or more adjacent or pixel of encoded pixels, predict the possible uniformity coefficient of predicated error of pixel to be encoded, and choose the coding rule of different predicated error uniformity coefficients by this uniformity coefficient, thereby improved the specific aim of coding rule for coding region.
In implementation process, Color Channel corresponding to the first prediction error value carried out ascending order or descending can comprise according to the physical length of the first prediction error value: calculate respectively according to the physical length of the first prediction error value the effective number of bits that each Color Channel comprises pixel adjacent with pixel to be encoded in the lastrow pixel of pixel to be encoded; According to the effective number of bits that calculates, Color Channel is carried out ascending order or descending.Adopt said method, length to the prediction error value of the same color passage of a plurality of neighbors is sued for peace, can learn Energy distribution (being the uniformity coefficient of the prediction error value of the different color channels) situation of the Color Channel in the near zone of pixel to be encoded, be convenient to the situation for the prediction error value of each Color Channel, different image-regions done differentiation process.
For example, after storing the putting in order of Color Channel corresponding to the first prediction error value, can also sort according to the corresponding Color Channel for the treatment of encoded pixels that puts in order of Color Channel corresponding to the first prediction error value that stores.Adopt the method, after calculating the first prediction error value of completing coding, can determine the sortord of the corresponding Color Channel of pixel to be encoded, thereby make in the situation that Color Channel was reordered, can prediction error value corresponding according to the lastrow pixel is counter sort, learn the sequence situation of Color Channel in pixel to be decoded, make decoding in this case to realize smoothly.
Preferably, before step S106, can be with the second prediction error value of the Color Channel of pixel to be encoded the order of the Color Channel of the pixel to be encoded after according to sequence carry out permutatation.After Color Channel is sorted, second prediction error value corresponding with each Color Channel also should sort according to the order of corresponding Color Channel, adopt such method, can use less coding rule table, improve the efficient of searching the coding rule label, and then improve code efficiency.
preferably, the contextual information that uses due to said method seldom, the contextual information that uses is only the length of the prediction error value of encoded lastrow, namely, the method is very little to contextual dependence, and do not rely on the coded message of the previous pixel that this pixel to be encoded is expert at fully, therefore, in the situation that the unit of pixel to be encoded is continuous a plurality of pixels, in step S106, can be with the second prediction error value of each pixel in the coding rule label corresponding with the code length of each pixel in continuous a plurality of pixels and continuous a plurality of pixels, according to continuous a plurality of pixels in the code length of each pixel write the code stream corresponding with continuous a plurality of pixels.
In addition, before step S102, image can also be carried out color space conversion and data transformation, and the image after the data conversion is predicted, obtain the prediction error value of the Color Channel of each pixel in image.The method provides the operation of concrete decorrelation, can further improve the compression ratio of coding.
According to the embodiment of the present invention, also provide a kind of coding/decoding method that uses after above-mentioned coding method is encoded.Fig. 2 is the flow chart according to the coding/decoding method of the embodiment of the present invention, and as shown in Figure 2, the method comprises the following steps:
Step S202, the physical length of the first prediction error value of the Color Channel of the pixel adjacent with pixel to be decoded in the lastrow pixel that decodes of calculating pixel to be decoded;
Step S204 obtains the coding rule label of pixel to be decoded from the code stream after coding;
Step S206, selected code length during each Color Channel coding of determining pixel to be decoded according to physical length and the coding rule label of the first prediction error value; And
Step S208, during according to each Color Channel coding of the pixel to be decoded of determining, selected code length reads the second prediction error value of the Color Channel of pixel to be decoded from the code stream after coding, and the second prediction error value of the Color Channel by pixel to be decoded restores the indicated image of pixel to be decoded.
by above-mentioned steps, the physical length of the first prediction error value of the Color Channel of the pixel adjacent with pixel to be decoded in the lastrow pixel that decodes of employing calculating pixel to be decoded, obtain the coding rule label of pixel to be decoded from the code stream after coding, selected code length during each Color Channel coding of determining pixel to be decoded according to physical length and the coding rule label of the first prediction error value, and selected code length reads the second prediction error value of the Color Channel of pixel to be decoded from the code stream after coding during according to each Color Channel coding of the pixel to be decoded of determining, and the second prediction error value of the Color Channel by pixel to be decoded restores the mode of the indicated image of pixel to be decoded, the code stream of the code length that can need adaptive selection prediction error value is decoded, only need to carry out single pass in decode procedure, the complexity that realizes is low, because the dependence to contextual information is little, thereby can carry out parallel encoding to a plurality of pixels simultaneously, having solved in the correlation technique compression algorithm of image, can't to satisfy simultaneously complexity low, power consumption is little, the problem that fireballing hardware circuit design requires, thereby improved the performance of image compression algorithm.
Need to prove, can carry out in the computer system such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out step shown or that describe with the order that is different from herein.
Corresponding to the coding method of above-mentioned image, the embodiment of the present invention also provides a kind of code device of image.Fig. 3 is the structured flowchart according to the code device of the image of the embodiment of the present invention, and as shown in Figure 3, this device comprises: computing module 32, determination module 34 and writing module 36.Wherein, computing module 32 is used for the second prediction error value of the Color Channel of the physical length of the first prediction error value of Color Channel of pixel adjacent with pixel to be encoded in the lastrow pixel of computed image pixel to be encoded and pixel to be encoded; Determination module 34 is coupled to computing module 32, is used for determining selected code length according to the physical length of the first prediction error value and the physical length of the second prediction error value; And writing module 36, be coupled to determination module 34, be used for will be corresponding with code length coding rule label and the second prediction error value write the code stream corresponding with pixel to be encoded according to code length.
pass through said apparatus, the second prediction error value of the Color Channel of the physical length of the first prediction error value of the Color Channel of the pixel adjacent with pixel to be encoded and pixel to be encoded in the lastrow pixel of pixel to be encoded in computing module 32 computed image, determination module 34 is determined selected code length according to the physical length of the first prediction error value and the physical length of the second prediction error value, and writing module 36 will be corresponding with code length coding rule label and the second prediction error value write the code stream corresponding with pixel to be encoded according to code length, can be according to the code length of the adaptive selection prediction error value of the length needs of the prediction error value of each Color Channel of pixel in image, only need to carry out single pass in cataloged procedure, the complexity that realizes is low, because the dependence to contextual information is little, thereby can carry out parallel encoding to a plurality of pixels simultaneously, having solved in the correlation technique compression algorithm of image, can't to satisfy simultaneously complexity low, power consumption is little, the problem that fireballing hardware circuit design requires, thereby improved the performance of image compression algorithm.
Corresponding to above-mentioned coding/decoding method, the embodiment of the present invention also provides a kind of decoding device.Fig. 4 is the structured flowchart according to the decoding device of the embodiment of the present invention, and as shown in Figure 4, this device comprises: computing module 42, acquisition module 44, matching module 46 and processing module 48.Wherein, computing module 42 is used for calculating the physical length of the first prediction error value of the Color Channel of the lastrow pixel that decodes of the pixel to be decoded pixel adjacent with pixel to be decoded; Acquisition module 44 is used for the coding rule label that code stream after the coding obtains pixel to be decoded; Matching module 46 is coupled to computing module 42 and acquisition module 44, selected code length during each Color Channel coding of being used for determining pixel to be decoded according to physical length and the coding rule label of the first prediction error value; And processing module 48, be coupled to matching module 46, when being used for each Color Channel coding according to the pixel to be decoded of determining, the selected code length code stream after the coding reads the second prediction error value of the Color Channel of pixel to be decoded, and the second prediction error value of the Color Channel by pixel to be decoded restores the indicated image of pixel to be decoded.
pass through said apparatus, the physical length of the first prediction error value of the Color Channel of the pixel adjacent with pixel to be decoded in the lastrow pixel that decodes of computing module 42 calculating pixels to be decoded, acquisition module 44 obtains the coding rule label of pixel to be decoded from the code stream after coding, selected code length during each Color Channel coding that matching module 46 is determined pixel to be decoded according to physical length and the coding rule label of the first prediction error value, and processing module 48 during according to each Color Channel coding of the pixel to be decoded of determining selected code length read the second prediction error value of the Color Channel of pixel to be decoded from the code stream after coding, and the second prediction error value of the Color Channel by pixel to be decoded restores the indicated image of pixel to be decoded, having solved in the correlation technique compression algorithm of image, can't to satisfy simultaneously complexity low, power consumption is little, the problem that fireballing hardware circuit design requires, thereby improved the performance of image compression algorithm.
In order to make technical scheme of the present invention and implementation method clearer, below in conjunction with preferred embodiment, its implementation procedure is described in detail.
According to the preferred embodiment of the present invention, a kind of compaction coding method of coloured image is provided, this coded system belongs to single pass (being onepass) coding, uses the contextual information of minute quantity, is applicable to the real-time coding lower to the hardware requirement level.Fig. 5 is the flow chart of the compaction coding method of coloured image according to the preferred embodiment of the invention, and as shown in Figure 5, the method comprises the steps:
Step S502 carries out the color space conversion to image, removes correlation between passage;
Step S504 carries out local data transformation, removes the correlation of adjacent region data as far as possible;
Step S506 further removes correlation by the mode of prediction;
Step S508 encodes to the error of prediction.
Need to prove, in implementation process, step S502 and step S504 can omit, and can directly predict data and encode.
The coded system that this preferred embodiment provides is used for realizing predicated error is waited for the fast coding of coded message exactly.For example, if this coded system belongs to block code, code stream is comprised of two parts: label (Tag) and numerical value.Fig. 6 is the form schematic diagram of encoding code stream according to the preferred embodiment of the invention, and as shown in Figure 6, the numerical part of code stream comprises the predicated error of three passages, and wherein, the L1~L3 in figure represents respectively the code length of three passage prediction error values.Due to the length of predicated error have multiple may, therefore, the demand that can as far as possible provide different selections to satisfy storage, wherein, the length of selectable maximum will can satisfy the peaked memory requirement of predicated error.
because image is after carrying out colour space transformation, energy generally concentrates on one or two passage, and, with R-G-B (Red-Green-Blue, referred to as RGB) image is example, even the RGB image does not carry out colour space transformation, three passages of RGB image neither be equally distributed with respect to coloured image, but because of the content of image different, so, encode for different images or the different zone identical data length (length that refers in the present embodiment predicated error) of employing of image, will cause the waste of memory space, thereby affect compression ratio.Therefore, adopt the length of above-mentioned different predicated error that the zones of different of different images or image is encoded, can reduce memory space, improve compression ratio.
In the preferred embodiment, provided the default table of a code length.Table 1 is the default table of code length according to the preferred embodiment of the invention, wherein, is no more than 8bit length as example (in the RGB image, the scope of prediction error value is 0~255) take the prediction error value of maximum.
Table 1
Figure BDA00002890770200081
As implied above, show as example so that three group coding length are default in table 1, respectively corresponding CodeID=1, CoderID=2 and CoderID=3; The default table of every group coding length comprises eight groups of default coded formats (Tag value from 000 to 111); The default table of every group coding length comprises three Color Channels (Sep1~Sep3 take the RGB image as example, represents respectively red channel, green channel and blue channel), and Sum represents the summation of the code length of Tag and three Color Channels.Need to prove, table 1 can be adjusted as required, and for example, CoderID can be not limited to 1,2,3.Tag also can expand or reduce.
In implementation process, the compaction coding method of the coloured image in this preferred embodiment can comprise the following steps:
Step 1 is obtained the information info1 of lastrow, info2, info3.Fig. 7 is the neighbor schematic diagram of the compaction coding method of coloured image according to the preferred embodiment of the invention, as shown in Figure 7, has represented in lastrow, the pixel adjacent with pixel (Pix in Fig. 7) to be encoded.Fig. 8 is the information format schematic diagram of compaction coding method of the adaptive coding length of coloured image according to the preferred embodiment of the invention, as shown in Figure 8, the info information of each pixel has 9bit, describe as an example of info1 example, wherein, first three bit(is info1[0:2]) in value be that the actual effectively bit number of the predicated error of passage 1 deducts 1(because the scope of actual bit number is 1~8, the scope that 3bit can represent is 0~7, in order to store by enough 3bit, deduct 1), middle 3 bit(are info1[3:5]) in value be that the actual effectively bit number of the predicated error of passage 2 deducts 1, rear three bit(are info1[6:8]) in value be that the actual effectively bit number of the predicated error of passage 3 deducts 1.Wherein, actual effectively bit number represent can the Storage Estimation error amount minimum bit number.
Step 2 is asked the maximum of following three numbers, minimum value, and median:
ref1=info1[0:2]+info2[0:2]+info3[0:2];
ref2=info1[3:5]+info2[3:5]+info3[3:5];
ref3=info1[6:8]+info2[6:8]+info3[6:8];
Wherein, info1[0:2] front 3 represented values in bit position in expression info1, with other info1[3:5], info2[0:2] etc. the expression mode similar.
Step 3 is asked CoderID.By the maximum (Max) that obtains in comparison step 2, the relative size of median (Med) and minimum value (Min) obtains CoderID, for example, at Max, Med, the value of Min relatively near the time, select CoderID=1; At Max, the value of Med approaches and when larger with the difference of the value of Min, selects CoderID=2; Approach and when larger with the difference of the value of Max, select CoderID=3 in the value of Med and Min.
Step 4 is asked the physical length of the predicated error of pixel to be encoded, namely significant bit (bit) number.
Step 5 deducts 1(in order to facilitate the 3bit storage with the effective bit number that obtains in step 4), be updated in the buffer storage (buffer) of storage info information the contextual information when encoding as next line with form shown in Figure 8.
Step 6, the predicated error for the treatment of encoded pixels sorts according to the mode of step 2.For example, the prediction error value of three passages is respectively err1, err2, and err3, sequence is not according to err1, err2, the size of err3 itself is carried out, but according to ref1 in step 2, the order of ref2 and ref3 carries out.For example, at ref1, in three numerical value of ref2 and ref3, ref2 is maximum, so to err1, and err2, when err3 sorted, err2 was placed on the foremost.
Step 7, be chosen according to the effective bit number of predicated error after sequence can satisfy under the CoderID group of selecting in step 3 storage demand minimum length, for example, effective bit number of the predicated error after sequence is respectively: 5,4,2, at first obtain CoderID=2 according to step 3, should select Tag=100 this moment under the CoderID=2 group.
Step 8, the prediction error value with after Tag value and sequence writes code stream according to the bit length of stipulating in table 1.
In the above-described embodiments, during sequence reference be the information of lastrow neighbor.The information of lastrow is stored among buffer, storage be the physical length information of prediction error value.This buffer constantly updates, and all the length information that newly calculates can be updated to the buffer the inside after each coding is completed, and the Image Coding of preparing against next line uses.
For each pixel to be encoded, the length information of the up neighbor of its reference comprises three, info1, and the ref1 that info2, info3. and being obtained by these three values come, ref2, ref3 can think to have represented local Color Channel information.For example, with through the RGB image of conversion not for example, ref1 be exactly the R passage up neighbor prediction error value length and; Ref2 be exactly the G passage up neighbor prediction error value length and; Ref3 be exactly the B passage up neighbor prediction error value length and.
In implementation process, in order to increase the efficient of processing pixel in one-period, two pixel can be walked abreast and encode.Fig. 9 is the form schematic diagram of the encoding code stream of two pixel parallel encodings of coloured image according to the preferred embodiment of the invention, as shown in Figure 9, in this case, when writing the code stream code, can first write two Tag values, then write numerical value (prediction error value of each passage), thereby when decoding, can access following error(predicated error according to Tag) code length, realize that two pixel decode simultaneously.
In the preferred embodiment of the present invention, a kind of coding/decoding method corresponding with the compaction coding method of above-mentioned coloured image also is provided, the method comprises the steps:
Step 1 is obtained the information info1 of lastrow, info2, info3.The info information of each pixel has 9bit, wherein, first three bit is that the actual effectively bit number of the predicated error of passage 1 deducts 1(because the scope of actual bit number is 1~8, the scope that 3bit can represent is 0~7, in order to store by enough 3bit, deduct 1), the actual effectively bit number of the predicated error that middle three bit are passages 2 deducts 1, and the actual effectively bit number of the predicated error that rear three bit are passages 3 deducts 1.
Step 2 is asked the maximum of following three numbers, minimum value, and median:
ref1=info1[0:2]+info2[0:2]+info3[0:2];
ref2=info1[3:5]+info2[3:5]+info3[3:5];
ref3=info1[6:8]+info2[6:8]+info3[6:8];
Wherein, info1[0:2] front 3 represented values in bit position in expression info1, with other info1[3:5], info2[0:2] etc. the expression mode similar.In addition, ref1, ref2, ref3 play two effects in coding, and the one, be used for calculating CoderID, the 2nd, the prediction error value that is used for treating encoded pixels sorts.The prediction error value of supposing current pixel is err1, err2, and err3, if ref1, ref2, the size sequence relation of ref3 is ref2, ref3, ref1, the prediction error value of so drained order is exactly err2, err3, err1.Final prediction error value is written into code stream just can be according to the order after drained order.
Step 3 is asked CoderID.By the maximum (Max) that obtains in comparison step 2, the relative size of median (Med) and minimum value (Min) obtains CoderID.
Step 4 reads the Tag value from code stream, the CoderID according to Tag value and step 3 are tried to achieve can obtain according to table one length of each Color Channel component, thus solution three prediction error values out.
Step 5 according to the Color Channel order that obtains in step 2, with the prediction error value that obtains in step 4 is counter sorts (namely recovering putting in order of Color Channel is corresponding before coding prediction error value), is recovered original Color Channel order.
Step 6 according to the numerical value after the sequence that obtains in step 5 (prediction error value), is calculated actual effectively bit number, deducts after 1 to deposit in info corresponding in buffer according to form shown in Figure 8 contextual information when encoding as next line.
Need to prove, if Color Channel is not sorted, and the Color Channel order of employing acquiescence, those skilled in the art can expect adopting the adaptive mode of code length to carry out Code And Decode to prediction error value according to the foregoing that discloses in the embodiment of the present invention also can realizing at an easy rate, therefore, the present embodiment does not limit technical scheme of the present invention and must reach to the sequence of Color Channel anti-sequence.
In sum, by above-described embodiment and preferred implementation, a kind of coded system that can satisfy Real Time Compression demand and the realization of suitable hardware circuit has been proposed, can come adaptive transition coding length according to the mode of image local Information Selection different code length when coding, can realize a clock cycle compression or the decompress(ion) of two pixel, greatly increase the throughput of data.
In addition, above preferred embodiment and execution mode also have following beneficial effect:
1, without any need for priori or statistical information, avoid Multiple-Scan.
When 2, calculating CoderID, only need up data, therefore can two pixel parallel computations.
3, hardware costs is less, only needs the up bit figure place information of storage.Size can not surpass 0.4 amount of information that linebuffer(is delegation, and its overall length is that 24bit multiply by picture traverse; The info information of delegation only has 9bit to multiply by picture traverse, and info information has taken 9/24 linebuffer).Because the conversion of image is generally so not fast, in order to reduce storage cost, also can carry out samples storage.
4, compression ratio is more stable comparatively speaking, although the existence of Tag with respect to some coded systems that there is no Tag information, has affected the upper limit of compression ratio, has also reduced contextual dependence, and compression ratio is relatively stable.
5, can be with different algorithm fusions together.For example, Figure 10 is the schematic flow sheet of adaptively selected compression algorithm according to the preferred embodiment of the invention, as shown in figure 10, the rational compression method of the adaptive selection of based on contextual information, thus compression ratio further improved.Can distinguish according to the difference of Tag in the time of decoding.For example, can increase the mode of look-up table, coding can be the mode that Tag indexes.
Need to prove, the coding of describing in device embodiment or decoding device are corresponding to above-mentioned embodiment of the method and preferred implementation, and its concrete implementation procedure had been carried out detailed description in embodiment of the method, do not repeat them here.
obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in storage device and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step being made into the single integrated circuit module realizes.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is only the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. the coding method of an image is characterized in that comprising:
The second prediction error value of the Color Channel of the physical length of the first prediction error value of the Color Channel of the pixel adjacent with described pixel to be encoded and described pixel to be encoded in the lastrow pixel of pixel to be encoded in computed image;
Determine selected code length according to the physical length of described the first prediction error value and the physical length of described the second prediction error value; And
Coding rule label that will be corresponding with described code length and described the second prediction error value write the code stream corresponding with described pixel to be encoded according to described code length.
2. method according to claim 1, is characterized in that, before determining selected code length according to the physical length of the physical length of described the first prediction error value and described the second prediction error value, described method also comprises:
According to the physical length of described the first prediction error value, Color Channel corresponding to described the first prediction error value carried out ascending order or descending, and store putting in order of Color Channel corresponding to described the first prediction error value.
3. method according to claim 2, is characterized in that, Color Channel corresponding to described the first prediction error value carried out ascending order or descending comprises according to the physical length of described the first prediction error value:
Calculate respectively the effective number of bits of pixel adjacent with described pixel to be encoded in the lastrow pixel that each Color Channel comprises described pixel to be encoded according to the physical length of described the first prediction error value;
According to the described effective number of bits that calculates, Color Channel is carried out ascending order or descending.
4. method according to claim 2, is characterized in that, after storing the putting in order of Color Channel corresponding to described the first prediction error value, described method also comprises:
The corresponding Color Channel that puts in order to described pixel to be encoded according to Color Channel corresponding to described the first prediction error value that stores sorts.
5. method according to claim 4, it is characterized in that, coding rule label that will be corresponding with described code length and described the second prediction error value according to described code length write with code stream corresponding to described pixel to be encoded before, described method also comprises:
The order of the Color Channel of the described pixel to be encoded with described second prediction error value of the Color Channel of described pixel to be encoded after according to sequence is carried out permutatation.
6. method according to claim 1, it is characterized in that, in the situation that the unit of described pixel to be encoded is continuous a plurality of pixels, coding rule label that will be corresponding with described code length and described the second prediction error value write with code stream corresponding to described pixel to be encoded according to described code length and comprise:
Described second prediction error value of each pixel in coding rule label that will be corresponding with the described code length of each pixel in described continuous a plurality of pixels and described continuous a plurality of pixels, according to described continuous a plurality of pixels in the described code length of each pixel write the code stream corresponding with described continuous a plurality of pixels.
7. method according to claim 1, is characterized in that, before calculating the physical length and described the second prediction error value of described the first prediction error value, described method also comprises:
Described image is carried out color space conversion and data transformation, and the described image after described data transformation is predicted, obtain the prediction error value of the Color Channel of each pixel in described image.
8. a right to use requires the coding/decoding method after in 1 to 7, the described coding method of any one is encoded, and it is characterized in that comprising:
Calculate the physical length of the first prediction error value of the Color Channel of pixel adjacent with described pixel to be decoded in the lastrow pixel that decodes of pixel to be decoded;
Obtain the coding rule label of described pixel to be decoded from the code stream after coding;
Selected code length during each Color Channel coding of determining described pixel to be decoded according to physical length and the described coding rule label of described the first prediction error value; And
During according to each Color Channel coding of the described pixel to be decoded of determining, selected code length reads the second prediction error value of the Color Channel of described pixel to be decoded from the code stream after described coding, and the second prediction error value of the Color Channel by described pixel to be decoded restores the indicated image of described pixel to be decoded.
9. the code device of an image is characterized in that comprising:
Computing module is used for the second prediction error value of the Color Channel of the physical length of the first prediction error value of Color Channel of pixel adjacent with described pixel to be encoded in the lastrow pixel of computed image pixel to be encoded and described pixel to be encoded;
Determination module is used for determining selected code length according to the physical length of described the first prediction error value and the physical length of described the second prediction error value; And
Writing module, be used for will be corresponding with described code length coding rule label and described the second prediction error value write the code stream corresponding with described pixel to be encoded according to described code length.
10. the decoding device after the described code device of a right to use requirement 9 is encoded is characterized in that comprising:
Computing module is used for calculating the physical length of the first prediction error value of the Color Channel of the lastrow pixel that decodes of the pixel to be decoded pixel adjacent with described pixel to be decoded;
Acquisition module is used for the coding rule label that code stream after the coding obtains described pixel to be decoded;
Matching module, selected code length during each Color Channel coding that is used for determining described pixel to be decoded according to physical length and the described coding rule label of described the first prediction error value; And
Processing module, when being used for each Color Channel coding according to the described pixel to be decoded of determining, the selected code length code stream after the described coding reads the second prediction error value of the Color Channel of described pixel to be decoded, and the second prediction error value of the Color Channel by described pixel to be decoded restores the indicated image of described pixel to be decoded.
CN201310071693.9A 2013-03-06 2013-03-06 The coding of image, coding/decoding method and coding, decoding device Active CN103167289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310071693.9A CN103167289B (en) 2013-03-06 2013-03-06 The coding of image, coding/decoding method and coding, decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310071693.9A CN103167289B (en) 2013-03-06 2013-03-06 The coding of image, coding/decoding method and coding, decoding device

Publications (2)

Publication Number Publication Date
CN103167289A true CN103167289A (en) 2013-06-19
CN103167289B CN103167289B (en) 2015-10-28

Family

ID=48589998

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310071693.9A Active CN103167289B (en) 2013-03-06 2013-03-06 The coding of image, coding/decoding method and coding, decoding device

Country Status (1)

Country Link
CN (1) CN103167289B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427349A (en) * 2013-08-20 2015-03-18 清华大学 Bayer image compression method
CN104881886A (en) * 2015-05-14 2015-09-02 大连民族学院 Method for coding color animated image via chain codes
CN105100814A (en) * 2014-05-06 2015-11-25 同济大学 Methods and devices for image encoding and decoding
CN106412579A (en) * 2015-07-30 2017-02-15 浙江大华技术股份有限公司 Image coding method and apparatus, and image decoding method and apparatus
CN107393503A (en) * 2017-07-28 2017-11-24 北京集创北方科技股份有限公司 Code device, display control unit and coding method
US11019365B2 (en) 2015-07-30 2021-05-25 Zhejiang Dahua Technology Co., Ltd. Methods and systems for image compression
CN114820863A (en) * 2022-07-01 2022-07-29 锐创软件技术(启东)有限公司 Intelligent color matching method and system based on color uniform coding
CN116668701A (en) * 2023-05-18 2023-08-29 联通沃音乐文化有限公司 Transmission method applied to interactive screen sharing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993976A (en) * 2004-07-29 2007-07-04 奥西-技术有限公司 Lossless compression of color image data using entropy encoding
CN101233765A (en) * 2005-07-26 2008-07-30 松下电器产业株式会社 Digital signal encoding and decoding device and method
CN101507277A (en) * 2006-08-16 2009-08-12 三星电子株式会社 Image encoding/decoding method and apparatus
CN102057678A (en) * 2008-06-10 2011-05-11 松下电器产业株式会社 Decoding device, decoding method, and reception device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1993976A (en) * 2004-07-29 2007-07-04 奥西-技术有限公司 Lossless compression of color image data using entropy encoding
CN101233765A (en) * 2005-07-26 2008-07-30 松下电器产业株式会社 Digital signal encoding and decoding device and method
CN101507277A (en) * 2006-08-16 2009-08-12 三星电子株式会社 Image encoding/decoding method and apparatus
CN102057678A (en) * 2008-06-10 2011-05-11 松下电器产业株式会社 Decoding device, decoding method, and reception device

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427349A (en) * 2013-08-20 2015-03-18 清华大学 Bayer image compression method
CN104427349B (en) * 2013-08-20 2017-09-29 清华大学 A kind of Bayer method for compressing image
CN105100814A (en) * 2014-05-06 2015-11-25 同济大学 Methods and devices for image encoding and decoding
US11451835B2 (en) 2014-05-06 2022-09-20 Tongji University Method and device for entropy coding and decoding using mapping of matching relationship parameters
CN104881886A (en) * 2015-05-14 2015-09-02 大连民族学院 Method for coding color animated image via chain codes
CN106412579B (en) * 2015-07-30 2019-07-16 浙江大华技术股份有限公司 A kind of coding of image, coding/decoding method and device
US11019365B2 (en) 2015-07-30 2021-05-25 Zhejiang Dahua Technology Co., Ltd. Methods and systems for image compression
CN106412579A (en) * 2015-07-30 2017-02-15 浙江大华技术股份有限公司 Image coding method and apparatus, and image decoding method and apparatus
CN107393503A (en) * 2017-07-28 2017-11-24 北京集创北方科技股份有限公司 Code device, display control unit and coding method
CN107393503B (en) * 2017-07-28 2019-08-02 北京集创北方科技股份有限公司 Code device, display control unit and coding method
CN114820863A (en) * 2022-07-01 2022-07-29 锐创软件技术(启东)有限公司 Intelligent color matching method and system based on color uniform coding
CN114820863B (en) * 2022-07-01 2022-09-09 锐创软件技术(启东)有限公司 Intelligent color matching method and system based on color uniform coding
CN116668701A (en) * 2023-05-18 2023-08-29 联通沃音乐文化有限公司 Transmission method applied to interactive screen sharing

Also Published As

Publication number Publication date
CN103167289B (en) 2015-10-28

Similar Documents

Publication Publication Date Title
CN103167289B (en) The coding of image, coding/decoding method and coding, decoding device
US8542939B2 (en) Methods of and apparatus for using tree representations for representing arrays of data elements for encoding and decoding data in data processing systems
TWI658702B (en) Data encoding and decoding
JP3978478B2 (en) Apparatus and method for performing fixed-speed block-unit image compression with estimated pixel values
US7710296B2 (en) N-bin arithmetic coding for context adaptive binary arithmetic coding
CN108419084B (en) Method, apparatus and storage medium for improved entropy coding and decoding
EP3386199B1 (en) Lossless compression method and system appled to video hard decoding
CN107743239B (en) Method and device for encoding and decoding video data
CN103119849A (en) Probability interval partioning encoder and decoder
CN104081772A (en) Entropy coding buffer arrangement
CN106170921A (en) Relate to source code and the decoding method and device of the data of sign compression
CA2831967A1 (en) Image compression using sub-resolution images
WO2012159301A1 (en) Method, device and medium for video entropy encoding and entropy decoding
CN101014129B (en) Video data compression method
CN103918273A (en) Method of determining binary codewords for transform coefficients
JP2009010954A (en) Method and system for processing image at high speed
CN109819250B (en) Method and system for transforming multi-core full combination mode
CN105027560A (en) Method of determining binary codewords for transform coefficients
CN104581154B (en) A kind of entropy coding method and entropy coder circuit
Son et al. Low complexity embedded compression algorithm for reduction of memory size and bandwidth requirements in the JPEG2000 encoder
CN102474565B (en) For the bitstream syntax of graphic model compression in wireless HD1.1
CN101180886A (en) Compression and decompression using corrections of predicted values
CN101707716A (en) Video coder and coding method
CN105592313A (en) Grouped adaptive entropy coding compression method
CN115474044B (en) Bayer domain image lossy compression method

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