Coding Block Partition Mode Decision Method, Apparatus, Electronic Device, and Storage Medium

CN117729329BActive Publication Date: 2025-07-22XIAOHONGSHU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311348211.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-07-22
Estimated Expiration
2043-10-17

AI Technical Summary

Technical Problem

[0002]目前,对一帧视频或者一帧图像进行编码一般都是基于相应的视频编码标准进行的,比如开放媒体联盟视频1代(Alliance for Open Media Video 1,AV1)视频编码标准,它将一帧视频或一帧图像基于预设尺寸划分为多个编码块,然后对每个编码块以该标准下的多种分割方式进行多层分割后,在每一层分割/每一次分割/每一个分割深度/每一个划分深度中,从每个分割深度对应的多种分割模式中确定出与每个分割深度对应的目标分割方式,再基于目标分割模式得到对每个编码块的最终分割方式;但是,由于在每个分割深度进行分割的编码块所对应的分割模式有多种,现有技术在确定编码块的最终分割方式时,需要在每个分割深度中将对应的编码块以多种分割模式均进行分割之后,再依据在每个分割深度进行分割之后的编码块确定出对应的目标分割模式,再依据每个分割深度得到的目标分割模式来确定出编码块的最终分割方式,使得确定编码块的最终分割模式的效率低下,进而降低了整体的编码效率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117729329B_ABST
    Figure CN117729329B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, electronic device and storage medium for encoding block segmentation mode decision. The method includes: obtaining a target encoding block; based on encoding block A i , and K i segmentation modes corresponding to encoding block A i1 , eliminating the K i2 segmentation modes to obtain K i3 segmentation modes corresponding to the first segmentation depth; determining a target segmentation mode B i3 from the K i segmentation modes; segmenting encoding block A i based on the target segmentation mode B i to obtain a plurality of first sub-encoding blocks; when the target segmentation mode B i is the first segmentation mode and the size of any one of the plurality of first sub-encoding blocks is greater than the first preset size, segmenting any one of the first sub-encoding blocks at the third segmentation depth until the target segmentation mode after segmentation at multiple segmentation depths is not the first segmentation mode; obtaining the final segmentation mode of the target encoding block based on the target segmentation mode corresponding to each segmentation depth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of coding technologies, and specifically relates to a method, apparatus, electronic device, and storage medium for making a decision on a coding block segmentation mode. Background Art

[0002] Currently, encoding a video frame or an image frame is generally based on a corresponding video encoding standard. For example, in the Alliance for Open Media Video 1 (AV1) video encoding standard, a video frame or an image frame is divided into multiple coding blocks based on a preset size. Then, after performing multi-layer segmentation on each coding block in multiple segmentation ways under this standard, at each layer of segmentation / each segmentation / each segmentation depth / each division depth, a target segmentation way corresponding to each segmentation depth is determined from multiple segmentation modes corresponding to each segmentation depth, and then the final segmentation way of each coding block is obtained based on the target segmentation mode. However, since there are multiple segmentation modes corresponding to the coding blocks segmented at each segmentation depth, when the prior art determines the final segmentation way of a coding block, it is necessary to segment the corresponding coding block in multiple segmentation modes at each segmentation depth, and then determine the corresponding target segmentation mode based on the coding blocks after segmentation at each segmentation depth, and then determine the final segmentation way of the coding block based on the target segmentation mode obtained at each segmentation depth, which results in low efficiency in determining the final segmentation mode of the coding block, thereby reducing the overall encoding efficiency. Summary of the Invention

[0003] Embodiments of the present application provide a method, apparatus, electronic device, and storage medium for making a decision on a coding block segmentation mode, which improve the efficiency of determining the final segmentation mode of a coding block and thus improve the overall encoding efficiency.

[0004] In a first aspect, an embodiment of the present application provides a method for making a decision on a coding block segmentation mode, the method including:

[0005] Obtain a target coding block;

[0006] At a first segmentation depth, based on coding block A i , and K i segmentation modes corresponding to coding block A i , eliminate K i1 segmentation modes from the K i segmentation modes, to obtain K i2 segmentation modes corresponding to the first segmentation depth, where K i3 , K i1The splitting mode includes a first splitting mode, where the first splitting mode means dividing the coded block into multiple sub-coded blocks with the same size and a square shape. The first splitting depth is i, and i is an integer. When i = 0, the coded block A i is the target coded block. When i > 0, the coded block A i is any one of the multiple sub-coded blocks obtained by splitting at the second splitting depth using the first splitting mode. K i = K i2 + K i3 ,K i 、K i1 、K i2 、K i3 are all integers;

[0007] Determine the target splitting mode B i3 corresponding to the first splitting depth from K i types of splitting modes;

[0008] Based on the target splitting mode B i split the coded block A i to obtain multiple first sub-coded blocks corresponding to the target splitting mode B i ;

[0009] When the target splitting mode B i is the first splitting mode, and the size of any one of the multiple first sub-coded blocks is greater than the first preset size, split any one of the first sub-coded blocks at the third splitting depth until the target splitting mode after splitting at multiple splitting depths is not the first splitting mode, or the size of any one of the multiple sub-coded blocks obtained by splitting using the first splitting mode after splitting at multiple splitting depths is equal to the first preset size. The third splitting depth is i + 1;

[0010] Based on the target splitting mode corresponding to each splitting depth among multiple splitting depths, obtain the final splitting mode of the target coded block.

[0011] In a second aspect, an embodiment of the present application provides a coded block splitting mode decision device, which includes: an acquisition unit and a processing unit;

[0012] The acquisition unit is used to acquire the target coded block;

[0013] The processing unit is used to, at the first splitting depth, based on the coded block A i , and K i types of splitting modes corresponding to the coded block A i among the K i1 types of splitting modes, for the K i types of splitting modes among the K i2Eliminate using a certain splitting mode to obtain K splitting modes corresponding to the first splitting depth, where i3 K is i1 a certain number of splitting modes. The first splitting mode represents dividing a coding block into multiple sub-coding blocks of the same size and square shape. The first splitting depth is i, where i is an integer. When i = 0, coding block A i is the target coding block. When i > 0, coding block A i is any one of the multiple sub-coding blocks obtained by splitting at the second splitting depth using the first splitting mode. K i = K i2 + K i3 , and K i , K i1 , K i2 , and K i3 are all integers;

[0014] The processing unit is further configured to determine a target splitting mode B corresponding to the first splitting depth from the K splitting modes i3 ; i

[0015] The processing unit is further configured to split coding block A based on target splitting mode B i to obtain multiple first sub-coding blocks corresponding to target splitting mode B i i ;

[0016]

[0017] The processing unit is further configured to, when the target splitting mode B i is the first splitting mode and the size of any one of the multiple first sub-coding blocks is greater than the first preset size, split any one of the first sub-coding blocks at the third splitting depth until the target splitting mode after splitting at multiple splitting depths is not the first splitting mode, or the size of any one of the multiple sub-coding blocks obtained by splitting using the first splitting mode after splitting at multiple splitting depths is equal to the first preset size;

[0018] The processing unit is further configured to obtain the final splitting mode of the target coding block based on the target splitting mode corresponding to each splitting depth among the multiple splitting depths.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory. The processor is connected to the memory. The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the electronic device executes the method as in the first aspect.

[0019] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing a computer program that causes a computer to execute the method according to the first aspect.

[0020] Fifthly, an embodiment of the present application provides a computer program product including a non-transitory computer-readable storage medium storing a computer program, and the computer is operable to cause the computer to execute the method according to the first aspect.

[0021] Implementing the embodiments of the present application has the following beneficial effects:

[0022] After obtaining the target coding block, it is necessary to split the target coding block. Among them, at the first splitting depth, based on coding block A i and K i types of splitting patterns corresponding to coding block A i among the K i1 types of splitting patterns, K i types of splitting patterns among the K i2 types of splitting patterns are excluded to obtain K i3 types of splitting patterns corresponding to the first splitting depth. Among them, when i = 0, coding block A i is the target coding block. When i > 0, coding block A i is any one of the multiple sub-coding blocks obtained by splitting at the second splitting depth using the first splitting pattern; then determine the target splitting pattern B i3 corresponding to the first splitting depth from the K i types of splitting patterns; then split coding block A i based on the target splitting pattern B i to obtain multiple first sub-coding blocks corresponding to the target splitting pattern B i ; when the target splitting pattern B i is the first splitting pattern and the size of any one of the multiple first sub-coding blocks is greater than the first preset size, split any one of the first sub-coding blocks at the third splitting depth until the target splitting pattern after splitting at multiple splitting depths is not the first splitting pattern, or the size of any one of the multiple sub-coding blocks obtained by splitting using the first splitting pattern after splitting at multiple splitting depths is equal to the first preset size; based on the target splitting pattern corresponding to each splitting depth among the multiple splitting depths, obtain the final splitting pattern of the target coding block. That is to say, the splitting of the target coding block is based on the K iA splitting mode is used to form multiple splittings of the target coding block (and the splitting at the first splitting depth depends on any sub-coding block obtained by splitting using the first splitting mode during the splitting at the second splitting depth, which is a hierarchical splitting). In this application, at each splitting depth, without having to pre-split the coding block A i According to K i splitting modes to respectively perform splitting to determine the target splitting mode. Only by using K i splitting modes among the K i1 splitting modes to make a decision to eliminate K i splitting modes among the K i2 splitting modes, so as to obtain K i3 splitting modes, and then directly determine the target splitting mode B i3 from the K i splitting modes. That is to say, there is no need to traverse all the splitting modes among the K i splitting modes to determine the target splitting mode B i , which improves the efficiency of determining the target splitting mode in each splitting, and thus also improves the efficiency of determining the final splitting mode of the target coding block, and also improves the overall coding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0024] Figure 1 Schematic diagram of a splitting mode provided by an embodiment of the present application;

