Video decoding real-time error concealment method and system based on H.264

By monitoring and processing erroneous macroblocks in real time during video decoding, and using the motion vectors of neighboring macroblocks to predict the motion vectors of erroneous macroblocks, the error problem caused by network instability in video decoding is solved and the quality of video decoding is improved. and stability.

CN118573901APending Publication Date: 2024-08-30HUIZHIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410463030.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

During the video decoding process, data packet loss and transmission delays caused by the instability of network transmission lead to errors in video decoding. It is difficult for existing technology to effectively solve the problem of real-time errors.

Method used

By monitoring the video frame in real time, recording the location of the erroneous macroblock, obtaining the edge macroblock information of the lost slice, predicting the motion vector of the erroneous macroblock using the motion vectors of neighboring macroblocks and the edge macroblock information of the lost slice, and performing Error masking enables real-time processing of errors in video decoding.

Benefits of technology

It improves the reliability and stability of video decoding, improves the subjective and objective quality of reconstructed images, and reduces video quality degradation caused by packet loss and bit errors in video data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573901A
    Figure CN118573901A
Patent Text Reader

Abstract

The invention provides an H.264-based video decoding real-time error concealment method and an H.264-based video decoding real-time error concealment system. The video decoding real-time error concealment method comprises the following steps: performing decoding video frame processing on a video, monitoring whether an error macro block exists in a video frame in real time when the video frame is decoded, and recording the position of the error macro block; acquiring edge macro block information of the lost slice; predicting a motion vector of a wrong macro block through the motion vector of the neighborhood macro block and the edge macro block information of the lost slice, and obtaining a motion vector predicted value of the wrong macro block; and performing error concealment on the error macro block by using the motion vector predicted value of the error macro block. The system comprises modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention proposes a real-time error concealment method and system for video decoding based on H.264, belonging to the technical field of video stream processing. Background Art

[0002] H.264 is a widely used video coding standard. It has the advantages of high coding efficiency, high compression ratio, and excellent image quality. However, during the video transmission and decoding process, due to the instability of network transmission and other reasons, problems such as packet loss and transmission delay may occur, resulting in errors in the video decoding process. Summary of the invention

[0003] The present invention provides a real-time error concealment method and system for video decoding based on H.264, which is used to solve the problem of IP network packet loss during real-time decoding. The technical solution adopted is as follows:

[0004] A real-time error concealment method for video decoding based on H.264, the real-time error concealment method for video decoding comprising:

[0005] Decoding the video frame, monitoring in real time whether there is an erroneous macroblock in the video frame when decoding the video frame, and recording the position of the erroneous macroblock;

[0006] Get the edge macroblock information of the lost slice;

[0007] The motion vector of the error macroblock is predicted by using the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and the motion vector prediction value of the error macroblock is obtained;

[0008] The error of the erroneous macroblock is concealed by using the motion vector prediction value of the erroneous macroblock.

[0009] Further, the video is decoded and processed. When decoding the video frame, whether there is an erroneous macroblock in the video frame is monitored in real time, and the position of the erroneous macroblock is recorded, including:

[0010] Initialize a video decoder and set decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate;

[0011] Decoding the video frame to obtain a decoded video frame;

[0012] Analyzing the decoded video frame to detect whether there is an erroneous macroblock in the decoded video frame;

[0013] If an erroneous macroblock is detected, the position of the erroneous macroblock is recorded, and after completing the processing of the current frame, the next frame is decoded and detected to obtain the erroneous macroblock and the position of the erroneous macroblock until all decoded video frames are detected.

[0014] Furthermore, the edge macroblock information of the lost slice is obtained, including:

[0015] Determine the position of the lost slice according to the recorded erroneous macroblock position information;

[0016] Extract edge macroblock information from adjacent macroblocks of the lost slice:

[0017] The sub-block edge information extracted from adjacent macroblocks is spliced ​​to obtain the initial edge macroblock information of the lost slice;

[0018] The initial edge macroblock information of the lost slice is filled in an interpolation manner to obtain a complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice.

[0019] Further, the motion vector of the error macroblock is predicted by the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and the motion vector prediction value of the error macroblock is obtained, including:

[0020] Determine the position of a neighboring macroblock of the erroneous macroblock according to the position information of the erroneous macroblock;

[0021] Using the decoded neighboring macroblocks and the corresponding motion vector information, the predicted motion vector of the erroneous macroblock is obtained;

[0022] The edge macroblock information of the lost slice is extracted, and the motion vector of the erroneous macroblock is predicted and calculated using the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to obtain the motion vector prediction value of the erroneous macroblock.

[0023] Further, using the motion vector prediction value of the erroneous macroblock, the erroneous macroblock is error concealed, including:

