Method and apparatus for video coding using history-based motion vector prediction

By using a parallel processing method based on the history-based motion vector predictive value table in video data encoding and decoding, the problem of efficient encoding and decoding of high-resolution video data is solved, and more efficient video data processing and quality maintenance are achieved.

CN118317107BActive Publication Date: 2025-06-17BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410491245.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-07-18
Filing Date
2019-07-16
Publication Date
2025-06-17
Estimated Expiration
2039-07-16

AI Technical Summary

Technical Problem

In the process of video data encoding and decoding, how to improve the efficiency of video data encoding and decoding while maintaining the image quality of decoded video data, especially when processing high-resolution video data.

Method used

Using a parallel processing system and method based on the history-based motion vector predicted value (HMVP) table, a motion vector candidate list is constructed, and the best motion vector predicted value is selected for encoding and decoding.

Benefits of technology

The efficiency of video data encoding and decoding is improved, the amount of motion information is reduced, the calculation complexity of encoding and decoding is reduced, and high-quality decoded video data is maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118317107B_ABST
    Figure CN118317107B_ABST
Patent Text Reader

Abstract

A coding method, before coding the first CU in the current CTU row of the current picture to be coded, resets the history-based motion vector prediction value HMVP table. Coding the current CTU row includes: maintaining a plurality of motion vector prediction values in the HMVP table; for the current CU to be coded in the current CTU row: constructing a motion vector candidate list according to the prediction mode and at least partially based on the plurality of motion vector prediction values in the HMVP table; selecting a motion vector prediction value from the motion vector candidate list; determining a motion vector at least partially based on the prediction mode and the selected motion vector prediction value to code the current CU; and updating the HMVP table based on the determined motion vector, wherein the prediction mode is an inter-frame mode, and the motion vector candidate list has a fixed length of two.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese Patent Application No. 201980047626.9, which is the national phase application in China of the international patent application PCT / US2019 / 041923 filed on July 16, 2019, and the international patent application claims the priority of the US patent application No. 62 / 700,106 filed on July 18, 2018. Technical Field

[0002] This application generally relates to video data encoding and decoding, and more particularly, to methods and systems for video encoding using history-based motion vector prediction. Background Art

[0003] A variety of electronic devices, such as digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video game consoles, smartphones, video teleconferencing devices, video streaming devices, etc., support digital video. The electronic devices transmit, receive, encode, decode, and / or store digital video data by implementing video compression / decompression standards defined by, for example, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10, Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC) standards. Video compression typically includes performing spatial (intra-frame) prediction and / or temporal (inter-frame) prediction to reduce or remove the redundancy inherent in the video data. For block-based video coding, a video frame is partitioned into one or more strips, each strip having a plurality of video blocks, which may also be referred to as coding tree units (CTUs). Each CTU may contain one coding unit (CU) or be recursively divided into smaller CUs until a preset minimum CU size is reached. Each CU (also referred to as a leaf CU) contains one or more transform units (TUs), and each CU also contains one or more prediction units (PUs). Each CU can be encoded in intra-frame, inter-frame, or IBC mode. Video blocks in the intra-coded (I) strips of a video frame are encoded using spatial prediction relative to reference samples in adjacent blocks within the same video frame. Video blocks in the inter-coded (P or B) strips of a video frame can be encoded using spatial prediction relative to reference samples in adjacent blocks within the same video frame or temporal prediction relative to reference samples in other previous and / or future reference video frames.

[0004] Spatial or temporal prediction based on previously encoded reference blocks (e.g., neighboring blocks) generates a prediction block for a current video block to be encoded. The process of finding the reference block can be accomplished by a block matching algorithm. Residual data representing the pixel difference between the current block to be encoded and the prediction block is referred to as a residual block or prediction error. Inter-coded blocks are encoded based on a motion vector pointing to a reference block in a reference frame forming the prediction block and the residual block. The process of determining the motion vector is typically referred to as motion estimation. Intra-coded blocks are encoded based on an intra-prediction mode and the residual block. For further compression, the residual block is transformed from the pixel domain to a transform domain, such as the frequency domain, to generate residual transform coefficients, which can then be quantized. The quantized transform coefficients initially arranged as a two-dimensional array can be scanned to generate a one-dimensional vector of the transform coefficients, and then entropy encoded into a video bitstream to achieve more compression.

[0005] Then, the encoded video bitstream is saved in a computer-readable storage medium (e.g., flash memory) to be accessed by another electronic device having digital video capabilities or directly transmitted to the electronic device in a wired or wireless manner. Then, the electronic device performs video decompression (which is a process opposite to the video compression described above) by, for example, parsing the encoded video bitstream to obtain syntax elements from the bitstream and reconstructing the digital video data from the encoded video bitstream into its original format at least in part based on the syntax elements obtained from the bitstream, and rendering the reconstructed digital video data on a display of the electronic device.

[0006] As digital video quality goes from high definition to 4K×2K or even 8K×4K, the amount of video data to be encoded / decoded grows exponentially. There has been a challenge in encoding / decoding video data more efficiently while maintaining the image quality of the decoded video data. SUMMARY OF THE INVENTION

[0007] This application describes embodiments related to video data encoding and decoding, and more particularly, embodiments related to systems and methods for parallel processing of video data during video encoding and decoding using history-based motion vector prediction.

[0008] According to a first aspect of the present application, a method for decoding video data is performed at a computing device having one or more processors and a memory storing a plurality of programs to be executed by the one or more processors. After obtaining a video bitstream, the computing device first extracts data associated with a plurality of encoded pictures from the video bitstream, each picture including a plurality of coded tree unit (CTU) rows, and each CTU including one or more coding units (CUs). Before starting to decode the first CU in the current CTU row of the decoded current picture, the computing device resets the history-based motion vector prediction value (HMVP) table. Then, when decoding the current CTU row, the computing device maintains a plurality of motion vector prediction values in the HMVP table, each motion vector prediction value having been used to decode at least one CU. For the current CU to be decoded in the current CTU row, the computing device extracts a prediction mode from the video bitstream and constructs a motion vector candidate list according to the prediction mode and at least partially based on the motion vector prediction values in the HMVP table. After selecting a motion vector prediction value from the motion vector candidate list, the computing device determines a motion vector at least partially based on the prediction mode and the selected motion vector prediction value, decodes the current CU using the determined motion vector, and updates the HMVP table based on the determined motion vector.

[0009] According to a second aspect of the present application, a computing device includes one or more processors, a memory, and a plurality of programs stored in the memory. When executed by the one or more processors, the programs cause the computing device to perform the operations as described above.

[0010] According to a third aspect of the present application, a non-transitory computer-readable storage medium stores a plurality of programs for execution by a computing device having one or more processors. When executed by the one or more processors, the programs cause the computing device to perform the operations as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings, which are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification, illustrate the described embodiments and, together with the description, serve to explain the basic principles. Like reference numerals refer to corresponding parts.

[0012] Figure 1 is a block diagram illustrating an exemplary video encoding and decoding system according to some embodiments of the present disclosure.

[0013] Figure 2 is a block diagram illustrating an exemplary video encoder according to some embodiments of the present disclosure.

[0014] Figure 3is a block diagram illustrating an exemplary video decoder in accordance with some embodiments of the present disclosure.

[0015] Figures 4A to 4D is a block diagram illustrating how a frame is recursively quadtree partitioned into multiple video blocks of different sizes in accordance with some embodiments of the present disclosure.

[0016] Figure 5A is a block diagram illustrating spatially adjacent and temporally collocated block positions of a current CU to be encoded in accordance with some embodiments of the present disclosure.

[0017] Figure 5B is a block diagram illustrating multi-threaded encoding of multiple CTU rows of a picture using wavefront parallel processing in accordance with some embodiments of the present disclosure.

[0018] Figure 6 is a flowchart illustrating an exemplary process by which a video encoder implements techniques for constructing a candidate list of motion vector prediction values in accordance with some embodiments of the present disclosure. DETAILED DESCRIPTION

[0019] Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth in order to assist in understanding the subject matter presented herein. However, it will be apparent to one of ordinary skill in the art that various alternative solutions may be used and the subject matter may be practiced without these specific details. For example, it will be apparent to one of ordinary skill in the art that the subject matter presented herein may be implemented on many types of electronic devices having digital video capabilities.