[0025] Figure 2 Schematic flowchart of a method for making a decision on a coding block splitting mode provided by an embodiment of the present application;

[0026] Figure 3 Schematic diagram of a decision on a coding block splitting mode provided by an embodiment of the present application;

[0027] Figure 4 Schematic diagram of obtaining the final splitting mode of a target coding block based on the target splitting mode corresponding to each splitting depth among multiple splitting depths provided by an embodiment of the present application;

[0028] Figure 5 Block diagram of the functional units of a device for making a decision on a coding block splitting mode provided by an embodiment of the present application;

[0029] Figure 6A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without making creative efforts fall within the scope of protection of the present application.

[0031] The terms "first", "second", "third", "fourth", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.

[0032] Referring to "embodiments" herein means that a particular feature, result or characteristic described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0033] For the convenience of understanding the embodiments of the present application, the relevant terms involved in the present application will be first explained and described:

[0034] Partition mode: There are differences in the types of partition modes of coding blocks corresponding to different video coding standards. For example, the partition modes in the Audio Video coding Standard (AVS) include quadtree partition, binary tree partition, etc., and the partition modes in the Versatile Video Coding (VCC) include quadtree partition, nested multi-type tree recursion, etc. The coding block partition mode decision method provided in this application is applicable to the video coding standards mentioned above and those not mentioned. All embodiments of this application are mainly described by taking the AV1 video coding standard as an example. For the application of other video coding standards, appropriate adjustments can be made based on the embodiments of this application. In the AV1 video coding standard, all types of its corresponding partition modes include: the first partition mode, the second partition mode, the third partition mode, the fourth partition mode, the fifth partition mode, the sixth partition mode, the seventh partition mode, and the eighth partition mode; among them, the first partition mode means dividing the coding block into multiple sub-coding blocks with the same size and square shape, the second partition mode means not dividing the coding block, the third partition mode means horizontally dividing the coding block into C1 sub-coding blocks with the same size and rectangular shape, the fourth partition mode means vertically dividing the coding block into C1 sub-coding blocks with the same size and rectangular shape, the fifth partition mode means performing a vertical T-shaped partition on the coding block, the sixth partition mode means performing a horizontal T-shaped partition on the coding block, the seventh partition mode means horizontally dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape, and the eighth partition mode means vertically dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape.

[0035] Exemplarily, refer to Figure 1 , Figure 1 which is a schematic diagram of a partition mode provided by an embodiment of this application. As Figure 1 shown, assume that a coding block with a size of N*N is given, and the multiple partition modes corresponding to this N*N coding block are exactly all the partition modes in the above AV1 video coding standard; as Figure 1As shown, at this time, the first splitting mode splits the N*N coded block into 4 sub-coded blocks with the same size and square shape (the size of each sub-coded block is N / 2*N / 2); the second splitting mode does not split the N*N coded block, so the obtained size is still N*N; the third splitting mode splits the N*N coded block horizontally into 2 (i.e., at this time C1 = 2) sub-coded blocks with the same size and rectangular shape (the size of each sub-coded block is N*N / 2); the fourth splitting mode splits the N*N coded block vertically into 2 (i.e., at this time C1 = 2) sub-coded blocks with the same size and rectangular shape (the size of each sub-coded block is N / 2*N); the fifth splitting mode means performing a vertical T-shaped split on the N*N coded block, and its forms are Figure 1 the two corresponding to the dashed boxes; the sixth splitting mode means performing a horizontal T-shaped split on the N*N coded block, and its forms are Figure 1 the two corresponding to the dashed boxes; the seventh splitting mode splits the N*N coded block horizontally into 4 (i.e., at this time C2 = 4) sub-coded blocks with the same size and rectangular shape (the size of each sub-coded block is N*N / 4); the eighth splitting mode splits the N*N coded block vertically into 4 (i.e., at this time C2 = 4) sub-coded blocks with the same size and rectangular shape (the size of each sub-coded block is N / 4*N).

[0036] Size of the coded block: The types of the sizes of the coded blocks corresponding to different video coding standards also vary. For example, in the AV1 video coding standard, the coded block has a maximum size (which can also be called the maximum macroblock size, 32R*32R) and a minimum size (i.e., the first preset size in this application, assumed to be R*R, where R is a positive integer), and there are also sizes of 2R*2R, 4R*4R, and so on.

[0037] Splitting depth: Also known as the partitioning depth depth, the splitting depth is an integer (expressed as 0, 1, 2, 3...). For example, when the splitting depth is 0, it means depth = 0, which can be understood as the first layer / first split of the target coded block in this application. When the splitting depth is 1, it means depth = 1, which can be understood as splitting a certain coded block with a splitting depth of 0, or as the second layer / second split of the target coded block. Similarly for the subsequent cases. The specific schematic diagram can be referred to Figure 3 or Figure 4 .

[0038] Refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for making a decision on the coded block splitting mode provided by an embodiment of this application. The method includes but is not limited to steps 201-206:

[0039] 201: Obtain the target coded block.

[0040] In an embodiment of the present application, the target coding block is any one of a plurality of candidate coding blocks, and the plurality of candidate coding blocks are obtained by dividing a video frame or an image frame according to a first size, and the first size is M*M. The shape of each corresponding candidate coding block is square. That is to say, when encoding a video frame or an image frame, a video frame or an image frame is divided into a plurality of square image blocks (i.e., the above-mentioned plurality of candidate coding blocks) based on the first size, and then the final segmentation method is determined for each image block according to the embodiment of the present application. Furthermore, each image block can be encoded based on the final segmentation method corresponding to each image block, or it can be understood that a video frame or an image frame is encoded according to the final segmentation method of each image block; it should be noted that in different video coding standards, for example, in the AV1 coding standard, the first size can be any one of the size types other than the smallest size in the coding standard, and for different video coding standards, the selectivity of the corresponding first size is also different. Determining which size in the coding standard the first size specifically is is determined according to actual requirements, and the present application does not make any limitations.

[0041] 202: In the first segmentation depth, based on coding block A i and the K i segmentation modes corresponding to coding block A i among the K i1 segmentation modes, K i segmentation modes among the K i2 segmentation modes are eliminated to obtain K i3 segmentation modes corresponding to the first segmentation depth.

[0042] In an embodiment of the present application, the K i1 segmentation modes include a first segmentation mode, and the first segmentation mode means dividing the coding block into a plurality of sub-coding blocks with the same size and square shape. The first segmentation depth is i, and i is an integer. When i = 0, coding block A i is the target coding block. When i > 0, coding block A i is any one of the plurality of sub-coding blocks obtained by performing segmentation in the second segmentation depth using the first segmentation mode. The second segmentation depth is i - 1, K i = K i2 + K i3 , and K i , K i1 , K i2 , and K i3 are all integers.

[0043] In addition, for coding blocks A i of different sizes, the corresponding K iThe splitting modes may be the same or different, depending on the coding block A i 's size. For example, in the AV1 video coding standard, if the coding block A i 's size is the maximum macroblock size in this standard, or in other words, if the coding block A i 's size is the second preset size in this application, then the corresponding K i splitting modes only include the above-mentioned first splitting mode, second splitting mode, third splitting mode, fourth splitting mode, fifth splitting mode, and sixth splitting mode. Similarly, if the coding block A i 's size is not the maximum macroblock size in this standard, or in other words, if the coding block A i 's size is not the second preset size in this application, then in principle, the corresponding K i splitting modes include the above-mentioned first splitting mode, second splitting mode, third splitting mode, fourth splitting mode, fifth splitting mode, sixth splitting mode, seventh splitting mode, and eighth splitting mode. However, it should be noted that there is an exception. If the coding block A i 's size is twice the minimum size (i.e., 2R*2R), or in other words, if the coding block A i 's size is twice the first preset size in this application, then the corresponding K i splitting modes only include the above-mentioned first splitting mode, second splitting mode, third splitting mode, and fourth splitting mode.

[0044] Therefore, in an optional embodiment of this application, step 202 specifically includes:

