Video coding method, apparatus, and non-transitory computer readable medium

The video coding method conditionally performs optical flow improvement based on preset conditions to enhance inter-prediction accuracy and reduce computational load, addressing the challenge of high computational expense in existing technologies.

JP2025107186AActive Publication Date: 2025-07-17HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2025067671
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-02-22
Filing Date
2025-04-16
Publication Date
2025-07-17
Estimated Expiration
2040-02-21

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in achieving accurate inter prediction while managing high computational load, particularly with bi-predictive optical flow, which is computationally expensive.

Method used

A method for video coding that conditionally performs optical flow improvement based on preset conditions, including a threshold for the first matching cost, to enhance inter-prediction accuracy while reducing unnecessary computational demands.

Benefits of technology

The method reduces decoding time by selectively performing optical flow improvement only when it significantly enhances accuracy, thereby balancing accuracy and computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025107186000001_ABST
    Figure 2025107186000001_ABST
Patent Text Reader

Abstract

To provide a method of video coding implemented in a decoding device or an encoding device.SOLUTION: A method comprises the steps of: obtaining initial motion vectors for a current block; obtaining first predictions for a sample value in the current block based on the initial motion vectors; calculating a first matching cost according to the first predictions; determining whether an optical flow refinement process should be performed or not, according to at least one preset condition, the at least one preset condition comprising a condition as to whether the calculated first matching cost is equal to or larger than a threshold; and performing an optical flow refinement process for obtaining a final inter prediction for the sample value in the current block, when it is determined that the optical flow refinement process should be performed.SELECTED DRAWING: Figure 10
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Cross - reference to Related Applications This patent application claims priority to Indian Provisional Patent Application No. IN201931007114, filed on February 22, 2019. The disclosure of the above - mentioned patent application is hereby incorporated by reference in its entirety into this specification.

[0002] The present invention relates to the field of picture processing, and more particularly, to the refinement of optical flow.

Background Art

[0003] 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, real - time conversation applications such as video chat, video conferencing, DVDs and Blu - ray discs, video content acquisition and editing systems, and camcorders for security applications.

[0004] The amount of video data required to depict even relatively short videos can be quite large, which can pose difficulties when the data is to be streamed over a communication network with a limited bandwidth capacity or otherwise transmitted. Thus, video data is generally compressed before being transmitted over modern communication networks. The size of the video can also be an issue when the video is stored on a storage device, as memory resources may be limited. In many cases, video compression devices use software and / or hardware at the source to encode the video data prior to transmission or storage, thereby reducing the amount of data required to represent the digital video image. The compressed data is then received at the destination by a video decompression device that decodes the video data. Improved compression and decompression techniques that increase the compression ratio without sacrificing much or any of the picture quality are desirable due to limited network resources and the ever-increasing demand for higher video quality.

[0005] Recently, inter prediction coding has been improved by an improvement in bi-predictive optical flow. This technique may enhance the accuracy of inter prediction of the current block of the picture being coded. However, the improvement in bi-predictive optical flow is relatively expensive in terms of computational load. Thus, a compromise between accurate inter prediction and computational load must be found. The present invention addresses this problem. SUMMARY OF THE INVENTION MEANS FOR SOLVING THE PROBLEM

[0006] Embodiments of the present application provide an apparatus and method for encoding and decoding according to the independent claims.

[0007] The above and other objects are achieved by the subject matter of the independent claims. Further implementation forms are apparent from the dependent claims, the description, and the drawings.

[0008] A method of video coding implemented in a decoding device or an encoding device is provided. The method includes: obtaining an initial motion vector for a current block (e.g., a coding block, a prediction block, or a sub-block); obtaining a first prediction (two prediction values for inter biprediction) for sample values within the current block based on the initial motion vector; calculating a first matching cost (e.g., consisting of or including some measure of similarity (or difference); see also the detailed description below) according to the first prediction; determining whether an optical flow improvement process should be executed according to at least one preset condition, where the at least one preset condition includes a condition of whether the calculated first matching cost is greater than or equal to a threshold; executing an optical flow improvement process to obtain a final inter prediction for sample values within the current block when it is determined that the optical flow improvement process should be executed; and

[0009] Accordingly, according to the present invention, improvement of optical flow, particularly improvement of bidirectional optical flow, is conditionally performed. The relatively expensive improvement of optical flow is performed only under specific circumstances that enable a suitable desired improvement in the accuracy of the entire inter-prediction process. If it is determined that the improvement of optical flow probably does not result in an improvement in the accuracy of inter-prediction that justifies the relatively high computational load required to perform the improvement of optical flow, the improvement of optical flow may be suppressed. Accordingly, the decoding time can be significantly reduced. The initial motion vector may be signaled within the bitstream. Alternatively, prediction of the motion vector and components of the motion vector difference may be provided with respect to the initial motion vector.

[0010] For example, at least one preset condition includes the condition that the current block can be predicted by improvement of the motion vector on the decoder side. This particular condition included in the at least one preset condition may be examined first to avoid unnecessary computational amount.

[0011] According to a particular embodiment, when it is determined that all of the at least one preset conditions are satisfied, it is determined that the optical flow improvement process should be executed. The at least one preset condition may, in principle, include one or more additional conditions. For example, the at least one preset condition may include the condition that a specific flag (e.g., 1) is set to have an optical improvement process being executed. If the conditions are not all satisfied, according to a particular embodiment, the improvement of optical flow may not be executed at all to reduce the computational demand.

[0012] A first prediction regarding sample values within a current block may be obtained based on a first interpolation filter in order to achieve some sub-pixel accuracy. In particular, the first interpolation filter may be a relatively simple bilinear interpolation filter that enables fast filtering.

[0013] A method of video coding implemented in a decoding device or an encoding device may include some improvement of motion vectors different from the improvement of optical flow. Thus, the method may include steps of obtaining an improved motion vector based on an initial motion vector and a first matching cost, obtaining a second prediction regarding sample values within a current block according to the improved motion vector, and performing an improvement of optical flow based on the second prediction (representing a prediction already improved) when it is determined that the optical flow improvement process should be executed. The overall accuracy of the inter prediction process may be enhanced by the use of the improved motion vector.

[0014] It is noted that the first prediction and the first matching cost have already been calculated for the improvement of the motion vector. Thus, no extra calculation is needed to determine an early termination / suppression of the optical flow improvement process, and the results of previous calculations included in the motion vector improvement process can be reused.

[0015] In each of the above-described embodiments of the inventive method, the step of obtaining a first prediction regarding sample values within a current block based on an initial motion vector may include the step of obtaining several candidate pairs based on the initial motion vector and the step of obtaining a first prediction regarding sample values within the current block based on at least one of the candidate pairs, and the step of calculating a first matching cost according to the first prediction may include the step of calculating a matching cost for each of the candidate pairs based on the first prediction and the step of determining the minimum matching cost among the determined matching costs as the first matching cost.

[0016] In the process of improving the motion vector, several candidate pairs regarding the improved motion vector may be obtained, and the pairs include pairs of the initial motion vectors. For example, candidate pairs regarding the improved motion vector include pairs of the initial motion vectors (MV0, MV1) and the pairs (MV0 + (0,1), MV1 + (0,-1)), (MV0 + (1,0), MV1 + (-1,0)), (MV0 + (0,-1), MV1 + (0,1)), (MV0 + (-1,0), MV1 + (1,0)), where (1,-1) represents a vector having a displacement of 1 in the horizontal (or x) direction and a displacement of -1 in the vertical (or y) direction. For each of the pairs, it is possible to determine the matching cost corresponding to that pair, and the first matching cost described above can be determined to be the minimum matching cost among the matching costs determined for candidate pairs regarding the improved motion vector. According to a specific example, the first matching cost can be the matching cost corresponding to the pair of the initial motion vectors (MV0, MV1) or (MV0' = MV0 + (0,1), MV1' = MV1 + (0,-1)) by the improved motion vectors MV0' and MV1'.

[0017] The use of that kind of first matching cost may be advantageous from the perspective of the overall coding.

[0018] The above-mentioned second prediction regarding the sample values within the current block may be obtained according to a second interpolation filter. This second interpolation filter may be a 6-tap or 8-tap interpolation filter that is relatively expensive but advantageous in terms of sub-pixel accuracy.

[0019] The above-mentioned improved motion vectors may be obtained according to a second matching cost to control the suitability of the improved motion vectors for inter prediction. When the value of the second matching cost is greater than or equal to another threshold, it may be determined that the optical flow improvement process should be executed. Otherwise, it may be determined that it is not worth executing any optical flow improvement process.

[0020] According to another embodiment, the final inter prediction is obtained by a weighted sum of the second prediction only when it is determined that the optical flow improvement process should not be executed. When it is not considered appropriate to execute the relatively costly optical flow improvement process, the weighted sum of the second prediction may provide some accuracy that may be considered sufficient.

[0021] Generally, the threshold or another threshold may be a value calculated based on the bit depth of the first prediction. Further, the threshold may be obtained according to the number of predicted samples used to calculate the first matching cost according to the first prediction. Further, the threshold may be obtained according to the size of the current block (width and height represented by the number of pixels). For example, the threshold may be thr = nCbW×nCbH×K, where K is a value greater than zero, and nCbW and nCbH are the width and height of the current block. For example, K = 2.

[0022] Furthermore, the above-mentioned second matching cost may be a derived cost obtained using a predefined model regarding the matching cost evaluated during the improvement of the motion vector and the shape of the matching cost near the position of the minimum matching cost. The predefined model in this context may be a linear combination model. Using a predefined model regarding the shape of the matching cost near the position of the minimum matching cost may enhance the accuracy of the inter prediction process.

[0023] The method according to all of the above embodiments may further include the step of generating an inter prediction block including a final inter prediction regarding the sample values within the current block.

[0024] Furthermore, an encoder or a decoder including some processing circuitry for performing the method according to any one of the above embodiments is provided. Furthermore, a computer program product including program code for performing the method according to any one of the above embodiments is provided.

[0025] All of the above variations of the video coding method may be implemented in a decoder or an encoder. Accordingly, a decoder or an encoder is provided, including one or more processors and a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming configuring the decoder to perform the method according to any one of the above embodiments when executed by the processor.

[0026] All of the above-described variations of the video coding method can be implemented in a device for use in an image encoder and / or an image decoder to address the above-mentioned requirements. Accordingly, a device for use in an image encoder and / or an image decoder is provided, the device comprising: an initial motion vector unit configured to obtain an initial motion vector for a current block (e.g., a coding block or a prediction block or a sub-block); a first prediction unit configured to obtain a first prediction regarding sample values within the current block based on the initial motion vector; a first matching cost calculation unit configured to calculate a first matching cost (e.g., a measure of similarity or difference) according to the first prediction; an optical flow improvement process determination unit configured to determine whether an optical flow improvement process should be executed according to at least one preset condition, wherein the at least one preset condition includes a condition as to whether the calculated first matching cost is greater than or equal to a threshold value; and an optical flow improvement process execution unit configured to execute an optical flow improvement process to obtain a final inter-prediction regarding sample values within the current block when it is determined that the optical flow improvement process should be executed.

[0027] This device, described above and its variations described below, provides the same advantages as the above-described method.

[0028] The at least one preset condition may include a condition that the current block can be predicted by improvement of a motion vector on the decoder side.

[0029] The optical flow improvement process determination unit may be configured to determine that the optical flow improvement process should be executed when it is determined that all of the at least one preset conditions are satisfied.

[0030] The device may include a first interpolation filter (e.g., a bilinear interpolation filter), and the first prediction unit may be configured to obtain a first prediction regarding sample values within the current block by means of the first interpolation filter.

[0031] The device may further include an improved motion vector unit configured to obtain an improved motion vector based on an initial motion vector and a first matching cost, and a second prediction unit configured to obtain a second prediction regarding sample values within the current block according to the improved motion vector. When it is determined by the optical flow improvement process determination unit that the optical flow improvement process should be executed, the optical flow improvement process execution unit may be configured to execute the improvement of the optical flow based on the second prediction. In the above-described embodiment of the device, the first prediction unit may be configured to obtain a first prediction regarding sample values within the current block based on the initial motion vector by obtaining several pairs of candidates based on the initial motion vector and obtaining a first prediction regarding sample values within the current block based on at least one of the pairs of candidates. Further, the first matching cost calculation unit may be configured to calculate the first matching cost according to the first prediction by determining the matching cost for each of the pairs of candidates based on the first prediction and determining the minimum matching cost among the determined matching costs as the first matching cost.

[0032]

[0033] ​According to an embodiment, the device may further include a second interpolation filter (e.g., a relatively expensive 6-tap or 8-tap interpolation filter with relatively high sub-pixel accuracy), and the second prediction unit may be configured to obtain a second prediction regarding sample values within the current block by means of the second interpolation filter.

[0034] According to another embodiment, the device further includes a second matching cost calculation unit configured to calculate a second matching cost, and the improved motion vector unit is configured to obtain an improved motion vector according to the second matching cost. In this case, the optical flow improvement process determination unit may be configured to determine that the optical flow improvement process should be executed when the value of the second matching cost is greater than or equal to another threshold.

[0035] The device may further include a weighted sum prediction unit configured to obtain a final inter-prediction by means of a weighted sum of the second prediction only when it is determined by the optical flow improvement process determination unit that the optical flow improvement process should not be executed.

[0036] Furthermore, the device may include a threshold calculation unit configured to calculate a threshold or another threshold based on the bit depth of the first prediction. Also, the device may further include a threshold calculation unit configured to calculate a threshold according to the number of predicted samples used to calculate the first matching cost according to the first prediction by the first matching cost calculation unit. Also, the device may further include a threshold calculation unit configured to calculate a threshold according to the size of the current block. For example, the threshold may be thr = nCbW×nCbH×K, where K is a value greater than zero, and nCbW and nCbH are the width and height of the current block. For example, K = 2.

[0037] According to certain embodiments, the second matching cost calculation unit is configured to calculate the second matching cost as a derived cost obtained using a predefined model (e.g., a linear combination model) regarding the matching cost evaluated during the improvement of the motion vector executed by the improved motion vector unit, and the shape of the matching cost near the position of the minimum matching cost.

[0038] The device according to any of the above embodiments may further include an inter-prediction block generation unit configured to generate an inter-prediction block including a final inter-prediction regarding the sample values within the current block.

[0039] Details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims.

[0040] Hereinafter, embodiments of the present invention will be described in more detail with reference to the accompanying figures and drawings.

Brief Description of the Drawings

[0041]

Figure 1A

Figure 1B

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Best Mode for Carrying Out the Invention

[0042] Hereinafter, the same reference numerals refer to the same or at least functionally equivalent features unless otherwise specified.

[0043] In the following description, reference is made to the accompanying drawings, which form a part hereof and which illustrate specific aspects of embodiments of the present invention or specific aspects in which embodiments of the present invention may be used. It is understood that embodiments of the present invention may be used in other aspects and may include structural or logical changes not shown in the drawings. Accordingly, the following detailed description should not be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.

[0044] For example, it is understood that the disclosures related to the described method may also apply to the corresponding device or system configured to perform the method, and vice versa. For example, if one or more specific method steps are described, the corresponding device may include one or more units for performing the one or more method steps described, such as functional units (e.g., one unit for performing one or more steps, or multiple units each performing one or more of the multiple steps), even if such one or more units are not explicitly described or shown in the figures. On the other hand, for example, if a specific device is described based on one or more units, such as functional units, the corresponding method may include one step for performing the functions of the one or more units (e.g., one step for performing the functions of one or more units, or multiple steps each performing one or more of the functions of the multiple units), even if such one or more steps are not explicitly described or shown in the figures. Further, it is understood that the features of the various exemplary embodiments and / or aspects described herein may be combined with each other unless otherwise specified.

[0045] Video coding generally refers to the processing of a sequence of pictures that form a video or video sequence. Instead of the term "picture", the terms "frame" or "image" may be used synonymously in the field of video coding. Video coding (or generally coding) includes two parts, video encoding and video decoding. Video encoding is performed on the source side and generally includes processing the original video picture (e.g., by compression) 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 generally includes inverse processing compared to the encoder to reconstruct the video picture. Embodiments referring to the "coding" of a video picture (or generally a picture) are understood to relate to the "encoding" or "decoding" of the video picture or respective video sequence. The combination of the encoding part and the decoding part is also called a codec (coding and decoding).