[0024] According to the predicted motion vector, obtaining the position and size of the erroneous macroblock;

[0025] Interpolate the decoded macroblocks around the erroneous macroblock to obtain a video frame after the error is concealed;

[0026] The video frame after error concealment is reconstructed to obtain reconstructed video frame data.

[0027] A real-time error concealment system for video decoding based on H.264, the real-time error concealment system for video decoding comprising:

[0028] The frame processing module is used to process the decoded video frames of the video. When decoding the video frames, it monitors in real time whether there are erroneous macroblocks in the video frames and records the positions of the erroneous macroblocks.

[0029] An edge macroblock information acquisition module is used to acquire edge macroblock information of a lost slice;

[0030] A prediction module, used to predict the motion vector of the error macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtain the motion vector prediction value of the error macroblock;

[0031] The error concealment module is used to conceal the error of the erroneous macroblock by using the motion vector prediction value of the erroneous macroblock.

[0032] Furthermore, the frame processing module includes:

[0033] An initialization module, used to initialize a video decoder and set decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate;

[0034] A decoding module, used for decoding the video frame to obtain a decoded video frame;

[0035] The analysis module is used to analyze the decoded video frame and detect whether there is an erroneous macroblock in the decoded video frame; the erroneous macroblock detection module is used to record the position of the erroneous macroblock if an erroneous macroblock is detected, and after completing the processing of the current frame, continue to decode and detect the next frame to obtain the erroneous macroblock and the position of the erroneous macroblock until all decoded video frames are detected.

[0036] Furthermore, the edge macroblock information of the lost slice is obtained, including:

[0037] A lost slice position determination module, used to determine the position of the lost slice according to the recorded erroneous macroblock position information;

[0038] The edge macroblock information extraction module is used to extract edge macroblock information from adjacent macroblocks of the lost slice:

[0039] An initial edge macroblock information acquisition module is used to splice sub-block edge information extracted from adjacent macroblocks to obtain initial edge macroblock information of the lost slice;

[0040] The complete pixel value acquisition module is used to fill the initial edge macroblock information of the lost slice by interpolation to obtain the complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice.

[0041] Furthermore, the prediction module includes:

[0042] A neighborhood macro position determination module, used to determine the position of the neighborhood macro block of the erroneous macro block according to the position information of the erroneous macro block;

[0043] A motion vector prediction module, used to obtain a predicted motion vector of an erroneous macroblock using decoded neighboring macroblocks and corresponding motion vector information;

[0044] The information extraction module is used to extract the edge macroblock information of the lost slice, and use the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to predict the motion vector of the error macroblock to obtain the motion vector prediction value of the error macroblock.

[0045] Furthermore, the error concealment module includes:

[0046] A position and size acquisition module, used to acquire the position and size of the erroneous macroblock according to the predicted motion vector;

[0047] A video frame acquisition module is used to perform interpolation processing on decoded macroblocks around the error macroblock to obtain a video frame after the error is concealed;

[0048] The video frame reconstruction module is used to reconstruct the video frame after error concealment to obtain reconstructed video frame data.

[0049] Beneficial effects of the present invention:

[0050] The present invention provides a real-time error concealment method and system for video decoding based on H.264, which improves the subjective quality and objective quality of reconstructed images, has low computational complexity and good error concealment effect. The real-time error concealment method for video decoding based on H.264 mainly relies on predicting edge macroblock information of lost slices and calculating motion vectors of erroneous macroblocks. Through these predictions and calculations, it is possible to conceal errors occurring in video decoding, thereby improving the reliability and stability of video decoding. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a flow chart of the method of the present invention;

[0052] Figure 2 The system block diagram of the system of the present invention. DETAILED DESCRIPTION

[0053] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0054] The embodiment of the present invention proposes a real-time error concealment method for video decoding based on H.264. Figure 1As shown, the video decoding real-time error concealment method includes:

[0055] S1, decoding a video frame, monitoring in real time whether there is an erroneous macroblock in the video frame when decoding the video frame, and recording the position of the erroneous macroblock;

[0056] S2, obtaining edge macroblock information of the lost slice;

[0057] S3, predicting the motion vector of the error macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtaining the motion vector prediction value of the error macroblock;

[0058] S4. Use the motion vector prediction value of the erroneous macroblock to conceal the error of the erroneous macroblock.

[0059] The working principle of the above technical solution is: decode the received video stream, monitor whether there are erroneous macroblocks in the video frame, and record their positions. Macroblocks are the basic units in the video compression process. If there are errors in macroblocks, it will affect the display effect of the entire video frame. Obtain the edge macroblock information of the lost slice. The lost slice refers to the part of the video frame that is lost due to transmission or other reasons. Predict the motion vector of the erroneous macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtain the motion vector prediction value of the erroneous macroblock. Adjacent macroblocks usually have similar motion vectors, and this similarity can be used to predict the motion vector of the erroneous macroblock. Use the motion vector prediction value of the erroneous macroblock to conceal the error of the erroneous macroblock. Cover the image information of the adjacent macroblock at the position of the erroneous macroblock to conceal the error.