[0020] Figure 1 is a block diagram illustrating an exemplary system 10 for encoding and decoding video blocks in parallel. As Figure 1 shown, system 10 includes a source device 12 that generates and encodes video data to be decoded by a destination device 14 at a later time. Source device 12 and destination device 14 may include any of a variety of electronic devices, including desktop or laptop computers, tablet computers, smart phones, set-top boxes, digital televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some embodiments, source device 12 and destination device 14 are equipped with wireless communication capabilities.

[0021] In some embodiments, the destination device 14 may receive encoded video data to be decoded via the link 16. The link 16 may include any type of communication medium or device capable of moving the encoded video data from the source device 12 to the destination device 14. In one example, the link 16 may include a communication medium that enables the source device 12 to directly transmit the encoded video data to the destination device 14 in real time. The encoded video data may be modulated and transmitted to the destination device 14 according to a communication standard such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, such as the radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network (such as a local area network, a wide area network, or a global network (such as the Internet)). The communication medium may include routers, switches, base stations, or any other device that may be used to facilitate communication from the source device 12 to the destination device 14.

[0022] In some other embodiments, the encoded video data may be transmitted from the output interface 22 to the storage device 32. Subsequently, the encoded video data in the storage device 32 may be accessed by the destination device 14 via the input interface 28. The storage device 32 may include any of a variety of distributed or locally accessible data storage media, such as a hard disk drive, a Blu-ray disc, a DVD, a CD-ROM, flash memory, volatile memory, or non-volatile memory, or any other suitable digital storage media for storing the encoded video data. In additional examples, the storage device 32 may correspond to a file server or another intermediate storage device that may hold the encoded video data generated by the source device 12. The destination device 14 may access the stored video data from the storage device 32 via streaming or downloading. The file server may be any type of computer capable of storing the encoded video data and transmitting the encoded video data to the destination device 14. Exemplary file servers include web servers (e.g., for websites), FTP servers, network-attached storage (NAS) devices, or local disk drives. The destination device 14 may access the encoded video data through any standard data connection, including a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both, suitable for accessing the encoded video data stored on the file server. Transmitting the encoded video data from the storage device 32 may be a streaming transmission, a download transmission, or a combination of both.

[0023] As Figure 1As shown, source device 12 includes video source 18, video encoder 20, and output interface 22. Video source 18 may include sources such as video capture devices, e.g., cameras, video archives containing previously captured video, video feed interfaces for receiving video from video content providers, and / or computer graphics systems for generating computer graphics data as source video, or combinations of these sources. As an example, if video source 18 is a camera of a security monitoring system, source device 12 and destination device 14 may form a camera phone or video phone. However, the embodiments described in this application are generally applicable to video encoding and may be applied to wireless and / or wired applications.

[0024] Captured, pre-captured, or computer-generated video may be encoded by video encoder 20. The encoded video data may be transmitted directly to destination device 14 via output interface 22 of source device 12. The encoded video data may also (or alternatively) be stored on storage device 32 for later access by destination device 14 or other devices for decoding and / or playback. Output interface 22 may further include a modem and / or a transmitter.

[0025] Destination device 14 includes input interface 28, video decoder 30, and display device 34. Input interface 28 may include a receiver and / or a modem and receives the encoded video data via link 16. The encoded video data transmitted or provided via link 16 and stored on storage device 32 may include various semantic elements generated by video encoder 20 for use by video decoder 30 to decode the video data. These semantic elements may be included within the encoded video data transmitted on a communication medium, stored on a storage medium, or stored in a file server.

[0026] In some embodiments, destination device 14 may include display device 34, which may be an integrated display device and an external display device configured to communicate with destination device 14. Display device 34 displays the decoded video data to a user and may include any of a variety of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.

[0027] Video encoder 20 and video decoder 30 may operate according to proprietary or industry standards such as VVC, HEVC, MPEG-4 Part 10, Advanced Video Coding (AVC), or extensions of these standards. It should be understood that the present application is not limited to a specific video coding / decoding standard and may be applicable to other video coding / decoding standards. It is generally contemplated that the video encoder 20 of the source device 12 may be configured to encode video data according to any of these current or future standards. Similarly, it is generally also contemplated that the video decoder 30 of the destination device 14 may be configured to decode video data according to any of these current or future standards.

[0028] Video encoder 20 and video decoder 30 may each be implemented as any of a variety of suitable encoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When implemented partially in software, the electronic device may store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the video coding / decoding operations disclosed in the present disclosure. Each of video encoder 20 and video decoder 30 may be included in one or more encoders or decoders, and any of the one or more encoders or decoders may be integrated as part of a combined encoder / decoder (CODEC) in the corresponding device.

[0029] Figure 2 is a block diagram illustrating an exemplary video encoder 20 according to some embodiments described in the present application. Video encoder 20 may perform intra prediction coding and inter prediction coding on video blocks within a video frame. Intra prediction coding relies on spatial prediction to reduce or remove spatial redundancy of video data within a given video frame or picture. Inter prediction coding relies on temporal prediction to reduce or remove temporal redundancy of video data within adjacent video frames or pictures of a video sequence.

[0030] Such as Figure 2As shown, the video encoder 20 includes a video data memory 40, a prediction processing unit 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processing unit 52, a quantization unit 54, and an entropy encoding unit 56. The prediction processing unit 41 further includes a motion estimation unit 42, a motion compensation unit 44, a partitioning unit 45, an intra prediction processing unit 46, and an intra block copy (BC) unit 48. In some embodiments, the video encoder 20 further includes an inverse quantization unit 58, an inverse transform processing unit 60, and an adder 62 for video block reconstruction. A deblocking filter (not shown) may be located between the adder 62 and the DPB 64 to filter block boundaries to remove block effect artifacts from the reconstructed video. In addition to the deblocking filter, a loop filter (not shown) may also be used to filter the output of the adder 62. The video encoder 20 may be in the form of fixed or programmable hardware units, or may be partitioned among one or more of the illustrated fixed or programmable hardware units.

[0031] The video data memory 40 may store video data to be encoded by components of the video encoder 20. The video data in the video data memory 40 may be obtained, for example, from the video source 18. The DPB 64 is a buffer that stores reference video data for encoding video data by the video encoder 20 (e.g., in an intra prediction coding mode or an inter prediction coding mode). The video data memory 40 and the DPB 64 may be formed of any of a variety of memory devices. In various examples, the video data memory 40 may be on-chip with other components of the video encoder 20, or off-chip relative to those components.

[0032] As Figure 2 shown, after receiving the video data, the partitioning unit 45 within the prediction processing unit 41 partitions the video data into video blocks. This partitioning may also include partitioning the video frame into strips, tiles, or other larger coding units (CUs) according to a preset segmentation structure, such as a quadtree structure associated with the video data. The video frame may be divided into a plurality of video blocks (or a set of video blocks referred to as tiles). The prediction processing unit 41 may select one of a plurality of possible prediction coding modes for the current video block based on error results (e.g., coding rate and distortion level), such as one of a plurality of intra prediction coding modes or one of a plurality of inter prediction coding modes. The prediction processing unit 41 may provide the resulting intra prediction coded block or inter prediction coded block to the adder 50 to generate a residual block, and to the adder 62 to reconstruct the encoded block to be subsequently used as part of a reference frame. The prediction processing unit 41 also provides semantic elements such as motion vectors, intra mode indicators, partitioning information, and other such semantic information to the entropy encoding unit 56.

[0033] To select an appropriate intra prediction coding mode for the current video block, the intra prediction processing unit 46 within the prediction processing unit 41 can perform intra prediction coding of the current video block with respect to one or more neighboring blocks in the same frame as the current block to be encoded to provide spatial prediction. The motion estimation unit 42 and the motion compensation unit 44 within the prediction processing unit 41 perform inter prediction coding of the current video block with respect to one or more prediction blocks in one or more reference frames to provide temporal prediction. The video encoder 20 can execute multiple coding channels, for example, to select an appropriate coding mode for each block of video data.