[0045] First, obtain the K i splitting modes corresponding to the coding block A i ; then, determine the rate-distortion cost corresponding to each splitting mode when the coding block A i is split in the K i splitting modes, where the K i1 splitting modes also include the second splitting mode, third splitting mode, and fourth splitting mode. The second splitting mode means not splitting the coding block, the third splitting mode means horizontally splitting the coding block into C1 sub-coding blocks with the same size and rectangular shape, and the fourth splitting mode means vertically splitting the coding block into C1 sub-coding blocks with the same size and rectangular shape, where C1 is a positive integer. Therefore, exemplarily, determine the coding block A i1 i ​The first rate-distortion cost corresponding to segmentation in the first segmentation mode, the second rate-distortion cost corresponding to segmentation in the second segmentation mode, the third rate-distortion cost corresponding to segmentation in the third segmentation mode, and the fourth rate-distortion cost corresponding to segmentation in the fourth segmentation mode. Exemplarily, the principle of determining the rate-distortion cost can be: before encoding or during the encoding process, the encoding end pre-determines the code rate, original pixels, and predicted pixels (which can be understood as reconstructed pixels, and the specific principle can refer to intra prediction. Since in the video encoding process, adjacent encoding (blocks) usually have correlations, that is, spatial correlations, the pixels of the currently to-be-encoded encoding block are predicted using the already-encoded encoding blocks. For example, the average of the pixel values in the horizontal and vertical directions corresponding to the current encoding block is used as the predicted value of the pixels of the current encoding block), and then the sum of squared errors (SSE), also known as pixel distortion, is obtained based on the original pixels and predicted pixels of the current encoding block. For example, if the original pixels and predicted pixels of the current encoding block refer to the pixels corresponding to each pixel point, then the difference between the original pixels and predicted pixels corresponding to each pixel point is calculated and then squared and summed to obtain the pixel distortion corresponding to the current encoding block. Of course, if there are multiple sub-blocks after the current encoding block is segmented, the pixel distortion of each sub-block can be calculated in the same way and then summed to obtain the pixel distortion corresponding to the current encoding block. Then, based on the code rate, pixel distortion, and weight coefficient of the current encoding block in the corresponding segmentation mode, the rate-distortion cost corresponding to the current encoding block is determined. Specifically, it can be the sum of the product of the weight coefficient corresponding to the current encoding block and the code rate and the corresponding pixel distortion; finally, based on K i1 the rate-distortion costs corresponding to each of the K i segmentation modes among the K i2 segmentation modes, K i3 segmentation modes are removed to obtain the K i2 segmentation modes corresponding to the first segmentation depth. Specifically, based on the first rate-distortion cost, the second rate-distortion cost, the third rate-distortion cost, and the fourth rate-distortion cost, K i2 segmentation modes are removed to obtain the K i3 segmentation modes corresponding to the first segmentation depth.

[0046] It should be noted that when the size of the target encoding block is the second preset size, that is, when the first size is the second preset size, the second preset size is one of the multiple size types corresponding to a certain video coding standard. If i = 0, then K i2The splitting modes include a fifth splitting mode and a sixth splitting mode; when the size of the target coding block is the second preset size, if i > 0 and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, then the k2 splitting modes include a fifth splitting mode, a sixth splitting mode, a seventh splitting mode, and an eighth splitting mode; when the size of the target coding block is not the second preset size, that is, when the first size is not the second preset size, and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, then K i2 The splitting modes include a fifth splitting mode, a sixth splitting mode, a seventh splitting mode, and an eighth splitting mode; among them, the fifth splitting mode means performing a vertical T-shaped split on the coding block, the sixth splitting mode means performing a horizontal T-shaped split on the coding block, the seventh splitting mode means horizontally dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape, and the eighth splitting mode means vertically dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape, where C2 is a positive integer and C2 ≠ C1.

[0047] Therefore, when the size of the target coding block is the second preset size, based on the first rate distortion cost, the second rate distortion cost, the third rate distortion cost, and the fourth rate distortion cost, the above-mentioned i2 K splitting modes are eliminated to obtain the K i3 splitting modes corresponding to the first splitting depth, specifically including:

[0048] When i = 0, if the third rate distortion cost is greater than the first product or the second product, the fifth splitting mode is eliminated, and if the fourth rate distortion cost is greater than the first product or the third product, the sixth splitting mode is eliminated, to obtain the K i3 splitting modes corresponding to the first splitting depth. That is to say, when the size of the target coding block is the second preset size and i = 0, if the third rate distortion cost is greater than the first product or the second product, and the fourth rate distortion cost is greater than the first product or the third product, then the fifth splitting mode and the sixth splitting mode should be eliminated correspondingly. At this time, the K i3 splitting modes are the remaining splitting modes after eliminating the fifth splitting mode and the sixth splitting mode in the K i splitting modes. Among them, the first preset size and the second preset size are different, the first product is the product of the first preset coefficient and the first rate distortion cost, the second product is the product of the second preset coefficient and the fourth rate distortion cost, and the third product is the product of the second preset coefficient and the first rate distortion cost;

[0049] When i > 0 and the size of any sub - coding block obtained by using the first splitting mode at the first splitting depth is greater than the first preset size, if the third rate - distortion cost is greater than the first product or the second product, the fifth splitting mode and the seventh splitting mode are excluded, and if the fourth rate - distortion cost is greater than the first product or the third product, the sixth splitting mode and the eighth splitting mode are excluded, to obtain K splitting modes corresponding to the first splitting depth. That is to say, when the size of the target coding block is the second preset size, i > 0, and the size of any sub - coding block obtained by using the first splitting mode at the first splitting depth is greater than the first preset size, if the third rate - distortion cost is greater than the first product or the second product, and the fourth rate - distortion cost is greater than the first product or the third product, then the fifth splitting mode, the sixth splitting mode, the seventh splitting mode, and the eighth splitting mode should be excluded correspondingly. At this time, the K splitting modes obtained are the remaining splitting modes after excluding the fifth splitting mode, the sixth splitting mode, the seventh splitting mode, and the eighth splitting mode from the K splitting modes. i3 It should be noted that the multiple sub - coding blocks obtained by using the first splitting mode at the first splitting depth include a second sub - coding block, a third sub - coding block, a fourth sub - coding block, and a fifth sub - coding block. Among them, the second sub - coding block and the third sub - coding block are respectively above the fourth sub - coding block and the fifth sub - coding block, and the third sub - coding block and the fifth sub - coding block are respectively on the right side of the second sub - coding block and the fourth sub - coding block. i3 Therefore, further, when the size of the target coding block is the second preset size and i = 0, if the third rate - distortion cost is less than the first product or the second product, then based on the original pixels and predicted pixels of the multiple sub - coding blocks obtained by using the first splitting mode at the first splitting depth, the fifth splitting mode is excluded. Exemplarily, determine the fifth rate - distortion cost, the sixth rate - distortion cost, the seventh rate - distortion cost, and the eighth rate - distortion cost corresponding to the second sub - coding block, the third sub - coding block, the fourth sub - coding block, and the fifth sub - coding block respectively; based on the original pixels and predicted pixels of the second sub - coding block, the third sub - coding block, the fourth sub - coding block, and the fifth sub - coding block, determine the corresponding first pixel distortion, second pixel distortion, third pixel distortion, and fourth pixel distortion respectively; determine the first difference between the first pixel distortion and the second pixel distortion; determine the second difference between the third pixel distortion and the fourth pixel distortion; based on the first initial threshold, the first difference, and the second difference, determine the first target threshold, where the first target threshold can be obtained through formula (1): i The K splitting modes obtained are the remaining splitting modes after excluding the fifth splitting mode, the sixth splitting mode, the seventh splitting mode, and the eighth splitting mode from the K splitting modes.

[0050] It should be noted that the multiple sub - coding blocks obtained by using the first splitting mode at the first splitting depth include a second sub - coding block, a third sub - coding block, a fourth sub - coding block, and a fifth sub - coding block. Among them, the second sub - coding block and the third sub - coding block are respectively above the fourth sub - coding block and the fifth sub - coding block, and the third sub - coding block and the fifth sub - coding block are respectively on the right side of the second sub - coding block and the fourth sub - coding block.

[0051] Therefore, further, when the size of the target coding block is the second preset size and i = 0, if the third rate - distortion cost is less than the first product or the second product, then based on the original pixels and predicted pixels of the multiple sub - coding blocks obtained by using the first splitting mode at the first splitting depth, the fifth splitting mode is excluded. Exemplarily, determine the fifth rate - distortion cost, the sixth rate - distortion cost, the seventh rate - distortion cost, and the eighth rate - distortion cost corresponding to the second sub - coding block, the third sub - coding block, the fourth sub - coding block, and the fifth sub - coding block respectively; based on the original pixels and predicted pixels of the second sub - coding block, the third sub - coding block, the fourth sub - coding block, and the fifth sub - coding block, determine the corresponding first pixel distortion, second pixel distortion, third pixel distortion, and fourth pixel distortion respectively; determine the first difference between the first pixel distortion and the second pixel distortion; determine the second difference between the third pixel distortion and the fourth pixel distortion; based on the first initial threshold, the first difference, and the second difference, determine the first target threshold, where the first target threshold can be obtained through formula (1):

[0052]

[0053] Among them, TH1 is the first target threshold, and TH1 init is the first initial threshold, ABS is the absolute value function, Min is the minimum value function, q0 is the first pixel distortion, q1 is the second pixel distortion, q2 is the third pixel distortion, q3 is the fourth pixel distortion, (q0 - q1) is the first difference, and (q2 - q3) is the second difference.