[0060] The effect of the above technical solution is: the real-time error concealment method for video decoding based on H.264 mainly relies on predicting the edge macroblock information of the lost slice and calculating the motion vector of the erroneous macroblock. Through these predictions and calculations, it is possible to conceal the errors occurring in video decoding, thereby improving the reliability and stability of video decoding. At the same time, the erroneous macroblocks in the video frame can be detected and concealed in real time during the video transmission process, thereby improving the video quality. At the same time, by predicting the motion vector of the erroneous macroblock and using the image information of the adjacent macroblock to conceal the error, the degradation of video quality caused by packet loss and bit errors in video data transmission can be reduced.

[0061] In one embodiment of the present invention, a video is decoded and processed. When decoding the video frame, whether there is an erroneous macroblock in the video frame is monitored in real time, and the position of the erroneous macroblock is recorded, including:

[0062] S101, initializing a video decoder and setting decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate;

[0063] S102, decoding the video frame to obtain a decoded video frame;

[0064] S103, analyzing the decoded video frame to detect whether there is an erroneous macroblock in the decoded video frame; S104, if an erroneous macroblock is detected, recording the position of the erroneous macroblock, and after completing the processing of the current frame, continuing to decode and detect the next frame to obtain the erroneous macroblock and the position of the erroneous macroblock until all decoded video frames are detected.

[0065] The working principle of the above technical solution is as follows: first, initialize the video decoder and set the decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate; then, decode the video frame to obtain the decoded video frame; then, analyze the decoded video frame to detect whether there is an erroneous macroblock in the decoded video frame; wherein the erroneous macroblock usually refers to an erroneous macroblock caused by channel transmission or decoder error, and generally uses motion estimation technology and residual signal analysis and other methods to detect erroneous macroblocks. Finally, if an erroneous macroblock is detected, the position of the erroneous macroblock is recorded, and after completing the processing of the current frame, the next frame is decoded and detected to obtain the erroneous macroblock and the position of the erroneous macroblock until all decoded video frames are detected. Specifically, the coordinate method is used for recording, such as recording the pixel coordinates of the upper left corner and the lower right corner of the erroneous macroblock.

[0066] The effect of the above technical solution is: by detecting the error macroblock and recording its position, basic data is provided for subsequent error concealment. By detecting and processing the error macroblock, the reliability and stability of video transmission can be effectively improved, the distortion phenomenon in the video transmission process can be reduced, and the video quality can be improved.

[0067] According to an embodiment of the present invention, obtaining edge macroblock information of a lost slice includes:

[0068] S201. Determine the position of a lost slice according to the recorded erroneous macroblock position information. The lost slice is usually composed of multiple erroneous macroblocks, so it is necessary to determine the edge macroblock information of the lost slice according to the erroneous macroblock position information.

[0069] S202, extracting edge macroblock information from adjacent macroblocks of the lost slice:

[0070] S203, splicing the sub-block edge information extracted from adjacent macroblocks to obtain initial edge macroblock information of the lost slice;

[0071] S204, filling the initial edge macroblock information of the lost slice by interpolation to obtain a complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice, and the interpolation method includes bilinear interpolation and cubic spline interpolation.

[0072] The working principle of the above technical solution is as follows: first, the position of the lost slice is determined according to the recorded erroneous macroblock position information; wherein the lost slice is usually composed of multiple erroneous macroblocks, so it is necessary to determine the edge macroblock information of the lost slice according to the erroneous macroblock position information. Then, the edge macroblock information is extracted from the adjacent macroblocks of the lost slice: specifically, for each lost slice, the edge macroblock information is extracted from its adjacent decoded macroblocks. The edge macroblock usually includes the boundary part of the macroblock, that is, the edge part of the luminance and chrominance subblocks. The edge macroblock information of the lost slice can be obtained by extracting the edge parts of these subblocks from the adjacent macroblocks. Afterwards, the subblock edge information extracted from the adjacent macroblocks is spliced ​​to obtain the initial edge macroblock information of the lost slice; finally, the initial edge macroblock information of the lost slice is filled by interpolation to obtain the complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice, and the interpolation method includes bilinear interpolation and cubic spline interpolation.

[0073] The effect of the above technical solution is: the above technical solution can solve the problem of video loss caused by erroneous macroblocks in video frames, by detecting the position of erroneous macroblocks, extracting the edge macroblock information of the lost slice, and filling the lost slice with pixels by interpolation, so that the lost slice in the video frame can be restored. Compared with directly discarding the entire video frame, this technology can improve the reliability and stability of video transmission, improve the success rate of video decoding and user experience.