[0034] In some embodiments, the motion estimation unit 42 determines an inter prediction mode of the current video frame by generating a motion vector according to a predetermined pattern within the video frame sequence, the motion vector indicating the displacement of a prediction unit (PU) of a video block within the current video frame with respect to a prediction block within a reference video frame. The motion estimation performed by the motion estimation unit 42 is a process of generating a motion vector, which estimates the motion of a video block. The motion vector can, for example, indicate the displacement of the PU of a video block within the current video frame or picture with respect to a prediction block (or other coding unit) within the reference frame with respect to the current block (or other coding unit) being encoded within the current frame. The predetermined pattern can designate video frames in the sequence as P frames or B frames. The intra BC unit 48 can determine a vector for performing intra BC coding, such as a block vector, in a manner similar to the way the motion estimation unit 42 determines a motion vector for inter prediction, or can utilize the motion estimation unit 42 to determine the block vector.

[0035] A prediction block is a block of a reference frame that is considered to closely match the PU of the video block to be encoded in terms of pixel difference, which can be determined by the sum of absolute differences (SAD), the sum of squared differences (SSD), or other difference metrics. In some embodiments, the video encoder 20 can calculate values at sub-integer pixel positions of the reference frames stored in the DPB 64. For example, the video encoder 20 can insert values at quarter-pixel positions, eighth-pixel positions, or other fractional pixel positions of the reference frames. Thus, the motion estimation unit 42 can perform a motion search with respect to full-pixel positions and fractional pixel positions and output a motion vector with fractional pixel accuracy.

[0036] The motion estimation unit 42 calculates a motion vector of the PU of a video block in an inter prediction coded frame by comparing the position of the PU with the position of a prediction block of a reference frame selected from a first reference frame list (list 0) or a second reference frame list (list 1), each of the lists identifying one or more reference frames stored in the DPB 64. The motion estimation unit 42 sends the calculated motion vector to the motion compensation unit 44 and then to the entropy coding unit 56.

[0037] The motion compensation performed by the motion compensation unit 44 may involve obtaining or generating a prediction block based on the motion vectors determined by the motion estimation unit 42. After receiving the motion vectors of the PUs of the current video block, the motion compensation unit 44 may locate the prediction block pointed to by the motion vectors in one of the reference frame lists, retrieve the prediction block from the DPB 64 and forward the prediction block to the adder 50. Then, the adder 50 forms a residual video block with pixel differences by subtracting the pixel values of the prediction block provided by the motion compensation unit 44 from the pixel values of the current video block being encoded. The pixel differences forming the residual video block may include a luminance difference component or a chrominance difference component or both. The motion compensation unit 44 may also generate semantic elements associated with the video blocks of the video frame for use by the video decoder 30 when decoding the video blocks of the video frame. The semantic elements may include, for example, semantic elements defining the motion vectors used to identify the prediction blocks, any flags indicating the prediction mode, or any other semantic information described herein. Note that the motion estimation unit 42 and the motion compensation unit 44 may be highly integrated, but are shown separately for conceptual purposes.

[0038] In some embodiments, the intra BC unit 48 may generate vectors and obtain prediction blocks in a manner similar to that described above in connection with the motion estimation unit 42 and the motion compensation unit 44, but where the prediction block is in the same frame as the current block being encoded, and where the vectors are referred to as block vectors rather than motion vectors. Specifically, the intra BC unit 48 may determine an intra prediction mode for encoding the current block. In some examples, the intra BC unit 48 may encode the current block using various intra prediction modes, for example, during a separate encoding pass, and test its performance through rate-distortion analysis. Next, the intra BC unit 48 may select an appropriate intra prediction mode to use from among the various tested intra prediction modes and generate an intra mode indicator accordingly. For example, the intra BC unit 48 may calculate rate-distortion values using rate-distortion analysis for the various tested intra prediction modes, and select the intra prediction mode having the best rate-distortion characteristics among the tested modes as the appropriate intra prediction mode to use. Rate-distortion analysis generally determines the amount of distortion (or error) between the encoded block and the original unencoded block (which was encoded to produce the encoded block) and the bitrate (i.e., the number of bits) used to produce the encoded block. The intra BC unit 48 may calculate a ratio based on the distortion and rate of each encoded block to determine which intra prediction mode exhibits the best rate-distortion value for the block.

[0039] In other examples, the intra BC unit 48 may use all or part of the motion estimation unit 42 and the motion compensation unit 44 to perform these functions for intra BC prediction according to the embodiments described herein. In either case, for intra block copy, the predicted block may be a block that is considered to closely match the block to be encoded in terms of pixel differences, which may be determined by the sum of absolute differences (SAD), the sum of squared differences (SSD), or other difference metrics, and the identification of the predicted block may include calculating values for sub-integer pixel positions.

[0040] Regardless of whether the predicted block is from the same frame according to intra prediction or from a different frame according to inter prediction, the video encoder 20 may form a residual video block by subtracting the pixel values of the predicted block from the pixel values of the current video block being encoded, thereby forming pixel difference values. The pixel difference values for forming the residual video block may include luminance component differences and chrominance component differences.

[0041] As described above, the intra prediction processing unit 46 may perform intra prediction on the current video block as an alternative to inter prediction performed by the motion estimation unit 42 and the motion compensation unit 44, or intra block copy prediction performed by the intra BC unit 48. Specifically, the intra prediction processing unit 46 may determine an intra prediction mode for encoding the current block. To this end, the intra prediction processing unit 46 may, for example, encode the current block using various intra prediction modes during a separate encoding pass, and the intra prediction processing unit 46 (or in some examples, the mode selection unit) may select an appropriate intra prediction mode from the tested intra prediction modes to use. The intra prediction processing unit 46 may provide information indicating the selected intra prediction mode of the block to the entropy encoding unit 56. The entropy encoding unit 56 may encode the information indicating the selected intra prediction mode in the bitstream.

[0042] After the prediction processing unit 41 determines the predicted block of the current video block via inter prediction or intra prediction, the adder 50 forms a residual video block by subtracting the predicted block from the current video block. The residual video data in the residual block may be included in one or more transform units (TUs) and provided to the transform processing unit 52. The transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform such as the discrete cosine transform (DCT) or a conceptually similar transform.

[0043] The transform processing unit 52 may send the resulting transform coefficients to the quantization unit 54. The quantization unit 54 quantizes the transform coefficients to further reduce the bit rate. The quantization process may also reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting the quantization parameter. In some examples, the quantization unit 54 may then perform a scan of the matrix including the quantized transform coefficients. Alternatively, the entropy coding unit 56 may perform the scan.

[0044] After quantization, the entropy coding unit 56 entropy encodes the quantized transform coefficients into a video bit stream using, for example, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), semantic-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques. The encoded bit stream may then be transmitted to the video decoder 30 or archived in the storage device 32 for later transmission to or retrieval by the video decoder 30. The entropy coding unit 56 may also entropy encode the motion vectors and other semantic elements of the current video frame being encoded.

[0045] The inverse quantization unit 58 and the inverse transform processing unit 60 respectively apply inverse quantization and inverse transform to reconstruct the residual video block in the pixel domain to generate a reference block for predicting other video blocks. As described above, the motion compensation unit 44 may generate a motion-compensated prediction block from one or more reference blocks of the frames stored in the DPB 64. The motion compensation unit 44 may also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values used in motion estimation.

[0046] The adder 62 adds the reconstructed residual block to the motion-compensated prediction block generated by the motion compensation unit 44 to produce a reference block for storage in the DPB 64. The reference block may then be used as a prediction block by the intra BC unit 48, the motion estimation unit 42, and the motion compensation unit 44 to perform inter prediction on another video block in a subsequent video frame.

[0047] Figure 3 is a block diagram illustrating an exemplary video decoder 30 according to some embodiments of the present application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, an adder 90, and a DPB 92. The prediction processing unit 81 further includes a motion compensation unit 82, an intra prediction processing unit 84, and an intra BC unit 85. The video decoder 30 may perform operations generally associated with those described above in connection with Figure 2A decoding process that is the opposite of the encoding process described with respect to video encoder 20. For example, motion compensation unit 82 can generate prediction data based on the motion vectors received from entropy decoding unit 80, while intra prediction unit 84 can generate prediction data based on the intra prediction mode indicator received from entropy decoding unit 80.