[0046] In the case of reversible video coding, the original video picture can be reconstructed (assuming no transmission loss or other data loss during storage or transmission), i.e., the reconstructed video picture has the same quality as the original video picture. In the case of irreversible video coding, additional compression, e.g., by quantization, is performed to reduce the amount of data representing the video picture, which cannot be fully reconstructed at the decoder, i.e., the quality of the reconstructed video picture is lower or worse compared to the quality of the original video picture.

[0047] Some video coding standards belong to the group of "irreversible hybrid video coders" (i.e., combining spatial and temporal prediction in the sample domain and 2D transform coding for applying quantization in the transform domain). Each picture of a video sequence is generally partitioned into a set of non-overlapping blocks, and coding is generally performed at the block level. In other words, in the encoder, the video generally generates a prediction block using, for example, spatial (intra-picture) prediction and / or temporal (inter-picture) prediction, subtracts the prediction block from the current block (the block being currently processed / processed), obtains a residual block, transforms the residual block, and quantizes the residual block in the transform domain to reduce the amount of data to be transmitted (compressed), i.e., coded, at the block (video block) level. On the other hand, in the decoder, the reverse process compared to the encoder is applied to the coded or compressed block to reconstruct the current block for representation. Further, the encoder duplicates the decoder's processing loop so that both generate the same prediction (e.g., intra and inter prediction) and / or reconstruction for processing, i.e., coding, subsequent blocks.

[0048] Embodiments of a video coding system 10, a video encoder 20, and a video decoder 30 are described below with reference to FIGS. 1 through 3.

[0049] FIG. 1A is a schematic block diagram showing an exemplary coding system 10 that may utilize the technology of the present application, e.g., a video coding system 10 (or simply coding system 10). The video encoder 20 (or simply encoder 20) and the video decoder 30 (or simply decoder 30) of the video coding system 10 are examples of devices that may be configured to perform the techniques according to various examples described in the present application.

[0050] As shown in FIG. 1A, the coding system 10 includes a source device 12 configured to provide, for example, encoded picture data 21 to a destination device 14 in order to decode the encoded picture data 13.

[0051] The source device 12 includes an encoder 20 and additionally, i.e., optionally, may include a picture source 16, a preprocessor (or preprocessing unit) 18, for example, a picture preprocessor 18, and a communication interface or communication unit 22.

[0052] The picture source 16 may include or be any kind of picture capturing device, such as a camera for capturing real-world pictures, and / or any kind of picture generating device, such as a computer graphics processor for generating pictures animated by a computer, or any kind of other device for acquiring and / or providing real-world pictures, pictures generated by a computer (e.g., screen content, virtual reality (VR) pictures), and / or any combination thereof (e.g., augmented reality (AR) pictures). The picture source may be any kind of memory or storage for storing any of the above-mentioned pictures.

[0053] Distinguished from the processing performed by the preprocessor 18 and the preprocessing unit 18, the picture or picture data 17 may also be referred to as raw picture or raw picture data 17.

[0054] The preprocessor 18 is configured to receive the (raw) picture data 17 and perform preprocessing on the picture data 17 to obtain preprocessed picture 19 or preprocessed picture data 19. The preprocessing performed by the preprocessor 18 may include, for example, trimming, color format conversion (e.g., from RGB to YCbCr), color correction, or noise removal. It can be understood that the preprocessing unit 18 may be an optional component.

[0055] The video encoder 20 is configured to receive the preprocessed picture data 19 and provide encoded picture data 21 (further details will be described below, for example, based on FIG. 2).

[0056] The communication interface 22 of the source device 12 is configured to receive the encoded picture data 21 and transmit the encoded picture data 21 (or any further processed version thereof) via the communication channel 13 to another device, such as the destination device 14 or any other device, for storage or direct reconstruction.

[0057] The destination device 14 includes a decoder 30 (e.g., a video decoder 30), and additionally, i.e., optionally, may include a communication interface or communication unit 28, a postprocessor 32 (or postprocessing unit 32), and a display device 34.

[0058] The communication 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, such as a storage device, e.g., a storage device for the encoded picture data, and provide the encoded picture data 21 to the decoder 30.

[0059] Communication interfaces 22 and 28 may be configured to transmit or receive encoded picture data 21 or encoded data 13 between the source device 12 and the destination device 14 via a direct communication link, such as a direct wired or wireless connection, or via any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public network, or any combination of any type thereof.

[0060] Communication interface 22 may be configured to process the encoded picture data, for example, by packaging the encoded picture data 21 into a suitable format, such as a packet, and / or using any type of encoding or processing of the transmission for transmission via the communication link or communication network.

[0061] Communication interface 28, which forms the counterpart of communication interface 22, may be configured to receive the transmitted data and process the transmitted data using any type of corresponding decoding or processing of the transmission and / or unpackaging to obtain the encoded picture data 21.

[0062] Both communication interface 22 and communication interface 28 may be configured as a unidirectional communication interface or a bidirectional communication interface indicated by an arrow regarding the communication channel 13 in FIG. 1A pointing from the source device 12 towards the destination device 14, and may be configured to, for example, set up a connection, verify and exchange any other information related to the communication link and / or data transmission, such as the transmission of encoded picture data, for example, by sending and receiving messages.

[0063] Decoder 30 is configured to receive the encoded picture data 21 and provide the decoded picture data 31 or the decoded picture 31 (further details are described below, for example, based on FIG. 3 or FIG. 5).

[0064] The post-processor 32 of the destination device 14 is configured to post-process the decoded picture data 31 (also referred to as the reconstructed picture data), for example, the decoded picture 31, to obtain the post-processed picture data 33, for example, the post-processed picture 33. The post-processing executed by the post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color correction, trimming, or resampling, or any other processing for preparing the decoded picture data 31, for example, for display by the display device 34.

[0065] The display device 34 of the destination device 14 is configured to receive the post-processed picture data 33 to display a picture for, for example, a user or viewer. The display device 34 may be any type of display for showing the reconstructed picture, for example, an integrated or external display or monitor or may include such a 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.

[0066] FIG. 1A shows the source device 12 and the destination device 14 as separate devices, but embodiments of the device may include both or both functions, the source device 12 or corresponding functions and the destination device 14 or corresponding functions. In such embodiments, the source device 12 or corresponding functions and the destination device 14 or corresponding functions may be implemented using the same hardware and / or software or by separate hardware and / or software or any combination thereof.

[0067] As will be apparent to those skilled in the art based on the description, the functions of the different units or the presence and (exact) partitioning of the functions within the source device 12 and / or the destination device 14 shown in FIG. 1A may vary depending on the actual device and application.

[0068] The encoder 20 (e.g., video encoder 20) or decoder 30 (e.g., video decoder 30) or both the encoder 20 and decoder 30 may be implemented by a processing circuit such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof dedicated to or arbitrary for their video coding, as shown in FIG. 1B. The encoder 20 may be implemented by the processing circuit 46 to embody various modules considered in relation to the encoder 20 of FIG. 2 and / or any other encoder system or subsystem described herein. The decoder 30 may be implemented by the processing circuit 46 to embody various modules considered in relation to the decoder 30 of FIG. 3 and / or any other decoder system or subsystem described herein. The processing circuit may be configured to perform various operations considered later. As shown in FIG. 5, when the technology is implemented partially in software, the device may store instructions for the software in a suitable non-transitory computer-readable storage medium and may execute the instructions in hardware using one or more processors to perform the technology of the present disclosure. Either the video encoder 20 or the video decoder 30 may be incorporated, for example, as part of a combined encoder / decoder (codec) within a single device as shown in FIG. 1B.

[0069] The source device 12 and the destination device 14 can include any of a wide range of devices, such as any type of handheld or fixed device, for example, 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 game console, a video streaming device (such as a content service server or a content delivery server), a broadcast receiver device, a broadcast transmitter device, etc., and may or may not use an operating system or may use any type of operating system. In some cases, the source device 12 and the destination device 14 may support wireless communication. Accordingly, the source device 12 and the destination device 14 can be wireless communication devices.

[0070] In some cases, the video coding system 10 shown in FIG. 1A is merely an example, and the technology of the present disclosure may be applicable to video coding situations (such as 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 is retrieved from local memory or streamed over a network, etc. A video encoding device may encode data and store it in memory, and / or a video decoding device may retrieve data from memory and decode it. In some examples, encoding and decoding are performed by devices that do not communicate with each other and simply encode data in memory and / or retrieve and decode data from memory.

[0071] For the sake of convenience in explanation, embodiments of the present invention will be described herein by referring to, for example, the reference software of the next-generation video coding standard developed by the Joint Collaboration Team on Video Coding (JCT-VC) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG), such as High-Efficiency Video Coding (HEVC) or Versatile Video Coding (VVC). Those skilled in the art will understand that the embodiments of the present invention are not limited to HEVC or VVC.

[0072] Encoder and Encoding Method FIG. 2 shows a schematic block diagram of an exemplary video encoder 20 configured to implement the technology of the present application. In the example of FIG. 2, the video encoder 20 includes an input 201 (or input interface 201), a residual calculation unit 204, a conversion processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse conversion 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 FIG. 2 may also be referred to as a hybrid video encoder or a video encoder by a hybrid video codec.

[0073] The residual calculation unit 204, the conversion processing unit 206, the quantization unit 208, and the mode selection unit 260 may be regarded as forming the forward signal path of the encoder 20. On the other hand, the dequantization unit 210, the inverse conversion 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 regarded as forming the reverse signal path of the video encoder 20. The reverse signal path of the video encoder 20 corresponds to the signal path of the decoder (see the video decoder 30 in FIG. 3). The dequantization unit 210, the inverse conversion 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 regarded as forming the "built-in decoder" of the video encoder 20.

[0074] Picture & Picture Division (Picture & Block) The encoder 20 may be configured to receive, for example, picture 17 (or picture data 17) via input 201, such as a sequence of pictures forming a video or a video sequence. The received picture or picture data may also be preprocessed picture 19 (or preprocessed picture data 19). For simplicity, the following description refers to picture 17. Picture 17 may also be referred to as the current picture or the picture to be coded (especially in video coding, to distinguish the current picture from other pictures, such as the already encoded and / or decoded pictures of the same video sequence, i.e., the video sequence that also includes the current picture).

[0075] (Digital) pictures can be considered or can be regarded as a two-dimensional array or matrix of samples having intensity values. The samples of the array can also be called pixels (a shortened form of 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. For color representation, generally three color components are used, i.e., the picture can be represented or can include three sample arrays. In the RGB format or color space, the picture includes corresponding sample arrays of red, green, and blue. However, in video coding, each pixel generally includes a luminance component represented by Y (L may also be used instead) and two chrominance components represented by Cb and Cr, and is represented in YCbCr. The luminance (or short for luma) component Y represents brightness or intensity of gray level (similar to, e.g., a grayscale picture), while the two chrominance (or short for chroma) components Cb and Cr represent chrominance or color information components. Thus, a picture in the 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 the RGB format can be converted or transformed to the YCbCr format, and vice versa, and the process is also known as color transformation or conversion. If the picture is monochrome, the picture can include only a luminance sample array. Thus, the picture can be, for example, an array of luma samples in a 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.

[0076] An embodiment of the video encoder 20 may include a picture partitioning unit (not shown in FIG. 2) configured to partition picture 17 into a plurality of (usually non-overlapping) picture blocks 203. These blocks may also be referred to as root blocks, macroblocks (H.264 / AVC), or coding tree blocks (CTB) or coding tree units (CTU) (H.265 / HEVC and VVC). The picture partitioning unit may use the same block size with respect to a corresponding grid that defines all pictures and block sizes of the video sequence, or may vary the block size between pictures or subsets or groups of pictures and be configured to partition each picture into corresponding blocks.

[0077] In a further embodiment, the video encoder may be configured to directly receive blocks 203 of picture 17, for example, 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.

[0078] Similar to Picture 17, Picture Block 203 can also be regarded as or can be regarded as a two-dimensional array or matrix of samples that is smaller in size than Picture 17 but has intensity values (sample values). In other words, depending on the applied color format, Block 203 can contain, for example, one sample array (e.g., the luma array in the case of monochrome Picture 17, or the luma or chroma arrays in the case of a color picture), or three sample arrays (e.g., the luma and two chroma arrays in the case of Color Picture 17), or any other number and / or type of arrays. The number of samples in the horizontal and vertical directions (or axes) of Block 203 defines the size of Block 203. Thus, the block can be, for example, an MxN (M columns × N rows) array of samples or an MxN array of transform coefficients.

[0079] The embodiment of Video Encoder 20 shown in FIG. 2 can be configured to encode Picture 17 block by block. For example, encoding and prediction can be performed for each Block 203.

[0080] The embodiment of Video Encoder 20 shown in FIG. 2 can be further configured to partition and / or encode a picture by using slices (also called video slices). A picture can be partitioned into one or more (generally non-overlapping) slices or encoded using one or more (generally non-overlapping) slices, and each slice can contain one or more blocks (e.g., CTUs).

[0081] The embodiment of the video encoder 20 shown in FIG. 2 may be further configured to partition and / or encode a picture by using tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), where the picture may be partitioned into one or more (generally non-overlapping) tile groups or encoded using one or more (generally non-overlapping) tile groups, each tile group may include, for example, one or more blocks (e.g., CTUs) or one or more tiles, each tile may be, for example, rectangular in shape and may include one or more blocks (e.g., CTUs), e.g., complete or fractional blocks.

[0082] Calculation of Residual The residual calculation unit 204 may be configured to calculate a residual block 205 (also referred to as residual 205) based on a picture block 203 and a prediction block 265 (further details about the prediction block 265 will be given later) by, for example, subtracting the sample values of the prediction block 265 from the sample values of the picture block 203 for each sample (per pixel) to obtain the residual block 205 in the sample region.

[0083] Transformation The transformation processing unit 206 may be configured to apply a transformation, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), to the sample values of the residual block 205 to obtain transformation coefficients 207 in the transform domain. The transformation coefficients 207, also referred to as transform residual coefficients, may represent the residual block 205 in the transform domain.

[0084] The conversion processing unit 206 may be configured to apply integer approximations of DCT / DST such as conversion defined for H.265 / HEVC. Compared to the orthogonal DCT transform, such integer approximations are generally scaled at a specific rate. To maintain the norm of the residual blocks processed by the forward and inverse transforms, an additional scaling factor is applied as part of the conversion process. The scaling factor is generally selected based on specific constraints such as the scaling factor being a power of 2 for shift operations, the bit depth of the conversion coefficients, and the trade-off between accuracy and implementation cost. For example, a specific scaling factor may be specified for the inverse transform by the inverse transform processing unit 212 (and a corresponding inverse transform by the inverse transform processing unit 312 in the video decoder 30, for example), and a corresponding scaling factor for the forward transform by the conversion processing unit 206 of the encoder 20 may be specified accordingly.

[0085] Embodiments of the video encoder 20 (the conversion processing unit 206, respectively) may be, for example, such that the video decoder 30 may receive the conversion parameters and use them for decoding, for example, the conversion parameters that are either intact or encoded or compressed by the entropy encoding unit 270, for example, and may be configured to output a certain type of one conversion or a plurality of conversions.

[0086] Quantization The quantization unit 208 may be configured to obtain the quantized coefficients 209 by quantizing the conversion coefficients 207, for example, by applying scalar quantization or vector quantization. The quantized coefficients 209 may also be referred to as quantized conversion coefficients 209 or quantized residual coefficients 209.

[0087] The quantization process may reduce the bit depth associated with some or all of the conversion coefficients 207. For example, an n-bit conversion coefficient may be truncated to an m-bit conversion coefficient during quantization, where n is greater than m. The degree of quantization may be modified by adjusting the quantization parameter (QP). For scalar quantization, for example, different scalings 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 be, for example, an index to a predefined set of applicable quantization step sizes. For example, a small quantization parameter may correspond to fine quantization (small quantization step size), a large quantization parameter may correspond to coarse quantization (large quantization step size), or vice versa. Quantization may include division by the quantization step size, and corresponding and / or inverse dequantization by, for example, the dequantization unit 210 may include multiplication by the quantization step size. Some standards, such as embodiments according to HEVC, may be configured to determine the quantization step size using the quantization parameter. Generally, the quantization step size may be calculated based on the quantization parameter using a fixed point approximation of an equation that includes division. Additional scaling factors may be introduced for quantization and dequantization to restore the norm of the residual block that may be modified due to the scaling used in the fixed point approximation of the equations for the quantization step size and quantization parameter. In one exemplary implementation, the scaling of the inverse transform and dequantization may be combined. Alternatively, a customized quantization table may be used, for example, signaled from the encoder to the decoder within the bitstream.Quantization is an irreversible operation, and the loss increases as the quantization step size increases.

