Search

CN-116033146-B - Determination method and device of coding unit, storage medium and electronic equipment

CN116033146BCN 116033146 BCN116033146 BCN 116033146BCN-116033146-B

Abstract

The invention discloses a method and a device for determining a coding unit, a storage medium and electronic equipment. The method comprises the steps of obtaining a first coding unit to be coded currently in a video frame, carrying out feature processing on the first coding unit to obtain a first feature value of the first coding unit, searching a second feature value matched with the first feature value in a preset feature table, and determining a second coding unit corresponding to the second feature value as a prediction coding unit of the first coding unit. The invention solves the technical problem of low coding efficiency.

Inventors

  • ZHANG TAO

Assignees

  • 腾讯科技(深圳)有限公司

Dates

Publication Date
20260512
Application Date
20211026

Claims (20)

  1. 1. A method of determining a coding unit, comprising: Acquiring a first coding unit to be coded currently in a video frame, wherein the video frame comprises a plurality of coding units, and the first coding unit is the coding unit to be coded currently in the plurality of coding units; performing feature processing on the first coding unit to obtain a first feature value of the first coding unit; searching a second characteristic value matched with the first characteristic value in a preset characteristic table, wherein the characteristic value of part or all of the plurality of coding units is recorded in the preset characteristic table; Determining a second coding unit corresponding to the second characteristic value as a prediction coding unit of the first coding unit; The method further comprises the steps of obtaining a target quantization step S of the video frame in a plurality of preset quantization step S, obtaining a group of coding units in the plurality of coding units according to the target quantization step S, wherein the S-column pixels are arranged between adjacent coding units belonging to the same row in the group of coding units, the S-row pixels are arranged between adjacent coding units belonging to the same column in an interval mode, and the identification and the corresponding characteristic value of each coding unit in the group of coding units are recorded in the preset characteristic table.
  2. 2. The method of claim 1, wherein said obtaining a set of coding units from said plurality of coding units according to said target quantization step S comprises: When the target quantization step S of the video frame is 1, determining the plurality of coding units as the group of coding units, wherein 1 column of pixels are arranged between adjacent coding units belonging to the same row in the group of coding units, 1 row of pixels are arranged between adjacent coding units belonging to the same column in the group of coding units, and the group of coding units comprises all coding units in the plurality of coding units; And when the target quantization step S of the video frame is greater than 1, acquiring the group of coding units from the plurality of coding units at intervals of the target quantization step S, wherein the S columns of pixels are spaced between adjacent coding units belonging to the same row in the group of coding units, the S rows of pixels are spaced between adjacent coding units belonging to the same column, and the group of coding units comprises part of coding units in the plurality of coding units.
  3. 3. The method according to claim 1 or 2, characterized in that before said obtaining a set of coding units among said plurality of coding units according to said target quantization step S, the method further comprises: Obtaining a target quantization step size of the video frame in a preset plurality of quantization step sizes according to a first duty ratio of an inter-frame coding unit in the plurality of coding units, wherein the inter-frame coding unit is a coding unit which uses an inter-frame mode for coding, or, And acquiring a target quantization step length of the video frame in a preset plurality of quantization step lengths according to a second duty ratio of an intra-frame coding unit in the plurality of coding units, wherein the intra-frame coding unit is a coding unit which uses intra-frame mode for coding.
  4. 4. The method of claim 3, wherein the step of, Determining a first duty ratio of the inter-frame coding units in the plurality of coding units comprises obtaining a first number of the inter-frame coding units in the plurality of coding units and a second number of intra-frame coding units; determining a second duty cycle of the intra-coded units of the plurality of coded units includes obtaining a first number of the inter-coded units of the plurality of coded units and a second number of intra-coded units, determining a sum of the first number and the second number as a target sum, and determining a ratio of the second number to the target sum as the second duty cycle.
  5. 5. The method of claim 3, wherein obtaining the target quantization step S of the video frame in a preset plurality of quantization steps according to the first duty cycle of the inter-coding unit of the plurality of coding units comprises: Determining that the target quantization step S is 1 when the first duty ratio is smaller than or equal to a first threshold value; Determining the target quantization step S as a first value under the condition that the first duty ratio is larger than the first threshold value and smaller than or equal to a second threshold value; determining the target quantization step S as a second value under the condition that the first duty ratio is larger than the second threshold value and smaller than or equal to a third threshold value; determining the target quantization step S to be a third value under the condition that the first duty ratio is larger than the third threshold value; the preset quantization step sizes comprise the 1, the first numerical value, the second numerical value and the third numerical value, wherein the first numerical value is larger than 1, the second numerical value is larger than the first numerical value, and the third numerical value is larger than the second numerical value.
  6. 6. The method of claim 3, wherein obtaining the target quantization step size of the video frame in a preset plurality of quantization step sizes according to the second duty cycle of the intra-coding unit of the plurality of coding units, comprises: Determining that the target quantization step S is 1 when the second duty ratio is greater than or equal to a fourth threshold; determining that the target quantization step S is a fourth value when the second duty ratio is smaller than the fourth threshold and greater than or equal to a fifth threshold; Determining that the target quantization step S is a fifth value when the second duty ratio is smaller than the fifth threshold and greater than or equal to a sixth threshold; determining that the target quantization step size S is a sixth value if the second duty ratio is smaller than the sixth threshold; The preset quantization step sizes include the 1, the fourth numerical value, the fifth numerical value and the sixth numerical value, wherein the fourth numerical value is greater than 1, the fifth numerical value is greater than the fourth numerical value, and the sixth numerical value is greater than the fifth numerical value.
  7. 7. The method of claim 1, wherein performing feature processing on the first coding unit to obtain a first feature value of the first coding unit comprises: Dividing the first coding unit into a plurality of sub-coding units; The first characteristic value of the first coding unit is determined by means of the mean value and the gradient value of the pixels in the plurality of sub-coding units.
  8. 8. The method of claim 7, wherein said determining the first characteristic value of the first coding unit from the mean and gradient values of the pixels in the plurality of sub-coding units comprises: acquiring the average value of pixels in each sub-coding unit in the plurality of sub-coding units to obtain a group of average values; Acquiring gradients of pixels in each sub-coding unit in the plurality of sub-coding units to obtain a group of gradient values; the first characteristic value of the first coding unit is determined from the set of mean values and the set of gradient values.
  9. 9. The method of claim 8, wherein the determining the first characteristic value of the first coding unit from the set of mean values and the set of gradient values comprises: Acquiring a value of a first preset bit on each mean value of the group of mean values, and combining the acquired values to obtain a first digital sequence; acquiring a numerical value of a second preset bit on the average value of the group of gradient values, and combining the acquired numerical values to obtain a second digital sequence; Determining a combination of the first digital sequence and the second digital sequence as the first characteristic value.
  10. 10. A determination apparatus of an encoding unit, characterized by comprising: The device comprises an acquisition module, a first coding module and a second coding module, wherein the acquisition module is used for acquiring a first coding unit to be coded currently in a video frame, the video frame comprises a plurality of coding units, and the first coding unit is the coding unit to be coded currently in the plurality of coding units; the processing module is used for carrying out characteristic processing on the first coding unit to obtain a first characteristic value of the first coding unit; The searching module is used for searching a second characteristic value matched with the first characteristic value in a preset characteristic table, wherein the characteristic value of part or all of the plurality of coding units is recorded in the preset characteristic table; The determining module is used for determining that the second coding unit corresponding to the second characteristic value is a predictive coding unit of the first coding unit; The device is further used for acquiring a target quantization step S of the video frame in a plurality of preset quantization step S, acquiring a group of coding units in the plurality of coding units according to the target quantization step S, wherein the S-column pixels are spaced between adjacent coding units belonging to the same row in the group of coding units, the S-row pixels are spaced between adjacent coding units belonging to the same column, and the identification and the corresponding characteristic value of each coding unit in the group of coding units are recorded in the preset characteristic table.
  11. 11. The apparatus of claim 10, wherein the apparatus is configured to obtain a set of coding units from the plurality of coding units according to the target quantization step S by: When the target quantization step S of the video frame is 1, determining the plurality of coding units as the group of coding units, wherein 1 column of pixels are arranged between adjacent coding units belonging to the same row in the group of coding units, 1 row of pixels are arranged between adjacent coding units belonging to the same column in the group of coding units, and the group of coding units comprises all coding units in the plurality of coding units; And when the target quantization step S of the video frame is greater than 1, acquiring the group of coding units from the plurality of coding units at intervals of the target quantization step S, wherein the S columns of pixels are spaced between adjacent coding units belonging to the same row in the group of coding units, the S rows of pixels are spaced between adjacent coding units belonging to the same column, and the group of coding units comprises part of coding units in the plurality of coding units.
  12. 12. The apparatus according to claim 10 or 11, characterized in that, before said obtaining a set of coding units among said plurality of coding units according to said target quantization step S, said apparatus is further adapted to: Obtaining a target quantization step size of the video frame in a preset plurality of quantization step sizes according to a first duty ratio of an inter-frame coding unit in the plurality of coding units, wherein the inter-frame coding unit is a coding unit which uses an inter-frame mode for coding, or, And acquiring a target quantization step length of the video frame in a preset plurality of quantization step lengths according to a second duty ratio of an intra-frame coding unit in the plurality of coding units, wherein the intra-frame coding unit is a coding unit which uses intra-frame mode for coding.
  13. 13. The apparatus of claim 12, wherein the device comprises a plurality of sensors, The device is used for determining a first duty ratio of the inter-frame coding units in the plurality of coding units by acquiring a first number of the inter-frame coding units in the plurality of coding units and a second number of the intra-frame coding units; The apparatus is configured to determine a second duty cycle of the intra-coded units of the plurality of coded units by obtaining a first number of the inter-coded units of the plurality of coded units and a second number of intra-coded units, determining a sum of the first number and the second number as a target sum, and determining a ratio of the second number to the target sum as the second duty cycle.
  14. 14. The apparatus of claim 12, wherein the apparatus is configured to obtain the target quantization step S for the video frame in a preset plurality of quantization steps according to a first duty cycle of an inter-coding unit of the plurality of coding units by: Determining that the target quantization step S is 1 when the first duty ratio is smaller than or equal to a first threshold value; Determining the target quantization step S as a first value under the condition that the first duty ratio is larger than the first threshold value and smaller than or equal to a second threshold value; determining the target quantization step S as a second value under the condition that the first duty ratio is larger than the second threshold value and smaller than or equal to a third threshold value; determining the target quantization step S to be a third value under the condition that the first duty ratio is larger than the third threshold value; the preset quantization step sizes comprise the 1, the first numerical value, the second numerical value and the third numerical value, wherein the first numerical value is larger than 1, the second numerical value is larger than the first numerical value, and the third numerical value is larger than the second numerical value.
  15. 15. The apparatus of claim 12, wherein the apparatus is configured to obtain the target quantization step size for the video frame in a preset plurality of quantization step sizes according to a second duty cycle of an intra-coding unit of the plurality of coding units by: Determining that the target quantization step S is 1 when the second duty ratio is greater than or equal to a fourth threshold; determining that the target quantization step S is a fourth value when the second duty ratio is smaller than the fourth threshold and greater than or equal to a fifth threshold; Determining that the target quantization step S is a fifth value when the second duty ratio is smaller than the fifth threshold and greater than or equal to a sixth threshold; determining that the target quantization step size S is a sixth value if the second duty ratio is smaller than the sixth threshold; The preset quantization step sizes include the 1, the fourth numerical value, the fifth numerical value and the sixth numerical value, wherein the fourth numerical value is greater than 1, the fifth numerical value is greater than the fourth numerical value, and the sixth numerical value is greater than the fifth numerical value.
  16. 16. The apparatus of claim 10, wherein the apparatus is configured to perform feature processing on the first coding unit to obtain a first feature value of the first coding unit by: Dividing the first coding unit into a plurality of sub-coding units; The first characteristic value of the first coding unit is determined by means of the mean value and the gradient value of the pixels in the plurality of sub-coding units.
  17. 17. The apparatus of claim 16, wherein the apparatus is configured to determine the first characteristic value of the first coding unit by means of a mean value and a gradient value of pixels in the plurality of sub-coding units by: acquiring the average value of pixels in each sub-coding unit in the plurality of sub-coding units to obtain a group of average values; Acquiring gradients of pixels in each sub-coding unit in the plurality of sub-coding units to obtain a group of gradient values; the first characteristic value of the first coding unit is determined from the set of mean values and the set of gradient values.
  18. 18. The apparatus of claim 17, wherein the apparatus is configured to determine the first characteristic value of the first coding unit by the set of means and the set of gradient values by: Acquiring a value of a first preset bit on each mean value of the group of mean values, and combining the acquired values to obtain a first digital sequence; acquiring a numerical value of a second preset bit on the average value of the group of gradient values, and combining the acquired numerical values to obtain a second digital sequence; Determining a combination of the first digital sequence and the second digital sequence as the first characteristic value.
  19. 19. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run by a processor performs the method of any one of claims 1 to 9.
  20. 20. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 9.

