Search

CN-121985126-A - Video encoding method, decoding method, electronic terminal and storage medium

CN121985126ACN 121985126 ACN121985126 ACN 121985126ACN-121985126-A

Abstract

The application provides a video coding method, a decoding method, an electronic terminal and a storage medium, wherein the video coding method provided by the application determines compression parameters corresponding to a current frame according to characteristic information of each target object in the current frame; the compression parameters corresponding to the current frame comprise compression grades corresponding to the current frame and/or grade parameters corresponding to the target object, code control parameters of the current frame are determined based on the compression parameters, and the current frame is encoded based on the code control parameters to obtain code stream data. The compression parameters of the image frames are mapped based on the characteristics of the target objects in the images, and the compression parameters are associated with the code control parameters, so that the subjective quality of the target objects in the images can be ensured, and the compression rate can be optimized.

Inventors

  • DUAN GUANGYAO
  • JIANG DONG
  • LI ZENG
  • LIN JUCAI
  • LI HONGHUI
  • YIN JUN

Assignees

  • 浙江大华技术股份有限公司

Dates

Publication Date
20260505
Application Date
20251212

Claims (14)

  1. 1. A video encoding method, comprising: Determining a compression parameter corresponding to a current frame according to the characteristic information of each target object in the current frame, wherein the compression parameter corresponding to the current frame comprises a compression grade corresponding to the current frame and/or a grade parameter corresponding to the target object; Determining a code control parameter of the current frame based on the compression parameter; And encoding the current frame based on the code control parameters to obtain code stream data.
  2. 2. The video coding method according to claim 1, wherein determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame comprises: And determining the compression grade corresponding to the current frame according to the preset quality grade and the grade parameter of each target object, thereby determining the compression parameter corresponding to the current frame.
  3. 3. The video coding method according to claim 2, wherein determining the compression level corresponding to the current frame according to a preset quality level and the level parameter of each target object comprises: determining the regional grade of the current frame according to the grade parameter of each target object, the picture duty ratio of each target object and the resolution of the current frame; determining a first complexity degree of the current frame according to the first time domain texture information of the current frame and the first space domain texture information of the current frame; And determining the compression grade corresponding to the current frame according to the first complexity of the current frame, the regional grade of the current frame and the preset quality grade.
  4. 4. The video encoding method according to claim 3, wherein determining the region level of the current frame based on the level parameter of each of the target objects, the picture duty ratio of each of the target objects, and the resolution of the current frame comprises: calculating the total picture occupation ratio of all target objects according to the grade parameter of each target object, the picture occupation ratio of each target object and the resolution of the current frame; determining the region level of the current frame according to the total picture occupation ratio of all target objects; Wherein the region level of the current frame is positively correlated with the total picture ratio.
  5. 5. The video coding method according to claim 1, wherein determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame comprises: Determining important parameters of the target object according to the attribute information of the target object; Determining a second complexity of the target object according to the second time domain texture information and the second space domain texture information of the target object; And determining a grade parameter corresponding to the target object according to the important parameter of the target object, the second complexity and the preset quality grade, so as to determine a compression parameter corresponding to the current frame.
  6. 6. The video coding method according to claim 1, wherein determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame comprises: Extracting the characteristics of the current frame to obtain an interested region corresponding to the current frame; And performing mask calculation on the region of interest to determine the grade parameter of the target object, thereby determining the compression parameter corresponding to the current frame.
  7. 7. The video coding method according to any one of claims 1 to 6, wherein determining the code control parameter of the current frame based on the compression parameter comprises: Determining at least one of global quantization parameter of the current frame, quantization parameter offset value of the target object, reference frame interval length, frame rate of the current frame based on compression level corresponding to the current frame in the compression parameters, thereby determining code control parameter of the current frame, and/or And determining at least one of a target quantization parameter of the target object, a quantization parameter offset value of the target object, a reference frame interval length and a frame rate of the current frame based on a grade parameter corresponding to the target object in the compression parameters, so as to determine a code control parameter of the current frame.
  8. 8. The video coding method of claim 7, wherein determining a quantization parameter offset value for the target object based on the compression parameter comprises: A quantization parameter offset value for the target object is determined based on a rank parameter of the target object in the compression parameters.
  9. 9. The video coding method according to claim 2, wherein before determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame, further comprising: Performing image enhancement on a foreground region of the current frame according to the preset quality level, and performing image filtering on a background region of the current frame; Wherein the intensity of the image enhancement is positively correlated with the preset quality level and the intensity of the image filtering is negatively correlated with the preset quality level.
  10. 10. The video coding method according to claim 2, wherein after coding the current frame based on the code control parameter, further comprising: And packaging the position information of the target object, the preset quality level and the code stream data to obtain encoded data.
  11. 11. A video decoding method, comprising: acquiring code stream data; acquiring code control parameters from the code stream data, and decoding the code stream data based on the code control parameters to obtain video data; The code control parameters are determined based on compression parameters, the compression parameters are determined according to characteristic information of each target object in the image frame, and the compression parameters comprise compression grades corresponding to the current frame and/or grade parameters corresponding to the target objects.
  12. 12. The video decoding method of claim 11, wherein acquiring the code stream data comprises: the encoded data is acquired and the data is encoded, Decompressing the coded data to obtain the code stream data, and acquiring the position information and the preset quality level of a target object corresponding to each image frame in video data corresponding to the code stream data; the video decoding method further includes: and carrying out image processing on the image frame based on the position information of each target object in the image frame and a preset quality level.
  13. 13. An electronic terminal comprising a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory, the processor being configured to execute program data to implement steps in the video encoding method of any one of claims 1 to 10 or steps in the video decoding method of any one of claims 11 to 12.
  14. 14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the video encoding method according to any of claims 1 to 10 or the steps of the video decoding method according to any of claims 11 to 12.