[0048] In some examples, tasks can be assigned to the units of video decoder 30 to perform embodiments of the present application. Similarly, in some examples, embodiments of the present disclosure can be divided among one or more units of video decoder 30. For example, intra BC unit 85 can perform embodiments of the present application alone or in combination with other units of video decoder 30, such as motion compensation unit 82, intra prediction processing unit 84, and entropy decoding unit 80. In some examples, video decoder 30 may not include intra BC unit 85, and the functions of intra BC unit 85 can be performed by other components of prediction processing unit 81, such as motion compensation unit 82.

[0049] Video data memory 79 can store video data to be decoded by other components of video decoder 30, such as an encoded video bitstream. For example, the video data stored in video data memory 79 can be obtained from storage device 32, from a local video source (such as a camera), via wired or wireless network transmission of the video data or by accessing a physical data storage medium (e.g., a flash drive or a hard disk). Video data memory 79 can include a coded picture buffer (CPB) that stores coded video data from the encoded video bitstream. The decoded picture buffer (DPB) 92 of video decoder 30 stores reference video data for use by video decoder 30 to decode video data (e.g., in intra prediction coding mode or inter prediction coding mode). Video data memory 79 and DPB 92 can be formed by any of a variety of 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. For illustrative purposes, video data memory 79 and DPB 92 are depicted as two different components of video decoder 30 in Figure 3 But it will be clear to those skilled in the art that video data memory 79 and DPB 92 can be provided by the same memory device or separate memory devices. In some examples, video data memory 79 can be on-chip with other components of video decoder 30 or off-chip relative to those components.

[0050] During the decoding process, video decoder 30 receives an encoded video bitstream representing video blocks of an encoded video frame and associated semantic elements. Video decoder 30 may receive semantic elements at the video frame level and / or at the video block level. Entropy decoding unit 80 of video decoder 30 entropy decodes the bitstream to generate quantized coefficients, motion vectors, or intra prediction mode indicators and other semantic elements. Entropy decoding unit 80 then forwards the motion vectors and other semantic elements to prediction processing unit 81.

[0051] When a video frame is encoded as an intra prediction coded (I) frame or for intra-coded prediction blocks in other types of frames, intra prediction processing unit 84 of prediction processing unit 81 may generate prediction data for video blocks of the current video frame based on the signal-transmitted intra prediction mode and reference data from previously decoded blocks of the current frame.

[0052] When a video frame is encoded as an inter prediction coded (i.e., B or P) frame, motion compensation unit 82 of prediction processing unit 81 generates one or more prediction blocks for video blocks of the current video frame based on the motion vectors and other semantic elements received from entropy decoding unit 80. Each prediction block may be generated from a reference frame within one of the reference frame lists. Video decoder 30 may construct the reference frame lists: list 0 and list 1, using a default construction technique based on the reference frames stored in DPB 92.

[0053] In some examples, when a video block is encoded according to the intra BC mode described herein, intra BC unit 85 of prediction processing unit 81 generates a prediction block for the current video block based on the block vector and other semantic elements received from entropy decoding unit 80. The prediction block may be within a reconstructed region of the same picture as the current video block defined by video encoder 20.

[0054] Motion compensation unit 82 and / or intra BC unit 85 determine prediction information for video blocks of the current video frame by parsing the motion vectors and other semantic elements, and then use the prediction information to generate prediction blocks for the decoded current video blocks. For example, motion compensation unit 82 uses some of the received semantic elements to determine a prediction mode (e.g., intra prediction or inter prediction) for encoding video blocks of a video frame, an inter prediction frame type (e.g., B or P), construction information for one or more of the reference frame lists in the reference frame list of the frame, motion vectors for each inter prediction coded video block of the frame, the inter prediction state for each inter prediction coded video block of the frame, and other information for decoding video blocks in the current video frame.

[0055] Similarly, the intra BC unit 85 can use some of the received semantic elements (e.g., flags) to determine that the current video block is predicted using: the intra BC mode, the construction information about which video blocks of the frame are within the reconstructed region and should be stored in the DPB 92, the block vectors of each intra BC predicted video block of the frame, the intra BC prediction state of each intra BC predicted video block of the frame, and other information for decoding the video blocks in the current video frame.

[0056] The motion compensation unit 82 can also perform interpolation using an interpolation filter as used by the video encoder 20 during encoding of the video block to calculate the interpolation values of the sub-integer pixels of the reference block. In this case, the motion compensation unit 82 can determine the interpolation filter used by the video encoder 20 from the received semantic elements and use the interpolation filter to generate the prediction block.

