H265-based coding and decoding method carrying custom image frame information
By adding custom image frame data at the tail of the H265 encoded image frame, the high power consumption and unreliable transmission problems of the H265 video encoding system in low-power and small-occupancy equipment are solved, achieving more efficient and reliable Video encoding and decoding.
Patent Information
- Application Number
- CN202510033270.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing H265 video encoding system has problems with high power consumption and large area in hardware devices in very small spaces, especially in scenarios where video acquisition tasks are required to be efficiently processed. The abnormal transmission of custom image frame data is likely to lead to poor application. reliable.
A H265-based encoding and decoding method is adopted to form a new AVPacket by adding custom image frame data to the tail of the encoded image frame, and decode the custom image frame data according to the encoding rules at the decoding end.
This method saves bandwidth resources and system overhead, improves system reliability, and ensures reliable transmission of custom image frame data, especially in embedded devices with limited system resources.
Smart Images

Figure CN119484844A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of H265 encoding, and in particular to an encoding and decoding method carrying custom image frame information based on H265. Background Art
[0002] H.265 (HEVC, High Efficiency Video Coding) is the latest international video compression standard. H265 has extremely high coding efficiency, mainly because it uses more accurate intra-frame prediction and inter-frame prediction. However, these improvements in coding efficiency are accompanied by increased coding complexity, which poses new challenges to the implementation of real-time algorithms.
[0003] With the rise of wearable smart devices, hardware devices integrated in a very small space require lower power consumption and the ability to efficiently handle various tasks, especially for widespread social needs such as video acquisition, which also poses challenges to video encoding systems. However, the current H265 video encoding system is lacking in performance, mainly reflected in the large footprint and high power consumption. For example, during encoding and decoding, if each image frame data and its corresponding extended data (such as azimuth angle, pitch angle, etc.) are transmitted separately, it is very unreliable for some application scenarios that are extremely dependent on image frame extended information. If the custom image frame data transmission is abnormal for some reason, the application will be unable to proceed.
[0004] Therefore, it is necessary to design a coding and decoding method based on H265 that carries custom image frame information. Summary of the invention
[0005] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art and to provide a coding and decoding method based on H265 that carries custom image frame information.
[0006] To achieve the above object, the technical solution adopted by the present invention is as follows: a coding and decoding method carrying custom image frame information based on H265, comprising the following steps: Step 1, perform H265 encoding on the received original image frame through the encoder, so that each image frame is successfully encoded to form an encoded image frame, and output AVPacket; Step 2, identifying the data frame type of each encoded image frame in the AVPacket according to the H265 encoding technical standard, filtering the encoded image frame according to the data frame type, and extending the tail of the filtered encoded image frame data to add custom image frame data to obtain a new AVPacket; Step 3: According to the rules of encoding and extending the custom image frame data, the new AVPacket is decoded by a decoder to obtain an image frame, and the information of the custom image frame data corresponding to the image frame is parsed.
[0007] Furthermore, in step 1, encoder parameters are set before encoding the original image frame, and the encoder parameters at least include bit rate, frame rate, and GOP.
[0008] Furthermore, in the step 1, each image frame is encoded one by one to obtain Packet_Init and Packet_Init.size, and it is determined whether each image frame is encoded successfully. If the original image frame is encoded successfully, AVPacket is output, and AVPacket stores the encoded compressed data obtained after encoding each image frame.
[0009] Furthermore, in step 2, the information of the custom image frame data at least includes pitch angle and azimuth angle information of the corresponding image frame.
[0010] Furthermore, in step 2, the structure of the custom image frame data is defined so that the structure size of the custom image frame data is fixed to K bytes.
[0011] Furthermore, in step 2, according to the coding frame structure in the H265 code stream and in accordance with the H265 coding technical standard, the data frame type of each coded image frame is identified, the data frame types include I frame, P frame, and B frame, and custom image frame data is added to the end of the data frame of the I frame, P frame, and B frame type to obtain a new AVPacket, and the new Packet_New and Packet_New.size are calculated at the same time, where Packet_New.size=Packet_Init.size+K.
[0012] Furthermore, in step 3, the initial Packet_Init.size of each image frame is restored, and the restoration process is: Obtain and parse Packet_New and Packet_New.size of each encoded image frame, and then obtain Packet_Init and Packet_Init.size of each image frame, where Packet_Init.size = Packet_New.size–K. Send Packet_Init and Packet_Init.size to the decoder for decoding.
[0013] It can be seen from the above description of the present invention that, compared with the prior art, the H265-based encoding and decoding method carrying custom image frame information of the present invention includes at least one of the following beneficial effects: 1. The present invention transmits the custom information carried by each image frame in the code stream, and does not need to transmit each image frame data and its corresponding custom image frame data information separately, thus saving bandwidth resources and system overheads of the encoding and decoding ends, especially for some embedded devices with very limited system resources; 2. The present invention directly adds extended custom image frame information at the end of the encoded image frame, which is simple and easy to use, and facilitates the decoding end to decode the custom image frame according to the encoding rule. The decoding end can simultaneously decode the image frame data and the corresponding custom image frame data; 3. The present invention transmits each image frame data and its corresponding custom image frame data information together, which is very reliable for some application scenarios that are extremely dependent on image frame extension information, and avoids abnormal transmission of custom image frame data. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The present invention is a flowchart of a coding and decoding method based on H265 that carries custom image frame information in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0015] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0016] Reference Figure 1 As shown, a preferred embodiment of the present invention, a coding and decoding method carrying custom image frame information based on H265, comprises the following steps: Step 1, perform H265 encoding on the received original image frame through the encoder, so that each image frame is successfully encoded to form an encoded image frame, and output AVPacket; Step 2, identifying the data frame type of each encoded image frame in the AVPacket according to the H265 encoding technical standard, filtering the encoded image frame according to the data frame type, and extending the tail of the filtered encoded image frame data to add custom image frame data to obtain a new AVPacket; Step 3: According to the rules of encoding and extending the custom image frame data, the new AVPacket is decoded by a decoder to obtain an image frame, and the information of the custom image frame data corresponding to the image frame is parsed.
[0017] The present invention transmits the custom information carried by each image frame in the code stream, and there is no need to transmit each image frame data and its corresponding custom image frame data information separately, saving bandwidth resources and system overhead of the encoding end and the decoding end, especially for some embedded devices with very limited system resources; the present invention directly adds extended custom image frame information at the end of the encoded image frame, which is simple and easy to use, and facilitates the decoding end to decode the custom image frame according to the encoding rules. The decoding end can synchronously decode the frame data and its corresponding custom image frame data; the present invention transmits each image frame data and its corresponding custom image frame data information together, which is very reliable for some application scenarios that are extremely dependent on image frame extended information, and avoids abnormal transmission of custom image frame data.
[0018] As a preferred embodiment of the present invention, it may also have the following additional technical features: In this embodiment, in step 1, encoder parameters are set before encoding the original image frame, and the encoder parameters at least include bit rate, frame rate, and GOP.
[0019] In this embodiment, in step 1, each image frame is encoded one by one to obtain Packet_Init and Packet_Init.size, and it is determined whether each image frame is encoded successfully. If the original image frame is encoded successfully, AVPacket is output, and AVPacket stores the encoded compressed data obtained after encoding each image frame.
[0020] In this embodiment, in step 2, the information of the custom image frame data at least includes the pitch angle and azimuth angle information of the corresponding image frame.
[0021] In this embodiment, in step 2, the structure of the custom image frame data is defined so that the structure size of the custom image frame data is fixed to K bytes.
[0022] In this embodiment, in step 2, according to the coding frame structure in the H265 code stream and in accordance with the H265 coding technical standard, the data frame type of each coded image frame is identified, and the data frame types include I frame, P frame, and B frame. Customized image frame data is added to the end of the data frame of the I frame, P frame, and B frame type to obtain a new AVPacket, and the new Packet_New and Packet_New.size are calculated at the same time, where Packet_New.size=Packet_Init.size+K.
[0023] In this embodiment, in step 3, the initial Packet_Init.size of each image frame is restored, and the restoration process is: Obtain and parse Packet_New and Packet_New.size of each encoded image frame, and then obtain Packet_Init and Packet_Init.size of each image frame, where Packet_Init.size = Packet_New.size–K. Send Packet_Init and Packet_Init.size to the decoder for decoding.
[0024] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and improved concepts of the present invention within the technical scope disclosed by the present invention, and they should be covered by the protection scope of the present invention.
Claims
1. A coding and decoding method carrying custom image frame information based on H265, characterized in that: The following steps are involved: Step 1, perform H265 encoding on the received original image frame through the encoder, so that each image frame is successfully encoded to form an encoded image frame, and output AVPacket; Step 2, identifying the data frame type of each encoded image frame in the AVPacket according to the H265 encoding technical standard, filtering the encoded image frame according to the data frame type, and extending the tail of the filtered encoded image frame data to add custom image frame data to obtain a new AVPacket; Step 3: According to the rules of encoding and extending the custom image frame data, the new AVPacket is decoded by a decoder to obtain an image frame, and the information of the custom image frame data corresponding to the image frame is parsed.
2. According to claim 1, a coding and decoding method based on H265 carrying custom image frame information is characterized in that: In the step 1, encoder parameters are set before encoding the original image frame, and the encoder parameters at least include bit rate, frame rate, and GOP.
3. According to claim 1, a coding and decoding method based on H265 carrying custom image frame information is characterized in that: In the step 1, each image frame is encoded one by one to obtain Packet_Init and Packet_Init.size, and it is determined whether each image frame is encoded successfully. If the original image frame is encoded successfully, AVPacket is output, and AVPacket stores the encoded compressed data obtained after encoding each image frame.
4. The encoding and decoding method based on H265 carrying custom image frame information according to claim 1, characterized in that: In the step 2, the information of the custom image frame data at least includes the pitch angle and azimuth angle information of the corresponding image frame.
5. The encoding and decoding method based on H265 carrying custom image frame information according to claim 1, characterized in that: In the step 2, the structure of the custom image frame data is defined so that the structure size of the custom image frame data is fixed to K bytes.
6. The encoding and decoding method carrying custom image frame information based on H265 according to claim 5, characterized in that: In step 2, according to the coding frame structure in the H265 code stream and the H265 coding technical standard, the data frame type of each coded image frame is identified, and the data frame types include I frame, P frame, and B frame. Custom image frame data is added to the end of the data frame of the I frame, P frame, and B frame type to obtain a new AVPacket, and the new Packet_New and Packet_New.size are calculated at the same time, where Packet_New.size=Packet_Init.size+K.
7. The encoding and decoding method carrying custom image frame information based on H265 according to claim 6, characterized in that: In step 3, the initial Packet_Init.size of each image frame is restored, and the restoration process is: Obtain and parse Packet_New and Packet_New.size of each encoded image frame, and then obtain Packet_Init and Packet_Init.size of each image frame, where Packet_Init.size = Packet_New.size–K. Send Packet_Init and Packet_Init.size to the decoder for decoding.
Citation Information
Patent Citations
Mobile terminal for processing multimedia data in user-defined format and realization method thereof
CN101645967A
Image encoding method, image decoding method, image encoder and image decoder
CN102724553A
Code stream processing method, device and system
CN106507112A
Video encoding method, device and system
CN106713909A
H264 video stream processing method and system, control device and readable storage medium
CN115379230A