[0074] An embodiment of the present invention predicts the motion vector of the error macroblock by using the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtains the motion vector prediction value of the error macroblock, including:

[0075] S301, determining the position of a neighboring macroblock of the erroneous macroblock according to the position information of the erroneous macroblock;

[0076] S302, using the decoded neighborhood macroblocks and corresponding motion vector information to obtain a predicted motion vector of the erroneous macroblock;

[0077] S303, extracting edge macroblock information of the lost slice, using the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, predicting and calculating the motion vector of the error macroblock, and obtaining the motion vector prediction value of the error macroblock. The motion vector prediction value is obtained by the following formula:

[0078]

[0079] Where M represents the motion vector prediction value of the error macroblock; M t 、M b 、M g and M r Respectively represent the motion vectors corresponding to the macroblocks above, below, on the left and on the right corresponding to the erroneous macroblock; λ1, λ2, λ3 and λ4 respectively represent the vector compensation coefficients corresponding to the macroblocks above, below, on the left and on the right corresponding to the erroneous macroblock; wherein the vector compensation coefficients corresponding to the macroblocks above, below, on the left and on the right are as follows:

[0080]

[0081] Among them, λ x represents the vector compensation coefficient corresponding to the macroblock, x=1, 2, 3, 4 correspond to the macroblocks above, below, left and right respectively; w x Indicates the weight coefficient corresponding to the macroblock; B x Indicates the amplitude value of the pixel value change on both sides of the edge of the macroblock; B0 represents the preset amplitude threshold of the pixel value change on both sides of the edge; α x represents the angle between the edge direction of the macroblock and the horizontal direction; α0 represents the preset angle threshold; D x Represents the macroblock contrast coefficient; L x represents the edge break evaluation coefficient of the macroblock; wherein the edge break evaluation coefficient of the macroblock is obtained by the following formula:

[0082]

[0083] Where n represents the number of edge sub-segments generated by the break of the macroblock edge; L i represents the length corresponding to the i-th edge sub-segment; L0 represents the length of the edge segment where the i-th edge sub-segment is located; P i represents the smoothing rate corresponding to the i-th edge subsegment;

[0084] At the same time, the macroblock contrast coefficient is obtained by the following formula:

[0085]

[0086] Where D represents the contrast corresponding to the edge of the macroblock; D p Indicates the overall contrast of the macroblock.

[0087] The working principle of the above technical solution is as follows: first, according to the position information of the erroneous macroblock, the position of the neighboring macroblock of the erroneous macroblock is determined; then, the predicted motion vector of the erroneous macroblock is obtained by using the decoded neighboring macroblock and the corresponding motion vector information; specifically, the weighted average method is used for calculation, that is, according to the motion vector and spatial position of the neighboring macroblock, the motion vector of the neighboring macroblock is weighted averaged to obtain the predicted motion vector of the erroneous macroblock. Finally, the edge macroblock information of the lost slice is extracted, and the motion vector of the erroneous macroblock is predicted and calculated using the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to obtain the motion vector prediction value of the erroneous macroblock. Specifically, the prediction calculation is calculated by the weighted average method, that is, the predicted motion vector of the neighboring macroblock is weighted averaged to obtain the predicted motion vector of the erroneous macroblock.

[0088] The effect of the above technical solution is: the pixel information of the lost slice is restored by predicting the motion vector of the erroneous macroblock. Since the motion between adjacent macroblocks in a video frame has a certain continuity and correlation, the motion vector of the neighboring macroblock is calculated by weighted average method to improve the accuracy and stability of the prediction. The motion vector prediction value of the erroneous macroblock predicted by motion estimation can be used to further fill in the pixel information of the lost slice, thereby improving the quality and accuracy of video recovery.

[0089] By comprehensively considering the motion vectors of the macroblocks surrounding the erroneous macroblock and multiple related parameters (such as the amplitude of the pixel value change on both sides of the edge, the edge direction, the contrast coefficient, and the edge break evaluation coefficient, etc.), this technical solution can more accurately predict the motion vector of the erroneous macroblock. This comprehensive consideration of multiple factors makes the prediction result more accurate and helps to reduce image distortion or decoding errors caused by motion vector errors. During video transmission, the motion vectors of some macroblocks may be lost or damaged due to network instability or other reasons. This technical solution enhances the robustness of the video by using the information of the surrounding macroblocks to predict the motion vector of the lost macroblock, so that high video quality can be maintained even when some data is lost.