[0088] Embodiments of the video encoder 20 (each, quantization unit 208) may be configured to output, for example, quantization parameters (QPs) that are, for example, left as is or encoded by the entropy encoding unit 270 such that the video decoder 30 may receive and apply the quantization parameters for decoding.

[0089] Dequantization The dequantization unit 210 is configured to apply dequantization of the quantization unit 208 to the quantized coefficients to obtain dequantized coefficients 211 by applying, for example, the inverse of the quantization method applied by the quantization unit 208 based on or using the same quantization step size as the quantization unit 208. The dequantized coefficients 211, also referred to as dequantized residual coefficients 211, may correspond to the transform coefficients 207, although generally not identical to the transform coefficients due to losses caused by quantization.

[0090] Inverse transformation The inverse transformation processing unit 212 is configured to apply an inverse transformation of the transformation applied by the transformation processing unit 206, for example, an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST) or other inverse transformation, 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.

[0091] Reconstruction The reconstruction unit 214 (e.g., an adder or summer 214) is configured to add the sample values of, for example, the reconstructed residual block 213 and the prediction block 265 -- sample by sample -- to the prediction block 265 by adding the transform block 213 (i.e., the reconstructed residual block 213) to obtain the reconstructed block 215 in the sample domain.

[0092] Filtering The loop filter unit 220 (or simply "loop filter" 220) is configured to filter the reconstructed block 215 to obtain the filtered block 221, or generally to filter the reconstructed samples to obtain the filtered samples. The loop filter unit is configured to, for example, smooth pixel transitions or otherwise improve the quality of the video. 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, for example, a bilateral filter, an adaptive loop filter (ALF), sharpening, a smoothing filter, or a collaborative filter, or any combination thereof. The loop filter unit 220 is shown as an in - loop filter in FIG. 2, but in other configurations, the loop filter unit 220 may be implemented as a post - loop filter. The filtered block 221 may also be referred to as the filtered reconstructed block 221.

[0093] Embodiments of the video encoder 20 (each loop filter unit 220) may be configured to output loop filter parameters (such as sample adaptive offset information), for example, as is or encoded by the entropy encoding unit 270, such that the decoder 30 may receive the same loop filter parameters or respective loop filters and apply them for decoding.

[0094] Decoded picture buffer The decoded picture buffer (DPB) 230 may be a memory that stores reference pictures for encoding video data by the video encoder 20 or generally reference picture data. The DPB 230 may be formed by any of various memory devices such as dynamic random access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (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 the same current picture or different pictures, for example, other already filtered blocks of already reconstructed pictures, for example, already reconstructed and filtered blocks 221, and may provide, for example, for inter prediction, a fully already reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and / or a partially reconstructed current picture (and corresponding reference blocks and samples). The decoded picture buffer (DPB) 230 may also be configured to store one or more non-filtered reconstructed blocks 215 or generally non-filtered reconstructed samples, or any other further processed version of the reconstructed blocks or samples, for example, if the reconstructed block 215 is not filtered by the loop filter unit 220.

[0095] Mode Selection (Partitioning & Prediction) The mode selection unit 260 includes a classification unit 262, an inter prediction unit 244, and an intra prediction unit 254, and is configured to receive or obtain original picture data, for example, the original block 203 (the current block 203 of the current picture 17), and reconstructed picture data, for example, from the same (current) picture and / or one or more already decoded pictures from, for example, the decoded picture buffer 230 or other buffers (for example, a line buffer not shown), filtered and / or unfiltered reconstructed samples or blocks. The reconstructed picture data is used as reference picture data for prediction, for example, inter prediction or intra prediction, to obtain the prediction block 265 or predictor 265.

[0096] The mode selection unit 260 may be configured to determine or select a classification and a prediction mode (for example, an intra or inter prediction mode) for the prediction mode of the current block (without classification), and generate a corresponding prediction block 265 used for the calculation of the residual block 205 and the reconstruction of the reconstructed block 215.

[0097] Embodiments of the mode selection unit 260 may be configured to select a partitioning and prediction mode that provides the best match or, in other words, the minimum residual (the minimum residual means better compression for transmission or storage) or the minimum signaling overhead (the minimum signaling overhead means better compression for transmission or storage), or to consider or balance both, from, for example, the partitioning and prediction modes supported by the mode selection unit 260 or available to the mode selection unit 260. The mode selection unit 260 may be configured to determine the partitioning and prediction modes based on rate-distortion optimization (RDO), i.e., to select the prediction mode that provides the minimum rate distortion. Terms such as "best," "minimum," "optimal," etc. in this context do not necessarily refer to the overall "best," "minimum," "optimal," etc., but may also refer to criteria for termination or selection such as a value exceeding or falling below a threshold, or other constraints that potentially lead to a "near-optimal selection" while satisfying complexity and processing time reduction.

[0098] In other words, the partitioning unit 262 may be configured to repeatedly use, for example, quad-tree partitioning (QT), binary partitioning (BT), or ternary-tree partitioning (TT), or any combination thereof, to partition block 203 into smaller block partitions or sub-blocks (which also form blocks), and, for example, to perform prediction for each of the block partitions or sub-blocks. The mode selection may include selection of the tree structure of the partitioned block 203, and the prediction mode is applied to each of the block partitions or sub-blocks.

[0099] The partitioning and prediction processing (by, for example, the partitioning unit 260) and prediction processing (by the inter-prediction unit 244 and the intra-prediction unit 254) performed by the exemplary video encoder 20 are described in more detail below.

[0100] Partitioning The partitioning unit 262 may partition (or divide) the current block 203 into smaller compartments, for example, smaller blocks of square or rectangular size. These smaller blocks (which may also be referred to as sub-blocks) may be further partitioned into even smaller compartments. This is also called a tree partition or a hierarchical tree partition. For example, a root block 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, nodes at tree level 1 (hierarchical level 1, depth 1), and these blocks may be further 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 a termination criterion is met, for example, the maximum tree depth or the minimum block size is reached and the partitioning ends. Blocks that are not further partitioned are also called leaf blocks or leaf nodes of the tree. A tree that uses a partition into two compartments is called a binary tree (BT), a tree that uses a partition into three compartments is called a ternary tree (TT), and a tree that uses a partition into four compartments is called a quadtree (QT).

[0101] As described above, the term "block" as used herein may be a portion of a picture, particularly, a portion of a square or a rectangle. For example, in relation to HEVC and VVC, a block may be a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), and a transform unit (TU), and / or a corresponding block, for example, a coding tree block (CTB), a coding block (CB), a transform block (TB), or a prediction block (PB), or may correspond to them.

[0102] For example, a coding tree unit (CTU) may be or may contain the CTB of luma samples, two corresponding CTBs of chroma samples of a picture having three sample arrays, or the CTB of samples of a picture coded using three separate colour planes and syntax structures for coding monochrome pictures or samples. Correspondingly, a coding tree block (CTB) may be an NxN block of samples for some value of N such that the division of a component into CTBs is a segmentation. A coding unit (CU) may be or may contain the coding block of luma samples, two corresponding coding blocks of chroma samples of a picture having three sample arrays, or the coding block of samples of a picture coded using three separate colour planes and syntax structures for coding monochrome pictures or samples. Correspondingly, a coding block (CB) may be an MxN block of samples for some values of M and N such that the division of a CTB into coding blocks is a segmentation.

[0103] For example, in an embodiment according to HEVC, a coding tree unit (CTU) may be divided into CUs by using a quadtree structure represented as a coding tree. The decision as to whether to code a picture area using inter-picture (temporal) prediction or to code a picture area using intra-picture (spatial) prediction is made at the CU level. Each CU may be further divided into one, two, or four PUs according to the PU split type. Within one PU, the same prediction process is applied and the relevant information is sent to the decoder based on the PU. After obtaining a residual block by applying a prediction process based on the PU split type, the CU may be partitioned into transform units (TUs) by another quadtree structure similar to the coding tree for the CU.

[0104] For example, in an embodiment according to the currently developed latest video coding standard called Versatile Video Coding (VVC), a combined quadtree and binary tree (QTBT) partitioning is used, for example, to partition coding blocks. In the QTBT block structure, a CU can have a shape that is either square or rectangular. For example, a Coding Tree Unit (CTU) is first partitioned by a quadtree structure. The leaf nodes of the quadtree are further partitioned by a binary tree or a ternary (or triple) tree structure. The leaf nodes of the partitioning tree are called Coding Units (CUs), and their segmentation is used for prediction and transformation processing without any further partitioning. This means that CUs, PUs, and TUs have the same block size in the QTBT coding block structure. In parallel, multi-partitions, for example, ternary partitions, can be used together with the QTBT block structure.

[0105] In one example, the mode selection unit 260 of the video encoder 20 can be configured to perform any combination of the partitioning techniques described herein.

[0106] As described above, the video encoder 20 is configured to determine or select the best or optimal prediction mode from a set of (e.g., pre-determined) prediction modes. The set of prediction modes can include, for example, an intra prediction mode and / or an inter prediction mode.

[0107] Intra Prediction A set of intra prediction modes can include, for example, 35 different intra prediction modes defined in HEVC, such as non-directional modes like DC (or average) mode and planar mode, or directional modes, or alternatively, for example, 67 different intra prediction modes defined for VVC, such as non-directional modes like DC (or average) mode and planar mode, or directional modes.

[0108] The intra prediction unit 254 is configured to generate an intra prediction block 265 using the reconstructed samples of neighboring blocks of the same current picture according to an intra prediction mode among a set of intra prediction modes.

[0109] The intra prediction unit 254 (or generally the mode selection unit 260) is further configured to output an intra prediction parameter (or generally information indicating the selected intra prediction mode for a block) to the entropy encoding unit 270 in the form of a syntax element 266 for inclusion in the encoded picture data 21 so that, for example, the video decoder 30 can receive the prediction parameter and potentially use it for decoding.

[0110] Inter prediction A set of (or possible) inter prediction modes depends on available reference pictures (i.e., for example, at least partially decoded previous pictures stored in the DBP 230) and other inter prediction parameters, such as whether the entire reference picture is used to search for the best matching reference block or only a part of the reference picture, for example, only the search window area around the area of the current block, and / or whether pixel interpolation, for example, half / semi-pel and / or quarter-pel interpolation, is applied.

[0111] In addition to the prediction modes described above, a skip mode and / or a direct mode may be applied.

[0112] The inter prediction unit 244 may include a motion estimation (ME) unit and a motion compensation (MC) unit (neither shown in FIG. 2). The motion estimation unit is configured to receive or obtain, for motion estimation, the picture block 203 (the current picture block 203 of the current picture 17) and the decoded picture 231, or at least one or a plurality of already reconstructed blocks, for example, the reconstructed blocks of one or a plurality of other / different already decoded pictures 231. For example, the video sequence may include the current picture and the already decoded picture 231, or in other words, the current picture and the already decoded picture 231 may be part of a sequence of pictures forming the video sequence or may form such a sequence of pictures.

[0113] The encoder 20 may be configured to select, for example, reference blocks from a plurality of reference blocks of the same or different pictures among a plurality of other pictures, and provide the motion estimation unit with the reference picture (or reference picture index) and / or the offset (spatial offset) between the position (x, y coordinates) of the reference block and the position of the current block as inter prediction parameters. This offset is also called a motion vector (MV).

[0114] The motion compensation unit is configured to obtain, for example receive, an inter prediction parameter and perform an inter prediction based on or using the inter prediction parameter to obtain an inter prediction block 265. The motion compensation performed by the motion compensation unit may include fetching or generating a prediction block based on a motion / block vector determined by motion estimation that likely performs interpolation with sub-pixel accuracy. Interpolation filtering may generate additional pixel samples from known pixel samples and thus potentially increase the number of candidate prediction blocks that may be used to code a picture block. When receiving a motion vector for a PU of a current picture block, the motion compensation unit may find a prediction block pointed to by the motion vector in one of the reference picture lists.

[0115] The motion compensation unit may also generate blocks for use by the video decoder 30 when decoding a picture block of a video slice and syntax elements associated with the video slice. In addition to or instead of the slice and its respective syntax elements, tile groups and / or tiles and their respective syntax elements may be generated or used.

[0116] Entropy coding The entropy encoding unit 270 is configured to apply, for example, an entropy encoding algorithm or method (e.g., variable length coding (VLC) method, context adaptive VLC (CAVLC), arithmetic coding method, binarization, context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or another entropy coding method or technique) or bypass (non-compression) to, for example, the quantized coefficients 209, inter prediction parameters, intra prediction parameters, loop filter parameters, and / or other syntax elements, so that, for example, the video decoder 30 can receive the parameters and may use them for decoding, and obtain the encoded picture data 21 that can be output via output 272, for example, in the form of the encoded bitstream 21. The encoded bitstream 21 may be transmitted to the video decoder 30 or stored in a memory for later transmission or retrieval by the video decoder 30.

[0117] Alternative configurations of the video encoder 20 and other structures may be used to encode the video stream. For example, a non-transform-based encoder 20 may directly quantize the residual signal without the transform processing unit 206 for a particular block or frame. In another implementation, the encoder 20 may have a quantization unit 208 and an inverse quantization unit 210 combined in a single unit.

[0118] Decoder and Decoding Method FIG. 3 shows an example of a video decoder 30 configured to implement the technology of the present application. The video decoder 30 is configured to receive, for example, encoded picture data 21 (e.g., an encoded bitstream 21) encoded by an encoder 20 in order to obtain a decoded picture 331. The encoded picture data or bitstream includes information for decoding data representing encoded picture blocks of an encoded video slice (and / or tile group or tile) and related syntax elements, for example.

[0119] In the example of FIG. 3, the 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., an adder 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. The inter prediction unit 344 may be or may include a motion compensation unit. The video decoder 30 may, in some examples, execute a decoding path that is generally inverse to the encoding path described in relation to the video encoder 100 of FIG. 2.

[0120] As described in relation to the encoder 20, the dequantization 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 344, and the intra prediction unit 354 are also considered to form the "built-in decoder" of the video encoder 20. Therefore, the dequantization unit 310 may be functionally identical to the dequantization unit 110, the inverse transform processing unit 312 may be functionally identical to the inverse transform processing unit 212, the reconstruction unit 314 may be functionally identical to the reconstruction unit 214, the loop filter 320 may be functionally identical to the loop filter 220, and the decoded picture buffer 330 may be functionally identical to the decoded picture buffer 230. Therefore, the descriptions given for each unit and function of the video 20 encoder are applied mutatis mutandis to each unit and function of the video decoder 30.

[0121] Entropy decoding The entropy decoding unit 304 analyzes the bitstream 21 (or generally the encoded picture data 21), and for example, performs entropy decoding on the encoded picture data 21 to obtain, for example, the quantized coefficients 309 and / or the decoded coding parameters (not shown in FIG. 3), such as inter prediction parameters (e.g., reference picture index and motion vector), intra prediction parameters (e.g., intra prediction mode or index), transform parameters, quantization parameters, loop filter parameters, and / or any or all of other syntax elements. The entropy decoding unit 304 may be configured to apply a decoding algorithm or method corresponding to the encoding method described in relation to the entropy encoding unit 270 of the encoder 20. The entropy decoding unit 304 may be further configured to provide the inter prediction parameters, intra prediction parameters, and / or other syntax elements to the mode application unit 360 and provide other parameters to other units of the decoder 30. The video decoder 30 may receive syntax elements at the level of a video slice and / or at the level of a video block. In addition to or instead of a slice and its respective syntax elements, a tile group and / or a tile and their respective syntax elements may be received and / or used.

