Search

CN-116527915-B - Video frame processing method and device, electronic equipment and storage medium

CN116527915BCN 116527915 BCN116527915 BCN 116527915BCN-116527915-B

Abstract

The disclosure relates to a video frame processing method, a device, electronic equipment and a storage medium, wherein under the condition that a video frame to be encoded is a reference frame, a first target filtering parameter is predicted for the video frame to be encoded based on a preset parameter prediction model, a first target encoding mode is selected for an encoding block in the video frame to be encoded from at least two encoding modes based on the first target filtering parameter, and the encoding block which is encoded and filtered by using the first target encoding mode and the first target filtering parameter is acquired to finish the processing of the video frame to be encoded. In this way, when the video frame to be encoded is the reference frame, the parameter prediction model is used to directly predict the first target filtering parameter for the video frame to be encoded, so that the parameters used for filtering the video frame to be encoded can be obtained quickly and effectively, and the processing efficiency can be improved relative to traversing all the filtering parameters to select the target filtering parameters.

Inventors

  • HUANG BO
  • GU JIAWEN
  • ZHONG TINGTING
  • SHAO YUCHAO
  • Xiao Junshi
  • WEN XING

Assignees

  • 北京达佳互联信息技术有限公司

Dates

Publication Date
20260512
Application Date
20230509

Claims (8)

  1. 1. A video frame processing method, applied to a video encoder, the method comprising: Under the condition that a video frame to be encoded is a reference frame, for any one of at least two encoding modes, based on the encoding mode and the video frame to be encoded, acquiring encoding characteristics corresponding to the encoding mode, wherein the encoding characteristics are used for representing encoding effects when the video frame to be encoded is encoded in the encoding mode; Selecting a first target coding mode for a coding block in the video frame to be coded from at least two coding modes based on the first target filtering parameter; Acquiring the coding block after coding and filtering by using the first target coding mode and the first target filtering parameter, and finishing the processing of the video frame to be coded; Selecting a second target coding mode for coding blocks in the video frame to be coded from the at least two coding modes based on a preset selection mode under the condition that the video frame to be coded is a non-reference frame; Selecting a first filtering parameter from selectable filtering parameters according to a first preset step length, and determining a distortion cost value of the coding block when the coding block is processed by the second target coding mode and the first filtering parameter as a distortion cost value corresponding to the first filtering parameter; Selecting a second target filtering parameter for the video frame to be encoded based on a second preset step length and a first filtering parameter with the minimum corresponding distortion cost value, wherein the first preset step length is larger than the second preset step length; And acquiring the coding block after coding and filtering by using the second target coding mode and the second target filtering parameter, and finishing the processing of the video frame to be coded.
  2. 2. The method of claim 1, wherein the selecting a first target coding mode for a coding block in the video frame to be coded from at least two coding modes based on the first target filtering parameter comprises: Determining a target distortion cost value corresponding to each coding mode based on each coding mode and the first target filtering parameter for any coding block in the video frame to be coded, wherein the target distortion cost value is the distortion cost value of the coding block when the coding mode and the first target filtering parameter are used for processing the coding block; And selecting a coding mode with the target distortion cost value meeting a first preset requirement as a first target coding mode of the coding block based on the target distortion cost value corresponding to each coding mode.
  3. 3. The method of claim 2, wherein determining a target distortion cost value for each coding mode based on each coding mode and the first target filtering parameter comprises: For any coding mode, coding the coding block based on the coding mode to obtain the coded coding block; filtering the coded coding block based on the first target filtering parameter to obtain a target coding block corresponding to the coding mode; determining a target coding block corresponding to the coding mode and a distortion cost value between the coding blocks to obtain the target distortion cost value corresponding to the coding mode; the obtaining the encoded block encoded and filtered using the first target encoding mode and the first target filtering parameter includes: And acquiring a target coding block of which the used coding mode is the first target coding mode and the used filtering parameter is the first target filtering parameter from target coding blocks corresponding to the coding modes.
  4. 4. The method according to claim 1, wherein the parametric prediction model is trained by: For any coding mode, acquiring sample coding features corresponding to the coding mode based on the coding mode and sample video frames, wherein the sample coding features are used for representing coding effects when the sample video frames are coded in the coding mode; taking sample coding features corresponding to the at least two coding modes as input of a parameter prediction model to be trained, and obtaining filtering parameters output by the parameter prediction model to be trained for the sample video frames as sample filtering parameters; Based on the sample filtering parameters and filtering parameters marked for the sample video frames in advance, carrying out parameter adjustment on the parameter prediction model to be trained; And under the condition that the parameter prediction model to be trained reaches a stop condition, determining the parameter prediction model to be trained which reaches the stop condition as the parameter prediction model.
  5. 5. The method of claim 1, wherein selecting the second target filtering parameter for the video frame to be encoded based on the second preset step size and the corresponding first filtering parameter with the smallest distortion cost value comprises: taking the first filter parameter with the minimum corresponding distortion cost value as a reference filter parameter, and selecting a second filter parameter from selectable filter parameters with the difference value of the second filter parameter belonging to a preset difference value range according to the second preset step length; Determining the distortion cost value of the coding block when the coding block is processed by the second target coding mode and the second filtering parameter, and taking the distortion cost value as the distortion cost value corresponding to the second filtering parameter; Selecting a filter parameter with the minimum corresponding distortion cost value from the second filter parameter and the reference filter parameter as a third filter parameter; the second target filter parameter is determined based on the third filter parameter.
  6. 6. A video frame processing apparatus for use in a video encoder, the apparatus comprising: the first prediction module is configured to acquire coding features corresponding to at least two coding modes for any one coding mode of the at least two coding modes under the condition that the video frame to be coded is a reference frame based on the coding modes and the video frame to be coded, wherein the coding features are used for representing coding effects when the video frame to be coded is coded by the coding modes; a first selection module configured to select a first target coding mode for a coding block in the video frame to be coded from at least two coding modes based on the first target filtering parameter; The first acquisition module is configured to acquire the coding block after coding and filtering by using the first target coding mode and the first target filtering parameter, and finish the processing of the video frame to be coded; A second target coding mode determining module configured to select a second target coding mode for a coding block in the video frame to be coded from the at least two coding modes based on a preset selection mode in the case that the video frame to be coded is a non-reference frame; The distortion cost value determining module is configured to select a first filtering parameter from selectable filtering parameters according to a first preset step length, and determine the distortion cost value of the coding block when the coding block is processed by the second target coding mode and the first filtering parameter, and the distortion cost value is used as the distortion cost value corresponding to the first filtering parameter; The second target filtering parameter selection module is configured to select a second target filtering parameter for the video frame to be encoded based on a second preset step length and a corresponding first filtering parameter with minimum distortion cost value, wherein the first preset step length is larger than the second preset step length; And the second acquisition module is configured to acquire the coding block coded and filtered by using the second target coding mode and the second target filtering parameter, and finish the processing of the video frame to be coded.
  7. 7. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 5.
  8. 8. A storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, cause the electronic device to perform the method of any of claims 1 to 5.