[0090] The technical solution pays special attention to the edge features of macroblocks, including the change amplitude of pixel values ​​on both sides of the edge, edge direction, contrast, and edge breakage. These factors are crucial for accurately predicting motion vectors because they directly affect the visual effect and coherence of the image. By finely processing these edge features, the technical solution can more accurately restore the information of lost macroblocks. At the same time, because the technical solution takes into account multiple parameters and these parameters are dynamically calculated according to actual conditions, it has strong adaptability. Whether in different video scenes or in different network environments, the technical solution can adjust the prediction strategy according to actual conditions to achieve the best prediction effect.

[0091] In summary, this technical solution improves the accuracy of motion vector prediction, enhances the robustness of video, and optimizes edge processing by comprehensively considering multiple relevant parameters and features. This enables better response to data loss or damage during video encoding, transmission, and decoding, thereby providing a more stable and clearer video viewing experience.

[0092] An embodiment of the present invention uses a motion vector prediction value of an erroneous macroblock to conceal an error of the erroneous macroblock, including:

[0093] S401, obtaining the position and size of the erroneous macroblock according to a motion vector prediction value corresponding to the predicted motion vector;

[0094] S402, interpolating the decoded macroblocks around the erroneous macroblock to obtain a video frame after error concealment; wherein the interpolation process may adopt a mean interpolation method, that is, using the average value of the pixel values ​​of the surrounding macroblocks as the pixel value of the erroneous macroblock. In addition, a weighted average method may be adopted to perform a weighted average on the pixel values ​​of the surrounding macroblocks to obtain a more accurate error concealment effect.

[0095] S403, reconstructing the video frame after the error is concealed to obtain reconstructed video frame data. The reconstructed video frame data ensures that the reconstructed video frame can be displayed normally.

[0096] The working principle of the above technical solution is: predicting motion vectors and interpolating neighboring macroblocks to repair the pixel values ​​of the erroneous macroblocks, thereby eliminating the distortion phenomenon in video encoding. Specifically, the position and size of the erroneous macroblock are determined by predicting motion vectors, and then the pixel values ​​around the decoded macroblocks are interpolated to obtain the video frame after the error is concealed. Finally, the video frame after the error is concealed is reconstructed to obtain the reconstructed video frame data.

[0097] The effect of the above technical solution is that the above technical solution can quickly repair the erroneous macroblocks, thereby reducing the impact of video distortion. At the same time, since the method adopts interpolation algorithms such as weighted average method, a more accurate error concealment effect can be obtained, thereby further improving the quality and clarity of the video.

[0098] The embodiment of the present invention proposes a real-time error concealment system for video decoding based on H.264. Figure 2 As shown, the video decoding real-time error concealment system includes:

[0099] The frame processing module is used to process the decoded video frames of the video. When decoding the video frames, it monitors in real time whether there are erroneous macroblocks in the video frames and records the positions of the erroneous macroblocks.

[0100] An edge macroblock information acquisition module is used to acquire edge macroblock information of a lost slice;

[0101] A prediction module, used to predict the motion vector of the error macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtain the motion vector prediction value of the error macroblock;

[0102] The error concealment module is used to conceal the error of the erroneous macroblock by using the motion vector prediction value of the erroneous macroblock.

[0103] The working principle of the above technical solution is as follows: first, a video is decoded and processed by a frame processing module. When decoding a video frame, whether there is an erroneous macroblock in the video frame is monitored in real time, and the position of the erroneous macroblock is recorded; then, the edge macroblock information acquisition module is used to obtain the edge macroblock information of the lost slice; after that, a prediction module is used to predict the motion vector of the erroneous macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtain the motion vector prediction value of the erroneous macroblock; finally, the error concealment module uses the motion vector prediction value of the erroneous macroblock to conceal the error of the erroneous macroblock.

[0104] The effect of the above technical solution is: the real-time error concealment method for video decoding based on H.264 mainly relies on predicting the edge macroblock information of the lost slice and calculating the motion vector of the erroneous macroblock. Through these predictions and calculations, it is possible to conceal the errors occurring in video decoding, thereby improving the reliability and stability of video decoding. At the same time, the erroneous macroblocks in the video frame can be detected and concealed in real time during the video transmission process, thereby improving the video quality. At the same time, by predicting the motion vector of the erroneous macroblock and using the image information of the adjacent macroblock to conceal the error, the degradation of video quality caused by packet loss and bit errors in video data transmission can be reduced.

[0105] In one embodiment of the present invention, the frame processing module includes:

[0106] An initialization module, used to initialize a video decoder and set decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate;

[0107] A decoding module, used for decoding the video frame to obtain the decoded video frame;

[0108] The analysis module is used to analyze the decoded video frame and detect whether there is an erroneous macroblock in the decoded video frame; wherein the erroneous macroblock usually refers to an erroneous macroblock caused by channel transmission or decoder error, and generally uses motion estimation technology and residual signal analysis and other methods to detect erroneous macroblocks.