[0054] Finally, based on the first target threshold, the fifth rate - distortion cost, the sixth rate - distortion cost, the seventh rate - distortion cost, and the eighth rate - distortion cost, the fifth segmentation mode is eliminated. Specifically: The fifth rate - distortion cost and the sixth rate - distortion cost are summed to obtain a first value; the seventh rate - distortion cost and the eighth rate - distortion cost are summed to obtain a second value; based on the first value and the second value, a first prediction value is determined; if the first prediction value is less than the first target threshold, the fifth segmentation mode is eliminated. Among them, the first prediction value can be obtained through formula (2):

[0055]

[0056] Among them, P1 is the first prediction value, ABS is the absolute value function, Min is the minimum value function, d0 is the fifth rate - distortion cost, d1 is the sixth rate - distortion cost, d2 is the seventh rate - distortion cost, d3 is the eighth rate - distortion cost, (d0 + d1) is the first value, and (d2 + d3) is the second value.

[0057] In an alternative embodiment, when the size of the target coding block is the second preset size, i > 0, and the size of any sub - coding block obtained by using the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate - distortion cost is less than the first product or the second product, then based on the original pixels and predicted pixels of the multiple sub - coding blocks obtained by using the first segmentation mode at the first segmentation depth, the fifth segmentation mode and the seventh segmentation mode can be eliminated. It should be noted that the principle of eliminating the fifth segmentation mode and the seventh segmentation mode based on the original pixels and predicted pixels of the multiple sub - coding blocks obtained by using the first segmentation mode at the first segmentation depth is similar to the principle of eliminating the fifth segmentation mode based on the original pixels and predicted pixels of the multiple sub - coding blocks obtained by using the first segmentation mode at the first segmentation depth, and will not be elaborated here.

[0058] In an alternative embodiment, when the size of the target coding block is the second preset size and i = 0, if the fourth rate-distortion cost is less than the first product or the third product, then based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by using the first splitting mode at the first splitting depth, the sixth splitting mode is excluded. Exemplarily, a third difference between the first pixel distortion and the third pixel distortion is determined; a fourth difference between the second pixel distortion and the fourth pixel distortion is determined; based on the second initial threshold, the third difference, and the fourth difference, a second target threshold is determined, where the second target threshold can be obtained by formula (3):

[0059]

[0060] where TH2 is the second target threshold, TH2 init is the second initial threshold, ABS is the absolute value function, Min is the minimum value function, q0 is the first pixel distortion, q1 is the second pixel distortion, q2 is the third pixel distortion, q3 is the fourth pixel distortion, (q0 - q2) is the third difference, and (q1 - q3) is the fourth difference.

[0061] Finally, based on the second target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, the sixth splitting mode is excluded. Specifically: the fifth rate-distortion cost and the seventh rate-distortion cost are summed to obtain a third value; the sixth rate-distortion cost and the eighth rate-distortion cost are summed to obtain a fourth value; based on the third value and the fourth value, a second predicted value is determined; if the second predicted value is less than the second target threshold, the sixth splitting mode is excluded, where the second predicted value can be obtained by formula (4):

[0062]

[0063] where P2 is the second predicted value, ABS is the absolute value function, Min is the minimum value function, d0 is the fifth rate-distortion cost, d1 is the sixth rate-distortion cost, d2 is the seventh rate-distortion cost, d3 is the eighth rate-distortion cost, (d0 + d2) is the third value, and (d1 + d3) is the fourth value.

[0064] In an alternative embodiment, when the size of the target coding block is the second preset size, i>0, and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, if the fourth rate distortion cost is less than the first product or the third product, then based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by splitting using the first splitting mode at the first splitting depth, the sixth splitting mode and the eighth splitting mode can be excluded. It should be noted that the principle of excluding the sixth splitting mode and the eighth splitting mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by splitting using the first splitting mode at the first splitting depth is similar to the principle of excluding the sixth splitting mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by splitting using the first splitting mode at the first splitting depth, which will not be elaborated here.

[0065] In an alternative embodiment, when the size of the target coding block is not the second preset size, based on the first rate distortion cost, the second rate distortion cost, the third rate distortion cost, and the fourth rate distortion cost, the following operations are performed on i2 K i3 splitting modes to obtain K

[0066] splitting modes corresponding to the first splitting depth, specifically including: i3 When the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, if the third rate distortion cost is greater than the first product or the second product, the fifth splitting mode and the seventh splitting mode are excluded, and if the fourth rate distortion cost is greater than the first product or the third product, the sixth splitting mode and the eighth splitting mode are excluded, to obtain K

[0067] Further, when the size of the target coding block is not the second preset size and the size of any sub-coding block obtained by performing segmentation in the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate-distortion cost is less than the first product or the second product, then based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth, the fifth segmentation mode and the seventh segmentation mode are eliminated. It should be noted that when the size of the target coding block is not the second preset size, the principle of eliminating the fifth segmentation mode and the seventh segmentation mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth is similar to the principle of eliminating the fifth segmentation mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth when the size of the target coding block is the second preset size, and will not be elaborated here.

[0068] When the size of the target coding block is not the second preset size and the size of any sub-coding block obtained by performing segmentation in the first segmentation mode at the first segmentation depth is greater than the first preset size, if the fourth rate-distortion cost is less than the first product or the third product, then based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth, the sixth segmentation mode and the eighth segmentation mode are eliminated. It should be noted that when the size of the target coding block is not the second preset size, the principle of eliminating the sixth segmentation mode and the eighth segmentation mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth is similar to the principle of eliminating the sixth segmentation mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by performing segmentation in the first segmentation mode at the first segmentation depth when the size of the target coding block is the second preset size, and will not be elaborated here.

[0069] 203: Determine the target segmentation mode B corresponding to the first segmentation depth from K i3 segmentation modes. i .

[0070] Exemplarily, the target segmentation mode B i can be i3 the segmentation mode with the smallest distortion cost corresponding to the K i segmentation modes. This application does not limit the specific judgment conditions for determining the target segmentation mode B.

[0071] 204: Segment the coding block A i based on the target segmentation mode B i to obtain multiple first sub-coding blocks corresponding to the target segmentation mode B i .

[0072] 205: When the target segmentation mode Bi is the first segmentation mode, and the size of any one of the multiple first sub-encoding blocks is greater than the first preset size. At the third segmentation depth, any one of the first sub-encoding blocks is segmented until the target segmentation mode after segmentation at multiple segmentation depths is not the first segmentation mode, or until the size of any one of the multiple sub-encoding blocks obtained by segmentation using the first segmentation mode at multiple segmentation depths is equal to the first preset size.

[0073] wherein, the third segmentation depth is i + 1. That is to say, if the target segmentation mode determined in the third segmentation depth is the first segmentation mode, and the coding block A i After being segmented in the first segmentation mode, the sizes of the multiple sub-encoding blocks with the same size and square shape (i.e., multiple first sub-encoding blocks) are greater than the first preset size (i.e., greater than the minimum size), then any one of the multiple first sub-encoding blocks can be further segmented at the third segmentation depth until the target segmentation mode determined after segmentation at multiple segmentation depths is not the first segmentation mode, and then the segmentation stops; or until the size of any one of the multiple sub-encoding blocks obtained by segmentation using the first segmentation mode at multiple segmentation depths is equal to the first preset size. That is, regardless of whether the target segmentation mode determined after segmentation at multiple segmentation depths is the first segmentation mode or not, as long as the size of any one of the multiple sub-encoding blocks obtained by segmentation using the first segmentation mode is equal to the first preset size, the segmentation stops.

