CN105472388A - Color filter array image encoding-decoding method, device and system - Google Patents

Color filter array image encoding-decoding method, device and system Download PDF

Info

Publication number
CN105472388A
CN105472388A CN201510901947.4A CN201510901947A CN105472388A CN 105472388 A CN105472388 A CN 105472388A CN 201510901947 A CN201510901947 A CN 201510901947A CN 105472388 A CN105472388 A CN 105472388A
Authority
CN
China
Prior art keywords
encoding block
code stream
row data
pixel
color filter
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
CN201510901947.4A
Other languages
Chinese (zh)
Other versions
CN105472388B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201510901947.4A priority Critical patent/CN105472388B/en
Publication of CN105472388A publication Critical patent/CN105472388A/en
Priority to PCT/CN2016/092427 priority patent/WO2017016526A1/en
Priority to EP16829891.7A priority patent/EP3320683A4/en
Priority to US15/747,589 priority patent/US11019365B2/en
Application granted granted Critical
Publication of CN105472388B publication Critical patent/CN105472388B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the invention discloses a color filter array image encoding-decoding method, device and system, relates to the field of image processing, and aims to reduce a bandwidth required for reference image transmission between an image signal processing chip and an external memory. The method comprises the following steps: reading row data line by line, and generating an encoding unit used for indicating image information contained by the row data according to the color filter array arrangement mode of the row data and the correlation among color components represented by different pixels in the row data; respectively determining the actual encoding modes of a first encoding block and a second encoding block, and performing encoding on the first encoding block and the second encoding block by utilizing the determined actual encoding modes; and encapsulating header information used for indicating the encoding modes and code stream lengths of the first encoding block and the second encoding block into code streams corresponding to the encoding unit according to a preset encapsulating rule, so as to solve the problem in the prior art.

Description