[0109] The error macroblock detection module is used to record the position of the error macroblock if an error macroblock is detected, and after completing the processing of the current frame, continue to decode and detect the next frame to obtain the error macroblock and the position of the error macroblock until all decoded video frames are detected. Specifically, the coordinates are recorded, such as recording the pixel coordinates of the upper left corner and the lower right corner of the error macroblock.

[0110] The working principle of the above technical solution is as follows: first, initialize the video decoder through the initialization module, and set the decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate; then, use the decoding module to decode the video frame to obtain the decoded video frame; then, use the analysis module to analyze the decoded video frame to detect whether there is an error macroblock in the decoded video frame; wherein, the error macroblock usually refers to an error macroblock caused by channel transmission or decoder error, and generally uses motion estimation technology and residual signal analysis and other methods to detect the error macroblock. Finally, if the error macroblock is detected by the error macroblock detection module, the position of the error macroblock is recorded, and after completing the processing of the current frame, the next frame is decoded and detected to obtain the error macroblock and the position of the error macroblock until all decoded video frames are detected. Specifically, the coordinate method is used for recording, such as recording the pixel coordinates of the upper left corner and the lower right corner of the error macroblock.

[0111] The effect of the above technical solution is: by detecting the error macroblock and recording its position, basic data is provided for subsequent error concealment. By detecting and processing the error macroblock, the reliability and stability of video transmission can be effectively improved, the distortion phenomenon in the video transmission process can be reduced, and the video quality can be improved.

[0112] According to an embodiment of the present invention, obtaining edge macroblock information of a lost slice includes:

[0113] The lost slice position determination module is used to determine the position of the lost slice according to the recorded erroneous macroblock position information; wherein the lost slice is usually composed of multiple erroneous macroblocks, so it is necessary to determine the edge macroblock information of the lost slice according to the erroneous macroblock position information.

[0114] The edge macroblock information extraction module is used to extract edge macroblock information from the adjacent macroblocks of the lost slice: specifically, for each lost slice, edge macroblock information is extracted from its adjacent decoded macroblocks. The edge macroblock usually includes the boundary part of the macroblock, that is, the edge part of the luminance and chrominance subblocks. The edge macroblock information of the lost slice can be obtained by extracting the edge parts of these subblocks from the adjacent macroblocks.

[0115] An initial edge macroblock information acquisition module is used to splice sub-block edge information extracted from adjacent macroblocks to obtain initial edge macroblock information of the lost slice;

[0116] The complete pixel value acquisition module is used to fill the initial edge macroblock information of the lost slice by interpolation to obtain the complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice, and the interpolation method includes bilinear interpolation and cubic spline interpolation.

[0117] The working principle of the above technical solution is as follows: first, the position of the lost slice is determined according to the recorded erroneous macroblock position information by the lost slice position determination module; wherein the lost slice is usually composed of multiple erroneous macroblocks, so it is necessary to determine the edge macroblock information of the lost slice according to the erroneous macroblock position information. Then, the edge macroblock information is extracted from the adjacent macroblocks of the lost slice by the edge macroblock information extraction module: specifically, for each lost slice, the edge macroblock information is extracted from its adjacent decoded macroblocks. The edge macroblock usually includes the boundary part of the macroblock, that is, the edge part of the luminance and chrominance subblocks. The edge macroblock information of the lost slice can be obtained by extracting the edge parts of these subblocks from the adjacent macroblocks. Then, the initial edge macroblock information acquisition module is used to splice the subblock edge information extracted from the adjacent macroblocks to obtain the initial edge macroblock information of the lost slice; finally, the complete pixel value acquisition module is used to fill the initial edge macroblock information of the lost slice by interpolation to obtain the complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice, and the interpolation method includes bilinear interpolation and cubic spline interpolation.

[0118] The effect of the above technical solution is: the above technical solution can solve the problem of video loss caused by erroneous macroblocks in video frames, by detecting the position of erroneous macroblocks, extracting the edge macroblock information of the lost slice, and filling the lost slice with pixels by interpolation, so that the lost slice in the video frame can be restored. Compared with directly discarding the entire video frame, this technology can improve the reliability and stability of video transmission, improve the success rate of video decoding and user experience.

[0119] In one embodiment of the present invention, the prediction module comprises:

[0120] A neighborhood macro position determination module, used to determine the position of the neighborhood macro block of the erroneous macro block according to the position information of the erroneous macro block;

[0121] The motion vector prediction module is used to obtain the predicted motion vector of the erroneous macroblock by using the decoded neighboring macroblocks and the corresponding motion vector information; specifically, the weighted average method is used for calculation, that is, the motion vectors of the neighboring macroblocks are weighted averaged according to the motion vectors and spatial positions of the neighboring macroblocks to obtain the predicted motion vector of the erroneous macroblock.