[0074] Exemplarily, based on Figure 1 the schematic diagrams of multiple segmentation modes shown, refer to Figure 3 , Figure 3 is a schematic diagram of a coding block segmentation mode decision provided by an embodiment of the present application. As Figure 3 shown, assume that the size of the target coding block is 8R * 8R, and the segmentation modes corresponding to the 8R * 8R target coding block include Figure 1 the first segmentation mode, the second segmentation mode, the third segmentation mode, the fourth segmentation mode, the fifth segmentation mode, the sixth segmentation mode, the seventh segmentation mode, and the eighth segmentation mode shown; at Figure 3 the first segmentation depth shown (i.e., at this time i = 0, which can be denoted as depth = 0, indicating a depth of 0), the target segmentation mode B1 determined based on the principle of the embodiment of the present application is the first segmentation mode (including 4 sub-encoding blocks with a size of 4R * 4R, that is, Figure 3(referred to by the numbers "11, 12, 13, 14" respectively in the figure); since the target segmentation pattern B1 is the first segmentation pattern, and the size of any one of the 4 sub-encoding blocks with a size of 4R*4R is greater than the first preset size (i.e., R*R), it can be segmented at the third segmentation depth (i.e., at this time i+1 = 1, which can be denoted as depth = 1, indicating a depth of 1). At this time, for any one of the sub-encoding blocks, such as the sub-encoding block referred to by the number "11", the type of its corresponding segmentation pattern is the same as that of the 8R*8R target encoding block. Similarly, the target segmentation pattern B2 determined based on the principle of this embodiment of the application is the first segmentation pattern (including 4 sub-encoding blocks with a size of 2R*2R, that is, Figure 3 (referred to by the numbers "21, 22, 23, 24" respectively in the figure); since the target segmentation pattern B2 is the first segmentation pattern, and the size of any one of the 4 sub-encoding blocks with a size of 2R*2R is greater than the first preset size, it can be segmented at the fourth segmentation depth (i.e., at this time i+2 = 2, which can be denoted as depth = 2, indicating a depth of 2). At this time, for any one of the sub-encoding blocks, such as the sub-encoding block referred to by the number "23", the types of its corresponding segmentation patterns include the first segmentation pattern, the second segmentation pattern, the third segmentation pattern, and the fourth segmentation pattern. In this special case, there is no need to judge whether to exclude the fifth segmentation pattern, the sixth segmentation pattern, the seventh segmentation pattern, and the eighth segmentation pattern. The target segmentation pattern B3 is directly determined from the first segmentation pattern, the second segmentation pattern, the third segmentation pattern, and the fourth segmentation pattern. At this time, the target segmentation pattern B3 is the third segmentation pattern. Since the target segmentation pattern B3 is the third segmentation pattern and not the first segmentation pattern, the segmentation is not continued. Furthermore, since the size of each sub-encoding block in the first segmentation pattern at the fourth segmentation depth is R*R (equal to the first preset size), the segmentation is not continued either.

[0075] 206: Obtain the final segmentation pattern of the target encoding block based on the target segmentation pattern corresponding to each segmentation depth among multiple segmentation depths.

[0076] Exemplarily, after completing the segmentation at multiple segmentation depths, that is, after completing the multi-level segmentation of the target encoding block, the target segmentation patterns determined in each segmentation depth / each layer / each segmentation are combined in place according to the levels, and the final segmentation pattern of the target encoding block is obtained; similarly, the final segmentation patterns of multiple candidate encoding blocks in a frame of video or a frame of image can be determined according to this embodiment of the application. Then, a frame of video or a frame of image is segmented based on the final segmentation pattern corresponding to each candidate encoding block, and then a frame of video or a frame of image is encoded, ensuring the encoding efficiency.

[0077] Exemplarily, based on Figure 1 andFigure 3 Schematic diagram, refer to Figure 4 , Figure 4 Schematic diagram of obtaining the final segmentation mode of the target coding block based on the target segmentation mode corresponding to each segmentation depth among multiple segmentation depths provided by the embodiment of the present application. As Figure 4 shown, the size of the target coding block is 8R*8R. When performing segmentation at the first segmentation depth (i.e., at this time i = 0, which can be denoted as depth = 0, indicating a depth of 0), the determined target segmentation mode of 8R*8R is the first segmentation mode (including 4 sub-coding blocks with a size of 4R*4R, respectively referred to by the numbers "11, 12, 13, 14"); thus, when performing segmentation at the third segmentation depth (i.e., at this time i + 1 = 1, which can be denoted as depth = 1, indicating a depth of 1), the determined target segmentation mode of the sub-coding block referred to by "11" is the first segmentation mode (including 4 sub-coding blocks with a size of 2R*2R, respectively referred to by the numbers "21, 22, 23, 24"), the determined target segmentation mode of the sub-coding block referred to by "12" is the fifth segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "13" is the third segmentation mode, and the determined target segmentation mode of the sub-coding block referred to by "14" is the first segmentation mode (including 4 sub-coding blocks with a size of 2R*2R, respectively referred to by the numbers "25, 26, 27, 28"); thus, when performing segmentation at the fourth segmentation depth (i.e., at this time i + 2 = 2, which can be denoted as depth = 2, indicating a depth of 2), the determined target segmentation mode of the sub-coding block referred to by "21" is the second segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "22" is the fifth segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "23" is the third segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "24" is the second segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "25" is the eighth segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "26" is the sixth segmentation mode, the determined target segmentation mode of the sub-coding block referred to by "27" is the second segmentation mode, and the determined target segmentation mode of the sub-coding block referred to by "28" is the second segmentation mode; finally, the target segmentation modes determined by performing segmentation at each segmentation depth are sorted layer by layer to obtain the final segmentation mode of the target coding block.

[0078] It can be seen that in the embodiment of the present application, after obtaining the target coding block, the target coding block needs to be segmented. Among them, at the first segmentation depth, based on coding block A i , and coding block A i corresponding K i types of segmentation modes among the K i1 types of segmentation modes, for the K i types of segmentation modes among the K i2The segmentation modes are eliminated to obtain the K corresponding to the first segmentation depth. i3 A segmentation mode, where when i = 0, the coding block A i is the target coding block, when i>0, coding block A i Any one of the multiple sub-coding blocks obtained by segmentation using the first segmentation mode when the second segmentation depth is used; then i3 Determine the target segmentation mode B corresponding to the first segmentation depth from the segmentation modes i ; Then based on the target segmentation mode B i For the coding block A i Segmentation is performed to obtain the target segmentation mode B i Corresponding multiple first sub-coding blocks; when the target segmentation mode B i is the first segmentation mode, and the size of any one of the plurality of first sub-coding blocks is greater than the first preset size, performing the i+1th segmentation on any one of the first sub-coding blocks at the third segmentation depth until the target segmentation mode after segmentation at the plurality of segmentation depths is not the first segmentation mode, or the size of any one of the plurality of sub-coding blocks obtained by segmentation using the first segmentation mode after segmentation at the plurality of segmentation depths is equal to the first preset size; based on the target segmentation mode corresponding to each segmentation depth in the plurality of segmentation depths, obtaining the final segmentation mode of the target coding block, that is, the segmentation of the target coding block is based on the K corresponding to each segmentation. i The target coding block is divided into multiple segments by using a segmentation mode (and the first segmentation depth is any sub-coding block obtained by segmentation using the first segmentation mode when the second segmentation depth is determined, and the segmentation is hierarchical). In this application, the coding block A is not required to be segmented in advance at each segmentation. i According to K i The target segmentation mode is determined by segmenting the target segmentation mode separately. i K in the segmentation mode i1 The segmentation mode is used to decide the removal of K i K in the segmentation mode i2 kinds of segmentation patterns to obtain K i3 segmentation mode, and then directly from K i3 The target segmentation mode B is determined from the segmentation modes i , that is to say, there is no need to traverse K i All the segmentation modes in the segmentation mode are used to determine the target segmentation mode B i, it improves the efficiency of determining the target segmentation mode in each segmentation, thereby also improving the efficiency of determining the final segmentation mode of the target coding block and the overall coding efficiency. Additionally, in the AV1 coding standard, the first segmentation mode, the second segmentation mode, the third segmentation mode, and the fourth segmentation mode have a relatively low impact on the compression performance. That is to say, in the decision-making process of the segmentation mode of the coding block, choosing to skip these four segmentation modes results in a relatively low loss in coding performance, i.e., the coding quality loss, which can be ignored in terms of the user's subjective experience. Therefore, in the decision-making process of the segmentation mode of the coding block in this application, by deciding whether to skip the first segmentation mode, the second segmentation mode, the third segmentation mode, and the fourth segmentation mode, instead of traversing these four segmentation modes separately, for example, without calculating the rate-distortion cost of each of these four segmentation modes, it is possible to improve the coding speed while keeping the coding quality loss very small, that is, without affecting the user's subjective experience as much as possible.

[0079] Further, in an alternative embodiment, based on the principles of the above steps 201-206, the final segmentation mode of the target coding block is obtained. Similarly, the final segmentation mode corresponding to each candidate coding block can also be obtained. Then, each candidate coding block can be encoded based on the AV1 coding standard to achieve the encoding of a video frame or an image frame. Here, taking the target coding block as an example, based on the final segmentation mode corresponding to the target coding block, the target coding block can be divided to obtain one or more sub-coding blocks. Then, encoding processes are performed separately for each sub-coding block, including intra-frame prediction, inter-frame prediction, transformation, quantization, entropy coding, loop filtering, etc., so as to obtain the compressed encoded data. For example, based on the pixels of the current coding block minus the predicted pixels corresponding to the current coding block (which can be simply referred to as the pixels of the prediction block), the pixels corresponding to the residual block are obtained; then, the residual block is subjected to a transformation process, such as discrete cosine transform (DCT), discrete sine transform (DST), etc., to obtain the corresponding first transformation coefficients to represent the residual block in the transform domain; then, the corresponding second transformation coefficients are obtained by scalar quantization or vector quantization of the transform coefficients (for example, the quantization degree can be modified by adjusting the quantization parameter to indicate an appropriate quantization step size); then, the second transformation coefficients are inverse quantized to obtain the third transformation coefficients (wherein, the inverse quantization process can use the same quantization step size as in the above quantization process); and the residual block represented by the first transformation coefficients is inverse-transformed to obtain the inverse-transformed residual block; then, the pixels of the inverse-transformed residual block are added to the pixels of the above prediction block to obtain the reconstructed block; then, the reconstructed block is filtered to obtain the reconstructed block after filtering; finally, entropy coding can be performed based on an entropy coding algorithm (such as variable-length coding, arithmetic coding, etc.) to obtain the encoded data (such as a bitstream). It should be noted that since each of the above processing processes includes multiple implementation methods, for example, the intra-frame prediction methods include the directional prediction mode, the recursive filtering mode, the cross-component prediction mode, the smooth prediction mode, etc., the inter-frame prediction includes motion estimation, motion compensation, etc., and the transformation includes DCT transformation, DST transformation, etc., multiple combinations of different methods in each processing process can be used to implement corresponding multiple coding methods. The above coding embodiments are only for illustrative purposes, and the present application is not limited thereto.

[0080] Further, the above encoding process is performed by the encoding end. After sending the encoded data to the decoding end, the decoding end will perform corresponding decoding on the encoded data based on the above encoding principle to obtain decoded data (such as a video frame or an image frame). Specifically: perform entropy decoding on the encoded data to obtain the encoding parameters adopted above (such as the first transform coefficient, the second transform coefficient, the third transform coefficient, etc.), then perform a transform on the inverse transform residual block to obtain a residual block represented by the first transform coefficient, then perform quantization on the third transform coefficient to obtain the second transform coefficient, then perform inverse quantization on the second transform coefficient to obtain the first transform coefficient, then perform an inverse transform on the first transform coefficient to obtain the pixels corresponding to the residual block, and then add the pixels corresponding to the residual block to the pixels of the above prediction block and perform filtering processing to obtain the corresponding decoded data (such as a video frame or an image frame). Similarly, the decoding method shown in this application is only one example, and based on the above, multiple combinations of different methods in each processing process are used to implement corresponding multiple encoding methods, and each encoding method corresponds to a decoding method, which is not specifically limited in this application.

[0081] See Figure 5 , Figure 5 It is a functional unit composition block diagram of an encoding block segmentation mode decision device provided by an embodiment of this application. The encoding block segmentation mode decision device 500 includes: an acquisition unit 501 and a processing unit 502;

[0082] The acquisition unit 501 is used to acquire a target encoding block;

[0083] The processing unit 502 is used to, in the first segmentation depth, based on the encoding block A i and the K i segmentation modes corresponding to the encoding block A i among the K i1 segmentation modes, eliminate K i segmentation modes among the K i2 segmentation modes to obtain K i3 segmentation modes corresponding to the first segmentation depth, where the K i1 segmentation modes include a first segmentation mode, and the first segmentation mode means dividing the encoding block into multiple sub-encoding blocks with the same size and a square shape. The first segmentation depth is i, and i is an integer. When i = 0, the encoding block A i is the target encoding block. When i > 0, the encoding block A i is any one of the multiple sub-encoding blocks obtained by dividing using the first segmentation mode in the second segmentation depth. The second segmentation depth is i - 1, K i = K i2 + K i3 , K i , K i1 , Ki2 , K i3 are all integers;

[0084] The processing unit 502 is further configured to determine a target segmentation mode B corresponding to the first segmentation depth from K i3 segmentation modes; i ;

[0085] The processing unit 502 is further configured to segment the coding block A based on the target segmentation mode B i to obtain a plurality of first sub-coding blocks corresponding to the target segmentation mode B i ; i ;

[0086] When the target segmentation mode B i is the first segmentation mode and the size of any one of the plurality of first sub-coding blocks is greater than the first preset size, the processing unit 502 segments the any one of the first sub-coding blocks at the third segmentation depth until the target segmentation mode after segmentation at multiple segmentation depths is not the first segmentation mode, or the size of any one of the plurality of sub-coding blocks obtained by segmentation using the first segmentation mode after segmentation at multiple segmentation depths is equal to the first preset size, and the third segmentation depth is i + 1;

[0087] The processing unit 502 is further configured to obtain the final segmentation mode of the target coding block based on the target segmentation mode corresponding to each segmentation depth among the multiple segmentation depths.

[0088] In an embodiment of the present application, in terms of eliminating K i segmentation modes from the K i segmentation modes corresponding to the coding block A and obtaining K i segmentation modes corresponding to the first segmentation depth, the processing unit 502 is specifically configured to: i1 K i K i2 K i3 segmentation modes corresponding to the first segmentation depth, the processing unit 502 is specifically configured to:

[0089] Obtain K i segmentation modes corresponding to the coding block A i ;

[0090] Determine the rate-distortion cost corresponding to each of the K i segmentation modes when the coding block A is segmented in each of the K i segmentation modes; i1 ;

[0091] Based on the rate-distortion cost corresponding to each of the K i1 segmentation modes, for the Ki K in a segmentation mode i2 Eliminate K segmentation modes to obtain K segmentation modes corresponding to the first segmentation depth i3 segmentation modes.

[0092] In an embodiment of the present application, the K i1 segmentation modes further include a second segmentation mode, a third segmentation mode, and a fourth segmentation mode. The second segmentation mode means that the coding block is not segmented. The third segmentation mode means that the coding block is horizontally segmented into C1 sub-coding blocks of the same size and rectangular shape. The fourth segmentation mode means that the coding block is vertically segmented into C1 sub-coding blocks of the same size and rectangular shape, where C1 is a positive integer; when determining the coding block A i With K i K in a segmentation mode i1 In terms of the rate-distortion cost corresponding to each segmentation mode in the K segmentation modes, the processing unit 502 is specifically configured to:

[0093] Determine the coding block A i The first rate-distortion cost corresponding to segmentation in the first segmentation mode, the second rate-distortion cost corresponding to segmentation in the second segmentation mode, the third rate-distortion cost corresponding to segmentation in the third segmentation mode, and the fourth rate-distortion cost corresponding to segmentation in the fourth segmentation mode;

[0094] Based on the rate-distortion cost corresponding to each segmentation mode in the K i1 segmentation modes, for the K i K in a segmentation mode i2 segmentation modes, eliminate the K i3 segmentation modes to obtain K segmentation modes corresponding to the first segmentation depth. In this regard, the processing unit 502 is specifically configured to:

[0095] Based on the first rate-distortion cost, the second rate-distortion cost, the third rate-distortion cost, and the fourth rate-distortion cost, eliminate the K i2 segmentation modes to obtain K segmentation modes corresponding to the first segmentation depth i3 segmentation modes.

[0096] In an embodiment of the present application, when the size of the target coding block is the second preset size, if i = 0, then K i2The splitting modes include a fifth splitting mode and a sixth splitting mode. If i > 0 and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, then the k2 splitting modes include a fifth splitting mode, a sixth splitting mode, a seventh splitting mode, and an eighth splitting mode; when the size of the target coding block is not the second preset size and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, then K i2 The splitting modes include a fifth splitting mode, a sixth splitting mode, a seventh splitting mode, and an eighth splitting mode; among them, the fifth splitting mode represents a vertical T-shaped splitting of the coding block, the sixth splitting mode represents a horizontal T-shaped splitting of the coding block, the seventh splitting mode represents horizontally dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape, and the eighth splitting mode represents vertically dividing the coding block into C2 sub-coding blocks with the same size and rectangular shape, where C2 is a positive integer and C2 ≠ C1.

[0097] In an embodiment of the present application, when the size of the target coding block is the second preset size, based on the first rate-distortion cost, the second rate-distortion cost, the third rate-distortion cost, and the fourth rate-distortion cost, for K i2 the splitting modes are eliminated to obtain the K i3 splitting modes corresponding to the first splitting depth. The processing unit 502 is specifically used for:

[0098] When i = 0, if the third rate-distortion cost is greater than the first product or the second product, the fifth splitting mode is eliminated, and if the fourth rate-distortion cost is greater than the first product or the third product, the sixth splitting mode is eliminated, to obtain the K i3 splitting modes corresponding to the first splitting depth;

[0099] When i > 0 and the size of any sub-coding block obtained by splitting using the first splitting mode at the first splitting depth is greater than the first preset size, if the third rate-distortion cost is greater than the first product or the second product, the fifth splitting mode and the seventh splitting mode are eliminated, and if the fourth rate-distortion cost is greater than the first product or the third product, the sixth splitting mode and the eighth splitting mode are eliminated, to obtain the K i3 splitting modes corresponding to the first splitting depth;

[0100] Among them, the first product is the product of the first preset coefficient and the first rate-distortion cost, the second product is the product of the second preset coefficient and the fourth rate-distortion cost, and the third product is the product of the second preset coefficient and the first rate-distortion cost.

[0101] In an embodiment of the present application, the processing unit 502 is specifically used for:

[0102] When i = 0, if the third rate-distortion cost is less than the first product or the second product, based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, the fifth segmentation mode is eliminated.

[0103] When i > 0 and the size of any one of the sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate-distortion cost is less than the first product or the second product, based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, the fifth segmentation mode and the seventh segmentation mode are eliminated.

[0104] In an embodiment of the present application, the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth include a second sub-encoding block, a third sub-encoding block, a fourth sub-encoding block, and a fifth sub-encoding block. Among them, the second sub-encoding block and the third sub-encoding block are respectively above the fourth sub-encoding block and the fifth sub-encoding block, and the third sub-encoding block and the fifth sub-encoding block are respectively on the right side of the second sub-encoding block and the fourth sub-encoding block; in terms of eliminating the fifth segmentation mode based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, the processing unit 502 is specifically configured to:

[0105] Determine the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost corresponding to the second sub-encoding block, the third sub-encoding block, the fourth sub-encoding block, and the fifth sub-encoding block respectively;

[0106] Based on the original pixels and predicted pixels of the second sub-encoding block, the original pixels and predicted pixels of the third sub-encoding block, the original pixels and predicted pixels of the fourth sub-encoding block, and the original pixels and predicted pixels of the fifth sub-encoding block, determine the corresponding first pixel distortion, second pixel distortion, third pixel distortion, and fourth pixel distortion respectively;

[0107] Determine the first difference between the first pixel distortion and the second pixel distortion;

[0108] Determine the second difference between the third pixel distortion and the fourth pixel distortion;

[0109] Based on the first initial threshold, the first difference, and the second difference, determine the first target threshold;

[0110] Based on the first target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, eliminate the fifth segmentation mode.

[0111] In an embodiment of the present application, in terms of eliminating the fifth segmentation mode based on the first target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, the processing unit 502 is specifically configured to:

[0112] Sum the fifth rate-distortion cost and the sixth rate-distortion cost to obtain a first value;

[0113] Sum the seventh rate-distortion cost and the eighth rate-distortion cost to obtain a second value;

[0114] Determine a first predicted value based on the first value and the second value;

[0115] If the first predicted value is less than the first target threshold, eliminate the fifth segmentation mode.

[0116] In an embodiment of the present application, the processing unit 502 is specifically configured to:

[0117] When i = 0, if the fourth rate-distortion cost is less than the first product or the third product, based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, eliminate the sixth segmentation mode;

[0118] When i > 0 and the size of any one of the sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth is greater than the first preset size, if the fourth rate-distortion cost is less than the first product or the third product, based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, eliminate the sixth segmentation mode and the eighth segmentation mode.

[0119] In an embodiment of the present application, in terms of eliminating the sixth segmentation mode based on the original pixels and predicted pixels of the multiple sub-encoding blocks obtained by performing segmentation using the first segmentation mode at the first segmentation depth, the processing unit 502 is specifically configured to:

[0120] Determine a third difference between the first pixel distortion and the third pixel distortion;

[0121] Determine a fourth difference between the second pixel distortion and the fourth pixel distortion;

[0122] Determine a second target threshold based on the second initial threshold, the third difference, and the fourth difference;

[0123] Based on the second target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, eliminate the sixth segmentation mode.

[0124] In an embodiment of the present application, in terms of eliminating the sixth segmentation mode based on the second target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, the processing unit 502 is specifically configured to: sum the fifth rate-distortion cost and the seventh rate-distortion cost to obtain a third value;

[0125] sum the sixth rate-distortion cost and the eighth rate-distortion cost to obtain a fourth value;

[0126] determine a second predicted value based on the third value and the fourth value;

[0127] if the second predicted value is less than the second target threshold, eliminate the sixth segmentation mode.

[0128] In a specific implementation, the obtaining unit 501 and the processing unit 502 described in the embodiments of the present invention may implement other implementation manners described in the encoding block segmentation mode decision method provided by the embodiments of the present invention, which will not be elaborated herein.

[0129] Refer to Figure 6 , Figure 6 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 6 shown, the electronic device 600 includes a transceiver 601, a processor 602, and a memory 603. They are connected through a bus 604. The memory 603 is used to store computer programs and data, and can transmit the data stored in the memory 603 to the processor 602.

[0130] The processor 602 is configured to read the computer program in the memory 603 and perform the following operations:

[0131] control the transceiver 601 to obtain a target coding block;

[0132] In the first segmentation depth, based on the coding block A i , and the K i types of segmentation modes corresponding to the coding block A i among the K i1 types of segmentation modes, eliminate the K i types of segmentation modes among the K i2 types of segmentation modes to obtain the K i3 types of segmentation modes corresponding to the first segmentation depth, where the K i1 types of segmentation modes include a first segmentation mode, and the first segmentation mode means dividing the coding block into multiple sub-coding blocks with the same size and a square shape. The first segmentation depth is i, and i is an integer. When i = 0, the coding block A i is the target coding block. When i > 0, the coding block A iAny one of the multiple sub - coded blocks obtained by dividing using the first division mode when the second division depth is reached. The second division depth is i - 1, and K i = K i2 + K i3 , K i , K i1 , K i2 , K i3 are all integers;

[0133] Determine the target division mode B corresponding to the first division depth from K i3 types of division modes; i ;

[0134] Based on the target division mode B i divide the coded block A i to obtain multiple first sub - coded blocks corresponding to the target division mode B i ;

[0135] When the target division mode B i is the first division mode, and the size of any one of the multiple first sub - coded blocks is greater than the first preset size, divide any one of the first sub - coded blocks at the third division depth until the target division mode after division at multiple division depths is not the first division mode, or the size of any one of the multiple sub - coded blocks obtained by dividing using the first division mode after division at multiple division depths is equal to the first preset size;

[0136] Based on the target division mode corresponding to each division depth among multiple division depths, obtain the final division mode of the target coded block.

[0137] In a specific implementation, the transceiver 601, the processor 602, and the memory 603 described in the embodiments of the present invention may respectively correspond to other implementation manners described in the coded - block division - mode decision method provided by the embodiments of the present invention, which will not be elaborated here.

[0138] Specifically, the above - mentioned transceiver 601 may be Figure 5 the acquisition unit 501 of the coded - block division - mode decision device 500 in the embodiments of Figure 5 and the above - mentioned processor 602 may be the processing unit 502 of the coded - block division - mode decision device 500 in the embodiments of

[0139] It should be understood that the electronic devices in this application may include smartphones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, handheld computers, laptop computers, Mobile Internet Devices (MID), or wearable devices, etc. The above-mentioned electronic devices are only examples, not exhaustive, including but not limited to the above-mentioned electronic devices. In practical applications, the above-mentioned electronic devices may also include: intelligent vehicle terminals, computer devices, and so on.

[0140] The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement some or all of the steps of any one of the coding block segmentation mode decision methods described in the above method embodiments.

[0141] The embodiments of the present application also provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps of any one of the coding block segmentation mode decision methods described in the above method embodiments.

[0142] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0143] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0144] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.