[0122] Inverse quantization The quantization scaling unit 310 receives the quantization parameter (QP) (or generally information related to quantization scaling) and the quantized coefficients from the encoded picture data 21 (e.g., by the entropy decoder unit 304, e.g., by parsing and / or decoding), and may be configured to apply quantization scaling based on the quantization parameter to the decoded quantized coefficients 309 to obtain the quantization-scaled coefficients 311, which may also be referred to as transform coefficients 311. The quantization scaling process may include using the quantization parameter determined by the video encoder 20 for each video block within a video slice (or tile or tile group) to determine the degree of quantization as well as the degree of quantization scaling to be applied.

[0123] Inverse transformation The inverse transform processing unit 312 receives the quantization-scaled coefficients 311, which may also be referred to as transform coefficients 311, and may be configured to apply a transform to the quantization-scaled coefficients 311 to obtain the residual block 213 reconstructed in the sample domain. The reconstructed residual block 213 may also be referred to as the transform block 213. The transform may be an inverse transform, e.g., inverse DCT, inverse DST, inverse integer transform, or a conceptually similar inverse transform process. The inverse transform processing unit 312 may be further configured to receive the transform parameter or corresponding information from the encoded picture data 21 (e.g., by the entropy decoder unit 304, e.g., by parsing and / or decoding) to determine the transform applied to the quantization-scaled coefficients 311.

[0124] Reconstruction The reconstruction unit 314 (e.g., adder or summer 314) may be configured to add the reconstructed residual block 313 to the prediction block 365, e.g., by adding the sample values of the reconstructed residual block 313 and the sample values of the prediction block 365, to obtain the block 315 reconstructed in the sample domain.

[0125] Filtering (Either within or after the coding loop) The loop filter unit 320 is configured to filter the reconstructed block 315, for example, to smooth pixel transitions or otherwise improve the quality of the video, to obtain a filtered block 321. The loop filter unit 320 may include a deblocking filter, a sample adaptive offset (SAO) filter, or one or more other filters, such as a bilateral filter, an adaptive loop filter (ALF), sharpening, a smoothing filter, or a joint filter, or any combination thereof. The loop filter unit 320 is shown in FIG. 3 as a in-loop filter, but in other configurations, the loop filter unit 320 may be implemented as a post-loop filter.

[0126] Decoded Picture Buffer Then, the decoded video block 321 of the picture is stored in a decoded picture buffer 330 that stores the decoded picture 331 for subsequent motion compensation with respect to other pictures and / or for outputting respectively on a display as a reference picture.

[0127] The decoder 30 is configured to output the decoded picture 311, for example, via output 312, for presentation or viewing by a user.

[0128] Prediction The inter prediction unit 344 may be the same as the inter prediction unit 244 (especially the motion compensation unit), and the intra prediction unit 354 may be functionally the same as the inter prediction unit 254. Based on the partition and / or prediction parameters or respective information received from the decoded picture data 21 (for example, by the entropy decoding unit 304, for example, by analyzing and / or decoding), it performs the determination and prediction of partitioning or segmentation. 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 the prediction block 365.

[0129] When a video slice is coded as an intra-coded (I) slice, the intra prediction unit 354 of the mode application unit 360 is configured to generate a prediction block 365 for a picture block of the current video slice based on the signaled intra prediction mode and data from already decoded blocks of the current picture. When the video picture is coded as an inter-coded (i.e., B or P) slice, the inter prediction unit 344 (e.g., motion compensation unit) of the mode application unit 360 is configured to generate a prediction block 365 for a video block of the current video slice based on the motion vector and other syntax elements received from the entropy decoding unit 304. For inter prediction, the prediction block may be generated from one of the reference pictures in one of the reference picture lists. The video decoder 30 may construct the reference frame lists, List 0 and List 1, using a default construction technique based on the reference pictures stored in the DPB 330. The same or similar may apply for embodiments that use tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or as an alternative to slices (e.g., video slices), e.g., the video may be coded using I, P, or B tile groups and / or tiles.

[0130] The mode application unit 360 is configured to determine prediction information regarding a video block of a current video slice by analyzing motion vectors or related information and other syntax elements, and generate a prediction block regarding the current decoded video block using the prediction information. For example, the mode application unit 360 uses a part of the received syntax elements to determine a prediction mode (e.g., intra or inter prediction) used to code a video block of a video slice, a slice type of inter prediction (e.g., B slice, P slice, or GPB slice), construction information regarding one or more of reference picture lists for the slice, motion vectors regarding each inter-coded video block of the slice, the status of inter prediction regarding each inter-coded video block of the slice, and other information for decoding a video block within the current video slice. The same or similar applies for embodiments that use tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or as an alternative to slices (e.g., video slices), for example, the video may be coded using I, P, or B tile groups and / or tiles.

[0131] An embodiment of the video decoder 30 shown in FIG. 3 may be configured to partition and / or decode a picture by using slices (also referred to as video slices), where the picture may be partitioned into one or more (generally non-overlapping) slices or decoded using one or more (generally non-overlapping) slices, and each slice may include one or more blocks (e.g., CTUs).

[0132] The embodiment of video decoder 30 shown in FIG. 3 may be configured to partition and / or decode a picture by using tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), where the picture may be partitioned into one or more (generally non-overlapping) tile groups or decoded using one or more (generally non-overlapping) tile groups, each tile group may include, for example, one or more blocks (e.g., CTUs) or one or more tiles, each tile may be, for example, rectangular in shape and may include one or more blocks (e.g., CTUs), e.g., complete or partial blocks.

[0133] Other variations of video decoder 30 may be used to decode the encoded picture data 21. For example, decoder 30 may generate an output video stream without loop filtering unit 320. For example, a transform-free decoder 30 may directly dequantize the residual signal without inverse transform processing unit 312 for a particular block or frame. In another implementation, video decoder 30 may have a dequantization unit 310 and an inverse transform processing unit 312 combined in a single unit.

[0134] It should be understood that in encoder 20 and 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 Clip or Shift may be performed on the processing result of interpolation filtering, motion vector derivation, or loop filtering.

[0135] Note that further operations may be applied to the derived motion vectors of the current block (including, but not limited to, the control point motion vector in affine mode, affine, plane, sub-block motion vectors in ATMVP mode, temporal motion vector, etc.). For example, the value of the motion vector is constrained to a predetermined range according to its representation bits. When the representation bit of the motion vector is bitDepth, the range is -2^(bitDepth-1) to 2^(bitDepth-1)-1, where "^" means exponentiation. For example, when bitDepth is set to be equal to 16, the range is -32768 to 32767, and when bitDepth is set to be equal to 18, the range is -131072 to 131071. For example, the value of the derived motion vector (e.g., the MV of 4 4×4 sub-blocks within one 8×8 block) is constrained such that the maximum difference between the integer parts of the MVs of the 4 4×4 sub-blocks is no more than N pixels, such as no more than 1 pixel. Here, two methods for constraining the motion vector according to bitDepth are provided.

[0136] Method 1: Remove the overflow MSB (most significant bit) by the flowing operation ux = ( mvx+2 bitDepth ) % 2 bitDepth (1) mvx = ( ux >= 2 bitDepth-1 ) ? ( ux - 2 bitDepth ) : ux (2) uy= ( mvy+2 bitDepth ) % 2 bitDepth (3) mvy = ( uy >= 2 bitDepth-1 ) ? ( uy - 2 bitDepth ) : uy (4) Wherein, mvx is the horizontal component of the motion vector of the image block or sub-block, mvy is the vertical component of the motion vector of the image block or sub-block, and ux and uy represent intermediate values.

[0137] For example, when the value of mvx is -32769, after applying equations (1) and (2), the resulting value is 32767. In a computer system, decimal numbers are stored as two's complements. The two's complement of -32769 is 1,0111,1111,1111,1111 (17 bits), and at that time, the MSB is discarded. Therefore, the resulting two's complement is 0111,1111,1111,1111 (decimal 32767), which is the same as the output by applying equations (1) and (2). ux = (mvpx + mvdx + 2 bitDepth ) % 2 bitDepth (5) mvx = (ux >= 2 bitDepth-1 )? (ux - 2 bitDepth ) : ux (6) uy = (mvpy + mvdy + 2 bitDepth ) % 2 bitDepth (7) mvy = (uy >= 2 bitDepth-1 )? (uy - 2 bitDepth ) : uy (8)

[0138] The operation may be applied in the sum of mvp and mvd as shown in equations (5) to (8).

[0139] Method 2: Removing the overflow MSB by clipping the value vx = Clip3(-2 bitDepth-1 , 2 bitDepth-1 -1, vx) vy = Clip3(-2 bitDepth-1 , 2 bitDepth-1 -1, vy) Where vx is the horizontal component of the motion vector of the image block or sub-block, vy is the vertical component of the motion vector of the image block or sub-block, x, y, and z respectively correspond to the three input values of the MV clipping process, and the definition of the function Clip3 is as follows.

[0140] [Number]

[0141] FIG. 4 is a schematic diagram of a video coding device 400 according to an embodiment of the present disclosure. The video coding device 400 is suitable for implementing the disclosed embodiments as described herein. In an 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.

[0142] The video coding device 400 includes an incoming 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 data, a transmitter unit (Tx) 440 and an outgoing port 450 (or output port 450) for transmitting data, and a memory 460 for storing data. The video coding device 400 may also include optical - electrical (OE) components and electro - optical (EO) components coupled to the incoming port 410, the receiver unit 420, the transmitter unit 440, and the outgoing port 450 for transmitting or receiving optical or electrical signals.

[0143] Processor 430 is implemented by hardware and software. Processor 430 may be implemented as one or more CPU chips, cores (e.g., as a multi-core processor), FPGA, ASIC, and DSP. Processor 430 communicates with incoming port 410, receiver unit 420, transmitter unit 440, outgoing port 450, and memory 460. Processor 430 includes coding module 470. Coding module 470 implements the disclosed embodiments described above. For example, coding module 470 implements, processes, prepares, or provides various coding operations. Thus, including coding module 470 significantly improves the function of video coding device 400 and brings about a transition of video coding device 400 to different states. Alternatively, coding module 470 is implemented as instructions stored in memory 460 and executed by processor 430.

[0144] Memory 460 may include one or more disks, tape drives, and solid state drives and may be used as an over-flow data storage device for storing such programs when selected for program execution and for storing 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).

[0145] FIG. 5 is a simplified block diagram of an apparatus 500 that may be used as either or both of the source device 12 and the destination device 14 of FIG. 1 according to an exemplary embodiment.

[0146] The processor 502 of device 500 can be a central processing unit. Alternatively, the processor 502 can be any other type of one or more devices, existing or to be developed in the future, that can manipulate or process information. Although the disclosed implementation can be carried out by a single processor, for example, processor 502, advantages in terms of speed and efficiency can be realized by using two or more processors.

[0147] The memory 504 of device 500 can be a read-only memory (ROM) device or a random access memory (RAM) device in an implementation. Any other suitable type of storage device can be used as the memory 504. The memory 504 can include code and data 506 that are accessed by the processor 502 using the bus 512. The memory 504 can further include an operating system 508 and an application program 510, and the application program 510 includes at least one program that enables the processor 502 to execute the methods described herein. For example, the application program 510 can include applications 1 to N that further include a video coding application that executes the methods described herein.

[0148] Device 500 can also include one or more output devices such as a display 518. In one example, the display 518 can be a touch display that is combined with a touch sensing element operable to sense touch input to the display. The display 518 can be coupled to the processor 502 via the bus 512.

[0149] Although shown here as a single bus, the bus 212 of the apparatus 500 can be composed of a plurality of buses. Further, the secondary storage 514 can be directly coupled to other components of the apparatus 500 or can be accessed via a network, and can include a single integrated unit such as a memory card or a plurality of units such as a plurality of memory cards. Thus, the apparatus 500 can be implemented in a wide variety of configurations.

[0150] Motion Vector Refinement (MVR) Normally, motion vectors are at least partially determined on the encoder side and signaled to the decoder within the encoded bitstream. However, motion vectors can also be refined at the decoder (and also at the encoder) starting from the initial motion vectors shown within the bitstream. In such cases, for example, the similarity between patches of already decoded pixels indicated by the initial motion vectors can be used to improve the accuracy of the initial motion vectors. Such motion refinement provides the advantage of reducing the signaling overhead, i.e., the accuracy of the initial motion is enhanced in the same way at both the encoder and the decoder, and thus no additional signaling for the refinement is required.

[0151] It is noted that the initial motion vector before improvement may not be the best motion vector that provides the best prediction. Since the initial motion vector is signaled in the bitstream, it may not be possible to represent the initial motion vector with very high accuracy (which would increase the bit rate), and thus, a motion vector improvement process is utilized to make the initial motion vector better. The initial motion vector may be, for example, the motion vector used in the prediction of neighboring blocks of the current block. In this case, it is sufficient to signal in the bitstream an indication of which neighboring block's motion vector is used by the current block. Such a prediction mechanism is very effective in reducing the number of bits for representing the initial motion vector. However, generally, the motion vectors of two neighboring blocks are not predicted to be the same, so the accuracy of the initial motion vector may be low.

[0152] To further increase the accuracy of the motion vector without further increasing the overhead of signaling, it may be beneficial to further improve the motion vector that is derived at the encoder side and provided (signaled) in the bitstream. The improvement of the motion vector may be performed at the decoder without assistance from the encoder. The encoder may use the same improvement to obtain the corresponding improved motion vector that is available at the decoder within the decoder loop of that encoder. The improvement for the currently reconstructed current block within the current picture is performed by determining a template of the reconstructed samples, determining the search space around the initial motion information for the current block, and finding the portion of the reference picture that best matches the template within the search space. The best-matching portion determines the improved motion vector for the current block, and that improved motion vector is used to obtain the inter-predicted samples for the current block, i.e., the currently reconstructed current block.

[0153] The improvement of the motion vector is part of the inter prediction unit (244) of FIG. 2 and part of 344 of FIG. 3.

[0154] The improvement of the motion vector may be performed according to the following steps.

[0155] Generally, the initial motion vector can be determined based on an indication in the bitstream. For example, an index indicating a position within a list of candidate motion vectors may be signaled in the bitstream. In another example, a motion vector predictor index and a value of the difference of the motion vector may be signaled in the bitstream. The motion vector determined based on the indication in the bitstream is defined as the initial motion vector. In the case of bi-prediction where the inter prediction for the current block is obtained as a weighted combination of predicted blocks of samples determined by two motion vectors, the initial motion vector in the first reference picture of list L0 is denoted as MV0, and the initial motion vector in the second reference picture of list L1 is denoted as MV1.

[0156] Using the initial motion vector, a pair of candidate motion vectors (MV) for improvement is determined. At least two pairs of candidates for improvement need to be determined. Generally, the pair of candidate motion vectors for improvement is determined based on the pair of initial motion vectors (MV0, MV1). Further, the pair of candidate MVs is determined by adding a small motion vector difference to MV0 and MV1. For example, the pair of candidate MVs may include the following. ·(MV0, MV1) ·(MV0 + (0,1), MV1 + (0,-1)) ·(MV0 + (1,0), MV1 + (-1,0)) ·(MV0 + (0,-1), MV1 + (0,1)) ·(MV0 + (-1,0), MV1 + (1,0)) ·... Here, (1, -1) represents a vector having a displacement of 1 in the horizontal (or x) direction and a displacement of -1 in the vertical (or y) direction.

[0157] It should be noted that the list above of candidate pairs is merely an example for illustration, and the present invention is not limited to a specific list of candidates.

[0158] Pairs of candidate motion vectors (MVs) form the search space of the motion vector refinement process.

[0159] In the bi-prediction of the current block, two predicted blocks obtained using the respective first motion vectors of list L0 and the second motion vectors of list L1 are combined into a single prediction signal, which can provide a better adaptation to the original signal than uni-prediction, resulting in less residual information and possibly more efficient compression.

[0160] In the refinement of motion vectors, two predicted blocks obtained using the respective first motion vectors and second motion vectors of pairs of candidate MVs are compared based on a similarity measurement criterion for each pair of candidate MVs for refinement. Usually, the pair of candidate MVs that results in the highest similarity is selected as the refined motion vector. The refined motion vector in the first reference picture of list L0 and the refined motion vector in the second reference picture of list L1 are denoted as MV0' and MV1', respectively. In other words, predictions corresponding to the motion vectors of list L0 and the motion vectors of list L1 of the pair of candidate motion vectors are obtained, and then those predictions are compared based on a similarity measurement criterion. The pair of candidate motion vectors having the highest relevant similarity is selected as the pair of refined MVs.

