Summary of the invention
The object of the present invention is to provide a kind of error detection real-time low, hide the error control method that is used for video decoder chip that combines by error detection, mistake with the error correction algorithm complexity.
Purpose of the present invention can realize by following technical measures: a kind of error control method that is used for video decoder chip, and its processing procedure may further comprise the steps:
(1), carry out error detection based on syntactic element importance, wrong classification is handled, drawn to be summed up as and lose one frame/multiple image or lost part macro block two class results in the video decode controlling unit.
(2), according to the error detection result of step (1), carry out corresponding mistake in the decoding controlling unit and hide at losing one frame/multiple image, carry out corresponding mistake at the lost part macro block in the de-blocking filter link and hide.
The error detection of step of the present invention (1) is: to sequence head parameter set, image head parameter set, sheet parameter, macroblock parameters and five kinds of detections that the parameter information that main syntactic element comprised carries out of piece parameter.
The mistake of step of the present invention (1) is classified as: the parameter information that sequence head parameter set, image head parameter set are comprised makes a mistake and is considered as the image level mistake, is summed up as and loses one frame/multiple image; Sheet parameter, macroblock parameters and piece parameter make a mistake and are considered as the macro-block level mistake, are summed up as the lost part macro block.
The mistake that other encoded digital information that lost part macro block of the present invention also comprises in the code stream being comprised takes place, this mistake also can be considered the macro-block level mistake, is summed up as the lost part macro block.
The mistake at losing one frame/multiple image of step of the present invention (2) hide for: if sequence parameter set is made mistakes, then abandon whole sequence, occur until next sequence head; If picture parameter set is made mistakes, then end the decoding of current image frame, add the frame number lose, and the former frame of lost frames in the image buffer is pointed in the address of lost frames, cover lost frames with the decoded data that former frame is correct.
The mistake at the lost part macro block of step of the present invention (2) hide for: from the macro block of makeing mistakes, abandon whole of current macro place, all macro blocks from current macro in this sheet of mark are erroneous macroblock, and withdraw from current decoding program, directly begin to continue decoding from the next correct sheet that searches.
The mistake at the lost part macro block of step of the present invention (2) is hidden and is comprised respectively to losing spatial domain type macro block and the mistake of losing time domain type macro block being hidden.Wherein said spatial domain type macro block is for adopting the macro block that picture frame comprised of spatial prediction technology, and the spatial prediction technology is to utilize the technology that the spatial coherence between the adjacent macroblocks pixel is predicted in the picture frame; Described time domain type macro block is the macro block that adopts motion estimation technique in the picture frame, and motion estimation technique is a technology of utilizing the temporal correlation of picture frame adjoining in the video sequence to predict.
Mistake to spatial domain type macro block of the present invention hide for: judge whether error macro block left macro block and top macro block exist, if all exist, then the top macro block pixel value bottom and the average reconstruct error macro block of the rightmost pixel value of left macro block to read in; If only there is the left macro block, then read in the rightmost pixel value reconstruct of its left macro block error macro block; If only have top macro block, then top macro block pixel value reconstruct error macro block bottom to read in; If top macro block and left macro block do not exist, then with pixel value 128 reconstruct error macro blocks.
Mistake to time domain type macro block of the present invention hide for: described mistake to time domain type macro block hide into: the motion vector of the average of the motion vector of error macro block next-door neighbour's upper block and left piece as error macro block, then according to its motion vector value, directly the macro block pixels value of copy error macro block former frame image relevant position is as the current pixel value of losing macro block, reconstruct current macro.
Compared with prior art, adopt method of the present invention that following advantage is arranged:
(1) error detection is real-time, and location of mistake accuracy height, and to whole video decode system close friend is difficult for causing causing because of fatal error the serious system failures such as deadlock;
(2) the error correction algorithm complexity is low, and operand is little, and speed is fast;
(3) for realizing that video decoding chip has the advantage of aspects such as high speed, low-power consumption, has good prospects for application in built-in field;
(4) any Video Decoder being had general applicability, promptly do not rely on video algorithm itself, is the very strong video decode error-control technique of a kind of versatility.
Embodiment
The method that the present invention takes is hidden to combine based on error detection, mistake and is realized.As shown in Figure 1, be error detection of the present invention and wrong hiding in conjunction with the block diagram that is applied to Video Decoder.Wherein decoder comprises: buffering area is used to receive the code stream from encoded video; The entropy decoding, the bit stream that is used to decode through buffering generates decoding control information and residual transform coefficient; Residual transform coefficient generates residual error data through inverse transformation/inverse quantization; Decoding control information is divided into two big classes interior prediction decoding of control frame and interframe prediction decoding respectively; The corresponding addition with residual error data of data that prediction decoding produces is exported with the video image form behind de-blocking filter.When the entropy decoding generates decoding control information, impose error detection,, then carry out the image level mistake and hide,, then carry out mistake and hide in the de-blocking filter link if the mistake that takes place is the macro-block level mistake in the decoding controlling unit if the mistake that takes place is the image level mistake.
Error detection of the present invention and wrong method of hiding specifically comprise the steps:
(1), carry out error detection based on syntactic element importance, draw and be summed up as the type of error of losing one frame/multiple image or lost part macro block in the video decode controlling unit.
In existing video encoding and decoding standard, the main syntactic element that is comprised in the encoding code stream has five kinds of sequence head parameter set, image head (I image head, P, B image head) parameter set, sheet parameter, macroblock parameters, piece parameters etc., error detection is exactly that the correctness of above five kinds of syntactic element parameters is adjudicated, whether the value of judging each parameter that they comprise is in normal span, if some parameter is crossed the border, we can utilize priori correction, and some then can not.
Detect after mistake and the location mistake, the mistake that is taken place is carried out corresponding correction process, promptly mistake is hidden.Influence degree from mistake:
If the sequence head parameter set is made mistakes, then abandon whole sequence, all images frame that the sequence that abandons comprises all can't recover, the decoding after could recover appears in next sequence head;
If the image head parameter set is made mistakes, then abandon whole two field picture, can adopt the frame level technology of hiding to be similar to reconstruct;
Make mistakes as the chankings parameter, then abandon whole, can adopt the macro-block level technology of hiding to be similar to reconstruct;
If macro block is made mistakes, all are included in macro block data in anter then to begin to abandon the back from the current macro of makeing mistakes.(the piece situation of makeing mistakes is included within the situation that the macro block at its place makes mistakes.)
Concluding above-mentioned error situation can lose the mistake end image, lose sheet and lose macro block.Further, if a two field picture has only a sheet, then lose a sheet and be equal to and lose a two field picture; Otherwise lose a sheet and be equal to the lost part macro block.Processing to mistake is taked different modes at losing image with the lost part macro block respectively.
(2), according to step (one's) error detection result, carry out corresponding mistake based on one frame/multiple image or lost part macro block and hide, specifically undertaken by following two links:
1, the decoding controlling unit to losing treatment of picture:
When finding that frame number is discontinuous, promptly there is the frame losing phenomenon to take place.Interrupt the decoding of present frame immediately, add the frame number lose, and the former frame of lost frames in the image buffer is pointed in the address of lost frames, cover lost frames with the decoded data that former frame is correct.
If the reference the when picture frame of losing is not used as other picture decodings then be it seems from output and has just been exported same frame twice., be difficult for discovering than under the condition with higher in frame per second for human eye.
The reference when if the picture frame of losing will be brought as other picture decodings, participate in the management of reference picture with the frame number of its interpolation, then when the image of decoding thereafter, also can find " puppet " reference image frame as a reference, just the image of institute's reference is actual is its address picture frame pointed, is not itself.Change under the less situation in picture material, can guarantee sight.
2, in of the processing of de-blocking filter link to the lost part macro block:
The processing of lost part macro block is carried out when the de-blocking filter, is handled respectively by following dual mode according to the macro block attribute difference of losing:
(1) macro block belongs to the fault processing of spatial prediction sheet
Macro block belongs to the spatial prediction sheet, is called spatial domain type macro block.As shown in Figure 3, hide schematic flow sheet for spatial domain type macro-block level mistake, concrete grammar and step that mistake is hidden are as follows:
That determines among a, the error detection result by decoding control information to make a mistake is spatial domain type macro block;
B, withdraw from the decoding of current erroneous macroblock, search for the initial of next sheet, continue decoding from new correct sheet, and mark is erroneous macroblock from this erroneous macroblock until all macro blocks that this macro block place sheet finishes;
C, in the de-blocking filter link, when filtering proceeds to error macro block, to all macro blocks that are masked as erroneous macroblock carry out mistake and hide from this macro block;
D, judge whether error macro block top macro block exists, if exist, then read in its top macro block bottom pixel value and adjust filtering strength for maximum, if there is no, directly adjust filtering strength for maximum;
E, judge whether error macro block left macro block and top macro block exist, if all exist, the top macro block pixel value bottom and the average reconstruct error macro block of the rightmost pixel value of left macro block then to read in, if only there is the left macro block, then read in the rightmost pixel value reconstruct of its left macro block error macro block, if only there is the top macro block, top macro block pixel value reconstruct error macro block bottom then to read in, if top macro block and left macro block do not exist, then with pixel value 128 reconstruct error macro blocks;
F, repeating step d, e continue that follow-up all macro blocks that are labeled as erroneous macroblock of error macro block are carried out mistake and hide, until when all error macro blocks of anter all reconstruct finish.
(2) macro block belongs to the fault processing of motion prediction sheet
Macro block belongs to the motion prediction sheet, is called time domain type macro block.As shown in Figure 4, hide schematic flow sheet for time domain type macro-block level mistake, concrete grammar and step that mistake is hidden are as follows:
That determines among a, the error detection result by decoding control information to make a mistake is time domain type macro block;
B, withdraw from the decoding of current erroneous macroblock, search for the initial of next sheet, continue decoding from new correct sheet, and mark is erroneous macroblock from this erroneous macroblock until all macro blocks that this macro block place sheet finishes;
C, in the de-blocking filter link, when filtering proceeds to error macro block, to all macro blocks that are masked as erroneous macroblock carry out mistake and hide from this macro block;
D, judge whether error macro block top and left macro block exist, if all exist, then read in motion vector (MV) value of current macro lower left and upper left prescription piece, and with the motion vector (MV) of its average as current error macro block, if only there is the top macro block, then with the MV value of upper left prescription piece motion vector (MV) as current error macro block, if only there is the left macro block, then with the MV value of lower-left prescription piece MV as current error macro block, if do not exist, then with 0 motion vector (MV) as current error macro block;
The motion vector (MV) of e, error macro block that steps d is obtained is adjusted, according to motion vector (MV), from the former frame image buffer of error macro block reference key number be in 0 the picture frame the corresponding macro block pixels value of copy to current error macro block, reconstruct current macro;
F, repeating step d, e continue that follow-up all macro blocks that are labeled as erroneous macroblock of error macro block are carried out mistake and hide, until when all error macro blocks of anter all reconstruct finish.