[0145] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of these units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In addition, in each embodiment of this application, each functional unit can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software program modules.

[0147] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of this application. The aforementioned memory includes: USB flash drives, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs and other media that can store program codes.

[0148] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memory (abbreviation: ROM), random access memory (abbreviation: RAM), magnetic disks, or optical discs, etc.

[0149] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A coding block splitting mode decision method, characterized in that, The method includes: Obtaining a target coding block; In the first segmentation depth, based on the coding block A i , and the coding block A i The corresponding K i K in the segmentation mode i1 The K i K in the segmentation mode i2 The segmentation modes are eliminated to obtain K corresponding to the first segmentation depth. i3 A segmentation mode specifically includes: when the size of the target coding block is the second preset size, when i=0, if the third rate-distortion cost corresponding to the third segmentation mode is greater than the first product or the second product, the fifth segmentation mode is eliminated, and if the fourth rate-distortion cost corresponding to the fourth segmentation mode is greater than the first product or the third product, the sixth segmentation mode is eliminated; when i>0, and the size of any sub-coding block obtained by segmenting with the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate-distortion cost is greater than the first product or the second product, the fifth segmentation mode and the seventh segmentation mode are eliminated, and if the fourth rate-distortion cost is greater than the first product or the third product, the sixth segmentation mode and the eighth segmentation mode are eliminated, and K corresponding to the first segmentation depth is obtained. i3 a segmentation mode; the first product is the product of the first preset coefficient and the first rate-distortion cost corresponding to the first segmentation mode, the second product is the product of the second preset coefficient and the fourth rate-distortion cost, and the third product is the product of the second preset coefficient and the first rate-distortion cost; wherein the K i1 The segmentation modes include a first segmentation mode, wherein the K i2 The segmentation modes include a fifth segmentation mode, a sixth segmentation mode, a seventh segmentation mode and an eighth segmentation mode, wherein the first segmentation mode indicates that the coding block is divided into a plurality of sub-coding blocks of the same size and a square shape, the third segmentation mode indicates that the coding block is horizontally divided into C1 sub-coding blocks of the same size and a rectangular shape, the fourth segmentation mode indicates that the coding block is vertically divided into C1 sub-coding blocks of the same size and a rectangular shape, the fifth segmentation mode indicates that the coding block is vertically divided into a T-shaped segmentation, the sixth segmentation mode indicates that the coding block is horizontally divided into a T-shaped segmentation, the seventh segmentation mode indicates that the coding block is horizontally divided into C2 sub-coding blocks of the same size and a rectangular shape, the eighth segmentation mode indicates that the coding block is vertically divided into C2 sub-coding blocks of the same size and a rectangular shape, the first segmentation depth is i, i is an integer, when i=0, the coding block A i is the target coding block, when i>0, the coding block A i is any one of the multiple sub-coding blocks obtained by segmenting at a second segmentation depth using the first segmentation mode, where the second segmentation depth is i-1, K i =K i2 +K i3 ,K i 、K i1 、K i2 、K i3 are all integers; Determine the target segmentation mode B corresponding to the first segmentation depth from the i3 K segmentation modes i ; Based on the target segmentation pattern B i segment the encoded block A i to obtain a plurality of first sub-encoded blocks corresponding to the target segmentation pattern B i ; When the target segmentation mode B i is the first segmentation mode, and the size of any one of the plurality of first sub-coding blocks is greater than a first preset size, the any one of the first sub-coding blocks is segmented at a third segmentation depth until the target segmentation mode after segmentation at multiple segmentation depths is not the first segmentation mode, or the size of any one of the plurality of sub-coding blocks obtained by segmentation using the first segmentation mode after segmentation at multiple segmentation depths is equal to the first preset size, and the third segmentation depth is i + 1; Based on the target segmentation mode corresponding to each of the multiple segmentation depths, obtaining the final segmentation mode of the target coding block.