[0161] Generally, the output of the improvement process is the improved MV. The improved MV may be the same as or different from the initial MV depending on which pair of candidate MVs achieves the highest similarity, and the pairs of candidate MVs formed by the initial MV are also among the candidates for pairs of MVs. In other words, if the pair of the highest candidate MVs achieving the highest similarity is formed by the initial MV, the improved MV and the initial MV are equal to each other.

[0162] Instead of selecting the position that maximizes the similarity measurement criterion, another approach is to select the position that minimizes the dissimilarity measurement criterion. The measures for dissimilarity comparison can be SAD (Sum of Absolute Differences), MRSAD (Mean Removed Sum of Absolute Differences), SSE (Sum of Squared Errors), etc. The SAD between two prediction blocks can be obtained using a pair of candidate MVs (CMV0, CMV1), and the SAD can be calculated as follows.

[0163]

Equation

[0164] where nCbH and nCbW are the height and width of the prediction block, the function abs(a) specifies the absolute value of the argument a, and predSAmplesL0 and predSAmplesL1 are the prediction block samples obtained by the pair of candidate MVs represented by (CMV0, CMV1).

[0165] Alternatively, the measure for dissimilarity comparison can be obtained by evaluating only a subset of the samples within the prediction block to reduce the number of calculations. An example is as follows, where every other row of samples is alternatively included in the SAD calculation (every other row is evaluated).

[0166]

Equation

[0167] An example of motion vector improvement is described in JVET-M1001-v3, "Versatile Video Coding (Draft 4)", a JVET document (of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11) published at http: / / phenix.it-sudparis.eu / jvet / . Section "8.4.3 Decoder side motion vector refinement process" of the document exemplifies motion vector improvement.

[0168] To reduce the requirements for internal memory for improvement, in some embodiments, the motion vector improvement process can be performed independently on blocks of luma samples obtained by partitioning a coded block of samples that exceeds a particular predetermined width or a predetermined height within a luma sample into sub-blocks of samples that are below the predetermined width and the predetermined height of the luma. The pairs of improved MVs for each sub-block within the partitioned coded block can be different. And inter prediction for both luma and chroma is performed for each sub-block using the pair of improved MVs for that sub-block.

[0169] Each MV of the pair of initial MVs can have fractional pixel accuracy. In other words, the MV indicates the displacement between the current block of samples and the resampled reference region, and this displacement can indicate fractional positions in the horizontal and vertical directions from the integer grid of the reconstructed reference samples. Generally, 2D interpolation of the reconstructed reference integer sample grid values is performed to obtain the sample values at the fractional sample offset positions. The process of obtaining samples predicted from the reconstructed reference picture using the pair of candidate MVs can be by one of the following methods. · Round the fractional parts of the pair of initial MVs to the nearest integer positions to obtain the integer grid values of the reconstructed reference picture. · Perform 2-tap (e.g., bilinear) separable bilinear interpolation to obtain a sample value predicted by the accuracy of the fractional pixels indicated by the pair of initial MVs. · Perform separable interpolation with more taps (e.g., 8-tap or 6-tap) to obtain a sample value predicted by the accuracy of the fractional pixels indicated by the pair of initial MVs.

[0170] The pair of candidate MVs can have an offset of any sub-pixel with respect to the initial MV pair. However, in some embodiments, for simplicity of search, a pair of candidate MVs at an integer pixel distance with respect to the pair of initial MVs is selected. In such a case, the predicted samples of all pairs of candidate MVs can be obtained by performing a prediction regarding a block of samples around the pair of initial MVs such that the predicted samples of all pairs of candidate MVs encompass all improvement positions around the pair of initial MVs.

[0171] In some embodiments, when the cost values of the differences in all pairs of candidate MVs at an integer distance from the pair of initial MVs are evaluated, an additional pair of candidate MVs at a sub-pixel distance offset from the position of the best cost value is added. The predicted samples are obtained for each of these positions using one of the methods described above, and the cost of the difference is evaluated and compared to obtain the position with the lowest difference. In certain other embodiments, to avoid this computationally expensive prediction process for each sub-pixel distance position around the position of the best cost at an integer distance, the evaluated cost value at an integer distance is memorized and a parametric error surface is fitted in the vicinity of the position at an integer distance. Then, the minimum value of this error surface is calculated analytically and used as the position with the minimum difference. In such a case, it is said that the cost value of the difference is derived from the calculated cost value at an integer distance.

[0172] The application of motion vector refinement for a given coded block of samples can be conditioned by certain coding properties of the coded block of samples. Some examples of such coding properties can be the following. · The distance, expressed in number of pictures (when sampled at a uniform frame rate), to the two reference pictures used for dual prediction of the coded block of samples from the current picture is equal and decreases on both sides of the current picture. · The initial difference between the two predicted blocks obtained using the pair of initial MVs is less than a per-sample threshold determined in advance.

[0173] Bidirectional Prediction Optical Flow Refinement (BPOF) Bidirectional Prediction Optical Flow Refinement is a process that enhances the accuracy of block bidirectional prediction without any explicit additional signaling in the bitstream other than that signaled for bidirectional prediction. Bidirectional Prediction Optical Flow Refinement is part of the inter prediction unit (244) of FIG. 2 and 344 of FIG. 3.

[0174] In bidirectional prediction, two inter predictions are obtained according to two motion vectors, and then the predictions are combined by the application of a weighted average. The combined prediction can result in reduced residual energy because the quantization noise in the two reference patches cancels out, thereby providing a higher coding efficiency than single prediction. The weighted combination of bidirectional prediction is performed by the equation Bi-prediction = Prediction1 * W1 + Prediction2 * W2 + K where W1 and W2 are weighting factors that may be signaled in the bitstream or may be predefined on the encoder side or decoder side. K is also an additive factor that may be signaled in the bitstream or may be predefined on the encoder side or decoder side. As an example, bidirectional prediction is Bi - prediction = (Prediction1 + Prediction2) / 2 may be obtained using, where W1 and W2 are set to 1 / 2 and K is set to 0.

[0175] The purpose of optical flow improvement is to enhance the accuracy of bi - prediction. Optical flow is the visible motion pattern of image objects between two consecutive frames. Optical flow is caused by the movement of objects or the camera. The optical flow improvement process enhances the accuracy of bi - prediction by applying the optical flow equation (solving the optical flow equation).

[0176] In an example, pixel I(x,y,t) is within the first frame (where x and y correspond to spatial coordinates and t corresponds to the time dimension). The object represented by the pixel moves a distance (dx,dy) in the next frame acquired after a time dt. Since those pixels are the same and their intensity does not change, the optical flow equation is I(x,y,t) = I(x+dx, y+dy, t+dt) given by.

[0177] I(x,y,t) specifies the intensity (sample value) of the pixel at coordinates (x,y,t).

[0178] In another example, small displacements and higher - order terms in the Taylor series expansion are ignored, and the optical flow equation can be described as

[0179]

Equation

[0180] as, where

[0181]

Equation

[0182] is the gradient of the spatial samples in the horizontal and vertical directions at the position (x, y),

[0183]

Number

[0184] is the temporal partial derivative function at (x, y).

[0185] The improvement of the optical flow utilizes the above principle to enhance the quality of the double prediction.

[0186] The implementation of the improvement of the optical flow generally includes the following steps. 1. Calculate the gradient of the samples 2. Calculate the difference between the first prediction and the second prediction 3. Calculate the displacement of the pixels or groups of pixels that minimize the error Δ between the two reference patches obtained using the optical flow equation

[0187]

Number

[0188] where I (0) corresponds to the sample value of the first prediction, I (1) is the sample value of the second prediction, ∂I (0) / ∂x and ∂I (0) / ∂y are the gradients in the -x and -y directions, τ1 and τ0 represent the distances to the reference pictures, and the first prediction and the second prediction are obtained. The motion vectors (v x , v y ) are obtained by the minimization process. Some methods minimize the sum of squared residuals, while some methods minimize the sum of absolute errors. 4. Use the implementation of the optical flow equation as follows. pred BIO = 1 / 2·(I (0) + I (1) + v x / 2·(τ1∂I (1) / ∂x - τ0∂I (0) / ∂x) + v y / 2·(τ1∂I (1) / ∂y - τ0∂I (0) / ∂y)) where, pred BIO designates the corrected prediction that is the output of the optical flow improvement process.

[0189] The gradient of the sample can be obtained by the following formula. ·∂I(x, y, t) / ∂x = I(x + 1, y, t) - I(x - 1, y, t) ·∂I(x, y, t) / ∂y = I(x, y + 1, t) - I(x, y - 1, t)

[0190] In some embodiments, to reduce the complexity of the displacement estimation for each pixel, the displacement is estimated for a group of pixels. In some examples, to calculate an improved bi-prediction for a 4×4 luma sample block, the displacement is estimated using the sample values of an 8×8 luma sample block centered on the 4×4 block of samples.

[0191] The input to the optical flow improvement process is the predicted samples from two reference pictures, and the output of the optical flow improvement is the combined prediction (predBIO) calculated by the optical flow formula.

[0192] An example of the optical flow improvement is described in Section 8.4.7.4, "Bidirectional optical flow prediction process" of document JVET-M1001, Versatile Video Coding (Draft 4).

[0193] The terms optical flow improvement, dual-prediction optical flow improvement, and bidirectional optical flow improvement are used interchangeably in this disclosure as the terms are substantially equivalent.

[0194] In an example, the motion vector improvement and the optical flow improvement are applied sequentially as follows. Step 0: Obtain an initial motion vector as shown at 1010 in FIG. 8. Step 1: Motion vector improvement is applied at 1020, and an improved motion vector 1030 is obtained. Step 2: A prediction is obtained from the improved motion vector at 1040. The obtained prediction is I (0) and I (1) which are inputs to the optical flow improvement process. Step 3: The optical flow improvement process is applied to the prediction to obtain a corrected prediction. The corrected prediction is obtained by the optical flow formula and is denoted as pred BIO as shown.

[0195] However, the optical flow improvement process has a high computational load. The decoding time is increased by the application of optical flow improvement.

[0196] In one embodiment of the present invention, a method for determining whether to apply optical flow improvement is not disclosed, and this determination may be made by calculations performed during the motion vector improvement process.

[0197] More specifically, the result of the calculations performed during the motion vector improvement process is used to determine whether to apply optical flow improvement.

[0198] An object of the present invention is to skip the application of optical flow improvement according to specified conditions so that the average decoding time is reduced (by skipping necessary calculations).

[0199] According to the first exemplary embodiment, the following steps are applied to obtain a prediction regarding the current coding block. Step 0: Obtain an initial motion vector based on indication information in the bitstream. Step 1: Obtain a first prediction based on the initial motion vector and an M-tap interpolation filter. Step 2: Obtain a matching cost based on the first prediction. Step 3: Obtain an improved motion vector according to the initial motion vector and the matching cost. Step 4: Obtain a second prediction by the improved motion vector and a K-tap interpolation filter. Step 5: Determine whether an optical flow improvement process should be executed according to the matching cost. In the example, the matching cost is compared with a threshold value, and the optical flow improvement process is executed when the value of the matching cost is greater than or equal to the threshold value. Step 5 may also be executed before Step 3 or Step 4. Step 6: When it is determined that the optical flow improvement process needs to be executed, the improvement of the optical flow is applied with the second prediction as the input and the modified second prediction as the output. If it is determined negatively, the improvement of the optical flow is not applied to the second prediction. In other words, when it is determined that the optical flow improvement process needs to be executed, the final prediction of the current coding block is obtained by the second prediction and the optical flow improvement process. Otherwise, the final prediction of the current coding block is obtained by the second prediction without applying the optical flow improvement process.

[0200] The detailed description of the steps is as follows.

[0201] In step 0, two initial motion vectors are obtained as input. The initial motion vectors can be determined based on the indication information in the bitstream. For example, an index may be signaled in the bitstream, and the index indicates a position within a list of candidate motion vectors. In another example, a motion vector predictor index and a value of the difference of the motion vectors may be signaled in the bitstream. The motion vector determined based on the indication information in the bitstream is defined as the initial motion vector.

[0202] In another example, an indication of a reference picture can be obtained from the bitstream, and the initial motion vector is obtained based on the indication of the reference picture. The indication of the reference picture is used to determine the reference picture pointed to by the initial motion vector.

[0203] Steps 1, 2, and 3 correspond to the motion vector refinement process as described in the above example. The initial motion vector is refined by the refinement of the motion vector. In one example, the matching cost is a measure of similarity used in the refinement of the motion vector.

[0204] By step 1, a first prediction corresponding to the initial motion vector is obtained. In an example, in the motion vector refinement process, there are at least two pairs of candidate motion vectors, and one of them is usually the pair (MV0, MV1) formed by the initial motion vector. In other words, the set of candidate motion vectors usually includes two or more pairs, and one of the pairs is usually (MV0, MV1). The other pairs of candidate motion vectors are determined based on (MV0, MV1) by adding a small perturbation to the motion vector (as described in the above example).

[0205] In step 1, a first prediction corresponding to each pair of candidate motion vectors is obtained based on an M-tap interpolation filter. As an example, one prediction corresponding to MV0 can be obtained by identifying the position of a rectangular block within a reference picture (a picture that has already been encoded in the encoder or decoded in the decoder), where the block is indicated by MV0. Subsequently, advantageously, the interpolation filter is applied to the samples within the block indicated by MV0. To provide a more accurate motion estimation, the resolution of the reference picture may be increased by interpolating samples between pixels. Fractional pixel interpolation can be performed by a weighted average of the nearest pixels. Here, the M-tap filter can generally be a 2, 4, 6, or 8-tap filter (not limited to these options), that is, the filter has M multiplication coefficients. The prediction corresponding to MV1 can be obtained in a similar manner by identifying the position of a rectangular block within the same or a different reference picture. The size of the rectangle is proportional to the size of the current coding block.

[0206] In step 2, a matching cost associated with each pair of candidate motion vectors is determined according to the first prediction.

[0207] By step 2, at least one matching cost (e.g., a measure of similarity) corresponding to one of the pairs of improved candidate motion vectors (MVs) is obtained. The higher the similarity between the two predicted blocks, the smaller the matching cost.

[0208] The matching cost is used in the refinement of the initial motion vectors in step 3. The refined motion vectors are selected according to the matching cost.

[0209] In step 4, a second prediction is obtained by the refined motion vectors and a K-tap interpolation filter. In the case of two refined motion vectors (MV0' and MV1') for the case of dual prediction, two second predictions are obtained.

[0210] The second prediction may be the same as the first interpolation filter (M-tap filter) or may be obtained by applying a second interpolation filter (K-tap filter) that is not the same. The second prediction is obtained in the same manner as the first prediction by applying the second interpolation filter and according to the blocks indicated by MV0' and MV1' in the reference picture.

[0211] In step 5, the matching cost is used to determine whether to perform the optical flow improvement process as follows.

[0212] When the value of the matching cost is less than a predefined threshold, the improvement of the optical flow is not applied. When the value of the matching cost is greater than or equal to the threshold, the optical flow improvement process is executed. When the optical flow improvement process is executed, the samples of the final prediction are corrected.

[0213] In step 6, according to the output of step 5, when the matching cost is greater than or equal to the threshold, the optical flow improvement process is applied to the second prediction, and the second prediction is obtained by MV0' and MV1' (improved motion vectors). The final prediction regarding the current coding block is obtained by performing the optical flow improvement process on the second prediction, and the second prediction is indicated by MV0' and MV1'. When the matching cost is less than the threshold, the final prediction is obtained by the second prediction indicated by MV0' and MV1' without applying the improvement of the optical flow, that is, step 6 is not executed.

[0214] In one implementation, the matching cost in step 2 is the matching cost corresponding to a pair of initial motion vectors (which is one of the pairs of candidate motion vectors for improvement). The matching cost may correspond to the pair of MV0 and MV1.

