CN-119342232-B - Video encoding method, video decoding method and related devices
Abstract
The application discloses a video encoding method, a video decoding method and related devices. The video coding method comprises the steps of coding video to obtain coding data, adding preset syntax into the coding data to obtain a video code stream, wherein different values of the preset syntax are used for indicating whether a knowledge image is used for displaying and/or whether a skip mode is forcedly used for coding the same content frame of the knowledge image, and the knowledge image corresponds to the same original image content with the same content frame. The application can reduce the coding delay.
Inventors
- FANG CHENG
- JIANG DONG
- LIN JUCAI
- ZHANG XUE
- YIN JUN
Assignees
- 浙江大华技术股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230718
Claims (20)
- 1. A method of video encoding, the method comprising: Encoding the video to obtain encoded data; adding a preset syntax into the encoded data to obtain a video code stream, wherein different values of the preset syntax are used for indicating whether a knowledge image is used for display or not; the adding a preset syntax into the encoded data to obtain a video code stream includes: If the knowledge image is transmitted in a slicing way, and if a code stream for transmitting other images is inserted between the code streams of at least two image blocks of the knowledge image, the preset syntax in the encoded data indicates that the knowledge image is not used for displaying.
- 2. The video coding method of claim 1, wherein, The video is encoded to obtain encoded data, which comprises that the original image content of the knowledge image is encoded only once to obtain the encoded data of the knowledge image; The adding of the preset syntax in the encoded data to obtain a video code stream comprises adding the preset syntax in the encoded data of the knowledge image and/or a sequence parameter set corresponding to the knowledge image to indicate the knowledge image to display.
- 3. The video coding method according to claim 2, wherein the encoding the original image content of the knowledge-image only once to obtain the encoded data of the knowledge-image comprises: and encoding the playing sequence number of the knowledge image into the encoded data of the knowledge image.
- 4. The video coding method according to claim 1, wherein the preset syntax is provided with at least a first value, a second value and/or a third value; When the preset syntax value is a first value, representing that the knowledge image is not used for display, and encoding the same content frame of the knowledge image by using a skip mode is not forced; when the preset syntax value is a second value, representing the knowledge image for display; And when the preset syntax value is a third value, the knowledge image is represented not to be displayed, and the same content frame of the knowledge image is forcedly encoded by using a skip mode.
- 5. The video encoding method according to claim 1, wherein the preset syntax includes a first syntax and/or a second syntax; when the first syntax value is a fourth value, representing that the knowledge image is not used for display; When the first syntax value is a fifth value, representing the knowledge image for display; when the second syntax value is a sixth value, the representation does not force to encode the same content frame of the knowledge image using a skip mode; and when the second syntax value is a seventh value, encoding the same content frame of the knowledge image by forcing to use a skip mode.
- 6. The method for video coding according to claim 1, wherein adding a predetermined syntax to the coded data to obtain a video bitstream comprises: and adding the preset syntax into the sequence parameter set and/or the image parameter set.
- 7. The video encoding method according to claim 6, wherein the preset syntax includes a switch syntax and a use state syntax, and the adding the preset syntax in the sequence parameter set and/or the picture parameter set includes: Adding the switch syntax in the sequence parameter set, wherein different values of the switch syntax are used for indicating whether a display scheme of a knowledge image is started in an image sequence of the sequence parameter set; and adding the use state syntax into the image parameter set, wherein different values of the use state syntax are used for indicating whether a knowledge image corresponding to the image parameter set is used for display or not.
- 8. The method of video coding according to claim 1, wherein the encoding the video to obtain encoded data comprises: Judging whether the knowledge image is transmitted in a slicing way or not; if the segmented transmission is adopted, the knowledge image is segmented into at least two image blocks, and then the at least two image blocks of the knowledge image are respectively coded into different coding data; If the slice transmission is not adopted, the whole frame of knowledge image is directly coded into one coded data.
- 9. The video encoding method according to claim 8, wherein the determining whether to employ slice transmission for the knowledge image comprises determining whether to employ slice transmission for the knowledge image based on a traffic scenario; The business scenario is determined based on bit overhead and/or image code rate requirements of the knowledge image.
- 10. The method for video coding according to claim 8, wherein adding a predetermined syntax to the coded data to obtain a video bitstream comprises: If the knowledge image is not transmitted in a slicing way, the preset syntax in the encoded data indicates that the knowledge image is used for displaying; and if the knowledge image is transmitted in a slicing way, the preset syntax in the encoded data indicates that the knowledge image is not used for display.
- 11. A method of video encoding, the method comprising: Encoding the video to obtain encoded data; Adding a preset syntax to the encoded data to obtain a video code stream, wherein different values of the preset syntax are used for indicating whether a knowledge image is used for displaying and whether a skip mode is forced to encode the same content frame of the knowledge image, the knowledge image corresponds to the same original image content with the same content frame, The method comprises the steps of forcing the use of a skip mode to encode the same content frame of a knowledge image, wherein the forced use of the skip mode is that a preset mode of all image blocks in the same content frame is set to be a skip mode, and all filtering tools in the encoding process of the same content frame are closed; the adding a preset syntax into the encoded data to obtain a video code stream includes: If the knowledge image is transmitted in a slicing way, and if a code stream for transmitting other images is inserted between the code streams of at least two image blocks of the knowledge image, the preset syntax in the encoded data indicates that the knowledge image is not used for displaying.
- 12. The video coding method of claim 11, wherein, The video is encoded to obtain encoded data, which comprises that the original image content of the knowledge image is encoded only once to obtain the encoded data of the knowledge image; The adding of the preset syntax in the encoded data to obtain a video code stream comprises adding the preset syntax in the encoded data of the knowledge image and/or a sequence parameter set corresponding to the knowledge image to indicate the knowledge image to display.
- 13. The video coding method according to claim 12, wherein the encoding the original image content of the knowledge-image only once to obtain the encoded data of the knowledge-image comprises: and encoding the playing sequence number of the knowledge image into the encoded data of the knowledge image.
- 14. The video coding method according to claim 11, wherein the preset syntax is provided with at least a first value, a second value and/or a third value; When the preset syntax value is a first value, representing that the knowledge image is not used for display, and encoding the same content frame of the knowledge image by using a skip mode is not forced; when the preset syntax value is a second value, representing the knowledge image for display; And when the preset syntax value is a third value, the knowledge image is represented not to be displayed, and the same content frame of the knowledge image is forcedly encoded by using a skip mode.
- 15. The video coding method according to claim 11, wherein the preset syntax includes a first syntax and/or a second syntax; when the first syntax value is a fourth value, representing that the knowledge image is not used for display; When the first syntax value is a fifth value, representing the knowledge image for display; when the second syntax value is a sixth value, the representation does not force to encode the same content frame of the knowledge image using a skip mode; and when the second syntax value is a seventh value, encoding the same content frame of the knowledge image by forcing to use a skip mode.
- 16. The method for video coding according to claim 11, wherein adding a predetermined syntax to the coded data to obtain a video bitstream comprises: and adding the preset syntax into the sequence parameter set and/or the image parameter set.
- 17. The video coding method according to claim 16, wherein the preset syntax includes a switch syntax and a use state syntax, and the adding the preset syntax in a sequence parameter set and/or a picture parameter set includes: adding the switch syntax in the sequence parameter set, wherein different values of the switch syntax are used for indicating whether a display scheme of a knowledge image is enabled in an image sequence of the sequence parameter set and whether a scheme for encoding the same content frame of the knowledge image by using a skip mode is enabled in the image sequence of the sequence parameter set; And adding the use state syntax in the image parameter set, wherein different values of the use state syntax are used for indicating whether the knowledge image corresponding to the image parameter set is used for displaying or not and whether the same content frame of the knowledge image corresponding to the image parameter set is forcedly encoded by using a skip mode or not.
- 18. The method of video coding according to claim 11, wherein the encoding the video to obtain encoded data comprises: Judging whether the knowledge image is transmitted in a slicing way or not; if the segmented transmission is adopted, the knowledge image is segmented into at least two image blocks, and then the at least two image blocks of the knowledge image are respectively coded into different coding data; If the slice transmission is not adopted, the whole frame of knowledge image is directly coded into one coded data.
- 19. The video encoding method according to claim 18, wherein the determining whether to employ slice transmission for the knowledge-image comprises determining whether to employ slice transmission for the knowledge-image based on a traffic scenario; The business scenario is determined based on bit overhead and/or image code rate requirements of the knowledge image.
- 20. The method for video coding according to claim 18, wherein adding a predetermined syntax to the coded data to obtain a video bitstream comprises: If the knowledge image is not transmitted in a slicing way, the preset syntax in the encoded data indicates that the knowledge image is used for displaying; and if the knowledge image is transmitted in a slicing way, the preset syntax in the encoded data indicates that the knowledge image is not used for display.
Description
Video encoding method, video decoding method and related devices Technical Field The present application relates to the field of video encoding and decoding technologies, and in particular, to a video encoding method, a video decoding method, and related devices. Background The video image data volume is relatively large, and video pixel data (RGB, YUV, etc.) is usually required to be compressed, and the compressed data is called a video code stream, and the video code stream is transmitted to a user terminal through a wired or wireless network and then decoded and watched. The whole video coding flow comprises the processes of prediction, transformation, quantization, coding and the like. In video encoding and decoding, in order to increase the compression rate and reduce the code words to be transmitted, an encoder does not directly encode and transmit pixel values, but adopts an intra-frame or inter-frame prediction mode, and adopts reconstructed pixels of an encoded block of a current frame or a reference frame to predict the pixel values of the current block. The pixel value predicted using a certain prediction mode is called a predicted pixel value, and the difference between the predicted pixel value and the original pixel value is called a residual. The encoder only needs to encode a certain prediction mode and residual errors generated when the prediction mode is adopted, and the decoding end can decode corresponding pixel values according to the code stream information. This greatly reduces the code words required for encoding. However, the inventor of the present application has found that the current video coding method has some disadvantages in long-term development, such as long coding delay. Disclosure of Invention The application provides a video encoding method, a video decoding method and a related device, which can reduce encoding delay. To achieve the above object, the present application provides a video encoding method, comprising: Encoding the video to obtain encoded data; And adding a preset syntax into the encoded data to obtain a video code stream, wherein different values of the preset syntax are used for indicating whether the knowledge image is used for displaying and/or whether the knowledge image is forcedly encoded by using a skip mode to the same content frame of the knowledge image, and the knowledge image corresponds to the same original image content with the same content frame. In one embodiment, The video is encoded to obtain encoded data, which comprises that the original image content of the knowledge image is encoded only once to obtain the encoded data of the knowledge image; The adding of the preset syntax in the encoded data to obtain a video code stream comprises adding the preset syntax in the encoded data of the knowledge image and/or a sequence parameter set corresponding to the knowledge image to indicate the knowledge image to display. In an embodiment, the encoding the original image content of the knowledge image only once to obtain the encoded data of the knowledge image includes: and encoding the playing sequence number of the knowledge image into the encoded data of the knowledge image. In an embodiment, the encoding of the video comprises encoding the knowledge image to obtain encoded data of the knowledge image, setting a preset mode of all image blocks in the same content frame of the knowledge image to be a skip mode, and closing all filtering tools in the encoding process of the same content frame to obtain encoded data of the same content frame; Adding a preset syntax in the encoded data to obtain a video code stream, wherein the adding of the preset syntax in the encoded data of the knowledge image and/or the sequence parameter set corresponding to the knowledge image indicates that the same content frame of the knowledge image is encoded by using a skip mode forcedly. In an embodiment, the preset syntax is provided with at least a first value, a second value and/or a third value; When the preset syntax value is a first value, representing that the knowledge image is not used for display, and encoding the same content frame of the knowledge image by using a skip mode is not forced; when the preset syntax value is a second value, representing the knowledge image for display; And when the preset syntax value is a third value, the knowledge image is represented not to be displayed, and the same content frame of the knowledge image is forcedly encoded by using a skip mode. In an embodiment, the preset syntax includes a first syntax and/or a second syntax; when the first syntax value is a fourth value, representing that the knowledge image is not used for display; When the first syntax value is a fifth value, representing the knowledge image for display; when the second syntax value is a sixth value, the representation does not force to encode the same content frame of the knowledge image using a skip mode; and when the second syntax value is a sevent