2. The method according to claim 1, wherein The method further includes: Determine the coded block A i The first rate-distortion cost corresponding to splitting in the first splitting mode, the third rate-distortion cost corresponding to splitting in the third splitting mode, and the fourth rate-distortion cost corresponding to splitting in the fourth splitting mode.

3. The method according to claim 2, characterized in that The method further includes: When i = 0, if the third rate-distortion cost is less than the first product or the second product, based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth, eliminating the fifth segmentation mode; When i > 0 and the size of any one of the sub-coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate-distortion cost is less than the first product or the second product, based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth, eliminating the fifth segmentation mode and the seventh segmentation mode.

4. The method according to claim 3, wherein: The multiple sub-coding blocks in the first segmentation mode after segmentation at the first segmentation depth include a second sub-coding block, a third sub-coding block, a fourth sub-coding block, and a fifth sub-coding block, wherein the second sub-coding block and the third sub-coding block are respectively above the fourth sub-coding block and the fifth sub-coding block, and the third sub-coding block and the fifth sub-coding block are respectively to the right of the second sub-coding block and the fourth sub-coding block; The eliminating the fifth segmentation mode based on the original pixels and predicted pixels of the multiple sub-coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth includes: Determining the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost corresponding to the second sub-coding block, the third sub-coding block, the fourth sub-coding block, and the fifth sub-coding block respectively; Based on the original pixels and predicted pixels of the second sub-coding block, the third sub-coding block, the fourth sub-coding block, and the fifth sub-coding block, respectively determining the corresponding first pixel distortion, second pixel distortion, third pixel distortion, and fourth pixel distortion; Determining a first difference between the first pixel distortion and the second pixel distortion; Determining a second difference between the third pixel distortion and the fourth pixel distortion; Based on a first initial threshold, the first difference, and the second difference, determining a first target threshold; Based on the first target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost, eliminating the fifth segmentation mode.