[0215] In another implementation, the matching cost in step 2 is the matching cost equal to the minimum matching cost among pairs of improved candidate motion vectors (MVs). In other words, the matching costs corresponding to pairs of respective improved candidate motion vectors are obtained, and the matching cost is equal to the minimum matching cost among them. In one example, since the pair of improved motion vectors (MV0', MV1') has the minimum matching cost, the pair of improved motion vectors (MV0', MV1') is selected, so the matching cost is the matching cost corresponding to the pair of improved motion vectors MV0' and MV1'.

[0216] As an example, pairs of MVs can be constructed by the following method.

[0217] Pairs of candidate MVs are determined by adding small motion vector differences to MV0 and MV1. For example, pairs of candidate MVs can include the following. (MV0, MV1) (MV0 + (0,1), MV1 + (0,-1)) (MV0 + (1,0), MV1 + (-1,0))

[0218] Throughout this application, MV0 and MV1 are initial motion vectors, and MV0' and MV1' are improved motion vectors.

[0219] According to another implementation, when the optical flow improvement process is not executed, the final prediction is obtained by the following formula. Bi-prediction = Prediction1 * W1 + Prediction2 * W2 + K where W1 and W2 are weight coefficients, W1 and W2 may be signaled within the bitstream, or W1 and W2 may be predefined on the encoder side or the decoder side. K is also an additive factor that may be signaled within the bitstream or predefined on the encoder side or the decoder side. In the example, bi-prediction may be obtained using Bi-prediction = (Prediction1 + Prediction2) / 2 where W1 and W2 are set to 1 / 2 and K is set to 0. Prediction1 and Prediction2 are the second predictions obtained by K-tap interpolation filtering, Prediction1 corresponds to the first improved MV (MV0'), and Prediction2 corresponds to the second improved MV (MV1').

[0220] The above equation realizes a weighted combination of two predictions, and the result is the final prediction regarding the block.

[0221] The threshold value can be a predefined value, and the value of the threshold may depend on the size of the prediction block. For example, the threshold value can be thr = nCbW × nCbH × K, where K is a value greater than zero, and nCbW and nCbH are the width and height of the prediction block.

[0222] The first embodiment is further illustrated by the flowchart of FIG. 6.

[0223] In one implementation, the M-tap filter is a 2-tap filter (e.g., a bilinear filter) where one of the taps is equal to zero. In this implementation, the M-tap filter uses two multiplier coefficients, and the value of one of the coefficients is always equal to zero. Which coefficient has a value equal to zero is determined based on the fractional sample point, where the fractional sample point is indicated by the motion vector. In this case, depending on the fractional component of the motion vector, either the value of the first multiplier coefficient or the value of the second multiplier coefficient may be zero.

[0224] Such a filter having two taps where one is zero can be exemplified by the table below.

[0225]

Table 1

[0226] The fractional sample position (p) can be obtained according to the components of the initial or improved motion vector. For example, if the -x component of the motion vector is given by MV0x, the fractional sample position can be obtained as p = MV0x % 16, where "%" is the modulo operation. Generally, p = MV0x % K, where K represents the number of fractional sample positions between two sample positions. The interpolation filter exemplified above can also be called a 1-tap filter since only one of the filter taps becomes non-zero at a time.

[0227] In one implementation, the value of K is equal to 8. In other examples, the value of M is less than 8.

[0228] In one implementation, both the value of M and the value of K are equal to 8.

[0229] The initial motion vector, which is the input to the motion vector improvement unit, is obtained at 710. A search space is constructed around the initial motion vector by the motion vector improvement unit (740). In one example, the search space consists of pairs of candidate motion vectors, where the first motion vector of the pair corresponds to a first reference picture and the second motion vector of the pair corresponds to a second reference picture. A first prediction corresponding to each pair of candidate motion vectors is obtained at step 710 by application of an M-tap interpolation filter. As part of the improvement of the motion vector, a matching cost corresponding to one of the pairs of motion vectors within the search space is calculated (720). The matching cost is used as part of two processes. The first process is the improvement of the motion vector (740) in which the matching cost is used to determine which pair of motion vectors is selected as the improved pair of motion vectors (750). The second process is the determination of whether the improvement of the optical flow (770) is applied. After the improved motion vector is obtained, a second prediction regarding the current block is obtained by (760). If the matching cost is above a threshold, the improvement of the optical flow is applied and the prediction of 760 is modified by 770 to obtain a modified prediction (780). The modified prediction generally has sample values different from the second prediction of step 760.

[0230] In one example, the motion vector improvement process is executed two or more times to further improve the motion vector. In this example, first, the initial motion vector is improved by the motion vector improvement process to obtain a first improved motion vector. Thereafter, the improvement of the motion vector is executed again, in which case the first improved motion vector is considered as the initial motion vector for the improvement of the second motion vector.

[0231] According to a second exemplary embodiment, the following steps are applied to obtain a prediction regarding the current coding block. Step 0: Obtain an initial motion vector based on the indication information in the bitstream. Step 1: Obtain a first prediction based on the initial motion vector and the M-tap interpolation filter. Step 2: Obtain N matching costs based on the first prediction. Step 3: Obtain an improved motion vector according to the initial motion vector and the N matching costs based on the first function. Step 4: Obtain a second prediction by the improved motion vector and the K-tap interpolation filter. Step 5: Determine whether to execute the optical flow improvement process according to the N matching costs. The derived cost is obtained by the N matching costs and the second function. In the example, the derived cost is compared with a threshold, and the optical flow improvement process is executed when the value of the derived cost is greater than or equal to the threshold. Step 5 may also be executed before Step 3 or Step 4. Step 6: When it is determined that the optical flow improvement process needs to be executed, correct at least one sample of the prediction of the current coding block by applying the improvement of the optical flow.

[0232] When it is determined that the optical flow improvement process needs to be executed, the improvement of the optical flow is applied with the second prediction as the input and the corrected second prediction as the output. If the determination is negative, the improvement of the optical flow is not applied to the second prediction. In other words, when it is determined that the optical flow improvement process needs to be executed, the final prediction of the current coding block is obtained by the second prediction and the optical flow improvement process. Otherwise, the final prediction of the current coding block is obtained by the second prediction without applying the optical flow improvement process.

[0233] The detailed description of the steps is as follows.

[0234] In step 0, two initial motion vectors are obtained as input. The initial motion vectors can be determined based on the indication information in the bitstream. For example, an index may be signaled in the bitstream, and the index indicates a position within a list of candidate motion vectors. In another example, a motion vector predictor index and a value of the difference of the motion vectors may be signaled in the bitstream. The motion vector determined based on the indication information in the bitstream is defined as the initial motion vector.

[0235] In another example, an indication of a reference picture can be obtained from the bitstream, and the initial motion vector is obtained based on the indication of the reference picture. The indication of the reference picture is used to determine the reference picture pointed to by the initial motion vector.

[0236] Steps 1, 2, and 3 correspond to a motion vector refinement process as described in the above example. The initial motion vector is refined by the refinement of the motion vector. In one example, the matching cost is a measure of similarity used in the refinement of the motion vector.

[0237] By step 1, a first prediction corresponding to the initial motion vector is obtained. In an example, in the motion vector refinement process, there are at least two pairs of candidate motion vectors, and one of them is usually a pair (MV0, MV1) formed by the initial motion vector. Also, the other pairs of candidate motion vectors are determined based on (MV0, MV1) by adding a small perturbation to the motion vector (as described in the above example).

[0238] In step 1, a first prediction corresponding to each pair of candidate motion vectors is obtained based on an M-tap interpolation filter.

[0239] In step 2, N matching costs associated with N pairs of candidate motion vectors are determined according to the first prediction.

[0240] In step 2, N matching costs (measures of similarity) corresponding to N of the pairs of improved candidate motion vectors (MVs) are obtained. The higher the similarity between two prediction blocks, the smaller the matching cost.

[0241] The N matching costs are used in the refinement of the initial motion vectors in step 3.

[0242] The refined motion vector is determined by the first function and the N matching costs.

[0243] In one example, the refined motion vector can be obtained by the following function. - If (sad

[0003] + sad[5]) is equal to ( sad

[0004] << 1 ), dmvOffset

[0000] is set to be equal to 0 - Otherwise, the following applies dmvOffset

[0000] = ( ( sad

[0003] - sad

[0005] ) << 3 ) / ( sad

[0003] + sad

[0005] - ( sad

[0004] << 1 ) ) - If ( sad

[0001] + sad[7]) is equal to ( sad

[0004] << 1 ), dmvOffset

[0001] is set to be equal to 0 - Otherwise, the following applies dmvOffset

[0001] = ( ( sad

[0001] - sad

[0007] ) << 3 ) / ( sad

[0001] + sad

[0007] - ( sad

[0004] << 1 ) ) In the formula, dmvOffset[0] and dmvOffset[1] specify the difference between the initial motion vector and the improved motion vector. In the example, dmvOffset[0] and dmvOffset[1] specify the -x and -y components of the difference between the improved motion vector and the initial motion vector. sad[0] to sad[7] are the N matching costs corresponding to N pairs of candidate motion vectors. The improved motion vector is obtained by adding dmvOffset to the initial motion vector.

[0244] There may be other functions that may be used to determine the improved motion vector according to the N matching costs. The first function of the present invention is not limited to the above formula.

[0245] In step 4, a second prediction is obtained by the improved motion vector and the K-tap interpolation filter. In the case of two improved motion vectors (MV0' and MV1') in the case of double prediction, two second predictions are obtained.

[0246] The second prediction may be the same as the first interpolation filter (M-tap filter), or may be obtained by applying a second interpolation filter (K-tap filter) that is not the same. The second prediction is obtained in the same manner as the first prediction by applying the second interpolation filter and according to the blocks indicated by MV0' and MV1' in the reference picture.

[0247] In step 5, the derived cost is obtained by the second function and the N matching costs. The derived cost is used to determine whether to execute the optical flow improvement process. When the value of the derived cost is less than a predefined threshold, the optical flow improvement process is not applied. When the value of the derived cost is greater than or equal to the threshold, the optical flow improvement process is executed. When the optical flow improvement process is executed, the samples of the final prediction are corrected.

[0248] In step 6, according to the output of step 5, if the derived cost is greater than the threshold, the optical flow improvement process is applied to the second prediction, and the second prediction is obtained by MV0' and MV1' (improved motion vectors). The final prediction regarding the current coding block is obtained by performing the optical flow improvement process on the second prediction, and the second prediction is indicated by MV0' and MV1'. If the matching cost is less than the threshold, the final prediction is obtained by the second prediction indicated by MV0' and MV1' without applying the improvement of the optical flow, that is, step 6 is not executed.

[0249] According to another implementation, when the optical flow improvement process is not executed, the final prediction is obtained by the following formula. Bi - prediction = Prediction1 * W1 + Prediction2 * W2 + K Where W1 and W2 are weight coefficients, and W1 and W2 may be signaled in the bitstream or may be predefined on the encoder side or decoder side. K is also an additive factor that may be signaled in the bitstream or may be predefined on the encoder side or decoder side. In the example, the bi - prediction is Bi - prediction = (Prediction1 + Prediction2) / 2 is used, where W1 and W2 are set to 1 / 2 and K is set to 0. Prediction1 and Prediction2 are the second predictions obtained by K - tap interpolation filtering, Prediction1 corresponds to the first improved MV (MV0'), and Prediction2 corresponds to the second improved MV (MV1').

[0250] The above formula realizes a weighted combination of two predictions, and the result is the final prediction regarding the block.

[0251] The threshold value can be a predefined value, and the value of the threshold depends on the size of the prediction block. For example, the threshold value can be thr = nCbW × nCbH × K, where K is a value greater than zero, and nCbW and nCbH are the width and height of the prediction block.

[0252] The second embodiment is further illustrated by the flowchart of FIG. 7.

[0253] In one implementation, the M - tap filter is a 2 - tap filter (e.g., a bilinear filter) in which one of the taps is equal to zero. In this implementation, the M - tap filter uses two multiplier coefficients, and the value of one of the coefficients is always equal to zero. The coefficient equal to zero is determined based on the fractional sample point indicated by the motion vector. In this case, depending on the fractional component of the motion vector, the value of the first multiplier coefficient or the value of the second multiplier coefficient may be zero.

[0254] Such a filter having two taps with one being zero can be illustrated by the following table.

[0255]

Table 2

[0256] The fractional sample position (p) can be obtained according to the components of the initial or improved motion vector. For example, when the - x component of the motion vector is given by MV0x, the fractional sample position can be obtained as p = MV0x % 16, where "%" is the modulo operation. Generally, p = MV0x % K, where K represents the number of fractional sample positions between two sample positions. The interpolation filter illustrated above can also be called a 1 - tap filter because only one of the filter taps becomes non - zero at a time.

[0257] Another example of a bilinear interpolation filter can be as follows, where both filter coefficients are non-zero.

[0258]

Table 3

[0259] In one implementation, the value of K is equal to 8. In other examples, the value of M is less than 8.

[0260] In one implementation, both the value of M and the value of K are equal to 8.

[0261] In one implementation, the second function can be a function for linearly combining N matching costs according to dmvOffset, where dmvOffset has been obtained in step 3. The linear combination of x and y can be any expression of the form ax + by, where a and b are constants. In an example, the constants a and b can be determined based on dmvOffset. An example of the second function is given below.

[0262] In one implementation, the second function can be as follows. · Sad[1]*A + Sad[2]*B + Sad[3]*C + Sad[4]*D, where A, B, C, and D are non-negative. In one example, A, B, C, and D can be numbers between 0 and 1 and sum to 1 (i.e., A + B + C + D = 1). In another example, A, B, C, and D can be non-negative numbers that sum to a predefined fixed number P, where P can be equal to 1, 2, 4, 8, 16, etc. · A, B, C, and D can be predefined fixed numbers. ·A, B, C, and D may be derived according to dmvOffset

[0000] and dmvOffset

[0001] . In the example, A = dmvOffset

[0000] , B = P1 - dmvOffset

[0000] , C = dmvOffset

[0001] , D = P2 - dmvOffset

[0001] . Wherein, P1 and P2 may be equal to 1, 4, 8, 16, etc. ·The above formula is given as an example. The formula represents a linear combination of four matching costs to obtain the derived cost. In the formula, the dmvOffset that may be obtained in step 3 is used. The dmvOffset represents the difference between the improved motion vector and the initial motion vector. In one specific implementation, the dmvOffset is defined as the difference between MV0 and MV0'. More specifically, dmvOffset[0] may be the difference between the -x components of MV0 and MV0', while dmvOffset[1] may be the difference between the -y components of MV0 and MV0'.

[0263] In another implementation, the second function can be as follows. ·Sad[1]*A + Sad[2]*B + Sad[3]*C, where A, B, and C are non - negative. In one example, A, B, and C may be numbers between 0 and 1 and sum to 1 (i.e., A + B + C = 1). In another example, A, B, and C may be numbers that are non - negative and sum to a predefined fixed number P, and P may be equal to 1, 2, 4, 8, 16, etc. ·A, B, and C can be predefined fixed numbers. ·A, B, and C may be derived according to dmvOffset

[0000] and dmvOffset

[0001] . In the example, A = P - dmvOffset

[0000] - dmvOffset

[0001] , B = dmvOffset

[0000] , C = dmvOffset

[0001] . Wherein, P may be equal to 1, 4, 8, 16, etc. · The above formula is given as an example. The formula represents a linear combination of three matching costs to obtain the derived cost. In the formula, the dmvOffset that may be obtained in step 3 is used. The dmvOffset represents the difference between the improved motion vector and the initial motion vector. In one example, the dmvOffset is defined as the difference between MV0 and MV0'. More specifically, dmvOffset[0] may be the difference between the -x components of MV0 and MV0', while dmvOffset[1] may be the difference between the -y components of MV0 and MV0'.

[0264] In another implementation, the second function to obtain the derived cost can be as follows. · Using five evaluated difference cost values (e.g., SAD values) of the improved MV pairs and the candidate MV pairs at an integer distance from the improved MV pairs, the parametric error surface function E(x,y) = A*(x - x0) 2 + B*(y - y0) 2 + C is fitted, where (x0, y0) corresponds to the position where the difference between two reference patches is minimized, C is the cost value at (x0, y0), and A, B are model coefficients. These five unknowns can be solved exactly when five cost values are available. In other words, the formula for E(x,y) assumes that the shape of the matching cost as a function of the spatial position near the position of the minimum matching cost is parabolic.

