Method and device for motion information storage
By determining the distance between sample sets and applying threshold-based geometric methods, the method optimizes motion information preservation, enhancing video coding efficiency and compression ratios.
Patent Information
- Application Number
- JP2025076647
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-02
- Publication Date
- 2025-08-05
AI Technical Summary
Existing video coding technologies face challenges in achieving high compression ratios with minimal loss in picture quality, particularly in handling motion information across block boundaries in video sequences.
A method is introduced to determine the distance between a sample set and a common boundary within a block, comparing it to a threshold to decide whether to preserve combined motion information, using geometric relationships and angle parameters to optimize motion information preservation.
This approach enhances video coding efficiency by maintaining picture quality while improving compression ratios through optimized motion information management across block boundaries.
Smart Images

Figure 2025114690000001_ABST
Abstract
Description
[Technical Field]
[0001] FIELD Embodiments of the present application relate generally to the field of video coding, and more particularly to inter prediction. [Background technology]
[0002] Video coding (video encoding and decoding) is used in a wide range of digital video applications, such as broadcast digital TV, video transmission over the Internet and mobile networks, video chat, video conferencing, real-time conversation applications such as DVD and Blu-ray discs, video content acquisition and editing systems, and camcorders in security applications.
[0003] The amount of video data required to render even a relatively short video can be substantial, resulting in difficulties when the data is to be streamed or otherwise communicated over communication networks with limited bandwidth capacity. Therefore, video data is typically compressed before being communicated over modern telecommunications networks. Because memory resources may be limited, video size can also be an issue when the video is stored on a storage device. Video compression devices often use software and / or hardware at the source to code the video data before transmission or storage, thereby reducing the amount of data needed to represent a digital video image. The compressed data is then received at the destination by a video decompression device, which decodes the video data. In light of limited network resources and ever-increasing demands for higher video quality, improved compression and decompression techniques are desired that improve compression ratios with little or no sacrifice in picture quality. Summary of the Invention
[0004] Embodiments of the present application provide apparatus and methods for encoding and decoding as set forth in the independent claims.
[0005] These and other objects are achieved by the subject matter of the independent claims. Further implementations become apparent from the dependent claims, the description and the drawings.
[0006] According to a first aspect of the present application, a motion information preservation method is disclosed, wherein a current block consists of a first sub-block and a second sub-block, the first sub-block and the second sub-block are separated by a common boundary, the first sub-block corresponds to first motion information, and the second sub-block corresponds to second motion information, the method comprising: determining a distance between a sample set in the current block and the common boundary; and comparing the distance with a threshold to determine whether third motion information is to be preserved for the sample set, the third motion information being derived from the first motion information and the second motion information.
[0007] In a possible implementation, the step of comparing the distance with a threshold to determine whether the third motion information is to be saved for the sample set includes a step of determining that the third motion information is to be saved for the sample set if the absolute value of the distance is less than or equal to the threshold.
[0008] In a possible implementation, if the absolute value of the distance is greater than the threshold, the method further comprises a step of determining that the first motion information is to be preserved with respect to the sample set if the distance is positive, or determining that the second motion information is to be preserved with respect to the sample set if the distance is negative.
[0009] In a possible implementation, the threshold is predetermined.
[0010] In a possible implementation, the threshold is based on a geometric relationship between the common boundary and a horizontal or vertical direction.
[0011] In a possible implementation, the threshold is based on the angle between the orthogonal direction of the common boundary and the horizontal or vertical direction.
[0012] In a possible implementation, the threshold is based on the width and / or height of the current block.
[0013] In a possible implementation, the common boundary is determined by an angle parameter and a distance parameter, and before determining the distance between the sample set in the current block and the common boundary, the method further comprises a step of determining the angle parameter and the distance parameter.
[0014] In a possible implementation, in a decoder, the step of determining the angle parameters and the distance parameters comprises parsing the angle parameters and the distance parameters from a bitstream, or parsing an indicator from the bitstream and obtaining the angle parameters and the distance parameters based on the indicator.
[0015] In a possible implementation, after the step of determining the angle parameter and the distance parameter, the method further includes the steps of determining a first calculation parameter based on the angle parameter, calculating a temp angle parameter based on the angle parameter, determining a second calculation parameter based on the temp angle parameter, and calculating a third calculation parameter based on the angle parameter and the distance parameter.
[0016] In a possible implementation, the first calculation parameter is determined by checking a pre-set lookup table according to the angle parameter, and the second calculation parameter is determined by checking a lookup table according to the temp angle parameter, and the first calculation parameter and the second calculation parameter are respectively the cosine value and sine value of the same angle.
[0017] In a possible implementation, the distance is calculated by: distFromLine=(x+K)*P1+(y+K)*P2-P3 P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively; distFromLine represents the distance; K is a non-negative integer; x represents the horizontal coordinate of the target position in the sample set; y represents the vertical coordinate of the target position in the rectangular coordinate system; the position of the top-left sample of the current block is set as the coordinate origin, the right direction is set as the positive horizontal direction, and the downward direction is set as the positive vertical direction.
[0018] In a possible implementation, K is equal to 1.
[0019] In a possible implementation, the target locations are predetermined in the sample set.
[0020] In a possible implementation, the predetermined position is the top left position of the sample set or the center position of the sample set.
[0021] In a feasible implementation, the distance has a sample precision of greater than an integer number of samples, Correspondingly, the distance is calculated by: distFromLine=((x< <N)+K)*P1+((y<<N)+K)*P2-P3 2N represents the reciprocal of the sample precision of the distance.
[0022] In a possible implementation, N is equal to 1.
[0023] In a possible implementation, the sample set is the luma sample set of the current block.
[0024] In a possible implementation, before determining the distance between the sample set within the current block and the common boundary, the method further comprises a step of dividing the current block into a plurality of sample sets, each of the plurality of sample sets having the same size as the sample set, or a step of setting the current block as the sample set.
[0025] In a possible implementation, the sample set is a 4x4 sample array.
[0026] In a possible implementation, each of the plurality of sample sets corresponds to a respective motion information storage unit, and the motion information storage unit is used to store one of the first motion information, the second motion information, and the third motion information.
[0027] In a possible implementation, the first sub-block and the second sub-block are triangular sections, trapezoidal sections, or asymmetric rectangular sections.
[0028] In a possible implementation, the first motion information includes motion information based on a first reference picture list, the second motion information includes motion information based on a second reference picture list, and the third motion information includes the first motion information and the second motion information.
[0029] According to a second aspect of the present application, there is disclosed an apparatus for decoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to perform the method according to the first aspect.
[0030] According to a third aspect of the present application, there is disclosed an apparatus for encoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to perform the method according to the first aspect.
[0031] According to a fourth aspect, there is proposed a computer-readable storage medium having stored thereon instructions configured to, when executed, cause one or more processors to code video data, the instructions causing the one or more processors to perform a method according to the first aspect.
[0032] According to a fifth aspect, a computer program comprising program code which, when executed on a computer, performs the method according to the first aspect.
[0033] The details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims. [Brief explanation of the drawings]
[0034] Hereinafter, embodiments of the present application will be described in more detail with reference to the accompanying figures and drawings. [Figure 1A] 1 is a block diagram illustrating an example of a video coding system configured to implement embodiments of the present application. [Figure 1B] FIG. 2 is a block diagram illustrating another example of a video coding system configured to implement embodiments of the present application. [Figure 2] 1 is a block diagram illustrating an example of a video encoder configured to implement embodiments of the present application. [Figure 3] 1 is a block diagram illustrating an exemplary structure of a video decoder configured to implement embodiments of the present application. [Figure 4] 1 is a block diagram showing an example of an encoding device or a decoding device. [Figure 5] FIG. 10 is a block diagram illustrating another example of an encoding device or a decoding device. [Figure 6] FIG. 10 is a diagram illustrating an example of the positions of spatial merge candidates. [Figure 7] FIG. 10 illustrates an example of a candidate pair considered for a spatial merge candidate redundancy check. [Figure 8] FIG. 10 illustrates an example of motion vector scaling for temporal merge candidates. [Figure 9] FIG. 10 illustrates an example of motion vector storage for a prediction block of luma samples of size 8×8. [Figure 10] FIG. 10 is a diagram illustrating an example of triangle partition-based inter prediction. [Figure 11] FIG. 10 illustrates an example of uni-predictive MV selection for triangular partition mode. [Figure 12] FIG. 10 is a diagram illustrating an example of weights used in the blending process. [Figure 13] FIG. 10 illustrates an example of motion vector preservation for triangular partition mode. [Figure 14] 1A and 1B illustrate examples of different geometric divisions. [Figure 15] FIG. 10 is a diagram illustrating an example of GEO segmentation parameters. [Figure 16] FIG. 10 is a diagram illustrating an example of a blending operation. [Figure 17] FIG. 10 illustrates an example of a lookup table for a blending operation. [Figure 18] FIG. 10 illustrates an example of a 4x4 motion preservation example with integer and half-pel positions. [Figure 19] FIG. 10 illustrates an example of a motion preservation method. [Figure 20] FIG. 10 is a block diagram illustrating an example of a motion information preservation method. [Figure 21] FIG. 1 is a block diagram illustrating an example of a motion information storage device. [Figure 22] 31 is a block diagram illustrating an exemplary structure of a content supply system 3100 for implementing a content distribution service. [Figure 23] FIG. 2 is a block diagram illustrating the structure of an example of a terminal device.
[0035] Hereinafter, unless expressly specified otherwise, identical reference signs refer to identical or at least functionally equivalent features. DETAILED DESCRIPTION OF THE INVENTION
[0036] In the following description, reference is made to the accompanying drawings, which form a part of this disclosure and which show, by way of illustration, specific aspects of the present embodiments or specific aspects in which the present embodiments may be used. It is understood that the present embodiments may be used in other ways and may include structural or logical changes not shown in the drawings. Therefore, the following detailed description is not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims.
[0037] For example, it is understood that disclosure related to a described method may also apply to a corresponding device or system configured to perform the method, and vice versa. For example, when one or more of particular method steps are described, a corresponding device may include one or more units, e.g., functional units, to perform the described one or more method steps (e.g., a unit performing the one or more steps, or multiple units each performing one or more of the steps), even if such unit or units are not explicitly described or shown in a drawing. On the other hand, for example, when a particular apparatus is described based on one or more units, e.g., functional units, a corresponding method may include one or more steps (e.g., a step performing the function of one or more units, or multiple steps each performing the function of one or more units), to perform the function of the one or more units, even if such step or steps are not explicitly described or shown in a drawing. Furthermore, it is understood that features of various exemplary embodiments and / or aspects described herein may be combined with each other, unless specifically noted otherwise.
[0038] Video coding typically refers to the processing of a series of pictures that form a video or a video sequence. Instead of the term "picture," the terms "frame" or "image" are sometimes used as synonyms in the field of video coding. Video coding (or coding in general) includes two parts: video encoding and video decoding. Video encoding is performed on the source side and typically involves processing (e.g., by compression) the original video picture to reduce the amount of data required to represent the video picture (for more efficient storage and / or transmission). Video decoding is performed on the destination side and typically involves the reverse process compared to the encoder to reconstruct the video picture. Embodiments referring to "coding" a video picture (or pictures in general) shall be understood to relate to "encoding" or "decoding" the video picture or the respective video sequence. The combination of the encoding and decoding parts is also referred to as a codec (coding and decoding).
[0039] In the case of lossless video coding, the original video picture can be reconstructed, i.e., the reconstructed video picture is of the same quality as the original video picture (assuming there is no transmission or other data loss during storage or transmission). In the case of lossy video coding, further compression, e.g., by quantization, is performed to reduce the amount of data representing the video picture, which cannot be perfectly reconstructed at the decoder, i.e., the quality of the reconstructed video picture is reduced or degraded compared to the quality of the original video picture.
[0040] Some video coding standards belong to the group of "lossy hybrid video codecs" (i.e., they combine spatial and temporal prediction in the sample domain with 2D transform coding to apply quantization in the transform domain). Each picture of a video sequence is typically partitioned into a set of non-overlapping blocks, and coding is typically performed at the block level. In other words, at an encoder, video is typically processed, i.e., encoded, at the block (video block) level, for example, by generating a predictive block using spatial (intra-picture) prediction and / or temporal (inter-picture) prediction, subtracting the predictive block from a current block (the block currently being / to be processed) to obtain a residual block, transforming the residual block, and quantizing the residual block in the transform domain to reduce (compress) the amount of data to be transmitted; while at a decoder, in order to reconstruct the current block for representation, an inverse process is applied to the encoded or compressed block compared to the encoder. Furthermore, as the encoder repeats the decoder processing loop, both will generate the same prediction (e.g., intra- and inter-prediction) and / or reconstruction for processing, i.e., coding, of a subsequent block.
[0041] Hereinafter, embodiments of a video coding system 10, a video encoder 20, and a video decoder 30 will be described with reference to FIGS. 1A to 3. FIG.
[0042] 1A is a schematic block diagram illustrating an example coding system 10, e.g., video coding system 10 (or coding system 10 for short), that may use the techniques of the present application. A video encoder 20 (or encoder 20 for short) and a video decoder 30 (or decoder 30 for short) of video coding system 10 represent examples of devices that may be configured to perform techniques in accordance with various examples described herein.
[0043] As shown in FIG. 1A, coding system 10 includes a source device 12 configured to provide encoded picture data 21 to, for example, a destination device 14 for decoding the encoded picture data 13.
[0044] The source device 12 comprises an encoder 20, and may additionally, i.e. optionally, comprise a picture source 16, a pre-processor (or pre-processing unit) 18, for example a picture pre-processor 18, and a communication interface or communication unit 22.
[0045] Picture source 16 may include or be any type of picture capture device, e.g., a camera that captures pictures of the real world, and / or any type of picture generation device, e.g., a computer graphics processor that generates computer-animated pictures, or any type of other device that acquires and / or provides real-world pictures, computer-generated pictures (e.g., screen content, virtual reality (VR) pictures), and / or any combination thereof (e.g., augmented reality (AR) pictures). Picture source may be any type of memory or storage that stores any of the above-mentioned pictures.
[0046] To distinguish between the pre-processor 18 and the processing performed by the pre-processing unit 18 , the picture or picture data 17 may also be referred to as a raw picture or raw picture data 17 .
[0047] The pre-processor 18 is configured to receive (raw) picture data 17 and to perform pre-processing on the picture data 17 to obtain a pre-processed picture 19 or pre-processed picture data 19. The pre-processing performed by the pre-processor 18 may include, for example, cropping, color format conversion (e.g., RGB to YCbCr), color correction, or noise removal. It may be understood that the pre-processing unit 18 may be an optional component.
[0048] Video encoder 20 is configured to receive pre-processed picture data 19 and to provide encoded picture data 21 (further details are described below, eg, with reference to FIG. 2).
[0049] The communication interface 22 of the source device 12 may be configured to receive the encoded picture data 21 via the communication channel 13 and to transmit the encoded picture data 21 (or any further processed version thereof) to another device, such as the destination device 14 or any other device, for storage or direct reconstruction.
[0050] The destination device 14 comprises a decoder 30 (e.g., a video decoder 30), and may additionally, i.e. optionally, comprise a communication interface or communication unit 28, a post-processor 32 (or post-processing unit 32), and a display device 34.
[0051] The communications interface 28 of the destination device 14 is configured to receive the encoded picture data 21 (or any further processed version thereof), for example directly from the source device 12 or from any other source, for example a storage device, for example an encoded picture data storage device, and to provide the encoded picture data 21 to a decoder 30.
[0052] The communication interface 22 and the communication interface 28 may be configured to transmit or receive the encoded picture data 21 or the encoded data 13 between the source device 12 and the destination device 14 via a direct communication link, e.g., a direct wired or wireless connection, or via any type of network, e.g., a wired or wireless network or any combination thereof, or any type of private and public network or any combination thereof.
[0053] The communications interface 22 may be configured, for example, to package the encoded picture data 21 into a suitable format, for example into packets, and / or to process the encoded picture data using any type of transmission encoding or processing for transmission over a communications link or network.
[0054] The communication interface 28, which is the counterpart of the communication interface 22, may be configured, for example, to receive the transmitted data and process the transmitted data using any type of corresponding transmission decoding or processing and / or depackaging to obtain the encoded picture data 21.
[0055] Both communication interface 22 and communication interface 28 may be configured as unidirectional communication interfaces, as indicated by the arrow of communication channel 13 pointing from source device 12 to destination device 14 in FIG. 1A, or as bidirectional communication interfaces, e.g., configured to send and receive messages, e.g., to set up connections, and to confirm and exchange any other information related to the communication link and / or data transmission, e.g., encoded picture data transmission.
[0056] The decoder 30 is configured to receive the encoded picture data 21 and to provide decoded picture data 31 or decoded pictures 31 (further details are described below, for example, with reference to Figure 3 or Figure 5).
[0057] The post-processor 32 of the destination device 14 is configured to post-process the decoded picture data 31 (also called reconstructed picture data), e.g., the decoded picture 31, to obtain post-processed picture data 33, e.g., the post-processed picture 33. The post-processing performed by the post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color correction, cropping or resampling, or any other processing, for example, in order to prepare the decoded picture data 31 for display by, for example, a display device 34.
[0058] A display device 34 of destination device 14 is configured to receive the post-processed picture data 33 for displaying the picture, e.g., to a user or viewer. Display device 34 may be or include any type of display for presenting the reconstructed picture, e.g., an integrated or external display or monitor. The display may include, for example, a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display.
[0059] 1A depicts source device 12 and destination device 14 as separate devices, an embodiment of the device may include both or both of their functionality, i.e., source device 12 or corresponding functionality and destination device 14 or corresponding functionality. In such an embodiment, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and / or software, or by separate hardware and / or software, or any combination thereof.
[0060] As will be clear to those skilled in the art based on this description, the presence and (exact) division of functions of different units or functions within source device 12 and / or destination device 14, as shown in FIG. 1A, may vary depending on the actual device and application.
[0061] Encoder 20 (e.g., video encoder 20) or decoder 30 (e.g., video decoder 30), or both encoder 20 and decoder 30, may be implemented via processing circuitry as shown in FIG. 1B , such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, hardware, dedicated to video coding, or any combination thereof. Encoder 20 may be implemented via processing circuitry 46 to embody the various modules described in connection with encoder 20 of FIG. 2 and / or any other encoder system or subsystem described herein. Decoder 30 may be implemented via processing circuitry 46 to embody the various modules described in connection with decoder 30 of FIG. 3 and / or any other decoder system or subsystem described herein. The processing circuitry may be configured to perform various operations as described below. If the techniques are implemented partially in software, as shown in FIG. 5, a device may store instructions for the software on a suitable non-transitory computer-readable storage medium and execute the instructions using one or more processors in hardware to implement the techniques of this disclosure. Either video encoder 20 and video decoder 30 may be integrated as part of a combined encoder / decoder (codec) within a single device, for example, as shown in FIG. 1B.
[0062] Source device 12 and destination device 14 may comprise any of a wide range of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a display device, a digital media player, a video gaming console, a video streaming device (such as a content service server or content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may use no operating system or any type of operating system. In some cases, source device 12 and destination device 14 may be capable of wireless communication. Thus, source device 12 and destination device 14 may be wireless communication devices.
[0063] 1A is merely an example, and the techniques herein may be applied to video coding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between an encoding device and a decoding device. In other examples, data may be retrieved from local memory, streamed over a network, etc. A video encoding device may encode and store data in memory, and / or a video decoding device may retrieve and decode data from memory. In some examples, encoding and decoding are performed by devices that do not communicate with each other but simply encode data to memory and / or retrieve and decode data from memory.
[0064] For ease of explanation, embodiments of the present application are described herein with reference to reference software for High Efficiency Video Coding (HEVC) or Versatile Video Coding (VVC), which are next-generation video coding standards developed by the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) Joint Working Group on Video Coding (JCT-VC). Those skilled in the art will appreciate that embodiments of the present application are not limited to HEVC or VVC.
[0065] [Encoder and encoding method] Figure 2 shows a schematic block diagram of an exemplary video encoder 20 configured to implement the techniques of the present application. In the example of Figure 2, the video encoder 20 includes an input 201 (or input interface 201), a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a loop filter unit 220, a decoded picture buffer (DPB) 230, a mode selection unit 260, an entropy encoding unit 270, and an output 272 (or output interface 272). The mode selection unit 260 may include an inter prediction unit 244, an intra prediction unit 254, and a partitioning unit 262. The inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The video encoder 20 shown in Figure 2 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.
[0066] The residual calculation unit 204, the transform processing unit 206, the quantization unit 208, and the mode selection unit 260 may be referred to as forming a forward signal path of the encoder 20, while the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer (DPB) 230, the inter prediction unit 244, and the intra prediction unit 254 may be referred to as forming a backward signal path of the video encoder 20. The backward signal path of the video encoder 20 corresponds to the signal path of a decoder (see the video decoder 30 of FIG. 3). The inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the loop filter 220, the decoded picture buffer (DPB) 230, the inter prediction unit 244, and the intra prediction unit 254 may also be referred to as forming a “built-in decoder” of the video encoder 20.
[0067] [Pictures and Picture Segmentation (Pictures and Blocks)] The encoder 20 may be configured to receive, for example, via an input 201, a picture 17 (or picture data 17), e.g., a picture of a series of pictures forming a video or a video sequence. The received picture or picture data may be a preprocessed picture 19 (or preprocessed picture data 19). For simplicity, the following description will refer to the picture 17. The picture 17 may also be referred to as the current picture or the picture to be coded (particularly in video coding, to distinguish the current picture from other pictures, e.g., previously encoded and / or decoded pictures of the same video sequence, i.e., a video sequence that also includes the current picture).
[0068] A (digital) picture is or can be considered as a two-dimensional array or matrix of samples with intensity values. The samples in the array may also be called picture elements (short for picture elements) or pels. The number of samples in the horizontal and vertical directions (or axes) of the array or picture defines the size and / or resolution of the picture. Three color components are typically used to represent color, i.e., a picture may be represented by or contain three sample arrays. In an RBG format or color space, a picture contains corresponding red, green, and blue sample arrays. However, in video coding, each pixel is typically represented in a luminance and chrominance format or color space, such as YCbCr, which contains a luminance component denoted Y (although L may be used instead) and two chrominance components denoted Cb and Cr. The luminance (or luma for short) component Y represents brightness or gray level intensity (e.g., as in a grayscale picture), and the two chrominance (or chroma for short) components Cb and Cr represent color or color information components. Thus, a picture in YCbCr format includes a luminance sample array of luminance sample values (Y) and two chrominance sample arrays of chrominance values (Cb and Cr). A picture in RGB format can be converted or transformed to YCbCr format, and vice versa; this process is also known as color conversion. If a picture is monochrome, the picture may include only a luminance sample array. Thus, a picture may be, for example, an array of luma samples in monochrome format, or an array of luma samples and two corresponding arrays of chroma samples in 4:2:0, 4:2:2, and 4:4:4 color formats.
[0069] Embodiments of video encoder 20 may include a picture partitioning unit (not shown in FIG. 2 ) configured to partition picture 17 into multiple (typically non-overlapping) picture blocks 203. These blocks may also be referred to as root blocks, macroblocks (H.264 / AVC) or coding tree blocks (CTBs) or coding tree units (CTUs) (H.265 / HEVC and VVC). The picture partitioning unit may be configured to partition each picture into corresponding blocks using the same block size for all pictures of a video sequence and the corresponding grid that defines the block size, or to vary the block size among pictures or subsets or groups of pictures.
[0070] In further embodiments, the video encoder may be configured to directly receive blocks 203 of picture 17, e.g., one, some, or all of the blocks that form picture 17. Picture blocks 203 may also be referred to as current picture blocks or picture blocks to be coded.
[0071] Similar to picture 17, picture block 203 here is or can be considered as a two-dimensional array or matrix of samples with intensity values (sample values), although with smaller dimensions than picture 17. In other words, block 203 may comprise, for example, one sample array (e.g., a luma array for a monochrome picture 17, or a luma or chroma array for a color picture), or three sample arrays (e.g., a luma and two chroma arrays for a color picture 17), or any other number and / or type of array depending on the applied color format. The number of samples in the horizontal and vertical directions (or axes) of block 203 defines the size of block 203. A block may therefore be, for example, an M×N (M columns by N rows) array of samples, or an M×N array of transform coefficients.
[0072] The embodiment of video encoder 20 shown in FIG. 2 may be configured to encode picture 17 block by block, eg, encoding and prediction is performed for each block 203.
[0073] The embodiment of video encoder 20 shown in FIG. 2 may further be configured to partition and / or encode pictures by using slices (also referred to as video slices), where a picture may be partitioned or encoded using one or more slices (typically non-overlapping), each of which may include one or more blocks (e.g., CTUs) or one or more groups of blocks (e.g., tiles (H.265 / HEVC and VVC) or bricks (VVC)).
[0074] The embodiment of video encoder 20 shown in FIG. 2 may be further configured to partition and / or encode a picture by using slice / tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), where a picture may be partitioned or encoded using one or more slice / tile groups (typically non-overlapping), each of which may, for example, include one or more blocks (e.g., CTUs) or one or more tiles, and each tile may, for example, be rectangular and include one or more blocks (e.g., CTUs), e.g., full or partial blocks.
[0075] [Residual calculation] The residual calculation unit 204 may be configured to calculate the residual block 205 (also referred to as the residual 205) based on the picture block 203 and the prediction block 265 (further details regarding the prediction block 265 are provided later), for example, by subtracting sample values of the prediction block 265 from sample values of the picture block 203 on a sample-by-sample (pixel-by-pixel) basis to obtain the residual block 205 in the sample domain.
[0076] [conversion] The transform processing unit 206 may be configured to apply a transform, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), to the sample values of the residual block 205 to obtain transform coefficients 207 in a transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients and represent the residual block 205 in the transform domain.
[0077] The transform processing unit 206 may be configured to apply an integer approximation of a DCT / DST, such as the transform specified for H.265 / HEVC. Compared to an orthogonal DCT transform, such an integer approximation is typically scaled by a particular factor. To preserve the norm of the residual blocks processed by the forward and inverse transforms, an additional scaling factor is applied as part of the transform processing. The scaling factor is typically selected based on particular constraints, such as scaling factors that are powers of two with respect to shift operations, the bit depth of the transform coefficients, a trade-off between accuracy and implementation cost, etc. For example, a particular scaling factor may be specified for the inverse transform, e.g., by the inverse transform processing unit 212 (and a corresponding inverse transform, e.g., by the inverse transform processing unit 312 in the video decoder 30), and a corresponding scaling factor for the forward transform, e.g., by the transform processing unit 206 in the encoder 20, may be specified accordingly.
[0078] An embodiment of video encoder 20 (respectively transform processing unit 206) may be configured to encode or compress and then output transform parameters, e.g., one or more types of transform, e.g., directly or via entropy encoding unit 270, so that, for example, video decoder 30 may receive and use the transform parameters for decoding.
[0079] [Quantization] The quantization unit 208 may be configured to quantize the transform coefficients 207, for example, by applying scalar quantization or vector quantization, to obtain quantized coefficients 209. The quantized coefficients 209 may also be referred to as quantized transform coefficients 209 or quantized residual coefficients 209.
[0080] The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, an n-bit transform coefficient may be rounded to an m-bit transform coefficient during quantization, where n is greater than m. The degree of quantization may be changed by adjusting the quantization parameter (QP). For example, in the case of scalar quantization, different scaling may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. The applicable quantization step size may be indicated by the quantization parameter (QP). The quantization parameter may, for example, be an index into a predefined set of applicable quantization step sizes. For example, a small quantization parameter may correspond to fine quantization (small quantization step size) and a large quantization parameter may correspond to coarse quantization (large quantization step size), or vice versa. Quantization may involve division by a quantization step size, and corresponding and / or inverse dequantization, e.g., by the inverse quantization unit 210, may involve multiplication by the quantization step size. Some standards, e.g., HEVC, may be configured to use a quantization parameter to determine the quantization step size. Generally, the quantization step size may be calculated based on the quantization parameter using a fixed-point approximation of an equation involving division. To restore the norm of the residual block, an additional scaling factor may be introduced in the quantization and dequantization, which may change due to the scaling used in the fixed-point approximation of the quantization step size and quantization parameter equations. In one exemplary implementation, the scaling of the inverse transform and dequantization may be combined. Alternatively, customized quantization tables may be used and signaled, e.g., in the bitstream, from the encoder to the decoder. Quantization is a lossy operation, and the loss increases with increasing quantization step size.
[0081] An embodiment of video encoder 20 (respectively quantization unit 208) may be configured to encode and then output a quantization parameter (QP), e.g., directly or via entropy encoding unit 270, so that, for example, video decoder 30 may receive and apply the quantization parameter for decoding.
[0082] [Dequantization] Inverse quantization unit 210 is configured to apply the inverse quantization of quantization unit 208 to the quantized coefficients, e.g., by applying the inverse of the quantization scheme applied by quantization unit 208 based on or using the same quantization step size as quantization unit 208, to obtain dequantized coefficients 211. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211 and correspond to the transform coefficients 207, although they are typically not identical to the transform coefficients due to loss due to quantization.
[0083] [Inverse Transformation] The inverse transform processing unit 212 is configured to apply an inverse transform of the transform applied by the transform processing unit 206, such as an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST) or other inverse transform, to obtain a reconstructed residual block 213 (or corresponding dequantized coefficients 213) in the sample domain. The reconstructed residual block 213 may also be referred to as a transform block 213.
[0084] [Rebuild] The reconstruction unit 214 (e.g., an adder or summator 214) is configured to add the transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265, for example, by adding, sample by sample, the sample values of the reconstructed residual block 213 and the sample values of the prediction block 265, to obtain a reconstructed block 215 in the sample domain.
[0085] [filtering] The loop filter unit 220 (or "loop filter" 220 for short) is configured to filter the reconstructed block 215 to obtain a filtered block 221, or generally, to filter the reconstructed samples to obtain filtered sample values. The loop filter unit is configured, for example, to smooth pixel transitions or otherwise improve video quality. The loop filter unit 220 may include one or more loop filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, or one or more other filters, such as an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination thereof. In one example, the loop filter unit 220 may include a deblocking filter, an SAO filter, and an ALF filter. The filtering process order may be deblocking filter, SAO, and ALF. In another example, a process called luma mapping with chroma scaling (LMCS) (i.e., adaptive in-loop reshaper) is added. This process is performed before deblocking. In another example, deblocking filtering may also be applied to interior sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra-subdivision (ISP) edges. Although loop filter unit 220 is shown in FIG. 2 as being an in-loop filter, in other configurations, loop filter unit 220 may be implemented as a post-loop filter. Filtered block 221 may also be referred to as filtered reconstruction block 221.
[0086] An embodiment of video encoder 20 (respectively loop filter unit 220) may be configured to encode and then output loop filter parameters (such as SAO filter parameters or ALF filter parameters or LMCS parameters), e.g., directly or via entropy encoding unit 270, so that, for example, decoder 30 may receive and apply the same loop filter parameters or respective loop filters for decoding.
[0087] [Decoded Picture Buffer] The decoded picture buffer (DPB) 230 may be a memory that stores reference pictures, or reference picture data in general, for encoding video data by the video encoder 20. The DPB 230 may be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous dynamic random access memory (SDRAM), magnetoresistive random access memory (MRAM), resistive random access memory (RRAM), or other types of memory devices. The decoded picture buffer (DPB) 230 may be configured to store one or more filtered blocks 221. The decoded picture buffer 230 may be further configured to store other previously filtered blocks, e.g., previously reconstructed and filtered blocks 221, of the same current picture or a different picture, e.g., a previously reconstructed picture, to provide a previously reconstructed, i.e., decoded, complete picture (and corresponding reference blocks and samples) and / or a partially reconstructed current picture (and corresponding reference blocks and samples), e.g., for inter-prediction. The decoded picture buffer (DPB) 230 may be configured to store one or more unfiltered reconstructed blocks 215, for example if the reconstructed blocks 215 have not been filtered by the loop filter unit 220, or in general, unfiltered reconstructed samples, or any other further processed version of the reconstructed blocks or samples.
[0088] Mode Selection (Segmentation and Prediction) The mode selection unit 260 comprises a partitioning unit 262, an inter prediction unit 244, and an intra prediction unit 254, and is configured to receive or obtain original picture data, e.g., original block 203 (current block 203 of current picture 17), and reconstructed picture data, e.g., filtered and / or unfiltered reconstructed samples or blocks of the same (current) picture and / or from one or more previously decoded pictures, e.g., from the decoded picture buffer 230 or other buffers (e.g., line buffers, not shown). The reconstructed picture data is used as reference picture data for prediction, e.g., inter prediction or intra prediction, to obtain a prediction block 265 or predictor 265.
[0089] The mode selection unit 260 may be configured to determine or select a partitioning and prediction mode (e.g., intra or inter prediction mode) for the current block prediction mode (not including partitioning) and generate a corresponding prediction block 265, which is used for calculating the residual block 205 and for reconstructing the reconstruction block 215.
[0090] Embodiments of the mode selection unit 260 may be configured to select a partitioning and prediction mode (e.g., from those supported by or available to the mode selection unit 260) that provides the best match, or in other words, the smallest residual (smallest residual means better compression for transmission or storage), or the smallest signaling overhead (smallest signaling overhead means better compression for transmission or storage), or a consideration or balance of both. The mode selection unit 260 may be configured to determine the partitioning and prediction mode based on rate-distortion optimization (RDO), i.e., to select the prediction mode that provides the smallest rate-distortion. In this context, terms such as “best,” “minimum,” “optimum,” etc., do not necessarily refer to an overall “best,” “minimum,” “optimum,” etc., but may refer to the achievement of a termination or selection criterion, such as a value exceeding or falling below a threshold or other constraint, potentially leading to a “suboptimal selection” but reducing complexity and processing time.
[0091] In other words, the partitioning unit 262 may be configured to partition a picture from a video sequence into a series of coding tree units (CTUs), and the CTUs 203 may be further partitioned into smaller block partitions or sub-blocks (which also form blocks), for example, using quad-tree partitioning (QT), binary partitioning (BT), or triple-tree partitioning (TT), or any combination thereof, and may be configured to perform prediction for each of the block partitions or sub-blocks, for example, where mode selection includes selecting a tree structure of the partitioned block 203, and a prediction mode is applied to each of the block partitions or sub-blocks.
[0092] The partitioning (eg, by partitioning unit 260) and prediction processes (by inter-prediction unit 244 and intra-prediction unit 254) performed by exemplary video encoder 20 are described in more detail below.
[0093] [Differentiation] The partitioning unit 262 may be configured to partition a picture from a video sequence into a series of coding tree units (CTUs), and the partitioning unit 262 may partition (or divide) the coding tree units (CTUs) 203 into smaller partitions, for example, smaller blocks of square or rectangular size. For a picture with three sample arrays, a CTU consists of an N×N block of luma samples along with two corresponding blocks of chroma samples. The maximum allowable size of a luma block in a CTU is specified as 128×128 in the currently developing Versatile Video Coding (VVC) standard, but may be specified as a value other than 128×128, for example, 256×256, in the future. The CTUs of a picture may be clustered / grouped as slices / tile groups, tiles, or bricks. A tile covers a rectangular area of the picture, and a tile can be divided into one or more bricks. A brick consists of multiple CTU rows within the tile. A tile that is not partitioned into multiple bricks can be referred to as a brick. However, a brick is a true subset of a tile and is not referred to as a tile. There are two modes of tile groups supported in VVC: raster scan slice / tile group mode and rectangular slice mode. In raster scan tile group mode, a slice / tile group contains a series of tiles in a tile raster scan of a picture. In rectangular slice mode, a slice contains multiple bricks of a picture that collectively form a rectangular region of the picture. The bricks within a rectangular slice are in brick raster scan order of the slice. These smaller blocks (which may also be called sub-blocks) may be further partitioned into even smaller partitions.This is also referred to as tree partitioning or hierarchical tree partitioning, where a root block, for example at root tree level 0 (hierarchical level 0, depth 0), may be recursively partitioned, for example, into two or more blocks at the next lower tree level, for example, into nodes at tree level 1 (hierarchical level 1, depth 1), and these blocks may be again partitioned into two or more blocks at the next lower level, for example, tree level 2 (hierarchical level 2, depth 2), and so on, until the partitioning terminates, for example, because a termination criterion is met, for example, because a maximum tree depth or a minimum block size is reached. Blocks that are not further partitioned are also referred to as leaf blocks or leaf nodes of the tree. A tree using a partitioning into two partitions is called a binary tree (BT), a tree using a partitioning into three partitions is called a ternary tree (TT), and a tree using a partitioning into four partitions is called a quad tree (QT).
[0094] For example, a coding tree unit (CTU) may be or include a CTB of luma samples for a picture having three sample arrays, two corresponding CTBs of chroma samples, or a CTB of a monochrome picture or a picture coded using three distinct color planes and syntax structures used to code the samples. Correspondingly, a coding tree block (CTB) may be an N×N block of samples for some value of N, such that the division of components into CTBs is partitioned. A coding unit (CU) may be or include a coding block of luma samples, two corresponding coding blocks of chroma samples for a picture having three sample arrays, or a coding block of samples of a monochrome picture or a picture coded using three distinct color planes and syntax structures used to code the samples. Correspondingly, a coding block (CB) may be an M×N block of samples for some values of M and N, such that the division of CTBs into coding blocks is partitioned.
[0095] For example, in an embodiment according to HEVC, a coding tree unit (CTU) may be divided into CUs by using a quad-tree structure, denoted as a coding tree. The decision of whether to code a picture area using inter-picture (temporal) prediction or intra-picture (spatial) prediction is made at the leaf CU level. Each leaf CU can be further divided into one, two, or four PUs according to the partition type of the PU. Within one PU, the same prediction process is applied, and related information is transmitted to the decoder on a PU-by-PU basis. After obtaining residual blocks by applying a prediction process based on the partition type of the PU, the leaf CU can be partitioned into transform units (TUs) according to another quad-tree structure similar to the coding tree for CUs.
[0096] In an embodiment, for example, according to the latest video coding standard currently under development, referred to as Versatile Video Coding (VVC), a combined quad-tree nested multi-type tree is used, for example, using a binary and ternary split segmentation structure to partition the coding tree unit. In the coding tree structure within the coding tree unit, the CU can be either square or rectangular. For example, a coding tree unit (CTU) is first partitioned by a quaternary tree. Then, the quaternary tree leaf node can be further partitioned by a multi-type tree structure. The multi-type tree structure has four partition types: vertical binary split (SPLIT_BT_VER), horizontal binary split (SPLIT_BT_HOR), vertical ternary split (SPLIT_TT_VER), and horizontal ternary split (SPLIT_TT_HOR). The multi-type tree leaf node is called a coding unit (CU), and this segmentation is used for prediction and transform processing without any further partitioning, as long as the CU is not too large for the maximum transform length. This means that in most cases, CUs, PUs, and TUs have the same block size in a quad-tree with a nested multi-type tree coding block structure. An exception occurs when the supported maximum transform length is smaller than the width or height of a color component of a CU. VVC develops its own signaling mechanism for partition division information in a quad-tree with a nested multi-type tree coding tree structure. In the signaling mechanism, a coding tree unit (CTU) is treated as the root of a quaternary tree and is first partitioned by the quaternary tree structure. Then, each quaternary tree leaf node (when large enough to allow it) is further partitioned by the multi-type tree structure.In a multitype tree structure, a first flag (mtt_split_cu_flag) is signaled to indicate whether a node is further partitioned; when the node is further partitioned, a second flag (mtt_split_cu_vertical_flag) is signaled to indicate the split direction; and then a third flag (mtt_split_cu_binary_flag) is signaled to indicate whether the split is binary or ternary. Based on the values of mtt_split_cu_vertical_flag and mtt_split_cu_binary_flag, the multitype tree split mode (MttSplitMode) of the CU can be derived by the decoder based on a predefined rule or table. It should be noted that in certain designs, for example, a 64x64 luma block and 32x32 chroma pipeline design in a VVC hardware decoder, TT splitting is prohibited when either the width or height of the luma coding block is greater than 64, as shown in Figure 6. TT splitting is also prohibited when either the width or height of a chroma coding block is greater than 32. The pipeline design divides a picture into virtual pipeline data units (VPDUs), which are defined as non-overlapping units in a picture. In a hardware decoder, consecutive VPDUs are processed simultaneously by multiple pipeline stages. Because the VPDU size is roughly proportional to the buffer size in most pipeline stages, it is important to keep the VPDU size small. In most hardware decoders, the VPDU size can be set to the maximum transform block (TB) size. However, in VVC, ternary tree (TT) and binary tree (BT) partitioning can lead to an increase in the VPDU size. Additionally, it should be noted that if a portion of a tree node block exceeds the bottom or right picture boundary, the tree node block is forced to split until all samples of every coded CU are located within the picture boundary.
[0097] As an example, an intra subpartition (ISP) tool may divide a luma intra prediction block vertically or horizontally into two or four subpartitions depending on the block size.
[0098] In one example, mode select unit 260 of video encoder 20 may be configured to perform any combination of the partitioning techniques described herein.
[0099] As described above, video encoder 20 is configured to determine or select a best or optimal prediction mode from a (e.g., predetermined) set of prediction modes, which may include, for example, intra-prediction modes and / or inter-prediction modes.
[0100] [Intra prediction] The set of intra-prediction modes may include 35 different intra-prediction modes, e.g., non-directional modes such as DC (or mean) mode and planar mode, or directional modes, e.g., as defined in HEVC, or 67 different intra-prediction modes, e.g., non-directional modes such as DC (or mean) mode and planar mode, or directional modes, e.g., as defined for VVC. As an example, some conventional angular intra-prediction modes are adaptively replaced with wide-angle intra-prediction modes for non-square blocks, e.g., as defined in VVC. As another example, to avoid division operations for DC prediction, only the long side is used to calculate the average for non-square blocks. Then, the results of planar mode intra-prediction may be further modified by position-dependent intra-prediction combining (PDPC) methods.
[0101] The intra prediction unit 254 is configured to generate an intra prediction block 265 according to an intra prediction mode from a set of intra prediction modes using reconstructed samples of neighboring blocks of the same current picture.
[0102] The intra prediction unit 254 (or generally the mode selection unit 260) is further configured to output the intra prediction parameters (or generally information indicating the intra prediction mode selected for the block) to the entropy encoding unit 270 in the form of a syntax element 266 to be included in the encoded picture data 21, so that, for example, the video decoder 30 may receive and use the prediction parameters for decoding.
[0103] [Inter Prediction] The set of inter prediction modes (or possible inter prediction modes) depends on the available reference pictures (i.e., previous, at least partially decoded pictures, e.g., stored in DBP 230) and other inter prediction parameters, such as whether the entire reference picture or only a portion of the reference picture, e.g., a search window area around the area of the current block, was used to search for the best matching reference block, and / or whether pixel interpolation, e.g., half / semi-pel, quarter-pel and / or 1 / 16-pel interpolation, was applied.
[0104] In addition to the above prediction modes, skip mode and direct mode can also be applied.
[0105] The inter prediction unit 244 may comprise a motion estimation (ME) unit and a motion compensation (MC) unit (both not shown in FIG. 2). The motion estimation unit may be configured to receive or obtain, for motion estimation, a picture block 203 (current picture block 203 of current picture 17) and a decoded picture 231, or at least one or more previously reconstructed blocks, such as reconstructed blocks of one or more other / different previously decoded pictures 231. For example, a video sequence may include the current picture and the previously decoded picture 231, or in other words, the current picture and the previously decoded picture 231 may be part of or form a series of pictures that form a video sequence.
[0106] The encoder 20 may be configured to, for example, select a reference block from multiple reference blocks of the same or different pictures among multiple other pictures, and provide the reference picture (or reference picture index) and / or an offset (spatial offset) between the position (x, y coordinates) of the reference block and the position of the current block to the motion estimation unit as an inter-prediction parameter. This offset is also called a motion vector (MV).
[0107] The motion compensation unit is configured to obtain, e.g., receive, inter prediction parameters and perform inter prediction based on or using the inter prediction parameters to obtain an inter prediction block 265. The motion compensation performed by the motion compensation unit may involve fetching or generating a prediction block based on motion / block vectors determined by motion estimation, possibly performing interpolation up to sub-pixel accuracy. Interpolation filtering may generate additional pixel samples from known pixel samples, thus potentially increasing the number of candidate prediction blocks that can be used to code the picture block. Upon receiving a motion vector for the PU of the current picture block, the motion compensation unit may locate the prediction block to which the motion vector points in one of the reference picture lists.
[0108] The motion compensation unit may generate syntax elements associated with blocks and video slices for use by video decoder 30 in decoding picture blocks of the video slices. In addition to, or instead of, slices and their respective syntax elements, tile groups and / or tiles and their respective syntax elements may be generated or used.
[0109] [Entropy Coding] Entropy encoding unit 270 is configured to, for example, apply an entropy encoding algorithm or scheme (e.g., a variable length coding (VLC) scheme, a context-adaptive VLC scheme (CAVLC), an arithmetic coding scheme, binarization, context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioned entropy (PIPE) coding, or another entropy encoding method or technique), or bypass (no compression), to quantization coefficients 209, inter-prediction parameters, intra-prediction parameters, loop filter parameters, and / or other syntax elements to obtain encoded picture data 21 that can be output via output 272, for example, in the form of encoded bitstream 21, so that, for example, video decoder 30 may receive and use the parameters for decoding. Encoded bitstream 21 may be transmitted to video decoder 30 or stored in memory for later transmission or retrieval by video decoder 30.
[0110] Other structural variations of the video encoder 20 can be used to encode the video stream. For example, a non-transform-based encoder 20 can quantize the residual signal directly without using the transform processing unit 206 for a particular block or frame. In another implementation, the encoder 20 can have the quantization unit 208 and the inverse quantization unit 210 combined into a single unit.
[0111] [Decoder and decoding method] 3 shows an example of a video decoder 30 configured to implement the techniques of the present application. The video decoder 30 is configured to receive encoded picture data 21 (e.g., encoded bitstream 21), for example, encoded by encoder 20, to obtain a decoded picture 331. The encoded picture data or bitstream includes information for decoding the encoded picture data, for example, data representing picture blocks and associated syntax elements of an encoded video slice (and / or tile group or tile).
[0112] 3, decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., summer 314), a loop filter 320, a decoded picture buffer (DBP) 330, a mode application unit 360, an inter prediction unit 344, and an intra prediction unit 354. Inter prediction unit 344 may be or include a motion compensation unit. Video decoder 30, in some examples, may perform a decoding path that is generally inverse to the encoding path described with respect to video encoder 100 of FIG. 2.
[0113] As described with respect to encoder 20, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer (DPB) 230, inter prediction unit 344, and intra prediction unit 354 are also referred to as forming a "built-in decoder" of video encoder 20. Accordingly, inverse quantization unit 310 may be functionally identical to inverse quantization unit 110, inverse transform processing unit 312 may be functionally identical to inverse transform processing unit 212, reconstruction unit 314 may be functionally identical to reconstruction unit 214, loop filter 320 may be functionally identical to loop filter 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230. Accordingly, the descriptions provided for the respective units and functions of video encoder 20 correspondingly apply to the respective units and functions of video decoder 30.
[0114] [Entropy Decoding] The entropy decoding unit 304 is configured to parse the bitstream 21 (or generally the encoded picture data 21) and, e.g., perform entropy decoding on the encoded picture data 21 to obtain, e.g., quantization coefficients 309 and / or decoded coding parameters (not shown in FIG. 3 ), e.g., any or all of inter-prediction parameters (e.g., reference picture indices and motion vectors), intra-prediction parameters (e.g., intra-prediction modes or indices), transform parameters, quantization parameters, loop filter parameters, and / or other syntax elements. The entropy decoding unit 304 may be configured to apply a decoding algorithm or scheme corresponding to the encoding scheme described with respect to the entropy encoding unit 270 of the encoder 20. The entropy decoding unit 304 may further be configured to provide the inter-prediction parameters, intra-prediction parameters, and / or other syntax elements to the mode application unit 360, and other parameters to other units of the decoder 30. Video decoder 30 may receive syntax elements at the video slice level and / or the video block level. In addition to or instead of slices and their respective syntax elements, tile groups and / or tiles and their respective syntax elements may be received and / or used.
[0115] [Dequantization] Inverse quantization unit 310 may be configured to receive a quantization parameter (QP) (or information related to inverse quantization in general) and quantized coefficients from encoded picture data 21 (e.g., by parsing and / or decoding, e.g., by entropy decoding unit 304), and to apply inverse quantization to the decoded quantized coefficients 309 based on the quantization parameter to obtain dequantized coefficients 311, which may also be referred to as transform coefficients 311. The inverse quantization process may involve using a quantization parameter determined by video encoder 20 for each video block within a video slice (or tile or tile group) to determine the degree of quantization, and similarly, the degree of inverse quantization to be applied.
[0116] [Inverse Transformation] The inverse transform processing unit 312 may be configured to receive the dequantized coefficients 311, also referred to as transform coefficients 311, and to apply a transform to the dequantized coefficients 311 to obtain the reconstructed residual block 213 in the sample domain. The reconstructed residual block 213 may also be referred to as a transform block 313. The transform may be an inverse transform, e.g., an inverse DCT, an inverse DST, an inverse integer transform, or a conceptually similar inverse transform process. The inverse transform processing unit 312 may further be configured to receive transform parameters or corresponding information from the encoded picture data 21 (e.g., by parsing and / or decoding, e.g., by the entropy decoding unit 304) and determine the transform to be applied to the dequantized coefficients 311.
[0117] [Rebuild] The reconstruction unit 314 (e.g., an adder or summator 314) may be configured to add the reconstructed residual block 313 to the prediction block 365, for example, by adding the sample values of the reconstructed residual block 313 and the sample values of the prediction block 365, to obtain the reconstructed block 315 in the sample domain.
[0118] [filtering] The loop filter unit 320 (either in the coding loop or after the coding loop) is configured to filter the reconstruction block 315 to obtain a filtered block 321, for example, to smooth pixel transitions or otherwise improve video quality. The loop filter unit 320 may include one or more loop filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, or one or more other filters, for example, an adaptive loop filter (ALF), a noise suppression filter (NSF), or any combination thereof. In one example, the loop filter unit 320 may include a deblocking filter, an SAO filter, and an ALF filter. The order of the filtering operations may be deblocking filter, SAO, and ALF. In another example, a process called luma mapping with chroma scaling (LMCS) (i.e., adaptive in-loop reshaper) is added. This process is performed before deblocking. In another example, deblocking filtering may also be applied to interior sub-block edges, such as affine sub-block edges, ATMVP sub-block edges, sub-block transform (SBT) edges, and intra-subdivision (ISP) edges. Although loop filter unit 320 is shown in FIG. 3 as being an in-loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.
[0119] [Decoded Picture Buffer] The decoded video blocks 321 of the picture are then stored in a decoded picture buffer 330, which stores the decoded picture 331 as a reference picture for subsequent motion compensation of other pictures and / or for output display, respectively.
[0120] The decoder 30 is arranged to output the decoded pictures 311 for presentation or viewing to a user, for example via an output 312 .
[0121] [prediction] The inter prediction unit 344 may be identical to the inter prediction unit 244 (in particular, the motion compensation unit), and the intra prediction unit 354 may be functionally identical to the inter prediction unit 254, and performs the partitioning or segmentation decision and prediction based on the segmentation and / or prediction parameters or respective information received (e.g., by parsing and / or decoding by the entropy decoding unit 304) from the encoded picture data 21. The mode application unit 360 may be configured to perform prediction (intra or inter prediction) for each block based on the reconstructed picture, block, or respective samples (filtered or unfiltered) to obtain a prediction block 365.
[0122] If the video slice is coded as an intra-coded (I) slice, intra prediction unit 354 of mode application unit 360 is configured to generate a predictive block 365 for a picture block of the current video slice based on the signaled intra prediction mode and data from previously decoded blocks of the current picture. If the video picture is coded as an inter-coded (i.e., B or P) slice, inter prediction unit 344 (e.g., a motion compensation unit) of mode application unit 360 is configured to generate a predictive block 365 for a video block of the current video slice based on the motion vector and other syntax elements received from entropy decoding unit 304. In inter prediction, the predictive block may be generated from one of the reference pictures included in one of the reference picture lists. Video decoder 30 may construct reference frame lists, List0 and List1, based on the reference pictures stored in DPB 330 using a default construction technique. The same or similar may apply to or with embodiments that use tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or instead of slices (e.g., video slices). For example, video may be coded using I, P, or B tile groups and / or tiles.
[0123] Mode application unit 360 is configured to determine prediction information for video blocks of the current video slice by parsing motion vectors or related information and other syntax elements, and uses the prediction information to generate predictive blocks for the current video block being decoded. For example, mode application unit 360 uses some of the received syntax elements to determine the prediction mode (e.g., intra or inter prediction) used to code the video blocks of the video slice, the inter-prediction slice type (e.g., B slice, P slice, or GPB slice), construction information regarding one or more of the reference picture lists for the slice, motion vectors for each inter-encoded video block of the slice, inter-prediction status for each inter-coded video block of the slice, and other information for decoding video blocks in the current video slice. The same or similar may apply for or with embodiments that use tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or instead of slices (e.g., video slices). For example, video may be coded using I, P, or B tile groups and / or tiles.
[0124] The embodiment of video decoder 30 shown in FIG. 3 may be configured to partition and / or decode pictures by using slices (also referred to as video slices), where a picture may be partitioned or decoded using one or more slices (typically non-overlapping), each of which may include one or more blocks (e.g., CTUs) or one or more groups of blocks (e.g., tiles (H.265 / HEVC and VVC) or bricks (VVC)).
[0125] The embodiment of video decoder 30 shown in FIG. 3 may be configured to partition and / or decode a picture by using slice / tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), and a picture may be partitioned or decoded using one or more slice / tile groups (typically non-overlapping), each of which may include, for example, one or more blocks (e.g., CTUs) or one or more tiles, and each tile may be, for example, rectangular in shape and may include one or more blocks (e.g., CTUs), e.g., full or partial blocks.
[0126] Other variations of the video decoder 30 may be used to decode the encoded picture data 21. For example, the decoder 30 may generate the output video stream without using a loop filtering unit 320. For example, a non-transform-based decoder 30 may directly inverse quantize the residual signal without using an inverse transform processing unit 312 for a particular block or frame. In another implementation, the video decoder 30 may have the inverse quantization unit 310 and the inverse transform processing unit 312 combined into a single unit.
[0127] It should be understood that in the encoder 20 and the decoder 30, the processing result of the current step may be further processed and then output to the next step. For example, after interpolation filtering, motion vector derivation or loop filtering, further operations such as clipping or shifting may be performed on the processing result of the interpolation filtering, motion vector derivation or loop filtering.
[0128] It should be noted that further operations may be applied to the derived motion vectors of the current block (including, but not limited to, control point motion vectors in affine mode, sub-block motion vectors in affine, planar, and ATMVP modes, temporal motion vectors, etc.). For example, the value of a motion vector is restricted to a predefined range according to its representation bits. If the representation bits of a motion vector are bitDepth, its range is -2^(bitDepth-1) to 2^(bitDepth-1)-1, where "^" means exponentiation. For example, if bitDepth is set equal to 16, its range is -32768 to 32767, and if bitDepth is set equal to 18, its range is -131072 to 131071. For example, the value of a derived motion vector (e.g., MVs of four 4x4 sub-blocks in one 8x8 block) is restricted so that the maximum difference between the integer parts of the four 4x4 sub-block MVs is equal to or less than N pixels, such as equal to or less than 1 pixel. Below, we provide two methods to constrain motion vectors according to bitDepth.
[0129] 4 is a schematic diagram of a video coding device 400 according to one embodiment of the present disclosure. The video coding device 400 is suitable for implementing the disclosed embodiments described herein. In one embodiment, the video coding device 400 may be a decoder, such as the video decoder 30 of FIG. 1A, or an encoder, such as the video encoder 20 of FIG. 1A.
[0130] Video coding device 400 includes an ingress port 410 (or input port 410) and a receiver unit (Rx) 420 for receiving data, a processor, logic unit, or central processing unit (CPU) 430 for processing the data, a transmitter unit (Tx) 440 and an egress port 450 (or output port 450) for transmitting the data, and a memory 460 for storing the data. Video coding device 400 may include optical / electrical (OE) and electrical / optical (EO) components coupled to ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for inputting and outputting optical or electrical signals.
[0131] The processor 430 is implemented in hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., as a multi-core processor), FPGA, ASIC, and DSP. The processor 430 communicates with the ingress port 410, the receiver unit 420, the transmitter unit 440, the egress port 450, and the memory 460. The processor 430 includes a coding module 470. The coding module 470 implements the disclosed embodiments described above. For example, the coding module 470 implements, processes, prepares, or provides various coding operations. Thus, the inclusion of the coding module 470 provides a significant improvement in the functionality of the video coding device 400 and results in the transformation of the video coding device 400 into different states. Alternatively, the coding module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.
[0132] Memory 460 may comprise one or more disks, tape drives, and solid state drives, and may be used as an overflow data storage device to store programs when such programs are selected for execution and to store instructions and data read during program execution. Memory 460 may be, for example, volatile and / or non-volatile, and may be read-only memory (ROM), random access memory (RAM), ternary content addressable memory (TCAM), and / or static random access memory (SRAM).
[0133] FIG. 5 is a simplified block diagram of an apparatus 500 that may be used as either or both of source device 12 and destination device 14 from FIG. 1A according to an example embodiment.
[0134] Processor 502 in device 500 may be a central processing unit. Alternatively, processor 502 may be any other type of device or devices now existing or later developed capable of manipulating or processing information. While the disclosed implementations may be practiced with a single processor as shown, such as processor 502, benefits of speed and efficiency may be realized using more than one processor.
[0135] The memory 504 in the apparatus 500, in one implementation, may be a read-only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may be used as the memory 504. The memory 504 may comprise code and data 506 accessed by the processor 502 using a bus 512. The memory 504 may further comprise an operating system 508 and application programs 510, the application programs 510 including at least one program that enables the processor 502 to perform the methods described herein. For example, the application programs 510 may include applications 1-N, which further include a video coding application that performs the methods described herein.
[0136] The apparatus 500 may also include one or more output devices, such as a display 518. The display 518, in one example, may be a touch-sensitive display that combines a display with a touch-sensitive element operable to detect touch input. The display 518 may be coupled to the processor 502 via the bus 512.
[0137] Although shown herein as a single bus, bus 512 of device 500 may be comprised of multiple buses. Additionally, secondary storage 514 may be directly coupled to other components of device 500 or may be accessible over a network, and may include a single integrated unit such as a memory card or multiple units such as multiple memory cards. Accordingly, device 500 may be implemented in a wide variety of configurations.
[0138] Some relevant examples are below, please note that JVET meeting document JVET-N1002 is used as reference:
[0139] [I. Merge Prediction] The merge candidate list is constructed by including the following five types of candidates, in order: 1) Spatial MVP from spatially neighboring CUs 2) Temporal MVP from a collocated CU 3) History-based MVP from FIFO tables 4) Pairwise average MVP 5) Zero MV.
[0140] The size of the merge list is signaled in the slice header, and the maximum allowed size of the merge list is an integer, e.g., the number may be 6. For each CU code in merge mode, the index of the best merge candidate is encoded. The generation process for each category of merge candidates is provided in this section.
[0141] [(1) Spatial candidate derivation] As an example, up to four merge candidates are selected from the candidates located at the positions shown in FIG. 6. The derivation order is A0, B0, B1, A1, and B2. Position B2 is considered only if any CU at positions A0, B0, B1, A1 is unavailable (e.g., because it belongs to another slice or tile) or is intra-coded. After the candidate at position A1 is added, the addition of the remaining candidates undergoes a redundancy check. This ensures that candidates with the same motion information are removed from the list. In a possible implementation, only pairs linked by arrows in FIG. 7 are considered, and a candidate is only added to the list if the corresponding candidate used for the redundancy check does not have the same motion information.
[0142] [(2) Time candidate derivation] As an example, only one candidate is added to the list. In particular, in deriving this temporal merge candidate, a scaled motion vector is derived based on the co-located CU belonging to the co-located reference picture. The reference picture list to be used for deriving the co-located CU is explicitly signaled in the slice header. The scaled motion vector for the temporal merge candidate is obtained as shown by the dotted line in FIG. 8 and is scaled from the motion vector of the co-located CU using POC distances tb and td, where tb is defined as the POC difference between the reference picture of the current picture and the current picture, and td is defined as the POC difference between the reference picture of the co-located picture and the co-located picture. The reference picture index of the temporal merge candidate is set equal to zero.
[0143] It should be noted that POC (Picture Order Count) refers to a variable associated with each picture, which uniquely identifies the associated picture among all pictures in a CVS (Coded Video Sequence) and indicates the position of the associated picture in output order relative to the output order positions of other pictures in the same CVS that will be output from the decoded picture buffer, if the associated picture is to be output from the decoded picture buffer.
[0144] [(3) History-based merge candidate derivation] History-based MVP (HMVP) merge candidates are added to the merge list after spatial MVP and TMVP. The motion information of previously coded blocks is saved in a table and used as the MVP for the current CU. A table with multiple HMVP candidates is maintained during the encoding / decoding process. The table is reset when a new CTU row is encountered. Whenever there is a non-subblock inter-coded CU, the associated motion information is added as a new HMVP candidate to the last entry in the table. The most recent multiple HMVP candidates in the table are checked in order and inserted into the candidate list after the TMVP candidate. A redundancy check is applied from the HMVP candidates to the spatial or temporal merge candidates.
[0145] [(4) Pairwise average merging candidate derivation] The pairwise average candidate is generated by averaging predefined pairs of candidates in the existing merge candidate list, where the predefined pairs are defined as {(0,1),(0,2),(1,2),(0,3),(1,3),(2,3)}, for example, where the numbers indicate merge indices into the merge candidate list. The averaged motion vector is calculated separately for each reference list. If both motion vectors are available in one list, these two motion vectors are averaged even when they point to different reference pictures. If only one motion vector is available, it is used directly. If no motion vector is available, the list is kept invalid.
[0146] (5) If the merge list is not full after the pairwise average merge candidates are added, MVPs with 0 are inserted at the end until the maximum number of merge candidates is encountered.
[0147] [II. Bi-prediction] Inter-picture prediction exploits the temporal correlation between pictures to derive a motion-compensated prediction (MCP) for a block of image samples. For each block, a corresponding block in a previously decoded picture can be found, which serves as a predictor. The position of the block in the previously decoded picture is indicated by a motion vector (Δx, Δy), where Δx specifies the horizontal displacement and Δy specifies the vertical displacement relative to the position of the current block. The motion vector (Δx, Δy) can be of fractional sample accuracy to more accurately capture the motion of the underlying object. If the corresponding motion vector has fractional sample accuracy, interpolation is applied to the reference picture to derive the prediction signal. The previously decoded picture is called the reference picture and is indicated by a reference index Δt into the reference picture list.
[0148] In the case of bi-prediction (compared to uni-prediction, which uses one set of motion data), two sets of motion data (Δx0, Δy0, Δt0 and Δx1, Δy1, Δt1) are used to generate two MCPs (which can be from different pictures or the same picture), which are then combined to obtain the final MCP. Generally, this is derived by averaging. In the case of weighted prediction, different weights can be applied to each MCP. The reference pictures that can be used for bi-prediction are stored in two separate lists: list0 and list1.
[0149] [III. Motion Information Preservation] After motion compensation is performed, the motion information (uni-predictive or bi-predictive) associated with the prediction block is stored in memory, and the stored motion information is used as reference information for future blocks (CU / PU), such as by spatial or temporal motion vector prediction.
[0150] In some examples, motion information storage is performed using a two-dimensional array of motion information sub-blocks or motion information storage units. The spatial resolution of the two-dimensional array may be different from the spatial resolution of the image to be coded. In one example, a motion information storage unit with a lower resolution is used to save memory space. For example, 16x16 luma samples correspond to a single motion information storage unit, which means that each sample in the 16x16 luma samples has the same motion information, and the same motion information is stored in the single motion information storage unit corresponding to the 16x16 luma sample. In other words, the motion information storage unit contains inter-picture prediction information for an associated prediction block consisting of 16x16 luma samples.
[0151] It should also be noted that 16x16 luma samples refers to a set of luma samples that is a two-dimensional sample array, where both the width and height of the two-dimensional sample array are 16. A single motion information storage unit may correspond to 8x8 luma samples, 4x4 luma samples, or other NxM luma or chroma samples, where N and M are positive integers. It can also be understood that a smaller size of the motion information storage unit enables better motion vector prediction but requires more memory space. Motion vector storage for a prediction block of luma samples with a size of 8x8 is illustrated in Figure 9. Motion information of a prediction block labeled Mv0 is stored in each 2x2 motion vector storage unit.
[0152] [III. Triangle Partitioning for Inter Prediction] As an example, the triangle partitioning mode only applies to CUs that are 8x8 or larger and coded in skip or merge mode. An ACU level flag is signaled to indicate whether the triangle partitioning mode applies.
[0153] In the triangular partition mode, a CU is evenly divided into two triangular partitions using either diagonal or anti-diagonal partitioning (FIG. 10). Each triangular partition in a CU is inter-predicted using its own motion. Only uni-prediction is allowed for each partition. That is, each partition has one motion vector and one reference index. The uni-prediction motion constraint is applied to ensure that only two motion-compensated predictions are required for each CU, just like in traditional bi-prediction. The uni-prediction motion for each partition is derived directly from the merge candidate list constructed for merge prediction described above, and the selection of a uni-prediction motion from a given merge candidate in the list follows the "uni-prediction candidate list construction" procedure. After predicting each triangular partition, the sample values along the diagonal or anti-diagonal edges are adjusted using a blending process with adaptive weights. Finally, the motion field of the CU predicted using the triangular partition mode is saved.
[0154] [(1) Constructing a list of candidates for one-sided prediction] As an example in Figure 11, given a merge candidate index, a uni-predictive motion vector is derived from the merge candidate list constructed for merge prediction described above. For a candidate in the list, its LX motion vector (X is equal to the parity of the merge candidate index value) is used as the uni-predictive motion vector for the triangular partition mode. These motion vectors are indicated by "x" in Figure 11. If there is no corresponding LX motion vector, the L(1-X) motion vector of the same candidate in the merge prediction candidate list is used as the uni-predictive motion vector for the triangular partition mode.
[0155] (2) Blending along triangulation edges After predicting each triangle partition using its own motion, blending is applied to the two prediction signals to derive samples around the diagonal or anti-diagonal edges. As shown in Figure 12, the following weights are used in the blending process: {7 / 8, 6 / 8, 5 / 8, 4 / 8, 3 / 8, 2 / 8, 1 / 8} for luma and {6 / 8, 4 / 8, 2 / 8} for chroma.
[0156] [(3) Motion field preservation] As an example, the motion vector of a CU coded in triangular partition mode is stored in a 4x4 unit. Depending on the position of each 4x4 unit, either a uni-predictive or bi-predictive motion vector is stored. Mv1 and Mv2 are shown as uni-predictive motion vectors for partition 1 and partition 2, respectively. If a 4x4 unit is located in an unweighted area as shown in the example of Figure 12, either Mv1 or Mv2 is stored for that 4x4 unit. Otherwise (if the 4x4 unit is located in a weighted area), a bi-predictive motion vector is stored. The bi-predictive motion vector is derived from Mv1 and Mv2 according to the following process: 1) If Mv1 and Mv2 are from different reference picture lists (one from L0 and the other from L1), Mv1 and Mv2 are simply combined to form a bi-predictive motion vector. 2) Otherwise, if Mv1 and Mv2 are from the same list, then without loss of generality, they are assumed to both be from L0. In this case, If any reference picture of Mv2 (or Mv1) appears in L1, Mv2 (or Mv1) is converted to an L1 motion vector using that reference picture in L1. The two motion vectors are then combined to form a bi-predictive motion vector. Otherwise, only the uni-predictive motion Mv1 is preserved instead of the bi-predictive motion.
[0157] As another example, motion vector preservation for triangular partitioning mode is illustrated in FIG.
[0158] IV. Geometric Partitioning for Interblocks For the triangular partition mode, two sub-blocks are divided by a separation line, and the direction of the separation line is 45 degrees or 135 degrees. Other partition angles and partition ratios are also possible, as shown in Fig. 14, for example, which are referred to as GEO (geometric partitioning) modes in this application.
[0159] In one example, the total number of GEO partitions can be 140. This number has been found to be optimal in terms of balancing flexibility and bit cost. Additional signaling for GEO requires signaling for the angle α and the offset ρ of the separation line relative to the center of the block. α represents a quantized angle between 0 and 360 degrees with a separation of 11.25 degrees, and ρ represents a distance with five different values. The meaning of α and ρ is illustrated in Figure 15.
[0160] It can be understood in the technical field of video coding that, in general, the prediction process performed at the encoder side and the prediction process performed at the decoder side are similar, except that at the decoder side, side information is parsed from the bitstream, and at this time, the side information is determined by a pre-set rule, similar to the rate-distortion optimization (RDO) method. As an example, to obtain prediction samples in GEO mode at the decoder side, the following steps are applied:
[0161] S101: Determine the partition ratio for the current block.
[0162] The element syntax geo_partition_idx is parsed from the bitstream and is used as an index into a lookup table that stores α and ρ pairs. In one example, α and ρ are represented by angle and distance indices, respectively.
[0163] S102: Obtain a first prediction mode for a first sub-block and a second prediction mode for a second sub-block.
[0164] In general, the same merge list derivation process used for the triangle partition mode is used to derive motion vectors for each partition (sub-block) of a GEO block. Each partition is predicted by only one prediction. Two element syntaxes, geo_merge_idx0 and geo_merge_idx1, are parsed from the bitstream to indicate the prediction modes of the two sub-blocks, respectively.
[0165] In one example, the first prediction mode is not the same as the second prediction mode. In one example, the prediction mode (the first prediction mode or the second prediction mode) may be an inter prediction mode, and the information for the inter prediction mode may include a reference picture index and a motion vector. In another example, the prediction mode may be an intra prediction mode, and the information for the intra prediction mode may include an intra prediction mode index.
[0166] S103: Generate a first predicted value for the first sub-block and a second predicted value for the second sub-block using the first prediction mode and the second prediction mode, respectively.
[0167] S104: Obtain a combination value of a predicted sample by combining the first predicted value and the second predicted value according to the division disclosed in S101.
[0168] As an example, more specifically, step S104 includes: S104-1: For luma samples in the current block, a sample distance (sample_dist) is calculated, where the sample distance represents the distance of the luma sample to the separation line of the current block determined in S101.
[0169] In one example, the sample distance sample_dist is calculated according to the following formula: sample_dist=((x<<1)+1)*Dis[angleIdx1]+((y<<1)+1))*Dis[angleIdx2]-offset(distanceIdx). angleIdx1 and angleIdx2 are obtained as angle indices from the bitstream in step S101, or are derived based on other information obtained from the bitstream, for example, based on the element syntax geo_partition_idx, and angleIdx1 and angleIdx2 represent the quantized triangular parameters of the separation line. x and y are the horizontal and vertical distances of the sample relative to the top left sample of the current block. ●offset(distanceIdx) is a function of the index value (distanceIdx), which is obtained from the bitstream as a distance index in step S101 or is derived based on other information obtained from the bitstream, for example, derived based on the element syntax geo_partition_idx. ●Dis[] is a predefined lookup table.
[0170] In another example, sample_dist and sampleWeight1 can be obtained according to the following formula: - nCbR=(W>H)?(W / H):(H / W) - sample_dist=(W>H)?(Clip3(0,8,(x / nCbR-y)+4)):(Clip3(0,8,(xy / nCbR)+4)), Or, sample_dist=(W>H)?(Clip3(0,8,(H-1-x / nCbR-y)+4)):(Clip3(0,8,(W-1-xy / nCbR)+4)). W is the width of the current block, and H is the height of the current block.
[0171] It should be noted that the above two examples illustrate two calculation methods that follow integer arithmetic, and embodiments of the present invention are not limited to these examples of calculating sample_dist.
[0172] In one example, sample_dist can be the orthogonal distance between the sample located at (x,y) and the separation line. In another example, a horizontal or vertical line is created that passes through the sample located at (x,y). The horizontal or vertical line has an intersection with the separation line. sample_dist can be the distance between the sample located at (x,y) and the intersection.
[0173] S104-2: The blending operation is implemented as a function that takes sample_dist as input and sampleWeight1 or sampleWeight2 as output.
[0174] The sample_dist is used to calculate weighting factors, which are used for a combined predicted value derived by combining the first predicted value and the second predicted value corresponding to the first sub-block and the second sub-block, respectively. In one example, the weighting factors are denoted as sampleWeight1 and sampleWeight2, referring to the weighting values corresponding to the first predicted value and the second predicted value, respectively. In one example, sampleWeight1 is calculated according to sample_dist, and sampleWeight2 is calculated according to the formula sampleWeight2=T-sampleWeight1, where T is a predefined constant. In one example, the predefined constant T is equal to 8, which means that sampleWeight1 and sampleWeight2 can have values within a value range of 0 to 8 (inclusive). In another example, the predefined constant T is equal to 16.
[0175] According to one example, the first weighting factor sampleWeight1 is obtained according to sample_dist and a lookup table. In one example, the lookup table is used to store the filter coefficients. In other words, the blending operation is implemented according to the lookup table. In such an example, a function of sample_dist can be used as an index value for the lookup table. The function can be an implementation of division or multiplication with a constant operation, a right shift with a quantization operation, an absolute value or clipping operation, or a combination thereof.
[0176] The blending operation is applied to the samples according to the value of the indication in the bitstream or to the samples according to the value of the indication in the bitstream.
[0177] In one example, sampleWeight1=Clip3(0,8,f(sample_dist)). The function f() can be an implementation of division / addition / multiplication with a constant operation, right shift with a quantity operation, absolute value operation or clipping operation, or a combination thereof.
[0178] In one example, sampleWeight1 (or sampleWeight2)=Clip3(0, 8, sample_dist). In one example, sampleWeight1 (or sampleWeight2)=Clip3(0, 8, sample_dist+4). In one example, sampleWeight1 (or sampleWeight2)=sample_dist==4?4:sample_dist<4?0:8. In one example, sampleWeight1 (or sampleWeight2) = Clip3(0, 8, (sample_dist-4) * K + sample_dist). In one example, sampleWeight1 (or sampleWeight2)=sample_dist==0?4:sample_dist<0?0:8. In one example, sampleWeight1 (or sampleWeight2) = Clip3(0, 8, sample_dist * K + Clip3(0, 8, sample_dist + 4)), where K is an integer greater than 0. Note that the blending operation becomes shorter (and therefore sharper) as K increases. For example, if K = 4, the second blending operation is identical to "sampleWeight = sample_dist == 0?4:sample_dist < 0?0:8" illustrated in FIG. 16. According to one example, the value of an indicator in the bitstream indicates the value of K.
[0179] In one example, the blending operation can be implemented as a lookup table, such as the table illustrated in Figure 17. In one example, sampleWeight can be obtained as geoFilter[idx], where idx is obtained as a function of sampleDist and geoFilter is a one-dimensional linear array of filter weights. As an example, idx = min((abs(sample_dist) + 8) >> 4, maxIdx), where maxIdx is the maximum value idx can take.
[0180] S105: According to the division disclosed in step S101 and according to the combining method disclosed in step S104, save the prediction mode information of the current block (for example, motion information including motion vectors or intra prediction information).
[0181] Specifically, in the first embodiment of the decoding process for the GEO prediction mode, This process is invoked when decoding a coding unit with MergeTriangleFlag[xCb][yCb] equal to 1 or geo_flag[xCb][yCb] equal to 1.
[0182] The inputs to this process are: - a luma position (xCb, yCb) that specifies the top-left sample of the current coding block relative to the top-left luma sample of the current picture; - a variable cbWidth that specifies the width of the current coding block in luma samples, - a variable cbHeight that specifies the height of the current coding block in luma samples, - luma motion vectors mvA and mvB at 1 / 16 fractional sample accuracy, - chroma motion vectors mvCA and mvCB, - reference indices refIdxA and refIdxB, - Prediction list flags predListFlagA and predListFlagB.
[0183] The output of this process is: - predSamples, a (cbWidth) x (cbHeight) array of luma prediction samples L , - predSamples, a (cbWidth / 2) x (cbHeight / 2) array of chroma prediction samples for component Cb Cb , - predSamples, a (cbWidth / 2) x (cbHeight / 2) array of chroma prediction samples for component Cr Cr .
[0184] predSamplesLA L and predSamplesLB L Let predSamplesLA be a (cbWidth) × (cbHeight) array of predicted luma sample values. Cb , predSamplesLB Cb ,predSamplesLA Cr , and predSamplesLB Cr Let be a (cbWidth / 2) x (cbHeight / 2) array of predicted chroma sample values.
[0185] predSamples L , predSamples Cb , and predSamples Cr is derived by the following ordered steps:
[0186] 1. If N is each of A and B, then the following applies: - refPicLN, an ordered two-dimensional array of luma samples L and two ordered two-dimensional arrays of chroma samples, refPicLN Cb and refPicLN Cr The reference picture consisting of is derived with inputs X set equal to predListFlagN and refIdxX set equal to refIdxN. - Array predSamplesLN L is the luma position (xCb, yCb), the luma coding block width sbWidth set equal to cbWidth, the luma coding block height sbHeight set equal to cbHeight, the motion vector offset mvOffset set equal to (0,0), the motion vector mvLX set equal to mvN, and refPicLN. L The reference array refPicLX set equal to L , the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 0 as inputs. - Array predSamplesLN Cb is the luma position (xCb, yCb), the coding block width sbWidth set equal to cbWidth / 2, the coding block height sbHeight set equal to cbHeight / 2, the motion vector offset mvOffset set equal to (0,0), the motion vector mvLX set equal to mvCN, and refPicLN Cb The reference array refPicLX set equal to Cb, the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 1 as inputs. - Array predSamplesLN Cr is the luma position (xCb, yCb), the coding block width sbWidth set equal to cbWidth / 2, the coding block height sbHeight set equal to cbHeight / 2, the motion vector offset mvOffset set equal to (0,0), the motion vector mvLX set equal to mvCN, and refPicLN Cr The reference array refPicLX set equal to Cr , the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 2 as inputs. 2. If geo_flag[xCb][yCb] is equal to 1, then the geometric partitioning related variables angleIdx and distanceIdx are set according to the value of geo_partitioning_idx[xCb][yCb] as specified in Table 1. a. The sample weight derivation process for geometric partitioning merge mode is called. The inputs to this process are three ordered arrays, sampleWeightL, sampleWeightC, and motionWeight, of sizes (cbWidth) x (cbHeight), (cbWidth / 2) x (cbHeight / 2), and (cbWidth / 4) x (cbHeight / 4), respectively, and the variables angleIdx, distanceIdx, cbWidth, and cbHeight. b. The predicted samples within the current luma coding block, i.e., predSamplesL[xL][yL], where xL=0..cbWidth-1 and yL=0..cbHeight-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode with inputs: coding block width nCbW set equal to cbWidth, coding block height nCbH set equal to cbHeight, sample arrays predSamplesLAL, predSamplesLBL, predWeightL, and cIdx equal to 0. c. The predicted samples in the current chroma component Cb coding block, i.e., predSamplesCb[xC][yC], where xC=0..cbWidth / 2-1 and yC=0..cbHeight / 2-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode with inputs: coding block width nCbW set equal to cbWidth / 2, coding block height nCbH set equal to cbHeight / 2, sample arrays predSamplesLACb, predSamplesLBCb, predWeightC, and cIdx equal to 1. d. The predicted samples in the current chroma component Cr coding block, i.e., predSamplesCr[xC][yC], where xC=0..cbWidth / 2-1 and yC=0..cbHeight / 2-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode with inputs: coding block width nCbW set equal to cbWidth / 2, coding block height nCbH set equal to cbHeight / 2, sample arrays predSamplesLACr, predSamplesLBCr, predWeightC, and cIdx equal to 2. e. The motion vector preservation process for geometric merge mode is called with the luma coding block position (xCb, yCb), luma coding block width cbWidth, luma coding block height cbHeight, sample array motionWeight, luma motion vectors mvA and mvB, reference indices refIdxA and refIdxB, and prediction list flags predListFlagA and predListFlagB as inputs.
[0187] [Reference Picture Mapping Process for Triangle Merge Mode] The inputs to this process are: - a variable X representing a reference list equal to 0 or 1, - Reference index refIdxN. The output of this process is: - Reference index refIdxTemp.
[0188] The variable refPicPoc is derived as follows: refPicPoc=(X==0) ? RefPicList[0][refIdxN] : RefPicList[1][refIdxN] (8-878)
[0189] The reference picture list refPicListTemp is derived as follows: refPicListTemp=(X==0) ? RefPicList[1] : RefPicList[0] (8-879)
[0190] The variable refIdxTemp is derived as follows: The variable mapStop is set equal to FALSE. - variable refIdx where m=0..NumRefIdxActive[1]-1 m For mapStop, the following applies until mapStop is equal to FALSE: refIdxTemp=(refPicListTemp[refIdxm ]==refPicPoc) ? refIdx m : -1 (8-880) mapStop=(refIdxTemp!=-1) ? TRUE : FALSE (8-881)
[0191] [Sample weight derivation process for geometric partitioning merge mode] The inputs to this process are: - two variables nCbW and nCbH that specify the width and height of the current coding block, - two variables angleIdx and distanceIdx that specify the angle and distance lookup values for the current geometric segmentation mode, - (nCbW) x (nCbH) array sampleWeight L , - (nCbW / 2) x (nCbH / 2) array sampleWeight C , - (nCbW / 4) x (nCbH / 4) array motionWeight.
[0192] The output of this process is three identical arrays of weight values per sample, sampleWeight, ranging from 0...8. L , sampleWeight C , and motionWeight. 1. sampleWeight for the current geometric segmentation mode L The luma blending weights stored in are derived as follows:
[0193] The values of the following variables are set: - wIdx is set to log2(nCbW)-3, - hIdx is set to log2(nCbH)-3, - stepOffset is set to 64, - The following variables are set according to the comparison (wIdx>=hIdx), - whRratio=(wIdx>=hIdx) ? wIdx-hIdx:hIdx-wIdx (8-882) - wIsLargerH=(wIdx>=hIdx)?true:false (8-883) - scaleStep=(wIdx>=hIdx) ? (1< <hIdx):(1<<wIdx) (8-884) - displacementX is set to angleIdx, - displacementY is set to (displacementX+8)%32, - angleN is angleN=angleIdx if angleIdx>=0&&angleIdx<=8, angleN=16-angleIdx if angleIdx>8&&angleIdx<=16, angleN=angleIdx-16 if angleIdx>16&&angleIdx<=24, angleN=32-angleIdx otherwise, is set to - Furthermore, angleN is set to the following value depending on wIsLargerH: angleN=(wIsLargerH)?8-angleN:angleN - stepDis is set according to the values of whRatio and angleN as specified in Table 2, and is further less than or equal to: stepSize=stepDis+stepOffset - rho is set to the following value using the look-up table designated as Dis as specified in Table 3: - rho=distanceIdx*stepSize*scaleStep+nCbW*Dis[displacementX]+nCbH*Dis[displacementY]. (8-885). For each sample position x=0...nCbW-1 and y=0...nCbH-1, sampleWeightL The values of [x][y] are derived as follows: The distance distFromLine is calculated using a lookup table denoted as Dis specified in Table 3 as follows: - distFromLine=((x<<1)+1)*Dis[displacementX]+((y<<1)+1))*Dis[displacementY]-rho. (8-886) The scaled distance distScaled is derived as: - distScaled=min((abs(distFromLine)+8)>>4,14) (8-887)
[0194] sampleWeight L The values of [x][y] are set according to a filter weight lookup table, designated GeoFilter, specified in Table 4 as follows: sampleWeight L [x][y]=GeoFilter[distScaled] if distFromLine<=0 sampleWeight L [x][y]=8-GeoFilter[distScaled] if distFromLine>0
[0195] 2. sampleWeight for the current geometric partitioning mode C The chroma weights stored in are derived as follows: For each sample position x=0...(nCbW / 2)-1 and y=0...(nCbH / 2)-1, sampleWeight C The values of [x][y] are derived as follows: sampleWeight C [x][y]=sampleWeight L [(x<<1)][(y<<1)]
[0196] 3. The motion weights stored in the array motionWeight for the current geometric partitioning mode are derived as follows: - The following variables are set: threshScaler=((log2(nCbW)+log2(nCbH))>>1)-1 threshLower=32>>threshScaler threshUpper=32-threshLower For each sample position x=0...(nCbW / 4)-1 and y=0...(nCbH / 4)-1, the value of motionWeight[x][y] is derived as follows: Cnt=sampleWeight L [(x<<2)][(y<<2)] +sampleWeight L [(x<<2)+3][(y<<2)] +sampleWeight L [(x<<2)][(y<<2)+3] +sampleWeight L [(x<<2)+3][(y<<2)+3]
[0197] The values of motionWeight[x][y] are set as follows: motionWeight[x][y]=0, if Cnt<=threshLower motionWeight[x][y]=1, if Cnt>=threshUpper motionWeight[x][y]=2, otherwise
[0198] Weighted Sample Prediction for Geometric Partitioning Merge Mode The inputs to this process are: - two variables nCbW and nCbH that specify the width and height of the current coding block, - two (nCbW) x (nCbH) arrays predSamplesLA and predSamplesLB, - (nCbW) x (nCbH) array sampleWeight, - A variable cIdx that specifies the color component index.
[0199] The output of this process is a (nCbW) x (nCbH) array of predicted sample values, pbSamples.
[0200] The variable bitDepth is derived as follows: - If cIdx is equal to 0, bitDepth is Y is set equal to - Otherwise, bitDepth is BitDepth C is set equal to
[0201] The variables shift1 and offset1 are derived as follows: - The variable shift1 is set equal to Max(5,17-bitDepth). - The variable offset1 is set equal to 1<<(shift1-1).
[0202] The predicted sample values are derived as follows: pbSamples[x][y]= Clip3(0,(1< <bitDepth)-1, (predSamplesLA[x][y]*sampleWeight[x][y] +predSamplesLB[x][y]*(8-sampleWeight[x][y])+offset1)>>shift1)
[0203] Motion Vector Preservation for Geometric Partitioning Merge Mode This process is invoked when decoding a coding unit with geo_flag[xCb][yCb] equal to 1.
[0204] The inputs to this process are: - a luma position (xCb, yCb) that specifies the top-left sample of the current coding block relative to the top-left luma sample of the current picture; - a variable cbWidth that specifies the width of the current coding block in luma samples, - a variable cbHeight that specifies the height of the current coding block in luma samples, - Array motionWeight of size (cbWidth / 4) x (cbHeight / 4) containing motion assignment indices - luma motion vectors mvA and mvB with 1 / 16 fractional sample accuracy, - reference indices refIdxA and refIdxB, - Prediction list flags predListFlagA and predListFlagB.
[0205] The variables numSbX and numSbY, which specify the number of 4x4 blocks in the current coding block in the horizontal and vertical directions, are set equal to numSbX=cbWidth>>2 and numSbY=cbHeight>>2.
[0206] The variable minSb is set equal to min(numSbX, numSbY).
[0207] The variable refIdxTempA is derived by invoking the reference picture mapping process for triangle merge mode with inputs X set equal to predListFlagA and refIdxN set equal to refIdxA.
[0208] The variable refIdxTempB is derived by invoking the reference picture mapping process for triangle merge mode with inputs X set equal to predListFlagB and refIdxN set equal to refIdxB.
[0209] For each 4x4 sub-block at sub-block index (xSbIdx, ySbIdx), where xSbIdx=0..numSbX-1 and ySbIdx=0..numSbY-1, the following applies: - If motionWeight[xSbIdx][ySbIdx] is equal to 0, the following applies: predFlagL0=(predListFlagA==0) ? 1 : 0 (8-888) predFlagL1=(predListFlagA==0) ? 0 : 1 (8-889) refIdxL0=(predListFlagA==0) ? refIdxA : -1 (8-890) refIdxL1=(predListFlagA==0) ? -1 : refIdxA (8-891) mvL0[0]=(predListFlagA==0) ? mvA[0] : 0 (8-892) mvL0[1]=(predListFlagA==0) ? mvA[1] : 0 (8-893) mvL1[0]=(predListFlagA==0) ? 0 : mvA[0] (8-894) mvL1[1]=(predListFlagA==0) ? 0 : mvA[1] (8-895) - Otherwise, if motionWeight[xSbIdx][ySbIdx] is equal to 1, the following applies: predFlagL0=(predListFlagB==0) ? 1 : 0 (8-896) predFlagL1=(predListFlagB==0) ? 0 : 1 (8-897) refIdxL0=(predListFlagB==0) ? refIdxB : -1 (8-898) refIdxL1=(predListFlagB==0) ? -1 : refIdxB (8-899) mvL0[0]=(predListFlagB==0) ? mvB[0] : 0 (8-900) mvL0[1]=(predListFlagB==0) ? mvB[1] : 0 (8-901) mvL1[0]=(predListFlagB==0) ? 0 : mvB[0] (8-902) mvL1[1]=(predListFlagB==0) ? 0 : mvB[1] (8-903) - Otherwise (motionWeight[xSbIdx][ySbIdx] equals 2), the following applies: - if predListFlagA+predListFlagB is equal to 1, predFlagL0=1 (8-904) predFlagL1=1 (8-905) refIdxL0=(predListFlagA==0) ? refIdxA : refIdxB (8-906) refIdxL1=(predListFlagA==0) ? refIdxB : refIdxA (8-907) mvL0[0]=(predListFlagA==0) ? mvA[0] : mvB[0] (8-908) mvL0[1]=(predListFlagA==0) ? mvA[1] : mvB[1] (8-909) mvL1[0]=(predListFlagA==0) ? mvB[0] : mvA[0] (8-910) mvL1[1]=(predListFlagA==0) ? mvB[1] : mvA[1] (8-911) - If predListFlagA+predListFlagB is equal to 0, the following applies: predFlagL0=1 (8-912) predFlagL1=(refIdxTempA==-1&&refIdxTempB==-1) ? 0 : 1 (8-913) refIdxL0=(refIdxTempB!=-1) ? refIdxA : (8-914) ((refIdxTempA!=-1) ? refIdxB : refIdxA) refIdxL1=(refIdxTempB!=-1) ? refIdxTempB : (8-915) ((refIdxTempA!=-1) ? refIdxTempA : -1) mvL0[0]=(refIdxTempB!=-1) ? mvA[0] : (8-916) ((refIdxTempA!=-1) ? mvB[0] : mvA[0]) mvL0[1]=(refIdxTempB!=-1) ? mvA[1] : (8-917) ((refIdxTempA!=-1) ? mvB[1] : mvA[1]) mvL1[0]=(refIdxTempB!=-1) ? mvB[0] : (8-918) ((refIdxTempA!=-1) ? mvA[0] : 0) mvL1[1]=(refIdxTempB!=-1) ? mvB[1] : (8-919) ((refIdxTempA!=-1) ? mvA[1] : 0) - If predListFlagA+predListFlagB is equal to 2, the following applies: predFlagL0=(refIdxTempA==-1 && refIdxTempB==-1) ? 0 : 1 (8-920) predFlagL1=1 (8-921) refIdxL0=(refIdxTempB!=-1) ? refIdxTempB : (8-922) ((refIdxTempA!=-1) ? refIdxTempA : -1) refIdxL1=(refIdxTempB!=-1) ? refIdxA : (8-923) ((refIdxTempA!=-1) ? refIdxB : refIdxA) mvL0[0]=(refIdxTempB!=-1) ? mvB[0] : (8-924) ((refIdxTempA!=-1) ? mvA[0] : 0) mvL0[1]=(refIdxTempB!=-1) ? mvB[1] : (8-925) ((refIdxTempA!=-1) ? mvA[1] : 0) mvL1[0]=(refIdxTempB!=-1) ? mvA[0] : (8-926) ((refIdxTempA!=-1) ? mvB[0] : mvA[0]) mvL1[1]=(refIdxTempB!=-1) ? mvA[1] : (8-927) ((refIdxTempA!=-1) ? mvB[1] : mvA[1]) - For x=0..3 and y=0..3, the following assignments are made: MvL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=mvL0(8-928) MvL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=mvL1(8-929) RefIdxL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=refIdxL0(8-930) RedIdxL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=refIdxL1(8-931) PredFlagL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=predFlagL0(8-932) PredFlagL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=predFlagL1(8-933) [Table 1] TIFF2025114690000003.tif18897 [Table 2] [Table 3] [Table 4]
[0210] In a second embodiment of the decoding process for the GEO prediction mode, the motion information preservation process is as follows.
[0211] The coding block is subdivided into K motion save units. In one example, the size of the coding block is M×N luma samples, and each motion save unit has luma samples of the same size of (M / K)×(N / K). In one example, the value of K is 4, the value of M is 16, and the value of N is 16, and in this example, each motion save unit is associated with a luma sub-block of size 4×4. The top-left luma position (x, y) of the coding block is associated with the top-left position (x / K, y / K) of the motion save block.
[0212] For a motion save unit, determine whether to save the first uni-predictive motion information, the second uni-predictive motion information, or the bi-predictive motion information according to the first sample weight or the second sample weight. In one example, the determination is based on the distance of the samples in the motion save unit to the partition boundary. The samples can be integer samples or fractional samples. The separation line is defined as the partition line of the geometric partition mode. According to one example, K is equal to 4 (the width and height of the motion save unit in terms of luma samples). An example of dividing a coding block into motion save units is shown in FIG. 13.
[0213] According to one example, the distance between a sample and a separation boundary can be calculated as follows: For a luma sample within a block, a sample distance (sample_dist) is calculated, which represents the distance of the luma sample to the separation line of the block.
[0214] In one example, the sample distance sample_dist is calculated according to the following formula: sample_dist=((x<<1)+1)*Dis[angleIdx1]+((y<<1)+1))*Dis[angleIdx2]-offset(distanceIdx) The values of angleIdx1 and angleIdx2 are obtained from the bitstream or derived / calculated based on other information obtained from the bitstream, and angleIdx1 and angleIdx2 represent the quantized triangular parameters of the separating line, where the type of the first triangular parameter is cosine and the type of the second triangular parameter is sine. x and y are the -x and -y coordinates of the sample relative to the top left sample of the coding block. ●offset(distanceIdx) is an offset value that is a function of the index value (distanceIdx), where the index value is obtained from the bitstream or is derived / calculated based on other information obtained from the bitstream. Dis[] is a lookup table. Dis[angleIdx1] represents the change in sample distance (sample_dist) for a unit increment (an increase of 1) in the -x coordinate of the sample. Dis[angleIdx2] represents the change in sample distance (sample_dist) for a unit increment (an increase of 1) in the -y coordinate of the sample.
[0215] Note that the coordinator in the above example does not follow the top-left position of , but the top-left position of the current coding block. Note that the above example illustrates a method of calculation according to integer arithmetic. Embodiments of the present invention are not limited to these examples of calculation of sample_dist.
[0216] Note that according to the above example, the sample coordinator is left shifted by 1 bit ((x<<1), (y<<1)). In this example, the distance calculation can be performed to 1 / 2 sample precision for integer arithmetic, e.g., the sample position at (0.5,0.5) can be calculated.
[0217] FIG. 18 shows a 4x4 motion preservation example with integer and half-pel positions (fractional positions, split boundaries, and distance between sample and split boundary (sample_dist)).
[0218] In one example, the decision refers to whether to save first uni-predictive motion information labeled Mv0, second uni-predictive motion information labeled Mv1, or combined motion information such as bi-predictive motion information labeled Mv2, and is performed according to the following steps: In one example, the decision is performed for one motion save unit, and in another example, the decision is performed for at least two (or all) motion save units included in the coding block. The top-left coordinate of the motion save unit is given by (x / K, y / K), and the width and height of the motion save unit are given by K in terms of luma samples.
[0219] If the calculated distance sample_dist is less than and / or equal to the threshold, the combined motion information (Mv2) is saved for the motion preservation unit. The threshold can be a constant or can be adaptively derived based on the angle of the dividing line, the aspect ratio of the current coding block, or other parameters. Otherwise (if the distance sample_dist is greater than and / or equal to the threshold), the sign of sample_dist is checked.
[0220] If sample_dist is negative (or positive), MV0 (or MV1) is saved with respect to the current motion save unit. Otherwise (sample_dist is positive (or negative)), MV1 (or MV0) is saved for the current motion saving unit.
[0221] FIG. 19 shows an example of motion preservation based on the mentioned method.
[0222] Compared to other motion preserving methods, this method only needs to calculate one sample distance per motion preserving unit, which reduces the computational complexity.
[0223] As shown in FIG. 20, in a third embodiment of the decoding process for the GEO prediction mode, the following is performed.
[0224] For video coding techniques that allow bi-prediction, two reference frame lists are used, for example List0 and List1, or a forward reference frame list and a backward reference frame list. (1) Prediction flag L0 (PFL0) and prediction flag L1 (PFL1). When the prediction flag L0 is true, List0 is used in inter prediction; otherwise (when the prediction flag L0 is false), List0 is not used. The same applies to the prediction flag L1. (2) Reference index L0 (RIL0) and reference index L1 (RIL1). Reference index L0 is used to indicate which reference frame (candidate) from List0 is to be used as the current reference frame. Similarly, reference index L1 is used. Also, in a possible implementation, reference index L0 equal to -1 means that no reference frame from List0 is to be used. (3) Motion vector L0 (MVL0) and motion vector L1 (MVL1) correspond to List0 and List1, respectively, and both of them have horizontal and vertical components.
[0225] After the motion information for the current block has been determined, in a possible implementation, the motion information may be stored and used as reference information for the prediction process of future coding blocks, for example, as predictive motion information of neighboring blocks in spatial prediction or temporal prediction.
[0226] The motion information is stored in a memory, more specifically in this embodiment in a motion information storage unit.
[0227] The current block may be divided into multiple sample sets, each of which has the same size as the sample set, or the current block is set as the sample set. For example, the sample set may be a 4x4 sample array. The size of the sample set may be, but is not limited to, 8x8, 16x16, 8x16, etc. Each of the multiple sample sets corresponds to a respective motion information storage unit, and therefore the motion information of the sample set is stored in the corresponding motion information storage unit. Note that there are two cases for "motion information of a sample set." Case 1: The motion information is used to determine the prediction value of the sample set. Case 2: The motion information is assigned to a sample set for storage.
[0228] Also, in this embodiment, the sample set is a luma sample set, while in other embodiments, the sample set may be a chroma sample set.
[0229] The GEO prediction mode is introduced in the above section. Generally, in GEO prediction, a current block consists of a first sub-block and a second sub-block, the first sub-block and the second sub-block are separated by a common boundary, the first sub-block corresponds to first motion information, and the second sub-block corresponds to second motion information. The first sub-block and the second sub-block may be, but are not limited to, a triangular partition, a trapezoidal partition, an asymmetric rectangular partition, or the like. It can also be understood that, for example, in a triangular partition, each sub-block is a triangular block.
[0230] As an example, in this embodiment, both the first motion information and the second motion information are derived from single prediction. The first motion information may include only RIL0 and MVL0, which means PFL0=1 and PFL1=0, or may include only RIL1 and MVL1, which means PFL0=0 and PFL1=1; similarly, the second motion information may include only RIL0 and MVL0, which means PFL0=1 and PFL1=0, or may include only RIL1 and MVL1, which means PFL0=0 and PFL1=1.
[0231] S201: Angle parameters and distance parameters are determined.
[0232] The common boundary is determined by an angle parameter and a distance parameter.
[0233] (1) In the decoder, In a possible implementation, the angle and distance parameters are parsed directly from the bitstream.
[0234] In another possible implementation, an indicator is parsed from the bitstream and the angle and distance parameters are obtained based on the indicator. The indicator can be an index, and the angle and distance parameters can be determined by checking a lookup table using such index. Alternatively, the angle and distance parameters can be calculated by a function, and the indicator is an input of the function.
[0235] In another possible implementation, two indicators are parsed from the bitstream and the angle parameter is obtained from one of the two indicators and the distance parameter is obtained from the other of the two indicators.
[0236] In this embodiment, the syntax element "geo_partition_idx" is parsed from the bitstream. The angle parameter "angleIdx" and the distance parameter "distanceIdx" are obtained by looking up a lookup table that defines the relationship between "geo_partition_idx" and pairs of "angleIdx" and "distanceIdx". The lookup table may be, for example, Table 1.
[0237] S202: Determine a first calculation parameter based on the angle parameter, calculate a temp angle parameter based on the angle parameter, determine a second calculation parameter based on the temp angle parameter, and calculate a third calculation parameter based on the angle parameter and the distance parameter.
[0238] The first calculation parameter is determined by checking a preset lookup table according to the angle parameter, and the second calculation parameter is determined by checking a lookup table according to the temp angle parameter, and the first calculation parameter and the second calculation parameter are the cosine value and sine value of the same angle respectively. It can be understood that the cosine and sine calculations can be simulated and replaced by the lookup table method, and the computation complexity is reduced.
[0239] In this embodiment, In a possible implementation, the first calculation parameter is set to Dis[angleIdx], where Dis[] is a lookup table, for example, Table 3.
[0240] The temp angle parameter is set to (angleIdx+8)%32, assumed as TempIdx.
[0241] The second calculation parameter is set to Dis[TempIdx].
[0242] Note that, in theory, Dis[angleIdx] and Dis[TempIdx] are the approximate cosine and sine values of the same angle, and the angle represents the geometric relationship between the common boundary and the current block.
[0243] In another possible implementation, the first calculation parameter is set to Dis1[angleIdx], where Dis1[] is a lookup table, for example, Table 3.
[0244] The second calculation parameter is set to Dis2[angleIdx], where Dis2[] is another lookup table.
[0245] Note that Dis1[angleIdx] and Dis2[angleIdx] are the approximate cosine and sine values of the same angle, where the angle represents the geometric relationship between the common boundary and the current block.
[0246] The third calculation parameter is obtained as follows. wIdx is set to log2(nCbW)-3, where nCbW is the width of the current block, hIdx is set to log2(nCbH)-3, where nCbH is the height of the current block, The stepOffset is set to a positive integer, for example, 64.
[0247] Compare wIdx and hIdx. whRratio=(wIdx>=hIdx)?wIdx-hIdx:hIdx-wIdx wIsLargerH=(wIdx>=hIdx)?true:false scaleStep=(wIdx>=hIdx)?(1< <hIdx):(1<<wIdx)
[0248] In another possible implementation, the following can be seen. whRratio=(wIdx>hIdx)?wIdx-hIdx:hIdx-wIdx wIsLargerH=(wIdx>hIdx)?true:false scaleStep=(wIdx>hIdx)?(1< <hIdx):(1<<wIdx) angleN is set as follows: angleN=angleIdx if angleIdx>=0&&angleIdx<=8, angleN=16-angleIdx if angleIdx>8&&angleIdx<=16, angleN=angleIdx-16 if angleIdx>16&&angleIdx<=24, angleN=32-angleIdx otherwise.
[0249] Note that in different implementations, the endpoints angleIdx0, 8, 16, 24 may, for example, belong to different subsections.
[0250] In another possible implementation, angleN is set to: angleN=angleIdx if angleIdx>0&&angleIdx<8, angleN=16-angleIdx if angleIdx>=8&&angleIdx<16, angleN=angleIdx-16 if angleIdx>=16&&angleIdx<24, angleN=32-angleIdx otherwise.
[0251] Additionally, angleN is set to the following value: angleN=(wIsLargerH)?8-angleN:angleN stepDis is set according to the values of whRatio and angleN as specified in a lookup table, for example, Table 2. stepSize=stepDis+stepOffset
[0252] The third calculation parameter rho is set to the following value using a look-up table, for example Table 3, shown as Dis: rho=distanceIdx*stepSize*scaleStep+nCbW*Dis[angleIdx]+nCbH*Dis[TempIdx].
[0253] Correspondingly, in another possible implementation, the third calculation parameter rho may be set as follows: rho=distanceIdx*stepSize*scaleStep+nCbW*Dis1[angleIdx]+nCbH*Dis2[angleIdx].
[0254] It should be noted that the first, second, and third calculation parameters can be determined after the angle parameter and the distance parameter are determined. In a possible implementation, the first, second, and third calculation parameters are calculated only once as parameters for all samples in the current block. Also, if the first, second, and third calculation parameters of the current block have already been determined, steps S201 and S202 can be skipped in the motion information preservation process.
[0255] S203: Determine the distance between the sample set in the current block and the common boundary.
[0256] The distance is calculated as follows: distFromLine=(x+K)*P1+(y+K)*P2-P3 P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively; distFromLine represents the distance; K is a non-negative integer; x represents the horizontal coordinate of the target position in the sample set; y represents the vertical coordinate of the target position in the rectangular coordinate system; the position of the top-left sample of the current block is set as the coordinate origin; the right direction is set as the positive horizontal direction; and the downward direction is set as the positive vertical direction.
[0257] In a possible implementation, K is equal to 1. distFromLine=(x+1)*P1+(y+1)*P2-P3.
[0258] Note that the distance between the sample set in the current block and the common boundary is generally the distance between the target position in the sample set and the common boundary.
[0259] The target position in the sample set is predetermined, for example, the predetermined position may be the top left position of the sample set, or the center position of the sample set, or any other position of the sample set.
[0260] It should be noted that the target position may be the position of an integer sample position in the sample set, or the target position may be the position of a fractional sample position. For example, the target position may be the position of the centroid of the current block. More specifically, if the current block is a 4x4 sample array, the target position may be the position of coordinates (1.5,1.5) in the rectangular coordinate system of this embodiment.
[0261] In a possible implementation, the distance has a sample precision of more than an integer sample. Correspondingly, the distance is calculated by: distFromLine=((x< <N)+K)*P1+((y<<N)+K)*P2-P3 2 N represents the reciprocal of the distance sample precision, for example, if the distance sample precision is half pixel precision, N is equal to 1, and if the distance sample precision is quarter pixel precision, N is equal to 2.
[0262] As an example, the distance is calculated by: distFromLine=((x<<1)+1)*Dis[angleIdx]+((y<<1)+1)*Dis[TempIdx]-rho
[0263] S204: Compare the distance to a threshold to determine whether third motion information is preserved for the sample set.
[0264] The third motion information is derived from the first motion information and the second information. In a possible implementation, the third motion information is a combination of the first motion information and the second motion information, similar to the motion information for bi-prediction. More specifically, if the first motion information includes RILX_first and MVLX_first, the second motion information includes RILY_second and MVLY_second, where X may be 0 or 1 and Y may be 0 or 1, the third motion information may include all of RILX_first, MVLX_first, RILY_second, and MVLY_second, which means PFL0=1 and PFL1=1.
[0265] In another possible implementation, if both the first motion information and the second motion information correspond to the same list (List0 or List1), the third motion information may be equal to one of the first motion information or the second motion information. For example, if PFL0 is equal to 1 and PFL1 is equal to 0 for both the first and second motion information, the third motion information may be set equal to the first motion information (or the second motion information according to a different implementation). Similarly, if PFL0 is equal to 0 and PFL1 is equal to 1 for both the first and second motion information, the third motion information may be set equal to the first motion information (or the second motion information according to a different implementation).
[0266] In a possible implementation, the threshold may be a predetermined value.
[0267] In another possible implementation, the threshold value is based on the geometric relationship between the common boundary and the horizontal direction or the geometric relationship between the common boundary and the vertical direction. More specifically, the threshold value is based on the angle between the orthogonal direction of the common boundary and the horizontal or vertical direction. In another implementation, the geometric relationship may include the length relationship between the common boundary and the block boundary of the current block or a sub-block of the current block. In this embodiment, the threshold value may be obtained by a lookup table, for example, Table 5, according to the angle calculated above. Threshold = RhoMax[angleN].
[0268] Note that since angleN can be determined before step S204, the threshold for the current block can be determined before step S204.
[0269] The threshold may be as follows. threshLower = -RhoMax[angleN] threshUpper = RhoMax[angleN].
Table 5
[0270] In another possible implementation, the threshold may be as follows. threshLower = -K threshUpper = K. K is a predetermined positive number. For example, the value of K may be 1. In one example, K can be obtained according to an indicator in the bit stream.
[0271] In another possible implementation, the threshold is based on the width and / or height of the current block.
[0272] Note that the threshold may be determined by two or more of the above conditions. For example, the width and / or height of the current block may determine a ratio, i.e., ratio = 1 << abs(log2(width) - log2(height)), and then this ratio is used to scale the threshold determined by the angle. Also, the scaled threshold is set as the final threshold.
[0273] The comparison between the threshold and the distance is performed.
[0274] S204 - 1: If the absolute value of the distance is less than or equal to the threshold, it is determined that the third motion information is saved for the sample set. S204 - 2: If the absolute value of the distance is greater than the threshold, If the distance is positive (or negative), then determining that the first motion information is to be preserved for the sample set, or If the distance is negative (or positive, according to the branch above), it is determined that the second motion information is preserved for the sample set.
[0275] It can be understood that, according to different implementations, the condition in step S204-1 may be that the absolute value of the distance is smaller than a threshold, and therefore the condition in step S204-2 may be that the absolute value of the distance is greater than or equal to a threshold.
[0276] In another possible implementation, the absolute value calculation is replaced by more subsections.
[0277] In this embodiment, if the distance is less than threshLower, the first motion information is saved for the sample set, if the distance is greater than threshUpper, the second motion information is saved for the sample set, and otherwise the third motion information is saved for the sample set.
[0278] It can also be understood that one of the first motion information, the second motion information, and the third motion information is stored in a motion information storage unit corresponding to the sample set.
[0279] It should be noted that the current block may be divided into multiple sample sets, and in a possible implementation, the above steps in this embodiment are used for all sample sets. In another possible implementation, the above steps in this embodiment are used for only one sample set. In another possible implementation, the above steps in this embodiment are used for at least two sample sets. For sample sets that are not implemented with the above steps, in a possible implementation, default motion information or motion information estimated according to a predetermined condition is saved.
[0280] It should be noted that to determine the preservation of motion information for GEO segmentation, only distance values need to be calculated based on a predetermined GEO segmentation module (function), and the module parameters can be determined at the CU level, which limits the computational complexity.
[0281] In a fourth embodiment of the decoding process for the GEO prediction mode, This process is invoked when decoding a coding unit with MergeTriangleFlag[xCb][yCb] equal to 1 or geo_flag[xCb][yCb] equal to 1.
[0282] The inputs to this process are: - a luma position (xCb, yCb) that specifies the top-left sample of the current coding block relative to the top-left luma sample of the current picture; - a variable cbWidth that specifies the width of the current coding block in luma samples, - a variable cbHeight that specifies the height of the current coding block in luma samples, - luma motion vectors mvA and mvB with 1 / 16 fractional sample accuracy, - chroma motion vectors mvCA and mvCB, - reference indices refIdxA and refIdxB, - Prediction list flags predListFlagA and predListFlagB.
[0283] The output of this process is: - predSamples, a (cbWidth) x (cbHeight) array of luma prediction samples L , - predSamples, a (cbWidth / 2) x (cbHeight / 2) array of chroma prediction samples for component Cb Cb , - predSamples, a (cbWidth / 2) x (cbHeight / 2) array of chroma prediction samples for component Cr Cr .
[0284] predSamplesLA L and predSamplesLB L Let predSamplesLA be the predicted luma sample value (cbWidth) × (cbHeight) array. Cb , predSamplesLB Cb ,predSamplesLA Cr , and predSamplesLB Cr Let be a (cbWidth / 2) x (cbHeight / 2) array of predicted chroma sample values.
[0285] predSamples L , predSamples Cb , and predSamples Cr is derived by the following ordered steps: 3. If N is each of A and B, then the following applies: - refPicLN, an ordered two-dimensional array of luma samples L and two ordered two-dimensional arrays of chroma samples, refPicLN Cb and refPicLN Cr The reference picture consisting of is derived with inputs X set equal to predListFlagN and refIdxX set equal to refIdxN. - Array predSamplesLN L is the luma position (xCb, yCb), the luma coding block width sbWidth set equal to cbWidth, the luma coding block height sbHeight set equal to cbHeight, the motion vector offset mvOffset set equal to (0,0), the motion vectors mvLX and refPicLN set equal to mvN. L The reference array refPicLX set equal to L, the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 0, as inputs, by invoking the fractional sample interpolation process. - Array predSamplesLN Cb is the luma position (xCb, yCb), the coding block width sbWidth set equal to cbWidth / 2, the coding block height sbHeight set equal to cbHeight / 2, the motion vector offset mvOffset set equal to (0,0), the motion vector mvLX set equal to mvCN, and refPicLN Cb The reference array refPicLX set equal to Cb , the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 1 as inputs, by invoking the fractional sample interpolation process. - Array predSamplesLN Cr is the luma position (xCb, yCb), the coding block width sbWidth set equal to cbWidth / 2, the coding block height sbHeight set equal to cbHeight / 2, the motion vector offset mvOffset set equal to (0,0), the motion vector mvLX set equal to mvCN, and refPicLN Cr The reference array refPicLX set equal to Cr , the variable bdofFlag set equal to FALSE, and the variable cIdx set equal to 2 as inputs, by invoking the fractional sample interpolation process. 4. If MergeTriangleFlag[xCb][yCb] is equal to 1, then the merge triangle mode variable split direction triangleDir is set equal to merge_triangle_split_dir[xCb][yCb]. a. Predicted samples in the current luma coding block, i.e., x L = 0..cbWidth-1, and y L predSamples = 0..cbHeight-1 L [xL ][y L ] is the coding block width nCbW set equal to cbWidth, the coding block height nCbH set equal to cbHeight, and the sample array predSamplesLA L and predSamplesLB L , and variables triangleDir, and cIdx equal to 0 as inputs by calling the weighted sample prediction process for triangle merge mode. b. The predicted sample in the current chroma component Cb coding block, i.e., x C = 0..cbWidth / 2-1, and y C predSamples = 0..cbHeight / 2-1 Cb [x C ][y C ] is the coding block width nCbW set equal to cbWidth / 2, the coding block height nCbH set equal to cbHeight / 2, and the sample array predSamplesLA Cb and predSamplesLB Cb , and variables triangleDir, and cIdx equal to 1 as inputs by calling the weighted sample prediction process for triangle merge mode. c. Predicted sample in the current chroma component Cr coding block, i.e., x C = 0..cbWidth / 2-1, and y C predSamples = 0..cbHeight / 2-1 Cr [x C ][y C ] is the coding block width nCbW set equal to cbWidth / 2, the coding block height nCbH set equal to cbHeight / 2, and the sample array predSamplesLA Cr and predSamplesLB Cr, and variables triangleDir, and cIdx equal to 2 as inputs by calling the weighted sample prediction process for triangle merge mode. d. The motion vector saving process for merge triangle mode is called with the luma coding block position (xCb, yCb), luma coding block width cbWidth, luma coding block height cbHeight, partition direction triangleDir, luma motion vectors mvA and mvB, reference indices refIdxA and refIdxB, and prediction list flags predListFlagA and predListFlagB as inputs. 5. If geo_flag[xCb][yCb] is equal to 1, the geometric partitioning related variables angleIdx and distanceIdx are set according to the value of geo_partitioning_idx[xCb][yCb] as specified in Table 1. a. The sample weight derivation process for geometric partitioning merge mode is called. The inputs to this process are three ordered arrays, sampleWeightL, sampleWeightC, and motionWeight, of sizes (cbWidth) x (cbHeight), (cbWidth / 2) x (cbHeight / 2), and (cbWidth / 4) x (cbHeight / 4), respectively, and the variables angleIdx, distanceIdx, cbWidth, and cbHeight. b. The predicted samples within the current luma coding block, i.e., predSamplesL[xL][yL], where xL=0..cbWidth-1 and yL=0..cbHeight-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode with inputs: coding block width nCbW set equal to cbWidth, coding block height nCbH set equal to cbHeight, sample arrays predSamplesLAL, predSamplesLBL, predWeightL, and cIdx equal to 0. c. The predicted samples in the current chroma component Cb coding block, i.e., predSamplesCb[xC][yC], where xC=0..cbWidth / 2-1 and yC=0..cbHeight / 2-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode with inputs: coding block width nCbW set equal to cbWidth / 2, coding block height nCbH set equal to cbHeight / 2, sample arrays predSamplesLACb, predSamplesLBCb, predWeightC, and cIdx equal to 1. d. The predicted samples in the current chroma component Cr coding block, i.e., predSamplesCr[xC][yC], where xC=0..cbWidth / 2-1 and yC=0..cbHeight / 2-1, are derived by invoking the weighted sample prediction process for the geometric partitioning merge mode specified in Section 8.5.8.3 with inputs the coding block width nCbW set equal to cbWidth / 2, the coding block height nCbH set equal to cbHeight / 2, the sample arrays predSamplesLACr, predSamplesLBCr, predWeightC, and cIdx equal to 2. e. The motion vector preservation process for geometric merge mode is called with the luma coding block position (xCb, yCb), luma coding block width cbWidth, luma coding block height cbHeight, sample array motionWeight, luma motion vectors mvA and mvB, reference indices refIdxA and refIdxB, and prediction list flags predListFlagA and predListFlagB as inputs.
[0286] [Reference Picture Mapping Process for Triangle Merge Mode] The inputs to this process are: - a variable X representing a reference list equal to 0 or 1, - Reference index refIdxN.
[0287] The output of this process is: - Reference index refIdxTemp.
[0288] The variable refPicPoc is derived as follows: refPicPoc=(X==0) ? RefPicList[0][refIdxN] : RefPicList[1][refIdxN] (8-878) The reference picture list refPicListTemp is derived as follows: refPicListTemp=(X==0) ? RefPicList[1] : RefPicList[0] (8-879) The variable refIdxTemp is derived as follows: - The variable mapStop is set equal to FALSE, - variable refIdx where m=0..NumRefIdxActive[1]-1 m For , the following applies until mapStop is equal to FALSE: refIdxTemp=(refPicListTemp[refIdx m ]==refPicPoc) ? refIdx m : -1 (8-880) mapStop=(refIdxTemp!=-1) ? TRUE : FALSE (8-881)
[0289] [Sample weight derivation process for geometric partitioning merge mode] The inputs to this process are: - two variables nCbW and nCbH that specify the width and height of the current coding block, - two variables angleIdx and distanceIdx that specify the angle and distance lookup values for the current geometric segmentation mode, - (nCbW) x (nCbH) array sampleWeightL , - (nCbW / 2) x (nCbH / 2) array sampleWeight C , - (nCbW / 4) x (nCbH / 4) array motionWeight.
[0290] The output of this process is three identical arrays of weight values per sample, sampleWeight, ranging from 0...8. L , sampleWeight C , and motionWeight. 4. sampleWeight for the current geometric partitioning mode L The luma blending weights stored in are derived as follows: The values of the following variables are set: - wIdx is set to log2(nCbW)-3, - hIdx is set to log2(nCbH)-3, - stepOffset is set to 64, - The following variables are set according to the comparison (wIdx>=hIdx), - whRratio=(wIdx>=hIdx)?wIdx-hIdx:hIdx-wIdx (8-882) - wIsLargerH=(wIdx>=hIdx)?true:false (8-883) - scaleStep=(wIdx>=hIdx)?(1< <hIdx):(1<<wIdx) (8-884) - displacementX is set to angleIdx, - displacementY is set to (displacementX+8)%32, - angleN is set to angleN=angleIdx if angleIdx>=0&&angleIdx<=8, angleN=16-angleIdx if angleIdx>8&&angleIdx<=16, angleN=angleIdx-16 if angleIdx>16&&angleIdx<=24, angleN=32-angleIdx otherwise, - Furthermore, depending on wIsLargerH, angleN is set to the following value: angleN=(wIsLargerH)?8-angleN:angleN - stepDis is set according to the values of whRatio and angleN as specified in Table 2, and further is: stepSize=stepDis+stepOffset rho is set to the following value using the look-up table designated as Dis as specified in Table 3: - rho=distanceIdx*stepSize*scaleStep+nCbW*Dis[displacementX]+nCbH*Dis[displacementY]. (8-885) For each sample position x=0...nCbW-1 and y=0...nCbH-1, sampleWeight L The values of [x][y] are derived as follows: The distance distFromLine[x][y] is calculated using a lookup table denoted as Dis specified in Table 3 as follows: - distFromLine[x][y]=((x<<1)+1)*Dis[displacementX]+((y<<1)+1))*Dis[displacementY]-rho (8-886) The scaled distance distScaled is derived as follows: - distScaled=min((abs(distFromLine[x][y])+8)>>4,14). (8-887) sampleWeight LThe values of [x][y] are set according to the filter weight lookup table designated as geoFilter in Table 4 as follows: sampleWeight L [x][y]=GeoFilter[distScaled] if distFromLine<=0 sampleWeight L [x][y]=8-GeoFilter[distScaled] if distFromLine>0 5. sampleWeight for the current geometric partitioning mode C The chroma weights stored in are derived as follows: For each sample position x=0...(nCbW / 2)-1 and y=0...(nCbH / 2)-1, sampleWeight C The values of [x][y] are derived as follows: sampleWeight C [x][y]=sampleWeight L [(x<<1)][(y<<1)] 6. The motion weights stored in the array motionWeight for the current geometric partitioning mode are derived as follows: - The following variables are set according to Table 5: threshLower=-RhoMax[angleN] threshUpper=RhoMax[angleN] For each sample position x=0...(nCbW / 4)-1 and y=0...(nCbH / 4)-1, the value of motionWeight[x][y] is derived as follows: Cnt=distFromLine[x*4+1][y*4+1] The values of motionWeight[x][y] are set as follows: motionWeight[x][y]=0 if Cnt<=threshLower motionWeight[x][y]=1 if Cnt>=threshUpper motionWeight[x][y]=2 otherwise
[0291] Weighted Sample Prediction for Geometric Partitioning Merge Mode The inputs to this process are: - two variables nCbW and nCbH that specify the width and height of the current coding block, - two (nCbW) x (nCbH) arrays predSamplesLA and predSamplesLB, - (nCbW) x (nCbH) array sampleWeight, - A variable cIdx that specifies the color component index.
[0292] The output of this process is a (nCbW) x (nCbH) array of predicted sample values, pbSamples.
[0293] The variable bitDepth is derived as follows: - If cIdx is equal to 0, bitDepth is Y is set equal to - Otherwise, bitDepth is BitDepth C is set equal to
[0294] The variables shift1 and offset1 are derived as follows: - The variable shift1 is set equal to Max(5,17-bitDepth). - The variable offset1 is set equal to 1<<(shift1-1).
[0295] The predicted sample values are derived as follows: pbSamples[x][y]= Clip3(0,(1< <bitDepth)-1, (predSamplesLA[x][y]*sampleWeight[x][y] +predSamplesLB[x][y]*(8-sampleWeight[x][y])+offset1)>>shift1)
[0296] Motion Vector Preservation for Geometric Partitioning Merge Mode This process is invoked when decoding a coding unit with geo_flag[xCb][yCb] equal to 1.
[0297] The inputs to this process are: - a luma position (xCb, yCb) that specifies the top-left sample of the current coding block relative to the top-left luma sample of the current picture; - a variable cbWidth that specifies the width of the current coding block in luma samples, - a variable cbHeight that specifies the height of the current coding block in luma samples, - an array motionWeight of size (cbWidth / 4) x (cbHeight / 4) containing motion assignment indices, - luma motion vectors mvA and mvB with 1 / 16 sample accuracy, - reference indices refIdxA and refIdxB, - Prediction list flags predListFlagA and predListFlagB
[0298] The variables numSbX and numSbY, which specify the number of 4x4 blocks in the current coding block in the horizontal and vertical directions, are set equal to numSbX=cbWidth>>2 and numSbY=cbHeight>>2.
[0299] The variable minSb is set equal to min(numSbX, numSbY).
[0300] The variable refIdxTempA is derived by invoking the reference picture mapping process for triangle merge mode specified in Section 8.5.7.4 with X set equal to predListFlagA and refIdxN set equal to refIdxA as input.
[0301] The variable refIdxTempB is derived by invoking the reference picture mapping process for triangle merge mode specified in Section 8.5.7.4 with X set equal to predListFlagB and refIdxN set equal to refIdxB as input.
[0302] For each 4x4 sub-block at sub-block index (xSbIdx, ySbIdx), where xSbIdx=0..numSbX-1 and ySbIdx=0..numSbY-1, the following applies: - If motionWeight[xSbIdx][ySbIdx] is equal to 0, the following applies: predFlagL0=(predListFlagA==0) ? 1 : 0 (8-888) predFlagL1=(predListFlagA==0) ? 0:1 (8-889) refIdxL0=(predListFlagA==0) ? refIdxA : -1 (8-890) refIdxL1=(predListFlagA==0) ? -1 : refIdxA (8-891) mvL0[0]=(predListFlagA==0) ? mvA[0] : 0 (8-892) mvL0[1]=(predListFlagA==0) ? mvA[1] : 0 (8-893) mvL1[0]=(predListFlagA==0) ? 0 : mvA[0] (8-894) mvL1[1]=(predListFlagA==0) ? 0 : mvA[1] (8-895) - Otherwise, if motionWeight[xSbIdx][ySbIdx] is equal to 1, the following applies: predFlagL0=(predListFlagB==0) ? 1 : 0 (8-896) predFlagL1=(predListFlagB==0) ? 0 : 1 (8-897) refIdxL0=(predListFlagB==0) ? refIdxB : -1 (8-898) refIdxL1=(predListFlagB==0) ? -1 : refIdxB (8-899) mvL0[0]=(predListFlagB==0) ? mvB[0] : 0 (8-900) mvL0[1]=(predListFlagB==0) ? mvB[1] : 0 (8-901) mvL1[0]=(predListFlagB==0) ? 0 : mvB[0] (8-902) mvL1[1]=(predListFlagB==0) ? 0 : mvB[1] (8-903) - Otherwise (motionWeight[xSbIdx][ySbIdx] equals 2), the following applies: - if predListFlagA+predListFlagB is equal to 1, predFlagL0=1 (8-904) predFlagL1=1 (8-905) refIdxL0=(predListFlagA==0)?refIdxA : refIdxB (8-906) refIdxL1=(predListFlagA==0)?refIdxB : refIdxA (8-907) mvL0[0]=(predListFlagA==0)?mvA[0] : mvB[0] (8-908) mvL0[1]=(predListFlagA==0)?mvA[1] : mvB[1] (8-909) mvL1[0]=(predListFlagA==0)?mvB[0] : mvA[0] (8-910) mvL1[1]=(predListFlagA==0)?mvB[1] : mvA[1] (8-911) - If predListFlagA+predListFlagB is equal to 0, the following applies: predFlagL0=1 (8-912) predFlagL1=(refIdxTempA==-1&&refIdxTempB==-1) ? 0 : 1 (8-913) refIdxL0=(refIdxTempB!=-1)?refIdxA : (8-914) ((refIdxTempA!=-1)?refIdxB : refIdxA) refIdxL1=(refIdxTempB!=-1)?refIdxTempB : (8-915) ((refIdxTempA!=-1)?refIdxTempA : -1) mvL0[0]=(refIdxTempB!=-1)?mvA[0] : (8-916) ((refIdxTempA!=-1)?mvB[0] : mvA[0]) mvL0[1]=(refIdxTempB!=-1)?mvA[1] : (8-917) ((refIdxTempA!=-1)?mvB[1] : mvA[1]) mvL1[0]=(refIdxTempB!=-1)?mvB[0]: (8-918) ((refIdxTempA!=-1)?mvA[0] : 0) mvL1[1]=(refIdxTempB!=-1)?mvB[1]: (8-919) ((refIdxTempA!=-1)?mvA[1] : 0) - If predListFlagA+predListFlagB is equal to 2, the following applies: predFlagL0=(refIdxTempA==-1&&refIdxTempB==-1)?0 : 1 (8-920) predFlagL1=1 (8-921) refIdxL0=(refIdxTempB!=-1)?refIdxTempB : (8-922) ((refIdxTempA!=-1)?refIdxTempA : -1) refIdxL1=(refIdxTempB!=-1)?refIdxA : (8-923) ((refIdxTempA!=-1)?refIdxB : refIdxA) mvL0[0]=(refIdxTempB!=-1)?mvB[0] : (8-924) ((refIdxTempA!=-1)?mvA[0] : 0) mvL0[1]=(refIdxTempB!=-1)?mvB[1] : (8-925) ((refIdxTempA!=-1)?mvA[1] : 0) mvL1[0]=(refIdxTempB!=-1)?mvA[0] : (8-926) ((refIdxTempA!=-1)?mvB[0] : mvA[0]) mvL1[1]=(refIdxTempB!=-1)?mvA[1] : (8-927) ((refIdxTempA!=-1)?mvB[1] : mvA[1]) - If x=0..3 and y=0..3, the following assignments are made: MvL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=mvL0 (8-928) MvL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=mvL1 (8-929) RefIdxL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=refIdxL0 (8-930) RedIdxL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=refIdxL1 (8-931) PredFlagL0[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=predFlagL0 (8-932) PredFlagL1[(xSbIdx<<2)+x][(ySbIdx<<2)+y]=predFlagL1 (8-933)
[0303] In an alternative implementation, step 6 of the "Sample Weight Derivation Process for Geometric Partitioning Merge Mode" can be implemented as follows: 6. The motion weights stored in the array motionWeight for the current geometric partitioning mode are derived as follows: - The following variables are set according to Table 5: threshLower=-RhoMax[angleN] threshUpper=RhoMax[angleN]
[0304] For each sample position x=0...(nCbW / 4)-1 and y=0...(nCbH / 4)-1, the value of motionWeight[x][y] is derived as follows: Cnt=((x<<4)+3)*Dis[displacementX]+((y<<4)+3))*Dis[displacementY]-rho<<1 The values of motionWeight[x][y] are set as follows: motionWeight[x][y]=0 if Cnt<=threshLower motionWeight[x][y]=1 if Cnt>=threshUpper motionWeight[x][y]=2 otherwise
[0305] In the above example implementation of step 6 of the "Sample Weight Derivation Process for Geometric Partitioning Merge Mode," the formula "Cnt=((x<<4)+3)*Dis[displacementX]+((y<<4)+3))*Dis[displacementY]-rho<<1" corresponds to the calculation of the distance between the centroid of the set of samples and the line. The set of samples in this example includes 16 samples with the following coordinates: (x*4,y*4),(x*4+1,y*4),(x*4+2,y*4),(x*4+3,y*4),(x*4,y*4+1),(x*4+1,y*4+1),(x*4+2,y*4+1),(x*4+3,y*4+1),(x*4 ,y*4+2),(x*4+1,y*4+2),(x*4+2,y*4+2),(x*4+3,y*4+2),(x*4,y*4+3),(x*4+1,y*4+3),(x*4+2,y*4+3),(x*4+3,y*4+3).
[0306] The coordinates of the center of gravity are (x*4+1.5, y*4+1.5). Integer arithmetic is the preferred implementation feature, so in the above formula, all of the additional terms in the formula are multiplied by 2 to make the coordinate offset 1.5 an integer (hence 3 in this example).
[0307] In the fifth embodiment, as shown in FIG. 21, the device for storing the motion information is as follows:
[0308] A motion information storage device (3000), wherein a current block consists of a first sub-block and a second sub-block, the first sub-block and the second sub-block being separated by a common boundary, the first sub-block corresponding to first motion information, and the second sub-block corresponding to second motion information, the device (3000) comprising: a calculation module (3001) configured to determine a distance between a sample set in the current block and the common boundary; and a comparison module (3002) configured to compare the distance with a threshold to determine whether third motion information is to be stored for the sample set, the third motion information being derived from the first motion information and the second motion information.
[0309] In a possible implementation, the comparison module (3002) is configured to determine that the third motion information is to be saved for the sample set if the absolute value of the distance is less than or equal to the threshold value.
[0310] In a possible implementation, if the absolute value of the distance is greater than the threshold, the comparison module (3002) is further configured to determine that the first motion information is to be saved with respect to the sample set if the distance is positive, or to determine that the second motion information is to be saved with respect to the sample set if the distance is negative.
[0311] In a possible implementation, the threshold is predetermined.
[0312] In a possible implementation, the threshold is based on a geometric relationship between the common boundary and a horizontal or vertical direction.
[0313] In a possible implementation, the threshold is based on the angle between the orthogonal direction of the common boundary and the horizontal or vertical direction.
[0314] In a possible implementation, the threshold is based on the width and / or height of the current block.
[0315] In a possible implementation, the common boundary is determined by an angle parameter and a distance parameter, and the calculation module (3001) is further configured to determine the angle parameter and the distance parameter.
[0316] In a possible implementation, in the decoder, the calculation module (3001) is further configured to parse the angle parameter and the distance parameter from the bitstream, or to parse an indicator from the bitstream and obtain the angle parameter and the distance parameter based on the indicator.
[0317] In a possible implementation, the calculation module (3001) is further configured to determine a first calculation parameter based on the angle parameter, calculate a temp angle parameter based on the angle parameter, determine a second calculation parameter based on the temp angle parameter, and calculate a third calculation parameter based on the angle parameter and the distance parameter.
[0318] In a possible implementation, the first calculation parameter is determined by checking a pre-set lookup table according to the angle parameter, and the second calculation parameter is determined by checking the lookup table according to the temp angle parameter, and the first calculation parameter and the second calculation parameter are respectively the cosine value and sine value of the same angle.
[0319] In a possible implementation, the distance is calculated by: distFromLine=(x+K)*P1+(y+K)*P2-P3 P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively; distFromLine represents the distance; K is a non-negative integer; x represents the horizontal coordinate of the target position in the sample set; y represents the vertical coordinate of the target position in the rectangular coordinate system; the position of the top-left sample of the current block is set as the coordinate origin, the right direction is set as the positive horizontal direction, and the downward direction is set as the positive vertical direction.
[0320] In a possible implementation, K is equal to 1.
[0321] In a possible implementation, the target locations are predetermined in the sample set.
[0322] In a possible implementation, the predetermined position is the top left position of the sample set or the center position of the sample set.
[0323] In a feasible implementation, the distance has a sample precision of greater than an integer number of samples, Correspondingly, the distance is calculated by: distFromLine=((x< <N)+K)*P1+((y<<N)+K)*P2-P3 2N represents the reciprocal of the sample precision of the distance.
[0324] In a possible implementation, N is equal to 1.
[0325] In a possible implementation, the sample set is the luma sample set of the current block.
[0326] In a possible implementation, the device (3000) further comprises a division module (3003) configured to divide the current block into a plurality of sample sets, each of which has the same size as the sample set, or to set the current block as the sample set.
[0327] In a possible implementation, the sample set is a 4x4 sample array.
[0328] In a possible implementation, each of the plurality of sample sets corresponds to a respective motion information storage unit, and the motion information storage unit is used to store one of the first motion information, the second motion information, and the third motion information.
[0329] In a possible implementation, the first sub-block and the second sub-block are triangular sections, asymmetric rectangular sections, or trapezoidal sections.
[0330] In a possible implementation, the first motion information includes motion information based on a first reference picture list, the second motion information includes motion information based on a second reference picture list, and the third motion information includes the first motion information and the second motion information.
[0331] In a sixth embodiment, an apparatus for decoding a video stream comprises a processor and a memory, the memory storing instructions for causing the processor to perform a method according to any implementation of the third embodiment.
[0332] In a seventh embodiment, an apparatus for encoding a video stream comprises a processor and a memory, the memory storing instructions for causing the processor to perform a method according to any implementation of the third embodiment.
[0333] In an eighth embodiment, a computer-readable storage medium storing instructions that, when executed, cause one or more processors to be configured to code video data, the instructions causing the one or more processors to perform a method according to any implementation of the third embodiment.
[0334] In a ninth embodiment, a computer program comprising program code which, when executed on a computer, performs a method according to any implementation of the third embodiment.
[0335] The following is a description of the application of the encoding and decoding methods as shown in the above embodiments and the system using them.
[0336] 22 is a block diagram showing a content supply system 3100 for realizing a content distribution service. The content supply system 3100 includes a photographing device 3102 and a terminal device 3106, and optionally includes a display 3126. The photographing device 3102 communicates with the terminal device 3106 via a communication link 3104. The communication link may include the communication channel 13 described above. The communication link 3104 includes, but is not limited to, WIFI, Ethernet, cable, wireless (3G / 4G / 5G), USB, or any combination thereof.
[0337] The photographing device 3102 may generate data and encode the data using the encoding method described in the above embodiment. Alternatively, the photographing device 3102 may distribute the data to a streaming server (not shown), which encodes the data and transmits the encoded data to the terminal device 3106. The photographing device 3102 includes, but is not limited to, a camera, a smartphone or pad, a computer or laptop, a video conferencing system, a PDA, an in-vehicle device, or any combination thereof. For example, as described above, the photographing device 3102 may include the source device 12. If the data includes video, the video encoder 20 included in the photographing device 3102 may actually perform the video encoding process. If the data includes audio (i.e., voice), the audio encoder included in the photographing device 3102 may actually perform the audio encoding process. In some practical scenarios, the photographing device 3102 distributes encoded video and audio data by multiplexing them together. In other practical scenarios, for example, in a video conferencing system, the encoded audio data and the encoded video data are not multiplexed, and the image capture device 3102 delivers the encoded audio data and the encoded video data to the terminal device 3106 separately.
[0338] In the content supply system 3100, the terminal device 3106 receives and reproduces the encoded data. The terminal device 3106 may be a device having data reception and reproduction capabilities, such as a smartphone or pad 3108, a computer or laptop 3110, a network video recorder (NVR) / digital video recorder (DVR) 3112, a TV 3114, a set-top box (STB) 3116, a video conferencing system 3118, a video surveillance system 3120, a personal digital assistant (PDA) 3122, an in-vehicle device 3124, or any combination thereof, capable of decoding the encoded data described above. For example, as described above, the terminal device 3106 may include the destination device 14. If the encoded data includes video, the video decoder 30 included in the terminal device prioritizes performing video decoding. If the encoded data includes audio, the audio decoder included in the terminal device prioritizes performing audio decoding.
[0339] For terminal devices with a display, such as a smartphone or pad 3108, a computer or laptop 3110, a network video recorder (NVR) / digital video recorder (DVR) 3112, a TV 3114, a personal digital assistant (PDA) 3122, or an in-vehicle device 3124, the terminal device can send the decoded data to its display. For terminal devices without a display, such as an STB 3116, a video conferencing system 3118, or a video surveillance system 3120, an external display 3126 is internally contacted to receive and show the decoded data.
[0340] When each device in this system performs encoding or decoding, it can use the picture encoding device or picture decoding device as shown in the above embodiments.
[0341] 23 is a diagram showing the structure of an example of the terminal device 3106. After the terminal device 3106 receives a stream from the shooting device 3102, the protocol processing unit 3202 analyzes the transmission protocol of the stream. The protocol includes, but is not limited to, Real Time Streaming Protocol (RTSP), HyperText Transfer Protocol (HTTP), HTTP Live Streaming Protocol (HLS), MPEG-DASH, Real Time Transport Protocol (RTP), Real Time Messaging Protocol (RTMP), or any combination thereof.
[0342] After the protocol processing unit 3202 processes the stream, a stream file is generated. This file is output to the demultiplexing unit 3204. The demultiplexing unit 3204 can separate the multiplexed data into encoded audio data and encoded video data. As mentioned above, in some practical scenarios, for example, in a video conferencing system, the encoded audio data and encoded video data are not multiplexed. In this situation, the encoded data is sent to the video decoder 3206 and the audio decoder 3208 without going through the demultiplexing unit 3204.
[0343] Through the demultiplexing process, a video elementary stream (ES), an audio ES, and optionally subtitles are generated. As described in the above embodiments, the video decoder 3206 including the video decoder 30 decodes the video ES by the decoding method shown in the above embodiments to generate video frames and sends this data to the synchronization unit 3212. The audio decoder 3208 decodes the audio ES to generate audio frames and sends this data to the synchronization unit 3212. Alternatively, the video frames may be stored in a buffer (not shown in FIG. 23) before sending them to the synchronization unit 3212. Similarly, the audio frames may be stored in a buffer (not shown in FIG. 23) before sending them to the synchronization unit 3212.
[0344] The synchronization unit 3212 synchronizes the video and audio frames and provides the video / audio to the video / audio display 3214. For example, the synchronization unit 3212 synchronizes the presentation of video and audio information, which may be coded in a syntax with timestamps for the presentation of the coded audio and visual data and timestamps for the delivery of the data stream itself.
[0345] If the stream contains subtitles, the subtitle decoder 3210 decodes the subtitles, synchronizes them with the video and audio frames, and provides the video / audio / subtitles to the video / audio / subtitle display 3216.
[0346] The present application is not limited to the above-mentioned system, and either the picture encoding device or the picture decoding device in the above-mentioned embodiments can be incorporated into other systems, for example, a car system.
[0347] [Mathematical Operators] The mathematical operators used in this application are similar to those used in the C programming language. However, the results of integer division and arithmetic shift operations are more strictly defined, and additional operations such as exponentiation and real division are defined. Numbering and counting conventions generally start from 0, e.g., "first" is equivalent to 0th, "second" is equivalent to 1st, and so on.
[0348] [arithmetic operators] The following arithmetic operators are defined as follows: [Table 6]
[0349] [Logical Operators] The following logical operators are defined as follows: x&&y Boolean logic "and" for x and y x||y Boolean logic "or" of x and y ! Boolean logic "not" x?y:zIf x is true or not equal to 0, evaluates to the value of y, otherwise evaluates to the value of z.
[0350] [relational operator] The following relational operators are defined as follows: > greater than >= Greater than or equal to < Less than <= Less than or equal to Equals == != not equal to When a relational operator is applied to a syntax element or variable that has been assigned the value "na" (not applicable), the value "na" is treated as the distinct value of that syntax element or variable. The value "na" is considered unequal to any other value.
[0351] [Bitwise Operators] The following bitwise operators are defined as follows: & Bitwise "and". When acting on integer arguments, it acts on the two's complement representation of the integer value. When acting on a binary argument containing fewer bits than another argument, the shorter argument is extended by adding higher bits equal to 0. | Bitwise "or". When acting on integer arguments, it acts on the two's complement representation of the integer value. When acting on a binary argument containing fewer bits than another argument, the shorter argument is extended by adding higher bits equal to 0. ^ Bitwise "exclusive or". When acting on integer arguments, it acts on the two's complement representation of the integer value. When acting on a binary argument containing fewer bits than another argument, the shorter argument is extended by adding higher bits equal to 0. x>>y Arithmetic right shift of the two's complement integer representation of x by the number of bits in y. This function is defined only for non-negative integer values of y. The bit shifted into the most significant bit (MSB) as a result of the right shift has a value equal to the MSB of x before the shift operation. x<<y Arithmetic left shift of the two's complement integer representation of x by the number of bits in y. This function is defined only for non-negative integer values of y. The bit shifted into the least significant bit (LSB) as a result of the left shift has a value equal to 0.
[0352] [Assignment operator] The following arithmetic operators are defined as follows. = Assignment operator ++ Increment, i.e., x++ is equivalent to x=x+1, and when used in an array index, it is evaluated as the value of the variable before the increment operation. -- Decrement, i.e., x-- is equivalent to x=x-1, and when used in an array index, it is evaluated as the value of the variable before the decrement operation. += Increment by the specified amount, i.e., x+=3 is equivalent to x=x+3, x+=(-3) is equivalent to x=x+(-3). -= Decrement by the specified amount, i.e. x-=3 is equivalent to x=x-3, x-=(-3) is equivalent to x=x-(-3).
[0353] [Range notation] The following notation is used to specify a range of values: x=y..zx takes integer values starting from y up to and including z, where x, y, and z are integers and z is greater than y.
[0354] [Mathematical Functions] The following mathematical functions are defined:
number
number
number
number
number
number
number
number
[0355] [Order of operation precedence] When the order of precedence in a formula is not explicitly indicated by the use of parentheses, the following rules apply:
[0356] - An operation with higher precedence is evaluated before any operation with lower precedence.
[0357] - Operations of equal precedence are evaluated in order from left to right.
[0358] The table below specifies the priority of operations from highest to lowest, with higher positions in the table indicating higher priority.
[0359] For operators that are also used in the C programming language, the order of precedence used herein is the same as that used in the C programming language. Table: Operation precedence from highest (top of table) to lowest (bottom of table) [Table 7]
[0360] [Textual explanation of logical operations] In the text, logical statements are written mathematically in the following form: if(condition 0) statement 0 else if(condition 1) statement 1 ... else / *Reference notes for remaining conditions* / statement n can be written as follows: ...as follows / ...the following applies: - If condition 0, statement 0 - Otherwise, if condition 1, statement 1 - ... - Otherwise (reference notes for the remaining conditions), statement n
[0361] Each "If...Otherwise,if...Otherwise,..." statement in the text is introduced with "...as follows" or "...the following applies" immediately followed by "If...". The last condition in an "If...Otherwise,if...Otherwise,..." is always "Otherwise,...". Interleaved "If...Otherwise,if...Otherwise,..." statements can be identified by matching the "...as follows" or "...the following applies" with the final "Otherwise,...".
[0362] In the text, logical statements are written mathematically in the following form: if(condition 0a && condition 0b) statement 0 else if(condition 1a || condition 1b) statement 1 ... else statement n can be written as follows: ...as follows / ...the following applies: - statement 0 if all of the following conditions are true: - condition 0a - condition 0b - Otherwise, if one or more of the following conditions are true, then statement 1: - condition 1a - condition 1b - ... - Otherwise, statement n
[0363] In the text, logical statements are written mathematically in the following form: if(condition 0) statement 0 if(condition 1) statement 1 can be written as follows: When condition 0, statement 0 When condition 1, statement 1.
[0364] Embodiments of, for example, the encoder 20 and the decoder 30, and functions described herein with reference to, for example, the encoder 20 and the decoder 30, may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted over a communication medium as one or more instructions or code for execution by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which correspond to tangible media such as data storage media, or communication media, which include any medium that facilitates transfer of a computer program from one place to another, for example, according to a communication protocol. Thus, computer-readable media may generally correspond to (1) non-transitory tangible computer-readable storage media or (2) communication media, such as a signal or carrier wave. Data storage media may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementing the techniques described in this disclosure. A computer program product may include a computer-readable medium.
[0365] By way of example, and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is appropriately referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead refer to non-transitory, tangible storage media. As used herein, "disk" and "disc" include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where typically, a disk is one that reproduces data magnetically and a disc is one that reproduces data optically with a laser. Combinations of the above should also be included within the scope of computer-readable media.
[0366] The instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field-programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Accordingly, the term "processor," as used herein, may refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. Additionally, in some aspects, the functionality described herein may be provided in dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. Alternatively, the techniques may be implemented entirely in one or more circuits or logic elements.
[0367] The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). While various components, modules, or units are described in this disclosure to highlight functional aspects of devices configured to perform the disclosed techniques, realization by different hardware units is not necessarily required. Rather, the various units may be combined into a codec hardware unit, as described above, in conjunction with suitable software and / or firmware, or may be provided by a collection of interoperating hardware units including one or more processors, as described above. (Item 1) A motion information preservation method, wherein a current block consists of a first sub-block and a second sub-block, the first sub-block and the second sub-block are separated by a common boundary, the first sub-block corresponds to first motion information, and the second sub-block corresponds to second motion information, the method comprising: determining a distance between a set of samples in the current block and the common boundary; comparing the distance to a threshold to determine whether third motion information is saved for the sample set, the third motion information being derived from the first motion information and the second motion information; A motion information preservation method comprising: (Item 2) comparing the distance to a threshold to determine whether the third motion information is saved for the sample set; determining that the third motion information is to be stored for the sample set if the absolute value of the distance is less than or equal to the threshold; Item 1. The method according to item 1, comprising: (Item 3) If the absolute value of the distance is greater than the threshold, the method further comprises: determining that the first motion information is to be preserved for the sample set if the distance is positive; or determining that the second motion information is to be preserved for the sample set if the distance is negative; The method of item 2 further comprises: (Item 4) 4. The method according to any one of items 1 to 3, wherein the threshold value is predetermined. (Item 5) 5. The method according to any one of items 1 to 4, wherein the threshold is based on a geometric relationship between the common boundary and a horizontal or vertical direction. (Item 6) 6. The method according to claim 5, wherein the threshold is based on the angle between the orthogonal direction of the common boundary and the horizontal direction or the vertical direction. (Item 7) 7. The method according to any one of items 1 to 6, wherein the threshold is based on the width and / or height of the current block. (Item 8) The common boundary is determined by an angle parameter and a distance parameter, and before determining the distance between the set of samples in the current block and the common boundary, the method includes: determining said angle parameter and said distance parameter; The method according to any one of items 1 to 7, further comprising: (Item 9) In a decoder, the step of determining said angle parameter and said distance parameter comprises: parsing said angle parameters and said distance parameters from a bitstream; or parsing an indicator from said bitstream; obtaining the angle parameter and the distance parameter based on the indicator; Item 9. The method according to item 8, comprising: (Item 10) After determining the angle parameter and the distance parameter, the method further comprises: determining a first calculation parameter based on the angle parameter; calculating a temp angle parameter based on the angle parameter; determining a second calculation parameter based on the temp angle parameter; calculating a third calculation parameter based on the angle parameter and the distance parameter; 10. The method according to item 8 or 9, further comprising: (Item 11) Item 11. The method according to item 10, wherein the first calculation parameter is determined by checking a preset lookup table according to the angle parameter, and the second calculation parameter is determined by checking the lookup table according to the temp angle parameter, and the first calculation parameter and the second calculation parameter are the cosine value and sine value of the same angle, respectively. (Item 12) The distance is calculated as follows: distFromLine=(x+K)*P1+(y+K)*P2-P3 12. The method according to item 10 or 11, wherein P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively; distFromLine represents the distance; K is a non-negative integer; x represents the horizontal coordinate of the target position in the sample set; y represents the vertical coordinate of the target position in a rectangular coordinate system; the position of the top-left sample of the current block is set as the coordinate origin; the right direction is set as the positive horizontal direction; and the downward direction is set as the positive vertical direction. (Item 13) Item 13. The method of item 12, wherein K is equal to 1. (Item 14) 14. The method according to item 12 or 13, wherein the target locations are predetermined in the sample set. (Item 15) Item 15. The method according to item 14, wherein the predetermined position is the upper left position of the sample set or the center position of the sample set. (Item 16) The sample precision of the distances is higher than integer samples, Correspondingly, the distance is calculated by: distFromLine=((x< <N)+K)*P1+((y<<N)+K)*P2-P3 2 N 16. The method according to any one of items 12 to 15, wherein represents the reciprocal of the sample precision of the distance. (Item 17) Item 14. The method of item 13, wherein N is equal to 1. (Item 18) 18. The method according to any one of items 1 to 17, wherein the sample set is the luma sample set of the current block. (Item 19) Before determining the distance between the set of samples in the current block and the common boundary, the method further comprises: Dividing the current block into a plurality of sample sets, each of the plurality of sample sets having the same size as the current block; or setting the current block as the sample set; 19. The method according to any one of items 1 to 18, further comprising: (Item 20) 20. The method according to any one of items 1 to 19, wherein the sample set is a 4x4 sample array. (Item 21) 20. The method of claim 18 or 19, wherein each of the plurality of sample sets corresponds to a respective motion information storage unit, and the motion information storage unit is used to store one of the first motion information, the second motion information, and the third motion information. (Item 22) 22. The method according to any one of items 1 to 21, wherein the first sub-block and the second sub-block are triangular sections, trapezoidal sections, or asymmetric rectangular sections. (Item 23) A method according to any one of items 1 to 22, wherein the first motion information includes motion information based on a first reference picture list, the second motion information includes motion information based on a second reference picture list, and the third motion information includes the first motion information and the second motion information. (Item 24) A motion information storage device, wherein a current block consists of a first sub-block and a second sub-block, the first sub-block and the second sub-block are separated by a common boundary, the first sub-block corresponds to first motion information, and the second sub-block corresponds to second motion information, the device comprising: a calculation module configured to determine a distance between a set of samples in the current block and the common boundary; a comparison module configured to compare the distance to a threshold to determine whether third motion information is to be saved for the sample set, the third motion information being derived from the first motion information and the second motion information; and A motion information storage device comprising: (Item 25) The comparison module is determining that the third motion information is to be stored for the sample set if the absolute value of the distance is less than or equal to the threshold; Item 25. The device according to item 24, configured as follows: (Item 26) If the absolute value of the distance is greater than the threshold, the comparison module: If the distance is positive, determining that the first motion information is to be preserved for the sample set; or determining that the second motion information is preserved for the sample set if the distance is negative; Item 26. The device according to item 25, further configured as follows: (Item 27) 27. The device according to any one of items 24 to 26, wherein the threshold value is predetermined. (Item 28) 28. The apparatus according to any one of items 24 to 27, wherein the threshold is based on a geometric relationship between the common boundary and a horizontal or vertical direction. (Item 29) Item 29. The apparatus of item 28, wherein the threshold is based on an angle between an orthogonal direction of the common boundary and the horizontal or vertical direction. (Item 30) 30. The apparatus according to any one of items 24 to 29, wherein the threshold is based on the width and / or height of the current block. (Item 31) The common boundary is determined by an angle parameter and a distance parameter, and the calculation module: determining said angle parameter and said distance parameter; The device according to any one of items 24 to 30, further configured as follows: (Item 32) In the decoder, the calculation module Parsing said angle parameters and said distance parameters from the bitstream; or Parse the indicator from the bitstream, obtaining the angle parameter and the distance parameter based on the indicator; Item 32. The device according to item 31, further configured as follows: (Item 33) The calculation module is determining a first calculation parameter based on the angle parameter; Calculating a temp angle parameter based on the above angle parameters; determining a second calculation parameter based on the temp angle parameter; calculating a third calculation parameter based on the angle parameter and the distance parameter; 33. The device according to item 31 or 32, further configured as follows: (Item 34) Item 34. The apparatus of item 33, wherein the first calculation parameter is determined by checking a preset lookup table according to the angle parameter, and the second calculation parameter is determined by checking the lookup table according to the temp angle parameter, and the first calculation parameter and the second calculation parameter are the cosine value and sine value of the same angle, respectively. (Item 35) The distance is calculated as follows: distFromLine=(x+K)*P1+(y+K)*P2-P3 35. The apparatus of item 33 or 34, wherein P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively; distFromLine represents the distance; K is a non-negative integer; x represents the horizontal coordinate of the target position in the sample set; y represents the vertical coordinate of the target position in a rectangular coordinate system; the position of the top-left sample of the current block is set as the coordinate origin; the right direction is set as the positive horizontal direction; and the downward direction is set as the positive vertical direction. (Item 36) Item 36. The apparatus of item 35, wherein K is equal to 1. (Item 37) 37. The apparatus of claim 35 or 36, wherein the target locations are predetermined in the sample set. (Item 38) Item 38. The apparatus according to item 37, wherein the predetermined position is the upper left position of the sample set or the center position of the sample set. (Item 39) The sample precision of the distances is higher than integer samples, Correspondingly, the distance is calculated by: distFromLine=((x< <N)+K)*P1+((y<<N)+K)*P2-P3 2 N 39. The device according to any one of items 35 to 38, wherein represents the reciprocal of the sample precision of the distance. (Item 40) Item 37. The apparatus of item 36, wherein N is equal to 1. (Item 41) 41. The apparatus of any one of items 24 to 40, wherein the sample set is a luma sample set of the current block. (Item 42) The device comprises: Dividing the current block into a plurality of sample sets, each of the plurality of sample sets having the same size as the sample set; or Set the current block as the sample set, 42. The apparatus according to any one of items 24 to 41, further comprising a division module configured as follows: (Item 43) 43. The apparatus of any one of items 24 to 42, wherein the sample set is a 4x4 sample array. (Item 44) Item 44. The apparatus of item 42 or 43, wherein each of the plurality of sample sets corresponds to a respective motion information storage unit, and the motion information storage unit is used to store one of the first motion information, the second motion information, and the third motion information. (Item 45) 45. The device according to any one of items 24 to 44, wherein the first sub-block and the second sub-block are triangular sections, asymmetric rectangular sections, or trapezoidal sections. (Item 46) An apparatus described in any one of items 24 to 45, wherein the first motion information includes motion information based on a first reference picture list, the second motion information includes motion information based on a second reference picture list, and the third motion information includes the first motion information and the second motion information. (Item 47) 24. An apparatus for decoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to perform the method according to any one of items 1 to 23. (Item 48) 24. An apparatus for encoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to perform the method according to any one of items 1 to 23. (Item 49) 24. A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to be configured to code video data, the instructions causing the one or more processors to perform the method of any one of items 1 to 23. (Item 50) 24. A computer program comprising a program code for performing the method according to any one of items 1 to 23, when the computer program is executed on a computer. (Item 51) A computer-readable medium comprising a bitstream encoded / decoded by the method according to any one of items 1 to 23.
Claims
1. receiving a bitstream, the bitstream including coded data and an indicator of a current block, the current block being separated into a first sub-block and a second sub-block by a common boundary, the first sub-block corresponding to first motion information, the second sub-block corresponding to second motion information, and the common boundary being a dividing line in a geometric partitioning mode; decoding the bitstream to obtain the indicator; obtaining an angle parameter and a distance parameter based on the indicator, wherein the angle parameter specifies an angle index of the geometric partitioning mode, the distance parameter specifies a distance index of the geometric partitioning mode, the angle parameter is represented by angleIdx, and the distance parameter is represented by distanceIdx; determining a distance between the sample set in the current block and the common boundary based on a first calculation parameter, a second calculation parameter, and a third calculation parameter, wherein the first calculation parameter is determined by checking a preset lookup table according to the angleIdx, the second calculation parameter is determined by checking the preset lookup table according to (angleIdx+8)%32, and the third calculation parameter is determined based on the angleIdx and the distanceIdx; comparing the distance with a threshold to determine whether to save third motion information for the sample set, wherein if the first motion information and the second motion information are from different reference picture lists, the third motion information is derived by combining the first motion information and the second motion information, and if the first motion information and the second motion information are from the same reference picture list, the third motion information is equal to the first motion information or the second motion information; if the absolute value of the distance is less than the threshold, storing the third motion information for the sample set; A decoding method comprising:
2. determining the distance based on a first calculation parameter, a second calculation parameter, and a third calculation parameter; calculating the distance by using the following formula: distFromLine=((x<<N)+K)*P1+((y<<N)+K)*P2-P3 2. The decoding method of claim 1, wherein distFromLine represents the distance, K is a non-negative integer, N=1, and P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively.
3. If the absolute value of the distance is greater than or equal to the threshold, the decoding method comprises: If the distance is positive, storing the first motion information for the sample set; or if the distance is negative, storing the second motion information for the sample set; The decoding method of claim 1 or 2, further comprising:
4. The decoding method according to any one of claims 1 to 3, wherein the threshold value is predetermined.
5. 5. A decoding method according to claim 1, wherein the sample set is a 4x4 sample array.
6. The decoding method according to any one of claims 1 to 5, wherein the first sub-block and the second sub-block are triangular, trapezoidal or asymmetric rectangular partitions.
7. 7. A decoding method according to claim 1, wherein the first motion information includes a unidirectional predictive motion vector based on a first reference picture list, and the second motion information includes a unidirectional predictive motion vector based on a second reference picture list.
8. A decoding device comprising a processor and a memory, the processor being configured to execute instructions stored in the memory to perform the decoding method of any one of claims 1 to 7.
9. Apparatus for decoding a video stream, comprising a processing circuit configured to perform the decoding method according to any one of claims 1 to 7.
10. A computer readable storage medium storing instructions that, when executed, cause one or more processors to perform the decoding method of any one of claims 1 to 7.
11. 1. A method for storing a bitstream, comprising: receiving one or more bitstreams via at least one receiver; storing the one or more bitstreams in at least one memory; Equipped with the bitstream includes coded data and an indicator of a current block; the current block is separated into a first sub-block and a second sub-block by a common boundary, the first sub-block corresponds to first motion information, and the second sub-block corresponds to second motion information, the common boundary being a dividing line in a geometric partitioning mode, and the bitstream further includes the first motion information and the second motion information; The indicator is used to obtain an angle parameter and a distance parameter, the angle parameter specifying an angle index of the geometric partitioning mode, the distance parameter specifying a distance index of the geometric partitioning mode, the angle parameter represented by angleIdx, and the distance parameter represented by distanceIdx; the angleIdx is used to determine a first calculation parameter by checking a preset lookup table, (angleIdx+8)%32 is used to determine a second calculation parameter by checking the preset lookup table, the angleIdx and the distanceIdx are used to determine a third calculation parameter, and the first calculation parameter, the second calculation parameter, and the third calculation parameter are used to determine a distance between a sample set in the current block and the common boundary; The method, wherein the distance is used to determine whether to save third motion information for the sample set, and if the first motion information and the second motion information are from different reference picture lists, the third motion information is derived by combining the first motion information and the second motion information, and if the first motion information and the second motion information are from the same reference picture list, the third motion information is equal to the first motion information or the second motion information.
12. encoding a current block and an indicator into a bitstream, wherein the current block is separated into a first sub-block and a second sub-block by a common boundary, the first sub-block corresponds to first motion information, the second sub-block corresponds to second motion information, the common boundary is a dividing line of a geometric partitioning mode, the indicator is used to obtain an angle parameter and a distance parameter, the angle parameter specifies an angle index of the geometric partitioning mode, the distance parameter specifies a distance index of the geometric partitioning mode, the angle parameter is represented by angleIdx, and the distance parameter is represented by distanceIdx; determining a distance between the sample set in the current block and the common boundary based on a first calculation parameter, a second calculation parameter, and a third calculation parameter, wherein the first calculation parameter is determined by checking a preset lookup table according to the angleIdx, the second calculation parameter is determined by checking the preset lookup table according to (angleIdx+8)%32, and the third calculation parameter is determined based on the angleIdx and the distanceIdx; comparing the distance with a threshold to determine whether to save third motion information for the sample set, wherein if the first motion information and the second motion information are from different reference picture lists, the third motion information is derived by combining the first motion information and the second motion information, and if the first motion information and the second motion information are from the same reference picture list, the third motion information is equal to the first motion information or the second motion information; if the absolute value of the distance is less than the threshold, storing the third motion information for the sample set; The encoding method, including
13. determining the distance based on a first calculation parameter, a second calculation parameter, and a third calculation parameter; calculating the distance by using the following formula: distFromLine=((x<<N)+K)*P1+((y<<N)+K)*P2-P3 The distFromLine represents the distance, K is a non-negative integer, N=1, and P1, P2, and P3 are the first calculation parameter, the second calculation parameter, and the third calculation parameter, respectively. The encoding method of claim 12.
14. If the absolute value of the distance is greater than or equal to the threshold, the encoding method comprises: If the distance is positive, storing the first motion information for the sample set; or if the distance is negative, storing the second motion information for the sample set; The encoding method of claim 12 or 13, further comprising:
15. An apparatus for encoding a video bitstream, comprising a processor and a memory, said memory storing instructions for causing said processor to perform the encoding method of any one of claims 12 to 14.
16. Apparatus for encoding a video bitstream, comprising a processing circuit configured to perform the encoding method of any one of claims 12 to 14.
Citation Information
Patent Citations
Cross-component prediction for video coding and clipping for adaptive color conversion
JP2018507622A
Block partitioning methods for video coding
WO2021030019A1