Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out
Clearly and completely describe, it is clear that described embodiment is only a part of embodiment of the present invention, and
It is not all, of embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not making
Go out the every other embodiment obtained under creative work premise, broadly fall into the scope of protection of the invention.
The embodiment of the present invention provides a kind of error concealing method, mainly in the post processing performed by decoding end
Error concealing method, wherein decoding end is can be with any communication equipment of transmitting video image, and flow chart is such as
Shown in Fig. 1, including:
Step 101, selects the pixel of optimal reference macro block as the picture losing macro block in the image of present frame
Element.
Be appreciated that decoding end after receiving view data and being decoded, if a decoded frame
Image has loss macro block, then need first to according to boundary matching algorithm such as BMA algorithm in reference frame
Select optimal reference macro block, for example, it is possible to select in the multiple reference macroblocks included by the image of former frame
Select the boundary pixel difference of and loss macro block surrounding macro blocks (such as up, down, left and right side's macro block)
A minimum reference macroblock is optimal reference macro block.Here macro block is the unit of image slices vegetarian refreshments, such as
One macro block can include that 16*16 pixel, each two field picture can include multiple macro block.
Step 102, determines the multiple parallelogrames in present frame, and this parallelogram is by losing macro block
Article one, deckle, the opposite side of the deckle after movement, and deckle with mobile after two companies of opposite side opposite endpoint
Line forms;In the pixel number run through on each line and loss macro block in addition to deckle and opposite side
The pixel number that another side is run through is identical.
With reference to shown in Fig. 2, it is assumed that loss macro block is the pixel cell of n*n (n is the positive integer more than 1),
Using lose macro block a limit as deckle A, the opposite side B of this deckle A can (-n, n) in the range of
It is that step-length moves with the N individual pixel such as (can arrange N be 1,2,4 or 8), is then equivalent to lose
Macro block has carried out the deformation of 45 ° to 135 ° and has rotated.In this process, after opposite side B moves every time, fixed
Limit A, mobile after opposite side B and deckle A and mobile after the line of opposite endpoint of opposite side B (in figure
Dotted line shown in) parallelogram will be formed, such as, in fig. 2, when opposite side B moves up
After (moving direction is as represented by the arrows in the dashed line in figure 2), deckle A, the opposite side B after moving, the end of deckle A
Point a1 with mobile after the line of opposite endpoint b1 of opposite side B, and the end points a2 of deckle A with mobile after right
The line of opposite endpoint b2 of limit B forms parallelogram.
It should be noted that in the moving process of opposite side B, opposite side B opposite endpoint after deckle A and movement
The pixel number needs that run through of the line pixel number phase usual with losing macro block another side C
With, it is the most all n pixel.Wherein this another side C is to lose in macro block except deckle A and opposite side B
Outside another side, such opposite side B move every time after formed parallelogram area all with lose macro block
Area identical.
Step 103, selects the pixel included by a parallelogram as losing in multiple parallelogrames
Lose the pixel of macro block.
After decoding end obtains multiple parallelogram by step 102, included by each parallelogram
Pixel is the most different, and decoding end can select one according to the boundary matching algorithm as described in step 101
The optimal pixel included by parallelogram is as the pixel of loss macro block, thus recovers loss macro block
Content.Such as: select boundary pixel to differ the one of minimum with the interface pixel losing macro block surrounding macro blocks
Individual parallelogram.
It should be noted that above-mentioned steps 101 to 103 is simply to lose, to one, the side that macro block recovers
Method, in the image of some frame, cover can be according to step 101 to 103 for the mistake of each loss macro block
Perform.
Visible, in the post processing error concealing method of the embodiment of the present invention, decoding end can first pass through step
After boundary matching algorithm in 101, determine loss macro block parallel four limits after rotation further according to step 102
Shape, the pixel finally according to parallelogram again carries out boundary matching algorithm thus recovers loss macro block,
Due in mistake masking process, it is contemplated that the rotating factor of transmission image, and prior art is only passed through
Boundary matching algorithm recover lose macro block method compare, the embodiment of the present invention can improve carry out extensive
The fluency of physical edge Byway in image after Fu.
With reference to shown in Fig. 3, in a specific embodiment, decoding end can be by each two field picture
Included macro block carries out status indication, is labeled as correct, mistake or the state covered, thus convenient
Management to macro block, specifically:
104: macro block included in present frame is scanned by decoding end one by one, if a certain macro block of scanning
State be mistake, and arbitrary macro block (to the upper, lower, left, or right side macro block) of the macro block surrounding of scanning
When state is not mistake, then performs step and select optimal reference macro block, determine multiple parallelogram and choosing
Select the step of parallelogram, i.e. perform above-mentioned steps 101 to 103;If the state of the macro block of scanning is wrong
By mistake, and when the state of arbitrary macro block of the macro block surrounding of scanning be all wrong, illustrate around this macro block is grand
Block is lost, it is impossible to carries out mistake and covers, then continue to scan on next macro block;If the macro block of scanning
State for cover, then performs determine multiple parallelogram and select the step of parallelogram, i.e. holds
Row above-mentioned steps 102 to 103.Wherein after execution of step 101, decoding end can perform step 105,
And after execution of step 103, decoding end can perform step 106.
It is appreciated that when the view data received is decoded by decoding end, needs decoded figure
Macro block in Xiang carries out status indication, is labeled as correct state by decoding correct macro block, will be transmitted across
The macro block lost in journey is labeled as the state of mistake.Decoding end, after completing decoding process, enters loss
Macro block carries out the process that mistake is covered, specifically: decoding end can be first to included in a certain two field picture
Macro block is scanned, the state i.e. determining the information such as macro block of macro block and the pixel included, it is also possible to really
Determine the information such as motion vector of macro block, if the macroblock status of scanning is appointing around mistake and this macro block
When the state of one macro block is not mistake, then the macro block to this mistake is needed to perform above-mentioned steps 101 to 103,
And revise the state of this macro block in this process.Wherein decoding end can be concurrently to multiple loss macro blocks
The process that the mistake carried out is covered.
So that recover each loss macro block in a two field picture, decoding end needs a certain
The macro block of two field picture takes multiple scan, and carries out mistake according to the method in the embodiment of the present invention after scanning
Cover by mistake, wherein the scanning times of a certain two field picture is needed less than or equal to preset value.
It should be noted that decoding end scan macro block time, can according to row or column and with from four weeks in
The order of the heart is scanned, thus then to carry out mistake from the order at four Zhou Dao centers cover losing macro block,
Owing to human eye compares the centre point of concern image, and weaken to both sides attention, therefore use and first cover
Surrounding covers the macro block at center again, can obtain more preferable screening effect.
Such as shown in Fig. 4, decoding end is scanned to the macro block of central series from the macro block of both sides row according to row,
I.e. with the 1st row macro block, the 6th row macro block, the 2nd row macro block, the 5th row macro block ... the order of .. is scanned, as
In figure shown in the arrow of label.
Step 105, will lose the status modifier of macro block for cover.
Step 106, is correct by the status modifier of loss macro block.
In another specific embodiment, decoding end, can be according to border when performing above-mentioned steps 101
Pixel matching algorithm performs, and specifically includes following steps:
A1: lose multiple candidate motion vectors (Motion Vector, MV) that macro block is corresponding according to preset
Determine multiple reference macroblocks corresponding in previous frame image respectively.
In embodiments of the present invention, decoding end can be each state be mistake macro block (i.e. losing macro block)
Set up the table of a corresponding motion vector, these motion vectors may include that in previous frame image with lose
Lose the motion vector of macro block correspondence position macro block, lose the motion of up, down, left and right side's macro block of macro block
Vector average value, loses the meansigma methods of the motion vector intermediate value of up, down, left and right side's macro block of macro block,
And lose the upper macroblock of macro block, lower section macro block, left macro block and the motion vector of right macro block, 0 and lose
Lose the motion vector initial value etc. of macro block.
Wherein a two field picture is divided into some macro blocks, and determines each macro block position in contiguous frames image,
This macro block drawn is fortune in the position of this two field picture with the relative displacement in the position of contiguous frames image
Dynamic vector.Then decoding end is according to losing macro block position in current frame image and each motion vector can obtain
Macro block i.e. reference macroblock to relevant position in previous frame image.
B1: using the pixel of multiple reference macroblocks as the pixel losing macro block, and calculate loss respectively
The boundary pixel of macro block and the difference of the boundary pixel of surrounding macro blocks.
Calculate this difference time can use average absolute calculus of finite differences (mean absolute deviation,
MAD) calculating, specifically, for a macro block, computing macro block each edge is passed through the most respectively
The pixel value worn and the difference of the border pixel values with described limit adjacent macroblocks, and the difference of calculating is carried out
Averagely obtain the MAD value of a macro block, wherein, without the macro block adjacent with a certain bar limit of macro block,
Or the state of adjacent macro block is mistake, this limit is not calculated.
C1: select the reference macroblock of difference minimum of boundary pixel as optimal reference macro block.
By the calculating of above-mentioned steps B, decoding end has obtained the difference that multiple reference macroblock is corresponding, then will be poor
The reference macroblock of value minimum is as optimal reference macro block.
And in the present embodiment, when decoding end is when performing step 102, specifically can by lose in macro block with
One limit of the boundary pixel difference minimum of adjacent macroblocks is as the deckle of parallelogram, thus considers limit
The rotation on the limit that boundary's pixel value difference is maximum.
Decoding end, when performing above-mentioned steps 103, can perform according to boundary pixel matching algorithm, specifically
Comprise the steps:
A2: by respectively using the pixel included by parallelogram each in current frame image as lose macro block
Pixel, and calculate the difference of the boundary pixel of boundary pixel and the surrounding macro blocks of losing macro block respectively, tool
Body ground, can be according to the MAD value calculating parallelogram described in above-mentioned steps B1.
B2: select the pixel of parallelogram of the difference minimum of boundary pixel as the pixel losing macro block.
When, after decoding end execution of step 103, the motion vector losing macro block also determines, and decoding end is permissible
To according to the pixel losing macro block update decoding end preset lose macro block and corresponding candidate motion vector
Corresponding relation, specifically, owing to having recovered this loss macro block, need to delete that this recovers loses
Lose the corresponding relation of macro block and candidate motion vector, and also need to lose around macro block what this recovered
The candidate motion vector that error condition macro block is corresponding is updated, and such as, updates the right of this loss macro block
In the motion vector that macro block is corresponding, the motion vector etc. of left macro block.
In other specific embodiment, decoding end is in the selection carrying out taking turns according to above-mentioned steps A1 to C1
Optimal reference macro block, and recover to lose after macro block according to optimal reference macro block, lose the motion vector of macro block
Also determining that, decoding end can first update the preset corresponding relation losing macro block and candidate motion vector,
And perform above-mentioned steps A1 to C1 again according to the corresponding relation after updating, i.e. perform another and take turns the optimal ginseng of selection
Examine the step of macro block.Then decoding end is before performing above-mentioned steps 102, can perform repeatedly above-mentioned steps
101, i.e. circulate the step repeatedly carrying out selecting optimal reference macro block, in this process, if when previous
When the optimal reference macro block of wheel selection is identical with the optimal reference macro block of last round of selection, illustrate that determine loses
The motion vector losing macro block has been stablized, and can perform above-mentioned steps 102 and 103;If when previous polling
When the optimal reference macro block of the optimal reference macro block selected and last round of selection differs, in addition it is also necessary to continue executing with
Above-mentioned steps 101, until the optimal reference macro block that continuous two-wheeled selects is identical, just performs above-mentioned steps
102 and 103.
The embodiment of the present invention also provides for the decoding end that a kind of communication equipment is the most above-mentioned, structural representation such as Fig. 5
Shown in, including:
Optimum selection unit 10, for selecting the pixel of optimal reference macro block to lose as in the image of present frame
Lose the pixel of macro block;
Tetragon determines unit 11, for determining the multiple parallelogrames in described present frame, described flat
Row tetragon by a deckle of described loss macro block, the opposite side of the described deckle after movement, and described
The line composition of opposite side opposite endpoint after deckle and movement;The pixel number run through on described line with
The pixel number run through except described deckle another side in addition to opposite side in described loss macro block is identical;
Pixel selection unit 12, for determining, at described tetragon, multiple parallelogrames that unit 11 determines
Pixel included by one parallelogram of middle selection is as the pixel of described loss macro block.
In the decoding end of the embodiment of the present invention, first can be determined the picture losing macro block by optimum selection unit 10
After element is the pixel of optimal reference macro block, then determined that unit 11 determines loss macro block after rotation by tetragon
Multiple parallelogrames, last pixel selection unit 12 select from multiple parallelogrames one parallel
The pixel of tetragon is as losing macro block, thus recovers loss macro block.Due to mistake masking process in,
Decoding end is in view of the rotating factor of transmission image, and only comes extensive by boundary matching algorithm in prior art
The method losing macro block again is compared, and can improve the smoothness of physical edge Byway in the image after recovering
Property.
With reference to shown in Fig. 6, in a specific embodiment, communication equipment is except can as shown in Figure 5
Outside structure, it is also possible to including: state updating unit 13 and scanning element 14, and pixel selection unit 12 can
To be realized, wherein by difference computational unit 120 and selection unit 121:
State updating unit 13, for revising the status modifier of losing macro block for having covered or correctly.
Scanning element 14, for being scanned macro block included in described present frame, if scanning is grand
The state of block is mistake, and when the state of arbitrary macro block of the macro block surrounding of described scanning is not mistake, logical
Know that described optimum selection unit 10 selects optimal reference macro block;If the state of the macro block of scanning is for cover,
Then notify that described tetragon determines that unit 11 determines multiple parallelogram.
Specifically, scanning element 14 can be according to row or column and with the order from four Zhou Dao centers, to described
Macro block included in present frame is scanned.
By tetragon described in described current frame image, difference computational unit 120, for determining that unit 11 determines
The pixel included by parallelogram as the pixel of described loss macro block, and calculate described loss macro block
The difference of boundary pixel of boundary pixel and surrounding macro blocks;
Select unit 121, for selecting the difference of boundary pixel that described difference computational unit 120 calculates
The pixel of little parallelogram is as the pixel of described loss macro block.
In the communication equipment of the present embodiment, the macro block of current frame image can be carried out one by one by scanning element 14
Scanning is specifically, it is thus achieved that the information such as the state of each macro block, if the state of the macro block of scanning is for cover,
Then notice tetragon determines that unit 11 determines multiple parallelogram;If the state of the macro block of scanning is wrong
By mistake, and when the state of arbitrary macro block of the macro block surrounding of described scanning is not mistake, informing optimum selects single
Unit 10 selects optimal reference macro blocks, if the state of macro block of scanning is mistake, and its surrounding is arbitrary grand
When the state of block is all mistake, then scanning element 14 continues to scan on next macro block.
In the present embodiment, primarily determined that the pixel losing macro block by optimum selection unit 10 after, Ke Yiyou
The state of this loss macro block is changed into covering by state updating unit 13, and tetragon determines that unit 11 starts
Determine multiple parallelogram, and calculated parallel four by the difference computational unit 120 in pixel selection unit 12
The boundary pixel difference that limit shape is corresponding, selects unit 121 to select one parallel four in multiple parallelogrames
After the pixel of the limit shape final pixel as loss macro block, state updating unit 13 can be by this loss macro block
State change into correctly.The unit of the decoding end of the present embodiment can be according to method stream as shown in Figure 3
Journey figure carries out mistake to loss macro block and covers, and does not repeats at this.
With reference to shown in Fig. 7, in a specific embodiment, communication equipment is except can as shown in Figure 5
Outside structure, it is also possible to including: corresponding relation updating block 15 and macro block comparing unit 16, and optimum selection
By reference macroblock, unit 10 can determine that unit 110, reference difference computing unit 210 and reference select single
Unit 310 realizes, wherein:
Reference macroblock determines unit 110, for the multiple candidates fortune corresponding according to preset described loss macro block
Dynamic vector determines multiple reference macroblocks corresponding in previous frame image respectively, and it is corresponding that one of them loses macro block
Multiple candidate motion vectors may include that in described previous frame image with described loss macro block correspondence position
The motion vector of macro block, the motion vector meansigma methods of up, down, left and right side's macro block of described loss macro block,
The meansigma methods of the motion vector intermediate value of up, down, left and right side's macro block of described loss macro block, and described
Lose the upper macroblock of macro block, lower section macro block, left macro block and the motion vector of right macro block.
By described reference macroblock, reference difference computing unit 210, for determining that the reference that unit 110 determines is grand
The pixel of block is as the pixel of described loss macro block, and calculates boundary pixel and the surrounding of described loss macro block
The difference of the boundary pixel of macro block.
With reference to selecting unit 310, for the boundary pixel selecting described reference difference computing unit 210 to calculate
The minimum reference macroblock of difference as optimal reference macro block.
Corresponding relation updating block 15, updates preset loss for the pixel according to described loss macro block grand
The corresponding relation of block and corresponding candidate motion vector.
In the communication equipment of the present embodiment, the reference macroblock in optimum selection unit 10 determines that unit 110 is the most really
Fixed multiple reference macroblocks, reference difference computing unit 210 boundary pixel calculating reference macroblock corresponding is poor
Value, and by with reference to selecting unit 310 to select the pixel of an optimal reference macro block as the picture losing macro block
Element, thus initially determined that the pixel losing macro block;Determined that unit 11 determines multiple parallel four by tetragon
Limit shape, wherein the deckle in parallelogram can be the loss macro block that reference difference computing unit 210 calculates
In a limit minimum with the boundary pixel difference of adjacent macroblocks;Finally by pixel selection unit 12 multiple
Parallelogram select the pixel of a parallelogram as the pixel losing macro block.Wherein work as pixel
Select unit 12 determining the pixel losing macro block, or the reference in optimum selection unit 10 selects unit 310
After determining the pixel of loss macro block, loss macro block and time can be updated by corresponding relation updating block 15
Select the corresponding relation of motion vector.
It addition, the reference macroblock in optimum selection unit 10 determines unit 110, reference difference computing unit 210
Select unit 310 can carry out the selection optimal reference macro block taken turns, when optimum selection unit 10 with reference more
The corresponding relation circulation updated according to corresponding relation updating block 15 carries out selecting the process of optimal reference macro block
In, can be judged described with reference to selecting unit 310 previous ought take turns the optimal of selection by macro block comparing unit 16
Reference macroblock is the most identical at the optimal reference macro block of last round of selection with reference to selection unit 310 with described, as
Fruit be, then notice tetragon determine that unit 11 determines multiple parallelogram, if it is not, then continue by
Optimum selection unit 10 carries out the selection of another optimal reference macro block taken turns.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment
Suddenly the program that can be by completes to instruct relevant hardware, and this program can be stored in a computer can
Reading in storage medium, storage medium may include that read only memory (ROM), random access memory
(RAM), disk or CD etc..
The error concealing method provided the embodiment of the present invention above and communication equipment, carried out detailed Jie
Continuing, principle and the embodiment of the present invention are set forth by specific case used herein, above reality
The explanation executing example is only intended to help to understand method and the core concept thereof of the present invention;Simultaneously for ability
The those skilled in the art in territory, according to the thought of the present invention, the most all can
Change part, and in sum, this specification content should not be construed as limitation of the present invention.