Search

CN-122027791-A - Method for encoding video frame, method, device and equipment for decoding video frame

CN122027791ACN 122027791 ACN122027791 ACN 122027791ACN-122027791-A

Abstract

The embodiment of the specification provides a method for encoding video frames, a method for decoding video frames, a device and equipment. The scheme for encoding the video frames comprises the steps of obtaining a first video frame to be encoded with a first resolution, obtaining a first quantization parameter value for encoding a previous video frame of the first video frame to be encoded by an encoder, adjusting the resolution of the first video frame to be encoded from the first resolution to a second resolution if the first quantization parameter value is larger than a first preset quantization parameter threshold value, obtaining an adjusted first video frame to be encoded, wherein the second resolution is smaller than the first resolution, and encoding the adjusted first video frame to be encoded according to a P frame encoding mode in an inter-frame prediction technology.

Inventors

  • ZHANG MINQI
  • YE RUNGUI
  • FAN HONGFEI

Assignees

  • 支付宝(杭州)数字服务技术有限公司

Dates

Publication Date
20260512
Application Date
20260211

Claims (15)

  1. 1. A method of encoding a video frame, comprising: Acquiring a first video frame to be encoded with a first resolution; Acquiring a first quantization parameter value encoded by an encoder for a video frame preceding the first video frame to be encoded; If the first quantization parameter value is larger than a first preset quantization parameter threshold value, adjusting the resolution of the first video frame to be encoded from the first resolution to a second resolution, and obtaining an adjusted first video frame to be encoded, wherein the second resolution is smaller than the first resolution; And encoding the adjusted first video frame to be encoded according to a P frame encoding mode in an inter-frame prediction technology.
  2. 2. The method of claim 1, further comprising, prior to the acquiring the first video frame to be encoded at the first resolution: acquiring a target code rate of a video frame before the first video frame to be coded; The first quantization parameter value is determined based on picture complexity of a video frame preceding the first video frame to be encoded and the target bitrate.
  3. 3. The method of claim 2, the obtaining a target code rate for a video frame preceding the first video frame to be encoded, comprising: calculating the available bandwidth of the network based on a bandwidth estimation algorithm; A target code rate of a video frame preceding the first video frame to be encoded is calculated based on the available bandwidth.
  4. 4. The method of claim 1, the obtaining the first quantization parameter value encoded by the encoder for a video frame preceding the first video frame to be encoded, further comprising: And if the first quantization parameter value is smaller than or equal to the first preset quantization parameter threshold value, encoding the first video frame to be encoded with the first resolution according to a P frame encoding mode in an inter-frame prediction technology.
  5. 5. The method of claim 1, wherein the encoding the adjusted first video frame to be encoded according to the P-frame encoding method in the inter-frame prediction technique comprises: the first indicator information is used for indicating the encoder to encode the adjusted first video frame to be encoded according to a P frame encoding mode; And based on the first indicator information, referring to the video frame before the first video frame to be coded, coding the adjusted first video frame to be coded to obtain code stream information.
  6. 6. The method of claim 5, the method further comprising: acquiring metadata containing supplemental enhancement information; Packaging the code stream information and the metadata to obtain a data packet; and sending the data packet to a decoder.
  7. 7. The method of claim 1, further comprising triggering a fallback mechanism when network conditions are good Acquiring a second video frame to be encoded with a third resolution; acquiring a second quantization parameter value of a video frame preceding the second video frame to be encoded; And if the second quantization parameter value is smaller than or equal to a second preset quantization parameter threshold value, the second video frame to be encoded is encoded according to a P frame encoding mode in an inter-frame prediction technology, wherein the second preset quantization parameter threshold value is smaller than the first preset quantization parameter threshold value.
  8. 8. The method of claim 7, wherein the encoding the second video frame to be encoded according to the P-frame encoding method in the inter-frame prediction technique comprises: the second indicator information is used for indicating the encoder to encode the second video frame to be encoded according to a P frame encoding mode; And based on the second indicator information, encoding the second video frame to be encoded with reference to a video frame preceding the second video frame to be encoded.
  9. 9. A method of decoding video frames, comprising: The method comprises the steps of receiving a data packet, wherein the data packet comprises code stream information and metadata of a video frame to be decoded, the data packet is obtained by taking the video frame to be decoded with a second resolution as a P frame to be encoded, and when a first quantization parameter value used for encoding a previous video frame of the video frame to be decoded is larger than a first preset quantization parameter threshold value, the resolution of the video frame to be decoded is adjusted from the first resolution to the second resolution, and the second resolution is smaller than the first resolution; analyzing the metadata to obtain a sequence parameter set and supplementary enhancement information; and decoding the code stream information based on the sequence parameter set and the supplementary enhancement information to obtain image data with a second resolution.
  10. 10. The method of claim 9, the method further comprising: Based on the supplementary enhancement information, stretching the image data with the second resolution to obtain the image data with the first resolution; Rendering is carried out based on the image data with the first resolution, and a video frame with the first resolution is obtained.
  11. 11. The method of claim 10, the method further comprising: and sending the video frame with the first resolution to a terminal device.
  12. 12. The method of claim 9, the image data being data in YUV format.
  13. 13. An apparatus for encoding video frames, comprising: The video frame acquisition module is used for acquiring a first video frame to be encoded with a first resolution; A quantization parameter value acquisition module, configured to acquire a first quantization parameter value encoded by an encoder for a video frame preceding the first video frame to be encoded; The resolution adjustment module is used for adjusting the resolution of the first video frame to be encoded from the first resolution to a second resolution if the first quantization parameter value is larger than a first preset quantization parameter threshold value, so as to obtain an adjusted first video frame to be encoded; and the coding module is used for coding the adjusted first video frame to be coded according to a P frame coding mode in an inter-frame prediction technology.
  14. 14. An apparatus for decoding video frames, comprising: The device comprises a receiving module, a receiving module and a processing module, wherein the data packet comprises code stream information and metadata of a video frame to be decoded, the data packet is obtained by taking the video frame to be decoded with a second resolution as a P frame to encode, the video frame to be decoded with the second resolution is obtained by adjusting the resolution of the video frame to be decoded from a first resolution to a second resolution under the condition that a first quantization parameter value used for encoding a previous video frame of the video frame to be decoded is larger than a first preset quantization parameter threshold value, and the second resolution is smaller than the first resolution; the analysis module is used for analyzing the metadata to obtain a sequence parameter set and supplementary enhancement information; and the decoding module is used for decoding the code stream information based on the sequence parameter set and the supplementary enhancement information to obtain image data with a second resolution.
  15. 15. A computing device, comprising: A memory and a processor; The memory is adapted to store a computer program/instruction, the processor being adapted to execute the computer program/instruction, which when executed by the processor, implements the steps of the method of any of claims 1 to 12.