Description

Video frame processing method and device, electronic equipment and storage medium Technical Field The disclosure relates to the field of computer technology, and in particular, to a video frame processing method, a video frame processing device, electronic equipment and a storage medium. Background Since the compressed image is reconstructed, the image quality is reduced due to artifacts such as blocking effect and ringing effect, and thus, in order to improve the image quality, in-loop filtering techniques, such as deblocking filtering (DF, deblocking Filter), may be used to remove discontinuities at the boundaries of the encoded blocks in the image. In the related art, in the process of deblocking filtering a video frame, all filtering parameters often need to be traversed, and the deblocking filtering processing is performed on the video frame by selecting the filtering parameters to be used, but the processing efficiency is low and the encoding time is long in such a way. Disclosure of Invention The disclosure provides a video frame processing method, a video frame processing device, an electronic device and a storage medium, so as to at least solve the problems of how to improve the processing efficiency and reduce the encoding time length. The technical scheme of the present disclosure is as follows: According to a first aspect of embodiments of the present disclosure, there is provided a video frame processing method, applied to a video encoder, the method comprising: Under the condition that a video frame to be encoded is a reference frame, predicting a first target filtering parameter for the video frame to be encoded based on a preset parameter prediction model; Selecting a first target coding mode for a coding block in the video frame to be coded from at least two coding modes based on the first target filtering parameter; and acquiring the coding block after coding and filtering by using the first target coding mode and the first target filtering parameter, and finishing the processing of the video frame to be coded. Optionally, the predicting, based on a preset parameter prediction model, the first target filtering parameter for the video frame to be encoded includes: for any one of the at least two coding modes, based on the coding mode and the video frame to be coded, obtaining coding features corresponding to the coding mode, wherein the coding features are used for representing coding effects when the video frame to be coded is coded in the coding mode; And taking the coding features corresponding to the at least two coding modes as the input of the parameter prediction model, and obtaining the filtering parameters output by the parameter prediction model for the video frame to be coded to obtain the first target filtering parameters. Optionally, the selecting, based on the first target filtering parameter, a first target coding mode for a coding block in the video frame to be coded from at least two coding modes includes: Determining a target distortion cost value corresponding to each coding mode based on each coding mode and the first target filtering parameter for any coding block in the video frame to be coded, wherein the target distortion cost value is the distortion cost value of the coding block when the coding mode and the first target filtering parameter are used for processing the coding block; And selecting a coding mode with the target distortion cost value meeting a first preset requirement as a first target coding mode of the coding block based on the target distortion cost value corresponding to each coding mode. Optionally, the determining, based on each coding mode and the first target filtering parameter, a target distortion cost value corresponding to each coding mode includes: For any coding mode, coding the coding block based on the coding mode to obtain the coded coding block; filtering the coded coding block based on the first target filtering parameter to obtain a target coding block corresponding to the coding mode; determining a target coding block corresponding to the coding mode and a distortion cost value between the coding blocks to obtain the target distortion cost value corresponding to the coding mode; the obtaining the encoded block encoded and filtered using the first target encoding mode and the first target filtering parameter includes: And acquiring a target coding block of which the used coding mode is the first target coding mode and the used filtering parameter is the first target filtering parameter from target coding blocks corresponding to the coding modes. Optionally, the parameter prediction model is obtained by training in the following manner: For any coding mode, acquiring sample coding features corresponding to the coding mode based on the coding mode and sample video frames, wherein the sample coding features are used for representing coding effects when the sample video frames are coded in the coding mode; taking sample coding features c