Coding method and device
By acquiring the encoding tree units in the video encoding standard H.266/VVC and performing multi-forktree division, the encoding process is accelerated by using the attribute identification and encoding flag bits of the encoding block, the problems of high coding complexity and low efficiency caused by multi-forktree division are solved, and significant coding time saving and efficiency improvement are achieved.
Patent Information
- Application Number
- CN202210194324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-01
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-03-01
AI Technical Summary
The multi-forktree division introduced in the video encoding standard H.266/VVC leads to high encoding complexity, resulting in separate encoding blocks of the same content, resulting in high encoding time cost and low efficiency.
By obtaining the encoding tree unit and performing multi-forktree division, after obtaining the encoding block, the attribute identification and encoding flag bits of each encoding block are obtained. If the encoding flag bit indicates that the coded block with the same content has been encoded, the encoding of the current encoding block is accelerated by using the encoding information of the encoding block.
By using the encoded information to accelerate the encoding process, the encoding time is greatly saved, the encoding efficiency is improved, and the problems of high cost and low efficiency are solved.
Smart Images

Figure CN114710678B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a coding method and device. Background Art
[0002] At present, the video coding standard H.266 / VVC has introduced multi-tree partitioning, that is, in addition to quadtree partitioning, it also includes vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning. The new partitioning architecture improves coding efficiency, but also brings extremely high coding complexity. This high complexity limits the large-scale promotion and application of the video coding standard H.266 / VVC.
[0003] Since multi-tree partitioning is introduced in H.266 / VVC, different partitioning modes may result in the same coding block, that is, coding blocks of the same size at the same position can be obtained through different partitioning methods. For example, during the encoding process, the coding tree unit may obtain coding block 1 through quadtree partitioning, and may also obtain coding block 2 with the same content as coding block 1 by first performing horizontal binary tree partitioning and then vertical binary tree partitioning. The related technology encodes coding block 1 and coding block 2 separately. Therefore, the above encoding process of separately encoding two coding blocks with the same content leads to unnecessary repeated operations and low encoding efficiency. Summary of the invention
[0004] The present disclosure provides a coding method and device to at least solve the problem that the related art encodes coding blocks with the same content separately, resulting in high coding time cost and low efficiency.
[0005] According to a first aspect of an embodiment of the present disclosure, a coding method is provided, comprising: obtaining a coding tree unit of data to be encoded; obtaining at least one coding block by performing multi-branch tree division on the coding tree unit; for each coding block in the at least one coding block, obtaining an attribute identifier of a current coding block, and determining a coding flag bit associated with the attribute identifier, wherein the coding flag bit is used to indicate whether a coding block with the same content as the current coding block has been encoded; when the coding flag bit indicates that a coding block with the same content as the current coding block has been encoded, encoding the current coding block according to the coding information corresponding to the attribute identifier.
[0006] Optionally, obtaining the attribute identifier of the current coding block includes: obtaining a four-dimensional coordinate of the current coding block according to the two-dimensional coordinate of a predetermined point on the current coding block and the size of the current coding block, wherein the abscissa in the two-dimensional coordinate is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the ordinate in the two-dimensional coordinate is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit;
[0007] Optionally, the four-dimensional coordinates of the current coding block are obtained according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block, including: obtaining the two-dimensional coordinates of the upper left corner of the current coding block; determining the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks contained in the current coding block; and obtaining the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates, width and height.
[0008] Optionally, before obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block, it also includes: dividing the coding tree unit according to the minimum size allowed by the coding block to obtain at least one minimum coding block; determining the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and storing the two-dimensional coordinates corresponding to each minimum coding block.
[0009] Optionally, obtaining the two-dimensional coordinates of the upper left corner of the current coding block includes: determining the minimum coding block contained in the current coding block and arranged in the upper left position; and using the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position as the two-dimensional coordinates of the upper left corner of the current coding block.
[0010] Optionally, the above encoding method also includes: when the encoding flag indicates that there is no encoding block with the same content as the current encoding block that has been encoded, traversing all encoding modes related to the current encoding block, selecting the encoding mode with the smallest encoding cost to encode the current encoding block; associating the attribute identifier, the encoding information of the current encoding block and the encoding flag with storage, and updating the value of the encoding flag, the updated encoding flag indicating that there is a encoding block with the same content as the current encoding that has been encoded.
[0011] Optionally, the encoding information associated with the attribute identifier includes at least one of the following: a target partition mode, a prediction mode, a target reference frame, and an encoding cost.
[0012] Optionally, the current coding block is encoded according to the coding information associated with the attribute identifier, including: dividing the current coding block based on a target division mode; selecting at least one coding mode corresponding to the current coding block based on a prediction mode and / or a coding cost; determining a maximum number of reference frames in a reference frame list of the current coding block based on a target reference frame; selecting a coding mode of the current coding block from at least one coding mode based on the maximum number of reference frames, and encoding the current coding block based on the selected coding mode.
[0013] Optionally, selecting a coding mode for the current coding block based on the prediction mode and / or the coding cost includes: determining a target prediction mode corresponding to the prediction mode according to a pre-stored first coding acceleration strategy, and selecting at least one coding mode corresponding to the current coding block from prediction modes other than the target prediction mode; or determining a target coding mode corresponding to the coding cost according to a pre-stored second coding acceleration strategy, and when the coding cost is less than a preset threshold, selecting at least one coding mode corresponding to the current coding block from coding modes other than the target coding mode; or determining a target prediction mode corresponding to the prediction mode and a target coding mode corresponding to the coding cost according to a pre-stored third coding acceleration strategy, and selecting multiple coding modes corresponding to the current coding block from prediction modes other than the target prediction mode; and when the coding cost is less than a preset threshold, selecting at least one coding mode corresponding to the current coding block from multiple coding modes other than the target coding mode.
[0014] Optionally, determining the maximum number of reference frames in the reference frame list of the current coding block based on the target reference frame includes: determining the sequence number of the target reference frame; and determining the maximum number of reference frames in the reference frame list of the current coding block based on the sequence number.
[0015] According to a second aspect of an embodiment of the present disclosure, a coding device is provided, comprising: an acquisition unit, configured to acquire a coding tree unit of data to be encoded; a division unit, configured to obtain at least one coding block by performing multi-branch tree division on the coding tree unit; an identification determination unit, configured to acquire an attribute identification of a current coding block for each coding block in at least one coding block, and determine a coding flag bit associated with the attribute identification, wherein the coding flag bit is used to indicate whether a coding block with the same content as the current coding block has been encoded; and the coding unit, configured to encode the current coding block according to the coding information corresponding to the attribute identification when the coding flag bit indicates that a coding block with the same content as the current coding block has been encoded.
[0016] Optionally, the identification determination unit is also configured to obtain the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, wherein the horizontal coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the vertical coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit; and the four-dimensional coordinates are used as the attribute identification of the current coding block.
[0017] Optionally, the identification determination unit is also configured to obtain the two-dimensional coordinates of the upper left corner of the current coding block; determine the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks contained in the current coding block; and obtain the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates, width and height.
[0018] Optionally, the identification determination unit is also configured to divide the coding tree unit according to the minimum size allowed by the coding block to obtain at least one minimum coding block before obtaining the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block; determine the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and store the two-dimensional coordinates corresponding to each minimum coding block.
[0019] Optionally, the identification determination unit is further configured to determine the minimum coding block arranged in the upper left position contained in the current coding block; and use the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position as the two-dimensional coordinates of the upper left corner of the current coding block.
[0020] Optionally, the encoding unit is further configured to, when the encoding flag indicates that no encoding block with the same content as the current encoding block has been encoded, traverse all encoding modes related to the current encoding block, select the encoding mode with the smallest encoding cost to encode the current encoding block; store the attribute identifier, the encoding information of the current encoding block and the encoding flag in association with each other, and update the value of the encoding flag, wherein the updated encoding flag indicates that there is a encoding block with the same content as the current encoding that has been encoded.
[0021] Optionally, the encoding information associated with the attribute identifier includes at least one of the following: a target partition mode, a prediction mode, a target reference frame, and an encoding cost.
[0022] Optionally, the encoding unit is further configured to divide the current coding block based on the target division mode; select at least one encoding mode corresponding to the current coding block based on the prediction mode and / or the encoding cost; determine the maximum number of reference frames in the reference frame list of the current coding block based on the target reference frame; select the encoding mode of the current coding block from at least one encoding mode based on the maximum number of reference frames, and encode the current coding block based on the selected encoding mode.
[0023] Optionally, the encoding unit is further configured to determine a target prediction mode corresponding to the prediction mode according to a pre-stored first encoding acceleration strategy, and select at least one encoding mode corresponding to the current encoding block from prediction modes other than the target prediction mode; or, determine a target encoding mode corresponding to the encoding cost according to a pre-stored second encoding acceleration strategy, and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block from coding modes other than the target encoding mode; or, determine a target prediction mode corresponding to the prediction mode and a target encoding mode corresponding to the encoding cost according to a pre-stored third encoding acceleration strategy, and select multiple encoding modes corresponding to the current encoding block from prediction modes other than the target prediction mode; and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block from multiple encoding modes other than the target encoding mode.
[0024] Optionally, the encoding unit is further configured to determine a sequence number of the target reference frame; and based on the sequence number, determine a maximum number of reference frames in a reference frame list of a current encoding block.
[0025] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the encoding method according to the present disclosure.
[0026] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the encoding method according to the present disclosure as described above.
[0027] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which implement the encoding method according to the present disclosure when executed by a processor.
[0028] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0029] According to the encoding method and device disclosed in the present invention, each encoding block has its own attribute identifier to identify the position and size of the encoding block. When a encoding block with the same content as the current encoding block has been encoded at the position indicated by the attribute identifier, the current encoding block can be encoded by the encoding information of the encoded encoding block, that is, the encoded information can be used to accelerate the encoding process of the current encoding block, greatly saving the encoding time. Therefore, the present invention solves the problem that the related art encodes the encoding blocks with the same content separately, resulting in high encoding time cost and low efficiency.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0032] Figure 1 It is a schematic diagram showing BT / TT division in the related art;
[0033] Figure 2 It is a schematic diagram showing the QT / BT / TT division in the related art;
[0034] Figure 3 is a schematic diagram showing an implementation scenario of an encoding method according to an exemplary embodiment of the present disclosure;
[0035] Figure 4 is a flowchart of an encoding method according to an exemplary embodiment;
[0036] Figure 5 is a schematic diagram of a minimum coding block according to an exemplary embodiment;
[0037] Figure 6 is a block diagram of a coding device according to an exemplary embodiment;
[0038] Figure 7 is a block diagram of an electronic device 700 according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0041] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0042] The following takes the coding blocks with the same size and the same position as the coding blocks with the same content as an example. Figure 1 As shown in FIG. 1 , the multi-tree partition introduced by the video coding standard H.266 / VVC includes, in addition to quadtree partition, vertical binary tree partition (SPLIT_BT_VER), horizontal binary tree partition (SPLIT_BT_HOR), vertical ternary tree partition (SPLIT_TT_VER), and horizontal ternary tree partition (SPLIT_TT_HOR). Due to the introduction of multi-tree partition in H.266 / VVC, different partition modes may result in the same coding block, that is, the coding block of the same size at the same position can be obtained through different partitioning methods, such as Figure 2 The upper left corner coding block in the image can be obtained directly through quadtree division, or by first performing horizontal binary tree division and then vertical binary tree division. The related technology encodes the same upper left corner coding block separately, thus resulting in unnecessary repeated operations, increasing the coding time of the coding block and low coding efficiency. In view of the above problems, the present disclosure provides a coding method that can reduce coding time and improve coding efficiency. The following is an example of a video coding scenario for explanation.
[0043] Figure 3 is a schematic diagram showing an implementation scenario of an encoding method according to an exemplary embodiment of the present disclosure, such as Figure 3 The implementation scenario includes a server 100, a user terminal 110 and a user terminal 120, wherein the user terminals are not limited to two, and include but are not limited to mobile phones, personal computers and other devices. The user terminal can be equipped with a camera for acquiring video. The server can be a single server, or a server cluster composed of several servers, or a cloud computing platform or a virtualization center.
[0044] The user terminal 110 or the user terminal 120 obtains a video file through a camera, and sends the video file to the server 100 for encoding. After receiving the video file, the server 100 first cuts each frame of the video file into coding tree units of equal size, and then encodes it in the encoder in the server 100 (in order to simplify the description, the server 100 is directly described as performing the encoding operation). The encoding process can be as follows: the server 100 obtains at least one coding block by performing a multi-branch tree division on the coding tree unit; for each coding block in the at least one coding block, the server 100 obtains the attribute identifier of the current coding block, and determines the encoding flag associated with the attribute identifier, wherein the encoding flag is used to indicate whether there is a coding block with the same content as the current coding block that has been encoded. When the encoding flag indicates that there is a coding block with the same content as the current coding block that has been encoded, the current coding block is encoded according to the encoding information corresponding to the attribute identifier. After the current coding blocks obtained by different divisions are all encoded, the encoding results of all current coding blocks are compared, and then the best encoding result is selected or all encoding results are merged as the final encoding result of the current coding block.
[0045] Next, we will refer to Figures 4 to 6 An encoding method and apparatus according to exemplary embodiments of the present disclosure are described in detail.
[0046] Figure 4 is a flowchart of an encoding method according to an exemplary embodiment. Figure 4 As shown, the encoding method includes the following steps:
[0047] In step S401, a coding tree unit of data to be encoded is obtained.
[0048] For example, the data to be encoded can be divided into coding tree units of equal size, where the coding tree unit (Coding Tree Unit, abbreviated as CTU) is the processing unit of H.265 / High Efficiency Video Coding (High Efficiency Video Coding, abbreviated as HEVC), which is similar to the macroblock in H.264 / Advanced Video Coding (AVC); and the size of the coding tree unit can be from 16x16 to 64x64, and the specific size is set according to needs, but using a larger processing unit than H.264 can obtain better compression effect.
[0049] In step S402, at least one coding block is obtained by performing multi-branch tree division on the coding tree unit.
[0050] For example, the coding of a coding tree unit may need to be divided multiple times, and different division modes will result in corresponding coding blocks, such as Figure 2 As shown in the figure, the coding tree unit can be divided into a quadtree to obtain the former in the figure, and the coding tree unit can be divided into a horizontal binary tree and then a vertical binary tree to obtain the latter in the figure. Of course, for coding needs, other division modes can be used to continue to divide the coding tree unit, and the present disclosure is not limited. The above-mentioned at least one coding unit is a coding block after multiple divisions, such as Figure 2 Taking the two divisions shown as an example, the at least one coding unit includes 7 coding blocks.
[0051] In step S403, for each coding block in at least one coding block, an attribute identifier of the current coding block is obtained, and a coding flag associated with the attribute identifier is determined, wherein the coding flag is used to indicate whether a coding block with the same content as the current coding block has been encoded.
[0052] The above-mentioned attribute identifier may be a coordinate, such as a four-dimensional coordinate, or other information, as long as it can be used to uniquely identify the current coding block, and the present disclosure does not limit this. The above-mentioned coding flag may be a flag identifier, such as flag=0 to indicate that a coding block with the same content as the current coding block has been encoded, and flag=1 to indicate that no coding block with the same content as the current coding block has been encoded, and the present disclosure does not limit this. The coding block with the same content as the current coding block may be a coding block with the same position and size as the current coding block obtained by dividing the above-mentioned coding tree unit multiple times, such as Figure 2 The two identical coding blocks in the upper left corner may also be coding blocks that are different in position or size from the current coding block but have the same content, which is not limited in the present disclosure.
[0053] The encoding method disclosed in the present invention is described below by taking the attribute identifier as a four-dimensional coordinate as an example.
[0054] According to an exemplary embodiment of the present disclosure, obtaining the attribute identifier of the current coding block includes: obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block, wherein the horizontal coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the vertical coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit; and using the four-dimensional coordinates as the attribute identifier of the current coding block. According to this embodiment, determining the four-dimensional coordinates as the attribute identifier can conveniently determine coding blocks with the same content.
[0055] It should be noted that the above-mentioned predetermined point can be any point of the current coding block, for example, it can be the upper left corner of the current coding block, it can be the upper right corner of the current coding block, or it can be the center point of the current coding block. This disclosure does not limit this.
[0056] The following description is made by taking the predetermined point as the upper corner of the current coding block as an example.
[0057] According to an exemplary embodiment of the present disclosure, the four-dimensional coordinates of the current coding block are obtained according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block, including: obtaining the two-dimensional coordinates of the upper left corner of the current coding block; determining the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks contained in the current coding block; and obtaining the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates, width, and height.
[0058] According to this embodiment, the height and width of the current coding block are determined by the minimum coding block, and then the four-dimensional coordinates are determined, so that the occupied storage space can be reduced. If the width and height are determined by pixels, an 8×8 coding block requires 8 storage spaces, while using the minimum coding block (4×4), only 4 storage spaces are required. It should be noted that after obtaining the current coding block, the current coding block can be divided to obtain the arrangement of the included minimum coding blocks, and the arrangement includes the number and arrangement structure of all the minimum coding blocks obtained by the division.
[0059] For example, the two-dimensional coordinates of the upper left corner of the current coding block obtained by multi-tree partitioning are represented by (idxX, idxY), where idxX and idxY correspond to the distances of the upper left corner relative to the left and upper boundaries of the coding tree unit (Coding Tree Unit, abbreviated as CTU), respectively. Figure 5 To explain, Figure 5 is a schematic diagram of a minimum coding block according to an exemplary embodiment. Figure 5 The grid point A has idxX=8, idxY=8. The size of the current coding block obtained by multi-tree partitioning is represented by (width, height), where width and height are the width and height of the current coding block, and width and height are integer multiples of the minimum coding block size minCbSize, such as Figure 5 The coding block in the dotted box composed of the midpoint and the short line has width = 8 and height = 8. According to the position and size of the upper left corner grid point of the current coding block obtained by multi-tree partitioning, the four-dimensional coordinates (idxX, idxY, width, height) are determined to represent the position and size of the current coding block in the CTU. Figure 5As shown in the figure, the four-dimensional coordinates of the coding block in the dotted frame composed of dots and short lines are (8,8,8,8), the coding block in the dotted frame composed of thick dots is (8,8,8,16), the coding block in the dotted frame composed of short lines is (8,8,16,8), and the coding block in the solid frame is (8,8,16,16). In addition, according to the division structure restrictions of the coding blocks, some coding blocks are not allowed to appear, such as the coding block (8,8,8,32) in the dotted frame composed of thin dots, and the four-dimensional coordinates corresponding to the coding block are meaningless values.
[0060] According to an exemplary embodiment of the present disclosure, before obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block, it also includes: dividing the coding tree unit according to the minimum size allowed by the coding block to obtain at least one minimum coding block; determining the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and storing the two-dimensional coordinates corresponding to each minimum coding block. According to this embodiment, the minimum coding blocks can be divided in advance and the two-dimensional coordinates of the upper left corner of the minimum coding blocks can be stored so that the four-dimensional coordinates of the current coding block can be quickly determined based on the two-dimensional coordinates.
[0061] For example, Figure 5 As shown, the minimum coding block is obtained according to the size of the coding tree unit (Coding Tree Unit, abbreviated as CTU) and the minimum size allowed by the coding block, that is, Figure 5 The upper left corner of the coding block obtained by multi-tree partitioning of CTU must fall on the upper left corner of the smallest coding block. Generally speaking, each corner of the coding block is a grid point. Figure 5 The CTU shown is 64×64, and the minimum coding block size is 8×8, so a total of 8×8 minimum coding blocks are obtained, and there are 8×8 upper left corner grid points corresponding to them. Point A corresponds to the upper left corner grid point of the minimum coding block in the second row and second column.
[0062] According to an exemplary embodiment of the present disclosure, obtaining the two-dimensional coordinates of the upper left corner of the current coding block includes: determining the minimum coding block arranged in the upper left position contained in the current coding block; using the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position as the two-dimensional coordinates of the upper left corner of the current coding block. According to this embodiment, the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position are directly used as the two-dimensional coordinates of the upper left corner of the current coding block, so that the two-dimensional coordinates of the current coding block can be quickly determined.
[0063] In step S404, when the coding flag indicates that a coding block with the same content as the current coding block has been encoded, the current coding block is encoded according to the coding information corresponding to the attribute identifier. It should be noted that if the coding blocks are at the same position and the same size, after the current coding blocks obtained by different divisions are encoded, the encoding results of all current coding blocks are compared, and then the best encoding result is selected or all encoding results are merged as the final encoding result of the current coding block.
[0064] According to an exemplary embodiment of the present disclosure, when the coding flag indicates that there is no coding block with the same content as the current coding block that has been encoded, all coding modes related to the current coding block are traversed, and the coding mode with the lowest coding cost is selected to encode the current coding block; the attribute identifier, the coding information of the current coding block and the coding flag are stored in association with each other, and the value of the coding flag is updated, and the updated coding flag indicates that there is a coding block with the same content as the current coding that has been encoded. According to this embodiment, if there is no coding block with the same content as the current coding that has been encoded, then after encoding using the relevant technology, the attribute identifier, the coding information of the current coding block and the coding flag are stored in parallel and the coding flag is updated for use when the same coding block is encoded later.
[0065] For example, in the actual encoding process, after the CTU obtains the current coding block through the multi-tree partitioning method, the four-dimensional coordinates of the current coding block are determined according to the position of the upper left corner of the current coding block and the size of the current coding block, and then the coding flag associated with the four-dimensional coordinates is used to determine whether there is a coding block with the same content as the current coding block that has been encoded. If the coding flag indicates that there is no coding block with the same content as the current coding block that has been encoded, conventional encoding is performed through related technologies, that is, all possible coding modes are traversed, and the optimal mode (such as the coding mode with the lowest coding cost) is selected as the coding mode of the current coding block through RDO (Rate-Distortion Optimization). At the same time, the attribute identification, coding information and coding flag of the current coding block are stored in parallel, and the coding flag associated with the four-dimensional coordinates of the current coding block is updated. The updated coding flag indicates that there is a coding block with the same content as the current coding that has been encoded, that is, it indicates that the current coding block has been encoded. If the encoding flag indicates that a coding block with the same content as the current coding has been encoded, the encoding information associated with the four-dimensional coordinates of the current coding block is obtained, and then the encoding process of the current coding block is accelerated using the encoding information.
[0066] According to an exemplary embodiment of the present disclosure, the encoding information associated with the attribute identifier includes at least one of the following: target partition mode, prediction mode, target reference frame, and encoding cost. Specifically, a set of encoding information associated with each meaningful four-dimensional coordinate may include the target partition mode, whether the prediction mode is merge / skip mode, whether the prediction mode is affine mode, whether the prediction mode is intra mode, target reference frame, encoding cost, and may also include other encoding information, including but not limited to the accuracy of AVR, the optimal angle of intra, etc., which is not limited by the present disclosure.
[0067] According to an exemplary embodiment of the present disclosure, encoding the current coding block according to the coding information associated with the attribute identifier includes: dividing the current coding block based on the target division mode; selecting at least one coding mode corresponding to the current coding block based on the prediction mode and / or the coding cost; determining the maximum number of reference frames in the reference frame list of the current coding block based on the target reference frame; selecting the coding mode of the current coding block from at least one coding mode based on the maximum number of reference frames, and encoding the current coding block based on the selected coding mode. According to this embodiment, the process of division, coding and determining the maximum number of reference frames can be accelerated, thereby accelerating the coding speed.
[0068] For example, when the target partitioning mode is not partitioned, the current coding block is not partitioned; when the target partitioning mode is a predetermined multi-tree partitioning, the current coding block is partitioned based on the predetermined multi-tree partitioning. Specifically, if the target partitioning mode of the coding information is quadtree partitioning, binary tree partitioning, or ternary tree partitioning, the current coding block directly enters the next layer of partitioning. If the target partitioning mode in the coding information is not partitioned, the current coding block is not partitioned into binary and ternary trees; if the target partitioning mode in the coding information is horizontal binary tree partitioning, the current coding block is partitioned by skipping ternary tree partitioning and vertical binary tree partitioning; if the target partitioning mode in the coding information is vertical binary tree partitioning, the current coding block is partitioned by skipping ternary tree partitioning and horizontal binary tree partitioning; if the target partitioning mode in the coding information is horizontal ternary tree partitioning, the current coding block is partitioned by skipping binary tree partitioning and vertical ternary tree partitioning; if the target partitioning mode in the coding information is vertical ternary tree partitioning, the current coding block is partitioned by skipping binary tree partitioning and horizontal ternary tree partitioning. It should be noted that the above are some rules for accelerating the current block encoding process based on the target division mode in the encoding information. There are other rules that can be used for acceleration, and the present disclosure does not limit this.
[0069] For another example, after determining that the maximum number of reference frames in the reference frame list of the current coding block is idxL0+1, assuming that idxL0+1 is 3, which means that there are 3 reference frames, then at least one coding mode will traverse the 3 reference frames respectively to obtain their respective rate-distortion costs, and select the coding mode with the lowest rate-distortion cost as the coding mode of the current coding block. It should be noted that if the maximum number of reference frames is not determined, the reference frames that need to be traversed by at least one coding mode will generally exceed 3. Assuming that there are currently 6 reference frames, all 6 reference frames need to be traversed, increasing the coding time. With the limitation of the maximum number of reference frames disclosed in the present invention, the first 3 reference frames can be selected from the 6 reference frames for traversal. It should be noted here that, generally speaking, according to the standard, these 6 reference frames are sorted according to rules. The specific rules can be set by the standard or set according to needs.
[0070] According to an exemplary embodiment of the present disclosure, the encoding mode of the current encoding block is selected based on the prediction mode and / or the encoding cost, including: according to a pre-stored first encoding acceleration strategy, determining the target prediction mode corresponding to the prediction mode, and selecting at least one encoding mode corresponding to the current encoding block in other prediction modes other than the target prediction mode; or, according to a pre-stored second encoding acceleration strategy, determining the target encoding mode corresponding to the encoding cost, and in the case where the encoding cost is less than a preset threshold, selecting at least one encoding mode corresponding to the current encoding block in other encoding modes other than the target encoding mode; or, according to a pre-stored third encoding acceleration strategy, determining the target prediction mode corresponding to the prediction mode and the target encoding mode corresponding to the encoding cost, and in other prediction modes other than the target prediction mode, selecting multiple encoding modes corresponding to the current encoding block; and in the case where the encoding cost is less than a preset threshold, selecting at least one encoding mode corresponding to the current encoding block in other encoding modes other than the target encoding mode. According to this embodiment, based on the prediction mode in the encoding information, some encoding modes can be skipped during traversal without all traversal, and the size of the encoding cost can further skip some encoding modes, thereby accelerating the encoding speed.
[0071] For example, when the prediction mode is not the affine mode, the affine-merge mode is skipped to select the coding mode of the current coding block; when the prediction mode is the skip mode and not the skip-affine mode, the amvr mode, the mode in which the coded block flag (coded block flag, abbreviated as cbf) in the merge mode is not equal to 0, the intra mode and the affine mode are skipped to select at least one coding mode corresponding to the current coding block.
[0072] When the coding cost is less than a preset threshold, complex coding modes (such as affine) are skipped to select at least one coding mode corresponding to the current coding block. When the coding cost is greater than or equal to the preset threshold, there is no need to skip complex coding modes (such as affine) to select at least one coding mode corresponding to the current coding block, that is, the existing coding modes can be traversed according to the conventional method to select at least one coding mode corresponding to the current coding block.
[0073] For another example, when the prediction mode is not the affine mode, the affine-merge mode is skipped to select multiple coding modes corresponding to the current coding block; when the prediction mode is the skip mode and not the skip-affine mode, the amvr mode, the mode in which the coded block flag (coded block flag, abbreviated as cbf) in the merge mode is not equal to 0, the intra mode and the affine mode are skipped to select multiple coding modes corresponding to the current coding block. After selecting multiple coding modes, continue to judge whether the coding cost is less than the preset threshold. If the judgment result is less than, skip the complex coding mode (such as affine) and continue to select at least one coding mode corresponding to the current coding block from the multiple coding modes. If the judgment result is not less than, select at least one coding mode corresponding to the current coding block from the multiple coding modes.
[0074] It should be noted that the above are some rules for accelerating the current block encoding process based on the prediction mode and the encoding cost. There are other rules that can be used for acceleration, and the present disclosure does not limit this.
[0075] According to an exemplary embodiment of the present disclosure, determining the maximum number of reference frames in the reference frame list of the current coding block based on the target reference frame includes: determining the sequence number of the target reference frame; and determining the maximum number of reference frames in the reference frame list of the current coding block based on the sequence number.
[0076] For example, if the optimal reference frames of the two reference lists are idxL0 / idxL1, the maximum number of reference frames in the two reference frame lists of the current coding block is idxL0+1 / idxL1+1. It should be noted that the above are some rules for accelerating the current block encoding process based on the optimal reference frame. There are other rules that can be used for acceleration, and the present disclosure does not limit this.
[0077] In summary, the introduction of multi-tree partitioning in video coding H.266 / VVC brings great coding complexity and puts forward higher requirements for the implementation of the encoder. Therefore, it is necessary to optimize the speed of the encoder. In view of the shortcomings of the narrow application scope of the relevant technology and the lack of acceleration using the coding information of the coded block, the present disclosure uses the information of the coded blocks with the same content to accelerate the coding process of the subsequent coding blocks to improve the coding speed. For example, according to the position of the current coding block in the CTU and the width and height of the current coding block, a four-dimensional coordinate is determined to identify the current position and size of the current coding block, and a coding flag is associated to identify whether the coding block has been encoded. At the same time, a set of coding information is also associated to store the encoded information, thereby accelerating the encoding process of the coding blocks of the same position and size obtained by different subsequent division methods, which can greatly save the encoding time and bring about 15.6% time saving and 0.5% BD-Rate PSNR loss in the next generation encoder.
[0078] Figure 6 is a block diagram of a coding device according to an exemplary embodiment. Figure 6 The device includes an acquisition unit 60, a division unit 62, an identification determination unit 64 and an encoding unit 66.
[0079] The acquisition unit 60 is configured to acquire a coding tree unit of data to be encoded; the division unit 62 is configured to obtain at least one coding block by performing a multi-branch tree division on the coding tree unit; the identification determination unit 64 is configured to acquire the attribute identification of the current coding block for each coding block in the at least one coding block, and determine the coding flag bit associated with the attribute identification, wherein the coding flag bit is used to indicate whether there is a coding block with the same content as the current coding block that has been encoded; the encoding unit 66 is configured to encode the current coding block according to the coding information corresponding to the attribute identification when the coding flag bit indicates that there is a coding block with the same content as the current coding block that has been encoded.
[0080] According to an embodiment of the present disclosure, the identification determination unit 64 is also configured to obtain the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, wherein the horizontal coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the vertical coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit; and the four-dimensional coordinates are used as the attribute identification of the current coding block.
[0081] According to an embodiment of the present disclosure, the identification determination unit 64 is also configured to obtain the two-dimensional coordinates of the upper left corner of the current coding block; determine the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks contained in the current coding block; and obtain the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates, width and height.
[0082] According to an embodiment of the present disclosure, the identification determination unit 64 is also configured to divide the coding tree unit according to the minimum size allowed by the coding block to obtain at least one minimum coding block before obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of a predetermined point on the current coding block and the size of the current coding block; determine the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and store the two-dimensional coordinates corresponding to each minimum coding block.
[0083] According to an embodiment of the present disclosure, the identification determination unit 64 is also configured to determine the minimum coding block arranged in the upper left position contained in the current coding block; and use the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position as the two-dimensional coordinates of the upper left corner of the current coding block.
[0084] According to an embodiment of the present disclosure, the encoding unit 66 is also configured to, when the encoding flag indicates that there is no encoding block with the same content as the current encoding block that has been encoded, traverse all encoding modes related to the current encoding block, select the encoding mode with the smallest encoding cost to encode the current encoding block; store the attribute identifier, the encoding information of the current encoding block and the encoding flag in association with each other, and update the value of the encoding flag, wherein the updated encoding flag indicates that there is an encoding block with the same content as the current encoding that has been encoded.
[0085] According to an embodiment of the present disclosure, the encoding information associated with the attribute identifier includes at least one of the following: a target partition mode, a prediction mode, a target reference frame, and an encoding cost.
[0086] According to an embodiment of the present disclosure, the encoding unit 66 is further configured to divide the current coding block based on a target division mode; select at least one encoding mode corresponding to the current coding block based on a prediction mode and / or encoding cost; determine the maximum number of reference frames in a reference frame list of the current coding block based on a target reference frame; select a coding mode of the current coding block from at least one encoding mode based on the maximum number of reference frames, and encode the current coding block based on the selected encoding mode.
[0087] According to an embodiment of the present disclosure, the encoding unit 66 is also configured to determine a target prediction mode corresponding to a prediction mode according to a pre-stored first encoding acceleration strategy, and select at least one encoding mode corresponding to a current encoding block in prediction modes other than the target prediction mode; or, determine a target encoding mode corresponding to an encoding cost according to a pre-stored second encoding acceleration strategy, and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block in encoding modes other than the target encoding mode; or, determine a target prediction mode corresponding to a prediction mode and a target encoding mode corresponding to an encoding cost according to a pre-stored third encoding acceleration strategy, and select multiple encoding modes corresponding to the current encoding block in prediction modes other than the target prediction mode; and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block in multiple encoding modes other than the target encoding mode.
[0088] According to an embodiment of the present disclosure, the encoding unit 66 is further configured to determine a sequence number of the target reference frame; and based on the sequence number, determine a maximum number of reference frames in a reference frame list of a current encoding block.
[0089] According to an embodiment of the present disclosure, an electronic device may be provided. Figure 7 It is a block diagram of an electronic device 700 according to an embodiment of the present disclosure, and the electronic device includes at least one memory 701 and at least one processor 702, wherein a set of computer executable instructions is stored in the at least one memory, and when the computer executable instruction set is executed by the at least one processor, the encoding method according to the embodiment of the present disclosure is executed.
[0090] As an example, the electronic device 700 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 1000 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 700 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0091] In the electronic device 700, the processor 702 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor 702 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0092] The processor 702 may execute instructions or codes stored in the memory, wherein the memory 701 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.
[0093] The memory 701 may be integrated with the processor 702, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 701 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 701 and the processor 702 may be operationally coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 702 can read files stored in the memory 701.
[0094] In addition, the electronic device 700 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device may be connected to each other via a bus and / or a network.
[0095] According to an embodiment of the present disclosure, a computer-readable storage medium may also be provided, wherein when the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the encoding method of the embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0096] According to an embodiment of the present disclosure, a computer program product is provided, including computer instructions, and when the computer instructions are executed by a processor, the encoding method of the embodiment of the present disclosure is implemented.
[0097] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0098] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A coding method, characterized in that: include: Obtain a coding tree unit of data to be encoded; At least one coding block is obtained by performing multi-branch tree division on the coding tree unit; For each coding block in the at least one coding block, obtain an attribute identifier of the current coding block, and determine a coding flag bit associated with the attribute identifier, wherein the coding flag bit is used to indicate whether a coding block with the same content as the current coding block has been encoded; When the encoding flag indicates that a coding block having the same content as the current coding block has been encoded, the current coding block is encoded according to the encoding information corresponding to the attribute identifier.
2. The encoding method according to claim 1, characterized in that The step of obtaining the attribute identifier of the current coding block includes: Obtaining, according to the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, the four-dimensional coordinates of the current coding block, wherein the abscissa in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the ordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit; The four-dimensional coordinate is used as an attribute identifier of the current coding block.
3. The encoding method according to claim 2, characterized in that The obtaining, according to the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, the four-dimensional coordinates of the current coding block includes: Obtain the two-dimensional coordinates of the upper left corner of the current coding block; Determine the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks included in the current coding block; Based on the two-dimensional coordinates, the width and the height, a four-dimensional coordinate of the current coding block is obtained.
4. The encoding method according to claim 3, characterized in that Before obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, the method further includes: Dividing the coding tree unit according to the minimum size allowed by the coding block to obtain at least one minimum coding block; Determine the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and store the two-dimensional coordinates corresponding to each of the minimum coding blocks.
5. The encoding method according to claim 4, characterized in that The obtaining the two-dimensional coordinates of the upper left corner of the current coding block includes: Determine a minimum coding block included in the current coding block and arranged at the upper left position; The two-dimensional coordinate of the upper left corner of the minimum coding block arranged at the upper left position is used as the two-dimensional coordinate of the upper left corner of the current coding block.
6. The encoding method according to claim 1, characterized in that Also includes: When the encoding flag indicates that no encoding block with the same content as the current encoding block has been encoded, traverse all encoding modes related to the current encoding block and select the encoding mode with the smallest encoding cost to encode the current encoding block; The attribute identifier, the encoding information of the current encoding block and the encoding flag are stored in association, and the value of the encoding flag is updated. The updated encoding flag indicates that there is an encoding block with the same content as the current encoding block that has been encoded.
7. The encoding method according to claim 1, characterized in that The encoding information associated with the attribute identifier includes at least one of the following: target partition mode, prediction mode, target reference frame, and encoding cost.
8. The encoding method according to claim 7, characterized in that The encoding of the current coding block according to the coding information associated with the attribute identifier includes: Dividing the current coding block based on the target partitioning mode; Selecting at least one coding mode corresponding to the current coding block based on the prediction mode and / or the coding cost; Determining, based on the target reference frame, a maximum number of reference frames in a reference frame list of the current coding block; A coding mode for the current coding block is selected from the at least one coding mode based on the maximum number of reference frames, and the current coding block is encoded based on the selected coding mode.
9. The encoding method according to claim 8, characterized in that The selecting at least one coding mode corresponding to the current coding block based on the prediction mode and / or the coding cost includes: Determine a target prediction mode corresponding to the prediction mode according to a pre-stored first encoding acceleration strategy, and select at least one encoding mode corresponding to the current encoding block from prediction modes other than the target prediction mode; or Determine, according to a pre-stored second encoding acceleration strategy, a target encoding mode corresponding to the encoding cost, and select, from encoding modes other than the target encoding mode, at least one encoding mode corresponding to the current encoding block when the encoding cost is less than a preset threshold; or According to a pre-stored third encoding acceleration strategy, a target prediction mode corresponding to the prediction mode and a target encoding mode corresponding to the encoding cost are determined, and among prediction modes other than the target prediction mode, multiple encoding modes corresponding to the current encoding block are selected; when the encoding cost is less than a preset threshold, at least one encoding mode corresponding to the current encoding block is selected from the multiple encoding modes.
10. The encoding method according to claim 8, characterized in that: The determining, based on the target reference frame, a maximum number of reference frames in a reference frame list of the current coding block comprises: Determining the sequence number of the target reference frame; Based on the sequence number, a maximum number of reference frames in a reference frame list of the current coding block is determined.
11. A coding device, characterized in that: include: An acquisition unit, configured to acquire a coding tree unit of data to be encoded; A division unit, configured to obtain at least one coding block by performing multi-branch tree division on the coding tree unit; an identification determination unit, configured to obtain, for each coding block in the at least one coding block, an attribute identification of the current coding block, and determine a coding flag bit associated with the attribute identification, wherein the coding flag bit is used to indicate whether a coding block with the same content as the current coding block has been encoded; The encoding unit is configured to encode the current encoding block according to the encoding information corresponding to the attribute identifier when the encoding flag indicates that a coding block with the same content as the current coding block has been encoded.
12. The encoding device according to claim 11, characterized in that The identification determination unit is further configured to obtain the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block, wherein the horizontal coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the left boundary of the coding tree unit, and the vertical coordinate in the two-dimensional coordinates is the distance between the predetermined point on the current coding block and the upper boundary of the coding tree unit; and use the four-dimensional coordinates as the attribute identification of the current coding block.
13. The encoding device according to claim 12, characterized in that The identification determination unit is also configured to obtain the two-dimensional coordinates of the upper left corner of the current coding block; determine the width and height of the current coding block based on the size of the minimum coding block and the arrangement of the minimum coding blocks contained in the current coding block; and obtain the four-dimensional coordinates of the current coding block based on the two-dimensional coordinates, the width and the height.
14. The encoding device according to claim 13, characterized in that The identification determination unit is further configured to divide the coding tree unit according to a minimum size allowed by the coding block to obtain at least one minimum coding block before obtaining the four-dimensional coordinates of the current coding block according to the two-dimensional coordinates of the predetermined point on the current coding block and the size of the current coding block; Determine the two-dimensional coordinates of the upper left corner of each minimum coding block in the at least one minimum coding block, and store the two-dimensional coordinates corresponding to each of the minimum coding blocks.
15. The encoding device according to claim 14, characterized in that The identification determination unit is also configured to determine the minimum coding block arranged in the upper left position contained in the current coding block; and use the two-dimensional coordinates of the upper left corner of the minimum coding block arranged in the upper left position as the two-dimensional coordinates of the upper left corner of the current coding block.
16. The encoding device according to claim 12, characterized in that The encoding unit is further configured to, when the encoding flag indicates that no encoding block with the same content as the current encoding block has been encoded, traverse all encoding modes related to the current encoding block and select the encoding mode with the smallest encoding cost to encode the current encoding block; The attribute identifier, the encoding information of the current encoding block and the encoding flag are stored in association, and the value of the encoding flag is updated. The updated encoding flag indicates that there is an encoding block with the same content as the current encoding block that has been encoded.
17. The encoding device according to claim 11, characterized in that The encoding information associated with the attribute identifier includes at least one of the following: target partition mode, prediction mode, target reference frame, and encoding cost.
18. The encoding device according to claim 17, characterized in that The encoding unit is further configured to divide the current encoding block based on the target division mode; select at least one encoding mode corresponding to the current encoding block based on the prediction mode and / or the encoding cost; Determining, based on the target reference frame, a maximum number of reference frames in a reference frame list of the current coding block; A coding mode for the current coding block is selected from the at least one coding mode based on the maximum number of reference frames, and the current coding block is encoded based on the selected coding mode.
19. The encoding device according to claim 18, characterized in that The encoding unit is further configured to determine the target prediction mode corresponding to the prediction mode according to a pre-stored first encoding acceleration strategy, and select at least one encoding mode corresponding to the current encoding block in prediction modes other than the target prediction mode; or, determine the target encoding mode corresponding to the encoding cost according to a pre-stored second encoding acceleration strategy, and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block in encoding modes other than the target encoding mode; or, determine the target prediction mode corresponding to the prediction mode and the target encoding mode corresponding to the encoding cost according to a pre-stored third encoding acceleration strategy, and select multiple encoding modes corresponding to the current encoding block in prediction modes other than the target prediction mode; and when the encoding cost is less than a preset threshold, select at least one encoding mode corresponding to the current encoding block in encoding modes other than the target encoding mode among the multiple encoding modes.
20. The encoding device according to claim 18, characterized in that The encoding unit is further configured to determine a sequence number of the target reference frame; and based on the sequence number, determine a maximum number of reference frames in a reference frame list of the current encoding block.
21. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the encoding method according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the encoding method according to any one of claims 1 to 10.
23. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the encoding method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Method and apparatus for video coding and decoding
CN113841390A
Method for video processing and apparatus therefor
WO2019194515A1