Description

Video encoding method, decoding method, electronic terminal and storage medium Technical Field The present application relates to the field of image technologies, and in particular, to a video encoding method, a video decoding method, an electronic terminal, and a storage medium. Background In recent years, with the development of video technology and media transmission technology, higher requirements are put on video quality, and in order to provide better video playing experience, an internet video platform has a tendency of increasing video code rate. Some existing video coding methods cannot simultaneously give consideration to target subjective quality and compression rate. Disclosure of Invention The application provides a video coding method, a decoding method, an electronic terminal and a storage medium. In order to solve the technical problems, the first technical scheme adopted by the application is to provide a video coding method, which comprises the following steps: Determining a compression parameter corresponding to the current frame according to the characteristic information of each target object in the current frame, wherein the compression parameter corresponding to the current frame comprises a compression grade corresponding to the current frame and/or a grade parameter corresponding to the target object; Determining a code control parameter of the current frame based on the compression parameter; And encoding the current frame based on the code control parameters to obtain code stream data. In an embodiment, determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame includes: and determining the compression grade corresponding to the current frame according to the preset quality grade and the grade parameter of each target object, thereby determining the compression parameter corresponding to the current frame. In an embodiment, determining the compression level corresponding to the current frame according to the preset quality level and the level parameter of each target object includes: Determining the regional grade of the current frame according to the grade parameter of each target object, the picture occupation ratio of each target object and the resolution of the current frame; determining a first complexity of the current frame according to the first time domain texture information of the current frame and the first space domain texture information of the current frame; and determining the compression grade corresponding to the current frame according to the first complexity of the current frame, the regional grade of the current frame and the preset quality grade. In one embodiment, determining the region level of the current frame according to the level parameter of each target object, the picture duty cycle of each target object, and the resolution of the current frame includes: calculating the total picture occupation ratio of all the target objects according to the grade parameter of each target object, the picture occupation ratio of each target object and the resolution of the current frame; Determining the area level of the current frame according to the total picture occupation ratio of all the target objects; wherein the region level of the current frame is positively correlated with the total picture occupancy. In an embodiment, determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame includes: Determining important parameters of the target object according to the attribute information of the target object; determining a second complexity of the target object according to the second time domain texture information and the second space domain texture information of the target object; And determining a grade parameter corresponding to the target object according to the important parameter, the second complexity and the preset quality grade of the target object, so as to determine a compression parameter corresponding to the current frame. In an embodiment, determining the compression parameter corresponding to the current frame according to the feature information of each target object in the current frame includes: Extracting features of the current frame to obtain an interested region corresponding to the current frame; and performing mask calculation on the region of interest to determine the grade parameter of the target object, thereby determining the compression parameter corresponding to the current frame. In one embodiment, determining the code control parameter of the current frame based on the compression parameter includes: Determining at least one of global quantization parameter of the current frame, quantization parameter offset value of the target object, reference frame interval length, frame rate of the current frame based on compression level corresponding to the c