[0057] The inverse quantization unit 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by the entropy decoding unit 80 using the same quantization parameters calculated by the video encoder 20 for each video block in the video frame to determine the degree of quantization. The inverse transform processing unit 88 applies an inverse transform (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients in order to reconstruct the residual block in the pixel domain.

[0058] After the motion compensation unit 82 or the intra BC unit 85 generates a prediction block for the current video block based on the vector and other semantic elements, the adder 90 reconstructs the decoded video block of the current video block by summing the residual block from the inverse transform processing unit 88 and the corresponding prediction block generated by the motion compensation unit 82 and the intra BC unit 85. A loop filter (not shown) can be located between the adder 90 and the DPB 92 to further process the decoded video block. Then, the decoded video blocks in a given frame are stored in the DPB 92, and the DPB 92 stores the reference frames for subsequent motion compensation of the next video blocks. The DPB 92 or a memory device separate from the DPB 92 can also store the decoded video for later presentation on a display device such as Figure 1 the display device 34.

[0059] In a typical video encoding process, a video sequence typically includes an ordered collection of frames or pictures. Each frame can include three arrays of samples, denoted as SL, SCb, and SCr, respectively. SL is a two-dimensional array of luminance samples. SCb is a two-dimensional array of Cb chrominance samples. SCr is a two-dimensional array of Cr chrominance samples. In other instances, the frame can be monochromatic and thus include only one two-dimensional array of luminance samples.

[0060] As Figure 4AAs shown, video encoder 20 (or more specifically, partitioning unit 45) generates an encoded representation of a frame by first partitioning the frame into a set of coding tree units (CTUs). A video frame may include an integer number of CTUs serially ordered in a raster scan order from left to right and top to bottom. Each CTU is the largest logical coding unit, and the width and height of the CTU are signaled by video encoder 20 in the sequence parameter set such that all CTUs in the video sequence have the same size, i.e., one of 128×128, 64×64, 32×32, and 16×16. However, it should be noted that the present application is not necessarily limited to a specific size. As Figure 4B shown, each CTU may include one coding tree block (CTB) of luma samples, two corresponding coding tree blocks of chroma samples, and semantic elements for encoding the samples of the coding tree blocks. The semantic elements describe the attributes of different types of units of the encoded pixel block and how the video sequence can be reconstructed at video decoder 30, and the semantic elements include inter-frame prediction or intra-frame prediction, intra-frame prediction mode, motion vectors, and other parameters. In a monochrome picture or a picture with three separate color planes, a CTU may include a single coding tree block and semantic elements for encoding the samples of the coding tree block. The coding tree block may be an N×N sample block.

[0061] To achieve better performance, video encoder 20 may recursively perform tree partitioning such as binary tree partitioning, quadtree partitioning, or a combination of both on the coding tree blocks of the CTU and divide the CTU into smaller coding units (CUs). As Figure 4C depicted, a 64×64 CTU 400 is first divided into four smaller CUs, each with a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are each divided into four 16×16 CUs by block size. Two 16×16 CUs 430 and 440 are each further divided into four 8×8 CUs by block size. Figure 4D depicts a quadtree data structure that illustrates the final result of the partitioning process of CTU 400 as depicted in Figure 4C where each leaf node of the quadtree corresponds to a CU with a corresponding size in the range of 32×32 to 8×8. Similar to the Figure 4B depicted CTU, each CU may include a coding block (CB) of luma samples and two corresponding coding blocks of chroma samples of the same size of the frame, and semantic elements for encoding the samples of the coding blocks. In a monochrome picture or a picture with three separate color planes, a CU may include a single coding block and a semantic structure for encoding the samples of the coding block.

[0062] In some embodiments, video encoder 20 may further partition the coded block of a CU into one or more M×N prediction blocks (PBs). A prediction block is a rectangular (square or non-square) block of samples to which the same prediction (inter-frame or intra-frame) is applied. The prediction unit (PU) of a CU may include a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and semantic elements for predicting the prediction block. In a monochrome picture or a picture with three separate color planes, the PU may include a single prediction block and a semantic structure for predicting the prediction block. Video encoder 20 may generate prediction luma, Cb, and Cr blocks for the luma, Cb, and Cr prediction blocks of each PU of the CU.

[0063] Video encoder 20 may use intra-frame prediction or inter-frame prediction to generate the prediction block of a PU. If video encoder 20 uses intra-frame prediction to generate the prediction block of a PU, video encoder 20 may generate the prediction block of the PU based on the decoded samples of the frame associated with the PU. If video encoder 20 uses inter-frame prediction to generate the prediction block of a PU, video encoder 20 may generate the prediction block of the PU based on the decoded samples of one or more frames other than the frame associated with the PU.

[0064] After video encoder 20 generates the prediction luma, Cb, and Cr blocks of one or more PUs of a CU, video encoder 20 may generate a luma residual block of the CU by subtracting its prediction luma block from the original luma coded block of the CU, such that each sample in the luma residual block of the CU indicates the difference between the luma sample in one of the prediction luma blocks of the CU and the corresponding sample in the original luma coded block of the CU. Similarly, video encoder 20 may generate a Cb residual block and a Cr residual block of the CU, such that each sample in the Cb residual block of the CU indicates the difference between the Cb sample in one of the prediction Cb blocks of the CU and the corresponding sample in the original Cb coded block of the CU, and each sample in the Cr residual block of the CU may indicate the difference between the Cr sample in one of the prediction Cr blocks of the CU and the corresponding sample in the original Cr coded block of the CU.

[0065] In addition, as Figure 4CAs illustrated, video encoder 20 may use quadtree partitioning to decompose the luminance, Cb, and Cr residual blocks of a CU into one or more luminance, Cb, and Cr transform blocks. A transform block is a rectangular (square or non-square) block of samples to which the same transform is applied. The transform unit (TU) of a CU may include a transform block of luminance samples, two corresponding transform blocks of chrominance samples, and semantic elements for transforming the samples of the transform block. Thus, each TU of a CU may be associated with a luminance transform block, a Cb transform block, and a Cr transform block. In some examples, the luminance transform block associated with a TU may be a sub-block of the luminance residual block of the CU. The Cb transform block may be a sub-block of the Cb residual block of the CU. The Cr transform block may be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU may include a single transform block and a semantic structure for transforming the samples of the transform block.

[0066] Video encoder 20 may apply one or more transforms to the luminance transform block of a TU to generate a luminance coefficient block for that TU. A coefficient block may be a two-dimensional array of transform coefficients. The transform coefficients may be scalars. Video encoder 20 may apply one or more transforms to the Cb transform block of a TU to generate a Cb coefficient block for that TU. Video encoder 20 may apply one or more transforms to the Cr transform block of a TU to generate a Cr coefficient block for that TU.

[0067] After generating a coefficient block (e.g., a luminance coefficient block, a Cb coefficient block, or a Cr coefficient block), video encoder 20 may quantize the coefficient block. Quantization generally refers to the process of quantizing transform coefficients to possibly reduce the amount of data used to represent the transform coefficients, thereby providing further compression. After video encoder 20 quantizes the coefficient block, video encoder 20 may entropy code the semantic elements indicating the quantized transform coefficients. For example, video encoder 20 may perform context-adaptive binary arithmetic coding (CABAC) on the semantic elements indicating the quantized transform coefficients. Finally, video encoder 20 may output a bitstream including a bit sequence representing an encoded frame and associated data, which is stored in storage device 32 or transmitted to destination device 14.

[0068] After receiving the bitstream generated by video encoder 20, video decoder 30 may parse the bitstream to obtain semantic elements from the bitstream. Video decoder 30 may reconstruct a frame of video data at least partially based on the semantic elements obtained from the bitstream. The process of reconstructing video data is generally the reverse of the encoding process performed by video encoder 20. For example, video decoder 30 may perform an inverse transform on a coefficient block associated with a TU of a current CU to reconstruct a residual block associated with the TU of the current CU. Video decoder 30 also reconstructs the coded block of the current CU by adding the samples of the prediction block of the PU of the current CU to the corresponding samples of the transform block of the TU of the current CU. After reconstructing the coded blocks of each CU of a frame, video decoder 30 may reconstruct the frame.

[0069] As described above, video coding mainly uses two modes (i.e., intra-frame prediction (or intra-prediction) and inter-frame prediction (or inter-prediction)) to achieve video compression. It should be noted that IBC can be considered as intra-frame prediction or a third mode. Between the two modes, inter-frame prediction contributes more to coding efficiency than intra-frame prediction because motion vectors are used to predict the current video block from reference video blocks.

[0070] However, with continuously improving video data capture technologies and finer video block sizes for preserving details in video data, the amount of data required to represent the motion vectors of the current frame has also increased significantly. One way to overcome this challenge is to benefit from the fact that not only does a set of neighboring CUs in the spatial and temporal domains have similar video data for prediction purposes, but the motion vectors between these neighboring CUs are also similar. Therefore, it is possible to use the motion information of spatially neighboring CUs and / or temporally juxtaposed CUs as an approximation of the motion information (e.g., motion vectors) of the current CU by exploring the spatial and temporal correlations of the CUs, and this approximation is also referred to as the "motion vector prediction value" (MVP) of the current CU.

[0071] Instead of encoding the actual motion vector of the current CU determined by the motion estimation unit 42 as described above in Figure 2 the video bitstream, the motion vector prediction value of the current CU is subtracted from the actual motion vector of the current CU to produce the motion vector difference (MVD) of the current CU. By doing so, it is not necessary to encode the motion vectors determined by the motion estimation unit 42 for each CU of a frame into the video bitstream, and the amount of data used to represent the motion information in the video bitstream can be significantly reduced.

[0072] Similar to the process of selecting a prediction block in a reference frame during inter - prediction of a coding block, a set of rules need to be adopted by both the video encoder 20 and the video decoder 30 for constructing the motion - vector candidate list of the current CU using those potential candidate motion vectors associated with spatially - adjacent CUs and / or temporally - collocated CUs of the current CU, and then selecting a member from the motion - vector candidate list as the motion - vector prediction value of the current CU. By doing so, it is not necessary to transmit the motion - vector candidate list itself between the video encoder 20 and the video decoder 30, and the index of the selected motion - vector prediction value within the motion - vector candidate list is sufficient for the video encoder 20 and the video decoder 30 to use the same motion - vector prediction value within the motion - vector candidate list to encode and decode the current CU.

[0073] In some embodiments, each inter - prediction CU has three motion - vector prediction modes for constructing the motion - vector candidate list, including inter (which is also referred to as "advanced motion - vector prediction" (AMVP)), skip, and merge. Under each mode, one or more motion - vector candidates can be added to the motion - vector candidate list according to the algorithms described below. Eventually, one of the candidates in the candidate list is used as the best motion - vector prediction value of the inter - prediction CU, and this best motion - vector prediction value will be encoded into the video bit - stream by the video encoder 20 or decoded from the video bit - stream by the video decoder 30. To find the best motion - vector prediction value from the candidate list, a motion - vector competition (MVC) scheme is introduced to select a motion vector from a given candidate set of motion vectors (i.e., the motion - vector candidate list), and the motion - vector candidate set includes spatial and temporal motion - vector candidates.

[0074] In addition to deriving motion - vector prediction - value candidates from spatially - adjacent or temporally - collocated CUs, motion - vector prediction - value candidates can also be derived from the so - called "history - based motion - vector prediction" (HMVP) table. The HMVP table accommodates a preset number of motion - vector prediction values, and each motion - vector prediction value has been used to encode / decode a specific CU in the same CTU row (or sometimes the same CTU). Due to the spatial / temporal proximity of these CUs, it is very likely that one of the motion - vector prediction values in the HMVP table can be reused to encode / decode a different CU within the same CTU row. Therefore, by including the HMVP table in the process of constructing the motion - vector candidate list, it is possible to achieve higher coding efficiency.

[0075] In some embodiments, the HMVP table has a fixed length (e.g., 5) and is managed in a quasi-first-in-first-out (FIFO) manner. For example, when decoding an inter-coded block of a CU, a motion vector is reconstructed for the CU. The HMVP table is updated instantaneously with the reconstructed motion vector because such a motion vector can be a motion vector prediction value for a subsequent CU. When updating the HMVP table, there are two cases: (i) the reconstructed motion vector is different from other existing motion vectors in the HMVP table, or (ii) the reconstructed motion vector is the same as one of the existing motion vectors in the HMVP table. For the first case, if the HMVP table is not full, the reconstructed motion vector is added to the HMVP table as the latest motion vector prediction value. If the HMVP table is full, the oldest motion vector in the HMVP table needs to be removed from the HMVP table first before adding the reconstructed motion vector as the latest motion vector prediction value. In other words, in this case, the HMVP table is similar to a FIFO buffer such that the motion information located at the head of the FIFO buffer and associated with another previous inter-coded block is removed from the buffer, and the reconstructed motion vector is appended to the tail of the FIFO buffer as the latest member of the HMVP table. For the second case, the existing motion vector in the HMVP table that is substantially the same as the reconstructed motion vector is removed from the HMVP table before adding the reconstructed motion vector as the latest motion vector prediction value. If the HMVP table is also maintained in the form of a FIFO buffer, each motion vector prediction value after the same motion vector in the HMVP table will be shifted forward by one element to occupy the space left by the removed motion vector, and then the reconstructed motion vector is appended to the tail of the FIFO buffer as the latest member of the HMVP table.

[0076] The motion vectors in the HMVP table can be added to the motion vector candidate lists under different prediction modes such as AMVP, merge, skip, etc. It has been found that the motion information of even a previous inter-coded block stored in the HMVP table that is not adjacent to the current block can be used for more efficient motion vector prediction.

[0077] After selecting an MVP candidate from a given set of motion vector candidates for the current CU, the video encoder 20 may generate one or more semantic elements for the corresponding MVP candidate and encode the semantic elements into the video bitstream such that the video decoder 30 can retrieve the MVP candidate from the video bitstream using the semantic elements. Depending on the specific mode used to construct the set of motion vector candidates, different modes (e.g., AMVP, merge, skip, etc.) have different sets of semantic elements. For the AMVP mode, the semantic elements include an inter prediction indicator (list 0, list 1, or bi-prediction), a reference index, a motion vector candidate index, a motion vector prediction residual signal, etc. For the skip mode and the merge mode, only the merge index is encoded into the bitstream because the current CU inherits other semantic elements, including the inter prediction indicator, the reference index, and the motion vector, from the neighboring CUs referenced by the encoded merge index. In the case of a skipped encoded CU, the motion vector prediction residual signal is also omitted.

[0078] Figure 5A is a block diagram illustrating spatially adjacent and temporally collocated block positions of a current CU to be encoded / decoded according to some embodiments of the present disclosure. For a given mode, a motion vector prediction (MVP) candidate list is constructed by first checking the availability of motion vectors associated with spatially left and above neighboring block positions, as well as the availability of motion vectors associated with temporally collocated block positions, and then checking the motion vectors in the HMVP table. During the process of constructing the MVP candidate list, some redundant MVP candidates are removed from the candidate list, and a zero-valued motion vector is added if necessary to make the candidate list have a fixed length (note that different modes may have different fixed lengths). After constructing the MVP candidate list, the video encoder 20 may select the best motion vector prediction value from the candidate list and encode the corresponding index indicating the selected candidate into the video bitstream.

[0079] Taking Figure 5A as an example and assuming that the fixed length of the candidate list is two, the motion vector prediction value (MVP) candidate list for the current CU can be constructed by sequentially performing the following steps in the AMVP mode:

[0080] 1) Select MVP candidates from spatially adjacent CUs

