CN105791819B - The decompression method and device of a kind of frame compression method of image, image - Google Patents
The decompression method and device of a kind of frame compression method of image, image Download PDFInfo
- Publication number
- CN105791819B CN105791819B CN201410836815.3A CN201410836815A CN105791819B CN 105791819 B CN105791819 B CN 105791819B CN 201410836815 A CN201410836815 A CN 201410836815A CN 105791819 B CN105791819 B CN 105791819B
- Authority
- CN
- China
- Prior art keywords
- pixel
- current line
- group
- value
- bit length
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a kind of frame compression method of image, the decompression methods and device of image.Its frame compression method includes since the second row pixel of image, proceeding as follows line by line:According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;Determine the difference of the predicted pixel values and pixel value of each pixel of current line;Determine the bit-depth of each pixel of current line;Current line pixel point is grouped, and determines the bit length of every group of pixel;If the sum of bit length of each group pixel is not more than bit length threshold value, the bit-depth of every group of pixel and difference are packaged as compressed data packets as the compressed data of this group of pixel.The embodiment of the present invention carries out frame compression with behavior unit, therefore reduces the consumption to hardware resource.And the operand for calculating bit-depth is far smaller than the operand of entropy coding method, therefore code efficiency is high.
Description
Technical field
The present invention relates to the decompressions of technical field of image processing more particularly to the frame compression method, image of a kind of image
Method and device.
Background technology
Frame compression (Frame Compress) be in embedded hardware system each image processing equipment (master) to figure
As data carry out a kind of mode of lossless compression.It is compressed from image data is read in frame buffer (buffer), it then will pressure
Image data deposit Double Data Rate synchronous DRAM (DDR) after contracting, through compression so that each image in system
The readwrite bandwidth that processing master accesses image data from DDR is reduced.
Image procossing master involved in embedded system to frame squeeze operation has Video Codec (Video
Codec), image processor (GPU), image-signal processor (ISP) and display engine (Display Engine).Wherein, depending on
Frequency codec and image processor access image data, image-signal processor and display engine by block (block) for unit
It is that unit accesses image data by row (line).
It in existing frame compress mode, is encoded using entropy coding method, such as Huffman compiling methods etc..Entropy coding
Method in blocks, carries out image coding, therefore be required to consume the largely hardware resources such as caching at encoding and decoding end, and encode effect
Rate is relatively low.
Invention content
The object of the present invention is to provide a kind of frame compression method of image, the decompression methods and device of image, to solve
The code efficiency of existing frame compress mode is low, the problem of needing to consume great amount of hardware resources.
The purpose of the present invention is what is be achieved through the following technical solutions:
A kind of frame compression method of image, including:Using the pixel value of the first row pixel of image as the first row pixel
The coded data of point is sent, and sends the unpressed instruction information of current line pixel point;Since the second row pixel of image,
It proceeds as follows line by line:
According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;
Determine the difference of the predicted pixel values and its pixel value of each pixel of current line;
Determine that the bit-depth of each pixel of current line, the bit-depth refer to the difference for indicating pixel
Value needs the number of bits occupied;
Current line pixel point is grouped, and determines the bit length of every group of pixel, the bit length is one group
The product of maximal bit depth and the quantity of this group of pixel in pixel;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
Compressed data packets are packaged as the compressed data of this group of pixel with the difference, the bit length threshold value is for indicating
The pixel value of current line pixel point needs the number of bits occupied;Send the compressed data packets and instruction current line pixel of current line
The instruction information of point compression;
If the sum of bit length of each group pixel is more than bit length threshold value, the pixel value of current line pixel point is made
It is sent for the coded data of current line, and sends the instruction unpressed instruction information of current line pixel point.
Preferably, according to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined, are wrapped
It includes:According to the pixel value of previous row pixel, the prediction picture of each pixel of current line is determined according at least two prediction modes
Element value;
Determine the difference of the predicted pixel values and pixel value of each pixel of current line, including:Determine each picture of current line
The difference for the predicted pixel values and pixel value that vegetarian refreshments is determined according to different prediction modes;
Determine the bit-depth of each pixel of current line, including:Determine each pixel of current line in different prediction moulds
Bit-depth under formula;
Determine the bit length of every group of pixel, including:Determine bit long of the every group of pixel under different prediction modes
Degree;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
Compressed data packets are packaged as the compressed data of this group of pixel with the difference, including:It selects each under different prediction modes
The minimum value of the sum of the bit length of group pixel, if the minimum value is not more than bit length threshold value, by every group of pixel
Bit-depth and the difference under minimum prediction mode are packaged as compressed data packets as the compressed data of this group of pixel,
The minimum prediction mode is the corresponding prediction mode of the minimum value.
Based on above-mentioned arbitrary frame compression method embodiment, it is preferred that be grouped to current line pixel point, and determine every group
The bit length of pixel, including:Current line pixel point is grouped according at least two group modes, and determines each point
The bit length of every group of pixel under group pattern;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
Compressed data packets are packaged as the compressed data of this group of pixel with the difference, including:It selects each under different grouping pattern
The minimum value of the sum of the bit length of group pixel, if the minimum value is not more than bit length threshold value, by minimum packets mould
The bit-depth of every group of pixel under formula and the difference are packaged as compressed data packets as the compressed data of this group of pixel,
The minimum packets pattern is the corresponding group mode of the minimum value.
Preferably, if the sum of bit length of each group pixel is not more than bit length threshold value, the pressure of current line is sent
The instruction information of contracting data packet and instruction current line pixel point compression, including:
The compressed data packets of current line, the instruction information of instruction current line pixel point compression, instruction current line is sent to use
Prediction mode instruction information and instruction current line use group mode instruction information.
A kind of decompression method of image, including, to each row pixel of image, proceed as follows line by line:
If the instruction unpressed instruction information of current line pixel point is received, by the pixel of the current line received
Pixel value of the coded data as the pixel of current line;
If receiving the instruction information of instruction current line pixel point compression, taken according in each compressed data packets of current line
The bit-depth of each group pixel of band obtains the pre- of each pixel of current line from each compressed data packets of current line respectively
Survey the difference of pixel value and pixel value;According to the pixel value of the difference and previous row pixel, each pixel of current line is determined
The pixel value of point, the bit-depth refer to the number of bits for needing to occupy for indicating the difference of pixel.
Preferably, according to the pixel value of the difference and previous row pixel, the pixel of each pixel of current line is determined
Value, including:
According to the instruction information for the prediction mode that the instruction current line received uses, the prediction mould that current line uses is determined
Formula;
The prediction of each pixel of current line is determined according to the pixel value of previous row pixel according to the prediction mode
Pixel value;
According to the difference and the predicted pixel values, the pixel value of each pixel of current line pixel point is determined.
Based on above-mentioned arbitrary decompression method embodiment, it is preferred that obtained from each compressed data packets of current line respectively
Before the predicted pixel values of each pixel of current line and the difference of pixel value, this method further includes:
According to the instruction information for the group mode that the instruction current line received uses, the grouping mould that current line uses is determined
Formula;
According to the group mode that current line uses, each compressed data packets of current line pixel point are obtained.
Based on inventive concept same as method, the embodiment of the present invention also provides a kind of frame compression set of image, including:
First compressing processing module, for using the pixel value of the first row pixel of image as the volume of the first row pixel
Code data are sent, and send the unpressed instruction information of current line pixel point;
Second compressing processing module, for since the second row pixel of image, proceeding as follows line by line:
According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;
Determine the difference of the predicted pixel values and its pixel value of each pixel of current line;
Determine that the bit-depth of each pixel of current line, the bit-depth refer to the difference for indicating pixel
Value needs the number of bits occupied;
Current line pixel point is grouped, and determines the bit length of every group of pixel, the bit length is one group
The product of maximal bit depth and the quantity of this group of pixel in pixel;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
Compressed data packets are packaged as the compressed data of this group of pixel with the difference, the bit length threshold value is for indicating
The pixel value of current line pixel point needs the number of bits occupied;Send the compressed data packets and instruction current line pixel of current line
The instruction information of point compression;
If the sum of bit length of each group pixel is more than bit length threshold value, the pixel value of current line pixel point is made
It is sent for the coded data of current line, and sends the instruction unpressed instruction information of current line pixel point.
Preferably, the second compressing processing module is used for:
According to the pixel value of previous row pixel, the pre- of each pixel of current line is determined according at least two prediction modes
Survey pixel value;
Determine the difference for the predicted pixel values and pixel value that each pixel of current line is determined according to different prediction modes;
Determine bit-depth of each pixel of current line under different prediction modes;
Determine bit length of the every group of pixel under different prediction modes;
If the sum of bit length of each group pixel is not more than bit length threshold value, each group under different prediction modes is selected
The minimum value of the sum of the bit length of pixel exists every group of pixel if the minimum value is not more than bit length threshold value
Bit-depth and the difference under minimum prediction mode are packaged as compressed data packets as the compressed data of this group of pixel, institute
It is the corresponding prediction mode of the minimum value to state minimum prediction mode;
If the sum of bit length of each group pixel is more than bit length threshold value, the pixel value of current line pixel point is made
It is sent for the coded data of current line, and sends the instruction unpressed instruction information of current line pixel point.
Based on above-mentioned any device embodiment, it is preferred that be grouped to current line pixel point, and determine every group of pixel
Bit length when, second compressing processing module is used for:Current line pixel point is carried out according at least two group modes
Grouping, and determine the bit length of every group of pixel under each group mode;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
When being packaged as compressed data packets as the compressed data of this group of pixel with the difference, second compressing processing module is used
In:Select the minimum value of the sum of bit length of each group pixel under different grouping pattern, if the minimum value be not more than than
Bit length threshold value, using the bit-depth of every group of pixel under minimum packets pattern and the difference as the pressure of this group of pixel
Contracting data are packaged as compressed data packets, and the minimum packets pattern is the corresponding group mode of the minimum value.
Based on above-mentioned any device embodiment, it is preferred that if the sum of bit length of each group pixel is not more than bit
Length threshold, when sending the compressed data packets of current line and indicating the instruction information of current line pixel point compression, second pressure
Contracting processing module is used for:
The compressed data packets of current line, the instruction information of instruction current line pixel point compression, instruction current line is sent to use
Prediction mode instruction information and instruction current line use group mode instruction information.
Based on inventive concept same as method, the embodiment of the present invention also provides a kind of decompressing device of image, including:
First decompression module will connect when for receiving the instruction unpressed instruction information of current line pixel point
Pixel value of the coded data of the pixel of the current line received as the pixel of current line;
Second decompression module, when instruction information for receiving instruction current line pixel point compression, according to working as
The bit-depth of each group pixel carried in each compressed data packets that move ahead, is obtained from each compressed data packets of current line respectively
Take the difference of the predicted pixel values and pixel value of each pixel of current line;According to the pixel of the difference and previous row pixel
Value, determines that the pixel value of each pixel of current line, the bit-depth refer to the difference needs for indicating pixel
The number of bits of occupancy.
Preferably, according to the pixel value of the difference and previous row pixel, the pixel of each pixel of current line is determined
When value, the second decompression module is used for:
According to the instruction information for the prediction mode that the instruction current line received uses, the prediction mould that current line uses is determined
Formula;
The prediction of each pixel of current line is determined according to the pixel value of previous row pixel according to the prediction mode
Pixel value;
According to the difference and the predicted pixel values, the pixel value of each pixel of current line pixel point is determined.
Based on above-mentioned any device embodiment, it is preferred that obtain current line from each compressed data packets of current line respectively
Before the predicted pixel values of each pixel and the difference of pixel value, the second decompression module is additionally operable to:
According to the instruction information for the group mode that the instruction current line received uses, the grouping mould that current line uses is determined
Formula;
According to the group mode that current line uses, each compressed data packets of current line pixel point are obtained.
Technical solution provided in an embodiment of the present invention carries out frame compression with behavior unit, one is only needed in compression process
A row caching is used for preserving the pixel value of lastrow pixel, therefore reduces the consumption to hardware resource.And in current line
When the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and above-mentioned difference
Compressed data as this group of pixel is packaged as compressed data packets.Operand due to calculating bit-depth is far smaller than entropy and compiles
The operand of code method, therefore the code efficiency of frame compression method provided in an embodiment of the present invention is high.
Description of the drawings
Fig. 1 is a kind of frame compression method flow chart provided in an embodiment of the present invention;
Fig. 2 is a kind of decompression method flow chart provided in an embodiment of the present invention;
Fig. 3 is frame compression set schematic diagram provided in an embodiment of the present invention;
Fig. 4 is decompressing device schematic diagram provided in an embodiment of the present invention.
Specific implementation mode
The core concept of the embodiment of the present invention is, with behavior unit, frame compression is carried out to image.To the first row of image
Pixel directly (compresses number without compression using the pixel value of each pixel as the coded data of the row pixel
According to), since the second row pixel, the bit-depth of each pixel and difference are packaged as compressed data.
Below in conjunction with attached drawing, technical solution provided in an embodiment of the present invention is described in detail.
The frame compression method of image provided in an embodiment of the present invention, using the pixel value of the first row pixel of image as
The coded data of one-row pixels point is sent, and sends the unpressed instruction information of current line pixel point;From the second row picture of image
Vegetarian refreshments starts, and carries out operation as shown in Figure 1 line by line, specific as follows:
Step 100, according to the pixel value of previous row pixel, determine the predicted pixel values of each pixel of current line.
Step 110, determine each pixel of current line predicted pixel values and its pixel value difference.
Step 120, the bit-depth for determining each pixel of current line.
Wherein, bit-depth refers to the number of bits for needing to occupy for indicating the difference of pixel.
Step 130 is grouped current line pixel point, and determines the bit length of every group of pixel.
Wherein, bit length is the product of the maximal bit depth and the quantity of this group of pixel in one group of pixel.
If the sum of bit length of step 140, each group pixel is not more than bit length threshold value, by every group of pixel
Bit-depth and above-mentioned difference are packaged as compressed data packets as the compressed data of this group of pixel, and send the compression of current line
The instruction information of data packet and instruction current line pixel point compression.
If the sum of bit length of step 150, each group pixel is more than bit length threshold value, by current line pixel point
Pixel value is sent as the coded data of current line, and sends the instruction unpressed instruction information of current line pixel point.
That is, if the sum of bit length of each group pixel is more than bit length threshold value, which is not carried out
Frame compression processing.
Wherein, bit length threshold value is the number of bits for needing to occupy for indicating the pixel value of current line pixel point.
Technical solution provided in an embodiment of the present invention carries out frame compression with behavior unit, one is only needed in compression process
A row caching is used for preserving the pixel value of lastrow pixel, therefore reduces the consumption to hardware resource.And in current line
When the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and above-mentioned difference
Compressed data as this group of pixel is packaged as compressed data packets.Operand due to calculating bit-depth is far smaller than entropy and compiles
The operand of code method, therefore the code efficiency of frame compression method provided in an embodiment of the present invention is high.
In the embodiment of the present invention, there are many prediction modes that determine the predicted pixel values of each pixel of current line, below
It enumerates wherein several.
Prediction mode one:
The prediction mode is properly termed as vertical prediction mode again.I.e. using the pixel value of previous row nth pixel point as working as
The predicted pixel values of the nth pixel that moves ahead point.
Prediction mode two:
The prediction mode is properly termed as mean prediction pattern again.I.e. by the equal of the pixel value of a~b pixel of previous row
It is worth the predicted pixel values as c-th of pixel of current line.Wherein, b>A, b >=c and c >=a.
Prediction mode three:
The prediction mode is properly termed as upper left prediction mode again.The pixel value of a~b pixel of previous row is carried out
Pixel value after ranking operation as b-th of pixel of current line.Wherein, b>a.
Prediction mode four:
The prediction mode is properly termed as upper right prediction mode again.The pixel value of a~b pixel of previous row is carried out
Pixel value after ranking operation as a-th of pixel of current line.Wherein, b>a.
Technical solution provided in an embodiment of the present invention may be used at least one prediction mode and determine each pixel of current line
The predicted pixel values of point.
If N (N is not less than 2 integer) kind prediction modes is used to determine the prediction pixel of each pixel of current line
Value, for each pixel, will obtain N number of predicted pixel values.Correspondingly, in the prediction picture for determining each pixel of current line
When element value and the difference of pixel value, for each pixel, N number of difference will be obtained;Determining each pixel of current line
When bit-depth, for each pixel, N number of bit-depth will be obtained;It is right when determining the bit length of every group of pixel
In every group of pixel, N number of bit length will be obtained;Using the bit-depth of every group of pixel as the compression number of this group of pixel
When according to being packaged as compressed data packets, the minimum of the sum of bit length of each group pixel under different prediction modes is specifically selected
Bit-depth of the every group of pixel under minimum prediction mode is packaged as compression number by value
According to packet, wherein minimum prediction mode is the corresponding prediction mode of the minimum value.
In the embodiment of the present invention, current line pixel point can be grouped according at least one group mode.
Wherein, difference lies in packet count differences between different grouping pattern.
If be grouped to current line pixel point according at least two group modes, it is determined that every under each group mode
The bit length of group pixel;The minimum value of the sum of bit length of each group pixel under different grouping pattern is selected, if should
Minimum value is not more than given threshold, using the bit-depth of every group of pixel under minimum packets pattern as the pressure of this group of pixel
Contracting data are packaged as compressed data packets, wherein minimum packets pattern is the corresponding group mode of the minimum value.
In the embodiment of the present invention, if determining the prediction pixel of pixel using two or more prediction mode
Value, and one-row pixels point is grouped according to two kinds or two or more group modes, according to finally obtained a line picture
Bit length of the vegetarian refreshments under different prediction modes and group mode selects optimal prediction mode and group mode (i.e. minimum
Prediction mode and minimum packets pattern), to improve compression performance.
Correspondingly, in the instruction information of the compressed data packets and instruction current line pixel point compression that send current line, also
Send the instruction letter of the instruction information for the prediction mode that instruction current line uses and/or the group mode of instruction current line use
Breath.
Technical solution provided in an embodiment of the present invention is particularly suitable for the application scenarios being written and read with behavior unit.Example
Such as, the raw reading and writing datas of ISP, the reading and writing data etc. of Display Engine.
The embodiment of the present invention also provides a kind of decompression method of image, to each row pixel of image, executes Fig. 2 line by line
Shown in operate, it is specific as follows:
If step 200 receives the instruction unpressed instruction information of current line pixel point, by the current line received
Pixel value of the coded data of pixel as the pixel of current line.
If step 210, the instruction information for receiving instruction current line pixel point compression, according to each compression number of current line
According to the bit-depth of each group pixel carried in packet, each picture of current line is obtained from each compressed data packets of current line respectively
The predicted pixel values of vegetarian refreshments and the difference of its pixel value;According to the pixel value of the difference and previous row pixel, determine current
The pixel value of each pixel of row, the bit-depth refer to the bit for needing to occupy for indicating the difference of pixel
Number.
Technical solution provided in an embodiment of the present invention carries out the decompression of image with behavior unit, in decompression process
It only needs a row caching to be used for preserving the pixel value of lastrow pixel, therefore reduces the consumption to hardware resource.And root
It decompresses to obtain the pixel value of pixel according to the bit length of each group pixel of current line, operand is far smaller than entropy coding
The operand of method, therefore the code efficiency of image expansion method provided in an embodiment of the present invention is high.
Preferably, according to the pixel value of the difference and previous row pixel, the pixel of each pixel of current line is determined
Value, including:
According to the instruction information for the prediction mode that the instruction current line received uses, the prediction mould that current line uses is determined
Formula;
The prediction of each pixel of current line is determined according to the pixel value of previous row pixel according to the prediction mode
Pixel value;
According to the difference and the predicted pixel values, the pixel value of each pixel of current line pixel point is determined.
Based on above-mentioned arbitrary decompression method embodiment, it is preferred that obtained from each compressed data packets of current line respectively
Before the predicted pixel values of each pixel of current line and the difference of pixel value, this method further includes:
According to the instruction information for the group mode that the instruction current line received uses, the grouping mould that current line uses is determined
Formula;
According to the group mode that current line uses, each compressed data packets of current line pixel point are obtained.
Below by taking the frame compression processing of ISP as an example, technical solution provided in an embodiment of the present invention is described in detail.
In the embodiment, the often row of image has 32 pixels, and there are four types of prediction mode, four kinds of group modes.Wherein, this
Four kinds of prediction modes are respectively above-mentioned vertical prediction mode, mean prediction pattern, upper left prediction mode and upper right prediction mode;
These four group modes are respectively:One-row pixels point is divided into 8 groups, the group mode that one-row pixels point is divided into acquiescence is
4 groups, one-row pixels point is divided into 2 groups, one-row pixels point is divided into one group.Wherein default packet pattern is by one-row pixels point
It is divided into 4 groups.Specific processing mode is as follows.
It is successively read the raw data of the one-row pixels point of image.If it is the first row pixel, then by the row pixel
Raw data are sent to DDR as coded data and preserve, and will indicate that the unpressed instruction information of the row pixel is sent to DDR
It preserves, if non-the first row pixel, is carried out according to following operation:
Prediction data (the i.e. prediction pixel that above-mentioned four kinds of prediction modes obtain each pixel of current line is respectively adopted
Value), and then be calculated under different prediction modes, the difference of the prediction data and raw data of each pixel;
It determines under different prediction modes, the bit-depth of each pixel;
According to above-mentioned four kinds of group modes, current line pixel point is grouped respectively;
It calculates separately under each group mode, each prediction mode, the bit length of each group pixel;
Wherein, under each prediction mode, there are four bit lengths for one group of pixel, correspond to different prediction modes respectively.
It calculates under each group mode, under each prediction mode, the sum of the bit length of each group pixel;
The minimum value of the sum of bit length is compared with bit length threshold value, if the minimum value is not more than bit long
Threshold value is spent, then packing processing is carried out to current line pixel point according to the corresponding group mode of the minimum value and prediction mode, otherwise,
The raw values of current line pixel point are sent to DDR as coded data to preserve, and will indicate the raw values of current line pixel point not
The instruction information of compression is sent to DDR preservations.
Assuming that the corresponding group mode of minimum value is that one-row pixels point is divided into 4 groups, corresponding prediction mode is vertical pre-
Survey pattern.By taking first group of 8 pixels as an example, the difference of raw data and prediction data be respectively (5,1,0,2,4,1,7,
6), bit-depth is respectively (3,1,1,2,3,1,3,3).
The maximal bit depth of this group of pixel is 3, and pixel quantity 8, therefore, the bit length of this group of pixel is
3*8=24bit.
Wherein, when calculating bit-depth, it is contemplated that compression efficiency, if bit-depth be more than a certain threshold value (such as
6bit), it is believed that the difference is needed using raw compress modes (namely without compression), so calculating bit-depth
When, if bit-depth is more than 6, directly indicated with 7, in this way, this parameter information of bit-depth is described just with 3bit
(the binary system range 000~111 that 3 bit can be indicated indicates bit depth from 0~7 respectively) much of that.
Based on inventive concept same as method, the embodiment of the present invention also provides a kind of frame compression set of image, such as Fig. 3
It is shown, including:
First compressing processing module 301, for using the pixel value of the first row pixel of image as the first row pixel
Coded data send, and send the unpressed instruction information of current line pixel point;
Second compressing processing module 302, for since the second row pixel of image, proceeding as follows line by line:
According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;
Determine the difference of the predicted pixel values and its pixel value of each pixel of current line;
Determine that the bit-depth of each pixel of current line, the bit-depth refer to the difference for indicating pixel
Value needs the number of bits occupied;
Current line pixel point is grouped, and determines the bit length of every group of pixel, the bit length is one group
The product of maximal bit depth and the quantity of this group of pixel in pixel;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel
Compressed data packets are packaged as the compressed data of this group of pixel with the difference, the bit length threshold value is for indicating
The pixel value of current line pixel point needs the number of bits occupied;Send the compressed data packets and instruction current line pixel of current line
The instruction information of point compression;
If the sum of bit length of each group pixel is more than bit length threshold value, the pixel value of current line pixel point is made
It is sent for the coded data of current line, and sends the instruction unpressed instruction information of current line pixel point.
Based on inventive concept same as method, the embodiment of the present invention also provides a kind of decompressing device of image, such as Fig. 4
It is shown, including:
First decompression module 401, when for receiving the instruction unpressed instruction information of current line pixel point, general
Pixel value of the coded data of the pixel of the current line received as the pixel of current line;
Second decompression module 402, when for receiving the instruction information for indicating the compression of current line pixel point, according to
The bit-depth of each group pixel carried in each compressed data packets of current line, respectively from each compressed data packets of current line
Obtain the difference of the predicted pixel values and pixel value of each pixel of current line;According to the picture of the difference and previous row pixel
Element value determines that the pixel value of each pixel of current line, the bit-depth refer to for indicating that the difference of pixel needs
The number of bits to be occupied.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (14)
1. a kind of frame compression method of image, which is characterized in that using the pixel value of the first row pixel of image as the first row
The coded data of pixel is sent, and sends the unpressed instruction information of current line pixel point;From the second row pixel of image
Start, proceeds as follows line by line:
According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;
Determine the difference of the predicted pixel values and its pixel value of each pixel of current line;
Determine that the bit-depth of each pixel of current line, the bit-depth refer to for indicating that the difference of pixel needs
The number of bits to be occupied;
Current line pixel point is grouped, and determines the bit length of every group of pixel, the bit length is one group of pixel
The product of maximal bit depth and the quantity of this group of pixel in point;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and institute
It states difference and is packaged as compressed data packets as the compressed data of this group of pixel, the bit length threshold value is for indicating current
The pixel value of row pixel needs the number of bits occupied;The compressed data packets and instruction current line pixel for sending current line press
The instruction information of contracting;
If the sum of bit length of each group pixel is more than bit length threshold value, using the pixel value of current line pixel point as working as
Forward coded data is sent, and sends the instruction unpressed instruction information of current line pixel point.
2. according to the method described in claim 1, it is characterized in that, according to the pixel value of previous row pixel, current line is determined
The predicted pixel values of each pixel, including:According to the pixel value of previous row pixel, determined according at least two prediction modes
The predicted pixel values of each pixel of current line;
Determine the difference of the predicted pixel values and pixel value of each pixel of current line, including:Determine each pixel of current line
According to the difference of predicted pixel values and pixel value that different prediction modes determine;
Determine the bit-depth of each pixel of current line, including:Determine each pixel of current line under different prediction modes
Bit-depth;
Determine the bit length of every group of pixel, including:Determine bit length of the every group of pixel under different prediction modes;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and institute
It states difference and is packaged as compressed data packets as the compressed data of this group of pixel, including:Select each group picture under same prediction mode
The minimum value of the sum of the bit length of vegetarian refreshments, if the minimum value is not more than bit length threshold value, by every group of pixel most
Bit-depth and the difference under small prediction mode are packaged as compressed data packets as the compressed data of this group of pixel, described
Minimum prediction mode is the corresponding prediction mode of the minimum value.
3. method according to claim 1 or 2, which is characterized in that be grouped to current line pixel point, and determine every group
The bit length of pixel, including:Current line pixel point is grouped according at least two group modes, and determines each point
The bit length of every group of pixel under group pattern;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and institute
It states difference and is packaged as compressed data packets as the compressed data of this group of pixel, including:Select each group picture under same packets pattern
The minimum value of the sum of the bit length of vegetarian refreshments will be under minimum packets pattern if the minimum value is not more than bit length threshold value
Every group of pixel bit-depth and the difference be packaged as compressed data packets as the compressed data of this group of pixel, it is described
Minimum packets pattern is the corresponding group mode of the minimum value.
4. according to the method described in claim 3, it is characterized in that, if the sum of bit length of each group pixel be not more than than
Bit length threshold value sends the instruction information of the compressed data packets and instruction current line pixel point compression of current line, including:
It sends the compressed data packets of current line, the instruction information of instruction current line pixel point compression, indicate that current line uses pre-
The instruction information for the group mode that the instruction information and instruction current line of survey pattern use.
5. a kind of decompression method of image, which is characterized in that each row pixel of image, proceed as follows line by line:
If the instruction unpressed instruction information of current line pixel point is received, by the coding of the pixel of the current line received
Pixel value of the data as the pixel of current line;
If the instruction information of instruction current line pixel point compression is received, according to what is carried in each compressed data packets of current line
The bit-depth of each group pixel obtains the prediction picture of each pixel of current line from each compressed data packets of current line respectively
The difference of element value and its pixel value;According to the pixel value of the difference and previous row pixel, each pixel of current line is determined
Pixel value, the bit-depth refers to for indicating that the difference of pixel needs the number of bits that occupies.
6. according to the method described in claim 5, it is characterized in that, according to the pixel value of the difference and previous row pixel,
Determine the pixel value of each pixel of current line, including:
According to the instruction information for the prediction mode that the instruction current line received uses, the prediction mode that current line uses is determined;
The prediction pixel of each pixel of current line is determined according to the pixel value of previous row pixel according to the prediction mode
Value;
According to the difference and the predicted pixel values, the pixel value of each pixel of current line pixel point is determined.
7. method according to claim 5 or 6, which is characterized in that obtained from each compressed data packets of current line respectively
Before the predicted pixel values of each pixel of current line and the difference of pixel value, this method further includes:
According to the instruction information for the group mode that the instruction current line received uses, the group mode that current line uses is determined;
According to the group mode that current line uses, each compressed data packets of current line pixel point are obtained.
8. a kind of frame compression set of image, which is characterized in that including:
First compressing processing module, for using the pixel value of the first row pixel of image as the coded number of the first row pixel
According to transmission, and send the unpressed instruction information of current line pixel point;
Second compressing processing module, for since the second row pixel of image, proceeding as follows line by line:
According to the pixel value of previous row pixel, the predicted pixel values of each pixel of current line are determined;
Determine the difference of the predicted pixel values and its pixel value of each pixel of current line;
Determine that the bit-depth of each pixel of current line, the bit-depth refer to for indicating that the difference of pixel needs
The number of bits to be occupied;
Current line pixel point is grouped, and determines the bit length of every group of pixel, the bit length is one group of pixel
The product of maximal bit depth and the quantity of this group of pixel in point;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and institute
It states difference and is packaged as compressed data packets as the compressed data of this group of pixel, the bit length threshold value is for indicating current
The pixel value of row pixel needs the number of bits occupied;The compressed data packets and instruction current line pixel for sending current line press
The instruction information of contracting;
If the sum of bit length of each group pixel is more than bit length threshold value, using the pixel value of current line pixel point as working as
Forward coded data is sent, and sends the instruction unpressed instruction information of current line pixel point.
9. device according to claim 8, which is characterized in that the second compressing processing module is used for:
According to the pixel value of previous row pixel, the prediction picture of each pixel of current line is determined according at least two prediction modes
Element value;
Determine the difference for the predicted pixel values and pixel value that each pixel of current line is determined according to different prediction modes;
Determine bit-depth of each pixel of current line under different prediction modes;
Determine bit length of the every group of pixel under different prediction modes;
If the sum of bit length of each group pixel is not more than bit length threshold value, each group pixel under same prediction mode is selected
The minimum value of the sum of the bit length of point, if the minimum value is not more than bit length threshold value, by every group of pixel in minimum
Bit-depth and the difference under prediction mode are packaged as compressed data packets as the compressed data of this group of pixel, it is described most
Small prediction mode is the corresponding prediction mode of the minimum value;
If the sum of bit length of each group pixel is more than bit length threshold value, using the pixel value of current line pixel point as working as
Forward coded data is sent, and sends the instruction unpressed instruction information of current line pixel point.
10. device according to claim 8 or claim 9, which is characterized in that be grouped, and determine every to current line pixel point
When the bit length of group pixel, second compressing processing module is used for:According at least two group modes to current line picture
Vegetarian refreshments is grouped, and determines the bit length of every group of pixel under each group mode;
If the sum of bit length of each group pixel is not more than bit length threshold value, by the bit-depth of every group of pixel and institute
When stating difference and being packaged as compressed data packets as the compressed data of this group of pixel, second compressing processing module is used for:Choosing
The minimum value of the sum of bit length of each group pixel under same packets pattern is selected, if the minimum value is not more than bit length
Threshold value, using the bit-depth of every group of pixel under minimum packets pattern and the difference as the compressed data of this group of pixel
Compressed data packets are packaged as, the minimum packets pattern is the corresponding group mode of the minimum value.
11. device according to claim 10, which is characterized in that if the sum of the bit length of each group pixel is not more than
Bit length threshold value, send current line compressed data packets and instruction current line pixel point compression instruction information when, described the
Two compressing processing modules are used for:
It sends the compressed data packets of current line, the instruction information of instruction current line pixel point compression, indicate that current line uses pre-
The instruction information for the group mode that the instruction information and instruction current line of survey pattern use.
12. a kind of decompressing device of image, which is characterized in that including:
First decompression module will receive when for receiving the instruction unpressed instruction information of current line pixel point
Current line pixel coded data as current line pixel pixel value;
Second decompression module, when for receiving the instruction information for indicating the compression of current line pixel point, according to current line
The bit-depth of each group pixel carried in each compressed data packets obtains from each compressed data packets of current line work as respectively
The difference of the predicted pixel values and pixel value of forward each pixel;According to the pixel value of the difference and previous row pixel,
Determine that the pixel value of each pixel of current line, the bit-depth refer to for indicating that the difference of pixel needs to occupy
Number of bits.
13. device according to claim 12, which is characterized in that according to the pixel of the difference and previous row pixel
Value, when determining the pixel value of each pixel of current line, the second decompression module is used for:
According to the instruction information for the prediction mode that the instruction current line received uses, the prediction mode that current line uses is determined;
The prediction pixel of each pixel of current line is determined according to the pixel value of previous row pixel according to the prediction mode
Value;
According to the difference and the predicted pixel values, the pixel value of each pixel of current line pixel point is determined.
14. device according to claim 12 or 13, which is characterized in that obtained from each compressed data packets of current line respectively
Before taking the predicted pixel values of each pixel of current line and the difference of pixel value, the second decompression module is also used
In:
According to the instruction information for the group mode that the instruction current line received uses, the group mode that current line uses is determined;
According to the group mode that current line uses, each compressed data packets of current line pixel point are obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410836815.3A CN105791819B (en) | 2014-12-26 | 2014-12-26 | The decompression method and device of a kind of frame compression method of image, image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410836815.3A CN105791819B (en) | 2014-12-26 | 2014-12-26 | The decompression method and device of a kind of frame compression method of image, image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105791819A CN105791819A (en) | 2016-07-20 |
CN105791819B true CN105791819B (en) | 2018-09-25 |
Family
ID=56389678
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410836815.3A Active CN105791819B (en) | 2014-12-26 | 2014-12-26 | The decompression method and device of a kind of frame compression method of image, image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105791819B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110971904B (en) * | 2018-10-15 | 2020-12-04 | 新相微电子(上海)有限公司 | Control method for image compression |
CN109309836B (en) * | 2018-10-25 | 2021-09-07 | 广州星唯信息科技有限公司 | Image compression method based on prediction difference |
CN112839230B (en) * | 2021-01-20 | 2023-04-28 | 上海思朗科技有限公司 | Image data compression device and image data decompression device |
CN116800956A (en) * | 2022-01-07 | 2023-09-22 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8542938B2 (en) * | 2008-12-31 | 2013-09-24 | Entropic Communications, Inc. | System and method for intra-frame compression using predictive coding |
CN103379334A (en) * | 2012-04-19 | 2013-10-30 | 富士施乐株式会社 | Image encoding apparatus and method, and image decoding apparatus and method |
-
2014
- 2014-12-26 CN CN201410836815.3A patent/CN105791819B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8542938B2 (en) * | 2008-12-31 | 2013-09-24 | Entropic Communications, Inc. | System and method for intra-frame compression using predictive coding |
CN103379334A (en) * | 2012-04-19 | 2013-10-30 | 富士施乐株式会社 | Image encoding apparatus and method, and image decoding apparatus and method |
Non-Patent Citations (1)
Title |
---|
数据多次分组的图像无损压缩算法;高健等;《计算机系统应用》;20101231;第19卷(第12期);第64-68页 * |
Also Published As
Publication number | Publication date |
---|---|
CN105791819A (en) | 2016-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107886560B (en) | Animation resource processing method and device | |
CN109842803B (en) | Image compression method and device | |
RU2630750C1 (en) | Device and method for encoding and decoding initial data | |
CN103581678B (en) | To improve the method and system of decoder capabilities by using multiple decoder channels | |
CN105791819B (en) | The decompression method and device of a kind of frame compression method of image, image | |
US20140086309A1 (en) | Method and device for encoding and decoding an image | |
JP2014525183A (en) | Method and apparatus for image compression storing encoding parameters in a 2D matrix | |
JP2016226001A (en) | Decoder and decoding method | |
US20190200017A1 (en) | Video encoding | |
CA2774976C (en) | Embedded graphics coding: reordered bitstream for parallel decoding | |
EP3635953B1 (en) | Electronic device for high-speed compression processing of feature map of cnn utilizing system and controlling method thereof | |
KR102231975B1 (en) | Techniques for performing a forward transformation by a video encoder using a forward transform matrix | |
CN111885346A (en) | Picture code stream synthesis method, terminal, electronic device and storage medium | |
CN103546161A (en) | Lossless compression method based on binary processing | |
CN104935944A (en) | Method and device for coding and decoding video data | |
CN117014618A (en) | Image compression-based blocking method and system and electronic equipment | |
CN106817584A (en) | A kind of MJPEG compressions implementation method and FPGA based on FPGA | |
JP2010098352A (en) | Image information encoder | |
CN102550009B (en) | Joint scalar embedded graphics coding for color images | |
GB2601890A (en) | Decoding data arrays | |
CN103973310A (en) | Test data compression method based on xor logical operation binary classification | |
CN102577412B (en) | Image coding method and device | |
US9008185B2 (en) | Apparatus and method of lossless compression/restoration of selective image information | |
JP2014143655A (en) | Image encoder, image decoder and program | |
Lee et al. | Low latency variable length coding scheme for frame memory recompression |
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 | ||
CP01 | Change in the name or title of a patent holder |
Address after: 519085 High-tech Zone, Tangjiawan Town, Zhuhai City, Guangdong Province Patentee after: ACTIONS TECHNOLOGY Co.,Ltd. Address before: 519085 High-tech Zone, Tangjiawan Town, Zhuhai City, Guangdong Province Patentee before: ACTIONS (ZHUHAI) TECHNOLOGY Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |