CN106101706B - A kind of image encoding method and device - Google Patents
A kind of image encoding method and device Download PDFInfo
- Publication number
- CN106101706B CN106101706B CN201610512351.XA CN201610512351A CN106101706B CN 106101706 B CN106101706 B CN 106101706B CN 201610512351 A CN201610512351 A CN 201610512351A CN 106101706 B CN106101706 B CN 106101706B
- Authority
- CN
- China
- Prior art keywords
- frame image
- current
- macro
- current frame
- macro block
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/81—Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
This application involves a kind of image encoding method and devices.This method comprises: reading the current macro of current frame image, determine whether the current macro of the current frame image belongs to occlusion area;If the current macro of the current frame image belongs to de-occlusion region, and the respective macroblock of the previous frame image of the current frame image belongs to occlusion area, then is encoded using current macro of first quantization parameter to the current frame image;Otherwise, it is encoded using current macro of second quantization parameter to the current frame image;Wherein, which is less than second quantization parameter.The application improves picture quality by dynamically distributing quantization parameter.
Description
Technical field
This application involves field of computer technology more particularly to image coding techniques.
Background technique
The compression performance of video encoder is determined by video compression algorithm.Video compress will obtain certain compression ratio,
Reach good picture quality again, this is a pair of contradictory body.Good video compression algorithm, seeks in same picture quality
In the case of, use lower code rate.
Quantization parameter (quantization parameter, English abbreviation QP) be the most important parameter of video compress it
One.In video encoder, QP defines the quantization step after real transform.QP is bigger, and quantization step is bigger, and picture quality is got over
Difference, but compression ratio is higher, and code rate is lower;Conversely, QP is smaller, quantization step is smaller, and picture quality is better, but compression ratio is lower,
Code rate is higher.The size for how determining QP, is the important means of video encoder control code rate, and improves the weight of picture quality
Want means.
In the prior art, it will usually lesser QP is used to I frame (key frame belongs to frame data compression), it is preferable to guarantee
Picture quality, to P frame (difference frame, indicate present frame and former frame difference) use biggish QP, to guarantee lower code
Rate.In this way, using skip mode (SKIP MODE) to P frame, such I for the region in static region or movable compensation
The region of the higher image quality of frame will be extended to P frame, so that the average image quality of entire sequence be made to be improved.
One negative interaction of such method is that, if local area cannot accomplish effective motion compensation in P frame, have residual
When difference needs to encode, since picture qualities of biggish QP used, these place reconstruct can be very low, or even motion smear is generated
Phenomena such as generation.Therefore, such method is not suitable for the case where including occlusion area (uncovering region).It blocks
Region, which refers to be blocked in former frame, can't see, and in the region that present frame reveals.For uncovering region,
Since the region currently revealed can not find reference in former frame, according to the above-mentioned prior art, P frame is used larger
QP, then this is blocked in former frame and the picture quality in the region that present frame reveals can be very poor, it is likely that can produce
Raw motion smear phenomenon.
Summary of the invention
This application provides a kind of image encoding method and device, the application improves picture quality, avoids movement and drags
The generation of tail phenomenon.
On the one hand, the embodiment of the present application provides a kind of image encoding method, comprising: reads the current macro of current frame image
Block, determines whether the current macro of the current frame image belongs to occlusion area;If the current macro of the current frame image belongs to
De-occlusion region, and the respective macroblock of the previous frame image of the current frame image belongs to occlusion area, then using the first quantization
Parameter encodes the current macro of the current frame image;Otherwise, the current frame image is worked as using the second quantization parameter
Preceding macro block is encoded;Wherein, which is less than second quantization parameter.
The embodiment of the present application in current frame image by belonging to de-occlusion region and belong to screening in previous frame image
The macro block for keeping off region using lesser quantization parameter, and uses other macro blocks the mode of larger quantization parameter, improves figure
Image quality amount improves motion smear phenomenon, and only needs to increase a small amount of code stream.
In the design of the application, before the current macro of the reading current frame image, comprising: it is current to read this
The respective macroblock of the previous frame image of frame image, determines whether the respective macroblock of the previous frame image belongs to occlusion area;It should
The mark of blocking of the respective macroblock of previous frame image is correspondingly stored with the macro block of respective macroblock mark, so as to basis
The respective macroblock of the determining previous frame image of macro block mark of the current macro of the current frame image blocks mark.
In the design of the application, before the current macro of the reading current frame image, comprising: sequence is read should
Each macro block of the previous frame image of current frame image, and according to the reading order, store each macro block blocks mark;And the reading
Take the current macro of current frame image, comprising: according to the sequence for reading each macro block of the previous frame image, read the current frame image
Each macro block, so as to according to this sequence, determine the respective macroblock of the previous frame image of the current frame image blocks mark, thus
Determine whether the respective macroblock of the previous frame image belongs to occlusion area.
In one of the application design, whether the current macro of the determination current frame image belongs to occlusion area, wraps
It includes: by Motion Estimation Search Algorithms, obtaining minimum cost value;When the minimum cost value is less than or equal to first threshold,
Determine that the current macro belongs to occlusion area;When the minimum cost value is more than or equal to second threshold, determine that this is current macro
Block belongs to de-occlusion region;Wherein, which is less than the second threshold.
In the design of the application, minimum cost value should be obtained by Motion Estimation Search Algorithms, specifically: it will
The pixel value of each pixel of the current macro of the current frame image and the pixel of one macro block corresponding pixel points of previous frame image
Value, does absolute error and operation;All macro blocks for traversing previous frame image determine the smallest absolute error and for the minimum generation
Value.
In one of the application design, which is non-first frame image, and read the current frame image it
Before include: the respective macroblock for reading first frame image, the respective macroblock that the first frame image is arranged belongs to occlusion area or unshielding
Region, and the respective macroblock in the first frame image is encoded using third quantization parameter, and the third quantization parameter is small
In first quantization parameter.
On the other hand, the embodiment of the present application provides a kind of picture coding device, comprising: read module is worked as reading
The current macro of prior image frame;Determining module is blocked, for determining whether the current macro of the current frame image belongs to blocked area
Domain;Macroblock coding module, if the current macro for the current frame image belongs to de-occlusion region, and the current frame image
The respective macroblock of previous frame image belong to occlusion area, then using the first quantization parameter to the current macro of the current frame image
It is encoded;Otherwise, it is encoded using current macro of second quantization parameter to the current frame image;Wherein, first amount
Change parameter and is less than second quantization parameter.
Another aspect, the embodiment of the present application provide a kind of image encoding method, comprising: read the current of current frame image
Macro block;Determine whether the current macro belongs to occlusion area;If the current macro belongs to occlusion area, the first quantization is used
Parameter encodes the current macro;If the current macro belongs to de-occlusion region, using the second quantization parameter to this
Current macro is encoded;Wherein, which is less than second quantization parameter.
The embodiment of the present application is by belonging to the macro block of occlusion area using lesser quantization parameter, to belonging to unshielding area
The macro block in domain use larger quantization parameter, solve the problems, such as motion smear, improve picture quality, only need increase compared with
Big code rate.
In the design of the application, whether the determination current macro belongs to occlusion area, comprising: is estimated by movement
Searching algorithm is counted, minimum cost value is obtained;When the minimum cost value is less than or equal to first threshold, the current macro is determined
Belong to occlusion area;When the minimum cost value is more than or equal to second threshold, determine that the current macro belongs to unshielding area
Domain;Wherein, which is less than the second threshold.
In the design of the application, minimum cost value should be obtained by Motion Estimation Search Algorithms, specifically: it will
The pixel value of each pixel of the current macro of the current frame image and each picture of one macro block corresponding pixel points of previous frame image
Element value, does absolute error and operation;All macro blocks for traversing previous frame image determine the smallest absolute error and for the minimum
Cost value.
In another aspect, the embodiment of the present application provides a kind of picture coding device, comprising: read module is worked as reading
The current macro of prior image frame;Determining module is blocked, for determining whether the current macro belongs to occlusion area;Macroblock coding mould
Block encodes the current macro using the first quantization parameter if belonging to occlusion area for the current macro;If
The current macro belongs to de-occlusion region, then is encoded using the second quantization parameter to the current macro;Wherein, first amount
Change parameter and is less than second quantization parameter.
Whether the application passes through the occlusion area for determining video image, and be occlusion area according to macro block each in image, moves
It is state each macroblock allocation quantization parameter, respective macroblock is encoded further according to the different quantization parameter.Due to the application
It is to dynamically distribute quantization parameter, therefore the application significantly improves picture quality on the basis of increasing smaller code rate, solves
In video image the problem of motion smear.
Detailed description of the invention
Fig. 1 is the image encoding method flow chart that the application one embodiment provides;
Fig. 2 is the image encoding method flow chart that another embodiment of the application provides;
Fig. 3 is the picture coding device block diagram that the application one embodiment provides;
Fig. 4 is the picture coding device block diagram that another embodiment of the application provides.
Specific embodiment
Below by drawings and examples, the technical solution of the application is described in further detail.
The application, which passes through, determines whether each macro block in video image belongs to occlusion area, and then dynamically adjusts each macro block
Quantization parameter value, respective macroblock is encoded according to different quantization parameter values.Therefore, the application improves video image
Quality solves the problems, such as motion smear, and code stream increasing degree very little.
The application is suitable for all video encoding protocols, such as HEVC (High Efficiency Video Coding, height
Imitate Video coding), AVC (Advanced Video Coding, advanced video coding), AVS (Audio Video coding
Standard, audio/video encoding standard) etc..
Fig. 1 is the image encoding method flow chart that the application one embodiment provides.
Step 101, video image is obtained, such as is acquired by monitoring camera, mobile phone camera, tablet computer camera etc.
Video image.
Step 102, a macro block of current frame image in the video image is read.
In Video coding, a coded image is usually divided into several macro blocks, and a macro block is by a luminance pixel
Block and two chroma pixel block compositions.In general, luminance pixel block is the block of pixels of 16*16 size, and chroma pixel block
Depending on size is according to the sample format of its image.In each coded image, several macro blocks are arranged sheet of form, and video is compiled
As unit of macro block, macro block is encoded code algorithm one by one, forms continuous video code flow.Image provided by the embodiments of the present application
Coding mode is suitable for the macro block of the sizes such as 64*64,32*32,16*16,8*8.
Step 103, judge whether the macro block of the current frame image belongs to occlusion area.
In one example, it determines in the current frame image whether each macro block belongs to by Motion Estimation Search Algorithms to block
Region.
Specifically, the pixel value of each pixel of the macro block of the current frame image is corresponding to each macro block of previous frame image
The pixel value doing mathematics operation of pixel, for example, be absolute difference and (sum of absolute difference, SAD) or
Mean square error and (sum of square error, SSE) or structure similar (strucural s imi larity, SSIM) etc.
Operation obtains minimum SAD or minimum SSE or minimum SSIN etc., by minimum SAD or minimum SSE or minimum SSIN etc. as most
Small cost value mincost can be obtained and be somebody's turn to do in all macro blocks of the previous frame image by minimum cost value mincost
The smallest macro block of macro block difference of current frame image, the smallest macro block of the difference is best similar block.The minimum cost value
Mincost indicates the highest macro block of macro block similarity in all macro blocks of previous frame image with the current frame image, also both
Best similar block.
Below minimum SAD as minimum cost value mincost, to be described in detail and how obtain SAD, and how basis
Minimum SAD, determines whether the macro block in the current frame image belongs to occlusion area.
The pixel value for obtaining each pixel of the macro block of the current frame image first, by the macro block of the current frame image
Each pixel pixel value and one macro block of previous frame image corresponding pixel points pixel value, absolute value is sought after making the difference again
(both absolute differences), then absolute difference corresponding to the pixel value of the macro block all pixels point is summed, to be somebody's turn to do
The sum of absolute difference of pixel value of one macro block of the macro block of current frame image and previous frame image is to get arriving SAD.So
Afterwards, all macro blocks of previous frame image are traversed, that is to say, that the macro block and the previous frame image of the current frame image is all macro
Block does the absolute difference operation of pixel value, then determines the smallest absolute difference, i.e., the smallest SAD.Wherein, deserve
The macroblock size of prior image frame and the macroblock size of the previous frame image are identical.Therefore, the embodiment of the present invention, which passes through, calculates SAD,
The similarity between two macro blocks is obtained, by the smallest SAD of determination, obtains best similar block, and by minimum SAD,
It can know whether the macro block of the current frame image belongs to occlusion area.
Further, the embodiment of the present invention determines whether the macro block of the current frame image belongs in the following manner and blocks
Region: determining the size relation of minimum SAD and first threshold, if minimum SAD is less than or equal to first threshold, it is determined that should
The macro block of current frame image belongs to de-occlusion region, the reason is that the macro block of the current frame image and its corresponding optimum similar block
Difference very little;If minimum SAD is more than or equal to second threshold, and the first threshold is less than the second threshold, it is determined that should
The macro block of current frame image belongs to occlusion area, the reason is that the macro block of the current frame image and its corresponding optimum similar block
Difference is very big.For example, the video image is divided into the macro block of several 16*16 pixels, setting first threshold is 800, second threshold
It is 3000.
Step 104, store the macro block of the current frame image blocks mark, for example, if the macro block belongs to occlusion area,
Then blocking for the macro block is identified as 1, if the macro block belongs to de-occlusion region, blocking for the macro block is identified as 0.
It should be noted that the macro block of the step 104 storage current frame image blocks mark, in order to next
Frame image does image coding and uses;Also, in the same way, stored all macro blocks of previous frame image blocks mark.
In one example, the mark of blocking of each macro block of video image is correspondingly stored with the mark of respective macroblock
Get up.For example, macro block mark 1001010, blocks mark 1.
In another example, each macro block blocks mark in sequential storage video image.For example, for the video image
Every frame image, the sequence for blocking mark for storing each macro block is equal are as follows: from left to right, from top to bottom.
Step 105, if the macro block that step 103 determines the current frame image belongs to occlusion area, the first amount is used
Change parameter QP to encode the macro block of the current frame image.
Quantization parameter QP refers to the quantization step after residual error variation, and quantization parameter QP is bigger, and quantization step is bigger, compression etc.
Grade is higher, and the data volume after coding is smaller, and encoded images quality is poorer.
In one example, which is existing quantization parameter value.For example, being 16*16 for size
The video image of macro block, usual existing quantization parameter value are 30, then first quantization parameter value is 30.
It should be noted that after the macro block that step 103 determines the current frame image belongs to occlusion area
Mark is blocked first to store the macro block of the current frame image, then the macro block of the current frame image encoded, it can also
With first to the macroblock coding of the current frame image, then stores the macro block of the current frame image and blocks mark, that is to say, that
Both step 104 can have been first carried out and executed step 105 again, step 105 can also be first carried out and execute step 104 again.
Step 106, it if the macro block that step 103 determines the current frame image belongs to de-occlusion region, obtains previous
The correspondence macro block of frame image blocks mark;Wherein, the correspondence macro block of the previous frame image refer in previous frame image with deserve
The macro block of prior image frame is in the macro block on same position.
In one example, the mark storage mode that blocks of each macro block of the video image is macro block mark and the macro block
Block mark correspondingly store.Specifically, by arbitrary frame image in video image, including previous frame image, present frame figure
Picture, next frame image etc., are identified each macro block according to each macro block present position, obtain respective macroblock mark.Therefore, it is in
Arbitrary frame image at same position, macro block mark is identical, therefore, can be obtained by the macro block mark of the current frame image
The macro block mark of respective macroblock into previous frame image in same position.The embodiment of the present invention is by each macro block of video image
Macro block identify corresponding with mark is blocked storage, the macro block of each macro block of previous frame image identify with block identify it is corresponding
Storage, therefore the macro block that can obtain the respective macroblock of previous frame image is identified by the macro block of the macro block of the current frame image
Mark is identified by the macro block of the respective macroblock of the previous frame image, can obtain the screening of the respective macroblock of the previous frame image
Gear mark.
In another example, the mark storage mode that blocks of each macro block of the video image is the sequential storage video
Each macro block blocks mark in image, then according to the sequence for reading in current frame image the macro block, obtains previous frame image
Respective macroblock blocks mark.
Step 107, determine whether the respective macroblock of the previous frame image belongs to occlusion area.That is, it is determined whether
The macro block of the current frame image belongs to de-occlusion region, and the respective macroblock of previous frame image belongs to occlusion area.
Specifically, mark is blocked according to the respective macroblock of the previous frame image got, determines the previous frame image
Respective macroblock whether belong to occlusion area.
Step 108, if the respective macroblock of the previous frame image belongs to de-occlusion region, the first quantization parameter pair is used
The macro block of the current frame image is encoded.
Quantization parameter QP refers to the quantization step after residual error variation, and quantization parameter QP is bigger, and quantization step is bigger, compression etc.
Grade is higher, and the data volume after coding is smaller, and encoded images quality is poorer.
In one example, which is existing quantization parameter value.For example, being 16*16 for size
The video image of macro block, usual existing quantization parameter value are 30, then first quantization parameter value is 30.
Step 109, if the respective macroblock of the previous frame image belongs to occlusion area, using the second quantization parameter to this
The macro block of current frame image is encoded, and second quantization parameter is less than first quantization parameter value.
That is, if met, " macro block of current frame image belongs to de-occlusion region, and previous frame image is corresponding
Macro block belongs to occlusion area " condition when, encoded using the macro block of the second quantization parameter to the current frame image, and this
Two quantization parameters are less than the first quantization parameter.
Step 110, all macro blocks in the current frame image are traversed, and for any macro block, only in current frame image
The macro block belong to de-occlusion region and when the respective macroblock of previous frame image belongs to occlusion area, use the second quantization parameter
The macro block of the current frame image is encoded, is otherwise carried out using the macro block of the first quantization parameter to the current frame image
Coding, wherein second quantization parameter is less than the first quantization parameter.
Specifically, when the macro block of current frame image belongs to occlusion area, using the first quantization parameter to deserving
The macro block of prior image frame is encoded;Belong to de-occlusion region, and the phase of previous frame image in the macro block of current frame image
It answers macro block to belong in the case of de-occlusion region, is encoded using the macro block of the first quantization parameter to the current frame image;In
The macro block of current frame image belongs to de-occlusion region, and the respective macroblock of previous frame image belongs in the case of occlusion area, makes
It is encoded with the macro block of the second quantization parameter to the current frame image;And second quantization parameter is less than the first quantization ginseng
Number.
In addition, for the case where current frame image is first frame image, since there is no previous frame image, therefore can not basis
Motion estimation algorithm knows the occlusion area of the first frame image, and therefore, any macro block being directly arranged in the first frame image is non-
Occlusion area or occlusion area, and quantization parameter value more smaller than the first quantization parameter value can be used to the first frame image
Each macro block encoded.
To sum up, in one frame of image, an occlusion area may include one or more macro blocks, and occlusion area is come
It says, if former frame is blocked, and if present frame reveals, if that using the quantization parameter value of the prior art
(i.e. the first quantization parameter) encodes the macro block of the occlusion area, then can generate biggish residual error, influence video image
Phenomena such as quality, such as generation motion smear.In current frame image and the embodiment of the present application is blocked in previous frame image
In the macro block that reveals again, encoded in present frame use the second quantization parameter more smaller than existing quantization parameter value, and
Other macro blocks are then encoded using existing quantization parameter i.e. the first quantization parameter, while improving picture quality, are saved
Code rate.
Above-mentioned image encoding method is, when detecting that the macro block in image belongs to occlusion area, postpones a frame to adjust
Quantization parameter, that is to say, that when detecting that the macro block in current frame image belongs to occlusion area, use existing quantization parameter
The macro block is encoded;When the macro block for detecting current frame image belongs to the corresponding macro of de-occlusion region and next frame image
When block belongs to de-occlusion region, the macro block is encoded using quantization parameter more smaller than existing quantization parameter, in this way, increasing
In the case where adding a small amount of code stream, video image quality is improved.In fact, the macro block in current frame image can also detected
When belonging to occlusion area, with regard to being encoded using quantization parameter more smaller than existing quantization parameter value to the macro block, it is explained in detail below.
Fig. 2 is the method for video coding flow chart that another embodiment of the application provides.
Step 201, video image is obtained, such as is acquired by monitoring camera, mobile phone camera, tablet computer camera etc.
Video image.
Step 202, a macro block of current frame image in the video image is read.
In Video coding, video coding algorithm is as unit of macro block, and macro block is encoded one by one, forms continuous video
Code stream.
Step 203, judge whether the macro block of the current frame image belongs to occlusion area.
In one example, determine whether the macro block in the current frame image belongs to screening by Motion Estimation Search Algorithms
Keep off region.
In one example, it determines in the current frame image whether each macro block belongs to by Motion Estimation Search Algorithms to block
Region.
Specifically, the pixel value of each pixel of the macro block of the current frame image is corresponding to each macro block of previous frame image
The pixel value doing mathematics operation of pixel, for example, be absolute difference and (sum of absolute difference, SAD) or
Mean square error and (sum of square error, SSE) or structure similar (strucural s imi larity, SSIM) etc.
Operation obtains minimum SAD or minimum SSE or minimum SSIN etc., by minimum SAD or minimum SSE or minimum SSIN etc. as most
Small cost value mincost can be obtained and be somebody's turn to do in all macro blocks of the previous frame image by minimum cost value mincost
The smallest macro block of macro block difference of current frame image, the smallest macro block of the difference is best similar block.The minimum cost value
Mincost indicates the highest macro block of macro block similarity in all macro blocks of previous frame image with the current frame image, also both
Best similar block.
Below minimum SAD as minimum cost value mincost, to be described in detail and how obtain SAD, and how basis
Minimum SAD, determines whether the macro block in the current frame image belongs to occlusion area.
The pixel value for obtaining each pixel of the macro block of the current frame image first, by the macro block of the current frame image
Each pixel pixel value and one macro block of previous frame image corresponding pixel points pixel value, absolute value is sought after making the difference again
(both absolute differences), then absolute difference corresponding to the pixel value of the macro block all pixels point is summed, to be somebody's turn to do
The sum of absolute difference of pixel value of one macro block of the macro block of current frame image and previous frame image is to get arriving SAD.So
Afterwards, all macro blocks of previous frame image are traversed, that is to say, that the macro block and the previous frame image of the current frame image is all macro
Block does the absolute difference operation of pixel value, then determines the smallest absolute difference, i.e., the smallest SAD.Wherein, deserve
The macroblock size of prior image frame and the macroblock size of the previous frame image are identical.Therefore, the embodiment of the present invention, which passes through, calculates SAD,
The similarity between two macro blocks is obtained, by the smallest SAD of determination, obtains best similar block, and by minimum SAD,
It can know whether the macro block of the current frame image belongs to occlusion area.
Further, the embodiment of the present invention determines whether the macro block of the current frame image belongs in the following manner and blocks
Region: determining the size relation of minimum SAD and first threshold, if minimum SAD is less than or equal to first threshold, it is determined that should
The macro block of current frame image belongs to de-occlusion region, the reason is that the macro block of the current frame image and its corresponding optimum similar block
Difference very little;If minimum SAD is more than or equal to second threshold, and the first threshold is less than the second threshold, it is determined that should
The macro block of current frame image belongs to occlusion area, the reason is that the macro block of the current frame image and its corresponding optimum similar block
Difference is very big.For example, the video image is divided into the macro block of several 16*16 pixels, setting first threshold is 800, second threshold
It is 3000.
Step 204, if the macro block belongs to de-occlusion region, the current frame image is somebody's turn to do using the first quantization parameter
Macro block is encoded, which can be a kind of existing quantization parameter value.For example, for being 16* for size
The image of 16 macro blocks, it is 30 that the existing quantization parameter value, which is arranged, then first quantization parameter value is 30.
Step 205, if the macro block belongs to occlusion area, using the second quantization parameter to the current frame image this is macro
Block is encoded, and second quantization parameter is less than first quantization parameter value.
Step 206, all macro blocks in the current frame image are traversed, any macro block in the current frame image is come
It says, if it belongs to de-occlusion region, is encoded using the macro block of the first quantization parameter to the current frame image, if it belongs to
It in occlusion area, is then encoded using the macro block of the second quantization parameter to the current frame image, wherein the second quantization ginseng
Number is less than the first quantization parameter.
Fig. 3 is the picture coding device block diagram that the application one embodiment provides.The picture coding device includes reading mould
Block 310 blocks determining module 320, macroblock coding module 330;Further, which further includes processing module
340。
In Fig. 3, read module 310 is used to read the current macro of current frame image.
Determining module 320 is blocked for determining whether the current macro of the current frame image belongs to occlusion area.
If current macro of the macroblock coding module 330 for the current frame image belongs to de-occlusion region, and deserves
The respective macroblock of the previous frame image of prior image frame belongs to occlusion area, then using the first quantization parameter to the current frame image
Current macro is encoded;Otherwise, it is encoded using current macro of second quantization parameter to the current frame image;Wherein,
First quantization parameter is less than second quantization parameter.
In one example, read module 310 is also used to read the respective macroblock of the previous frame image of the current frame image;
It blocks determining module 320 and is also used to determine whether the respective macroblock of the previous frame image belongs to occlusion area;Processing module 340 is also
For the mark of blocking of the respective macroblock of the previous frame image correspondingly to be stored with the macro block of respective macroblock mark,
The corresponding of the determining previous frame image is identified to block determining module 320 according to the macro block of the current macro of the current frame image
Macro block blocks mark.
In one example, modulus block 310 is specifically used for sequentially reading each macro of the previous frame image of the current frame image
Block;Processing module 340 is specifically used for according to the reading order, and store each macro block blocks mark;Read module 310 is specifically used
According to the sequence for reading each macro block of the previous frame image, each macro block of the current frame image is read, so as to processing module 340
The respective macroblock of the previous frame image of the current frame image is determined according to the sequence blocks mark, to block determining module 320
It can determine whether the respective macroblock of the previous frame image belongs to occlusion area.
In one example, it blocks determining module 320 to be specifically used for: by Motion Estimation Search Algorithms, obtaining minimum generation
Value;When the minimum cost value is less than or equal to first threshold, determine that the macro block belongs to occlusion area;In the minimum cost
Value is more than or equal in the case of second threshold, determines that the macro block belongs to de-occlusion region;Wherein, which is less than second threshold
Value.
In one example, it blocks determining module 320 to be specifically used for, by each pixel of the current macro of the current frame image
The pixel value of point and each pixel value of one macro block corresponding pixel points of previous frame image, do absolute error and operation;It traverses previous
All macro blocks of frame image determine the smallest absolute error and for the minimum cost value.
In one example, current frame image is non-first frame image, and read module 310 is also used to read the phase of first frame image
Answer macro block;The respective macroblock that processing module 340 is also used to be arranged the first frame image belongs to occlusion area or de-occlusion region;It is macro
Block coding module 330 is also used for third quantization parameter and encodes to the respective macroblock in the first frame image, and this
Three quantization parameters are less than first quantization parameter.
Fig. 4 is the picture coding device block diagram that another embodiment of the application provides.The picture coding device includes reading
Module 410 blocks determining module 420, macroblock coding module 430.
Read module 410 is used to read the current macro of current frame image.
Determining module 420 is blocked for determining whether the current macro belongs to occlusion area.
If macroblock coding module 430 belongs to occlusion area for the current macro, using the first quantization parameter to this
Current macro is encoded;If the current macro belongs to de-occlusion region, using the second quantization parameter to the current macro
It is encoded;Wherein, which is less than second quantization parameter.
In one example, it blocks determining module 420 to be specifically used for, by Motion Estimation Search Algorithms, obtains minimum generation
Value;If the minimum cost value is less than or equal to first threshold, determine that the current macro belongs to occlusion area;If the minimum cost value
More than or equal to second threshold, determine that the current macro belongs to de-occlusion region;Wherein, which is less than the second threshold.
Further, determining module 420 is blocked to be specifically used for, by each pixel value of the current macro of current frame image with
Each pixel value of one macro block of previous frame image, does absolute error and operation;All macro blocks of previous frame image are traversed, are determined most
The small absolute error and be the minimum cost value.
Foregoing describe the data transmission method for uplink of the embodiment of the present application.Those skilled in the art is, it is realized that the method
Embodiment and each step process can be realized in hardware.Those skilled in the art are according to above method embodiment, energy
Corresponding module and deformation are enough constructed, these modules and deformation should be attributed to the application protection scope, and details are not described herein.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It is not considered that exceeding scope of the present application.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can be executed with hardware, processor
The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described specific embodiment has carried out further the purpose of the application, technical scheme and beneficial effects
It is described in detail, it should be understood that being not used to limit the application the foregoing is merely the specific embodiment of the application
Protection scope, within the spirit and principles of this application, any modification, equivalent substitution, improvement and etc. done should all include
Within the scope of protection of this application.
Claims (9)
1. a kind of image encoding method characterized by comprising
The current macro for reading current frame image, determines whether the current macro of the current frame image belongs to occlusion area, institute
Occlusion area is stated to be blocked in former frame, and in the region that present frame reveals;
If the current macro of the current frame image belongs to de-occlusion region, and the previous frame image of the current frame image
Respective macroblock belong to occlusion area, then encoded using current macro of first quantization parameter to the current frame image;
Otherwise, it is encoded using current macro of second quantization parameter to the current frame image;
Wherein, first quantization parameter is less than second quantization parameter.
2. the method according to claim 1, wherein it is described read current frame image current macro before,
Include:
The respective macroblock for reading the previous frame image of the current frame image, determine the previous frame image respective macroblock whether
Belong to occlusion area;
The mark of blocking of the respective macroblock of the previous frame image is correspondingly stored with the macro block of respective macroblock mark
Get up, so as to according to the respective macroblock of the determining previous frame image of the macro block of the current macro of current frame image mark
Block mark.
3. the method according to claim 1, wherein it is described read current frame image current macro before,
Include:
Sequence reads each macro block of the previous frame image of the current frame image, and according to reading order, stores each macro block
Block mark;
And the current macro for reading current frame image, comprising:
According to the sequence for reading each macro block of previous frame image, each macro block of the current frame image is read, so as to according to institute
Sequence is stated, determine the respective macroblock of the previous frame image of the current frame image blocks mark, so that it is determined that the former frame
Whether the respective macroblock of image belongs to occlusion area.
4. according to claim 1 to method described in 3 any one, which is characterized in that the determination current frame image
Whether current macro belongs to occlusion area, comprising:
By Motion Estimation Search Algorithms, minimum cost value is obtained;
When the minimum cost value is less than or equal to first threshold, determine that the current macro belongs to de-occlusion region;
When the minimum cost value is more than or equal to second threshold, determine that the current macro belongs to occlusion area;
Wherein, the first threshold is less than the second threshold.
5. according to the method described in claim 4, obtaining minimum generation it is characterized in that, described by Motion Estimation Search Algorithms
Value, specifically:
By the pixel value of each pixel of the current macro of the current frame image and one macro block respective pixel of previous frame image
The pixel value of point, does absolute error and operation;
All macro blocks for traversing previous frame image determine the smallest absolute error and for the minimum cost value.
6. according to claim 1 to method described in 3 or claim 5 any one, which is characterized in that the current frame image
For non-first frame image, and before reading the current frame image include:
The respective macroblock of first frame image is read, the respective macroblock that the first frame image is arranged belongs to occlusion area or unshielding area
Domain, and the respective macroblock in the first frame image is encoded using third quantization parameter, and the third quantization parameter
Less than first quantization parameter.
7. a kind of picture coding device characterized by comprising
Read module, for reading the current macro of current frame image;
Determining module is blocked, for determining whether the current macro of the current frame image belongs to occlusion area, the blocked area
Domain is to be blocked in former frame, and in the region that present frame reveals;
Macroblock coding module, if the current macro for the current frame image belongs to de-occlusion region, and described current
The respective macroblock of the previous frame image of frame image belongs to occlusion area, then using the first quantization parameter to the current frame image
Current macro is encoded;Otherwise, it is encoded using current macro of second quantization parameter to the current frame image;
Wherein, first quantization parameter is less than second quantization parameter.
8. device according to claim 7, which is characterized in that it is described to block determining module, it is specifically used for:
By Motion Estimation Search Algorithms, minimum cost value is obtained;
When the minimum cost value is less than or equal to first threshold, determine that the macro block belongs to de-occlusion region;
When the minimum cost value is more than or equal to second threshold, determine that the macro block belongs to occlusion area;
Wherein, the first threshold is less than the second threshold.
9. device according to claim 8, which is characterized in that the determining module of blocking is calculated by motion estimation search
Method obtains minimum cost value, specifically:
By the pixel value of each pixel of the current macro of the current frame image and one macro block respective pixel of previous frame image
Each pixel value of point, does absolute error and operation;
All macro blocks for traversing previous frame image determine the smallest absolute error and for the minimum cost value.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911061664.8A CN110769255B (en) | 2016-06-30 | 2016-06-30 | Image coding method and device |
CN201610512351.XA CN106101706B (en) | 2016-06-30 | 2016-06-30 | A kind of image encoding method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610512351.XA CN106101706B (en) | 2016-06-30 | 2016-06-30 | A kind of image encoding method and device |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911061664.8A Division CN110769255B (en) | 2016-06-30 | 2016-06-30 | Image coding method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106101706A CN106101706A (en) | 2016-11-09 |
CN106101706B true CN106101706B (en) | 2019-11-19 |
Family
ID=57211699
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610512351.XA Active CN106101706B (en) | 2016-06-30 | 2016-06-30 | A kind of image encoding method and device |
CN201911061664.8A Active CN110769255B (en) | 2016-06-30 | 2016-06-30 | Image coding method and device |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911061664.8A Active CN110769255B (en) | 2016-06-30 | 2016-06-30 | Image coding method and device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN106101706B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3340623B1 (en) * | 2016-12-20 | 2023-04-12 | Axis AB | Method of encoding an image including a privacy mask |
CN111405279B (en) * | 2019-01-03 | 2021-06-29 | 华为技术有限公司 | Quantization and inverse quantization method and device |
CN111654699B (en) * | 2020-05-29 | 2024-05-17 | 西安万像电子科技有限公司 | Image transmission method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7142600B1 (en) * | 2003-01-11 | 2006-11-28 | Neomagic Corp. | Occlusion/disocclusion detection using K-means clustering near object boundary with comparison of average motion of clusters to object and background motions |
CN101855911A (en) * | 2007-09-28 | 2010-10-06 | 杜比实验室特许公司 | Treating video information |
CN104038666A (en) * | 2014-04-22 | 2014-09-10 | 深圳英飞拓科技股份有限公司 | Video shielding detection method and video shielding detection device |
CN104980759A (en) * | 2014-04-09 | 2015-10-14 | 联发科技股份有限公司 | Method for Detecting Occlusion Areas |
CN105516720A (en) * | 2015-12-23 | 2016-04-20 | 天津天地伟业数码科技有限公司 | Self-adaptive control method for code stream of surveillance camera |
EP2237559B1 (en) * | 2009-03-30 | 2016-05-11 | Vestel Elektronik Sanayi ve Ticaret A.S. | Background motion estimate based halo reduction |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030123539A1 (en) * | 2001-12-28 | 2003-07-03 | Hyung-Suk Kim | Method and apparatus for video bit-rate control |
CN100366091C (en) * | 2004-06-24 | 2008-01-30 | 华为技术有限公司 | Video frequency compression |
CN100527842C (en) * | 2007-01-26 | 2009-08-12 | 清华大学 | Background-based motion estimation coding method |
CN101252687B (en) * | 2008-03-20 | 2010-06-02 | 上海交通大学 | Method for implementing multichannel combined interested area video coding and transmission |
CN101262603B (en) * | 2008-03-27 | 2011-08-31 | 方春 | A self-adapted code rate control method |
CN101677398A (en) * | 2008-09-19 | 2010-03-24 | 三星电子株式会社 | Scene switching code rate control method |
US9621896B2 (en) * | 2011-06-10 | 2017-04-11 | Citrix Systems Inc. | Macroblock-level adaptive quantization in quality-aware video optimization |
CN102263955B (en) * | 2011-07-21 | 2013-04-03 | 福建星网视易信息系统有限公司 | Method for detecting video occlusion based on motion vectors |
KR20130084850A (en) * | 2012-01-18 | 2013-07-26 | 삼성전자주식회사 | Method and apparatus for image processing generating disparity value |
ITTO20120413A1 (en) * | 2012-05-08 | 2013-11-09 | Sisvel Technology Srl | METHOD FOR THE GENERATION AND RECONSTRUCTION OF A THREE-DIMENSIONAL VIDEO FLOW, BASED ON THE USE OF THE MAP OF OCCLUSIONS, AND CORRESPONDING DEVICE FOR GENERATION AND RECONSTRUCTION. |
CN104253995B (en) * | 2013-06-26 | 2017-10-20 | 中国电信股份有限公司 | Adaptive quantizing parameter control method and device |
CN104754361B (en) * | 2013-12-28 | 2018-01-23 | 同济大学 | Image Coding, coding/decoding method and device |
-
2016
- 2016-06-30 CN CN201610512351.XA patent/CN106101706B/en active Active
- 2016-06-30 CN CN201911061664.8A patent/CN110769255B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7142600B1 (en) * | 2003-01-11 | 2006-11-28 | Neomagic Corp. | Occlusion/disocclusion detection using K-means clustering near object boundary with comparison of average motion of clusters to object and background motions |
CN101855911A (en) * | 2007-09-28 | 2010-10-06 | 杜比实验室特许公司 | Treating video information |
EP2237559B1 (en) * | 2009-03-30 | 2016-05-11 | Vestel Elektronik Sanayi ve Ticaret A.S. | Background motion estimate based halo reduction |
CN104980759A (en) * | 2014-04-09 | 2015-10-14 | 联发科技股份有限公司 | Method for Detecting Occlusion Areas |
CN104038666A (en) * | 2014-04-22 | 2014-09-10 | 深圳英飞拓科技股份有限公司 | Video shielding detection method and video shielding detection device |
CN105516720A (en) * | 2015-12-23 | 2016-04-20 | 天津天地伟业数码科技有限公司 | Self-adaptive control method for code stream of surveillance camera |
Also Published As
Publication number | Publication date |
---|---|
CN110769255B (en) | 2022-04-22 |
CN110769255A (en) | 2020-02-07 |
CN106101706A (en) | 2016-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110933424B (en) | Multiple prediction blocks for an intra-coded block | |
US11363264B2 (en) | Sample adaptive offset control | |
CN113411577B (en) | Coding method and device | |
TWI605703B (en) | Sample adaptive offset control | |
KR102287414B1 (en) | Low Complexity Mixed Domain Cooperative In-Loop Filter for Lossy Video Coding | |
CN110199524A (en) | Noise inhibiting wave filter | |
US20220116664A1 (en) | Loop filtering method and device | |
CN106101706B (en) | A kind of image encoding method and device | |
CN112544081A (en) | Method and device for loop filtering | |
Wennersten et al. | Bilateral filtering for video coding | |
CN113068026B (en) | Coding prediction method, device and computer storage medium | |
CN110944198A (en) | Chroma mode intra coding | |
WO2022133320A1 (en) | Network based image filtering for video coding | |
CN114175653B (en) | Method and apparatus for lossless codec mode in video codec | |
US20240340446A1 (en) | Encoding resolution control | |
CN117643053A (en) | Network-based video codec image filtering | |
KR20160125712A (en) | Simplified Rate-Distortion calculation method considering quantization parameters for a hardware-based sample adaptive offset in hevc encoder | |
CN118435595A (en) | Intra-frame prediction method, device, system and storage medium | |
CN116546211A (en) | Video encoding method, video encoding device, computer equipment and storage medium | |
CN118474373A (en) | Encoding and decoding method and device | |
CN114586355A (en) | Method and apparatus for lossless codec mode in video codec |
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 |