[0081] a) Derive up to one non-scaled MVP candidate from one of two left spatially adjacent CUs starting from A0 and ending at A1;

[0082] b) If no non-scaled MVP candidate from the left is available in the previous step, derive up to one scaled MVP candidate from one of two left spatially adjacent CUs starting from A0 and ending at A1;

[0083] c) Derive up to one non-scaled MVP candidate from one of three spatially adjacent CUs starting with B0 then B1 and ending with B2;

[0084] d) If both A0 and A1 are unavailable, or if A0 and A1 are coded in intra mode, derive up to one scaled MVP candidate from one of three spatially adjacent CUs starting with B0 then B1 and ending with B2;

[0085] 2) If two MVP candidates are found in the previous step and the two MVP candidates are the same, remove one of the two candidates from the MVP candidate list;

[0086] 3) Select an MVP candidate from temporally collocated CUs

[0087] a) If the MVP candidate list after the previous step does not include two MVP candidates, derive up to one MVP candidate from temporally collocated CUs (e.g., T0)

[0088] 4) Select an MVP candidate from the HMVP table

[0089] a) If the MVP candidate list after the previous step does not include two MVP candidates, derive up to two history-based MVPs from the HMVP table; and

[0090] 5) If the MVP candidate list after the previous step does not include two MVP candidates, add up to two zero-valued MVPs to the MVP candidate list.

[0091] Since there are only two candidates in the AMVP mode MVP candidate list constructed above, associated semantic elements such as binary flags are coded into the bitstream to indicate which one of the two MVP candidates within the candidate list is used to decode the current CU.

[0092] In some embodiments, the MVP candidate list for the current CU in skip or merge mode can be constructed by sequentially performing a set of steps similar to the above steps. Note that for skip or merge mode, a special merge candidate called "paired merge candidate" is also included in the MVP candidate list. The paired merge candidate is generated by averaging the MVs of two previously derived merge mode motion vector candidates. The size of the merge MVP candidate list (e.g., from 1 to 6) is signaled in the slice header of the current CU. For each CU in merge mode, the index of the best merge candidate is encoded using truncated unary binary (TU). The first bin of the merge index is encoded using context, and the other bins use bypass coding.

[0093] As described above, the history-based MVP can be added to the AMVP mode MVP candidate list or the merge MVP candidate list after the spatial MVP and the temporal MVP. The motion information of the previous inter-coded CU is stored in the HMVP table and used as the MVP candidate for the current CU. The HMVP table is maintained during the encoding / decoding process. Whenever there is a non-sub-block inter-coded CU, the associated motion vector information is added as a new candidate to the last entry of the HMVP table, while the motion vector information stored in the first entry of the HMVP table is removed from it (if the HMVP table is full and there is no identical copy of the associated motion vector information in the table). Alternatively, the identical copy of the associated motion vector information is removed from the table before adding the associated motion vector information to the last entry of the HMVP table.

[0094] As described above, Intra Block Copy (IBC) can significantly improve the encoding efficiency of screen content material. Since the IBC mode is implemented as a block-level coding mode, block matching (BM) is performed at the video encoder 20 to find the best block vector for each CU. Here, the block vector is used to indicate the displacement from the current block to a reference block that has been reconstructed within the current picture. The IBC-encoded CU is considered as a third prediction mode different from the intra prediction mode or the inter prediction mode.

[0095] At the CU level, the IBC mode can be signaled as the IBC AMVP mode or the IBC skip / merge mode, as follows:

[0096] - IBC AMVP Mode: The block vector difference (BVD) between the actual block vector of the CU and the predicted value of the block vector of the CU selected from the block vector candidates of the CU is encoded in the same manner as the motion vector difference is encoded under the AMVP mode described above. The block vector prediction method uses two block vector candidates as the predicted values, one from the left neighbor and the other from the upper neighbor (if IBC encoded). When neither neighbor is available, the default block vector is used as the block vector predicted value. A binary flag is signaled to indicate the block vector predicted value index. The IBC AMVP candidate list consists of spatial candidates and HMVP candidates.