[0265] In one embodiment, the candidate MV pairs to the left, above, right, and below the improved MV pairs at a distance of 1 integer pixel are used. In this case, when the evaluated values of E(x,y) at the (x,y) positions (0,0), (-1,0), (0,-1), (1,0), and (0,1) and the parametric equation of E(x,y) are given, the five unknowns A, B, C, x0, y0 can be solved as follows.

[0266]

Number

[0267] On the one hand, if the cost values of six or more positions are available, the five unknowns can be solved using the least squares method or a similar technique. At that time, the obtained value of C becomes the derived cost.

[0268] In one implementation, the second function can be as follows.

[0269]

Number

[0270] In the formula, K is a scalar greater than 0, and sad[0] to sad[4] are N matching costs.

[0271] In one example, the motion vector improvement process is executed two or more times to further improve the motion vector. In this example, first, the initial motion vector is improved by the motion vector improvement process to obtain the first improved motion vector. Then, the improvement of the motion vector is executed again. In this case, the first improved motion vector is regarded as the initial motion vector for the second motion vector improvement.

[0272] The initial motion vector, which is the input to the motion vector improvement unit, is obtained at 925. A search space is constructed around the initial motion vector by the motion vector improvement unit (930). In one example, the search space consists of pairs of candidate motion vectors, where the first motion vector of the pair corresponds to a first reference picture and the second motion vector of the pair corresponds to a second reference picture. A first prediction corresponding to each pair of candidate motion vectors is obtained at step 910 by application of an M-tap interpolation filter. As part of the improvement of the motion vector, matching costs corresponding to N pairs of motion vectors within the search space are calculated (915). The N matching costs are used as part of two processes. The first process is a motion vector improvement (930) in which the matching costs are used to calculate a pair of improved motion vectors (935) by a function that receives the N matching costs as input. The second process is a determination as to whether optical flow improvement (950) is to be applied, and the determination is made at 945. After the improved motion vector is obtained, a second prediction regarding the current block is obtained at (940). If the matching cost is greater than a threshold, optical flow improvement is applied and the prediction at 940 is modified by 950 to obtain a modified prediction (955 - 960). The modified prediction generally has sample values different from the second prediction at step 940. If the matching cost is less than the threshold, optical flow improvement is not applied and the second prediction is set as the output (the final prediction of the current block).

[0273] According to a third exemplary embodiment of the present invention, the following steps are applied to obtain a prediction regarding a current coding block. Step 0: Obtain a pair of initial motion vectors based on indication information within the bitstream. Step 1: Obtain a first set of samples predicted based on the pair of initial MVs and an M-tap interpolation filter. Step 2: Obtain a first matching cost corresponding to the pair of initial MVs using a first set of predicted samples. Step 3: Determine whether the current coding block is eligible to perform motion vector refinement. Step 4: If in Step 3 it is determined that the current coding block is eligible to perform MVR, Step 4a: Using the motion vector refinement process, obtain a pair of refined MVs and a matching cost corresponding to the pair of refined MVs according to the pair of initial MVs and the matching cost. Step 4b: Obtain a second set of samples predicted by the pair of refined MVs and a K-tap interpolation filter. Step 4c: Determine whether an optical flow refinement process should be executed according to the second matching cost. In an example, the matching cost is compared with a threshold value, and the optical flow refinement process is executed when the value of the matching cost is greater than or equal to the threshold value. Step 5: Otherwise (if in Step 3 it is determined that the current coding block is not suitable to perform MVR), Step 5a: Obtain a second set of samples predicted by the pair of initial MVs and a K-tap interpolation filter. Step 5b: Determine whether an optical flow refinement process should be executed according to the first matching cost. In an example, the matching cost is compared with a threshold value, and the optical flow refinement process is executed when the value of the matching cost is greater than or equal to the threshold value. Step 6: When it is determined that the optical flow improvement process needs to be executed (either in step 4c or step 5b), the improvement of the optical flow is applied with the second prediction as the input and the corrected second prediction as the output. If it is determined negatively, the improvement of the optical flow is not applied to the second prediction. In other words, when it is determined that the optical flow improvement process needs to be executed, the final prediction of the current coding block is obtained by the second prediction and the optical flow improvement process. Otherwise, the final prediction of the current coding block is obtained by the second prediction without applying the optical flow improvement process.

[0274] This embodiment is further illustrated in the flowchart of FIG. 9. Block 1110 receives a pair of initial MVs for the current coding block for prediction at references L0 and L1. Block 1110 corresponds to step 1, and using the pair of initial MVs and the reconstructed reference samples of pictures L0 and L1, a first set of predicted samples is obtained. Block 1120 corresponds to step 2, and a first matching cost (or a measure of difference such as SAD) is evaluated between the first set of predicted blocks of samples corresponding to the pair of initial MVs (as described in the section on background MVR). Block 1130 corresponds to step 3, and conditions regarding the suitability of the current coding block for performing MVR are examined. Block 1140 corresponds to step 4a, and if it is found that the current coding block is eligible to perform MVR, an improved pair of MVs is obtained by performing MVR (as described in the section on background MVR), and a second matching cost (or measure of difference) corresponding to the improved pair of MVs is obtained. Block 1150 corresponds to step 4b, and a second set of predicted samples is obtained using the improved pair of MVs and a K-tap interpolation filter (in the horizontal and vertical directions). Block 1160 corresponds to step 4c, and it is examined whether the second matching cost is less than a predetermined threshold, and if it is less than the threshold, improvements based on dual-prediction optical flow and dual-prediction are skipped. Block 1180 corresponds to step 5a, and the current coding block skips MVR and uses the pair of initial MVs and a K-tap interpolation filter to obtain a second set of predicted samples. Block 1185 corresponds to step 5b, and it is examined whether the first matching cost is less than a predetermined threshold, and if it is less than the threshold, BPOF is skipped.Blocks 1170 and 1195 correspond to part of step 6, indicating that the check in step 4c or step 5b shows that the second or first matching cost is respectively less than a predetermined threshold. When BPOF is skipped below the threshold, a weighted average of the dual prediction without BPOF is performed using the second set of predicted samples. Block 1175 corresponds to part of step 6, indicating that the check in step 4c or step 5b shows that the second or first matching cost is not less than a predetermined threshold. When BPOF is skipped below the threshold, the estimated optical flow is obtained and the final dual prediction is obtained using the second set of predicted samples, the gradient of the second set of predicted samples, and the estimated optical flow.

[0275] Note that in order to determine an early termination of the improvement process based on the dual-predicted optical flow, the determination of whether to skip or execute BPOF can vary for each sub-block of MVR within a coding unit by using the first or second matching cost calculated for the sub-block of samples within the current coding unit required by the motion vector improvement process. BPOF is applied or skipped for all BPOF application units (e.g., pixel level or 4×4 block at sample level) within the sub-block based on the determination made in step 4c or step 5.

[0276] In certain embodiments, it is possible to perform further early termination for each BPOF application unit within the sub-block by obtaining a partial matching cost corresponding to each BPOF application unit within the sub-block of MVR.

[0277] The predetermined threshold is generally selected as a per-sample threshold that depends on the bit depth of the first prediction or the first set of predicted samples. For example, the first predicted sample value obtained using bilinear (2-tap) interpolation is constrained to be at bit depth b, and the per-sample threshold is calculated as k*2 (b-10) If the number of samples for which the matching cost is calculated is N, the predetermined threshold against which the matching cost for the current sub-block is compared is k*N*2 (10-b) The sample value for k is 2 (with respect to bit depth 10), N is 8×16 = 128, and b is 8. Since the matching cost for a given pair of candidate MVs can be calculated using a significantly reduced set of the first predicted samples, the value of N should be used accordingly. For example, if every other row of an 8×16 block of predicted samples is used, N is calculated as 8×8 = 64.

[0278] According to an embodiment of the present invention, an early termination method is provided for conditionally skipping the application of an optical flow improvement process, which is considered to have a high computational load. As a result, the average decoding time is reduced.

[0279] Furthermore, the condition for conditionally skipping the application of optical flow is determined based on a parameter calculated by another process (that calculates the matching cost in the process of the motion vector improvement process). Since the already calculated value is used, no additional calculation needs to be performed.

[0280] In particular, a method of video coding implemented in a decoding device or an encoding device as shown in FIG. 10 is provided. The method includes the following steps that may be executed in a given order. An initial motion vector is obtained 1210 for the current block, which may be the current coding block. A first prediction regarding the sample values within the current block is obtained 1220 based on the initial motion vector. A matching cost is calculated 1230 according to the first prediction.

[0281] After the first matching cost is obtained, it is determined 1240 whether an optical flow improvement process should be executed according to at least one preset condition. The at least one preset condition includes a condition of whether the calculated matching cost (e.g., according to a similarity measure; see the above description) is greater than or equal to a predefined threshold. When it is determined that the optical flow improvement process should be executed, an optical flow improvement process is executed 1250 to obtain a final inter-prediction regarding the sample values within the current block. When it is determined that the optical flow improvement process should not be executed, computational cost can be saved by skipping the optical flow improvement process.

[0282] This method may be implemented in the device described above with reference to FIGS. 1a to 5.

[0283] In particular, the method may be implemented in the context of a motion vector improvement process on the decoder side. The input to such a process is as follows. A luma position (xSb, ySb) specifying the top-left sample of the current coding sub-block with respect to the top-left luma sample of the current picture A variable sbWidth specifying the width of the current coding sub-block in luma samples A variable sbHeight specifying the height of the current coding sub-block in luma samples Luma motion vectors mvL0 and mvL1 with 1 / 16 fractional sample precision Selected luma reference picture sample array refPicL0 L and refPicL1 L

[0284] The output of this process is the delta luma motion vectors dMvL0 and dMvL, and the variable dmvrSad that specifies the sum of absolute differences of the minimum of the first prediction (see SAD calculation above).

[0285] The delta luma motion vector dMvL0 may be derived by dMvL0

[0000] += 16 * intOffX and dMvL0

[0001] += 16 * intOffY, where intOffX and intOffY are the integer sample offsets in the x and y directions respectively. Further, the delta luma motion vector dMvL may be calculated as dMvL1

[0000] = -dMvL0

[0000] and dMvL1

[0001] = -dMvL0

[0001] .

[0286] The first predicted luma sample value is derived by bilinear interpolation of fractional samples. In the decoding process of the inter-predicted block, the sample prediction process of bidirectional optical flow may or may not be applied. If the sample prediction process of bidirectional optical flow is not applied, the weighted sample prediction process is applied to the improved second prediction obtained based on the improved motion vector. If the sample prediction process of bidirectional optical flow is applied, the sample prediction process of bidirectional optical flow receives the second prediction obtained based on the improved motion vector as input and outputs the final prediction.

[0287] A flag may be used to signal whether a sample prediction process for bidirectional optical flow can be applied. For example, it may be considered a necessary condition for the sample prediction process of bidirectional optical flow to be executed that the flag is TRUE. However, this necessary condition may not be a sufficient condition for the sample prediction process of bidirectional optical flow to be executed. The sufficient condition may be both that the flag is TRUE and that the above-described matching cost is greater than or equal to a predefined threshold. For example, the matching cost may be determined based on a variable dmvrSad that specifies the sum of the absolute differences of the minimum of the first prediction.

[0288] On the other hand, if the flag is FALSE, it may be considered a sufficient condition for not executing the sample prediction process of optical flow and executing the weighted sample prediction process.

[0289] Furthermore, a device 1300 for use in an image encoder and / or image decoder is provided as shown in FIG. 11. The device 1300 includes an initial motion vector unit 1310 configured to obtain an initial motion vector for the current block according to this exemplary embodiment. Furthermore, the device 1300 includes a prediction unit 1320 configured to obtain a first prediction regarding sample values within the current block based on the initial motion vector. Furthermore, the device 1300 includes a matching cost calculation unit 1330 configured to calculate a matching cost according to the first prediction.

[0290] Device 1300 includes an optical flow improvement process determination unit 1340 configured to determine whether an optical flow improvement process should be executed according to at least one preset condition, and the at least one preset condition includes a condition of whether the calculated matching cost is greater than or equal to a threshold value. Further, when it is determined that the optical flow improvement process should be executed, device 1300 includes an optical flow improvement process execution unit 1350 configured to execute the optical flow improvement process to obtain a final inter-prediction regarding sample values within the current block.

[0291] Mathematical operator 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 precisely defined, and additional operations such as exponentiation and division of real values are defined. The numbering and counting rules generally start from 0. For example, "the first" is equivalent to number 0, "the second" is equivalent to number 1, and so on.

[0292] Arithmetic operator The following arithmetic operators are defined as follows.

[0293]

Number

[0294] Logical operator The following logical operators are defined as follows. x && y Boolean logical "product" of x and y x || y Boolean logical "sum" of x and y ! Boolean logical "negation" x? y : z If x is true or not equal to 0, it is evaluated as value y; otherwise, it is evaluated as value z.

[0295] Relational operator The following relational operators are defined as follows. > greater than >= greater than or equal to < less than <= less than or equal to == equal to != not equal to

[0296] When a relational operator is applied to a syntax element or variable to which the value "na" (not applicable) is assigned, the value "na" is treated as a distinct value with respect to the syntax element or variable. The value "na" is considered not equal to any other value.

[0297] Bitwise operators The following bitwise operators are defined as follows. & bitwise "logical AND". When operating on integer arguments, it acts on the two's complement representation of the integer values. When operating on a binary argument that contains fewer bits than the other argument, the shorter argument is extended by adding leading bits equal to 0. | bitwise "logical OR". When operating on integer arguments, it acts on the two's complement representation of the integer values. When operating on a binary argument that contains fewer bits than the other argument, the shorter argument is extended by adding leading bits equal to 0. ^ bitwise "exclusive OR". When operating on integer arguments, it acts on the two's complement representation of the integer values. When operating on a binary argument that contains fewer bits than the other argument, the shorter argument is extended by adding leading bits equal to 0. x>>y arithmetic right shift of the two's complement representation of the integer x by y binary digits. 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 the same value as the MSB of x before the shift operation. x << y: Arithmetic left shift of the two's complement integer representation of x by y binary digits. 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.

[0298] 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 as an array index, it is evaluated with the value of the variable before the increment operation. -- Decrement, i.e., x-- is equivalent to x = x - 1, and when used as an array index, it is evaluated with the value of the variable before the decrement operation. += Increment by the specified amount, i.e., x += 3 is equivalent to x = x + 3, and x += (-3) is equivalent to x = x + (-3). -= Decrement by the specified amount, i.e., x -= 3 is equivalent to x = x - 3, and x -= (-3) is equivalent to x = x - (-3).

[0299] Range notation The following notations are used to specify a range of values. x = y..z: x takes integer values from y to z, inclusive, where x, y, and z are integer values and z is greater than y.

[0300] Mathematical functions The following mathematical functions are defined.

[0301]

Number

[0302] The arcsine function of trigonometry that acts on an argument x in the range from -1.0 to 1.0 including -1.0 and 1.0, and has an output value in the range from -π÷2 to π÷2 including -π÷2 and π÷2 in radians The arctangent function of trigonometry that acts on an argument x and has an output value in the range from -π÷2 to π÷2 including -π÷2 and π÷2 in radians

[0303] [Mathematics]

[0304] Ceil(x) The smallest integer greater than or equal to x. Clip1 Y (x) = Clip3(0, (1 << BitDepth Y ) - 1, x) Clip1 C (x) = Clip3(0, (1 << BitDepth C ) - 1, x)

[0305] [Mathematics]

[0306] Cos(x) The cosine function of trigonometry that acts on an argument x in radians. Floor(x) The largest integer less than or equal to x.

[0307] [Mathematics]

[0308] Ln(x) The natural logarithm of x (logarithm with base e, where e is the constant 2.718281828... of the base of the natural logarithm). Log2(x) The logarithm of x with base 2. Log10(x) The logarithm of x with base 10.

[0309] [Number]

[0310] Round(x) = Sign(x) * Floor(Abs(x) + 0.5)

[0311] [Number]

[0312] Sin(x) The sine function of trigonometry acting on the argument x in radians