5. The method according to claim 4, wherein: The eliminating the fifth segmentation mode based on the first target threshold, the fifth rate-distortion cost, the sixth rate-distortion cost, the seventh rate-distortion cost, and the eighth rate-distortion cost includes: Adding the fifth rate-distortion cost and the sixth rate-distortion cost to obtain a first value; Sum the seventh rate - distortion cost and the eighth rate - distortion cost to obtain a second value; Determine a first prediction value based on the first value and the second value; If the first prediction value is less than the first target threshold, remove the fifth segmentation mode.

6. The method according to claim 4 or 5, characterized in that The method further includes: When i = 0, if the fourth rate - distortion cost is less than the first product or the third product, based on the original pixels and predicted pixels of multiple sub - coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth, remove the sixth segmentation mode; When i > 0 and the size of any one of the sub - coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth is greater than the first preset size, if the fourth rate - distortion cost is less than the first product or the third product, based on the original pixels and predicted pixels of multiple sub - coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth, remove the sixth segmentation mode and the eighth segmentation mode.

7. The method according to claim 6, wherein: Removing the sixth segmentation mode based on the original pixels and predicted pixels of multiple sub - coding blocks obtained by segmenting using the first segmentation mode at the first segmentation depth includes: Determine a third difference between the first pixel distortion and the third pixel distortion; Determine a fourth difference between the second pixel distortion and the fourth pixel distortion; Determine a second target threshold based on a second initial threshold, the third difference, and the fourth difference; Remove the sixth segmentation mode based on the second target threshold, the fifth rate - distortion cost, the sixth rate - distortion cost, the seventh rate - distortion cost, and the eighth rate - distortion cost.

8. The method according to claim 7, wherein: Removing the sixth segmentation mode based on the second target threshold, the fifth rate - distortion cost, the sixth rate - distortion cost, the seventh rate - distortion cost, and the eighth rate - distortion cost includes: Sum the fifth rate - distortion cost and the seventh rate - distortion cost to obtain a third value; Sum the sixth rate - distortion cost and the eighth rate - distortion cost to obtain a fourth value; Determine a second prediction value based on the third value and the fourth value; If the second prediction value is less than the second target threshold, remove the sixth segmentation mode.

9. An encoding block segmentation mode decision device, characterized in that The apparatus includes: an acquisition unit and a processing unit; The acquisition unit is configured to acquire a target coding block; The processing unit is used to, at a first segmentation depth, based on the coding block A i , and the coding block A i The corresponding K i K in the segmentation mode i1 The K i K in the segmentation mode i2 The segmentation modes are eliminated to obtain K corresponding to the first segmentation depth. i3 A segmentation mode specifically includes: when the size of the target coding block is the second preset size, when i=0, if the third rate-distortion cost corresponding to the third segmentation mode is greater than the first product or the second product, the fifth segmentation mode is eliminated, and if the fourth rate-distortion cost corresponding to the fourth segmentation mode is greater than the first product or the third product, the sixth segmentation mode is eliminated; when i>0, and the size of any sub-coding block obtained by segmenting with the first segmentation mode at the first segmentation depth is greater than the first preset size, if the third rate-distortion cost is greater than the first product or the second product, the fifth segmentation mode and the seventh segmentation mode are eliminated, and if the fourth rate-distortion cost is greater than the first product or the third product, the sixth segmentation mode and the eighth segmentation mode are eliminated, and K corresponding to the first segmentation depth is obtained. i3 a segmentation mode; the first product is the product of the first preset coefficient and the first rate-distortion cost corresponding to the first segmentation mode, the second product is the product of the second preset coefficient and the fourth rate-distortion cost, and the third product is the product of the second preset coefficient and the first rate-distortion cost; wherein the K i1 The segmentation modes include a first segmentation mode, wherein the K i2 The segmentation modes include a fifth segmentation mode, a sixth segmentation mode, a seventh segmentation mode and an eighth segmentation mode, wherein the first segmentation mode indicates that the coding block is divided into a plurality of sub-coding blocks of the same size and a square shape, the third segmentation mode indicates that the coding block is horizontally divided into C1 sub-coding blocks of the same size and a rectangular shape, the fourth segmentation mode indicates that the coding block is vertically divided into C1 sub-coding blocks of the same size and a rectangular shape, the fifth segmentation mode indicates that the coding block is vertically divided into a T-shaped segmentation, the sixth segmentation mode indicates that the coding block is horizontally divided into a T-shaped segmentation, the seventh segmentation mode indicates that the coding block is horizontally divided into C2 sub-coding blocks of the same size and a rectangular shape, the eighth segmentation mode indicates that the coding block is vertically divided into C2 sub-coding blocks of the same size and a rectangular shape, the first segmentation depth is i, i is an integer, when i=0, the coding block A i is the target coding block, when i>0, the coding block A i is any one of the multiple sub-coding blocks obtained by segmenting at a second segmentation depth using the first segmentation mode, where the second segmentation depth is i-1, K i = K i2 + K i3 , K i , K i1 , K i2 , K i3 are all integers; The processing unit is further configured to determine, from the K i3 segmentation patterns, a target segmentation pattern B corresponding to the first segmentation depth i ; The processing unit is further configured to, based on the target segmentation mode B i segment the coded block A i to obtain a plurality of first sub-coded blocks corresponding to the target segmentation mode B i ; The processing unit is further configured to, when the target segmentation mode B i is the first segmentation mode, and the size of any one of the plurality of first sub-encoding blocks is greater than a first preset size, perform segmentation on any one of the first sub-encoding blocks at a third segmentation depth until the target segmentation mode after segmentation at multiple segmentation depths is not the first segmentation mode, or the size of any one of the plurality of sub-encoding blocks obtained by performing segmentation using the first segmentation mode after segmentation at multiple segmentation depths is equal to the first preset size, where the third segmentation depth is i + 1; The processing unit is further configured to obtain the final segmentation mode of the target coding block based on the target segmentation mode corresponding to each segmentation depth among the multiple segmentation depths.

10. An electronic device, characterized in that, Including: A processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the electronic device executes the method according to any one of claims 1 - 8.

11. A computer-readable storage medium, characterized in that, The computer - readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 - 8.

Citation Information

Patent Citations

  • Video coding method and device, computer equipment and storage medium

    CN109788287A

  • VVC intra-frame CU depth rapid division method

    CN111246219A