VIDEO DECODING METHOD
Video decoding methods are disclosed. The video decoding method comprises providing a historical syntax element of a previous video frame, receiving a current video frame to determine a current syntax element therein, determining whether a high-level syntax error is present in the current syntax element, wherein upon detection of the high-level syntax error, determining a replacement syntax element according to the historical syntax element to replace the current syntax element, decoding the replaced current video frame to detect whether there is a missing video frame or undecodable video frame, and upon detection of the missing video frame or undecodable video frame, generating a replacement video frame to substitute for the missing or the undecodable video frame.
Latest MEDIATEK INC. Patents:
- METHOD AND APPARATUS FOR PERFORMING SINGULARITY DETECTION AIDED CALIBRATION ON TIME-INTERLEAVED ANALOG-TO-DIGITAL CONVERTER
- Adaptive radio frequency front-end circuit with low insertion loss for WLAN
- Electronic device and method for scheduling restriction
- Methods and apparatuses of sharing preload region for affine prediction or motion compensation
- Method and system for improving the efficiency of protecting a multi-content process
1. Field of the Invention
The invention relates in general to video decoding, and in particular, to a video decoding method capable of detecting and correcting missing or undecodable video frames.
2. Description of the Related Art
Various functionalities are implemented in video apparatuses in order to conveniently manipulate video data. Video CODECs (encoders/decoders) typically comply with video coding standards such as MPEG 1/2/4 and H.26x to perform digital data manipulation and compression. These compression techniques achieve relatively high compression ratios by discrete cosine transform (DCT) techniques and motion compensation (MC) techniques, so that the compressed video streams can be transmitted across various digital networks or stored in various storage medium in an efficient manner.
However, since MPEG 1/2/4 and H.26x video encoding employs compression schemes which encode later video frames based on earlier video frames, when unrecoverable errors are introduced into a video bitstream during transmission, these errors found in earlier video frames can render all the later dependent frames undecodable. Typically, the video encoder skips the undecodable video frame and repeats an early decodable frame, resulting in abrupt scene changes or discontinuous movement due to a number of video frames being skipped, thus resulting in unpleasant viewing experiences for users. Therefore, there exists a need for video decoding methods capable of detecting unrecoverable errors in video bitstreams and reducing motion jerkiness to alleviate degradation of video quality due to these unrecoverable errors.
BRIEF SUMMARY OF THE INVENTIONA detailed description is given in the following embodiments with reference to the accompanying drawings.
A video decoding method is provided, comprising providing a historical syntax element of a previous video frame, receiving a current video frame to determine a current syntax element therein, determining whether a high-level syntax error is present in the current syntax element, and upon detection of the high-level syntax error, determining a replaced syntax element according to the historical syntax element to replace the current error syntax element. The high-level syntax error is a syntax error above a Macroblock layer.
According to another aspect of the invention, a method for detecting a missing video frame is disclosed, comprising a demultiplexer receiving a Transport Stream to recover video Packetized Elementary Stream (PES) to determine a presentation time stamp (PTS) and a decoding time stamp (DTS) in a PES header of the PES, a decoder retrieving a video frame from the video PES to determine temporal reference of the video frame, and a controller receiving the PTS, the DTS, and the temporal reference to determine whether there is a missing video frame.
According to another aspect of the invention, a video decoding method is disclosed, comprising decoding a current video frame to detect a missing video frame or an undecodable video frame, and in response to detecting the missing video frame or the undecodable video frame, replacing the missing video frame or the undecodable video frame with a closest decodable video frame in display order.
According to yet another aspect of the invention, a video decoding method is disclosed, comprising decoding a current video frame to detect a missing video frame or an undecodable video frame, and upon detecting the missing video frame or the undecodable video frame, generating a replacement video frame according to motion vectors of a decodable video frame and a temporal distance between the current video frame and the decodable video frame, and in response to detecting the missing video frame or the undecodable video frame, replacing the missing video frame or the undecodable video frame with the replacement video frame.
According to still another aspect of the invention, a video decoding method is disclosed, comprising providing a historical syntax element of a previous video frame, receiving a current video frame to determine a current syntax element therein, determining whether a high-level syntax error is present in the current syntax element, upon detection of the high-level syntax error, determining a replaced syntax element according to the historical syntax element to replace the current error syntax element, decoding the syntax-replaced current video frame to detect whether there is a missing video frame or an undecodable video frame, and upon detection of the missing video frame or the undecodable video frame, generating a replacement video frame to substitute the missing or the undecodable video frame. The high-level syntax error is a syntax error above a Macroblock layer.
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
The video decoding scheme embodiments disclosed herein fully comply with the Moving Picture Expert Group MPEG Standards.
When a video decoder decodes and plays video data, the decoding order and the display order may be different, as shown in
To counter this problem, a video decoding scheme according to an embodiment of the present invention is provided in
Upon start of the video decoding method 5 (S500), the video decoder retrieves a video bitstream from a video buffer and locates the start of a video frame (S502), provides a historical syntax element of a previous video frame (S504), receives a current video frame to determine a current syntax element (S506), determines whether a high-level syntax error is present in the current syntax element (S508), and determines a replaced syntax element according to the historical syntax element to replace the current syntax element upon detection of the high-level syntax error (S510). In MPEG systems, each video frame contains a synchronization sequence at the beginning to indicate the start of a video frame, known as the picture start. The timing relationship of the previous and current video frames is in terms of the decoding order, i.e., the previous video frame is decoded before a current one. The high-level syntax error is a syntax error above a Macroblock layer, including the syntax elements in a sequence header, group of picture header, or picture header. For example, when a syntax element in the picture header exceeds a legal value boundary, the video decoder may identify it as a picture-layer syntax error. In step S510, the video decoder may assign the historical syntax element to be the replaced syntax element, or determine a likely value for the replaced syntax element based on the historical syntax elements if the syntax element has a periodic property.
When there is no error detected in the syntax elements or the high-level syntax element has been fixed by the replaced syntax element, the video decoder continues to perform MPEG decoding on the picture data in the current video frame in step S512. Next in step S514, the video decoder decodes the current video frame to detect whether there is a missing video frame or the current video frame is undecodable, and upon detection of the missing video frame or undecodable video frame, generates a replacement video frame to substitute the missing or undecodable video frame (S516). The video decoder determines the video frame to be undecodable when the reference frame is missing, high-level syntax error occurs, or when part or all of the picture data is corrupted. The generation of the replacement video frame comprises assigning a closest decodable video frame in display order to be the replacement video frame, or generating a replacement video frame according to motion vectors of a decodable video frame and a temporal distance between the current video frame and the decodable video frame.
In one embodiment, the video decoder parses the syntax elements in the sequence header (S600), and two of the syntax elements aspect_ratio and frame_rate contain illegal value 0000. Next, instead of outputting the error response “forbidden value in 13818-2” to indicate the syntax errors and stop decoding and data processing as in the conventional art, the video decoder of the invention corrects these errors by assigning the value derived from the historical syntax element as the current syntax element (S510 in
The video decoder 812 obtains a video frame FV from the video buffer 810 by removing a PES header at the beginning of the video PES data. The PES header contains Presentation Time Stamp (PTS) and Decoding Time Stamp (DTS) information in an optional field thereof, which can be used to identify if there is a missing video frame. Similarly, audio frame FA and system data may be obtained by removing the PES headers at the audio decoder 822 and system decoder 832. After locating the picture start of the video frame, the video decoder 812 also acquires temporal reference information Tref successive thereto, and transfers the PTS, the DTS, and the temporal reference Tref to the video controller 814. The video controller 814 receives the PTS, the DTS, and the temporal reference Tref to determine whether there is a missing video frame, and informs the video decoder 812 of the determination of a missing frame by signal Dmiss. Upon detection of a missing frame, the video decoder 812 performs video generation of a replacement video frame and performs video predictive decoding based on the replacement video frame.
The Decode Time Stamp (DTS) indicates the time at which a video frame FV should be instantaneously removed from the video buffer 810 and decoded by the video decoder 812. The Presentation Time Stamp (PTS) indicates the instant at which the decoded video frame FV should be removed from the receiver buffer, and presented for display. The PTS or DTS define the bitstream to be retrieved at intervals not exceeding 700 ms. The temporal reference Tref is reset to 0 after a GOP header, and is incremented by one for each video frame in display order. The video controller 814 may determine that there is no missing picture when the current temporal reference is consecutive to the previous temporal reference in display order, the current DTS of the current video frame does not exceed the previous DTS of the previous video frame by 700 ms, and the current PTS of the current video frame does not exceed the previous PTS of the previous video frame by 700 ms; otherwise the video controller 814 can indicate a missing video frame by signal Dmiss.
Upon start of a detection method 9 for missing video frame (S900), the demultiplexer 800 receives the input Transport Stream TS to recover video Packetized Elementary Stream VPES and determines the presentation time stamp PTS and the decoding time stamp DTS in a PES header of the video PES (S902). The video decoder 812 retrieves the video frame FV from the video PES VPES and determines the temporal reference Tref of the video frame (S904), and the video controller 814 receives the PTS, the DTS, and the temporal reference to determine whether there is a missing video frame (S906). Upon detection of a missing video frame, the video decoder 812 generates a replacement video frame to substitute for the missing video frame as provided in step S516 in
Upon start of the video decoding method 10 (S1000), the video decoder retrieves a current video frame from a video buffer by locating the picture start of a video bitstream (S1002), and parses a current syntax element (S1004). In some embodiments, the video decoder checks and corrects the high-level syntax error before step S1004. The detailed description of the detection and correction of the high-level syntax error is provided in the embodiment in
In step S1006, the missing picture may be identified according to the detection method disclosed in
Upon start of the video decoding method 12 (S1200), the video decoder retrieves a video bitstream from a video buffer to locate the start of a picture (S1202), and parses high-level syntax elements (S1204). In some embodiments, the video decoder checks and corrects the high-level syntax error before step S1204. The detailed description of the detection and correction of the high-level syntax error is provided in the embodiment in
In step S1206, the missing picture may be identified according to the detection method disclosed in
In steps S1208 and S1212, the replacement video frames are generated according to the motion vectors of the decodable video frame, the temporal distance (time difference in display order) between the current video frame and the decodable video frame, and also the frame type of the missing or undecodable video frames.
In step S1300, the video decoder detects the missing or undecodable video frame as in steps S1206 and S1210, and determines whether the missing or undecodable video frame is a reference video frame (e.g. I-frame and P-frame) in step S1302. If so, the video decoder then carries out motion vector (MV) extrapolation to generate the replacement video frame (S1304), and if not, the video decoder performs motion vector interpolation (pseudo direct mode) to generate the replacement video frame (S1306). After the replacement video frame is produced, the video decoder replaces the missing video frame or the undecodable video frame with the replacement video frame and the generation method 13 is exited (S1308).
In step S1404, when the missing video frame or the undecodable video frame is a reference frame with a dependent B-frame, the replacement video frame comprises only forward motion vectors. The replacement video frame is generated by extrapolating motion vectors of the preceding decodable dependent B-frame according to the temporal distances between the preceding decodable dependent B-frame and the current video frame, and between the other preceding decodable reference video frame and the current video frame, to generate the forward motion vectors of the replacement video frames. The preceding decodable dependent B-frame precedes the current video frame in display order.
In step S1406, when the missing video frame or the undecodable video frame is a reference frame without a dependent B-frame, the replacement video frame comprises only forward motion vectors. The replacement video frame is generated by extrapolating motion vectors of a preceding decodable reference frame according to the temporal distances between the preceding decodable reference frame, another preceding decodable frame, and the current video frame, to generate the forward motion vectors of the replacement video frames. The preceding decodable frames precede the current video frame in display order.
After the replacement video frame is reconstructed, MV extrapolation method 14 exits in step S1408.
where the preceding decodable reference frame is frame P1, the succeeding decodable reference frame is frame P2, the temporal distance TF is a time difference between the preceding decodable reference frame P1 and the undecodable video frame B3, and the temporal distance TB is a time difference between the succeeding decodable reference frame P2 and the undecodable video frame B3.
While the invention has been described by way of examples and in terms of preferred embodiments, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Claims
1. A video decoding method, comprising:
- providing a historical syntax element of a previous video frame;
- receiving a current video frame to determine a current syntax element therein;
- determining whether a high-level syntax error is present in the current syntax element; and
- upon detection of the high-level syntax error, determining a replacement syntax element according to the historical syntax element to replace the current syntax element,
- wherein the high-level syntax error is a syntax error above a Macroblock layer.
2. The video decoding method of claim 1, wherein the high-level syntax error is a picture-layer syntax error.
3. The video decoding method of claim 1, wherein the previous video frame is in terms of the video decoding order.
4. The video decoding method of claim 1, wherein the determination of the replacement syntax element comprises using the historical syntax element to estimate the correct syntax element and assigning the estimated result to be the replacement syntax element.
5. The video decoding method of claim 1, further comprising:
- decoding the current video frame to detect whether there is a missing video frame or undecodable video frame; and
- upon detection of the missing video frame or undecodable video frame, generating a replacement video frame to substitute for the missing or the undecodable video frame.
6. The video decoding method of claim 5, wherein the generation of the replacement video frame comprises assigning a closest decodable video frame in a display order to be the replacement video frame.
7. The video decoding method of claim 5, wherein the generation of the replacement video frame comprises generating a replacement video frame according to motion vectors of a decodable video frame and a temporal distance between the current video frame and the decodable video frame.
8. A video decoding method capable of detecting a missing video frame, comprising:
- a demultiplexer receiving a Transport Stream to recover video Packetized Elementary Stream (PES) to determine a presentation time stamp (PTS) and a decoding time stamp (DTS) in a PES header of the PES;
- a decoder retrieving a video frame from the video PES to determine temporal reference of the video frame; and
- a controller receiving the PTS, the DTS, and the temporal reference to determine whether there is a missing video frame.
9. The method of claim 8, further comprising:
- upon detection of the missing video frame, generating a replacement video frame to substitute for the missing video frame.
10. The method of claim 9, wherein the generation of the replacement video frame comprises assigning a closest decodable video frame in a display order to be the replacement video frame.
11. The method of claim 9, wherein the generation of the replacement video frame comprises generating a replacement video frame according to motion vectors of a decodable video frame and a temporal distance between the current video frame and the decodable video frame.
12. A video decoding method, comprising:
- decoding a current video frame to detect a missing video frame or an undecodable video frame; and
- in response to detecting the missing video frame or undecodable video frame, replacing the missing video frame or undecodable video frame with a closest decodable video frame in display order.
13. The video decoding method of claim 12, further comprising:
- providing a historical syntax element of a previous video frame;
- receiving the current video frame to determine a current syntax element therein;
- determining whether a high-level syntax error is present in the current syntax element; and
- upon detection of the high-level syntax error, determining a replaced syntax element according to the historical syntax element to replace the current syntax element,
- wherein the high-level syntax error is a syntax error above a Macroblock layer.
14. The video decoding method of claim 12, further comprising:
- a demultiplexer receiving a Transport Stream to recover video Packetized Elementary Stream (PES) to determine a presentation time stamp (PTS) and a decoding time stamp (DTS) in a PES header of the PES;
- a decoder retrieving the current video frame from the video PES to determine temporal reference of the video frame; and
- a controller receiving the PTS, the DTS, and the temporal reference to determine whether there is a missed video frame.
15. A video decoding method, comprising:
- decoding a current video frame to detect a missing video frame or an undecodable video frame;
- upon detection of the missing video frame or undecodable video frame, generating a replacement video frame according to motion vectors of a decodable video frame and a temporal distance between the current video frame and the decodable video frame; and
- in response to detecting the missing video frame or undecodable video frame, replacing the missing video frame or undecodable video frame with the replacement video frame.
16. The video decoding method of claim 15, wherein when the missing video frame or undecodable video frame is a reference frame with a dependent B-frame, the replacement video frame comprises only forward motion vectors, the decodable video frame is a preceding non-reference frame in display order, and the generation comprises extrapolating motion vectors of the preceding non-reference frame and another preceding video frame according to the temporal distance to generate the forward motion vectors of the replacement video frame.
17. The video decoding method of claim 15, wherein when the missing video frame or undecodable video frame is a reference frame with reference to a decodable reference frame, the replacement video frame comprises only forward motion vectors, the decodable video frame is a preceding decodable reference frame in display order, and the generation comprises extrapolating motion vectors of the preceding decodable reference frame according to the temporal distance to generate the forward motion vectors of the replacement video frames.
18. The video decoding method of claim 15, wherein when the missing video frame or undecodable video frame is a non-reference frame with a decodable reference frame, the replacement video frame comprises forward and backward motion vectors, and the generation comprises proportionating motion vectors of backward decodable reference frame of the missing video frame or undecodable non-reference frame according to the temporal distances between the preceding decodable reference frame and the undecodable video frame and between the succeeding decodable reference frame and the undecodable video frame, to generate the forward and backward motion vectors of the replacement video frame.
19. The video decoding method of claim 15, further comprising:
- providing a historical syntax element of a previous video frame;
- receiving the current video frame to determine a current syntax element therein;
- determining whether a high-level syntax error is present in the current syntax element; and
- upon detection of the high-level syntax error, determining a replaced syntax element according to the historical syntax element to replace the current syntax element,
- wherein the high-level syntax error is a syntax error above a Macroblock layer.
20. The video decoding method of claim 15, further comprising:
- a demultiplexer receiving a Transport Stream to recover video Packetized Elementary Stream (PES) to determine a presentation time stamp (PTS) and a decoding time stamp (DTS) in a PES header of the PES;
- a decoder retrieving the current video frame from the video PES to determine temporal reference of the video frame; and
- a controller receiving the PTS, the DTS, and the temporal reference to determine whether there is a missed video frame.
Type: Application
Filed: Dec 22, 2008
Publication Date: Jun 24, 2010
Applicant: MEDIATEK INC. (Hsin-Chu)
Inventors: Ying-Jui Chen (Hsinchu County), Chung-Bin Wu (Kaohsiung City), Ya-Ting Chuang (Hsinchu County)
Application Number: 12/340,872
International Classification: H04N 11/02 (20060101);