[0313] [Number]

[0314] Tan(x) The tangent function of trigonometry acting on the argument x in radians

[0315] Priority of operations When the priority in the formula is not explicitly specified using parentheses, the following rules apply. - Operations with higher priority are evaluated before any operations with lower priority. - Operations with the same priority are evaluated in order from left to right.

[0316] The following table shows the priorities of operations from the highest to the lowest, with higher positions in the table indicating higher priorities.

[0317] Regarding the operators also used in the C programming language, the priorities used in this specification are the same as those used in the C programming language.

[0318] Table: Priority of operations from the highest (at the top of the table) to the lowest (at the bottom of the table)

[0319]

Table 4

[0320] Text description of logical operations In the present text, in the following form, i.e., if( condition 0 ) Statement 0 else if( condition 1 ) Statement 1 ... else / * Comment conveying information about the remaining conditions * / Statement n The logical operation statements mathematically described in the form of As follows... / ... The following applies. - In the case of condition 0, Statement 0 - Otherwise, in the case of condition 1, Statement 1 -... - In other cases (comment conveying information about the remaining conditions), Statement n

[0321] Each "in the case of..., otherwise in the case of..., in other cases,..." statement in the present text is introduced by "as follows..." or "... the following applies." immediately following "in the case of...". The last condition of "in the case of..., otherwise in the case of..., in other cases,..." is always "in other cases,...". The alternately inserted "in the case of..., otherwise in the case of..., in other cases,..." statements can be identified by matching "as follows..." or "... the following applies." with the ending "in other cases,...".

[0322] In the present text, in the following form, i.e., if( condition 0a && condition 0b ) Statement 0 else if (condition 1a || condition 1b) Statement 1 ... else Statement n A logical operation statement described mathematically in the form of... can be described as follows. The following applies... / ... below applies. - When all of the following conditions are true, Statement 0 - Condition 0a - Condition 0b - Otherwise, when one or more of the following conditions are true, Statement 1 - Condition 1a - Condition 1b -... - In other cases, Statement n

[0323] In this document, in the following form, that is, if (condition 0) Statement 0 if (condition 1) Statement 1 A logical operation statement described mathematically in the form of... can be described as follows. When condition 0, Statement 0 When condition 1, Statement 1

[0324] Although embodiments of the present invention have been mainly described based on video coding, embodiments of the coding system 10, the encoder 20, and the decoder 30 (and the system 10 correspondingly), as well as other embodiments described herein, may be configured for the processing or coding of still pictures, i.e., individual pictures independent of any preceding or subsequent pictures similar to video coding. Note that generally, when the processing coding of a picture is limited to a single picture 17, only the inter prediction units 244 (encoder) and 344 (decoder) may not be available. All other functions (also called tools or technologies) of the video encoder 20 and the video decoder 30, such as residual calculation 204 / 304, transformation 206, quantization 208, dequantization 210 / 310, (inverse) transformation 212 / 312, segmentation 262 / 362, intra prediction 254 / 354, and / or loop filters 220, 320, and entropy coding 270, and entropy decoding 304 may be equally used for the processing of still pictures.

[0325] For example, the encoder 20 and the decoder 30, and embodiments of the functions described herein in connection with, for example, the encoder 20 and the decoder 30, may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on a computer-readable medium as one or more instructions or code or transmitted over a communication medium and may be executed by a processing unit based on hardware. The computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium such as a data storage medium, or a communication medium including any medium that facilitates transfer of a computer program from one place to another, for example, by a communication protocol. In this way, generally, the computer-readable medium may correspond to (1) a tangible computer-readable storage medium that is non-transitory or (2) a communication medium such as a signal or a carrier wave. The data storage medium 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 implementation of the techniques described in this disclosure. A computer program product may include a computer-readable medium.

[0326] By way of example and not limitation, such computer-readable storage media can 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 the desired program code in the form of instructions or data structures and that is accessible by a computer. Also, any connection can be properly termed a computer-readable medium. For example, if the 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, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient media, but instead are directed to non-transitory, tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc (registered trademark), optical disc, digital versatile disc (DVD), floppy disk (registered trademark), and Blu-ray disc (registered trademark), where disk typically magnetically reproduces data, while disc optically reproduces data using a laser. Combinations of the above should also be included within the scope of computer-readable media.

[0327] The commands 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 circuits. Accordingly, the term "processor" as used herein may refer to any of the foregoing structures or any other structure suitable for implementation of the techniques described herein. Additionally, in some aspects, the functions described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques may be implemented entirely in one or more circuits or logic elements.

[0328] The techniques of the present disclosure may be implemented in a variety of devices or apparatuses including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to emphasize aspects of the functionality of a device configured to execute the disclosed techniques, but implementation by different hardware units is not necessarily required. Rather, as described above, the various units may be provided by a combination in a codec hardware unit or by a set of interoperable hardware units including one or more of the foregoing processors in conjunction with suitable software and / or firmware.

Description of the Symbols

[0329] 10 Video coding system, coding system 12 Source device 13 Encoded picture data, communication channel 14 Destination device 16 Picture source 17 Picture, picture data, raw picture, raw picture data, monochrome picture, color picture, current picture 18 Preprocessor, preprocessing unit, picture preprocessor 19 Preprocessed picture, preprocessed picture data 20 Video encoder, encoder 21 Encoded picture data, encoded bitstream 22 Communication interface, communication unit 28 Communication interface, communication unit 30 Decoder, video decoder 31 Decoded picture data, decoded picture 32 Postprocessor, postprocessing unit 33 Postprocessed picture data, postprocessed picture 34 Display device 46 Processing circuit 100 Video encoder 201 Input, input interface 203 Picture block, original block, current block, segmented block, current picture block 204 Residual calculation unit, residual calculation 205 Residual block, residual 206 Transformation processing unit, transformation 207 Transformation coefficient 208 Quantization unit, quantization 209 Quantized coefficient, quantized transformation coefficient, quantized residual coefficient 210 Dequantization unit, dequantization 211 Dequantized coefficient, dequantized residual coefficient 212 Inverse transformation processing unit, (inverse) transformation 213 Reconstructed residual block, dequantized coefficient, transformation block 214 Reconstruction unit, adder, summer 215 Reconstructed block 216 Buffer 220 Loop filter unit, loop filter 221 Filtered block, filtered reconstructed block 230 Decoded picture buffer (DPB) 231 Decoded picture 244 Inter prediction unit 254 Intra prediction unit, inter prediction unit, intra prediction 260 Mode selection unit 262 Partitioning unit, partitioning 265 Prediction block, predictor 266 Syntax element 270 Entropy coding unit, entropy coding 272 Output, output interface 304 Entropy decoding unit, residual calculation, entropy decoding 309 Quantized coefficient 310 Inverse quantization unit, inverse quantization 311 Inverse quantized coefficient, transform coefficient 312 Inverse transform processing unit, (inverse) transform, output 313 Reconstructed residual block 314 Reconstruction unit, adder, adder 315 Reconstructed block 320 Loop filter, loop filter unit 321 Filtered block, decoded video block 330 Decoded picture buffer (DPB) 331 Decoded picture 344 Inter prediction unit 354 Intra prediction unit, intra prediction 360 Mode application unit 362 Partitioning 365 Prediction block 400 Video coding device 410 Incoming port, input port 420 Receiver Unit (Rx) 430 Processor, Logic Unit, Central Processing Unit (CPU) 440 Transmitter Unit (Tx) 450 Transmission Port, Output Port 460 Memory 470 Coding Module 500 Device 502 Processor 504 Memory 506 Data 508 Operating System 510 Application Program 512 Bus 514 Secondary Storage 518 Display 1300 Device 1310 Initial Motion Vector Unit 1320 Prediction Unit 1330 Matching Cost Calculation Unit 1340 Optical Flow Improvement Process Judgment Unit 1350 Optical Flow Improvement Process Execution Unit

Claims

1. A method of video coding implemented in a decoding device or an encoding device, comprising: obtaining an initial motion vector for a current block; obtaining a first prediction for sample values within the current block based on the initial motion vector; calculating a first matching cost according to the first prediction; determining whether an optical flow improvement process should be executed according to at least one preset condition, where the at least one preset condition includes a condition of whether the calculated first matching cost is greater than or equal to a threshold; executing the optical flow improvement process to obtain a final inter-prediction for the sample values within the current block when it is determined that the optical flow improvement process should be executed; A method comprising the above steps.

2. The method according to claim 1, wherein the at least one preset condition includes a condition that the current block can be predicted by improvement of a motion vector on the decoder side.

3. The method according to claim 1 or 2, wherein when it is determined that all of the at least one preset conditions are satisfied, it is determined that the optical flow improvement process should be executed.

4. The method according to any one of claims 1 to 3, wherein the first prediction for the sample values within the current block is obtained based on a first interpolation filter.

5. The method according to claim 4, wherein the first interpolation filter is a bilinear interpolation filter.

6. further comprising obtaining an improved motion vector based on the initial motion vector and the first matching cost; obtaining a second prediction for the sample values within the current block according to the improved motion vector; The method according to any one of claims 1 to 5, wherein the step of executing the optical flow improvement process includes executing the improvement of the optical flow based on the second prediction.

7. The step of obtaining a first prediction for sample values within the current block based on the initial motion vector is ​ Obtaining several pairs of candidates based on the initial motion vector; Obtaining a first prediction regarding sample values within the current block based on at least one of the pairs of candidates; including; the step of calculating a first matching cost according to the first prediction; determining a matching cost for each of the pairs of candidates based on the first prediction; determining the minimum matching cost among the determined matching costs as the first matching cost; The method according to any one of claims 1 to 6, including.

8. The method according to claim 6 or 7, wherein the second prediction regarding the sample values within the current block is obtained according to a second interpolation filter.

9. The method according to any one of claims 6 to 8, wherein the second interpolation filter is a 6-tap or 8-tap interpolation filter.

10. The method according to any one of claims 6 to 9, wherein the improved motion vector is obtained according to a second matching cost.

11. The method according to claim 10, wherein when the value of the second matching cost is greater than or equal to another threshold, it is determined that the optical flow improvement process should be executed.

12. The method according to any one of claims 6 to 11, wherein the final inter prediction is obtained by a weighted sum of the second prediction only when it is determined that the optical flow improvement process should not be executed.

13. The method according to any one of claims 1 to 12, wherein the threshold or another threshold is a value calculated based on the bit depth of the first prediction.

14. The method according to any one of claims 1 to 13, wherein the threshold is obtained according to the number of predicted samples used to calculate the first matching cost according to the first prediction.

15. The method according to any one of claims 1 to 14, wherein the threshold is obtained according to the size of the current block.

16. The method according to any one of claims 9 to 15, wherein the second matching cost is a derived cost obtained using a predefined model regarding the matching cost evaluated during the improvement of the motion vector and the shape of the matching cost near the position of the minimum matching cost.

17. The method according to claim 16, wherein the predefined model is a linear combination model.

18. The method according to any one of claims 1 to 17, wherein the first matching cost is a measure of similarity.

19. The method according to any one of claims 1 to 18, wherein the current block is a coding block or a sub-block.

20. The method according to any one of claims 1 to 19, further comprising the step of generating an inter-prediction block including the final inter-prediction regarding the sample values within the current block.

21. An encoder (20) including a processing circuit for executing the method according to any one of claims 1 to 20.

22. A decoder (30) including a processing circuit for executing the method according to any one of claims 1 to 20.

23. A computer program product including program code for executing the method according to any one of claims 1 to 20.

24. A decoder or an encoder, comprising one or more processors, a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming configuring the decoder to execute the method according to any one of claims 1 to 20 when executed by the processor and including a non-transitory computer-readable storage medium.

25. A device for use in an image encoder and / or an image decoder, an initial motion vector unit configured to obtain an initial motion vector regarding a current block, a first prediction unit configured to obtain a first prediction regarding sample values within the current block based on the initial motion vector, a first matching cost calculation unit configured to calculate a first matching cost according to the first prediction An optical flow improvement process determination unit configured to determine whether an optical flow improvement process should be executed according to at least one preset condition, wherein the at least one preset condition includes a condition of whether the calculated first matching cost is greater than or equal to a threshold value, and the optical flow improvement process determination unit An optical flow improvement process execution unit configured to execute the optical flow improvement process to obtain a final inter-prediction regarding the sample values within the current block when it is determined that the optical flow improvement process should be executed A device including the above.

26. The device according to claim 25, wherein the at least one preset condition includes a condition that the current block can be predicted by improving the motion vector on the decoder side.

27. The device according to claim 25 or 26, wherein the optical flow improvement process determination unit is configured to determine that the optical flow improvement process should be executed when it is determined that all of the at least one preset condition are satisfied.

28. The device according to any one of claims 24 to 27, further including a first interpolation filter, and the first prediction unit is configured to obtain the first prediction regarding the sample values within the current block by the first interpolation filter.

29. The device according to claim 28, wherein the first interpolation filter is a bilinear interpolation filter.

30. An improved motion vector unit configured to obtain an improved motion vector based on the initial motion vector and the first matching cost, and A second prediction unit configured to obtain a second prediction regarding the sample values within the current block according to the improved motion vector further included. The device according to any one of claims 25 to 29, wherein the optical flow improvement process execution unit is configured to execute improvement of the optical flow based on the second prediction when the optical flow improvement process determination unit determines that the optical flow improvement process should be executed.

31. The first prediction unit is configured to obtain a first prediction regarding sample values within the current block based on the initial motion vector by obtaining several pairs of candidates based on the initial motion vector and obtaining a first prediction regarding sample values within the current block based on at least one of the pairs of candidates. The device according to any one of claims 24 to 30, wherein the first matching cost calculation unit is configured to calculate the first matching cost according to the first prediction by determining a matching cost for each of the pairs of candidates based on the first prediction and determining the minimum matching cost among the determined matching costs as the first matching cost.

32. The device according to claim 30 or 31, further comprising a second interpolation filter, wherein the second prediction unit is configured to obtain the second prediction regarding the sample values within the current block by the second interpolation filter.

33. The device according to claim 32, wherein the second interpolation filter is a 6-tap or 8-tap interpolation filter.

34. The device according to any one of claims 30 to 33, further comprising a second matching cost calculation unit configured to calculate a second matching cost, wherein the improved motion vector unit is configured to obtain the improved motion vector according to the second matching cost.

35. The device according to claim 34, wherein the optical flow improvement process determination unit is configured to determine that the optical flow improvement process should be executed when the value of the second matching cost is equal to or greater than another threshold.

36. A weighted sum prediction unit configured to obtain the final inter prediction by the weighted sum of the second prediction only when it is determined by the optical flow improvement process determination unit that the optical flow improvement process should not be executed. The device according to any one of claims 30 to 35.

37. The device according to any one of claims 30 to 36, further comprising a threshold calculation unit configured to calculate the threshold or another threshold based on the bit depth of the first prediction.

38. The device according to any one of claims 25 to 37, further comprising a threshold calculation unit configured to calculate the threshold according to the number of predicted samples used to calculate the first matching cost according to the first prediction by the first matching cost calculation unit.

39. The device according to any one of claims 30 to 38, further comprising a threshold calculation unit configured to calculate the threshold according to the size of the current block.

40. A second matching cost calculation unit calculates the second matching cost as a derived cost obtained using a predefined model regarding the matching cost evaluated during the improvement of the motion vector executed by the improved motion vector unit and the shape of the matching cost near the position of the minimum matching cost. The device according to any one of claims 30 to 39.

41. The device according to claim 40, wherein the predefined model is a linear combination model.

42. The device according to any one of claims 25 to 41, wherein the first matching cost is a measure of similarity.

43. The device according to any one of claims 25 to 42, wherein the current block is a coding block or a sub-block.

44. The device according to any one of claims 25 to 43, further comprising an inter prediction block generation unit configured to generate an inter prediction block including the final inter prediction regarding the sample values within the current block.

Citation Information

Patent Citations

  • Inter prediction mode-based image processing method and apparatus therefor

    US20180242004A1

  • Predicted-image generation device, video decoding device, and video coding device

    WO2018173895A1

  • Decoder side motion vector refinement in video coding

    WO2019001259A1

  • Motion-compensation prediction based on BI-directional optical flow

    WO2019010156A1