A kind of decoding method of color filter array image, device and system
Technical field
The present invention relates to image processing field, particularly relate to a kind of decoding method of color filter array image, device and system.
Background technology
Image acquisition and processing system, is generally made up of image collecting device, image-signal processor and chip external memory.Wherein, image capture device can be used for gathering color video frequency image frame; Processor chips, for the image gathered, complete white balance, a series of operation such as auto-exposure control, video noise suppress, multiframe is wide dynamically, demosaicing.Usually, processor needs to read several moment collection above, is kept at the image of chip external memory as reference frame to complete aforesaid operations.
In order to reduce cost and the volume of image capture device, usual employing surface coverage one deck color filter array (CFA, ColorFilterArray) charge coupled cell (CCD, Charge-coupledDevice) or complementary metal oxide semiconductors (CMOS) (CMOS, ComplementaryMetalOxideSemiconductor) transducer catch image.For example, the color filter array of bayer-pattern (Bayer) is one of major technique realizing CCD or cmos sensor color image shot.
Fig. 1 shows a kind of Bayer format color filter array schematic diagram of the prior art.Common, because human eye is more responsive to green, so be summation that is red and blue-component pixels number at the number of Bayer figure Green component pixel.
See Fig. 1, for middle row, green (G) and red (R) component are spaced, at its immediate lastrow and next line, green (G) and blue (B) component are spaced, further, between two green components often arranged, there is the pixel of a redness or blue component.
But, along with the raising of image resolution ratio, to the bandwidth between processor chips and chip external memory, stern challenge can be proposed.Meanwhile, the increase of the data throughout between processor chips and chip external memory also will cause the rising of system power dissipation.
Based on the feature that the different colours component of color filter matrix image is spaced apart, prior art provides a kind of Lossless Image Compression Algorithm method, for the color filter matrix image that transducer gathers, color filter matrix image is split into green, redness and blue three component images, and they are regarded as one with the coloured image of 4:2:2 pattern sampling, under the framework of H.264 standard, compressed encoding is carried out to image.
Visible, prior art needs several adjacent row data of buffer memory in on-chip memory, carries out compressed encoding, like this for process chip to image, need built-in a large amount of on-chip memory in process chip of the prior art, the area that result in process chip increases.
Summary of the invention
The embodiment of the present invention provides a kind of decoding method of color filter array image, device and system, in order to reduce the bandwidth transmitted between image signal processing chip and external memory storage needed for reference picture.
Embodiments provide a kind of coding method of color filter array image, the method comprises:
Obtain pending color filter array picture frame, determine the color filter array arrangement mode of each row data in described picture frame;
Read line data line by line, for current pending row data, perform and operate as follows:
According to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block;
According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
Embodiments provide a kind of coding/decoding method of color filter array image, the method comprises:
Obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finding the header including current pending coding unit;
Resolve coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively;
According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
The embodiment of the present invention additionally provides a kind of code device of color filter array image, and this device comprises:
First acquisition module, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame;
Row data coding module, for read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block;
According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
The embodiment of the present invention additionally provides a kind of decoding device of color filter array image, and this device comprises:
Second acquisition module, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit;
Row data decoder module, for resolving coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively;
The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively; According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
The embodiment of the present invention additionally provides a kind of coding/decoding system of color filter array image, and this system comprises:
Code device, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame; Read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block;
According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit;
Decoding device, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit;
Resolve coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively;
According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
As can be seen from technique scheme, first, the embodiment of the present invention, can read line data line by line with behavior processed in units color filter matrix image, the encoding operation of line data of going forward side by side; The benefit of this processing mode is line by line not only adjacent without the need to buffer memory row, and same color component exists more data dependence, is conducive to utilizing the data redundancy of neighbor to carry out prediction in block; Secondly, the embodiment of the present invention can utilize the prediction residual value set in the coefficient sets of the different frequency component in row data and row data, the row data are encoded, because the coefficient sets of above-mentioned different frequency component and prediction residual value set all can be in round figures, therefore under the prerequisite ensureing computational accuracy, improve computing efficiency, further increase the treatment effeciency of chip; Visible, the embodiment of the present invention effectively raises image coding and decoding efficiency from above-mentioned two aspects, thus ensureing, under the prerequisite that chip area does not increase, to improve chip treatment effeciency, thus transmit the bandwidth needed for reference picture between reduction image signal processing chip and external memory storage.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly introduced, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of Bayer format color filter array schematic diagram of the prior art;
Fig. 2 (a) is the schematic flow sheet of the coding method of a kind of color filter array image in the embodiment of the present invention;
Fig. 2 (b) is the schematic flow sheet of the coding/decoding method of a kind of color filter array image in the embodiment of the present invention;
The schematic flow sheet of the coding method that Fig. 3 provides for the embodiment of the present invention;
Fig. 4 is the schematic diagram of the header of a kind of coding unit in the embodiment of the present invention;
Fig. 5 is the schematic diagram of the preservation order of the bit stream data of a kind of coding unit in the embodiment of the present invention;
Fig. 6 is the schematic flow sheet of a kind of coding/decoding method in the embodiment of the present invention;
The structural representation of the code device of a kind of color filter array image that Fig. 7 provides for the embodiment of the present invention;
The structural representation of the decoding device of a kind of color filter array image that Fig. 8 provides for the embodiment of the present invention;
The structural representation of the coding/decoding system of a kind of color filter array image that Fig. 9 provides for the embodiment of the present invention.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, and obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention can be applied to the video frame image of various form.Especially, the embodiment of the present invention goes for color filter array image (ColorFilterArray, CFA).
Generally, first, in coding side, the embodiment of the present invention can process color filter matrix image in units of row data, and without the need to the adjacent row of buffer memory, can exempt the cost needed for row data buffer storage; Secondly, the embodiment of the present invention can also utilize same color component to there is more data dependence, is conducive to utilizing the data redundancy of neighbor to carry out prediction in block.In addition, in decoding side, except sequentially to read and except whole image of decoding, the embodiment of the present invention can also any portion of positioning image randomly, reads and decode to this part data.
Fig. 2 (a) shows the schematic flow sheet of the coding method of a kind of color filter array image in the embodiment of the present invention, and as Fig. 2 (a), this flow process can comprise:
Step 201: obtain pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame.
Step 202: read line data line by line, for current pending row data, according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise;
Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data.
Step 203: adopt different coding pattern, predict respectively to described first encoding block and the second encoding block, obtains described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block.
Step 204: according to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
Optionally, in above-mentioned steps 202, according to the color filter array arrangement mode of the row data, extract each pixel belonging to same color component one by one, according to the set belonging to the pixel of same color component extracted, generate this color component data block;
For by the whole color component data blocks extracted in the row data, respectively two-dimension discrete cosine transform and quantification treatment are carried out to each color component data block, according to the set of the conversion coefficient after process, generate the first encoding block; And inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to difference between the pixel value of correspondence position pixel in the first encoding block after the pixel value of each pixel of the row data and process, generate the second encoding block; By described first encoding block and the second encoding block, arranging according to preset order, generating the coding unit for representing the image information comprised in the row data.
Optionally, in above-mentioned steps, for the pixel of the 2M in the row data, according to order from left to right, extract successively and be positioned at the pixel of odd positions, until extract M pixel, by the set of pixel extracted, as the first color component data block; Further, extract successively and be positioned at the pixel of even number position, until extract M pixel, by the set of pixel extracted, as the second color component data block;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
Optionally, in above-mentioned steps 203, for the arbitrary encoding block in described first encoding block and the second encoding block, according to default hierarchical rule, this encoding block is divided into N number of tomographic image, adopt different coding pattern, respectively each tomographic image after division is predicted, obtain the prediction code stream length of described each tomographic image under different coding pattern; For each tomographic image, according to the magnitude relationship between the prediction code stream length of this tomographic image under different coding pattern, choose the actual coding pattern of coding mode as this tomographic image of the minimum correspondence of prediction code stream length; In above-mentioned steps 204, by the actual coding pattern of N number of tomographic image that is used in the actual coding pattern of the N number of tomographic image represented in described first encoding block and code stream length, described second encoding block and the header of code stream length, be encapsulated in code stream corresponding to this coding unit; Wherein, described N>1 and N is integer.
Fig. 2 (b) shows the schematic flow sheet of the coding/decoding method of a kind of color filter array image in the embodiment of the present invention, and as Fig. 2 (b), this flow process can comprise:
Step 211: obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finding the header including current pending coding unit.
Step 212: coded system and the code stream length of resolving the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively.
Step 213: according to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
Optionally, in above-mentioned steps 212, according to the position of described header in described code stream, determine the original position of current pending coding unit in described code stream; According to described original position and the code stream length parsed, determine the final position of current pending coding unit in described code stream; According to the code stream comprised between described original position and final position, read out the code stream of described first encoding block and the code stream of the second encoding block.
Optionally, in above-mentioned steps 213, inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to the pixel value sum of the first encoding block after process and the respective pixel in described second encoding block, restores each different colours component data block; According to the color filter array arrangement mode of the current pending row data in described picture frame, each pixel comprised is arranged in order, restores the current pending row data in described picture frame in each different colours component data block described.
Optionally, in above-mentioned steps, if described pending color filter array picture frame is Bayer Bayer picture frame, then M the pixel will comprised in described first color component data block, according to order from left to right, successively as the pixel being positioned at odd positions in the row data; By M the pixel comprised in described second color component data block, according to order from left to right, successively as the pixel being positioned at even bit in the row data and putting; Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
Optionally, in above-mentioned steps 212, resolve coding mode and the code stream length of the N number of tomographic image in the coding mode of N number of tomographic image of the first encoding block carried in described header and code stream length, the second encoding block; According to the code stream length of each tomographic image, read the code stream of this tomographic image, utilize the coding mode that this tomographic image is corresponding, the code stream of this tomographic image read out is decoded; According to the N number of decoded tomographic image in described first encoding block, restore described first encoding block, according to the N number of decoded tomographic image in described second encoding block, restore described second encoding block; Wherein, described N>1 and N is integer.
The key point of the embodiment of the present invention is following aspect:
First, the color filter matrix image of embodiment of the present invention process input line by line, in a line continuous print 2M pixel, get M row green component data spaced apart be organized into a data block, the another kind of color component (red or blue) that compartment of terrain is got except green is organized into another data block.
The benefit of above-mentioned organizational form is: the pixel of same color component exists more data dependence, is conducive to utilizing the data redundancy of neighbor to carry out prediction in block; Process in mode line by line, the cost needed for row data buffer storage can be exempted.Further, the embodiment of the present invention by arranging suitable M value, by the data block organisation squarely of each color component corresponding, can also can be beneficial to conversion process.
Then, the embodiment of the present invention can carry out approximate DCT (DiscreteCosineTransform respectively to two data blocks, discrete cosine transform) transform and quantization process, the nuclear matrix, intermediate object program and the final result that use due to transform and quantization process are all under the prerequisite ensureing computational accuracy, in round figures, like this, be conducive to improving computational efficiency and chip realization.
Afterwards, inverse quantization and inverse transformation are carried out to above-mentioned conversion coefficient, and using the data after inverse transformation as predicted value, calculate the prediction residual value between initial data and prediction data.Visible, in embodiments of the present invention, to the data block of each color component, preserve two parts content: through approximate dct transform and conversion coefficient, prediction residual after quantizing.The conversion coefficient of two color component data blocks and residual error are organized into an encoding block respectively, and two encoding blocks form a coding unit.
Further, coding unit can also be resolved into tomographic image L0, L1 and L2 by the embodiment of the present invention, is corresponding in turn to data several bits from low to high in unit.
Finally, tomographic image is estimated respectively to the code stream length of different coding pattern, and select the pattern that can produce minimum code stream length as final coding mode.
In an embodiment of the present invention, run-length encoding, k rank exp-Golomb coding and fixed-length coding Three models can be adopted.
Accordingly, based on the technical conceive identical with coding side, in decoding side, the embodiment of the present invention can be decoded line by line, and without the need to the adjacent row of buffer memory., sequentially to read and outside whole image of decoding, the embodiment of the present invention can also utilize the M value set by coding side, certain part in random positioning image meanwhile, and the part navigated to is read and decodes, add the flexibility of image coding and decoding.
Below in conjunction with accompanying drawing to the embodiment of the present invention provide the embodiment of Code And Decode method to be illustrated.
Fig. 3 shows the schematic flow sheet of the coding method that the embodiment of the present invention provides, and as shown in Figure 3, this flow process can comprise:
Step 301, processes the color filter matrix image of input line by line.
During specific implementation, for color filter matrix image, due in each row of data all containing green-component pixel and another kind of color component (red or blue component) pixel, therefore, the embodiment of the present invention can be got M row green component data in a line and is organized into a green component data block in compartment of terrain, and the another kind of color component (red or blue) that compartment of terrain is got except green is organized into another color component data block.
For example, in embodiments of the present invention, suppose M=64, so, the size of the green component data block extracted is 8 × 8, and the size of another color component data block is also 8 × 8.That is, if the resolution of pending image is 1920 × 1080, so, each row of data can be divided into several foursquare data blocks by the embodiment of the present invention, is beneficial to subsequent conversion process.
Step 302, the approximate dct transform of data two dimension and quantification treatment in block are done respectively to each color component data block, inverse quantization and inverse transformation process are done, using the result of inverse transformation as predicted value, by initial data and prediction data computational prediction residual error to the conversion coefficient after quantizing.
During specific implementation, in order to obtain coefficient sets and the prediction residual value set of the different frequency component for representing row data, the embodiment of the present invention can comprise a kind of flow process of color component data block being carried out to transform and quantization, inverse quantization and inverse transformation process, specifically comprises the steps:
It should be noted that, below the embodiment of the present invention be still described for the color component data block of 8 × 8 sizes.
S1: approximate dct transform is done to the color component data block X of 8 × 8 sizes of input.
First, according to following formula one calculation of transform coefficients X':
Formula one is: X'=AX t
Wherein, A is following transformation kernel matrix, X trepresent the transposed matrix of X
A = 64 64 64 64 64 64 64 64 89 75 50 18 - 18 - 50 - 75 - 89 83 36 - 36 - 83 - 83 - 36 36 83 75 - 18 - 89 - 50 50 89 18 - 75 64 - 64 - 64 64 64 - 64 - 64 64 50 - 89 18 75 - 75 - 18 89 - 50 36 - 83 83 - 36 - 36 83 - 83 36 18 - 50 75 - 89 89 - 75 50 - 18
Secondly, according to following formula two, to each conversion coefficient in X', carry out reducing calculating:
Formula two is: X' i,j=(X' i,j+ r 1) > > (M-1+B-8)
Wherein, M=log 2n, N are the size of color component data block, i.e. N=8, therefore, for embodiment of the present invention M=3; And B calculates the bit depth used, in embodiments of the present invention, B=8 can be supposed.R 1be a parameter for rounding, in embodiments of the present invention, can r be supposed 1=1 < < (M-2+B-8).
Again, according to following formula three, calculation of transform coefficients Y:
Formula three is: Y=AX' t
Wherein, X' trepresent the transposed matrix of X'.
Finally, according to following formula four, to each conversion coefficient in Y, carry out reducing calculating:
Formula four is: Y i,j=(Y i,j+ r 2) > > (M+6)
Wherein, r 2=1 < < (M+5).
S2: according to following formula five, quantification treatment is carried out to above-mentioned conversion coefficient.
Formula five is: Z i , j = ( Y i , j &times; q + r 3 ) > > ( 21 + Q 6 - M - ( B - 8 ) )
Wherein, q is a parameter depending on Q value, determines by such as following table 1:
Table 1: the multiplication factor q determined by Q value and p
Wherein, r 3be a parameter for rounding, in embodiments of the present invention, can suppose r 3 = 85 < < ( 21 + Q 6 - M - ( B - 8 ) - 9 ) .
Wherein, Q is a parameter controlling the coefficient magnitude scope after quantizing, and in embodiments of the present invention, can suppose that the input data to bit depth is 12 get 29≤Q≤36, and hypothesis gets 32≤Q≤39 to the input that bit depth is 16.
S3: according to following formula six, to matrix Z i,jmake inverse quantization to calculate:
Formula six is:
U i , j = ( ( Z i , j &times; ( p < < Q 6 ) ) + ( 1 < < ( M - 2 + B - 8 ) ) ) > > ( M - 1 + B - 8 )
S4: to above-mentioned matrix U after inverse quantization calculates i,jmake approximate inverse dct transform.
First, according to following formula seven, calculation of transform coefficients U':
Formula seven is: U'=A tu
Wherein, A trepresent the transposed matrix of A.
Secondly, according to following formula eight, calculating is reduced to each conversion coefficient in U':
Formula eight is: U' i,j=(U' i,j+ (1 < < 6)) > > 7
Again, according to following formula nine, calculation of transform coefficients V:
Formula nine is: V=U'A
Finally, according to following formula ten, each element in V matrix is reduced and calculates reconstruction image:
Formula ten is: I' i,j=(V i,j+ (1 < < (11-(B-8)))) > > (12-(B-8))
S5: according to following formula 11, computational prediction residual error.
Formula 11 is: E i,j=I i,j-I' i,j
Like this, the embodiment of the present invention by above-mentioned steps S1 ~ S5, calculates the conversion coefficient after quantification treatment as the first encoding block, and using the prediction residual that calculates as the second encoding block.
Step 303, the conversion coefficient after quantizing using two component image blocks is as a first encoding block A, and the prediction residual of two component images is as the second encoding block B, and two encoding blocks form a coding unit.
During specific implementation, in an encoding process, in the first encoding block A, two DC component of conversion coefficient do not make coded treatment, directly transmit its initial value.
First, according to following formula 12, the positive number comprise the remainder of the first encoding block A and the second encoding block B and negative, be mapped to nonnegative integer:
Formula 12 is:
Wherein, f is the data mapped in coding unit before process, and g is the data mapped in coding unit after process.
Secondly, coding unit is resolved into tomographic image.
In embodiments of the present invention, if the color filter matrix image bit depth of hypothesis input is 12, then each data after above-mentioned steps 302 is handled are [0,2 13-1] in scope.
In embodiments of the present invention, if the color filter matrix image bit depth of hypothesis input is 16, then each data after above-mentioned steps 302 is handled are [0,2 17-1] in scope.
For example, the embodiment of the present invention can set the number of tomographic image is 3 (that is, N=3), like this, lower some bit data constituting layer image L0 of all pixels in encoding block, middle some bit data constituting layer image L1, the highest some bit data constituting layer image L2.
It should be noted that, only carry out citing for N=3 in embodiments of the present invention to describe, certainly, the number that the embodiment of the present invention is not limited to only set tomographic image is 3, when the number of tomographic image is 1, not can thinks and carry out tomographic image division, when the number of tomographic image is greater than 1, can think and carry out tomographic image division and the number of tomographic image is larger, computational accuracy is higher.
Particularly, the embodiment of the present invention according to following formula 13 ~ formula 15, can calculate three tomographic images respectively:
Formula 13 is: L 0(m, n)=g (m, n) mod2 b0
Formula 14 is: L 1(m, n)=(g (m, n) > > b0) mod2 b1
Formula 15 is: L 2(m, n)=g (m, n) > > (b0+b1)
In above-mentioned formula 13 ~ formula 15, remainder operation is got in mod representative, and > > represents shift right operation.For the color filter matrix image that bit depth is 12, in the embodiment of the present invention, b0=b1=4 can be supposed; For the color filter matrix image that bit depth is 16, can b0=5 be supposed in the embodiment of the present invention, and suppose b1=6.
Step 304, adopts different encoding schemes, predicts each tomographic image, estimates prediction code stream length respectively.
During specific implementation, the embodiment of the present invention can adopt three kinds of coding modes to predict, i.e. run-length encoding, k rank exp-Golomb coding and fixed length code.
First, tomographic image Li is estimated to the code stream length of run-length encoding, wherein, i=1,2,3.
Particularly, the value of continuous print neutral element number and nonzero element in statistics layer image, is expressed as two tuples of form: (number of continuous zero, nonzero element value).
For example, by data 0,12,23,0,0,0,5,0, can be expressed as (1,12), (0,23), (3,5), (0,0).
Further, can with two above-mentioned two tuples of byte representation in subsequent step, the number of one of them byte representation neutral element, the value of another byte representation nonzero element.
For example, (1,12) can be encoded into two bytes, that is: 00000001,00001100.
Like this, be more convenient for estimating the code stream length of each tomographic image run-length encoding by the number of above-mentioned two tuples, be denoted as Br.
Secondly, tomographic image Li is estimated to the code stream length of k rank exp-Golomb coding, wherein, i=1,2,3.
Particularly, the histogram Hi of statistics layer image, according to following formula 16, estimates the code stream length Bc of k rank exp-Golomb coding:
Formula 16 is: B c = &Sigma; x = 0 X - 1 H i ( x ) ( 2 &times; t ( x ) + k + 1 )
Wherein, X-1 is the maximum pixel value of tomographic image, depends on the bit depth of tomographic image; In embodiments of the present invention, can suppose representative is not more than the integer of y; In embodiments of the present invention, k=0 can be supposed.
In embodiments of the present invention, the code word of k rank exp-Golomb coding comprises prefix and suffix binary string two parts, so, for data x, prefix part connects a bit 0 after having the individual bit 1 of continuous print t (x), suffix portion then with the individual table of bits registration of k+t (x) according to x+2 k(1-2 t (x)).
For example, for 5, the code word of 0 rank exp-Golomb coding is: 11010.
Step 305, selects to produce and encodes to tomographic image compared with the coding mode of primary bit stream.
During specific implementation, if Br is less than or equal to Bc, and data volume when being less than fixed-length coding, then tomographic image adopts run-length encoding.
If Bc is less than Br, and data volume when being less than fixed-length coding, adopt k rank exp-Golomb coding.
If the smaller value in Br and Bc is greater than data volume when tomographic image data are not encoded, then tomographic image adopts fixed-length coding, and directly preserves by the value of formula 13 ~ formula 15.
Step 306, encapsulates the code stream of each coding unit.
During specific implementation, in order to make decoding end can correctly decode compressed image, except the code stream that coding produces, also need to record coding mode and code stream length information that each tomographic image uses.
For example, the embodiment of the present invention can use the header of 3 bytes to each coding unit, and the corresponding tomographic image of each byte, a coding unit comprises two encoding blocks, so the header of corresponding 6 bytes.
Fig. 4 shows the schematic diagram of the header of a kind of coding unit in the embodiment of the present invention, with reference to Fig. 4, for the tomographic image that bit depth is 4 bits, be 64 bytes in the code stream length of the next encoding block of the situation of fixed-length coding, need use 7 bit unsigned number to represent.
Wherein, the tomographic image L0 of byte 0 and corresponding two encoding blocks of byte 1 difference, the tomographic image L1 of corresponding two encoding blocks of byte 2 and 3 difference, the tomographic image L2 of byte 4 and 5 difference correspondences, two encoding blocks.
Further, the highest order of each byte indicates the coding mode of respective layer image, such as: when its value is 0, represent run-length encoding; When its value is 1, then it is k rank exp-Golomb coding; Remaining 7 have recorded respectively tomographic image encoded after in the code length of byte.If all bit of certain byte is 0, then corresponding tomographic image adopts fixed-length coding.In addition, if the encoded rear length of coding unit is more than or equal to length when not encoding, then the header putting 6 bytes is complete zero.Correspondingly, the initial data of coding unit is preserved at encoded data portion byte-by-byte.
Like this, the embodiment of the present invention, after the header utilizing aforesaid way preservation coding unit, also needs the code stream preserving coding generation, and preservation order and the mode of the bit stream data that a kind of embodiment of the present invention provides are described below by way of example.
Fig. 5 shows the schematic diagram of the preservation order of the bit stream data of a kind of coding unit in the embodiment of the present invention.
As shown in Figure 5, in embodiments of the present invention, first, the embodiment of the present invention preserves the direct current component value of the first encoding block after quantizing respectively, i.e. the DC coefficient (taking 2 bytes) of green component and the DC coefficient (taking 2 bytes) of redness or blue component.
Then, the encoding code stream of the encoding code stream of the tomographic image L1 of the encoding code stream of the tomographic image L0 of the first encoding block and the second encoding block, the first encoding block and the second encoding block and the tomographic image L2 of the first encoding block and the second encoding block is preserved successively.
Like this, preserved code stream and the header of this coding unit after coding by above-mentioned steps, finally, by the header generated by above-mentioned steps, be encapsulated in the bit stream data after coding, thus complete the coding flow process of whole coding unit.
It should be noted that, the data line of appointing in color filter array image according to the difference of M value, can be divided into several foursquare coding units, so that better carry out converting and coded treatment by the embodiment of the present invention.
Because approximate dct transform can under the prerequisite ensureing computational accuracy, in round figures view data, the complexity of floating-point operation can be eliminated like this, on the basis ensureing computational accuracy and image restoring degree, improve the computational efficiency of image processing efficiency and encoder, also do not need to increase chip area simultaneously.
In like manner, after Image Coding is carried out in the coding method adopting the embodiment of the present invention to provide, the embodiment of the present invention also provides a kind of coding/decoding method accordingly, is applicable to decoding end, in order to decode to the image after compression, and restores original image.
Be be one to one with flow process of encoding due to decoding process, code stream is reduced to original view data by the decoding identical standard that can use and encode, and therefore, in embodiments of the present invention, decoding process can be the inverse operation of encoding stream journey.
Be illustrated below in conjunction with the embodiment of accompanying drawing to the coding/decoding method that the embodiment of the present invention provides.
The embodiment of the present invention is corresponding with coding method illustrated in fig. 3, and Fig. 6 shows the schematic flow sheet of a kind of coding/decoding method in the embodiment of the present invention, and as shown in Figure 6, this flow process can comprise:
Step 601, reads in the header of all coding units.
During specific implementation, first, in current pending code stream, the header of each coding unit is read.
Step 602, locates the position of pending coding unit.
During specific implementation, in embodiments of the present invention, all coding units of can sequentially decoding, or certain coding unit of decoding randomly.For the coding unit that certain is to be decoded, the header that can be read in by above-mentioned steps 601 calculates the code stream length sum of all coding units be positioned at before this coding unit, and then can locate the original position of code stream of coding unit to be decoded.
Step 603, reads the code stream of each tomographic image.
During specific implementation, the embodiment of the present invention can according to the code stream length of each tomographic image of unit to be decoded, read the code stream of each tomographic image in this coding unit, in embodiments of the present invention, the number of tomographic image is strict consistent with the number of the tomographic image set by coding side, due in embodiments of the present invention, 3 (namely the number of the setting tomographic image set by coding side is, N=3), therefore, also be 3 (that is, N=3) at the number of the tomographic image of decoding end, be respectively tomographic image L0, tomographic image L1 and tomographic image L2.
Step 604, according to by lowermost layer image L0 until the order of top image L2, to decode successively each tomographic image according to coding mode in header and tomographic image code stream length, and the data of temporary decoding gained.
During specific implementation, according to the code stream length of each tomographic image preserved in header, read each tomographic image successively, and according to the coding mode for each tomographic image preserved in header, each tomographic image of decoding successively, obtains and the decoded data of buffer memory.
Step 605, by each pixel in tomographic image, is multiplied by the weights of corresponding place layer.
During specific implementation, the embodiment of the present invention can restore this coding unit data according to the mode corresponding to above-mentioned steps 303.Like this, by each pixel in tomographic image, be multiplied by the weights of corresponding place layer, and tomographic image L0, tomographic image L1 and tomographic image L2 divide other weights to depend on the value of b0 and b1 in above-mentioned steps 303.
Step 606, the respective pixel summation of each tomographic image is reconstructed into conversion coefficient and residual image encoding block.
During specific implementation, utilizing the pixel value that above-mentioned steps 605 restores, the second encoding block that the first encoding block of the set of transform coefficients for representing row data and user represent prediction residual value set can being restored.
Step 607, according to following formula 17, data in encoding block are carried out inverse mapping:
Formula 17 is:
Concrete, after carrying out inverse mapping process, using the data of each encoding block after process as code coefficient, and buffer memory.
Step 608, utilizes the first encoding block and the second encoding block, reduction raw image data.
During specific implementation, according to above-mentioned formula six ~ formula ten, the code coefficient of the encoding block preserved is carried out inverse quantization and inverse dct transform process, adds that prediction residual restores raw image data by the predicted value of inverse transformation gained.
Based on identical technical conceive, the inverse quantization in the embodiment of the present invention and inverse dct transform handling process can carry out inverse operation by above-mentioned steps 302, and its decode procedure and cataloged procedure one_to_one corresponding, repeat here no longer one by one.
To sum up, embodiments provide a kind of coding method of color filter matrix image, and correspondence provides a kind of coding/decoding method of color filter matrix image, its major advantage is:
The first, the embodiment of the present invention, with behavior processed in units color filter matrix image, without the need to the row that buffer memory is adjacent, can exempt the cost needed for row data buffer storage.
The second, the embodiment of the present invention, with integer form image data processing, under the prerequisite ensureing computational accuracy, improves operation efficiency.
3rd, coding unit is resolved into tomographic image by the embodiment of the present invention, in units of tomographic image, select coding mode, under the distortionless prerequisite of guarantee image, can further increase operation efficiency.
In sum, as can be seen from technique scheme, first, the embodiment of the present invention, can read line data line by line with behavior processed in units color filter matrix image, the encoding operation of line data of going forward side by side; The benefit of this processing mode is line by line not only adjacent without the need to buffer memory row, and same color component exists more data dependence, is conducive to utilizing the data redundancy of neighbor to carry out prediction in block.
Secondly, the embodiment of the present invention can utilize the prediction residual value set in the coefficient sets of the different frequency component in row data and row data, the row data are encoded, because the coefficient sets of above-mentioned different frequency component and prediction residual value set all can be in round figures, therefore under the prerequisite ensureing computational accuracy, improve computing efficiency, further increase the treatment effeciency of chip.
Visible, the embodiment of the present invention effectively raises image coding and decoding efficiency from above-mentioned two aspects, thus ensureing, under the prerequisite that do not increase of chip area, to improve chip treatment effeciency, thus reduce the bandwidth transmitted between image signal processing chip and external memory storage needed for reference picture.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of code device of color filter array image, Fig. 7 shows the structural representation of the code device of a kind of color filter array image that the embodiment of the present invention provides, and as shown in Figure 7, this device comprises:
First acquisition module 71, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame;
Row data coding module 72, for read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block;
According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
Optionally, described row data coding module 72 specifically for:
According to the color filter array arrangement mode of the row data, extract each pixel belonging to same color component one by one, according to the set belonging to the pixel of same color component extracted, generate this color component data block;
For by the whole color component data blocks extracted in the row data, respectively two-dimension discrete cosine transform and quantification treatment are carried out to each color component data block, according to the set of the conversion coefficient after process, generate the first encoding block; And inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to difference between the pixel value of correspondence position pixel in the first encoding block after the pixel value of each pixel of the row data and process, generate the second encoding block;
By described first encoding block and the second encoding block, arranging according to preset order, generating the coding unit for representing the image information comprised in the row data.
Optionally, described row data coding module 72 specifically for:
If described pending color filter array picture frame is Bayer Bayer picture frame, then for the pixel of the 2M in the row data, according to order from left to right, extract the pixel being positioned at odd positions successively, until extract M pixel, by the set of pixel extracted, as the first color component data block;
Further, extract successively and be positioned at the pixel of even number position, until extract M pixel, by the set of pixel extracted, as the second color component data block;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
Optionally, described row data coding module 72 specifically for:
For the arbitrary encoding block in described first encoding block and the second encoding block, according to default hierarchical rule, this encoding block is divided into N number of tomographic image, adopt different coding pattern, respectively each tomographic image after division is predicted, obtain the prediction code stream length of described each tomographic image under different coding pattern;
For each tomographic image, according to the magnitude relationship between the prediction code stream length of this tomographic image under different coding pattern, choose the actual coding pattern of coding mode as this tomographic image of the minimum correspondence of prediction code stream length;
By the actual coding pattern of N number of tomographic image that is used in the actual coding pattern of the N number of tomographic image represented in described first encoding block and code stream length, described second encoding block and the header of code stream length, be encapsulated in code stream corresponding to this coding unit;
Wherein, described N>1 and N is integer.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of decoding device of color filter array image, Fig. 8 shows the structural representation of the decoding device of a kind of color filter array image that the embodiment of the present invention provides, and as shown in Figure 8, this device comprises:
Second acquisition module 81, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit;
Row data decoder module 82, for resolving coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively; According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
Optionally, described row data decoder module 82 specifically for:
According to the position of described header in described code stream, determine the original position of current pending coding unit in described code stream;
According to described original position and the code stream length parsed, determine the final position of current pending coding unit in described code stream;
According to the code stream comprised between described original position and final position, read out the code stream of described first encoding block and the code stream of the second encoding block.
Optionally, described row data decoder module 82 specifically for:
Inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to the pixel value sum of the first encoding block after process and the respective pixel in described second encoding block, restores each different colours component data block;
According to the color filter array arrangement mode of the current pending row data in described picture frame, each pixel comprised is arranged in order, restores the current pending row data in described picture frame in each different colours component data block described.
Optionally, described row data decoder module 82 specifically for:
If described pending color filter array picture frame is Bayer Bayer picture frame, then M the pixel will comprised in described first color component data block, according to order from left to right, successively as the pixel being positioned at odd positions in the row data;
By M the pixel comprised in described second color component data block, according to order from left to right, successively as the pixel being positioned at even bit in the row data and putting;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
Optionally, described row data decoder module 82 specifically for:
Resolve coding mode and the code stream length of the N number of tomographic image in the coding mode of N number of tomographic image of the first encoding block carried in described header and code stream length, the second encoding block;
According to the code stream length of each tomographic image, read the code stream of this tomographic image, utilize the coding mode that this tomographic image is corresponding, the code stream of this tomographic image read out is decoded;
According to the N number of decoded tomographic image in described first encoding block, restore described first encoding block, according to the N number of decoded tomographic image in described second encoding block, restore described second encoding block;
Wherein, described N>1 and N is integer.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of coding/decoding system of color filter array image, Fig. 9 shows the structural representation of the coding/decoding system of a kind of color filter array image that the embodiment of the present invention provides, and as shown in Figure 9, this system comprises:
Code device 91, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame; Read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern;
According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block; According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit;
Decoding device 92, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit;
Resolve coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively;
The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively; According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can be provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device, make the function that the instruction that performed by the processor of this computer or other programmable data processing device can be specified in a flow process in realization flow figure or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in a flow process of flow chart or a square frame of multiple flow process and/or block diagram or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (19)