Description

Determination method and device of coding unit, storage medium and electronic equipment Technical Field The present invention relates to the field of computers, and in particular, to a method and apparatus for determining an encoding unit, a storage medium, and an electronic device. Background An Intra Block Copy (IBC) is a common encoding method in video encoding, for example, an IBC method is used to encode a screen video, and the screen video includes, but is not limited to, video call, video conference, online live broadcast, remote desktop, etc. The IBC method divides a video frame into a plurality of coding units, and encodes each coding unit separately. When coding a current coding unit to be coded (abbreviated as a current coding unit to be coded), searching a coding unit which is most similar to the current coding unit to be coded in a coded region of a video frame, taking the searched coding unit as a preset coding unit of the current coding unit to be coded, and coding the current coding unit through the prediction coding unit. However, a large number of matching of coding units is required in the searching process, which results in a large workload and high complexity, and thus low coding efficiency. In view of the above problems, no effective solution has been proposed at present. Disclosure of Invention The embodiment of the invention provides a method and a device for determining a coding unit, a storage medium and electronic equipment, which are used for at least solving the technical problem of low coding efficiency. According to one aspect of the embodiment of the invention, a method for determining a coding unit is provided, which comprises the steps of obtaining a first coding unit to be coded currently in a video frame, wherein the video frame comprises a plurality of coding units, the first coding unit is the coding unit to be coded currently in the plurality of coding units, performing feature processing on the first coding unit to obtain a first feature value of the first coding unit, searching a second feature value matched with the first feature value in a preset feature table, wherein the feature value of part or all of the coding units in the plurality of coding units is recorded in the preset feature table, and determining the second coding unit corresponding to the second feature value as a predictive coding unit of the first coding unit. Optionally, before searching the second characteristic value matched with the first characteristic value in the preset characteristic table, the method further comprises obtaining a group of coding units from the plurality of coding units according to a target quantization step S of the video frame, wherein the S columns of pixels are spaced between adjacent coding units belonging to the same row in the group of coding units, the S rows of pixels are spaced between adjacent coding units belonging to the same column, and the identification of each coding unit in the group of coding units and the corresponding characteristic value are recorded in the preset characteristic table. Optionally, the method comprises the steps of acquiring a group of coding units in the plurality of coding units according to a target quantization step S of the video frame, wherein the method comprises the steps of determining that the plurality of coding units are the group of coding units when the target quantization step S of the video frame is 1, wherein adjacent coding units belonging to the same row in the group of coding units are separated by 1 column of pixels, adjacent coding units belonging to the same column are separated by 1 row of pixels, the group of coding units comprises all coding units in the plurality of coding units, and acquiring the group of coding units in the plurality of coding units every the target quantization step S of the video frame is greater than 1, wherein adjacent coding units belonging to the same row in the group of coding units are separated by the S column of pixels, adjacent coding units belonging to the same column are separated by the S row of pixels, and the group of coding units comprises part of coding units in the plurality of coding units. Optionally, before acquiring a group of coding units in the plurality of coding units according to the target quantization step S of the video frame, the method further comprises acquiring the target quantization step of the video frame in a preset plurality of quantization steps according to a first duty ratio of inter-coding units in the plurality of coding units, wherein the inter-coding units are coding units using an inter-frame mode, or acquiring the target quantization step of the video frame in a preset plurality of quantization steps according to a second duty ratio of intra-coding units in the plurality of coding units, wherein the intra-coding units are coding units using an intra-frame mode. Optionally, determining a first duty cycle of the inter-coding units in the plurali