Video coding and decoding method based on synthetic image prediction
By encoding and decoding video signals within and between frames, and using synthetic image prediction to remove redundant information, the problem of redundant information occupying storage space in video encoding and decoding is solved, and transmission efficiency and decoding performance are improved.
Patent Information
- Application Number
- CN202410786759.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When video encoding and decoding is not performed based on synthetic image prediction in the prior art, a large amount of redundant information is stored in the video information memory, which occupies too much storage space, resulting in a waste of storage space.
By decomposing the video signal into image frames and encoding I frames, P frames and B frames in different ways, synthetic image prediction is used to remove redundant information, including spatial redundancy, temporal redundancy and visual redundancy, using hard decoding Video encoding and decoding are performed in combination with soft decoding.
Effectively reduce the size of video data, improve network transmission efficiency, release storage space, ensure video quality, and improve decoding efficiency and image quality.
Smart Images

Figure CN118741129A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of digital video compression coding and decoding, in particular to a video coding and decoding method based on synthetic image prediction. Background Art
[0002] From the perspective of information theory, the data describing the source is the sum of information and data redundancy, that is: data = information + data redundancy. There are many types of data redundancy, such as spatial redundancy, temporal redundancy, and visual redundancy. Taking the image as a source, the essence of video compression coding is to reduce the redundancy in the image.
[0003] In a Chinese patent with publication number CN104053008A, a video coding and decoding method based on synthetic image prediction and a video codec are mentioned, wherein a synthetic image prediction flag is set for a non-basic view according to the codec computing power, and the value of the synthetic image prediction flag indicates whether video coding and decoding based on synthetic image prediction is allowed. If allowed, the video coding and decoding based on synthetic image prediction can be enabled, and if not allowed, the video coding and decoding based on synthetic image prediction needs to be disabled, so that the video coding and decoding based on synthetic image prediction can be flexibly turned on or off by setting the value of the synthetic image prediction flag. The video codec is suitable for video codecs with different computing powers. The video codec can perform video coding and decoding that is adapted to its own computing power. When the codec computing power is strong, video coding and decoding based on synthetic image prediction is performed, and when the codec computing power is weak, video coding and decoding based on synthetic image prediction is not performed.
[0004] However, the above-mentioned device determines whether to perform video encoding and decoding based on synthetic image prediction through the computing power of the codec. When the computing power of the codec is small, video encoding and decoding is not performed based on synthetic image prediction, which will cause a large amount of redundant information to be stored in the video information memory, occupying too much storage space and causing storage space to be wasted.
[0005] To this end, those skilled in the art have proposed a video coding and decoding method based on synthetic image prediction to solve the problems raised by the background technology. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a video encoding and decoding method based on synthetic image prediction to solve the problem that video encoding and decoding is not based on synthetic image prediction in the prior art, which will lead to a large amount of redundant information in the video information memory, occupying too much storage space and causing storage space to be wasted.
[0007] The video encoding and decoding method based on synthetic image prediction includes the following steps:
[0008] S1: Video encoding, decomposing the video signal into image frames and outputting a single image frame;
[0009] S2: Identify the image frames and divide a single image frame into I frames (independent frames with all information), P frames (inter-frame prediction coding frames) and B frames (bidirectional prediction coding frames);
[0010] S3: I-frames are encoded independently without the need for synthetic images for prediction. P-frames are encoded based on the synthetic image prediction of different parts of the previous I-frame and P-frame. The synthetic image prediction of the previous and next frames of the B-frame are used as references.
[0011] S4: compressing according to redundant information of video data;
[0012] S5: Evaluate the coding effect and calculate the "Signal-to-Noise Ratio / Peak Signal-to-Noise Ratio";
[0013] S6: Video decoding, which is done by both hard decoding and soft decoding.
[0014] Preferably, when the image frame is an I frame, the image is cut into macroblocks, and the I frame is encoded using intra-frame coding, utilizing the spatial correlation within the frame image, and undergoing DCT (discrete cosine transform), quantization and Huffman coding processes.
[0015] Preferably, when the image frame is a P frame, the image is cut into macroblocks, the P frame adopts inter-frame coding, and simultaneously utilizes spatial and temporal correlations and a motion compensation algorithm to remove redundant information.
[0016] Preferably, when the image frame is a B frame, the image is cut into macroblocks, the B frame adopts bidirectional inter-frame coding, and a motion compensation method is used to remove redundant information.
[0017] Preferably, the redundant information includes spatial redundancy, temporal redundancy, image construction redundancy, knowledge redundancy and visual redundancy.
[0018] Preferably, the signal-to-noise ratio / peak signal-to-noise ratio is calculated as follows:
[0019] Mean Square Error (MSE)
[0020]
[0021] Mean Abs l oute Difference (MAD)
[0022]
[0023] Signal-to-noise ratio (SNR)
[0024]
[0025] Peak Signal Noise Rate (PSNR)
[0026]
[0027] The signal-to-noise ratio / peak signal-to-noise ratio was calculated in the above manner.
[0028] Preferably, the hard decoding method of the video decoding is to decode through hardware, and use the video acceleration function of the graphics card to decode the high-definition video.
[0029] Preferably, the soft decoding method of the video decoding is to perform decoding through software, using a CPU to perform decoding on a large amount of video information calculations.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] 1. The present invention decomposes the video signal into a series of image frames, outputs a single image frame, and encodes these image frames into digital signals. Video encoding is to compress each frame of the image, remove redundant information in the video data, and compress the video data to a smaller size while ensuring the video quality, thereby effectively improving the network transmission efficiency. After referring to the synthetic image prediction, the P frame and the B frame are compressed and the redundant information is removed, so that the P frame and the B frame have a high compression rate and occupy a small space. By classifying the image frames, the objects to be processed are reduced, the size of the video is greatly compressed, and a large amount of storage space is released.
[0032] 2. The present invention uses hard decoding and soft decoding in combination. Hard decoding does not occupy CPU resources, has high decoding efficiency, and allows smooth video playback. The image quality of soft decoding is relatively good. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of a video encoding and decoding method based on synthetic image prediction according to the present invention;
[0034] Figure 2 This is a step diagram of a video encoding and decoding method based on synthetic image prediction according to the present invention. DETAILED DESCRIPTION
[0035] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0036] As attached Figure 1 and Figure 2 As shown:
[0037] The present invention provides a video encoding and decoding method based on synthetic image prediction, comprising the following steps:
[0038] S1: Video encoding, decomposing the video signal into image frames and outputting a single image frame;
[0039] S2: Identify the image frames and divide a single image frame into I frames (independent frames with all information), P frames (inter-frame prediction coding frames) and B frames (bidirectional prediction coding frames);
[0040] S3: I-frames are encoded independently without the need for synthetic images for prediction. P-frames are encoded based on the synthetic image prediction of different parts of the previous I-frame and P-frame. The synthetic image prediction of the previous and next frames of the B-frame are used as references.
[0041] S4: compressing according to redundant information of video data;
[0042] S5: Evaluate the coding effect and calculate the "Signal-to-Noise Ratio / Peak Signal-to-Noise Ratio";
[0043] S6: Video decoding, which is done by both hard decoding and soft decoding.
[0044] As can be seen from the above, video signal encoding is achieved by decomposing the video signal into a series of image frames, outputting a single image frame, and encoding these image frames into digital signals. Video encoding is to compress each frame of the image, remove redundant information in the video data, and compress the video data to a smaller size while ensuring video quality, thereby effectively improving network transmission efficiency. Video signal decoding is the inverse process of encoding, which converts the encoded signal or data stream back to its original form for observation, processing and further operation.
[0045] Specifically, when the image frame is an I frame, the image is cut into macroblocks, and the I frame is encoded using intra-frame coding, utilizing the spatial correlation within the frame image, and undergoing DCT (discrete cosine transform), quantization, and Huffman coding processes.
[0046] From the above, we can see that video coding technology prioritizes eliminating targets and removing spatial and temporal redundancy. An I frame is an independent frame that carries all information and is the most complete picture (occupies the largest space). It can be decoded independently without referring to synthetic image predictions. The first frame in a video sequence is always an I frame.
[0047] Specifically, when the image frame is a P frame, the image is cut into macroblocks, and the P frame adopts inter-frame coding, and at the same time utilizes the correlation between space and time and adopts a motion compensation algorithm to remove redundant information.
[0048] From the above, it can be seen that the video coding technology is used to prioritize the elimination of targets, remove spatial redundancy and temporal redundancy. The P frame is an inter-frame prediction coding frame, which needs to refer to the synthetic image prediction and refer to different parts of the previous I frame and P frame for encoding. The P frame is dependent on the synthetic image of the previous P and I reference frames. Through the prediction of the P and I reference frames, the P frame predicted by the synthetic image has a high compression rate and occupies a small space, so that the storage space is released.
[0049] Specifically, when the image frame is a B frame, the image is cut into macroblocks, the B frame uses bidirectional inter-frame coding, and a motion compensation method is used to remove redundant information.
[0050] From the above, we can see that video coding technology gives priority to eliminating targets, removing spatial redundancy and temporal redundancy. B-frame bidirectional prediction coding frames need to refer to synthetic image prediction, and refer to previous frames and subsequent frames for encoding. B-frames predicted by synthetic images of previous and subsequent frames have high compression rates and occupy little space, thereby releasing storage space. By classifying image frames, the objects to be processed are reduced, and the size of the video is greatly compressed, thereby releasing a large amount of storage space.
[0051] Specifically, redundant information includes spatial redundancy, temporal redundancy, image structure redundancy, knowledge redundancy and visual redundancy. The content and compression method of redundant information are as follows:
[0052]
[0053] From the above, we can see that for redundant information in the video, spatial redundancy and temporal redundancy are eliminated first. Spatial redundancy is eliminated by using the correlation between pixels through transform coding and predictive coding for compression, while temporal redundancy is eliminated by using the correlation in the temporal direction through inter-frame prediction and motion compensation for compression.
[0054] Specifically, the calculation method of signal-to-noise ratio / peak signal-to-noise ratio is:
[0055] Mean Square Error (MSE)
[0056]
[0057] Mean Abs l oute Difference (MAD)
[0058]
[0059] Signal-to-noise ratio (SNR)
[0060]
[0061] Peak Signal Noise Rate (PSNR)
[0062]
[0063] The signal-to-noise ratio / peak signal-to-noise ratio was calculated in the above manner.
[0064] From the above, we can see that the quality of video encoding is judged by the signal-to-noise ratio / peak signal-to-noise ratio, and assisted by readability (easy to read and understand, with clear naming and good comments), maintainability (improving code maintainability through modular design, low coupling, high cohesion and code reuse), performance efficiency (ensuring performance efficiency through the time complexity and space complexity of the algorithm), reliability (following coding standards, error handling and exception handling), scalability (adapting to changes in requirements and system evolution through reasonable architecture design and flexible code organization) and security (paying attention to data verification, preventing security vulnerabilities and attacks) to make auxiliary judgments, so that the video encoding meets the specifications and standards.
[0065] Specifically, the hard decoding method of video decoding is to decode through hardware, and use the video acceleration function of the graphics card to decode the high-definition video.
[0066] From the above, we can see that hard decoding does not take up CPU resources, has high decoding efficiency, and allows smooth video playback, but the image quality may be affected due to compatibility issues.
[0067] Specifically, the soft decoding method of video decoding is to decode through software, and use the CPU to calculate and decode a large amount of video information.
[0068] From the above, we can see that the image quality of soft decoding is relatively good, which requires the CPU to have sufficient performance. According to the needs of video playback, hard decoding and soft decoding are used in combination.
[0069] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0070] In the drawings of the embodiments disclosed in the present invention, only the structures involved in the embodiments disclosed in the present invention are involved, and other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of the present invention can be combined with each other.
[0071] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A video coding and decoding method based on synthetic image prediction, characterized in that: The following steps are involved: S1: Video encoding, decomposing the video signal into image frames and outputting a single image frame; S2: Identify the image frames and divide a single image frame into I frame, P frame and B frame; S3: I-frames are encoded independently without the need for synthetic images for prediction. P-frames are encoded based on the synthetic image prediction of different parts of the previous I-frame and P-frame. The synthetic image prediction of the previous and next frames of the B-frame are used as references. S4: compressing according to redundant information of video data; S5: Evaluate the coding effect and calculate the "Signal-to-Noise Ratio / Peak Signal-to-Noise Ratio"; S6: Video decoding, which is done by both hard decoding and soft decoding.
2. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: When the image frame is an I frame, the image is cut into macroblocks. The I frame is encoded using intra-frame coding, utilizing the spatial correlation within the frame image, and undergoing DCT, quantization, and Huffman coding processes.
3. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: When the image frame is a P frame, the image is cut into macroblocks, and the P frame adopts inter-frame coding, and at the same time utilizes the spatial and temporal correlation and adopts a motion compensation algorithm to remove redundant information.
4. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: When the image frame is a B frame, the image is cut into macroblocks, the B frame adopts bidirectional inter-frame coding, and a motion compensation method is used to remove redundant information.
5. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: The redundant information includes spatial redundancy, temporal redundancy, image construction redundancy, knowledge redundancy and visual redundancy.
6. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: The signal-to-noise ratio / peak signal-to-noise ratio is calculated as follows: Mean Square Error (MSE) Mean Absloute Difference (MAD) Signal Noise Rate (SNR) Peak Signal Noise Rate (PSNR) The signal-to-noise ratio / peak signal-to-noise ratio was calculated in the above manner.
7. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: The hard decoding method of the video decoding is to decode through hardware, and utilize the video acceleration function of the graphics card to decode the high-definition video.
8. The video encoding and decoding method based on synthetic image prediction according to claim 1, characterized in that: The soft decoding method of the video decoding is to perform decoding through software, and utilize the CPU to perform decoding on a large amount of video information calculation.