1. a coding method for color filter array image, is characterized in that, the method comprises:
Obtain pending color filter array picture frame, determine the color filter array arrangement mode of each row data in described picture frame;
Read line data line by line, for current pending row data, perform and operate as follows:
According to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data;
Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block;
According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
2. the method for claim 1, is characterized in that, described generation, for representing the coding unit of the image information that the row data comprise, specifically comprises:
According to the color filter array arrangement mode of the row data, extract each pixel belonging to same color component one by one, according to the set belonging to the pixel of same color component extracted, generate this color component data block;
For by the whole color component data blocks extracted in the row data, respectively two-dimension discrete cosine transform and quantification treatment are carried out to each color component data block, according to the set of the conversion coefficient after process, generate the first encoding block; And inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to difference between the pixel value of correspondence position pixel in the first encoding block after the pixel value of each pixel of the row data and process, generate the second encoding block;
By described first encoding block and the second encoding block, arranging according to preset order, generating the coding unit for representing the image information comprised in the row data.
3. method as claimed in claim 2, it is characterized in that, if described pending color filter array picture frame is Bayer Bayer picture frame, then this color component data block of described generation, specifically comprises:
For the pixel of the 2M in the row data, according to order from left to right, extract successively and be positioned at the pixel of odd positions, until extract M pixel, by the set of pixel extracted, as the first color component data block; Further, extract successively and be positioned at the pixel of even number position, until extract M pixel, by the set of pixel extracted, as the second color component data block;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
4. the method according to any one of claim 1-3, is characterized in that, the described actual coding pattern determining described first encoding block and the second encoding block, specifically comprises:
For the arbitrary encoding block in described first encoding block and the second encoding block, according to default hierarchical rule, this encoding block is divided into N number of tomographic image, adopt different coding pattern, respectively each tomographic image after division is predicted, obtain the prediction code stream length of described each tomographic image under different coding pattern;
For each tomographic image, according to the magnitude relationship between the prediction code stream length of this tomographic image under different coding pattern, choose the actual coding pattern of coding mode as this tomographic image of the minimum correspondence of prediction code stream length;
Describedly representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit, specifically comprising:
By the actual coding pattern of N number of tomographic image that is used in the actual coding pattern of the N number of tomographic image represented in described first encoding block and code stream length, described second encoding block and the header of code stream length, be encapsulated in code stream corresponding to this coding unit;
Wherein, described N>1 and N is integer.
5. a coding/decoding method for color filter array image, is characterized in that, the method comprises:
Obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finding the header including current pending coding unit;
Resolve coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively;
According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
6. method as claimed in claim 5, is characterized in that, described in read out the code stream of described first encoding block and the code stream of the second encoding block, specifically comprise:
According to the position of described header in described code stream, determine the original position of current pending coding unit in described code stream;
According to described original position and the code stream length parsed, determine the final position of current pending coding unit in described code stream;
According to the code stream comprised between described original position and final position, read out the code stream of described first encoding block and the code stream of the second encoding block.
7. method as claimed in claim 5, it is characterized in that, the current pending row data in the described picture frame of described reduction, specifically comprise:
Inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to the pixel value sum of the first encoding block after process and the respective pixel in described second encoding block, restores each different colours component data block;
According to the color filter array arrangement mode of the current pending row data in described picture frame, each pixel comprised is arranged in order, restores the current pending row data in described picture frame in each different colours component data block described.
8. method as claimed in claim 7, is characterized in that, if described pending color filter array picture frame is Bayer Bayer picture frame, then restores the current pending row data in described picture frame, specifically comprise:
By M the pixel comprised in described first color component data block, according to order from left to right, successively as the pixel being positioned at odd positions in the row data;
By M the pixel comprised in described second color component data block, according to order from left to right, successively as the pixel being positioned at even bit in the row data and putting;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
9. the method according to any one of claim 5-8, is characterized in that, described in obtain described first encoding block and described second encoding block, specifically comprise:
Resolve coding mode and the code stream length of the N number of tomographic image in the coding mode of N number of tomographic image of the first encoding block carried in described header and code stream length, the second encoding block;
According to the code stream length of each tomographic image, read the code stream of this tomographic image, utilize the coding mode that this tomographic image is corresponding, the code stream of this tomographic image read out is decoded;
According to the N number of decoded tomographic image in described first encoding block, restore described first encoding block, according to the N number of decoded tomographic image in described second encoding block, restore described second encoding block;
Wherein, described N>1 and N is integer.
10. a code device for color filter array image, is characterized in that, this device comprises:
First acquisition module, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame;
Row data coding module, for read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data; Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block; According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit.
11. devices as claimed in claim 10, is characterized in that, described row data coding module specifically for:
According to the color filter array arrangement mode of the row data, extract each pixel belonging to same color component one by one, according to the set belonging to the pixel of same color component extracted, generate this color component data block; For by the whole color component data blocks extracted in the row data, respectively two-dimension discrete cosine transform and quantification treatment are carried out to each color component data block, according to the set of the conversion coefficient after process, generate the first encoding block; And inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to difference between the pixel value of correspondence position pixel in the first encoding block after the pixel value of each pixel of the row data and process, generate the second encoding block; By described first encoding block and the second encoding block, arranging according to preset order, generating the coding unit for representing the image information comprised in the row data.
12. devices as claimed in claim 11, is characterized in that, described row data coding module specifically for:
If described pending color filter array picture frame is Bayer Bayer picture frame, then for the pixel of the 2M in the row data, according to order from left to right, extract the pixel being positioned at odd positions successively, until extract M pixel, by the set of pixel extracted, as the first color component data block; Further, extract successively and be positioned at the pixel of even number position, until extract M pixel, by the set of pixel extracted, as the second color component data block;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
13. devices according to any one of claim 10-12, is characterized in that, described row data coding module specifically for:
For the arbitrary encoding block in described first encoding block and the second encoding block, according to default hierarchical rule, this encoding block is divided into N number of tomographic image, adopt different coding pattern, respectively each tomographic image after division is predicted, obtain the prediction code stream length of described each tomographic image under different coding pattern;
For each tomographic image, according to the magnitude relationship between the prediction code stream length of this tomographic image under different coding pattern, choose the actual coding pattern of coding mode as this tomographic image of the minimum correspondence of prediction code stream length;
By the actual coding pattern of N number of tomographic image that is used in the actual coding pattern of the N number of tomographic image represented in described first encoding block and code stream length, described second encoding block and the header of code stream length, be encapsulated in code stream corresponding to this coding unit;
Wherein, described N>1 and N is integer.
The decoding device of 14. 1 kinds of color filter array images, is characterized in that, this device comprises:
Second acquisition module, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit;
Row data decoder module, for resolving coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively; According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
15. devices as claimed in claim 14, is characterized in that, described row data decoder module specifically for:
According to the position of described header in described code stream, determine the original position of current pending coding unit in described code stream; According to described original position and the code stream length parsed, determine the final position of current pending coding unit in described code stream; According to the code stream comprised between described original position and final position, read out the code stream of described first encoding block and the code stream of the second encoding block.
16. devices as claimed in claim 14, is characterized in that, described row data decoder module specifically for:
Inverse quantization and inverse two-dimension discrete cosine transform process are carried out to described first encoding block, according to the pixel value sum of the first encoding block after process and the respective pixel in described second encoding block, restores each different colours component data block; According to the color filter array arrangement mode of the current pending row data in described picture frame, each pixel comprised is arranged in order, restores the current pending row data in described picture frame in each different colours component data block described.
17. devices as claimed in claim 16, is characterized in that, described row data decoder module specifically for:
If described pending color filter array picture frame is Bayer Bayer picture frame, then M the pixel will comprised in described first color component data block, according to order from left to right, successively as the pixel being positioned at odd positions in the row data;
By M the pixel comprised in described second color component data block, according to order from left to right, successively as the pixel being positioned at even bit in the row data and putting;
Wherein, described M>0 and M is integer; The total number of pixel in described row data is Sum, and Sum >=2M.
18. devices according to any one of claim 14-17, is characterized in that, described row data decoder module specifically for:
Resolve coding mode and the code stream length of the N number of tomographic image in the coding mode of N number of tomographic image of the first encoding block carried in described header and code stream length, the second encoding block;
According to the code stream length of each tomographic image, read the code stream of this tomographic image, utilize the coding mode that this tomographic image is corresponding, the code stream of this tomographic image read out is decoded;
According to the N number of decoded tomographic image in described first encoding block, restore described first encoding block, according to the N number of decoded tomographic image in described second encoding block, restore described second encoding block;
Wherein, described N>1 and N is integer.
The coding/decoding system of 19. 1 kinds of color filter array images, is characterized in that, this system comprises:
Code device, for obtaining pending color filter array picture frame, determines the color filter array arrangement mode of each row data in described picture frame; Read line data line by line, for current pending row data, perform following operation: according to the correlation between the color component that different pixels in the color filter array arrangement mode of the row data and the row data characterizes, generate the coding unit for representing the image information that the row data comprise; Wherein, described coding unit is by the first encoding block of the coefficient sets for representing the different frequency component in the row data with form for the second encoding block of the prediction residual value set representing the row data; Adopt different coding pattern, respectively described first encoding block and the second encoding block are predicted, obtain described first encoding block and the prediction code stream length of the second encoding block corresponding under different coding pattern; According to described prediction code stream length, determine the actual coding pattern of described first encoding block and the second encoding block respectively, and use the actual coding pattern determined to encode to described first encoding block and the second encoding block; According to default packing rule, representing the coded system of described first encoding block and the second encoding block and the header of code stream length by being used for, being encapsulated in code stream corresponding to this coding unit;
Decoding device, for obtaining the code stream for characterizing each row data in pending color filter array picture frame, in described code stream, finds the header including current pending coding unit; Resolve coded system and the code stream length of the first encoding block and the second encoding block carried in described header; According to the position of described header in described code stream and the code stream length parsed, in described code stream, read out the code stream of described first encoding block and the code stream of the second encoding block respectively; The code stream read out is decoded, obtains described first encoding block and described second encoding block respectively; According to the color filter array arrangement mode of current pending row data in the prediction residual value set of current pending row data represented in the coefficient sets of the different frequency component of current pending row data represented in described first encoding block, described second encoding block and described picture frame, the current pending row data of reducing in described picture frame.
CN201510901947.4A 2015-07-30 2015-12-08 A kind of decoding method of color filter array image, device and system Active CN105472388B (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201510901947.4A CN105472388B (en) 2015-12-08 2015-12-08 A kind of decoding method of color filter array image, device and system
PCT/CN2016/092427 WO2017016526A1 (en) 2015-07-30 2016-07-29 Methods and systems for image compression
EP16829891.7A EP3320683A4 (en) 2015-07-30 2016-07-29 Methods and systems for image compression
US15/747,589 US11019365B2 (en) 2015-07-30 2016-07-29 Methods and systems for image compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510901947.4A CN105472388B (en) 2015-12-08 2015-12-08 A kind of decoding method of color filter array image, device and system

Publications (2)

Publication Number Publication Date
CN105472388A true CN105472388A (en) 2016-04-06
CN105472388B CN105472388B (en) 2018-08-07

Family

ID=55609604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510901947.4A Active CN105472388B (en) 2015-07-30 2015-12-08 A kind of decoding method of color filter array image, device and system

Country Status (1)

Country Link
CN (1) CN105472388B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109829852A (en) * 2019-01-17 2019-05-31 浙江大华技术股份有限公司 The method, apparatus and storage medium of color filter array image procossing
CN110557637A (en) * 2018-06-01 2019-12-10 三星电子株式会社 Apparatus for encoding image, apparatus for decoding image, and image sensor
CN112055223A (en) * 2020-08-21 2020-12-08 浙江大华技术股份有限公司 Image coding and decoding method and coder-decoder
CN117956300A (en) * 2024-03-25 2024-04-30 上海元视芯智能科技有限公司 Image processing architecture, image processing method and image processing chip

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007202212A (en) * 2007-04-23 2007-08-09 Sony Corp Solid-state imaging apparatus and driving method thereof
US20090027517A1 (en) * 2007-07-25 2009-01-29 Micron Technology, Inc. Method, apparatus, and system for pre-compression assessment of compressed data length
CN101656889A (en) * 2009-06-22 2010-02-24 南京大学 High definition video real time compressing as well as coding and decoding method
CN101902650A (en) * 2009-05-27 2010-12-01 中国科学院微电子研究所 Lossless compression method applicable to Bayer image format
CN101986693A (en) * 2010-10-27 2011-03-16 格科微电子(上海)有限公司 Image sensor, working method thereof and display device
JP2013078377A (en) * 2011-09-30 2013-05-02 Fujifilm Corp Endoscope system and external control device of endoscope

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007202212A (en) * 2007-04-23 2007-08-09 Sony Corp Solid-state imaging apparatus and driving method thereof
US20090027517A1 (en) * 2007-07-25 2009-01-29 Micron Technology, Inc. Method, apparatus, and system for pre-compression assessment of compressed data length
CN101902650A (en) * 2009-05-27 2010-12-01 中国科学院微电子研究所 Lossless compression method applicable to Bayer image format
CN101656889A (en) * 2009-06-22 2010-02-24 南京大学 High definition video real time compressing as well as coding and decoding method
CN101986693A (en) * 2010-10-27 2011-03-16 格科微电子(上海)有限公司 Image sensor, working method thereof and display device
JP2013078377A (en) * 2011-09-30 2013-05-02 Fujifilm Corp Endoscope system and external control device of endoscope

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110557637A (en) * 2018-06-01 2019-12-10 三星电子株式会社 Apparatus for encoding image, apparatus for decoding image, and image sensor
CN110557637B (en) * 2018-06-01 2023-06-20 三星电子株式会社 Apparatus for encoding image, apparatus for decoding image, and image sensor
US11800248B2 (en) 2018-06-01 2023-10-24 Samsung Electronics Co., Ltd. Apparatus for encoding image, apparatus for decoding image and image sensor
CN109829852A (en) * 2019-01-17 2019-05-31 浙江大华技术股份有限公司 The method, apparatus and storage medium of color filter array image procossing
CN109829852B (en) * 2019-01-17 2023-04-25 浙江大华技术股份有限公司 Color filter array image processing method, device and storage medium
CN112055223A (en) * 2020-08-21 2020-12-08 浙江大华技术股份有限公司 Image coding and decoding method and coder-decoder
CN117956300A (en) * 2024-03-25 2024-04-30 上海元视芯智能科技有限公司 Image processing architecture, image processing method and image processing chip
CN117956300B (en) * 2024-03-25 2024-05-28 上海元视芯智能科技有限公司 Image processing architecture, image processing method and image processing chip

Also Published As

Publication number Publication date
CN105472388B (en) 2018-08-07

Similar Documents

Publication Publication Date Title
JP7431742B2 (en) Method and apparatus for encoding/decoding a point cloud representing a three-dimensional object
US8107752B2 (en) Method and system for processing image at high speed
US6285796B1 (en) Pseudo-fixed length image compression scheme
CN1129312C (en) Apparatus and method for compressing image data received from image sensor having bayer pattern
CN105472388A (en) Color filter array image encoding-decoding method, device and system
US9019399B2 (en) Two-dimensional signal encoding device
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
CN103167289B (en) The coding of image, coding/decoding method and coding, decoding device
AU2002259268C1 (en) Apparatus and method for encoding and computing a discrete cosine transform using a butterfly processor
US11677932B2 (en) Image processing device
CN105163130B (en) A kind of Lossless Image Compression Algorithm method based on discrete Tchebichef orthogonal polynomial
KR102219133B1 (en) Apparatus and method for compact bit-plane data compression
US8428381B2 (en) Image compression method with variable quantization parameter
CN105472395B (en) A kind of Lossless Image Compression Algorithm method based on discrete Krawtchouk orthogonal polynomial
CN114693818A (en) Compression method suitable for digital ortho image data
CN101193285A (en) Method and device for image compression coding and decoding
CN111815502A (en) FPGA (field programmable Gate array) acceleration method for multi-image processing based on WebP (Web Page) compression algorithm
CN108259910A (en) Compression method and device, storage medium, the computing device of video data
TWI502550B (en) Differential layered image compression method
TWI795480B (en) Image processing device for performing data decompression and image processing device for performing data compression
WO2023185806A9 (en) Image coding method and apparatus, image decoding method and apparatus, and electronic device and storage medium
EP1652146A1 (en) Implementation of the jpeg2000 compression algorithm in hardware
JPH06315143A (en) Image processor
KR20150068603A (en) Method for Multiple Description Coding using Directional Discrete Cosine Transform
JPH06178121A (en) Compressing 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
GR01 Patent grant
GR01 Patent grant