[0122] The information extraction module is used to extract the edge macroblock information of the lost slice, and use the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to predict the motion vector of the error macroblock to obtain the motion vector prediction value of the error macroblock. Specifically, the prediction calculation is performed using a weighted average method, that is, the predicted motion vectors of the neighboring macroblocks are weighted averaged to obtain the predicted motion vector of the error macroblock.

[0123] The working principle of the above technical solution is as follows: first, the position of the neighboring macroblock of the erroneous macroblock is determined according to the position information of the erroneous macroblock by the position determination module of the neighboring macroblock; then, the predicted motion vector of the erroneous macroblock is obtained by the motion vector prediction module using the decoded neighboring macroblock and the corresponding motion vector information; specifically, the weighted average method is used for calculation, that is, the motion vector of the neighboring macroblock is weighted averaged according to the motion vector and spatial position of the neighboring macroblock to obtain the predicted motion vector of the erroneous macroblock. After that, the edge macroblock information of the lost slice is extracted by the information extraction module, and the motion vector of the erroneous macroblock is predicted and calculated using the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to obtain the motion vector prediction value of the erroneous macroblock. Specifically, the prediction calculation is calculated by the weighted average method, that is, the predicted motion vector of the neighboring macroblock is weighted averaged to obtain the predicted motion vector of the erroneous macroblock.

[0124] The effect of the above technical solution is: the pixel information of the lost slice is restored by predicting the motion vector of the erroneous macroblock. Since the motion between adjacent macroblocks in a video frame has a certain continuity and correlation, the motion vector of the neighboring macroblock is calculated by weighted average method to improve the accuracy and stability of the prediction. The motion vector prediction value of the erroneous macroblock predicted by motion estimation can be used to further fill in the pixel information of the lost slice, thereby improving the quality and accuracy of video recovery.

[0125] In one embodiment of the present invention, the error concealment module includes:

[0126] A position and size acquisition module, used to acquire the position and size of the erroneous macroblock according to the predicted motion vector;

[0127] The video frame acquisition module is used to perform interpolation processing on the decoded macroblocks around the error macroblock to obtain the video frame after error concealment; wherein, the interpolation processing can adopt the mean interpolation method, that is, the average value of the pixel values ​​of the surrounding macroblocks is used as the pixel value of the error macroblock. In addition, the weighted average method can also be used to perform weighted average on the pixel values ​​of the surrounding macroblocks to obtain a more accurate error concealment effect.

[0128] The video frame reconstruction module is used to reconstruct the video frame after the error is concealed to obtain the reconstructed video frame data. The reconstructed video frame data ensures that the reconstructed video frame can be displayed normally.

[0129] The working principle of the above technical solution is: first, the position and size of the erroneous macroblock are obtained according to the predicted motion vector by the position and size acquisition module;

[0130] Then, the decoded macroblocks around the error macroblock are interpolated by the video frame acquisition module to obtain the video frame after error concealment; wherein, the interpolation process can adopt the mean interpolation method, that is, the average value of the pixel values ​​of the surrounding macroblocks is used as the pixel value of the error macroblock. In addition, the weighted average method can also be adopted to perform weighted average on the pixel values ​​of the surrounding macroblocks to obtain a more accurate error concealment effect.

[0131] Finally, the video frame after error masking is reconstructed by a video frame reconstruction module to obtain reconstructed video frame data, which ensures that the reconstructed video frame can be displayed normally.

[0132] The effect of the above technical solution is that the above technical solution can quickly repair the erroneous macroblocks, thereby reducing the impact of video distortion. At the same time, since the method adopts interpolation algorithms such as weighted average method, a more accurate error concealment effect can be obtained, thereby further improving the quality and clarity of the video.

