Video coding method, video decoding method and device
By segmenting the image blocks based on texture edges in video encoding and selecting the appropriate motion vector group for encoding, the problem of large consumption of motion vector encoding by non-rectangular subpartitions is solved, and more efficient video encoding is achieved.
Patent Information
- Application Number
- CN202410047683.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2025-07-22
AI Technical Summary
After the existing video encoding technology further divides the image block into non-rectangular subpartitions, the encoding of the motion vector is too large, affecting the encoding efficiency.
By obtaining the texture edge of the target image block, the image block is divided into a first sub-image block containing more pixel points and a second sub-image block with fewer pixel points using the segmentation curve, and the segmentation mode is determined based on the endpoint information of the segmentation curve and the position of the first sub-image block, a candidate motion vector export table is obtained, and a motion vector group with the least encoding cost is selected for encoding.
The number of index numbers representing motion vectors is reduced, the bit rate of video is reduced, and the encoding efficiency is improved.
Smart Images

Figure CN120358355A_ABST
Abstract
Description
Technical Field
[0001] Some embodiments of the present application relate to the field of video encoding and decoding technologies. More specifically, it relates to a video encoding method, a video decoding method, and a device thereof. Background Art
[0002] With the development of the information age, in the field of the Internet, people obtain information by watching videos or viewing pictures, and video transmission has become an important communication method. If unprocessed videos or pictures are directly transmitted over the network, it will occupy a large amount of network bandwidth and consume a large amount of traffic. Therefore, videos or pictures are encoded before transmission to reduce their volume.
[0003] Predictive coding technology is an indispensable part of video encoding. It utilizes the temporal correlation and spatial correlation in the video sequence to remove redundant information in the video, thereby achieving the purpose of video compression. Predictive coding technology includes: intra-frame prediction and inter-frame prediction. Intra-frame prediction mainly uses the reconstructed video pixel values of the encoded video to perform straight-through or compensation in a certain angular direction on the block to be encoded, so as to eliminate spatial redundant information, and only performs transform coding on the predicted residual video. Inter-frame prediction mainly involves two aspects: motion estimation and motion compensation. Motion estimation refers to dividing the video into several blocks, and trying to search for the best matching block of each block in the adjacent video frame as the reference block, and obtaining the relative offset in the spatial position between the two as the motion vector (MV). The process of obtaining the predicted block of the current encoded block according to the motion vector and the reference block is called motion compensation. The current mainstream video coding standards perform predictive coding based on the coding blocks obtained by dividing the video frame rather than the complete video frame. Different coding parameters will be used for different coding blocks. The more accurate the coding block division is, the smaller the difference between it and the predicted block, and the smaller the corresponding code rate overhead. Therefore, a suitable block division is crucial. In order to more accurately divide the video frame into blocks, in the related art, it is proposed to further divide the image block into two non-rectangular sub-partitions, and perform subsequent inter-frame prediction on this basis. For example: In H.266 / VVC, a geometric partitioning mode is introduced, and an inclined straight line is used as the partitioning line to divide the coding block into two non-rectangular sub-partitions. However, after the image block is further divided into two non-rectangular sub-partitions in the related art, the motion vectors of the two sub-partitions need to be separately encoded, which greatly increases the codeword consumption and thus affects the video encoding efficiency. Summary of the Invention
[0004] Exemplary embodiments of the present application provide a video encoding method, a video decoding method, and a device thereof, which are used to improve the video encoding efficiency.
[0005] Some embodiments of the present application provide the following technical solutions:
[0006] In a first aspect, some embodiments of the present application provide a video encoding method, including:
[0007] Obtaining a segmentation curve of a target image block based on texture edges in the target image block, where the target image block is a rectangular image block obtained by partitioning a target video frame into blocks;
[0008] Dividing the target image block into a first sub-image block and a second sub-image block through the segmentation curve; the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block;
[0009] Determining a segmentation mode of the target image block according to position information of endpoints of the segmentation curve and position information of the first sub-image block;
[0010] Obtaining a candidate motion vector derivation table corresponding to the segmentation mode; the candidate motion vector derivation table includes a plurality of motion vector groups and indexes of each motion vector group, and any motion vector group includes candidate motion vectors of the first sub-image block and the second sub-image block;
[0011] Determining a target motion vector group to be selected from the candidate motion vector derivation table according to an encoding cost;
[0012] Generating encoded data of the target image block according to the target motion vector group and the index of the target motion vector group.
[0013] In a second aspect, some embodiments of the present application provide a video decoding method, including:
[0014] Obtaining encoded data of a target image block, where the target image block is a rectangular image block obtained by partitioning a target video frame into blocks;
[0015] Obtaining a segmentation curve of the image block according to the encoded data of the target image block;
[0016] Dividing an image area corresponding to the target image block into a first sub-image area and a second sub-image area through the segmentation curve; wherein, the number of pixel points included in the first sub-image area is greater than the number of pixel points included in the second sub-image area;
[0017] Determining a segmentation mode of the target image block according to position information of endpoints of the segmentation curve and position information of the first sub-image area;
[0018] Obtaining a candidate motion vector derivation table corresponding to the segmentation mode; the candidate motion vector derivation table includes a plurality of motion vector groups and indexes of each motion vector group, and any motion vector group includes candidate motion vectors of the first sub-image area and the second sub-image area;
[0019] Obtain the index number of the target motion vector group according to the encoded data of the target image block;
[0020] Select the target motion vector group from the candidate motion vector derivation table according to the index number of the target motion vector group;
[0021] Reconstruct the target image block according to the target motion vector group.
[0022] In a third aspect, some embodiments of the present application provide a video encoding device, including:
[0023] A memory configured to store a computer program;
[0024] A processor configured to, when calling the computer program, cause the video encoding device to implement the video encoding method described in the first aspect.
[0025] In a fourth aspect, some embodiments of the present application provide a video decoding device, including:
[0026] A memory configured to store a computer program;
[0027] A processor configured to, when calling the computer program, cause the video decoding device to implement the video decoding method described in the second aspect.
[0028] In a fifth aspect, some embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a computing device, the computing device is caused to implement the video encoding method described in the first aspect or the video decoding method described in the second aspect.
[0029] In a sixth aspect, some embodiments of the present application provide a computer program product, which, when running on a computer, causes the computer to implement the video encoding method described in the first aspect or the video decoding method described in the second aspect.
[0030] As can be seen from the above technical solutions, when the video encoding method provided by the embodiments of the present application encodes the target image blocks obtained by block partitioning of the target video frame, first, a segmentation curve of the target image block is obtained based on the texture edges in the target image block, then the target image block is segmented into a first sub-image block with a larger number of pixel points and a second sub-image block with a smaller number of pixel points through the segmentation curve, and then the segmentation mode of the target image block is determined according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block, and a candidate motion vector derivation table corresponding to the segmentation mode is obtained. Finally, the target motion vector group is selected from the candidate motion vector derivation table according to the encoding cost, and the encoded data of the target image block is generated according to the target motion vector group and the index number of the target motion vector group. Since the video encoding method provided by the embodiments of the present application can represent the motion vectors of the two sub-image blocks obtained by segmenting the target image block through the segmentation curve with one index number in the encoded data, compared with the related art that represents the motion vectors of the two sub-image blocks obtained by segmenting the target image block through the segmentation curve with two index numbers respectively in the encoded data, the embodiments of the present application can reduce the number of index numbers representing the motion vectors, thereby reducing the bit rate of the video and improving the encoding efficiency of the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate some embodiments of the present application or the implementation manners in the related art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the related art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.
[0032] Figure 1 The block diagram of the video decoding system in some embodiments of the present application is shown;
[0033] Figure 2 The structural schematic diagram of the video encoder in some embodiments of the present application is shown;
[0034] Figure 3 The structural schematic diagram of the video decoder in some embodiments of the present application is shown;
[0035] Figure 4 The flowchart of the steps of the video encoding method in some embodiments of the present application is shown;
[0036] Figure 5 The schematic diagram of the encoded blocks for generating the candidate motion vectors of the target image block in some embodiments of the present application is shown;
[0037] Figure 6 The schematic diagram of the first segmentation mode in some embodiments of the present application is shown;
[0038] Figure 7 Shows a schematic diagram of the second segmentation mode in some embodiments of the present application;
[0039] Figure 8 Shows a schematic diagram of the third segmentation mode in some embodiments of the present application;
[0040] Figure 9 Shows a schematic diagram of the fourth segmentation mode in some embodiments of the present application;
[0041] Figure 10 Shows a schematic diagram of the fifth segmentation mode in some embodiments of the present application;
[0042] Figure 11 Shows a schematic diagram of the sixth segmentation mode in some embodiments of the present application;
[0043] Figure 12 Shows a schematic diagram of the seventh segmentation mode in some embodiments of the present application;
[0044] Figure 13 Shows a schematic diagram of the eighth segmentation mode in some embodiments of the present application;
[0045] Figure 14 Shows a schematic diagram of the ninth segmentation mode in some embodiments of the present application;
[0046] Figure 15 Shows a schematic diagram of the tenth segmentation mode in some embodiments of the present application;
[0047] Figure 16 Shows a schematic diagram of the eleventh segmentation mode in some embodiments of the present application;
[0048] Figure 17 Shows a schematic diagram of the twelfth segmentation mode in some embodiments of the present application;
[0049] Figure 18 Shows a schematic diagram of the thirteenth segmentation mode in some embodiments of the present application;
[0050] Figure 19 Shows a schematic diagram of the fourteenth segmentation mode in some embodiments of the present application;
[0051] Figure 20 Shows a schematic diagram of the fifteenth segmentation mode in some embodiments of the present application;
[0052] Figure 21 Shows a schematic diagram of the sixteenth segmentation mode in some embodiments of the present application;
[0053] Figure 22 Shows a step flowchart of the video decoding method in some embodiments of the present application. Detailed Implementation Modes
[0054] To make the objectives and implementation modes of this application clearer, the following will clearly and completely describe the exemplary implementation modes of this application with reference to the accompanying drawings in the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only a part rather than all of the embodiments of this application.
[0055] It should be noted that the brief description of terms in this application is only for the convenience of understanding the subsequent described implementation modes, rather than intending to limit the implementation modes of this application. Unless otherwise specified, these terms should be understood in their ordinary and common meanings.
[0056] The terms "comprising" and "having" and any variations thereof are intended to cover but not exclude inclusively. For example, a product or device comprising a series of components does not necessarily have to be limited to all the components clearly listed, but may include other components not clearly listed or inherent to these products or devices.
[0057] The mention of "some implementation modes", "some embodiments", etc. in the specification indicates that the described implementation modes or embodiments may include specific features, structures or characteristics, but not necessarily every embodiment includes such specific features, structures or characteristics. In addition, such phrases do not necessarily refer to the same implementation mode. Additionally, when describing a specific feature, structure or characteristic in connection with an embodiment, it is considered within the knowledge of those skilled in the art to implement such feature, structure or characteristic in connection with other implementation modes (whether or not explicitly described herein).
[0058] The mention of "some implementation modes", "some embodiments", etc. in the specification indicates that the described implementation modes or embodiments may include specific features, structures or characteristics, but not necessarily every embodiment includes such specific features, structures or characteristics. In addition, such phrases do not necessarily refer to the same implementation mode. Additionally, when describing a specific feature, structure or characteristic in connection with an embodiment, it is considered within the knowledge of those skilled in the art to implement such feature, structure or characteristic in connection with other implementation modes (whether or not explicitly described herein).
[0059] The "first", "second" and similar words used in the embodiments of this application do not denote any order, quantity or importance, but are only used to distinguish different elements. Words such as "comprising" or "including" and the like mean that the elements or items appearing before this word cover the elements or items listed after this word and their equivalents, without excluding other elements or items.
[0060] In the embodiments of the present application, terms such as "upper", "lower", "left", and "right" are only used to represent relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0061] The embodiments of the present application relate to the field of video coding and decoding technologies. First, the video coding and decoding framework for implementing the video coding method and video decoding method provided by the embodiments of the present application will be described below.
[0062] A video can be regarded as a sequence composed of multiple video frames (images). Video playback can be regarded as the video frames being displayed at a preset rate (for example: 24 frames per second, 30 frames per second, 60 frames per second) in the order in the sequence. Theoretically, the data volume of a video is positively correlated with the resolution of the video frames. The higher the resolution of the video frames, the greater the data volume of the video. If all pixel data of each pixel point of all video frames are directly saved in a video file, the data volume of the video will be extremely large, which will make it difficult to store and transmit the video. Video coding and decoding are proposed to solve this problem to a certain extent. Video decoding mainly includes: video coding and video decoding. Among them, video coding can be understood as a process of compressing the original video frames, and video decoding can be understood as a process of reconstructing video frames based on the compressed video data.
[0063] Refer to Figure 1 the block diagram of the video decoding system in some embodiments of the present application as shown. As Figure 1 shown, the video decoding system 100 includes: a source device 10 and a destination device 20. Among them, the source device 10 can obtain the original video data through the video source 101, encode the original video frames through the video encoder 102 to obtain video coding data, and provide the video coding data output by the video encoder 102 to the destination device 20 through the output interface 103. The destination device 20 can obtain the video coding data provided by the source device 10 through the input interface 201, decode the video coding data through the video decoder 202 to obtain video decoding data, and input the video decoding data into the player 203 to realize video playback. The source device 10 and the destination device 20 can include any one of a wide range of devices, such as: a personal computer (Program Counter), a notebook computer, a tablet computer, a set-top box, a mobile phone, a television, a camera, a monitor, a digital media player, a video game console, a video streaming device, etc.
[0064] In some embodiments, the video source 101 of the source device 10 can be a video shooting device, such as a camera. In other embodiments, the video source 101 can be a component capable of generating video based on computer graphics. Such as: a screen recording component, an animation generation component, etc.
[0065] In some embodiments, the destination device 20 may receive video encoded data provided by the source device 10 via a computer-readable medium. The computer-readable medium may include any type of medium or device capable of moving the video encoded data from the source device 10 to the destination device 20. In one example, the computer-readable medium may include a communication medium. The communication medium may modulate the video encoded data according to a communication standard (e.g., a wireless communication protocol) and transmit it to the destination device 20. The communication medium may include any wireless or wired communication medium, such as the radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet network (e.g., a local area network, a wide area network, or a global network such as the Internet). The communication medium may include routers, switches, base stations, or any other device that can be used to facilitate communication from the source device 10 to the destination device 20.
[0066] In some examples, the video encoded data may be output from the output interface 103 of the source device 10 to a storage device. Correspondingly, the video encoded data may be accessed by the input interface 201 of the destination device 20 from the storage device. The storage device may include any one of a variety of distributed or locally accessible data storage media, such as a hard disk drive, a Blu-ray disc, a DVD, a CD-ROM, a flash memory, a volatile or non-volatile memory, or any other suitable digital storage media for storing video encoded data. In another example, the storage device may be a server or an intermediate storage device for storing the video encoded data generated by the source device 10. The destination device 20 may obtain the stored video encoded data from the storage device via streaming or downloading. A file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to the destination device 20. In some embodiments, the file server includes a web server (e.g., for a website), an FTP server, a network-attached storage device, or a local disk drive. The destination device 20 may access the encoded video data through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both suitable for accessing the encoded video data stored on the file server. The transmission of the encoded video data from the storage device may be a streaming transmission, a download transmission, or a combination thereof.
[0067] Currently, video coding standards have evolved from ISO / IEC MPEG-1 (International Standardization Organization / International Electrotechnical Commission Moving Picture Experts Group-1) to Versatile Video Coding (VVC) through ISO / IEC MPEG-2, ISO / IEC MPEG-4, Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), etc. The video coding method and video decoding method provided by the embodiments of this application can be applied to any suitable video coding standard. For example: HEVC standard, VVC standard, etc.
[0068] Referring to Figure 2 As shown, the video encoder 200 provided by some embodiments of this application includes: a segmentation module 21. The segmentation module 21 is used to divide the video frame to be encoded into multiple rectangular image blocks and determine whether to further divide the rectangular image blocks according to the actual coding situation. Specifically: Since selecting a larger coding block is more conducive to improving coding efficiency, for rectangular image blocks with relatively flat pixels, fewer segmentation times can be selected, and the segmentation depth is shallower. On the contrary, for rectangular image blocks with more complex textures or located at the edges of the video frame, more segmentation times can be selected, and the segmentation depth is deeper. The segmentation module 21 will also divide at least one rectangular image block into two non-regular sub-image blocks based on a segmentation curve that fits the real texture edges in the rectangular image block.
[0069] Referring to Figure 2 As shown, the video encoder 200 provided by some embodiments of this application further includes: a motion estimation module 22. The motion estimation module 22 is used to perform motion estimation (Motion Estimation, ME) on each coding block (including: rectangular image blocks that are not further divided and non-regular sub-image blocks) to obtain a reference block (Reference Block, RB) corresponding to each coding block.
[0070] Referring to Figure 2 As shown, the video encoder 200 provided by some embodiments of this application further includes: a motion compensation module 23. The motion compensation module 23 is used to perform motion compensation (Motion Compensation, MC) on the reference block to obtain a predicted block and a motion vector (Motion Vector, MV) corresponding to each coding block
[0071] Referring to Figure 2 as shown, the video encoder 200 provided by some embodiments of the present application further includes: a residual calculation module 24. The residual calculation module 24 is configured to calculate the residual between a prediction block and a corresponding encoded block to obtain a prediction residual.
[0072] Referring to Figure 2 as shown, the video encoder 200 provided by some embodiments of the present application further includes: a quantization transformation module 25. The quantization transformation module 25 is configured to perform transformation and quantization on the prediction residual to obtain transformation coefficients.
[0073] Referring to Figure 2 as shown, the video encoder 200 provided by some embodiments of the present application further includes: an entropy encoding module 26. The entropy encoding module 26 is configured to perform entropy encoding on information such as a segmentation curve and transformation coefficients to obtain bitstream data of a video frame to be encoded.
[0074] It should be noted that the above encoding process only describes some steps in the video encoding process. In addition to the above steps, the video encoding process further includes other steps. For example: inputting information such as a prediction mode and a transformation mode into the entropy encoding module 26, and adding the entropy encoding results of information such as the index number of the motion vector in the motion vector derivation table, the prediction mode, and the transformation mode to the encoded data of the video frame to be encoded.
[0075] Referring to Figure 3 as shown, the video decoder 300 provided by some embodiments of the present application includes: an entropy decoding module 31. The entropy decoding module 31 is configured to perform entropy decoding on the bitstream data of the video frame to be encoded, and obtain at least one of the following information according to the entropy decoding result: a segmentation curve for dividing a rectangular image block of the video frame to be reconstructed into two non-regular sub-image blocks, motion vectors of the two sub-image blocks, transformation coefficients of the two sub-image blocks, a motion vector of the rectangular image block, transformation coefficients of the rectangular image block, etc.
[0076] Referring to Figure 3 as shown, the video decoder 300 provided by some embodiments of the present application further includes: a motion estimation module 32. The motion estimation module 32 is configured to determine a reference block corresponding to each block to be reconstructed (including: a rectangular image block that is not further segmented and a non-regular sub-image block)
[0077] Referring to Figure 3 as shown, the video decoder 300 provided by some embodiments of the present application further includes: a motion compensation module 33. The motion compensation module 33 is configured to perform motion compensation on the reference block according to the motion vector to obtain a prediction block corresponding to the block to be reconstructed.
[0078] Referring to Figure 3As shown, the video decoder 300 provided by some embodiments of the present application further includes: an inverse quantization and transformation module 34. The inverse quantization and transformation module 34 is used to perform inverse quantization and inverse transformation operations on the transform coefficients to obtain a prediction residual.
[0079] Referring to Figure 3 As shown, the video decoder 300 provided by some embodiments of the present application further includes: a fusion module 35. The fusion module 35 is used to add and fuse the prediction residual and the prediction block to obtain the reconstruction data of the block to be reconstructed.
[0080] Referring to Figure 3 As shown, the video decoder 300 provided by some embodiments of the present application further includes: a reconstruction module 36. The reconstruction module 36 is used to reconstruct each block to be reconstructed according to the reconstruction data of the block to be reconstructed to obtain a reconstructed video frame.
[0081] Embodiments of the present application provide a video encoding method. Referring to Figure 4 As shown, the video encoding method includes the following steps:
[0082] S41. Obtain a segmentation curve of the target image block based on the texture edges in the target image block.
[0083] Wherein, the target image block is a rectangular image block obtained by dividing a target video frame into blocks.
[0084] Under video coding standards such as HEVC and VVC, after receiving a video frame to be encoded, the encoder first divides the video frame to be encoded into multiple image blocks, and uses the image blocks obtained by dividing the video frame to be encoded as the smallest coding unit for encoding. In addition, the coding task for image blocks can be further refined and segmented. For example: in the HEVC standard, the image blocks obtained by dividing the video frame to be encoded are called Coding Tree Units (CTUs), and the coding tree units can be further divided into smaller square coding units (CUs) using a quadtree division method. The maximum size of the coding tree unit can support up to 64×64, and the minimum can support up to 16×16. In the VVC standard, in order to meet the needs of ultra-high definition video coding such as 4K and 8K, the maximum size of the CTU is expanded to 128×128, and the further division method is no longer limited to quadtree division, but also supports binary tree and ternary tree divisions. The target image block in the embodiments of the present application can be a coding tree unit or a coding unit obtained by further dividing the coding tree unit. The embodiments of the present application do not make any limitations in this regard.
[0085] In some embodiments, the above step S41 (obtaining the segmentation curve of the target image block based on the texture edges in the target image block) includes the following steps 1 to 3:
[0086] Step 1: Perform texture edge detection on the target image block to obtain the texture edges in the target image block.
[0087] In some embodiments, the texture edges in the target image block can be obtained by performing texture edge detection on the target image block through edge detection algorithms such as Sobel, Prewitt, Roberts, Canny, and Marr-Hildreth.
[0088] Step 2: Based on the texture edges in the target image block, divide the target image block into two image regions and obtain the boundary line between the two image regions.
[0089] It should be noted that in some cases, the brightness of the pixel points in the image block is relatively flat, and texture edges that can divide the image block into two image regions cannot be obtained by performing texture edge detection on the image block. For such image blocks, in the embodiments of the present application, further division of sub-image blocks may not be performed, but the image block can be directly used as an encoding unit for encoding. In other cases, the texture edges obtained by performing texture edge detection on the image block will divide the image block into more than two image regions. For such image blocks, multiple image regions can be first merged into two image regions, and then the subsequent video encoding steps can be executed.
[0090] In some embodiments, dividing the target image block into two image regions based on the at least one texture edge includes: performing image region division on the target image block based on the at least one texture edge to obtain a set of image regions corresponding to the target image block; obtaining the number of image regions in the set of image regions; if the number of image regions in the set of image regions is greater than 2, merging the image regions in the set of image regions into two image regions to divide the target image block into two image regions.
[0091] In some embodiments, merging the image regions in the set of image regions into two image regions includes: obtaining at least two merging schemes for the set of image regions, where the at least two merging schemes include various schemes for merging the image regions in the set of image regions into two image regions; respectively obtaining the difference degrees of the at least two merging schemes, where the difference degree of any merging scheme is the absolute difference between the first similarity and the second similarity of the merging scheme; the first similarity and the second similarity of any merging scheme are respectively the sum of the absolute differences of the gray values of the respective pixel points of the two image regions in the merging scheme and the corresponding co-located blocks; merging the image regions in the set of image regions into two image regions through the merging scheme with the largest difference degree among the at least two merging schemes.
[0092] Step 3: Perform curve fitting on the boundary line to obtain the segmentation curve of the target image block.
[0093] Generally, the boundary line between two image regions has no functional expression or the functional expression is very complex. Directly representing the boundary line between two image regions in the bitstream data will greatly increase the overhead of the bitstream data. Therefore, in the embodiments of the present application, curve fitting is performed on the boundary line between two image regions to simplify the functional expression of the boundary line, thereby reducing the overhead caused by the boundary line.
[0094] In some embodiments, the performing curve fitting on the boundary line to obtain the segmentation curve of the target image block includes: performing second-order or third-order Bezier curve fitting on the boundary line, and determining the Bezier curve obtained by performing second-order or third-order Bezier curve fitting on the boundary line as the segmentation curve of the target image block.
[0095] In some other embodiments, the above step S41 (obtaining the segmentation curve of the target image block based on the texture edge in the target image block) includes the following steps a to e:
[0096] Step a: Perform texture edge detection on the target image block to obtain the texture edge in the target image block.
[0097] Step b: Based on the texture edge in the target image block, divide the target image block into two image regions, and obtain the boundary line between the two image regions.
[0098] Among them, the implementation manners of steps a and b can refer to the above steps 1 and 2. To avoid repetition, details are not described here.
[0099] Step c: Obtain the two endpoints of the segmentation curve according to the encoded video content.
[0100] In some embodiments, obtaining the two endpoints of the segmentation curve according to the encoded video content includes: determining whether spatial adjacent pixel points of the four edges of the target image block can be obtained in the encoded video content; if so, obtaining the segmentation start point and the segmentation end point according to the spatial adjacent pixel points of the four edges of the target image block; if not, obtaining the best matching block of the target image block in the encoded video content, and obtaining the segmentation start point and the segmentation end point according to the edge pixel points of the best matching block of the target image block.
[0101] In some embodiments, obtaining the segmentation start point and the segmentation end point according to the spatial domain adjacent pixel points on the four edges of the target image block includes: obtaining the gradient magnitudes of the spatial domain adjacent pixel points on the four edges of the target image block in the directions of the corresponding edges; obtaining at least two pixel value step points according to the gradient magnitudes of the spatial domain adjacent pixel points on the four edges of the target image block in the directions of the corresponding edges, where the pixel value step point is a pixel point with the largest gradient magnitude and a gradient magnitude greater than the threshold gradient magnitude among the spatial domain adjacent pixel points on any edge of the target image block; respectively determining the two pixel value step points with the largest gradient magnitudes among the at least two pixel value step points as the segmentation start point and the segmentation end point.
[0102] In some embodiments, obtaining the segmentation start point and the segmentation end point according to the edge pixel points of the best matching block of the target image block includes: obtaining the gradient magnitudes of the pixel points on the four edges of the best matching block of the target image block in the directions of the corresponding edges; obtaining at least two pixel value step points according to the gradient magnitudes of the pixel points on the four edges of the best matching block of the target image block in the directions of the corresponding edges, where the pixel value step point is a pixel point with the largest gradient magnitude and a gradient magnitude greater than the threshold gradient magnitude among the pixel points on any edge of the best matching block of the target image block; obtaining the two pixel value step points with the largest gradient magnitudes among the at least two pixel value step points; respectively determining the segmentation start point and the segmentation end point according to the two pixel value step points with the largest gradient magnitudes and the motion vector of the best matching block of the target image block.
[0103] Step d, determining the segmentation curve according to the two end points of the segmentation curve and the demarcation line.
[0104] In some embodiments, determining the segmentation curve according to the two end points of the segmentation curve and the demarcation line includes: performing a third-order Bezier curve fitting on the demarcation line with the segmentation start point and the segmentation end point as the two end points of the third-order Bezier curve to obtain a first control point and a second control point; determining whether the first control point and the second control point are on the same side of the straight line connecting the segmentation start point and the segmentation end point; if not, obtaining the segmentation curve according to the segmentation start point, the segmentation end point, the first control point, and the second control point; if so, performing a second-order Bezier curve fitting on the demarcation line with the segmentation start point and the segmentation end point as the two end points of the second-order Bezier curve to obtain a control point, and obtaining the segmentation curve according to the segmentation start point, the segmentation end point, and the control point.
[0105] Since the starting point and the ending point of the segmentation curve for dividing the target image block into two sub-image blocks in the above embodiments are obtained according to the encoded video content, the decoding end can also obtain the starting point and the ending point of the segmentation curve according to the encoded video content. Therefore, the encoding end only needs to add the control information of the segmentation curve to the bitstream data corresponding to the target image block, and the decoding end can obtain the complete segmentation curve information. Therefore, the embodiments of the present application can avoid adding the starting point and the ending point of the segmentation curve to the bitstream data corresponding to the target image block, thereby reducing the bitrate overhead caused by representing the segmentation curve.
[0106] S42. Divide the target image block into a first sub-image block and a second sub-image block through the segmentation curve.
[0107] Among them, the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block.
[0108] In some embodiments, dividing the target image block into a first sub-image block and a second sub-image block through the segmentation curve includes: sampling the segmentation curve with integer-pixel precision to obtain the sampling result of the segmentation curve, and dividing the target image block into the first sub-image block and the second sub-image block based on the sampling result of the segmentation curve.
[0109] Since the segmentation curve is a continuous curve, this continuous segmentation curve may pass through the smallest unit (pixel point) of the digital image, and the smallest unit of the digital image cannot be segmented and encoded. Therefore, the segmentation curve cannot be directly applied to the segmentation of the digital image. Based on this, when the embodiments of the present application divide the target image block into two sub-image blocks based on the segmentation curve of the target image block, first, the segmentation curve is sampled with integer-pixel precision to sample the segmentation curve into a discrete curve, and then the target image block is divided into two sub-image blocks through the sampled curve (the sampling result of the segmentation curve), so as to avoid dividing a pixel point into different sub-image blocks.
[0110] That is, the embodiments of the present application first divide the target image block into two sub-image blocks through the segmentation curve, and define the sub-image block with more pixel points among the two sub-image blocks as the first sub-image block, and define the sub-image block with fewer pixel points among the two sub-image blocks as the second sub-image block.
[0111] S43. Determine the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block.
[0112] In some embodiments, the position information of the endpoints of the segmentation curve is the relative position information between the edges of the target image blocks where the two endpoints of the segmentation curve are located and the two endpoints of the segmentation curve, and the position information of the first sub-image block is the relative position information between the first sub-image block and the segmentation curve.
[0113] S44. Obtain the candidate motion vector derivation table corresponding to the segmentation mode.
[0114] Among them, the candidate motion vector derivation table includes a plurality of motion vector groups and the index numbers of each motion vector group. Any motion vector group includes the candidate motion vectors of the first sub-image block and the second sub-image block.
[0115] In some embodiments, each segmentation mode uniquely corresponds to a candidate motion vector derivation table. A correspondence table including the correspondence between each segmentation mode and the candidate motion vector derivation table can be established in advance, and the candidate motion vector derivation table corresponding to the segmentation mode can be determined according to the segmentation mode of the target image block and this correspondence table.
[0116] S45. Determine the target motion vector group to be selected from the candidate motion vector derivation table according to the coding cost.
[0117] In some embodiments, determining the target motion vector group to be selected from the candidate motion vector derivation table according to the coding cost includes: calculating the coding cost corresponding to each motion vector group in the candidate motion vector derivation table, and determining the motion vector group with the minimum coding cost in the candidate motion vector derivation table as the target motion vector group.
[0118] S46. Generate the coded data of the target image block according to the target motion vector group and the index number of the target motion vector group.
[0119] In some embodiments, generating the coded data of the target image block according to the target motion vector group and the index number of the target motion vector group includes:
[0120] Encode the first sub-image block and the second sub-image block according to the target motion vector group to obtain the first bitstream data;
[0121] Encode the index number of the target motion vector group to obtain the second bitstream data;
[0122] Generate the coded data of the target image block according to the first bitstream data and the second bitstream data.
[0123] When the video encoding method provided by the embodiment of the present application encodes a target image block obtained by block partitioning a target video frame, first, a segmentation curve of the target image block is obtained based on the texture edge in the target image block, then the target image block is segmented into a first sub-image block with a larger number of pixel points and a second sub-image block with a smaller number of pixel points through the segmentation curve, and then the segmentation mode of the target image block is determined according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block, and a candidate motion vector derivation table corresponding to the segmentation mode is obtained. Finally, a target motion vector group is selected from the candidate motion vector derivation table according to the encoding cost, and encoding data of the target image block is generated according to the target motion vector group and the index number of the target motion vector group. Since the video encoding method provided by the embodiment of the present application can represent the motion vectors of the two sub-image blocks obtained by segmenting the target image block through the segmentation curve by one index number in the encoding data, compared with the related art that represents the motion vectors of the two sub-image blocks obtained by segmenting the target image block through the segmentation curve by two index numbers respectively in the encoding data, the embodiment of the present application can reduce the number of index numbers representing the motion vectors, thereby reducing the bit rate of the video and improving the encoding efficiency of the video.
[0124] In some embodiments, the above step S44 (obtaining a candidate motion vector derivation table corresponding to the segmentation mode) includes: obtaining a candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vectors of the target image block.
[0125] Refer to Figure 5 As shown, the encoded image blocks adjacent to the target image block 500 in the spatial domain include: the encoded image block A0 located at the lower left of the current image block, the encoded image block A1 located on the left side of the current image block, the encoded image block B2 located at the upper left of the current image block, the encoded image block B1 located above the current image block, and the encoded image block B0 located at the upper right of the current image block. The encoded image block adjacent to the current image block in the spatial domain is the encoded image block T. Therefore, the candidate motion vectors of the target image block include: the first motion vector t obtained according to the encoded image block T, the second motion vector a0 of the encoded image block A0, the third motion vector b0 of the encoded image block B0, the fourth motion vector b2 of the encoded image block B2, the fifth motion vector a1 of the encoded image block A1, and the sixth motion vector b1 of the encoded image block B1.
[0126] The following details the determination of the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block, and the candidate motion vector derivation table corresponding to the segmentation mode.
[0127] Refer toFigure 6 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the left edge d of the target image block, and the first sub-image block Z A is located on the right side of the segmentation curve, and the second sub-image block Z B is located on the left side of the segmentation curve, then the segmentation mode of the target image block is determined to be the first segmentation mode.
[0128] When the segmentation mode of the target image block is the first segmentation mode, combine the motion vector selected by the first sub-image block from the first candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups. Among them, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
[0129] That is, the first candidate motion vector set is {t, a0, b0}; the second candidate motion vector set is {b2, a1, b1}. Combine the motion vector selected by the first sub-image block from {t, a0, b0} and the motion vector selected by the second sub-image block from {b2, a1, b1}, and the multiple motion vector groups obtained include: (t, b2), (t, a1), (t, b1), (a0, b2), (a0, a1), (a0, b1), (b0, b2), (b0, a1), (b0, b1).
[0130] In some embodiments, obtaining the candidate motion vector export table corresponding to the segmentation mode according to the candidate motion vectors of the target image block further includes: after obtaining the multiple motion vector groups, sorting the multiple motion vector groups in descending order according to the selection probabilities of the multiple motion vector groups to obtain the sorting result of the multiple motion vector groups, and assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result of the multiple motion vector groups to generate the candidate motion vector export table corresponding to the segmentation mode. Among them, the selection probability of any motion vector group is used to represent the probability of selecting this motion vector group as the target motion vector group.
[0131] In the first segmentation mode, the first sub-image block Z A has the highest probability of selecting the first motion vector t as the motion vector, followed by the second motion vector a0 and the third motion vector b0. The second sub-image block Z BThe probability of selecting the fourth motion vector b2 as the motion vector is the highest, followed by the fifth motion vector a1 and the sixth motion vector b1. Since the number of pixel points included in the first sub-image block is greater than that included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (t, b2) > (t, a1) = (t, b1) > (a0, b2) = (b0, b2) > (a0, a1) = (a0, b2) = (b0, a1) = (b0, b2). The candidate motion vector derivation table corresponding to the first segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large can be as shown in Table 1 below:
[0132] Table 1
[0133] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t b0 a0 b0 b0 a0 a0 <![CDATA[Z B > b2 a1 b1 b2 b2 a1 b1 a1 b1
[0134] It should be noted that since the selection probabilities of (t, a1) and (t, b1) are the same, the selection probabilities of (a0, b2) and (b0, b2) are the same, and the selection probabilities of (a0, a1), (a0, b2), (b0, a1), and (b0, b2) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (t, a1) and (t, b1), the order and index numbers of (a0, b2) and (b0, b2), and the order and index numbers of (a0, a1), (a0, b2), (b0, a1), and (b0, b2) can be adjusted to generate candidate motion vector derivation tables corresponding to other forms of the first segmentation mode.
[0135] For example: Since the selection probabilities of (t, a1) and (t, b1) are the same, the order and index numbers of (t, a1) and (t, b1) in Table 1 can be adjusted to generate the candidate motion vector derivation table corresponding to the first segmentation mode as shown in Table 2 below:
[0136] Table 2
[0137] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > t t t b0 a0 b0 b0 a0 a0 <![CDATA[Z B > b2 b1 a1 b2 b2 a1 b1 a1 b1
[0138] For another example: Since the selection probabilities of (a0, b2) and (b0, b2) are the same, the order and index numbers of (a0, b2) and (b0, b2) in Table 1 can be adjusted to generate the candidate motion vector derivation table corresponding to the first segmentation mode as shown in Table 3 below:
[0139] Table 3
[0140] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t a0 b0 b0 b0 a0 a0 <![CDATA[Z B > b2 a1 b1 b2 b2 a1 b1 a1 b1
[0141] Refer to Figure 7As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the left edge d of the target image block, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the second segmentation mode.
[0142] When the segmentation mode of the target image block is the second segmentation mode, combine the motion vector selected by the first sub-image block from the second candidate motion vector set and the motion vector selected by the second sub-image block from the first candidate motion vector set to obtain the multiple motion vector groups. Among them, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
[0143] In the second segmentation mode, for the first sub-image block Z A the probability of selecting the fourth motion vector b2 as the motion vector is the highest, followed by the fifth motion vector a1 and the sixth motion vector b1. For the second sub-image block Z B the probability of selecting the first motion vector t as the motion vector is the highest, followed by the second motion vector a0 and the third motion vector b0. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b2, t) > (b2, b0) = (b2, a0) > (a1, t) = (b1, t) > (a1, b0) = (a1, a0) = (b1, b0) = (b1, a0). The candidate motion vector derivation table corresponding to the second segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result can be as shown in Table 4 below:
[0144] Table 4
[0145] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > b2 b2 b2 a1 b1 a1 a1 b1 b1 <![CDATA[Z B > t b0 a0 t t b0 a0 b0 a0
[0146] Similarly, since the selection probabilities of (b2, b0) and (b2, a0) are the same, the selection probabilities of (a1, t) and (b1, t) are the same, and the selection probabilities of (a1, b0) = (a1, a0) = (b1, b0) = (b1, a0) are the same, the order and index numbers of (b2, b0) and (b2, a0), the order and index numbers of (a1, t) and (b1, t), and the order and index numbers of (a1, b0), (a1, a0), (b1, b0), and (b1, a0) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the second segmentation mode.
[0147] Refer to Figure 8 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the right edge b of the target image block, and the first sub-image block Z A is located on the right side of the segmentation curve, and the second sub-image block Z B is located on the left side of the segmentation curve, then the segmentation mode of the target image block is determined as the third segmentation mode.
[0148] When the segmentation mode of the target image block is the third segmentation mode, combine the motion vector selected by the first sub-image block from the third candidate motion vector set and the motion vector selected by the second sub-image block from the fourth candidate motion vector set to obtain the multiple motion vector groups.
[0149] Among them, the third candidate motion vector set includes: the second motion vector, the fourth motion vector, and the fifth motion vector; the fourth candidate motion vector set includes: the third motion vector and the sixth motion vector.
[0150] That is, the third candidate motion vector set is {a0, b2, a1}, the fourth candidate motion vector set is {b0, b1}, and the multiple motion vector groups obtained by combining the motion vector selected by the first sub-image block from {a0, b2, a1} and the motion vector selected by the second sub-image block from {b0, b1} include: (a0, b0), (a0, b1), (a0, 0), (b2, b0), (b2, b1), (b2, 0), (a1, b0), (a1, b1), (a1, 0). Among them, 0 in the motion vector group represents empty, in order to make the number of motion vector groups in the candidate motion vector derivation tables corresponding to all segmentation modes the same.
[0151] In the third segmentation mode, the first sub-image block Z A has the highest probability of selecting the second motion vector a0 as the motion vector, followed by the fourth motion vector b2 and the fifth motion vector a1. The second sub-image block Z BThe probability of selecting the third motion vector b0 as the motion vector is the highest, followed by the sixth motion vector b1. Since the number of pixel points included in the first sub-image block is greater than that included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (a0, b0) > (a0, b1) > (a0, 0) > (b2, b0) = (a1, b0) > (b2, b1) = (a1, b1) > (b2, 0) = (a1, 0). The candidate motion vector derivation table corresponding to the third segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large according to the sorting result can be as shown in Table 5 below:
[0152] Table 5
[0153] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > a0 a0 a0 a1 b2 a1 b2 a1 b2 <![CDATA[Z B > b0 b1 0 b0 b0 b1 b1 0 0
[0154] Similarly, since the selection probabilities of (b2, b0) and (a1, b0) are the same, the selection probabilities of (b2, b1) and (a1, b1) are the same, and the selection probabilities of (b2, 0) and (a1, 0) are the same, the order and index numbers of (b2, b0) and (a1, b0), the order and index numbers of (b2, b1) and (a1, b1), and the order and index numbers of (b2, 0) and (a1, 0) can also be adjusted to generate candidate motion vector derivation tables corresponding to other forms of the third segmentation mode.
[0155] Refer to Figure 9 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the right edge b of the target image block, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, the segmentation mode of the target image block is determined to be the fourth segmentation mode.
[0156] When the segmentation mode of the target image block is the fourth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the third candidate motion vector set to obtain the multiple motion vector groups.
[0157] Among them, the third candidate motion vector set includes: the second motion vector, the fourth motion vector, and the fifth motion vector; the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector.
[0158] That is, the third candidate motion vector set is {a0, b2, a1}; the fifth candidate motion vector set is {b0, b2, b1}. Combining the motion vector selected by the first sub-image block from {b0, b2, b1} and the motion vector selected by the second sub-image block from {a0, b2, a1}, the obtained multiple motion vector groups include: (b0, a0), (b0, b2), (b0, a1), (b2, a0), (b2, b2), (b2, a1), (b1, a0), (b1, b2), (b1, a1).
[0159] In the fourth segmentation mode, the first sub-image block Z A The probability of selecting the third motion vector b0 as the motion vector is the highest, followed by the sixth motion vector b1 and the fourth motion vector b2. For the second sub-image block Z B The probability of selecting the second motion vector a0 as the motion vector is the highest, followed by the fifth motion vector a1 and the fourth motion vector b2. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the encoding cost. Therefore, the sorting result of the multiple motion vector groups is: (b0, a0) > (b0, b2) = (b0, a1) > (b1, a0) = (b2, a0) > (b2, b2) = (b2, a1) = (b1, b2) = (b1, a1). According to the sorting result of the multiple motion vector groups from small to large, the candidate motion vector derivation table corresponding to the fourth segmentation mode generated by assigning index numbers to the multiple motion vector groups in sequence can be as shown in Table 6 below:
[0160] Table 6
[0161] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > b0 b0 b0 b1 b2 b1 b2 b1 b2 <![CDATA[Z B > a0 a1 b2 a0 a0 a1 b2 b2 a1
[0162] Similarly, because the selection probabilities of (b0, b2) and (b0, a1) are the same, the selection probabilities of (b1, a0) and (b2, a0) are the same, and the selection probabilities of (b2, b2), (b2, a1), (b1, b2), and (b1, a1) are the same, it is also possible to adjust the order and index numbers of (b0, b2) and (b0, a1), the order and index numbers of (b1, a0) and (b2, a0), and the order and index numbers of (b2, b2), (b2, a1), (b1, b2), and (b1, a1) to generate candidate motion vector derivation tables in other forms corresponding to the fourth segmentation mode.
[0163] Refer to Figure 10 As shown, when the endpoints of the segmentation curve 600 are respectively located on the lower edge c and the left edge d of the target image block, and the first sub-image block Z A is located on the right side of the segmentation curve, and the second sub-image block Z BIf it is located on the left side of the segmentation curve, it is determined that the segmentation mode of the target image block is the fifth segmentation mode.
[0164] When the segmentation mode of the target image block is the fifth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the sixth candidate motion vector set to obtain the multiple motion vector groups. Among them, the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the sixth candidate motion vector set includes: the second motion vector and the fifth motion vector.
[0165] That is, the fifth candidate motion vector set is {b0, b2, b1}, and the sixth candidate motion vector set is {a0, a1}; combine the motion vector selected by the first sub-image block from {b0, b2, b1} and the motion vector selected by the second sub-image block from {a0, a1}, and the multiple motion vector groups obtained include: (b0, a0), (b0, a1), (b0, 0), (b2, a0), (b2, a1), (b2, 0), (b1, a0), (b1, a1), (b1, 0).
[0166] In the fifth segmentation mode, the first sub-image block Z A The probability of selecting the third motion vector b0 as the motion vector is the highest, followed by the fourth motion vector b2 and the sixth motion vector b1. For the second sub-image block Z B The probability of selecting the second motion vector a0 as the motion vector is the highest, followed by the fifth motion vector a1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b0, a0) > (b0, a1) > (b0, 0) > (b2, a0) = (b1, a0) > (b2, a1) = (b1, a1) > (b2, 0) = (a1, 0). The candidate motion vector derivation table corresponding to the fifth segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result can be as shown in Table 7 below:
[0167] Table 7
[0168] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > b0 b0 b0 b1 b2 b1 b2 b1 b2 <![CDATA[Z B > a0 a1 0 a0 a0 a1 a1 0 0
[0169] Similarly, since the selection probabilities of (b2, a0) and (b1, a0) are the same, the selection probabilities of (b2, a1) and (b1, a1) are the same, and the selection probabilities of (b2, 0) and (a1, 0) are the same, the order and index numbers of (b2, a0) and (b1, a0), the order and index numbers of (b2, a1) and (b1, a1), and the order and index numbers of (b2, 0) and (a1, 0) can also be adjusted to generate candidate motion vector derivation tables corresponding to other forms of the fifth segmentation pattern.
[0170] Referring to Figure 11 As shown, when the endpoints of the segmentation curve 600 are respectively located at the lower edge c and the left edge d of the target image block, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, the segmentation pattern of the target image block is determined to be the sixth segmentation pattern.
[0171] When the segmentation pattern of the target image block is the sixth segmentation pattern, the motion vectors selected by the first sub-image block from the seventh candidate motion vector set and the motion vectors selected by the second sub-image block from the fifth candidate motion vector set are combined to obtain the multiple motion vector groups. Among them, the sixth candidate motion vector set includes: the second motion vector and the fifth motion vector; the seventh candidate motion vector set includes: the first motion vector, the second motion vector, and the fourth motion vector.
[0172] That is, the seventh candidate motion vector set is {t, a0, b2}; the fifth candidate motion vector set is {b0, b2, b1}, and the multiple motion vector groups obtained by combining the motion vectors selected by the first sub-image block from {t, a0, b2} and the motion vectors selected by the second sub-image block from {b0, b2, b1} include: (t, b0), (t, b2), (t, b1), (a0, b0), (a0, b2), (a0, b1), (b2, b0), (b2, b2), (b2, b1).
[0173] In the sixth segmentation pattern, the first sub-image block Z A has the highest probability of selecting the second motion vector a0 as the motion vector, followed by the first motion vector t and the fourth motion vector b2. The second sub-image block Z BThe probability of selecting the third motion vector b0 as the motion vector is the highest, followed by the fourth motion vector b2 and the sixth motion vector b1. Since the number of pixel points included in the first sub-image block is greater than that included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (a0, b0) > (a0, b1) = (a0, b2) > (b2, b0) = (t, b0) > (b2, b1) = (b2, b2) = (t, b1) = (t, b2). The candidate motion vector derivation table corresponding to the sixth segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large according to the sorting result of the multiple motion vector groups can be as shown in Table 8 below:
[0174] Table 8
[0175] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > a0 a0 a0 b2 t b2 b2 t t <![CDATA[Z B > b0 b1 b2 b0 b0 b1 b2 b1 b2
[0176] Similarly, since the selection probabilities of (a0, b1) and (a0, b2) are the same, the selection probabilities of (b2, b0) and (t, b0) are the same, and the selection probabilities of (b2, b1), (b2, b2), (t, b1), and (t, b2) are the same, it is also possible to adjust the order and index numbers of (a0, b1) and (a0, b2), the order and index numbers of (b2, b0) and (t, b0), and the order and index numbers of (b2, b1), (b2, b2), (t, b1), and (t, b2) to generate candidate motion vector derivation tables corresponding to other forms of the sixth segmentation mode.
[0177] Refer to Figure 12 As shown, when the endpoints of the segmentation curve 600 are respectively located on the lower edge c and the right edge d of the target image block, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then the segmentation mode of the target image block is determined as the seventh segmentation mode.
[0178] When the segmentation mode of the target image block is the seventh segmentation mode, combine the motion vector selected by the first sub-image block from the second candidate motion vector set and the motion vector selected by the second sub-image block from the first candidate motion vector set to obtain the multiple motion vector groups. Among them, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
[0179] That is, the first set of candidate motion vectors is {t, a0, b0}; the second set of candidate motion vectors is {b2, a1, b1}. Combining the motion vector selected from {b2, a1, b1} for the first sub-image block and the motion vector selected from {t, a0, b0} for the second sub-image block, the multiple motion vector groups obtained include: (b2, t), (b2, a0), (b2, b0), (a1, t), (a1, a0), (a1, a0), (b1, t), (b1, a0), (b1, b0).
[0180] In the seventh segmentation mode, the first sub-image block Z A has the highest probability of selecting the fourth motion vector b2 as the motion vector, followed by the fifth motion vector a1 and the sixth motion vector b1. The second sub-image block Z B has the highest probability of selecting the first motion vector t as the motion vector, followed by the second motion vector a0 and the third motion vector b0. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b2, t) > (b2, b0) = (b2, a0) > (b1, t) = (a1, t) > (b1, b0) = (b1, a0) = (a1, b0) = (a1, a0). The candidate motion vector derivation table corresponding to the seventh segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large can be as shown in Table 9 below:
[0181] Table 9
[0182] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > b2 b2 b2 a1 b1 a1 a1 b1 b1 <![CDATA[Z B > t b0 a0 t t b0 a0 a0 b0
[0183] Similarly, because the selection probabilities of (b2, b0) and (b2, a0) are the same, the selection probabilities of (b1, t) and (a1, t) are the same, and the selection probabilities of (b1, b0), (b1, a0), (a1, b0), and (a1, a0) are the same, the order and index numbers of (b2, b0) and (b2, a0), the order and index numbers of (b1, t) and (a1, t), and the order and index numbers of (b1, b0), (b1, a0), (a1, b0), and (a1, a0) can also be adjusted to generate candidate motion vector derivation tables corresponding to other forms of the seventh segmentation mode.
[0184] Refer to Figure 13 As shown, when the endpoints of the segmentation curve 600 are respectively located on the lower edge c and the right edge d of the target image block, and the first sub-image block Z A is located on the right side of the segmentation curve, the second sub-image block Z BIf it is located on the left side of the segmentation curve, then determine that the segmentation mode of the target image block is the eighth segmentation mode.
[0185] When the segmentation mode of the target image block is the eighth segmentation mode, combine the motion vector selected by the first sub-image block from the first candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups. Among them, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
[0186] That is, the first candidate motion vector set is {t, a0, b0}; the second candidate motion vector set is {b2, a1, b1}. Combine the motion vector selected by the first sub-image block from {t, a0, b0} and the motion vector selected by the second sub-image block from {b2, a1, b1}. The multiple motion vector groups obtained include: (t, b2), (t, a1), (t, b1), (a0, b2), (a0, a1), (a0, b1), (b0, b2), (b0, a1), (b0, b1).
[0187] In the eighth segmentation mode, the first sub-image block Z A The probability of selecting the first motion vector t as the motion vector is the highest, followed by the second motion vector a0 and the third motion vector b0. The second sub-image block Z B The probability of selecting the fourth motion vector b2 as the motion vector is the highest, followed by the fifth motion vector a1 and the sixth motion vector b1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (t, b2) > (t, a1) = (t, b1) > (a0, b2) = (b0, b2) > (a0, a1) = (a0, b2) = (b0, a1) = (b0, b2). The candidate motion vector derivation table corresponding to the eighth segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result of the multiple motion vector groups can be as shown in Table 10 below:
[0188] Table 10
[0189] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t b0 a0 b0 b0 a0 a0 <![CDATA[Z B > b2 a1 b1 b2 b2 a1 b1 a1 b1
[0190] It should be noted that since the selection probabilities of (t, a1) and (t, b1) are the same, the selection probabilities of (a0, b2) and (b0, b2) are the same, and the selection probabilities of (a0, a1), (a0, b2), (b0, a1), and (b0, b2) are the same. For the motion vector groups with the same selection probability, the order can be adjusted arbitrarily. Therefore, the order and index numbers of (t, a1) and (t, b1), the order and index numbers of (a0, b2) and (b0, b2), and the order and index numbers of (a0, a1), (a0, b2), (b0, a1), and (b0, b2) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the eighth segmentation pattern.
[0191] Referring to Figure 14 As shown, when the endpoints of the segmentation curve 600 are respectively located at the left edge b and the right edge d of the target image block, the endpoint S at the left edge b is higher than the endpoint E at the right edge d in the horizontal direction, and the first sub-image block Z A is located above the segmentation curve, and the second sub-image block Z B is located below the segmentation curve, then the segmentation pattern of the target image block is determined to be the ninth segmentation pattern.
[0192] When the segmentation pattern of the target image block is the ninth segmentation pattern, the motion vectors selected by the first sub-image block from the fifth candidate motion vector set and the motion vectors selected by the second sub-image block from the eighth candidate motion vector set are combined to obtain the multiple motion vector groups. Among them, the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the eighth candidate motion vector set includes: the first motion vector, the second motion vector, and the fifth motion vector.
[0193] That is, the fifth candidate motion vector set is {b0, b1, b2}; the eighth candidate motion vector set is {t, a1, a0}. The multiple motion vector groups obtained by combining the motion vectors selected by the first sub-image block from {b0, b1, b2} and the motion vectors selected by the second sub-image block from {t, a1, a0} include: (b0, t), (b0, a1), (b0, a0), (b1, t), (b1, a1), (b1, a0), (b2, t), (b2, a1), (b2, a0).
[0194] In the ninth segmentation pattern, the first sub-image block Z A has the highest probability of selecting the third motion vector b0 as the motion vector, followed by the fourth motion vector b2 and the sixth motion vector b1. The second sub-image block Z BThe probability of selecting the second motion vector a0 as the motion vector is the highest, followed by the first motion vector t and the fifth motion vector a1. Since the number of pixel points included in the first sub-image block is greater than that included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b0, a0) > (b0, a1) = (b1, t) > (b2, a0) = (b0, a0) > (b1, t) = (b1, a1) = (b2, t) = (b2, a1). The candidate motion vector derivation table corresponding to the ninth segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large according to the sorting result of the multiple motion vector groups can be as shown in Table 11 below:
[0195] Table 11
[0196] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > b0 b0 b0 b1 b2 b1 b1 b2 b2 <![CDATA[Z B > a0 t a1 a0 a0 t a1 t a1
[0197] It should be noted that since the selection probabilities of (b0, a1) and (b1, t) are the same, the selection probabilities of (b2, a0) and (b0, a0) are the same, and the selection probabilities of (b1, t), (b1, a1), (b2, t), and (b2, a1) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (b0, a1) and (b1, t), the order and index numbers of (b2, a0) and (b0, a0), and the order and index numbers of (a0, a1), (a0, b2), (b0, a1), and (b0, b2) can also be adjusted to generate a candidate motion vector derivation table corresponding to the ninth segmentation mode in other forms.
[0198] Refer to Figure 15 As shown, when the endpoints of the segmentation curve 600 are respectively located at the left edge b and the right edge d of the target image block, the endpoint S at the left edge b is lower than the endpoint E at the right edge d in the horizontal direction, and the first sub-image block Z A is located above the segmentation curve, and the second sub-image block Z B is located below the segmentation curve, then the segmentation mode of the target image block is determined to be the tenth segmentation mode.
[0199] When the segmentation mode of the target image block is the tenth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the eighth candidate motion vector set to obtain the multiple motion vector groups. Among them, the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the eighth candidate motion vector set includes: the first motion vector, the second motion vector, and the fifth motion vector.
[0200] That is, the fifth set of candidate motion vectors is {b0, b1, b2}; the eighth set of candidate motion vectors is {t, a1, a0}. Combining the motion vector selected from {b0, b1, b2} for the first sub-image block and the motion vector selected from {t, a1, a0} for the second sub-image block, the multiple motion vector groups obtained include: (b0, t), (b0, a1), (b0, a0), (b1, t), (b1, a1), (b1, a0), (b2, t), (b2, a1), (b2, a0).
[0201] In the tenth segmentation mode, the first sub-image block Z A has the highest probability of selecting the fourth motion vector b2 as the motion vector, followed by the third motion vector b0 and the sixth motion vector b1. The second sub-image block Z B has the highest probability of selecting the first motion vector t as the motion vector, followed by the second motion vector a0 and the fifth motion vector a1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b2, t) > (b2, a1) = (b1, a0) > (b0, t) = (b0, t) > (b1, a0) = (b1, a1) = (b0, a0) = (b0, a1). The candidate motion vector derivation table corresponding to the tenth segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result can be as shown in Table 12 below:
[0202] Table 12
[0203] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > b2 b2 b2 b0 b1 b0 b0 b1 b1 <![CDATA[Z B > t a1 a0 t t a1 a0 a1 a0
[0204] It should be noted that since the selection probabilities of (b2, a1) and (b1, a0) are the same, the selection probabilities of (b0, t) and (b0, t) are the same, and the selection probabilities of (b1, a0), (b1, a1), (b0, a0), and (b0, a1) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (b2, a1) and (b1, a0), the order and index numbers of (b0, t) and (b0, t), and the order and index numbers of (b1, a0), (b1, a1), (b0, a0), and (b0, a1) can also be adjusted to generate other forms of the candidate motion vector derivation table corresponding to the tenth segmentation mode.
[0205] Refer to Figure 16As shown, when the endpoints of the segmentation curve 600 are respectively located at the left edge b and the right edge d of the target image block, the endpoint S located at the left edge b is higher than the endpoint E located at the right edge d in the horizontal direction, and the first sub-image block Z A is located below the segmentation curve, and the second sub-image block Z B is located above the segmentation curve, then it is determined that the segmentation mode of the target image block is the eleventh segmentation mode.
[0206] When the segmentation mode of the target image block is the eleventh segmentation mode, combine the motion vector selected by the first sub-image block from the eighth candidate motion vector set and the motion vector selected by the second sub-image block from the fifth candidate motion vector set to obtain the multiple motion vector groups. Among them, the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the eighth candidate motion vector set includes: the first motion vector, the second motion vector, and the fifth motion vector.
[0207] That is, the fifth candidate motion vector set is {b0, b1, b2}; the eighth candidate motion vector set is {t, a1, a0}. Combine the motion vector selected by the first sub-image block from {t, a1, a0} and the motion vector selected by the second sub-image block from {b0, b1, b2}. The multiple motion vector groups obtained include: (t, b0), (t, b1), (t, b2), (a1, b0), (a1, b1), (a1, b2), (a0, b0), (a0, b1), (a0, b2).
[0208] In the eleventh segmentation mode, for the first sub-image block Z A the probability of selecting the second motion vector a0 as the motion vector is the highest, followed by the first motion vector t and the fifth motion vector a1. For the second sub-image block Z B the probability of selecting the third motion vector b0 as the motion vector is the highest, followed by the fourth motion vector b1 and the sixth motion vector b2. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (a0, b0) > (a0, b1) = (a0, b2) > (a1, b0) = (t, b0) > (a1, b1) = (a1, b2) = (t, b1) = (t, b2). The candidate motion vector derivation table corresponding to the eleventh segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result can be as shown in Table 13 below:
[0209] Table 13
[0210] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > a0 a0 a0 t a1 t t a1 a1 <![CDATA[Z B > b0 b1 b2 b0 b0 b1 b2 b1 b2
[0211] It should be noted that, since the selection probabilities of (a0, b1) and (a0, b2) are the same, the selection probabilities of (a1, b0) and (t, b0) are the same, and the selection probabilities of (a1, b1), (a1, b2), (t, b1), and (t, b2) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (a0, b1) and (a0, b2), the order and index numbers of (a1, b0) and (t, b0), and the order and index numbers of (a1, b1), (a1, b2), (t, b1), and (t, b2) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the eleventh segmentation mode.
[0212] Refer to Figure 17 As shown, when the endpoints of the segmentation curve 600 are respectively located at the left edge b and the right edge d of the target image block, the endpoint S at the left edge b is lower than the endpoint E at the right edge d in the horizontal direction, and the first sub-image block Z A is located below the segmentation curve, and the second sub-image block Z B is located above the segmentation curve, then it is determined that the segmentation mode of the target image block is the twelfth segmentation mode.
[0213] When the segmentation mode of the target image block is the twelfth segmentation mode, combine the motion vectors selected by the first sub-image block from the eighth candidate motion vector set and the motion vectors selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups. Among them, the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector; the eighth candidate motion vector set includes: the first motion vector, the second motion vector, and the fifth motion vector.
[0214] That is, the second candidate motion vector set is {b2, a1, b1}; the eighth candidate motion vector set is {t, a1, a0}. Combining the motion vectors selected by the first sub-image block from {t, a1, a0} and the motion vectors selected by the second sub-image block from {b2, a1, b1}, the multiple motion vector groups obtained include: (t, b2), (t, a1), (t, b1), (a1, b2), (a1, a1), (a1, b1), (a0, b2), (a0, a1), (a0, b1).
[0215] In the twelfth segmentation mode, the first sub-image block Z AThe probability of selecting the first motion vector t as the motion vector is the highest, followed by the second motion vector a0 and the fifth motion vector a1, and the second sub-image block Z B The probability of selecting the fourth motion vector b2 as the motion vector is the highest, followed by the fifth motion vector a1 and the sixth motion vector b1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (t, b2) > (t, a1) = (t, b1) > (a1, b2) = (a0, b2) > (a1, b1) = (a1, a1) = (a0, b1) = (a0, a1). The candidate motion vector derivation table corresponding to the twelfth segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large according to the sorting result of the multiple motion vector groups can be as shown in Table 14 below:
[0216] Table 14
[0217] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t a1 a0 a1 a1 a0 a0 <![CDATA[Z B > b2 b1 a1 b2 b2 b1 a1 b1 a1
[0218] It should be noted that since the selection probabilities of (t, a1) and (t, b1) are the same, the selection probabilities of (a1, b2) and (a0, b2) are the same, and the selection probabilities of (a1, b1), (a1, a1), (a0, b1), and (a0, a1) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (t, a1) and (t, b1), the order and index numbers of (a1, b2) and (a0, b2), and the order and index numbers of (a1, b1), (a1, a1), (a0, b1), and (a0, a1) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the twelfth segmentation mode.
[0219] Refer to Figure 18 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the lower edge c of the target image block, the endpoint S in the vertical direction on the upper edge is on the left side of the endpoint E on the lower edge, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then the segmentation mode of the target image block is determined as the thirteenth segmentation mode.
[0220] When the segmentation mode of the target image block is the thirteenth segmentation mode, combine the motion vector selected by the first sub-image block from the third candidate motion vector set and the motion vector selected by the second sub-image block from the ninth candidate motion vector set to obtain the plurality of motion vector groups. The third candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the ninth candidate motion vector set includes: the first motion vector, the third motion vector, and the sixth motion vector.
[0221] That is, the third candidate motion vector set is {a0, a1, b2}; the ninth candidate motion vector set is {b0, b1, t}. Combine the motion vector selected by the first sub-image block from {a0, a1, b2} and the motion vector selected by the second sub-image block from {b0, b1, t}. The obtained plurality of motion vector groups include: (a0, b0), (a0, b1), (a0, t), (a1, b0), (a1, b1), (a1, t), (b2, b0), (b2, b1), (b2, t).
[0222] In the thirteenth segmentation mode, the first sub-image block Z A has the highest probability of selecting the second motion vector a0 as the motion vector, followed by the fourth motion vector b2 and the fifth motion vector a1. The second sub-image block Z B has the highest probability of selecting the third motion vector b0 as the motion vector, followed by the first motion vector t and the sixth motion vector b1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the plurality of motion vector groups is: (a0, b0) > (a0, b1) = (a0, t) > (a1, b0) = (b2, b0) > (a1, b1) = (a1, t) = (b2, b1) = (b2, t). The candidate motion vector derivation table corresponding to the thirteenth segmentation mode generated by assigning index numbers to the plurality of motion vector groups in ascending order according to the sorting result of the plurality of motion vector groups can be as shown in Table 15 below:
[0223] Table 15
[0224] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t a1 a0 a1 a1 a0 a0 <![CDATA[Z B > b2 b1 a1 b2 b2 b1 a1 b1 a1
[0225] It should be noted that since the selection probabilities of (a0, b1) and (a0, t) are the same, the selection probabilities of (a1, b0) and (b2, b0) are the same, and the selection probabilities of (a1, b1), (a1, t), (b2, b1), and (b2, t) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (a0, b1) and (a0, t), the order and index numbers of (a1, b0) and (b2, b0), and the order and index numbers of (a1, b1), (a1, t), (b2, b1), and (b2, t) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the thirteenth segmentation mode.
[0226] Referring to Figure 19 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the lower edge c of the target image block, the endpoint S on the upper edge in the vertical direction is on the right side of the endpoint E on the lower edge, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then the segmentation mode of the target image block is determined as the fourteenth segmentation mode.
[0227] When the segmentation mode of the target image block is the fourteenth segmentation mode, combine the motion vectors selected by the first sub-image block from the second candidate motion vector set and the motion vectors selected by the second sub-image block from the ninth candidate motion vector set to obtain the multiple motion vector groups. The second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector; the ninth candidate motion vector set includes: the first motion vector, the third motion vector, and the sixth motion vector.
[0228] That is, the second candidate motion vector set is {b2, a1, b1}; the ninth candidate motion vector set is {b0, b1, t}. Combine the motion vectors selected by the first sub-image block from {b2, a1, b1} and the motion vectors selected by the second sub-image block from {b0, b1, t}, and the multiple motion vector groups obtained include: (b2, b0), (b2, b1), (b2, t), (a1, b0), (a1, b1), (a1, t), (b1, b0), (b1, b1), (b1, t).
[0229] In the fourteenth segmentation mode, the first sub-image block Z A has the highest probability of selecting the fourth motion vector b2 as the motion vector, followed by the fifth motion vector a1 and the sixth motion vector b1. The second sub-image block Z BThe probability of selecting the first motion vector t as the motion vector is the highest, followed by the third motion vector b0 and the sixth motion vector b1. Since the number of pixel points contained in the first sub-image block is greater than that contained in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b2, t) > (b2, a1) = (b2, b1) > (a1, t) = (b1, t) > (a1, b0) = (a1, b1) = (b1, b0) = (b1, b1). The candidate motion vector derivation table corresponding to the fourteenth segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large according to the sorting result of the multiple motion vector groups can be as shown in Table 16 below:
[0230] Table 16
[0231] 1 3 2 4 5 6 7 8 9 <![CDATA[Z A > b2 b2 b2 a1 b1 a1 a1 b1 b1 <![CDATA[Z B > t b0 b1 t t b0 b1 b0 b1
[0232] It should be noted that since the selection probabilities of (b2, a1) and (b2, b1) are the same, the selection probabilities of (a1, t) and (b1, t) are the same, and the selection probabilities of (a1, b0), (a1, b1), (b1, b0), and (b1, b1) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (b2, a1) and (b2, b1), the order and index numbers of (a1, t) and (b1, t), and the order and index numbers of (a1, b0), (a1, b1), (b1, b0), and (b1, b1) can also be adjusted to generate a candidate motion vector derivation table corresponding to the fourteenth segmentation mode in other forms.
[0233] Refer to Figure 20 As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the lower edge c of the target image block, the endpoint S in the vertical direction on the upper edge is on the left side of the endpoint E on the lower edge, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then the segmentation mode of the target image block is determined as the fifteenth segmentation mode.
[0234] When the segmentation mode of the target image block is the fifteenth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the third candidate motion vector set to obtain the multiple motion vector groups. The third candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector.
[0235] That is, the fifth candidate motion vector set is {b0, b2, b1}; the third candidate motion vector set is {a0, b2, a1}. Combining the motion vector selected by the first sub-image block from {b0, b2, b1} and the motion vector selected by the second sub-image block from {a0, b2, a1}, the obtained multiple motion vector groups include: (b0, a0), (b0, b2), (b0, a1), (b2, a0), (b2, b2), (b2, a1), (b1, a0), (b1, b2), (b1, a1).
[0236] In the fifteenth segmentation mode, the first sub-image block Z A has the highest probability of selecting the third motion vector b0 as the motion vector, followed by the fourth motion vector b2 and the sixth motion vector b1. The second sub-image block Z B has the highest probability of selecting the second motion vector a0 as the motion vector, followed by the fourth motion vector b2 and the fifth motion vector a1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, the first sub-image block has a greater impact on the coding cost. Therefore, the sorting result of the multiple motion vector groups is: (b0, a0) > (b0, a1) = (b0, b2) > (b1, a0) = (b2, a0) > (b1, a1) = (b1, b2) = (b2, a1) = (b2, b2). The candidate motion vector derivation table corresponding to the fifteenth segmentation mode generated by sequentially assigning index numbers to the multiple motion vector groups from small to large can be as shown in Table 17 below:
[0237] Table 17
[0238] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > b0 b0 b0 b1 b2 b1 b1 b2 b2 <![CDATA[Z B > a0 a1 b2 a0 a0 a1 b2 a1 b2
[0239] It should be noted that since the selection probabilities of (b0, a1) and (b0, b2) are the same, the selection probabilities of (b1, a0) and (b2, a0) are the same, and the selection probabilities of (b1, a1), (b1, b2), (b2, a1), and (b2, b2) are the same, and the order between the motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (b0, a1) and (b0, b2), the order and index numbers of (b1, a0) and (b2, a0), and the order and index numbers of (b1, a1), (b1, b2), (b2, a1), and (b2, b2) can also be adjusted to generate other forms of the candidate motion vector derivation table corresponding to the fifteenth segmentation mode.
[0240] Refer to Figure 20As shown, when the endpoints of the segmentation curve 600 are respectively located on the upper edge a and the lower edge c of the target image block, the endpoint S located on the upper edge is on the right side of the endpoint E located on the lower edge in the vertical direction, and the first sub-image block Z A is located on the left side of the segmentation curve, and the second sub-image block Z B is located on the right side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the sixteenth segmentation mode.
[0241] When the segmentation mode of the target image block is the sixteenth segmentation mode, combine the motion vector selected by the first sub-image block from the ninth candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups. Among them, the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector; the ninth candidate motion vector set includes: the first motion vector, the third motion vector, and the sixth motion vector.
[0242] That is, the ninth candidate motion vector set is {t, b0, b1}; the second candidate motion vector set is {b2, a1, b1}. Combine the motion vector selected by the first sub-image block from {t, b0, b1} and the motion vector selected by the second sub-image block from {b2, a1, b1}, and the multiple motion vector groups obtained include: (t, b2), (t, a1), (t, b1), (b0, b2), (b0, a1), (b0, b1), (b1, b2), (b1, a1), (b1, b1).
[0243] In the sixteenth segmentation mode, for the first sub-image block Z A the probability of selecting the first motion vector t as the motion vector is the highest, followed by the third motion vector b0 and the sixth motion vector b1. For the second sub-image block Z B the probability of selecting the fourth motion vector b2 as the motion vector is the highest, followed by the fifth motion vector a1 and the sixth motion vector b1. And because the number of pixel points included in the first sub-image block is greater than the number of pixel points included in the second sub-image block, and the first sub-image block has a greater impact on the coding cost, the sorting result of the multiple motion vector groups is: (t, b2) > (t, a1) = (t, b1) > (b0, b2) = (b1, b2) > (b0, a1) = (b0, b1) = (b1, a1) = (b1, b1). The candidate motion vector derivation table corresponding to the sixteenth segmentation mode generated by assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result of the multiple motion vector groups can be as shown in Table 18 below:
[0244] Table 18
[0245] 1 2 3 4 5 6 7 8 9 <![CDATA[Z A > t t t b1 b0 b1 b1 b0 b0 <![CDATA[Z B > b2 a1 b1 b2 b2 a1 b1 a1 b1
[0246] It should be noted that, since the selection probabilities of (t, a1) and (t, b1) are the same, the selection probabilities of (b0, b2) and (b1, b2) are the same, and the selection probabilities of (b0, a1), (b0, b1), (b1, a1), and (b1, b1) are the same, and the order between motion vector groups with the same selection probability can be adjusted arbitrarily. Therefore, the order and index numbers of (t, a1) and (t, b1), the order and index numbers of (b0, b2) and (b1, b2), and the order and index numbers of (b0, a1), (b0, b1), (b1, a1), and (b1, b1) can also be adjusted to generate a candidate motion vector derivation table corresponding to other forms of the sixteenth partition mode.
[0247] In some embodiments, generating the encoded data of the target image block according to the target motion vector group and the index number of the target motion vector group includes: performing adaptive length encoding (ALE for short) on the index number of the target motion vector group.
[0248] Adaptive length encoding is a data compression technology that can automatically assign codewords of different lengths to each data element according to the statistical characteristics of the data to achieve higher compression efficiency. For example: for index number 1, adaptive length encoding can encode it as 1; for index number 2, adaptive length encoding can encode it as 10; for index number 3, adaptive length encoding can encode it as 11; for index number 4, adaptive length encoding can encode it as 100, and for index number 4, adaptive length encoding can encode it as 1001. When using adaptive length encoding for the index number of the target motion vector group, the larger the index number, the more decoding is required. In the above embodiments, the multiple motion vector groups are first sorted in descending order according to the selection probabilities of the multiple motion vector groups, and then the index numbers are sequentially assigned to the multiple motion vector groups from small to large according to the sorting result of the multiple motion vector groups. Therefore, the above embodiments can make the index number with more usage times smaller, thereby reducing the byte code occupied by the index number and improving the encoding efficiency.
[0249] The embodiments of the present application also provide a video decoding method, as shown in Figure 22 The video decoding method includes the following steps:
[0250] S221. Obtain the encoded data of the target image block.
[0251] Wherein, the target image block is a rectangular image block obtained by block partitioning a target video frame.
[0252] The encoded data of the target image block may be the encoded data obtained by encoding the target image block according to any of the above video encoding methods.
[0253] In some embodiments, obtaining the encoded data of the target image block includes: receiving the video stream data of the video to be played sent by the media resource server, and extracting the encoded data of the target image block from the video stream data.
[0254] In some embodiments, the encoded data of the target image block includes: the encoded data obtained by encoding the information of the segmentation curve for dividing the target image block into a first sub-image block and a second sub-image block, the encoded data obtained by encoding the residual data of the target image block, and the encoded data obtained by encoding the index numbers of the target motion vector groups of the first sub-image block and the second sub-image block.
[0255] S222. Obtain the segmentation curve of the image block according to the encoded data of the target image block.
[0256] In some embodiments, the information of the segmentation curve for dividing the target image block into a first sub-image block and a second sub-image block includes: the position information of the starting point of the second-order Bezier curve, the position information of the ending point, and the position information of the control point.
[0257] In some embodiments, the information of the segmentation curve for dividing the target image block into a first sub-image block and a second sub-image block includes: the position information of the starting point of the third-order Bezier curve, the position information of the ending point, the position information of the first control point, and the position information of the second control point.
[0258] In some embodiments, the information of the segmentation curve for dividing the target image block into a first sub-image block and a second sub-image block includes: the position information of the control point of the second-order Bezier curve.
[0259] In some embodiments, the information of the segmentation curve for dividing the target image block into a first sub-image block and a second sub-image block includes: the position information of the first control point and the position information of the second control point of the third-order Bezier curve.
[0260] S223. Divide the image area corresponding to the target image block into a first sub-image area and a second sub-image area through the segmentation curve.
[0261] Wherein, the number of pixel points included in the first sub-image area is greater than the number of pixel points included in the second sub-image area.
[0262] S224. Determine the segmentation mode of the target image block according to the position information of the end points of the segmentation curve and the position information of the first sub-image area.
[0263] The implementation of step S224 can refer to the above embodiments. To avoid repetition, it will not be described again here.
[0264] S225. Obtain a candidate motion vector derivation table corresponding to the segmentation mode.
[0265] In some embodiments, the implementation of obtaining a candidate motion vector derivation table corresponding to the segmentation mode may include: The encoding end device constructs candidate motion vector derivation tables corresponding to each segmentation mode.
[0266] In other embodiments, the implementation of obtaining a candidate motion vector derivation table corresponding to the segmentation mode may include: Receiving candidate motion vector derivation tables corresponding to each segmentation mode sent by the encoding end device.
[0267] In the embodiments of the present application, the implementation of obtaining a candidate motion vector derivation table corresponding to the segmentation mode is not limited, as long as a candidate motion vector derivation table consistent with the encoding end can be obtained.
[0268] S226. Obtain the index number of the target motion vector group according to the encoded data of the target image block.
[0269] S227. Select the target motion vector group from the candidate motion vector derivation table according to the index number of the target motion vector group.
[0270] S228. Reconstruct the target image block according to the target motion vector group.
[0271] In some embodiments, reconstructing the target image block according to the target motion vector group includes: obtaining the residual data of the target image block according to the encoded data of the target image block, obtaining the motion vectors of the first sub-image block and the second sub-image block according to the target motion vector group, obtaining the prediction blocks corresponding to the first sub-image block and the second sub-image block according to the motion vectors of the first sub-image block and the second sub-image block, and obtaining the reconstructed target image block according to the residual data of the target image block, the prediction blocks corresponding to the first sub-image block and the second sub-image block.
[0272] The video decoding method provided by the embodiments of the present application can reconstruct the target image block based on the encoded data of the target image block obtained by the video encoding provided by the above embodiments to obtain the reconstructed image block of the target image block. Therefore, the embodiments of the present application can realize the normal decoding of the video while improving the efficiency of video encoding.
[0273] In some embodiments, some embodiments of the present application provide a video decoding device, and the video encoding device includes:
[0274] A memory configured to store a computer program;
[0275] A processor configured to cause the video decoding device to implement the video encoding method described in any of the above embodiments when the computer program is called.
[0276] In some embodiments, some embodiments of the present application provide a video decoding device, which includes:
[0277] A memory configured to store a computer program;
[0278] A processor configured to cause the video decoding device to implement the video decoding method described in any of the above embodiments when the computer program is called.
[0279] In some embodiments, some embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computing device, the computing device is caused to implement the video decoding method described in any of the above embodiments or the video encoding method described in any of the above embodiments.
[0280] In some embodiments, some embodiments of the present application provide a computer program product. When the computer program product runs on a computer, the computer is caused to implement the video decoding method described in any of the above embodiments or the video encoding method described in any of the above embodiments.
[0281] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0282] For the sake of convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, so that those skilled in the art can better use the embodiments and various different modified embodiments suitable for specific use considerations.
Claims
1. A video encoding method, characterized in that, include: Acquire a segmentation curve of the target image block based on a texture edge in the target image block, wherein the target image block is a rectangular image block obtained by dividing a target video frame into blocks; The target image block is divided into a first sub-image block and a second sub-image block by using the segmentation curve; the number of pixels included in the first sub-image block is greater than the number of pixels included in the second sub-image block; Determining a segmentation mode of the target image block according to position information of the endpoints of the segmentation curve and position information of the first sub-image block; Obtain a candidate motion vector derivation table corresponding to the segmentation mode; The candidate motion vector derivation table includes a plurality of motion vector groups and index numbers of the motion vector groups, and any motion vector group includes candidate motion vectors of the first sub-image block and the second sub-image block; Determine, according to the coding cost, to select a target motion vector group from the candidate motion vector derivation table; The encoding data of the target image block is generated according to the target motion vector group and the index number of the target motion vector group.
2. The method according to claim 1, characterized in that, The step of obtaining a candidate motion vector derivation table corresponding to the segmentation mode includes: Obtaining a candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vector of the target image block; The candidate motion vectors of the target image block include: a first motion vector obtained according to a co-located image block of the target image block in an encoded video frame, a second motion vector of an encoded image block located at the lower left of the target image block in the target video frame, a third motion vector of an encoded image block located at the upper right of the target image block in the target video frame, a fourth motion vector of an encoded image block located at the upper left of the target image block in the target video frame, a fifth motion vector of an encoded image block located at the left side of the target image block in the target video frame, and a sixth motion vector of an encoded image block located above the target image block in the target video frame.
3. The method according to claim 2, wherein The determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block comprises: When the endpoints of the segmentation curve are respectively located at the upper edge and the left edge of the target image block, and the first sub-image block is located on the right side of the segmentation curve, determining that the segmentation mode of the target image block is the first segmentation mode; When the endpoints of the segmentation curve are respectively located at the upper edge and the left edge of the target image block, and the first sub-image block is located on the left side of the segmentation curve, the segmentation mode of the target image block is determined to be the second segmentation mode.
4. The method according to claim 3, wherein The step of obtaining a candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vector of the target image block comprises: When the segmentation mode of the target image block is the first segmentation mode, combining the motion vector selected by the first sub-image block from the first candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the plurality of motion vector groups; When the segmentation mode of the target image block is the second segmentation mode, combine the motion vector selected by the first sub-image block from the second candidate motion vector set and the motion vector selected by the second sub-image block from the first candidate motion vector set to obtain the multiple motion vector groups; Among them, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
5. The method according to claim 2, wherein The determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block includes: When the endpoints of the segmentation curve are respectively located on the upper edge and the right edge of the target image block, and the first sub-image block is located on the right side of the segmentation curve, determine that the segmentation mode of the target image block is the third segmentation mode; When the endpoints of the segmentation curve are respectively located on the upper edge and the right edge of the target image block, and the first sub-image block is located on the left side of the segmentation curve, determine that the segmentation mode of the target image block is the fourth segmentation mode.
6. The method according to claim 5, wherein The obtaining the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vectors of the target image block includes: When the segmentation mode of the target image block is the third segmentation mode, combine the motion vector selected by the first sub-image block from the third candidate motion vector set and the motion vector selected by the second sub-image block from the fourth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the fourth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the third candidate motion vector set to obtain the multiple motion vector groups; Among them, the third candidate motion vector set includes: the second motion vector, the fourth motion vector, and the fifth motion vector; the fourth candidate motion vector set includes: the third motion vector and the sixth motion vector; the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector.
7. The method according to claim 2, characterized in that The determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block includes: When the endpoints of the segmentation curve are respectively located on the lower edge and the left edge of the target image block, and the first sub-image block is located on the right side of the segmentation curve, determine that the segmentation mode of the target image block is the fifth segmentation mode; When the endpoints of the segmentation curve are respectively located on the lower edge and the left edge of the target image block, and the first sub-image block is located on the left side of the segmentation curve, determine that the segmentation mode of the target image block is the sixth segmentation mode.
8. The method according to claim 7, wherein The obtaining the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vectors of the target image block includes: When the segmentation mode of the target image block is the fifth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the sixth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the sixth segmentation mode, combine the motion vector selected by the first sub-image block from the seventh candidate motion vector set and the motion vector selected by the second sub-image block from the fifth candidate motion vector set to obtain the multiple motion vector groups; Wherein, the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the sixth candidate motion vector set includes: the second motion vector and the fifth motion vector; the seventh candidate motion vector set includes: the first motion vector, the second motion vector, and the fourth motion vector.
9. The method according to claim 2, wherein The determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block includes: When the endpoints of the segmentation curve are respectively located at the lower edge and the right edge of the target image block, and the first sub-image block is located on the left side of the segmentation curve, determine that the segmentation mode of the target image block is the seventh segmentation mode; When the endpoints of the segmentation curve are respectively located at the lower edge and the right edge of the target image block, and the first sub-image block is located on the right side of the segmentation curve, determine that the segmentation mode of the target image block is the eighth segmentation mode.
10. The method according to claim 9, wherein The obtaining the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vectors of the target image block includes: When the segmentation mode of the target image block is the seventh segmentation mode, combine the motion vector selected by the first sub-image block from the second candidate motion vector set and the motion vector selected by the second sub-image block from the first candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the eighth segmentation mode, combine the motion vector selected by the first sub-image block from the first candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups; Wherein, the first candidate motion vector set includes: the first motion vector, the second motion vector, and the third motion vector; the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector.
11. The method according to claim 2, wherein The determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block includes: When the endpoints of the segmentation curve are respectively located at the left edge and the right edge of the target image block, the endpoint located at the left edge is higher than the endpoint located at the right edge in the horizontal direction, and the first sub-image block is located above the segmentation curve, determine that the segmentation mode of the target image block is the ninth segmentation mode; When the endpoints of the segmentation curve are respectively located at the left edge and the right edge of the target image block, the endpoint located at the left edge is lower than the endpoint located at the right edge in the horizontal direction, and the first sub-image block is located above the segmentation curve, then determine that the segmentation mode of the target image block is the tenth segmentation mode; When the endpoints of the segmentation curve are respectively located at the left edge and the right edge of the target image block, the endpoint located at the left edge is higher than the endpoint located at the right edge in the horizontal direction, and the first sub-image block is located below the segmentation curve, then determine that the segmentation mode of the target image block is the eleventh segmentation mode; When the endpoints of the segmentation curve are respectively located at the left edge and the right edge of the target image block, the endpoint located at the left edge is lower than the endpoint located at the right edge in the horizontal direction, and the first sub-image block is located below the segmentation curve, then determine that the segmentation mode of the target image block is the twelfth segmentation mode.
12. The method according to claim 11, wherein The obtaining of the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vector of the target image block includes: When the segmentation mode of the target image block is the ninth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the eighth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the tenth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the eighth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the eleventh segmentation mode, combine the motion vector selected by the first sub-image block from the eighth candidate motion vector set and the motion vector selected by the second sub-image block from the fifth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the twelfth segmentation mode, combine the motion vector selected by the first sub-image block from the eighth candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups; Wherein, the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector; the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the eighth candidate motion vector set includes: the first motion vector, the second motion vector, and the fifth motion vector.
13. The method according to claim 2, wherein The determining of the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image block includes: When the endpoints of the segmentation curve are respectively located on the upper edge and the lower edge of the target image block, the endpoint located on the upper edge is on the left side of the endpoint located on the lower edge in the vertical direction, and the first sub-image block is located on the left side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the thirteenth segmentation mode; When the endpoints of the segmentation curve are respectively located on the upper edge and the lower edge of the target image block, the endpoint located on the upper edge is on the right side of the endpoint located on the lower edge in the vertical direction, and the first sub-image block is located on the right side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the fourteenth segmentation mode; When the endpoints of the segmentation curve are respectively located on the upper edge and the lower edge of the target image block, the endpoint located on the upper edge is on the left side of the endpoint located on the lower edge in the vertical direction, and the first sub-image block is located on the left side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the fifteenth segmentation mode; When the endpoints of the segmentation curve are respectively located on the upper edge and the lower edge of the target image block, the endpoint located on the upper edge is on the right side of the endpoint located on the lower edge in the vertical direction, and the first sub-image block is located on the left side of the segmentation curve, then it is determined that the segmentation mode of the target image block is the sixteenth segmentation mode.
14. The method according to claim 13, wherein The obtaining of the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vector of the target image block includes: When the segmentation mode of the target image block is the thirteenth segmentation mode, combine the motion vector selected by the first sub-image block from the third candidate motion vector set and the motion vector selected by the second sub-image block from the ninth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the fourteenth segmentation mode, combine the motion vector selected by the first sub-image block from the second candidate motion vector set and the motion vector selected by the second sub-image block from the ninth candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the fifteenth segmentation mode, combine the motion vector selected by the first sub-image block from the fifth candidate motion vector set and the motion vector selected by the second sub-image block from the third candidate motion vector set to obtain the multiple motion vector groups; When the segmentation mode of the target image block is the sixteenth segmentation mode, combine the motion vector selected by the first sub-image block from the ninth candidate motion vector set and the motion vector selected by the second sub-image block from the second candidate motion vector set to obtain the multiple motion vector groups; Among them, the second candidate motion vector set includes: the fourth motion vector, the fifth motion vector, and the sixth motion vector; the third candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the fifth candidate motion vector set includes: the third motion vector, the fourth motion vector, and the sixth motion vector; the ninth candidate motion vector set includes: the first motion vector, the third motion vector, and the sixth motion vector.
15. The method according to claim 4 or 6 or 8 or 10 or 12 or 14, characterized in that The obtaining of the candidate motion vector derivation table corresponding to the segmentation mode according to the candidate motion vectors of the target image block further includes: After obtaining the multiple motion vector groups, sorting the multiple motion vector groups in descending order according to the selection probabilities of the multiple motion vector groups to obtain the sorting result of the multiple motion vector groups; the selection probability of any motion vector group is used to represent the probability of selecting this motion vector group as the target motion vector group; Assigning index numbers to the multiple motion vector groups in ascending order according to the sorting result of the multiple motion vector groups to generate the candidate motion vector derivation table corresponding to the segmentation mode; The generating of the encoded data of the target image block according to the target motion vector group and the index number of the target motion vector group includes: performing adaptive variable length coding on the index number of the target motion vector group.
16. A video decoding method, characterized in that, Including: Obtaining the encoded data of the target image block, where the target image block is a rectangular image block obtained by block partitioning a target video frame; According to the encoded data of the target image block, obtaining the segmentation curve of the image block; Dividing the image area corresponding to the target image block into a first sub-image area and a second sub-image area through the segmentation curve; among them, the number of pixel points included in the first sub-image area is greater than the number of pixel points included in the second sub-image area; Determining the segmentation mode of the target image block according to the position information of the endpoints of the segmentation curve and the position information of the first sub-image area; Obtaining the candidate motion vector derivation table corresponding to the segmentation mode; the candidate motion vector derivation table includes multiple motion vector groups and the index numbers of each motion vector group, and any motion vector group includes the candidate motion vectors of the first sub-image area and the second sub-image area; Obtaining the index number of the target motion vector group according to the encoded data of the target image block; Selecting the target motion vector group from the candidate motion vector derivation table according to the index number of the target motion vector group; Reconstructing the target image block according to the target motion vector group.
17. A video encoding device, characterized in that, Including: A memory configured to store a computer program; A processor configured to, when calling the computer program, cause the video encoding device to implement the video encoding method according to any one of claims 1-15.
18. A video decoding device, characterized in that, Including: A memory configured to store a computer program; A processor configured to, when calling the computer program, cause the video decoding device to implement the video decoding method according to claim 16.