Description

Method for encoding video frame, method, device and equipment for decoding video frame Technical Field One or more embodiments of the present disclosure relate to the field of video processing, and more particularly, to a method of encoding video frames and a method of decoding video frames. One or more embodiments of the present specification relate to an apparatus for encoding video frames and an apparatus for decoding video frames, a computing device, a computer-readable storage medium, and a computer program product. Background With the continuous development of the internet, the video needs to be encoded, transmitted and decoded, so as to normally display video pictures, in the fields related to video playing such as short video playing, video live broadcasting, and the like, or in the fields related to video communication such as instant messaging, video conference, and the like. However, in the case of poor or weak network state, the video has problems of blocking, unclear and the like, and bad experience is brought to users. Therefore, how to ensure the smoothness and definition of the video as much as possible even if the video network is in a poor or weak state is a technical problem to be solved. Disclosure of Invention In view of this, one or more embodiments of the present specification provide a method of encoding video frames and a method, apparatus, device, and computer readable medium for decoding video frames for improving smoothness and sharpness of video. According to a first aspect of one or more embodiments of the present specification, there is provided a method of encoding a video frame, comprising: Acquiring a first video frame to be encoded with a first resolution; Acquiring a first quantization parameter value encoded by an encoder for a video frame preceding the first video frame to be encoded; If the first quantization parameter value is larger than a first preset quantization parameter threshold value, adjusting the resolution of the first video frame to be encoded from the first resolution to a second resolution, and obtaining an adjusted first video frame to be encoded, wherein the second resolution is smaller than the first resolution; And encoding the adjusted first video frame to be encoded according to a P frame encoding mode in an inter-frame prediction technology. According to a second aspect of one or more embodiments of the present specification, there is provided a method of decoding a video frame, comprising: The method comprises the steps of receiving a data packet, wherein the data packet comprises code stream information and metadata of a video frame to be decoded, the data packet is obtained by taking the video frame to be decoded with a second resolution as a P frame to be encoded, and when a first quantization parameter value used for encoding a previous video frame of the video frame to be decoded is larger than a first preset quantization parameter threshold value, the resolution of the video frame to be decoded is adjusted from the first resolution to the second resolution, and the second resolution is smaller than the first resolution; analyzing the metadata to obtain a sequence parameter set and supplementary enhancement information; and decoding the code stream information based on the sequence parameter set and the supplementary enhancement information to obtain image data with a second resolution. According to a third aspect of one or more embodiments of the present specification, there is provided an apparatus for encoding a video frame, comprising: The video frame acquisition module is used for acquiring a first video frame to be encoded with a first resolution; A quantization parameter value acquisition module, configured to acquire a first quantization parameter value encoded by an encoder for a video frame preceding the first video frame to be encoded; The resolution adjustment module is used for adjusting the resolution of the first video frame to be encoded from the first resolution to a second resolution if the first quantization parameter value is larger than a first preset quantization parameter threshold value, so as to obtain an adjusted first video frame to be encoded; and the coding module is used for coding the adjusted first video frame to be coded according to a P frame coding mode in an inter-frame prediction technology. According to a fourth aspect of one or more embodiments of the present specification, there is provided an apparatus for decoding a video frame, comprising: The device comprises a receiving module, a receiving module and a processing module, wherein the data packet comprises code stream information and metadata of a video frame to be decoded, the data packet is obtained by taking the video frame to be decoded with a second resolution as a P frame to encode, the video frame to be decoded with the second resolution is obtained by adjusting the resolution of the video frame to be decoded from a first resolution to a seco