[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A real-time error concealment method for video decoding based on H.264, It is characterized in that The video decoding real-time error concealment method comprises: Decoding the video frame, monitoring in real time whether there is an erroneous macroblock in the video frame when decoding the video frame, and recording the position of the erroneous macroblock; Get the edge macroblock information of the lost slice; The motion vector of the error macroblock is predicted by using the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and the motion vector prediction value of the error macroblock is obtained; The error of the erroneous macroblock is concealed by using the motion vector prediction value of the erroneous macroblock.

2. The video decoding real-time error concealment method according to claim 1, It is characterized in that Decoding a video frame of a video, when decoding the video frame, monitoring in real time whether there is an erroneous macroblock in the video frame, and recording the position of the erroneous macroblock, including: Initialize a video decoder and set decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate; Decoding the video frame to obtain a decoded video frame; The decoded video frames are analyzed to detect whether there are erroneous macroblocks in the decoded video frames; if an erroneous macroblock is detected, the position of the erroneous macroblock is recorded, and after completing the processing of the current frame, the next frame is decoded and detected to obtain the erroneous macroblock and the position of the erroneous macroblock until all decoded video frames are detected.

3. The video decoding real-time error concealment method according to claim 1, It is characterized in that Get the edge macroblock information of the lost slice, including: Determine the position of the lost slice according to the recorded erroneous macroblock position information; Extract edge macroblock information from adjacent macroblocks of the lost slice: The sub-block edge information extracted from adjacent macroblocks is spliced ​​to obtain the initial edge macroblock information of the lost slice; The initial edge macroblock information of the lost slice is filled in an interpolation manner to obtain a complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice.

4. The video decoding real-time error concealment method according to claim 1, It is characterized in that The motion vector of the error macroblock is predicted by the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and the motion vector prediction value of the error macroblock is obtained, including: Determine the position of a neighboring macroblock of the erroneous macroblock according to the position information of the erroneous macroblock; The predicted motion vector of the erroneous macroblock is obtained by using the decoded neighboring macroblocks and the corresponding motion vector information; the edge macroblock information of the lost slice is extracted, and the motion vector of the erroneous macroblock is predicted and calculated by using the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to obtain the motion vector prediction value of the erroneous macroblock.

5. The video decoding real-time error concealment method according to claim 1, It is characterized in that Using the motion vector prediction value of the erroneous macroblock, the error of the erroneous macroblock is concealed, including: According to the predicted motion vector, obtaining the position and size of the erroneous macroblock; Interpolate the decoded macroblocks around the erroneous macroblock to obtain a video frame after the error is concealed; The video frame after error concealment is reconstructed to obtain reconstructed video frame data.

6. A real-time error concealment system for video decoding based on H.264, It is characterized in that The video decoding real-time error concealment system comprises: The frame processing module is used to process the decoded video frames of the video. When decoding the video frames, it monitors in real time whether there are erroneous macroblocks in the video frames and records the positions of the erroneous macroblocks. An edge macroblock information acquisition module is used to acquire edge macroblock information of a lost slice; A prediction module, used to predict the motion vector of the error macroblock through the motion vector of the neighboring macroblock and the edge macroblock information of the lost slice, and obtain the motion vector prediction value of the error macroblock; The error concealment module is used to conceal the error of the erroneous macroblock by using the motion vector prediction value of the erroneous macroblock.

7. The video decoding real-time error concealment system according to claim 6, It is characterized in that The frame processing module comprises: An initialization module, used to initialize a video decoder and set decoding parameters of the video decoder, wherein the decoding parameters include video format, resolution and frame rate; A decoding module, used for decoding the video frame to obtain a decoded video frame; An analysis module, used to analyze the decoded video frame and detect whether there is an erroneous macroblock in the decoded video frame; The error macroblock detection module is used to record the position of the error macroblock if an error macroblock is detected, and after completing the processing of the current frame, continue to decode and detect the next frame to obtain the error macroblock and the position of the error macroblock until all decoded video frames are detected.

8. The video decoding real-time error concealment system according to claim 6, It is characterized in that Get the edge macroblock information of the lost slice, including: A lost slice position determination module, used to determine the position of the lost slice according to the recorded erroneous macroblock position information; The edge macroblock information extraction module is used to extract edge macroblock information from adjacent macroblocks of the lost slice: An initial edge macroblock information acquisition module is used to splice sub-block edge information extracted from adjacent macroblocks to obtain initial edge macroblock information of the lost slice; The complete pixel value acquisition module is used to fill the initial edge macroblock information of the lost slice by interpolation to obtain the complete pixel value of the lost slice, wherein the complete pixel value of the lost slice is the edge macroblock information of the lost slice.

9. The video decoding real-time error concealment system according to claim 6, It is characterized in that The prediction module comprises: A neighborhood macro position determination module, used to determine the position of the neighborhood macro block of the erroneous macro block according to the position information of the erroneous macro block; A motion vector prediction module, used to obtain a predicted motion vector of an erroneous macroblock using decoded neighboring macroblocks and corresponding motion vector information; The information extraction module is used to extract the edge macroblock information of the lost slice, and use the predicted motion vector of the neighboring macroblock and the edge macroblock information of the lost slice to predict the motion vector of the error macroblock to obtain the motion vector prediction value of the error macroblock.

10. The video decoding real-time error concealment system according to claim 6, It is characterized in that The error concealment module comprises: A position and size acquisition module, used to acquire the position and size of the erroneous macroblock according to the predicted motion vector; A video frame acquisition module is used to perform interpolation processing on decoded macroblocks around the error macroblock to obtain a video frame after the error is concealed; The video frame reconstruction module is used to reconstruct the video frame after error concealment to obtain reconstructed video frame data.