[0097] - IBC Skip / Merge Mode: The merge candidate index is used to indicate which one of the block vector candidates in the merge candidate list from adjacent IBC-encoded blocks is used to predict the block vector of the current block. The IBC merge candidate list consists of spatial candidates, HMVP candidates, and pairwise candidates.

[0098] Another way to improve the coding efficiency adopted by the coding standards of the prior art is to introduce parallel processing into the video encoding / decoding process using, for example, a multi-core processor. For example, wavefront parallel processing (WPP) has been introduced into HEVC as a feature for encoding or decoding multiple CTU rows in parallel using multiple threads.

[0099] Figure 5BFIG. is a block diagram illustrating multi-threaded encoding of multiple CTU rows of a picture using wavefront parallel processing (WPP) according to some embodiments of the present disclosure. When WPP is enabled, it is possible to parallel process multiple CTU rows in a wavefront manner, where there may be a delay of two CTUs between the starts of two adjacent wavefronts. For example, to encode picture 500 using WPP, a video encoder (such as video encoders 20 and 30) may divide the coding tree units (CTUs) of picture 500 into multiple wavefronts, with each wavefront corresponding to a respective CTU row in the picture. The video encoder may start encoding the top wavefront using, for example, a first encoder core or thread. After the video encoder has encoded two or more CTUs of the top wavefront, the video encoder may start encoding the second-to-top wavefront in parallel with encoding the top wavefront using, for example, a second parallel encoder core or thread. After the video encoder has encoded two or more CTUs of the second-to-top wavefront, the video encoder may start encoding the third-to-top wavefront in parallel with encoding the higher wavefronts using, for example, a third parallel encoder core or thread. This pattern may continue along the wavefronts in picture 500. In the present disclosure, a set of CTUs that the video encoder encodes simultaneously using WPP is referred to as a "CTU group". Thus, when the video encoder encodes a picture using WPP, each CTU of the CTU group can belong to a unique wavefront of the picture, and the CTU can be offset from the CTUs in the corresponding upper wavefront by at least two columns of CTUs of the picture.

[0100] The video encoder may initialize the context of the current wavefront to perform context-adaptive binary arithmetic coding (CABAC) of the current wavefront based on data of the first two blocks of the upper wavefront and one or more elements of the slice header of the slice including the first encoded block of the current wavefront. The video encoder may use the context state to perform CABAC initialization of a subsequent wavefront (or CTU row) after encoding two CTUs of the CTU row above the subsequent CTU row. In other words, before starting to encode the current wavefront, the video encoder (or more specifically, a thread of the video encoder) may encode at least two blocks of the wavefront above the current wavefront, assuming the current wavefront is not the top CTU row of the picture. The video encoder may then initialize the CABAC context of the current wavefront after encoding at least two blocks of the wavefront above the current wavefront. In this example, each CTU row of picture 500 is a separate partition and has an associated thread (WPP thread 1, WPP thread 2,...), such that multiple CTU rows in picture 500 can be encoded in parallel.

[0101] Since the current implementation of the HMVP table uses a global motion vector (MV) buffer to store previously reconstructed motion vectors, this HMVP table cannot be implemented on the WPP-enabled parallel encoding scheme described above in conjunction with Figure 5B Specifically, the fact that the global MV buffer is shared by all threads of the encoding / decoding process of the video encoder prevents WPP threads after the first WPP thread (i.e., WPP thread 1) from being started because these WPP threads must wait for the update of the HMVP table of the last CTU (i.e., the rightmost CTU) of the first WPP thread (i.e., the first CTU row) to complete.

[0102] To overcome the above problem, it is proposed to replace the global MV buffer shared by each WPP thread with multiple CTU row-specific buffers, such that when WPP is enabled at the video encoder, each wavefront of CTU rows has its own buffer to store the HMVP table corresponding to the CTU row being processed by the corresponding WPP thread. Note that each CTU row having its own HMVP table is equivalent to resetting the HMVP table before encoding the first CU of the CTU row. HMVP table resetting is to clear all motion vectors generated by the encoding of another CTU row in the HMVP table. In one implementation, the reset operation is to set the number of available motion vector prediction values in the HMVP table to zero. In yet another implementation, the reset operation can be to set the reference index of all entries in the HMVP table to an invalid value, such as -1. By doing so, regardless of which of the three modes (AMVP, merge, and skip), the construction of the MVP candidate list for the current CTU within a specific wavefront depends on the HMVP table associated with the WPP thread processing that specific wavefront. In addition to the two CTU delays described above, there is no interdependence between different wavefronts, and the construction of the motion vector candidate lists associated with different wavefronts can be performed in parallel as in the Figure 5B WPP process depicted. In other words, at the start of processing a specific wavefront, the HMVP table is reset to empty without affecting the encoding of another wavefront of CTUs by another WPP thread. In some cases, the HMVP table can be reset to empty before encoding each individual CTU. In this case, the motion vectors in the HMVP table are restricted to a specific CTU, and the motion vectors within the HMVP table are more likely to be selected as the motion vectors of the current CU within that specific CTU.

[0103] Figure 6is a flowchart illustrating an exemplary process according to some embodiments of the present disclosure. A video encoder (such as video encoder 20 or video decoder 30) implements a technique for constructing a candidate list of motion vector prediction values using at least an HMVP table through the exemplary process. For illustrative purposes, the flowchart depicts a video decoding process. First, video decoder 30 obtains (610) an encoded video bitstream including data associated with a plurality of encoded pictures. As depicted in Figure 4A and Figure 4C , each picture includes a plurality of coding tree unit (CTU) rows, and each CTU includes one or more coding units (CUs). Video decoder 30 extracts different pieces of information (such as semantic elements and pixel values) from the video bitstream to reconstruct the image row by row.

[0104] Before decoding the current CTU row, video decoder 30 first resets (620) the history-based motion vector prediction value (HMVP) table for the current CTU row. As described above, resetting the HMVP table ensures that video decoder 30 can decode multiple CTU rows of the current picture in parallel using, for example, a multi-threaded process (each thread having its own HMVP table for each CTU row) or a multi-core processor (each core having its own HMVP table for each CTU row) or both. In still some other embodiments, before decoding the current CTU, video decoder 30 first resets (620) the history-based motion vector prediction value (HMVP) table for the current CTU. As described above, resetting the HMVP table ensures that video decoder 30 can decode multiple CTU rows of the current picture in parallel using, for example, a multi-threaded process (each thread having its own HMVP table for each CTU) or a multi-core processor (each core having its own HMVP table for each CTU) or both.

[0105] While decoding the current CTU row (630), video decoder 30 maintains (630-1) a plurality of motion vector prediction values in the HMVP table. As described above, each motion vector prediction value stored in the HMVP table has already been used to decode at least another CU within the current CTU row. The fact that the motion vector prediction values exist in the HMVP table is because when the HMVP table participates in the process of constructing the motion vector candidate list as described above, the motion vector prediction values can be used again to predict another CU within the current CTU row.

[0106] For the current CU of the current CTU row, the video decoder 30 first extracts (630-3) the prediction mode from the video bitstream. As described above, a CU can have multiple types of prediction modes, including the advanced motion vector prediction (AMVP) mode, the merge mode, the skip mode, the IBC AMVP mode, and the IBC merge mode. Once the video encoder 20 selects an appropriate prediction mode for the CU, the selected prediction mode is signaled in the bitstream. As described above, there are different sets of steps for constructing the motion vector candidate list that are executed in different orders. Here, the video decoder 30 constructs (630-5) the motion vector candidate list according to the prediction mode and at least partially based on multiple motion vector prediction values in the HMVP table. Other sources of the motion vector candidate list include motion vector prediction values from spatially adjacent CUs and / or temporally collocated CUs of the current CU (when the prediction mode is one of the AMVP mode, the IBC AMVP mode, and the IBC merge mode) and optionally paired motion vector prediction values (when the prediction mode is one of the merge mode and the skip mode). Optionally, when the motion vector candidate list does not reach a preset length, one or more zero-valued motion vector prediction values can be added to the motion vector candidate list.

