Coding unit determination method and apparatus, storage medium, and electronic device
By performing feature processing on the coding units in the video frame and searching for matching feature values in a preset feature table, the problem of high coding unit matching complexity in intra-frame block matching methods is solved, thus improving coding efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-10-26
- Publication Date
- 2026-05-12
AI Technical Summary
Intra-frame block matching methods have high complexity in the coding unit matching process during video coding, resulting in low coding efficiency.
By performing feature processing on the coding units in the video frame, feature values are generated, and matching feature values are searched in a preset feature table to determine the predictive coding unit.
This reduces the complexity of coding unit prediction and improves coding efficiency.
Smart Images

Figure CN116033146B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method and apparatus for determining encoding units, a storage medium, and an electronic device. Background Technology
[0002] Intra-block copy (IBC) is a common encoding method in video coding. For example, screen video can be encoded using IBC, including but not limited to video calls, video conferencing, live streaming, and remote desktop.
[0003] The IBC method divides a video frame into multiple coding units and encodes each unit separately. When encoding the current coding unit (hereinafter referred to as the current unit to be encoded), it is necessary to search for the most similar coding unit in the already encoded region of the video frame. The searched coding unit is used as the preset coding unit for the current unit, and encoding is performed using this predicted coding unit. However, the search process requires matching a large number of coding units, which is labor-intensive and complex, resulting in low encoding efficiency.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] The present invention provides a method and apparatus for determining encoding units, a storage medium and an electronic device, to at least solve the technical problem of low encoding efficiency.
[0006] According to one aspect of the present invention, a method for determining an encoding unit is provided, comprising: acquiring a first encoding unit currently to be encoded in a video frame, wherein the video frame includes a plurality of encoding units, and the first encoding unit is the encoding unit currently to be encoded among the plurality of encoding units; performing feature processing on the first encoding unit to obtain a first feature value of the first encoding unit; searching for a second feature value matching the first feature value in a preset feature table, wherein the preset feature table records feature values of some or all of the plurality of encoding units; and determining a second encoding unit corresponding to the second feature value as a predicted encoding unit of the first encoding unit.
[0007] Optionally, before searching for a second feature value that matches the first feature value in a preset feature table, the method further includes: obtaining a set of coding units from the plurality of coding units according to the target quantization step size S of the video frame, wherein adjacent coding units belonging to the same row in the set of coding units are separated by the S columns of pixels, and adjacent coding units belonging to the same column are separated by the S rows of pixels; and recording the identifier and corresponding feature value of each coding unit in the set of coding units in the preset feature table.
[0008] Optionally, obtaining a group of coding units from the plurality of coding units according to the target quantization step size S of the video frame includes: when the target quantization step size S of the video frame is 1, determining the plurality of coding units as the group of coding units, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by 1 column pixel, and adjacent coding units belonging to the same column are spaced apart by 1 row pixel, and the group of coding units includes all coding units in the plurality of coding units; when the target quantization step size S of the video frame is greater than 1, obtaining the group of coding units from the plurality of coding units every target quantization step size S, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by S column pixels, and adjacent coding units belonging to the same column are spaced apart by S row pixels, and the group of coding units includes some coding units in the plurality of coding units.
[0009] Optionally, before obtaining a set of coding units from the plurality of coding units according to the target quantization step size S of the video frame, the method further includes: obtaining the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a first proportion of inter-frame coding units among the plurality of coding units, wherein the inter-frame coding units are coding units encoded using inter-frame modes; or, obtaining the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a second proportion of intra-frame coding units among the plurality of coding units, wherein the intra-frame coding units are coding units encoded using intra-frame modes.
[0010] Optionally, determining the first proportion of inter-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum, and the ratio of the first number to the target sum as the first proportion; determining the second proportion of intra-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum; and determining the ratio of the second number to the target sum as the second proportion.
[0011] Optionally, obtaining the target quantization step size S of the video frame from a preset plurality of quantization step sizes based on a first proportion of inter-frame coding units among the plurality of coding units includes: determining the target quantization step size S as 1 when the first proportion is less than or equal to a first threshold; determining the target quantization step size S as a first value when the first proportion is greater than the first threshold and less than or equal to a second threshold; determining the target quantization step size S as a second value when the first proportion is greater than the second threshold and less than or equal to a third threshold; and determining the target quantization step size S as a third value when the first proportion is greater than the third threshold. Wherein, the preset plurality of quantization step sizes include 1, the first value, the second value, and the third value, wherein the first value is greater than 1, the second value is greater than the first value, and the third value is greater than the second value.
[0012] Optionally, the target quantization step size of the video frame is obtained from a preset plurality of quantization step sizes based on the second proportion of intra-coding units among the plurality of coding units, including: determining the target quantization step size S as 1 when the second proportion is greater than or equal to a fourth threshold; determining the target quantization step size S as a fourth value when the second proportion is less than the fourth threshold but greater than or equal to a fifth threshold; determining the target quantization step size S as a fifth value when the second proportion is less than the fifth threshold but greater than or equal to a sixth threshold; and determining the target quantization step size S as a sixth value when the second proportion is less than the sixth threshold; wherein the preset plurality of quantization step sizes include 1, the fourth value, the fifth value, and the sixth value, the fourth value being greater than 1, the fifth value being greater than the fourth value, and the sixth value being greater than the fifth value.
[0013] Optionally, feature processing is performed on the first coding unit to obtain a first feature value of the first coding unit, including: dividing the first coding unit into multiple sub-coding units; and determining the first feature value of the first coding unit by the mean and gradient values of the pixels in the multiple sub-coding units.
[0014] Optionally, determining the first feature value of the first coding unit by means and gradient values of pixels in the plurality of coding sub-units includes: obtaining the mean value of pixels in each sub-coding unit among the plurality of coding sub-units to obtain a set of mean values; obtaining the gradient of pixels in each sub-coding unit among the plurality of coding sub-units to obtain a set of gradient values; and determining the first feature value of the first coding unit by means of the set of mean values and the set of gradient values.
[0015] Optionally, determining the first feature value of the first encoding unit using the set of averages and the set of gradient values includes: obtaining the value of a first preset bit at each average of the set of averages, and combining the obtained values to obtain a first number sequence; obtaining the value of a second preset bit at the average of the set of gradient values, and combining the obtained values to obtain a second number sequence; and determining the combination of the first number sequence and the second number sequence as the first feature value.
[0016] According to another aspect of the present invention, an apparatus for determining an encoding unit is also provided, comprising: an acquisition module, configured to acquire a first encoding unit currently to be encoded in a video frame, wherein the video frame includes a plurality of encoding units, and the first encoding unit is the encoding unit currently to be encoded among the plurality of encoding units; a processing module, configured to perform feature processing on the first encoding unit to obtain a first feature value of the first encoding unit; a search module, configured to search for a second feature value matching the first feature value in a preset feature table, wherein the preset feature table records feature values of some or all of the plurality of encoding units; and a determination module, configured to determine that a second encoding unit corresponding to the second feature value is a predicted encoding unit of the first encoding unit.
[0017] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method for determining the above-described coded unit at runtime.
[0018] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the method for determining the encoded unit as described above.
[0019] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for determining the encoding unit through the computer program.
[0020] In this embodiment of the invention, a preset feature table records the feature values of all or some of the coding units in multiple coding units of a video frame. The predicted coding unit of the current coding unit can be found using the first feature value of the current coding unit and the preset feature table. This improves the efficiency of the predicted coding unit of the current coding unit, thereby solving the technical problem of low coding efficiency. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0022] Figure 1 This is a schematic diagram of an application environment for an optional method for determining an encoding unit according to an embodiment of the present invention;
[0023] Figure 2 This is a flowchart of an optional method for determining an encoding unit according to an embodiment of the present invention;
[0024] Figure 3 This is a schematic diagram of an optional video frame being divided into multiple coding units according to an embodiment of the present invention;
[0025] Figure 4 This is a schematic diagram of an optional preset feature table according to an embodiment of the present invention;
[0026] Figure 5 This is a schematic diagram of another optional preset feature table according to an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram of an optional sub-coding unit according to an embodiment of the present invention;
[0028] Figure 7 This is a schematic diagram of the structure of an optional encoding unit determination device according to an embodiment of the present invention;
[0029] Figure 8 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention;
[0030] Figure 9 This is a computer system architecture block diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0033] According to one aspect of the present invention, a method for determining an encoding unit is provided. Optionally, as an optional implementation, the method for determining the encoding unit may be applied to, but is not limited to, [examples of other methods]. Figure 1 The application environment shown includes user equipment 102, network 110, and server 112. User equipment 102 includes a memory 104, a processor 106, and a display 108. The memory stores data, including but not limited to the video frames. The processor processes the video, including but not limited to dividing the video frames into multiple encoding units and performing feature processing on the encoding units. The display shows the video frames.
[0034] Optionally, in this embodiment, the user equipment can be a terminal device configured with a target client, which may include, but is not limited to, at least one of the following: mobile phone (such as Android phone, iOS phone, etc.), laptop computer, tablet computer, PDA, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client may be a video client, instant messaging client, browser client, live streaming client, etc.
[0035] The aforementioned network 110 may include, but is not limited to, wired networks and wireless networks. The wired network includes local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). The wireless network includes Bluetooth, Wi-Fi, and other networks that enable wireless communication.
[0036] The server 112 includes a database 114 and a processing engine. The database is used to store data, including but not limited to video frames. The processor can be used to process the following method steps:
[0037] Step S11: Obtain the first coding unit to be encoded in the video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units.
[0038] Step S12: Perform feature processing on the first coding unit to obtain the first feature value of the first coding unit;
[0039] Step S13: Search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units;
[0040] Step S14: Determine that the second coding unit corresponding to the second feature value is the prediction coding unit of the first coding unit.
[0041] The server mentioned above can be a single server, a server cluster consisting of multiple servers, or a cloud server. The above is merely an example, and this embodiment does not impose any limitations on it.
[0042] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the method for determining the above-mentioned coding unit includes:
[0043] Step S202: Obtain the first coding unit to be encoded in the video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units.
[0044] The aforementioned video frames include, but are not limited to, a single frame from a screen video, which includes, but is not limited to, video conferencing, live streaming, and remote desktop. The acquired video frames can be divided into multiple coding units, the size of which can be determined according to the actual situation, such as 4×4, 8×8, or 16×16. Taking an 8×8 coding block as an example, it can be divided as follows... Figure 3The partitioning method shown divides the video frame into multiple coding units. As shown in the diagram, circles represent pixels, and 8×8 represents a coding block consisting of 8×8 pixels. Starting from the first row and first column of the video frame, each coding unit consists of 8×8 pixels. Block 10 and Block 11 shown in the diagram are two adjacent coding units; Block 10 is shifted one column of pixels to the right to obtain Block 11. After obtaining the coding unit Block 1N shown in the diagram, starting from the second row and first column, the video frame is divided into multiple coding units sequentially, each with a size of 8×8 pixels. Adjacent coding units within the same row differ by one column of pixels, as shown in Block 10 and Block 11; adjacent coding units within the same column differ by one row of pixels, as shown in Block 10 and Block 21. Each coding unit is encoded sequentially; the current coding unit is the first coding unit described above.
[0045] Step S204: Perform feature processing on the first coding unit to obtain the first feature value of the first coding unit;
[0046] The aforementioned feature processing includes, but is not limited to, mean processing and gradient processing, which are performed on the pixels in the first coding unit.
[0047] Step S206: Search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units;
[0048] In this process, feature processing can be used to obtain the feature values corresponding to each coding unit for all or part of multiple coding units. A preset feature table records the identifiers of the coding units and the correspondence between the feature values. For example... Figure 4 The coding unit Block10 shown in the figure has a feature value of hashIdx1 recorded in the preset feature table shown in the figure. The second feature value that matches the first feature value includes, but is not limited to: the second feature value is equal to the first feature value, or the difference between the second feature value and the first feature value is less than a preset value. The preset value can be determined according to the actual situation, such as 1, 2, 4, etc.
[0049] Step S208: Determine that the second coding unit corresponding to the second feature value is the prediction coding unit of the first coding unit.
[0050] Among them, such as Figure 4The diagram shows that a second feature value matching the first feature value is searched in a preset feature table, and the coding unit corresponding to the second feature value is determined to be the prediction coding unit of the first coding unit to be encoded. Assuming that the first feature value is hashIdx2, the coding unit corresponding to hashIdx2 can be determined to be Block20 by searching the preset feature table. Block20 is the prediction coding unit of the first coding unit, and the first coding unit is encoded by the prediction coding unit Block20.
[0051] Optionally, before searching for a second feature value that matches the first feature value in a preset feature table, the method further includes: obtaining a set of coding units from the plurality of coding units according to the target quantization step size S of the video frame, wherein adjacent coding units belonging to the same row in the set of coding units are separated by the S columns of pixels, and adjacent coding units belonging to the same column are separated by the S rows of pixels; and recording the identifier and corresponding feature value of each coding unit in the set of coding units in the preset feature table.
[0052] As an optional implementation, the quantization step size mentioned above refers to the number of columns and rows of pixels between which the feature values of the coding unit are calculated, and the calculated feature values are recorded in a preset feature table. The quantization step size can be arbitrarily set, for example, it can be 1, 2, 4, 8, etc. Taking a target quantization step size S = 4 as an example, ... Figure 5 As shown in the figure, a set of coding units includes Block 10, Block 11, Block 12, Block 20, etc. Only a portion of the coding units in this set are shown. Block 10, Block 11, and Block 12 belong to the same row. As shown in the figure, Block 10 and Block 11 differ by S = 4 columns of pixels, and Block 10 and Block 20 belong to the same column, differing by S = 4 rows of pixels. In this embodiment, the complexity of constructing the preset feature table can be reduced by adjusting the quantization step size, thus accelerating the construction of the preset feature table.
[0053] Optionally, obtaining a group of coding units from the plurality of coding units according to the target quantization step size S of the video frame includes: when the target quantization step size S of the video frame is 1, determining the plurality of coding units as the group of coding units, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by 1 column pixel, and adjacent coding units belonging to the same column are spaced apart by 1 row pixel, and the group of coding units includes all coding units in the plurality of coding units; when the target quantization step size S of the video frame is greater than 1, obtaining the group of coding units from the plurality of coding units every target quantization step size S, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by S column pixels, and adjacent coding units belonging to the same column are spaced apart by S row pixels, and the group of coding units includes some coding units in the plurality of coding units.
[0054] As an optional implementation, in the method of dividing the video frame into multiple coding units as described above, coding units belonging to the same row are separated by one column of pixels, and coding units belonging to the same column are separated by one row of pixels. For example, coding units Block 10 and Block 11 are separated by one column of pixels, and Block 10 and Block 21 are separated by one row of pixels. Therefore, when the target quantization step size S is 1, the multiple coding units constitute the above-mentioned group of coding units. In this case, the preset feature table records the feature value of each coding unit in the multiple coding units of the video frame.
[0055] When the target quantization step size is greater than 1, for example, in the above embodiment where the target quantization step size S = 4, Figure 5 As shown in the figure, a set of coding units includes Block 10, Block 11, Block 12, Block 20, etc. Only a portion of the coding units in this set are shown. Block 10, Block 11, and Block 12 belong to the same row. As shown in the figure, Block 10 and Block 11 differ by S = 4 columns of pixels, and Block 10 and Block 20 belong to the same column, differing by S = 4 rows of pixels. In this embodiment, the complexity of constructing the preset feature table can be reduced by adjusting the quantization step size, thus accelerating the construction of the preset feature table.
[0056] Optionally, before obtaining a set of coding units from the plurality of coding units according to the target quantization step size S of the video frame, the method further includes: obtaining the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a first proportion of inter-frame coding units among the plurality of coding units, wherein the inter-frame coding units are coding units encoded using inter-frame modes; or, obtaining the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a second proportion of intra-frame coding units among the plurality of coding units, wherein the intra-frame coding units are coding units encoded using intra-frame modes.
[0057] As an optional implementation, some coding units in a video frame employ intra-frame coding mode, using intra-frame information for encoding, while others employ inter-frame coding mode, using information from between video frames for encoding. In this embodiment, the coding units using intra-frame mode are called intra-frame coding units, and the coding units using inter-frame mode are called inter-frame coding units.
[0058] The distribution of intra-frame and inter-frame coding units within multiple coding units improves the accuracy of the quantization step size. This distribution includes, but is not limited to, a first proportion of inter-frame coding units or a second proportion. Specifically, the first proportion T1 and the second proportion T2 can be calculated using the following formulas:
[0059]
[0060]
[0061] Wherein, intraModeNum represents the number of intra-coding units in multiple coding units, and interModeNum represents the number of inter-coding units in multiple coding units.
[0062] The preset quantization step sizes mentioned above include, but are not limited to, 8, 4, 2, and 1. The preset quantization step sizes can be determined according to actual circumstances. The numbers 8, 4, 2, and 1 mentioned above are only for illustrative purposes and can also be 1, 3, 5, 7, or 2, 5, 6, 8, etc. The target quantization step size can be determined from among the preset quantization step sizes based on the first proportion T1 or the second proportion T2 mentioned above.
[0063] Optionally, determining the first proportion of inter-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum, and the ratio of the first number to the target sum as the first proportion; determining the second proportion of intra-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum; and determining the ratio of the second number to the target sum as the second proportion.
[0064] As an optional implementation, the first quantity is the number of coding units using inter-frame coding mode among the multiple coding units, such as interModeNum in the above embodiment. The second quantity is the number of coding units using intra-frame coding mode among the multiple coding units, such as intraModeNum in the above embodiment. The target sum is the sum of the first quantity and the second quantity, such as interModeNum + intraModeNum in the above embodiment.
[0065] Optionally, obtaining the target quantization step size S of the video frame from a preset plurality of quantization step sizes based on a first proportion of inter-frame coding units among the plurality of coding units includes: determining the target quantization step size S as 1 when the first proportion is less than or equal to a first threshold; determining the target quantization step size S as a first value when the first proportion is greater than the first threshold and less than or equal to a second threshold; determining the target quantization step size S as a second value when the first proportion is greater than the second threshold and less than or equal to a third threshold; and determining the target quantization step size S as a third value when the first proportion is greater than the third threshold. Wherein, the preset plurality of quantization step sizes include 1, the first value, the second value, and the third value, wherein the first value is greater than 1, the second value is greater than the first value, and the third value is greater than the second value.
[0066] As an optional implementation, the first threshold, second threshold, and third threshold can be determined according to actual conditions. Assuming the first threshold is 80%, the second threshold is 90%, and the third threshold is 95%, the preset quantization step sizes include 1, 2, 4, and 8. The first value is 2, the second value is 4, and the third value is 8.
[0067] If T1 ≤ 80%, then the target quantization step size S = 1; if 80% < T1 ≤ 90%, then the target quantization step size S = 2; if 90% < T1 ≤ 95%, then the target quantization step size S = 4; if T1 > 95%, then the target quantization step size S = 8.
[0068] Optionally, the target quantization step size of the video frame is obtained from a preset plurality of quantization step sizes based on the second proportion of intra-coding units among the plurality of coding units, including: determining the target quantization step size S as 1 when the second proportion is greater than or equal to a fourth threshold; determining the target quantization step size S as a fourth value when the second proportion is less than the fourth threshold but greater than or equal to a fifth threshold; determining the target quantization step size S as a fifth value when the second proportion is less than the fifth threshold but greater than or equal to a sixth threshold; and determining the target quantization step size S as a sixth value when the second proportion is less than the sixth threshold; wherein the preset plurality of quantization step sizes include 1, the fourth value, the fifth value, and the sixth value, the fourth value being greater than 1, the fifth value being greater than the fourth value, and the sixth value being greater than the fifth value.
[0069] As an optional implementation, the fourth, fifth, and sixth thresholds can be determined according to actual circumstances. Assuming the fourth threshold is 20%, the fifth threshold is 10%, and the sixth threshold is 5%, the preset quantization step sizes include 1, 2, 4, and 8. In this case, the fourth value is 2, the fifth value is 4, and the sixth value is 8.
[0070] If T≥20%, then the target quantization step size S=1; if 10%≤T1<20%, then the target quantization step size S=2; if 5%≤T1<10%, then the target quantization step size S=4; if T1<5%, then the target quantization step size S=8.
[0071] Optionally, feature processing is performed on the first coding unit to obtain a first feature value of the first coding unit, including: dividing the first coding unit into multiple sub-coding units; and determining the first feature value of the first coding unit by the mean and gradient values of the pixels in the multiple sub-coding units.
[0072] As an optional implementation, the number of the aforementioned sub-encoding units can be determined according to the actual situation, for example, it can be 2, 4, 6, etc. In this embodiment, dividing the first encoding unit into 4 sub-encoding units is taken as an example. Figure 6 The Block21 shown is the first encoding unit to be encoded. Block21 is divided into four sub-encoding units A, B, C, and D. The first feature value of Block21 can be obtained by performing mean and gradient processing on the pixels in each sub-encoding unit.
[0073] Optionally, determining the first feature value of the first coding unit by means and gradient values of pixels in the plurality of coding sub-units includes: obtaining the mean value of pixels in each sub-coding unit among the plurality of coding sub-units to obtain a set of mean values; obtaining the gradient of pixels in each sub-coding unit among the plurality of coding sub-units to obtain a set of gradient values; and determining the first feature value of the first coding unit by means of the set of mean values and the set of gradient values.
[0074] As an optional implementation, the above... Figure 6 Taking sub-coding units A, B, C, and D as examples, the pixels of each sub-coding unit are averaged to obtain a set of averages, which includes the averages of sub-coding units A, B, C, and D.
[0075] As an optional implementation, the average gradient value grad (the average of the horizontal and vertical gradients) of each sub-coding unit is calculated, as described above. Figure 6 Taking sub-coding units A, B, C, and D as examples, gradient processing is performed on the pixels of each sub-coding unit to obtain a set of gradients. This set of gradient values includes the average gradient value (grad) of each sub-coding unit (A, B, C, and D). The first feature value of the first coding unit is obtained through this set of gradient values and the average value.
[0076] Optionally, determining the first feature value of the first encoding unit using the set of averages and the set of gradient values includes: obtaining the value of a first preset bit at each average of the set of averages, and combining the obtained values to obtain a first number sequence; obtaining the value of a second preset bit at the average of the set of gradient values, and combining the obtained values to obtain a second number sequence; and determining the combination of the first number sequence and the second number sequence as the first feature value.
[0077] As an optional implementation, the first preset bit and the second preset bit can be determined according to the actual situation, for example, they can be 3, 4, 5, 6, etc. Taking the first preset bit as 3 bits and the second preset bit as 4 bits as an example. Three bits can be selected from the mean value corresponding to each sub-coding unit. Assuming that in the above embodiment, the mean value of sub-coding unit A is 01100001, the mean value of sub-coding unit B is 11000101, the mean value of sub-coding unit C is 00001110, and the mean value of sub-coding unit D is 00010100, the first three bits of each sub-coding unit are selected as 011, 110, 000, and 000 respectively, and combined to obtain a 12-bit first digital sequence 011110000000. The average value of the gradient values of the above four sub-coding units A, B, C, and D is calculated to obtain the average grad value. Assuming that the average value of the gradient values of the above sub-coding units A, B, C, and D is 01010000, the first four bits are taken to obtain a second digital sequence 0101. The first digital sequence and the second digital sequence are combined to obtain a 16-bit first feature value 0111100000000101.
[0078] In this application, a matching coding unit is searched in a preset feature library using the feature values of the coding unit to be encoded, and used as the predicted coding unit. This reduces the complexity of searching for the predicted coding unit and improves encoding efficiency.
[0079] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0080] According to another aspect of the present invention, an apparatus for determining an encoding unit for implementing the above-described method for determining an encoding unit is also provided. For example... Figure 7As shown, the device includes: an acquisition module 72, used to acquire a first coding unit to be encoded in a video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units; a processing module 74, used to perform feature processing on the first coding unit to obtain a first feature value of the first coding unit; a search module 76, used to search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units; and a determination module 78, used to determine that the second coding unit corresponding to the second feature value is a predicted coding unit of the first coding unit.
[0081] Optionally, the above-described apparatus is further configured to, before searching for a second feature value that matches the first feature value in a preset feature table, obtain a group of coding units from the plurality of coding units according to the target quantization step size S of the video frame, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by the S columns of pixels, and adjacent coding units belonging to the same column are spaced apart by the S rows of pixels; and record the identifier and corresponding feature value of each coding unit in the group of coding units in the preset feature table.
[0082] Optionally, the above-described apparatus is further configured to, when the target quantization step size S of the video frame is 1, determine the plurality of coding units as the group of coding units, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by 1 column pixel, and adjacent coding units belonging to the same column are spaced apart by 1 row pixel, and the group of coding units includes all coding units in the plurality of coding units; when the target quantization step size S of the video frame is greater than 1, obtain the group of coding units in the plurality of coding units every target quantization step size S, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by S columns pixel, and adjacent coding units belonging to the same column are spaced apart by S rows pixel, and the group of coding units includes some coding units in the plurality of coding units.
[0083] Optionally, the above-described apparatus is further configured to, before obtaining a set of coding units from the plurality of coding units according to the target quantization step size S of the video frame, obtain the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a first proportion of inter-frame coding units among the plurality of coding units, wherein the inter-frame coding units are coding units that use inter-frame modes for encoding; and obtain the target quantization step size of the video frame from a preset plurality of quantization step sizes according to a second proportion of intra-frame coding units among the plurality of coding units, wherein the intra-frame coding units are coding units that use intra-frame modes for encoding.
[0084] Optionally, the above-described apparatus is further configured to obtain a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determine the sum of the first number and the second number as a target sum, and the ratio of the first number to the target sum as a first proportion; determine the second proportion of intra-frame coding units among the plurality of coding units, including: obtaining the first number of inter-frame coding units and the second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum; and determining the ratio of the second number to the target sum as the second proportion.
[0085] Optionally, the above-described apparatus is further configured to: determine the target quantization step size S as 1 when the first proportion is less than or equal to a first threshold; determine the target quantization step size S as a first value when the first proportion is greater than the first threshold and less than or equal to a second threshold; determine the target quantization step size S as a second value when the first proportion is greater than the second threshold and less than or equal to a third threshold; and determine the target quantization step size S as a third value when the first proportion is greater than the third threshold; wherein the preset plurality of quantization step sizes includes 1, the first value, the second value, and the third value, wherein the first value is greater than 1, the second value is greater than the first value, and the third value is greater than the second value.
[0086] Optionally, the above-described apparatus is further configured to: determine the target quantization step size S as 1 when the second proportion is greater than or equal to the fourth threshold; determine the target quantization step size S as a fourth value when the second proportion is less than the fourth threshold and greater than or equal to the fifth threshold; determine the target quantization step size S as a fifth value when the second proportion is less than the fifth threshold and greater than or equal to the sixth threshold; and determine the target quantization step size S as a sixth value when the second proportion is less than the sixth threshold; wherein the preset plurality of quantization step sizes includes 1, the fourth value, the fifth value, and the sixth value, the fourth value being greater than 1, the fifth value being greater than the fourth value, and the sixth value being greater than the fifth value.
[0087] Optionally, the above-described apparatus is further configured to divide the first coding unit into multiple sub-coding units; and determine the first feature value of the first coding unit by the mean and gradient values of the pixels in the multiple sub-coding units.
[0088] Optionally, the above-described apparatus is further configured to obtain the mean value of pixels in each of the plurality of coding sub-units to obtain a set of mean values; obtain the gradient of pixels in each of the plurality of coding sub-units to obtain a set of gradient values; and determine the first feature value of the first coding unit through the set of mean values and the set of gradient values.
[0089] Optionally, the above-mentioned device is further configured to obtain the value of a first preset bit at each mean of the set of means, and combine the obtained values to obtain a first number sequence; obtain the value of a second preset bit at the mean of the set of gradient values, and combine the obtained values to obtain a second number sequence; and determine the combination of the first number sequence and the second number sequence as the first feature value.
[0090] According to another aspect of the present invention, an electronic device for implementing the above-described method for determining the encoding unit is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses the electronic device as a server as an example for illustration. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments via the computer program.
[0091] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0092] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0093] S1, Obtain the first coding unit to be encoded in the video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units;
[0094] S2, perform feature processing on the first coding unit to obtain the first feature value of the first coding unit;
[0095] S3, search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units;
[0096] S4, determine the second coding unit corresponding to the second feature value as the prediction coding unit of the first coding unit.
[0097] Alternatively, as those skilled in the art will understand, Figure 8The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 8 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 8 The different configurations shown.
[0098] The memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and apparatus for determining the encoding unit in this embodiment of the invention. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, thereby implementing the aforementioned method for determining the encoding unit. The memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include memory remotely located relative to the processor 804, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 802 may be used, but is not limited to, to store information such as video frames. As an example, such as... Figure 8 As shown, the memory 802 may include, but is not limited to, the acquisition module 72, processing module 74, search module 76, and determination module 78 in the determination device of the encoding unit. Furthermore, it may include, but is not limited to, other module units in the determination device of the encoding unit, which will not be described further in this example.
[0099] Optionally, the transmission device 806 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 806 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 806 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0100] In addition, the aforementioned electronic device also includes: a display 808 for displaying the aforementioned video frames; and a connection bus 810 for connecting the various module components in the aforementioned electronic device.
[0101] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0102] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication section 909, and / or installed from a removable medium 911. When the computer program is executed by a central processing unit 901, it performs various functions provided in embodiments of this application.
[0103] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0104] Figure 9 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.
[0105] It should be noted that, Figure 9 The computer system 900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0106] like Figure 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 902 or programs loaded from storage section 908 into random access memory (RAM). The RAM 903 also stores various programs and data required for system operation. The CPU 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output interface 905 (I / O interface) is also connected to the bus 904.
[0107] The following components are connected to the input / output interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a local area network card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0108] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by central processing unit 901, it performs various functions defined in the system of this application.
[0109] According to one aspect of this application, a computer-readable storage medium is provided, wherein a processor of a computer device reads computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
[0110] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0111] S1, Obtain the first coding unit to be encoded in the video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units;
[0112] S2, perform feature processing on the first coding unit to obtain the first feature value of the first coding unit;
[0113] S3, search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units;
[0114] S4, determine the second coding unit corresponding to the second feature value as the prediction coding unit of the first coding unit.
[0115] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0116] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0117] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for determining a coding unit, characterized in that, include: Obtain the first coding unit to be encoded in the video frame, wherein the video frame includes multiple coding units, and the first coding unit is the coding unit to be encoded among the multiple coding units; The first coding unit is subjected to feature processing to obtain the first feature value of the first coding unit; A second feature value that matches the first feature value is searched in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units; The second coding unit corresponding to the second feature value is determined to be the prediction coding unit of the first coding unit; The method further includes: obtaining a target quantization step size S of the video frame from a preset plurality of quantization step sizes; obtaining a group of coding units from the plurality of coding units according to the target quantization step size S, wherein adjacent coding units belonging to the same row in the group of coding units are separated by a distance of S columns of pixels, and adjacent coding units belonging to the same column are separated by a distance of S rows of pixels; and recording the identifier and corresponding feature value of each coding unit in the group of coding units in the preset feature table.
2. The method according to claim 1, characterized in that, The step of obtaining a set of coding units from the plurality of coding units according to the target quantization step size S includes: When the target quantization step size S of the video frame is 1, the plurality of coding units are determined to be the group of coding units, 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, and the group of coding units includes all coding units in the plurality of coding units. When the target quantization step size S of the video frame is greater than 1, the group of coding units is obtained from the plurality of coding units every target quantization step size S. The adjacent coding units belonging to the same row in the group of coding units are separated by the S column pixels, and the adjacent coding units belonging to the same column are separated by the S row pixels. The group of coding units includes some coding units from the plurality of coding units.
3. The method according to claim 1 or 2, characterized in that, Before obtaining a set of coding units from the plurality of coding units according to the target quantization step size S, the method further includes: The target quantization step size of the video frame is obtained from a preset set of multiple quantization step sizes based on a first proportion of inter-frame coding units among the plurality of coding units, wherein the inter-frame coding unit is a coding unit that uses an inter-frame mode for coding; or, The target quantization step size of the video frame is obtained from a preset plurality of quantization step sizes based on the second proportion of intra-frame coding units among the plurality of coding units, wherein the intra-frame coding unit is a coding unit that uses intra-frame mode for coding.
4. The method according to claim 3, characterized in that, Determining the first proportion of inter-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum, and the ratio of the first number to the target sum as the first proportion; Determining the second proportion of intra-frame coding units among the plurality of coding units includes: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum; and determining the ratio of the second number to the target sum as the second proportion.
5. The method according to claim 3, characterized in that, The target quantization step size S of the video frame is obtained from a preset set of multiple quantization step sizes based on the first proportion of inter-frame coding units among the plurality of coding units, including: If the first proportion is less than or equal to the first threshold, the target quantization step size S is determined to be 1; If the first proportion is greater than the first threshold and less than or equal to the second threshold, the target quantization step size S is determined to be a first value; If the first proportion is greater than the second threshold and less than or equal to the third threshold, the target quantization step size S is determined to be the second value; If the first proportion is greater than the third threshold, the target quantization step size S is determined to be the third value; The preset multiple quantization steps include 1, the first value, the second value, and the third value, wherein the first value is greater than 1, the second value is greater than the first value, and the third value is greater than the second value.
6. The method according to claim 3, characterized in that, The target quantization step size of the video frame is obtained from a preset set of multiple quantization step sizes based on the second proportion of intra-frame coding units among the plurality of coding units, including: If the second proportion is greater than or equal to the fourth threshold, the target quantization step size S is determined to be 1; If the second proportion is less than the fourth threshold and greater than or equal to the fifth threshold, the target quantization step size S is determined to be the fourth value. If the second proportion is less than the fifth threshold and greater than or equal to the sixth threshold, the target quantization step size S is determined to be the fifth value. If the second proportion is less than the sixth threshold, the target quantization step size S is determined to be the sixth value; The preset multiple quantization steps include 1, the fourth value, the fifth value, and the sixth value, wherein the fourth value is greater than 1, the fifth value is greater than the fourth value, and the sixth value is greater than the fifth value.
7. The method according to claim 1, characterized in that, The first coding unit is subjected to feature processing to obtain a first feature value of the first coding unit, including: The first coding unit is divided into multiple sub-coding units; The first feature value of the first coding unit is determined by the mean and gradient values of the pixels in the plurality of sub-coding units.
8. The method according to claim 7, characterized in that, Determining the first feature value of the first coding unit by using the mean and gradient values of pixels in the plurality of sub-coding units includes: Obtain the mean value of pixels in each of the multiple sub-coding units to obtain a set of mean values; The gradient of the pixel in each of the plurality of sub-coding units is obtained to obtain a set of gradient values; The first feature value of the first coding unit is determined by the set of mean values and the set of gradient values.
9. The method according to claim 8, characterized in that, Determining the first feature value of the first coding unit using the set of mean values and the set of gradient values includes: The value of a first preset bit is obtained at each mean of the set of means, and the obtained values are combined to obtain a first number sequence; The value of the second preset bit is obtained from the mean of the set of gradient values, and the obtained values are combined to obtain the second number sequence. The combination of the first number sequence and the second number sequence is determined as the first feature value.
10. A device for determining an encoding unit, characterized in that, include: The acquisition module is used to acquire the first encoding unit to be encoded in the video frame, wherein the video frame includes multiple encoding units, and the first encoding unit is the encoding unit to be encoded among the multiple encoding units; The processing module is used to perform feature processing on the first encoding unit to obtain the first feature value of the first encoding unit; The lookup module is used to search for a second feature value that matches the first feature value in a preset feature table, wherein the preset feature table records the feature values of some or all of the multiple coding units; The determining module is used to determine that the second coding unit corresponding to the second feature value is the prediction coding unit of the first coding unit; The device is further configured to: obtain a target quantization step size S of the video frame from a plurality of preset quantization step sizes; obtain a group of coding units from the plurality of coding units according to the target quantization step size S, wherein adjacent coding units belonging to the same row in the group of coding units are spaced apart by S columns of pixels, and adjacent coding units belonging to the same column are spaced apart by S rows of pixels; and record the identifier and corresponding feature value of each coding unit in the group of coding units in the preset feature table.
11. The apparatus according to claim 10, characterized in that, The device is used to obtain a set of coding units from the plurality of coding units according to the target quantization step size S in the following manner: When the target quantization step size S of the video frame is 1, the plurality of coding units are determined to be the group of coding units, 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, and the group of coding units includes all coding units in the plurality of coding units. When the target quantization step size S of the video frame is greater than 1, the group of coding units is obtained from the plurality of coding units every target quantization step size S. The adjacent coding units belonging to the same row in the group of coding units are separated by the S column pixels, and the adjacent coding units belonging to the same column are separated by the S row pixels. The group of coding units includes some coding units from the plurality of coding units.
12. The apparatus according to claim 10 or 11, characterized in that, Before acquiring a set of coding units from the plurality of coding units according to the target quantization step size S, the apparatus is further configured to: The target quantization step size of the video frame is obtained from a preset set of multiple quantization step sizes based on a first proportion of inter-frame coding units among the plurality of coding units, wherein the inter-frame coding unit is a coding unit that uses an inter-frame mode for coding; or, The target quantization step size of the video frame is obtained from a preset plurality of quantization step sizes based on the second proportion of intra-frame coding units among the plurality of coding units, wherein the intra-frame coding unit is a coding unit that uses intra-frame mode for coding.
13. The apparatus according to claim 12, characterized in that, The apparatus is configured to determine a first proportion of the inter-frame coding units among the plurality of coding units by: obtaining a first number of the inter-frame coding units and a second number of the intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum, and the ratio of the first number to the target sum as the first proportion; The apparatus is configured to determine a second proportion of intra-frame coding units among the plurality of coding units by: obtaining a first number of inter-frame coding units and a second number of intra-frame coding units among the plurality of coding units; determining the sum of the first number and the second number as a target sum; and determining the ratio of the second number to the target sum as the second proportion.
14. The apparatus according to claim 12, characterized in that, The apparatus is used to obtain the target quantization step size S of the video frame within a preset plurality of quantization step sizes based on a first proportion of inter-frame coding units among the plurality of coding units in the following manner: If the first proportion is less than or equal to the first threshold, the target quantization step size S is determined to be 1; If the first proportion is greater than the first threshold and less than or equal to the second threshold, the target quantization step size S is determined to be a first value; If the first proportion is greater than the second threshold and less than or equal to the third threshold, the target quantization step size S is determined to be the second value; If the first proportion is greater than the third threshold, the target quantization step size S is determined to be the third value; The preset multiple quantization steps include 1, the first value, the second value, and the third value, wherein the first value is greater than 1, the second value is greater than the first value, and the third value is greater than the second value.
15. The apparatus according to claim 12, characterized in that, The apparatus is used to obtain the target quantization step size of the video frame within a preset plurality of quantization step sizes based on a second proportion of intra-coding units among the plurality of coding units in the following manner: If the second proportion is greater than or equal to the fourth threshold, the target quantization step size S is determined to be 1; If the second proportion is less than the fourth threshold and greater than or equal to the fifth threshold, the target quantization step size S is determined to be the fourth value. If the second proportion is less than the fifth threshold and greater than or equal to the sixth threshold, the target quantization step size S is determined to be the fifth value. If the second proportion is less than the sixth threshold, the target quantization step size S is determined to be the sixth value; The preset multiple quantization steps include 1, the fourth value, the fifth value, and the sixth value, wherein the fourth value is greater than 1, the fifth value is greater than the fourth value, and the sixth value is greater than the fifth value.
16. The apparatus according to claim 10, characterized in that, The apparatus is used to perform feature processing on the first coding unit in the following manner to obtain a first feature value of the first coding unit: The first coding unit is divided into multiple sub-coding units; The first feature value of the first coding unit is determined by the mean and gradient values of the pixels in the plurality of sub-coding units.
17. The apparatus according to claim 16, characterized in that, The device is used to determine the first feature value of the first coding unit by using the mean and gradient values of the pixels in the plurality of sub-coding units in the following manner: Obtain the mean value of pixels in each of the multiple sub-coding units to obtain a set of mean values; The gradient of the pixel in each of the plurality of sub-coding units is obtained to obtain a set of gradient values; The first feature value of the first coding unit is determined by the set of mean values and the set of gradient values.
18. The apparatus according to claim 17, characterized in that, The device is used to determine the first feature value of the first coding unit by using the set of mean values and the set of gradient values in the following manner: The value of a first preset bit is obtained at each mean of the set of means, and the obtained values are combined to obtain a first number sequence; The value of the second preset bit is obtained from the mean of the set of gradient values, and the obtained values are combined to obtain the second number sequence. The combination of the first number sequence and the second number sequence is determined as the first feature value.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the method according to any one of claims 1 to 9.
20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.
21. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 9 through the computer program.