[0107] Next, the video decoder 30 selects (630-7) the motion vector prediction value of the current CU from the motion vector candidate list and determines (630-9) the motion vector at least partially based on the prediction mode and the selected motion vector prediction value. As described above, depending on whether the prediction mode is the AMVP mode, the selected motion vector prediction value may or may not be the estimated motion vector of the current CU. For example, if the prediction mode is the AMVP mode, the estimated motion vector is determined by adding the motion vector difference recovered from the bitstream to the selected motion vector prediction value, and then the current CU is decoded at least partially using the estimated motion vector and the corresponding CU within the reference picture. However, if the prediction mode is the merge mode or the skip mode, the selected motion vector prediction value is already the estimated motion vector, which can be used to decode the current CU together with the corresponding CU within the reference picture. Finally, the video decoder 30 updates (630-11) the HMVP table based on the determined motion vector. As described above, each member in the HMVP table has been previously used to decode at least another CU and remains in the HMVP table for constructing the motion vector candidate list until the member is removed from the HMVP table by table reset or by inserting a motion vector for decoding another subsequent CU within the current CTU row.

[0108] In some embodiments, there are two possible cases for inserting a motion vector into the HMVP table based on the comparison result between the motion vector determined for the current CU and multiple motion vector prediction values in the HMVP table. If none of the motion vector prediction values in the multiple motion vector prediction values in the HMVP table is the same as the determined motion vector, when the HMVP table is full and the motion vector is added to the table as the latest motion vector prediction value, the earliest or oldest motion vector prediction value is removed from the HMVP table. If one of the motion vector prediction values in the multiple motion vector prediction values in the HMVP table is the same as the motion vector, this identical motion vector prediction value is removed from the HMVP table, and all other motion vector prediction values after the removed motion vector prediction value are shifted forward in the HMVP table such that the motion vector is appended to the end of the HMVP table as the latest motion vector prediction value.

[0109] As described above, for example, two or more of multiple CTU rows can be encoded / decoded in parallel using WPP, and each CTU row has an associated HMVP table for storing multiple history-based motion vector prediction values for encoding / decoding the corresponding CTU row. For example, threads are assigned to decode a specific CTU row of the current picture being decoded such that different CTU rows have different associated threads, and decoding can be performed in parallel as described above in connection with Figure 5B the description. In some examples, the video decoder 30 identifies one or more motion vector prediction values within the motion vector candidate list as redundant motion vectors and removes them from the motion vector candidate list to further improve encoding efficiency.

[0110] In one or more examples, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functionality may be stored on or transmitted via a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. 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 that facilitates transferring a computer program from one place to another, for example, according to a communication protocol. In this way, the computer-readable medium generally may correspond to (1) a non-transitory tangible computer-readable storage medium 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 implementing the embodiments described in this application. A computer program product may include a computer-readable medium.

[0111] The terms used in the description of the embodiments herein are for the purpose of describing particular embodiments only and are not intended to limit the scope of the claims. As used in the description of the embodiments and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that when the terms "comprises" and / or "comprising" are used in this specification, they specify the presence of the stated features, elements, and / or components, but do not preclude the presence or addition of one or more other features, elements, components, and / or groups thereof.

[0112] It will also be understood that although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the embodiments, the first electrode may be referred to as the second electrode, and similarly, the second electrode may be referred to as the first electrode. The first electrode and the second electrode are both electrodes, but the first electrode and the second electrode are not the same electrode.

[0113] The description of the present application has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications, variations, and alternative embodiments will be apparent to those of ordinary skill in the art from the foregoing description and the teachings presented in the associated drawings. The embodiments were chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention in various embodiments and to best utilize the basic principles and various embodiments with various modifications suitable for the particular purposes contemplated. Accordingly, it should be understood that the scope of the claims should not be limited to the specific examples of the disclosed embodiments, and that modifications and other embodiments are intended to be included within the scope of the appended claims.

Claims

1. A coding method, comprising: Before encoding the first CU in the current CTU row of the current coded picture, reset the history-based motion vector prediction value (HMVP) table; Encode the current CTU row, including: Maintain a plurality of motion vector prediction values in the HMVP table, each motion vector prediction value in the HMVP table being used to encode at least one CU in the current CTU row; For the current CU to be encoded in the current CTU row: Construct a motion vector candidate list according to the prediction mode and at least partially based on the plurality of motion vector prediction values in the HMVP table; Select a motion vector prediction value from the motion vector candidate list; Determine a motion vector at least partially based on the prediction mode and the selected motion vector prediction value to encode the current CU; and Update the HMVP table based on the determined motion vector, wherein updating the HMVP table based on the determined motion vector includes: Compare the plurality of motion vector prediction values in the HMVP table with the determined motion vector; According to the comparison result that one motion vector prediction value among the plurality of motion vector prediction values in the HMVP table is the same as the determined motion vector: Remove the same one motion vector prediction value from the HMVP table; In the HMVP table, move each motion vector prediction value after the removed motion vector prediction value forward; and Add the determined motion vector as the latest motion vector prediction value to the HMVP table, and wherein the prediction mode is an inter-frame mode, the motion vector candidate list has a fixed length of two, and constructing the motion vector candidate list includes: When a history-based motion vector prediction value from the HMVP table is selected to construct the motion vector candidate list, add up to two history-based motion vector prediction values from the HMVP table to the motion vector candidate list.

2. The method according to claim 1, wherein, Updating the HMVP table based on the determined motion vector further includes: According to determining that no motion vector prediction value in the plurality of motion vector prediction values in the HMVP table is the same as the determined motion vector: When the HMVP table is full, remove the earliest motion vector prediction value from the HMVP table; and Add the determined motion vector as the latest motion vector prediction value to the HMVP table.

3. The method according to claim 1, wherein, Constructing the motion vector candidate list further includes: Add zero or more motion vector prediction values of spatially adjacent CUs and / or temporally collocated CUs of the current CU to the motion vector candidate list; and When the current length of the motion vector candidate list is less than a first preset threshold, add up to two history-based motion vector prediction values from the HMVP table to the motion vector candidate list, the first preset threshold being equal to the length of the motion vector candidate list.

4. The method according to claim 3, wherein, Constructing the motion vector candidate list further includes: After adding up to two history-based motion vector prediction values from the HMVP table to the motion vector candidate list: When the current length of the motion vector candidate list is less than the first preset threshold, add up to two zero-valued motion vector prediction values to the motion vector candidate list until the current length of the motion vector candidate list is equal to the first preset threshold.

5. The method according to claim 3, wherein, Adding zero or more motion vector prediction values from spatially adjacent CUs and / or temporally collocated CUs of the current CU to the motion vector candidate list includes: Adding zero or more motion vector prediction values from the spatially adjacent CUs of the current CU to the motion vector candidate list; and When the current length of the motion vector candidate list is less than the first preset threshold, adding zero or more motion vector prediction values from the temporally collocated CUs of the current CU to the motion vector candidate list.

6. The method according to claim 5, wherein, Adding zero or more motion vector prediction values from the temporally collocated CUs of the current CU to the motion vector candidate list includes: Deriving up to one motion vector prediction value candidate from the temporally collocated CUs.

7. The method according to claim 1, wherein, Resetting the HMVP table includes: setting the number of available motion vector prediction values in the HMVP table to zero.

8. The method according to claim 1, further comprising: Generating a bitstream including the encoded current picture, wherein the prediction mode is encoded into the bitstream.

9. A computing device, comprising: One or more processors; A memory configured to store instructions executable by the one or more processors; wherein the one or more processors, when executing the instructions, are configured to generate a bitstream according to the method of any one of claims 1 to 8 and store the bitstream in the memory.

10. A non-transitory computer-readable storage medium storing computer-executable instructions for execution by a computing device having one or more processors, the computer-executable instructions, when executed by the one or more processors, cause the computing device to perform the method according to any one of claims 1 to 8 to generate a bitstream and store the bitstream in the non-transitory computer-readable storage medium.

11. A computer program product comprising a plurality of programs for execution by a computing device having one or more processors, wherein, When executed by the one or more processors, the plurality of programs cause the computing device to execute the method of any one of claims 1 to 8.

12. A bitstream transmission method, wherein, The bitstream is generated by the method of any one of claims 1-8.