Video encoding method and apparatus

JP7899123B2Active Publication Date: 2026-08-03HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2023-03-22
Publication Date
2026-08-03

Smart Images

  • Figure 0007899123000001
    Figure 0007899123000001
  • Figure 0007899123000002
    Figure 0007899123000002
  • Figure 0007899123000003
    Figure 0007899123000003
Patent Text Reader

Abstract

To provide a video coding technology.SOLUTION: A method for obtaining a motion vector according to an embodiment of the present application includes steps of: determining a reference block for a block to be processed, a reference block and the block to be processed having a preset temporal or spatial correlation with each other, the reference block having an initial motion vector and one or more preset motion vector offsets, the initial motion vector of the reference block obtained on the basis of the predicted motion vector of the reference block, and the predicted block of the reference block obtained on the basis of the initial motion vector and one or more preset motion vector offsets; and using the initial motion vector of the reference block as the predicted motion vector of the block to be processed.SELECTED DRAWING: Figure 19
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Cross-reference to Related Applications This patent application claims the benefit of Japanese Patent Application No. 2020-564260, filed on May 16, 2018, which is incorporated herein by reference. This application relates to the field of video encoding technology, and more particularly, to video encoding methods and apparatuses.

Background Art

[0002] Digital video technology can be widely applied to various devices including digital TVs, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), notebook computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, mobile phones or satellite radiotelephones, video conferencing devices, video streaming transmission devices, and the like. Digital video devices implement video decoding technologies, such as MPEG-2, MPEG-4, ITU-T Recommendation H.263, ITU-T Recommendation H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), ITU-T Recommendation H.265 (also referred to as High Efficiency Video Coding (HEVC)), and video decoding technologies described in extended parts of these standards. By implementing these video decoding technologies, digital video devices can transmit, receive, encode, decode, and / or store digital video information more efficiently.

[0003] In video compression techniques, redundant information specific to a video sequence can be reduced or removed by performing spatial (intra) prediction and / or temporal (inter) prediction. In block-based video decoding, a video picture can be divided into video blocks. Video blocks are sometimes called tree blocks, coding units / decoding units (CUs), or coding nodes / decoding nodes. In an intra-decoded (I) slice of a picture, video blocks are encoded by spatial prediction of a reference sample in an adjacent block of the same picture. In an inter-decoded (P or B) slice of a picture, video blocks can be encoded by spatial prediction of a reference sample in an adjacent block of the same picture, or by temporal prediction of a reference sample in a different reference picture. A picture is sometimes called a frame, and a reference picture is sometimes called a reference frame. [Overview of the project]

[0004] Embodiments of this application provide a video encoding method and associated devices, primarily relating to the acquisition of motion vectors. In conventional inter-prediction and intra-prediction techniques related to motion estimation, motion vectors are a key implementation element and are used to determine the predictor of a block to be processed in order to reconstruct the block to be processed. Generally, a motion vector consists of a predicted motion vector and a difference in motion vectors. The difference in motion vectors is the difference between the motion vector and the predicted motion vector. In some techniques, for example in motion vector merge mode (Merge mode), the difference in motion vectors is not used, and the predicted motion vector is treated directly as the motion vector. The predicted motion vector is usually obtained from a previous encoded or decoded block that has a temporal or spatial correlation with the block to be processed, and the motion vector of the block to be processed is usually used as the predicted motion vector of the subsequent encoded or decoded block.

[0005] However, with technological advancements, techniques related to updating motion vectors have emerged. The motion vector used to determine the predictor of a block being processed is no longer directly obtained from the predicted motion vector, or the sum of the predicted motion vector and the difference between the motion vectors (here, the predicted motion vector, or the sum of the predicted motion vector and the difference between the motion vectors, is called the initial motion vector), but rather from an updated value of the initial motion vector. Specifically, after the initial motion vector of the block being processed is obtained, the initial motion vector is first updated to obtain the actual motion vector, and then the predicted block of the block being processed is obtained by using the actual motion vector. The actual motion vector is stored for use in the prediction procedure of subsequent coded or decoded blocks. Motion vector updating techniques improve prediction accuracy and coding efficiency. However, for subsequent coded or decoded blocks, the prediction step can only be performed after the motion vector updates for one or more previous coded or decoded blocks are complete—in other words, only after the actual motion vector has been determined. This causes delays in parallel or pipelined processing of different blocks compared to methods where motion vectors are not updated. [Means for solving the problem]

[0006] A first aspect of this application provides a method for obtaining a motion vector, comprising the steps of determining a reference block of a block to be processed, wherein the reference block and the block to be processed have a pre-defined temporal or spatial correlation, the reference block has an initial motion vector and one or more pre-defined motion vector offsets, the initial motion vector of the reference block is obtained based on a predicted motion vector of the reference block, and the predicted block of the reference block is obtained based on an initial motion vector and one or more pre-defined motion vector offsets, and using the initial motion vector of the reference block as the predicted motion vector of the block to be processed.

[0007] As described above, the initial motion vector before the update is used to replace the actual motion vector and to predict the subsequent coded or decoded block. The prediction step may be performed for the subsequent coded or decoded block before the actual motion vector update is complete. This ensures the improvement in coding efficiency brought about by the motion vector update and eliminates processing delays.

[0008] In the first feasible implementation of the first embodiment, the initial motion vector of the reference block is obtained in the following manner, namely, by using the predicted motion vector of the reference block as the initial motion vector of the reference block, or by adding the difference between the predicted motion vector of the reference block and the motion vector of the reference block in order to obtain the initial motion vector of the reference block.

[0009] In different interpretation modes, the initial motion vector can be obtained from the predicted motion vector, or from the sum of the predicted motion vector and the difference between the two motion vectors. This improves coding efficiency.

[0010] In a second feasible implementation of the first embodiment, the prediction block of the reference block is specifically obtained in the following manner: a step of obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block and using the obtained picture block as a temporary prediction block of the reference block; a step of adding the initial motion vector of the reference block and one or more pre-set motion vector offsets to obtain one or more actual motion vectors, wherein each actual motion vector indicates a search position; a step of obtaining one or more candidate prediction blocks at the search positions indicated by one or more actual motion vectors, wherein each search position corresponds to one candidate prediction block; and a step of selecting from one or more candidate prediction blocks the candidate prediction block with the smallest pixel difference from the temporary prediction block as the prediction block of the reference block.

[0011] This implementation specifically explains the motion vector update method. Based on the motion vector update, predictions become more accurate and coding efficiency is improved.

[0012] In a third feasible implementation of the first embodiment, the method is used for bidirectional prediction, wherein a reference frame includes a reference frame in a first direction and a reference frame in a second direction, and an initial motion vector includes an initial motion vector in a first direction and an initial motion vector in a second direction, and the steps of obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block and using the obtained picture block as a temporary prediction block of the reference block include the steps of obtaining a first picture block indicated by the initial motion vector of the first direction of the reference block from the reference frame in the first direction of the reference block, obtaining a second picture block indicated by the initial motion vector of the second direction of the reference block from the reference frame in the second direction of the reference block, and weighting the first picture block and the second picture block in order to obtain a temporary prediction block of the reference block.

[0013] This implementation specifically describes the motion vector update method during bidirectional prediction. Based on the motion vector updates, predictions become more accurate and coding efficiency is improved.

[0014] In a fourth feasible implementation of the first embodiment, the method further includes the step of rounding the motion vector resolution of an actual motion vector so that the motion vector resolution of the processed actual motion vector is equal to the pre-set pixel precision, if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision.

[0015] This implementation ensures that the motion vector resolution of the actual motion vector is equal to the pre-set pixel precision, thereby reducing the computational complexity caused by different motion vector resolutions. It should be understood that even when the initial motion vector before update is used to replace the actual motion vector, and the method used to predict subsequent coded or decoded blocks is not used, this implementation can reduce latency because, when used separately, it reduces the complexity of updating the motion vector.

[0016] In a fifth feasible implementation of the first embodiment, the step of selecting a candidate prediction block as the reference block from one or more candidate prediction blocks, the candidate prediction block having the smallest pixel difference with a temporary prediction block, includes the step of selecting an actual motion vector corresponding to the candidate prediction block having the smallest pixel difference with a temporary prediction block from one or more candidate prediction blocks; if the motion vector resolution of the selected actual motion vector is higher than a pre-set pixel precision, the step of rounding the motion vector resolution of the processed selected actual motion vector so that the motion vector resolution of the processed selected actual motion vector is equal to a pre-set pixel precision; and the step of determining that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the reference block.

[0017] This implementation also ensures that the motion vector resolution of the actual motion vector is equal to the pre-set pixel precision, mitigating the computational complexity caused by different motion vector resolutions. It should be understood that even when the initial motion vector before update is used to replace the actual motion vector and the method used to predict subsequent coded or decoded blocks is not used, this implementation can reduce latency because, when used separately, it reduces the complexity of updating the motion vector.

[0018] In the sixth feasible implementation of the first embodiment, the pre-configured pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0019] In the seventh feasible implementation of the first embodiment, the method further includes the step of using the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed.

[0020] In the eighth feasible implementation of the first embodiment, the method further includes the step of adding the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain an initial motion vector of the block to be processed.

[0021] In the ninth feasible implementation of the first embodiment, the method is used for video decoding, and the difference in motion vectors of the blocks being processed is obtained by analyzing a first identification information in the bitstream.

[0022] In different interpretation modes, the initial motion vector can be obtained from the predicted motion vector, or from the sum of the predicted motion vector and the difference between the two motion vectors. This improves coding efficiency.

[0023] In a tenth possible implementation of the first aspect, the method is used for video decoding, and the step of determining a reference block of a processed block includes analyzing a bitstream to obtain second identification information and determining a reference block of the processed block based on the second identification information.

[0024] In an eleventh possible implementation of the first aspect, the method is used for video encoding, and the step of determining a reference block of a processed block includes selecting, as the reference block of the processed block, a candidate reference block with the minimum rate-distortion cost from one or more candidate reference blocks of the processed block.

[0025] A reference block is a video picture block having a spatial or temporal correlation relationship with the processed block, and can be, for example, a spatially adjacent block or a co-located block at the same temporal position. The motion vector of the reference block is used to predict the motion vector of the processed block. This improves the encoding efficiency of the motion vector.

[0026] According to a second aspect of the present application, there is provided an apparatus for obtaining a motion vector, including a determination module configured such that a reference block of a processed block is determined, the reference block and the processed block have a preset temporal or spatial correlation relationship, the reference block has an initial motion vector and one or more preset motion vector offsets, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, and the predicted block of the reference block is obtained based on the initial motion vector and one or more preset motion vector offsets, and an acquisition module configured to use the initial motion vector of the reference block as the predicted motion vector of the processed block.

[0027] In a first possible implementation of the second aspect, the acquisition module is further configured to use the predicted motion vector of the reference block as the initial motion vector of the reference block, or to add the predicted motion vector of the reference block and the difference between the motion vectors of the reference block in order to obtain the initial motion vector of the reference block.

[0028] In a second possible implementation of the second aspect, the acquisition module obtains a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, uses the obtained picture block as a temporary prediction block of the reference block, and adds the initial motion vector of the reference block and one or more preset motion vector offsets in order to obtain one or more actual motion vectors. Each actual motion vector indicates a search position, and one or more candidate prediction blocks are obtained at the search positions indicated by the one or more actual motion vectors. Each search position corresponds to one candidate prediction block, and a candidate prediction block with the smallest pixel difference from the temporary prediction block is selected as the prediction block of the reference block.

[0029] In a third possible implementation of the second aspect, the apparatus is configured for bidirectional prediction. The reference frame includes a reference frame in the first direction and a reference frame in the second direction. The initial motion vector includes an initial motion vector in the first direction and an initial motion vector in the second direction. The acquisition module obtains a first picture block indicated by the initial motion vector in the first direction of the reference block from the reference frame in the first direction of the reference block, and obtains a second picture block indicated by the initial motion vector in the second direction of the reference block from the reference frame in the second direction of the reference block. The apparatus is specifically configured to weight the first picture block and the second picture block in order to obtain a temporary prediction block of the reference block.

[0030] In a fourth feasible implementation of the second embodiment, the device further comprises a rounding module configured to round the motion vector resolution of an actual motion vector so that the motion vector resolution of the processed actual motion vector becomes equal to the pre-set pixel precision if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision.

[0031] In a fifth feasible implementation of the second embodiment, the acquisition module is particularly configured to select an actual motion vector from one or more candidate prediction blocks that corresponds to a candidate prediction block with the smallest pixel difference from a temporary prediction block, and if the motion vector resolution of the selected actual motion vector is higher than a pre-set pixel precision, round the motion vector resolution of the selected actual motion vector so that the processed motion vector resolution of the selected actual motion vector is equal to the pre-set pixel precision, and determine that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the reference block.

[0032] In the sixth feasible implementation of the second embodiment, the pre-configured pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0033] In the seventh feasible implementation of the second embodiment, the acquisition module is specifically configured to use the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed.

[0034] In the eighth feasible implementation of the second embodiment, the acquisition module is specifically configured to add the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain the initial motion vector of the block to be processed.

[0035] In the ninth feasible implementation of the second embodiment, the device is used for video decoding, and the difference in motion vectors of the blocks being processed is obtained by analyzing first identification information in the bitstream.

[0036] In the tenth feasible implementation of the second embodiment, the device is used for video decoding and is particularly configured such that a decision module analyzes a bitstream to obtain a second identification information and, based on the second identification information, determines a reference block of the block to be processed.

[0037] In the eleventh feasible implementation of the second embodiment, the apparatus is used for video coding, and the decision module is particularly configured to select from one or more candidate reference blocks of the block to be processed the candidate reference block that has the minimum rate distortion cost as the reference block of the block to be processed.

[0038] A third aspect of this application provides a method for obtaining motion vectors, comprising the steps of: determining a reference block of a block to be processed, wherein the reference block and the block to be processed have a pre-defined temporal or spatial correlation; obtaining an initial motion vector of the block to be processed based on the reference block; obtaining a predicted motion vector of the block to be processed based on the initial motion vector of the block to be processed and one or more pre-defined motion vector offsets; and using the initial motion vector of the block to be processed as a predicted motion vector of a subsequent block to be processed after the block to be processed.

[0039] In the first feasible implementation of the third embodiment, the step of obtaining an initial motion vector of a block to be processed based on a reference block includes the step of using the initial motion vector of the reference block as the initial motion vector of the block to be processed, or the step of adding the difference between the initial motion vector of the reference block and the motion vector of the block to be processed in order to obtain an initial motion vector of the block to be processed.

[0040] In a second feasible implementation of the third embodiment, the step of obtaining a predicted block for a block to be processed, based on an initial motion vector of the block to be processed and one or more pre-configured motion vector offsets, includes: obtaining a picture block indicated by the initial motion vector of the block to be processed from a reference frame of the block to be processed and using the obtained picture block as a temporary predicted block for the block to be processed; adding the initial motion vector of the block to be processed and one or more pre-configured motion vector offsets to obtain one or more actual motion vectors, wherein each actual motion vector indicates a search position; obtaining one or more candidate predicted blocks at the search positions indicated by the one or more actual motion vectors, wherein each search position corresponds to one candidate predicted block; and selecting from one or more candidate predicted blocks the candidate predicted block with the smallest pixel difference from the temporary predicted block as the predicted block for the block to be processed.

[0041] In a third feasible implementation of the third embodiment, the method is used for bidirectional prediction, wherein the reference frame includes a reference frame in a first direction and a reference frame in a second direction, and the initial motion vector of the block to be processed includes an initial motion vector in a first direction and an initial motion vector in a second direction, and the steps of obtaining a picture block indicated by the initial motion vector of the block to be processed from the reference frame of the block to be processed and using the obtained picture block as a temporary prediction block of the block to be processed include the steps of obtaining a first picture block indicated by the initial motion vector of the block to be processed from the reference frame in a first direction of the block to be processed, obtaining a second picture block indicated by the initial motion vector of the block to be processed from the reference frame in a second direction of the block to be processed, and weighting the first picture block and the second picture block in order to obtain a temporary prediction block of the block to be processed.

[0042] In a fourth feasible implementation of the third embodiment, the method further includes the step of rounding the motion vector resolution of an actual motion vector so that the motion vector resolution of the processed actual motion vector is equal to the pre-set pixel precision, if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision.

[0043] In a fifth feasible implementation of the third embodiment, the step of selecting a candidate prediction block from one or more candidate prediction blocks that has the smallest pixel difference with a temporary prediction block as the prediction block for the block to be processed includes the step of selecting an actual motion vector corresponding to the candidate prediction block that has the smallest pixel difference with a temporary prediction block from one or more candidate prediction blocks; if the motion vector resolution of the selected actual motion vector is higher than a pre-set pixel precision, the step of rounding the motion vector resolution of the selected actual motion vector so that the motion vector resolution of the processed selected actual motion vector is equal to the pre-set pixel precision; and the step of determining that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block for the block to be processed.

[0044] In the sixth feasible implementation of the third embodiment, the pre-configured pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0045] In the seventh feasible implementation of the third embodiment, the method further includes the step of using the predicted motion vector of a subsequent processed block processed after the processed block as the initial motion vector of the subsequent processed block processed after the processed block.

[0046] In the eighth feasible implementation of the third embodiment, the method further includes the step of adding a predicted motion vector to the motion vector of a subsequent processed block that is processed after the block being processed, in order to obtain an initial motion vector of a subsequent processed block that is processed after the block being processed.

[0047] In the ninth feasible implementation of the third embodiment, the method is used for video decoding, and the difference in motion vectors of subsequent blocks to be processed after the block being processed is obtained by analyzing the first identification information in the bitstream.

[0048] In the tenth feasible implementation of the third embodiment, the method is used for video decoding, and the step of determining the reference block of the block to be processed includes the step of parsing the bitstream to obtain second identification information, and the step of determining the reference block of the block to be processed based on the second identification information.

[0049] In the eleventh feasible implementation of the third embodiment, the method is used for video coding, and the step of determining the reference block of the block to be processed includes selecting from one or more candidate reference blocks of the block to be processed the candidate reference block having the minimum rate distortion cost as the reference block of the block to be processed.

[0050] A fourth aspect of this application provides a device for acquiring motion vectors. The device may be applied to the encoder side or the decoder side. The device comprises a processor and memory. The processor and memory are interconnected (e.g., via a bus). In possible implementations, the device may further comprise a transceiver. The transceiver is connected to the processor and memory and is configured to receive / transmit data. The memory is configured to store program code and video data. The processor is configured to read program code stored in memory in order to perform the method described in the first or third aspect.

[0051] A fifth aspect of this application provides a video coding system. The video coding system comprises a source device and a destination device. The source device and the destination device may be connected in a communicative manner. The source device generates coded video data. Therefore, the source device may be called a video coding device or video coding apparatus. The destination device can decode the coded video data generated by the source device. Therefore, the destination device may be called a video decoding device or video decoding apparatus. The source device and destination device may be examples of a video coding device or video coding apparatus. The methods described in the first or third aspect apply to a video coding device or video coding apparatus.

[0052] According to a sixth aspect of this application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer is made capable of performing the methods described in the first or third aspect.

[0053] According to a seventh aspect of this application, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer is made capable of performing the methods described in the first or third aspect.

[0054] It should be understood that the embodiments corresponding to the second through seventh aspects of this application and the embodiments corresponding to the first aspect of this application have the same inventive purpose, similar technical features, and the same beneficial technical effects. Details will not be repeated. [Brief explanation of the drawing]

[0055] [Figure 1] This is a block diagram of an example of a video encoding system that may be configured for use in one embodiment of this application. [Figure 2] This is a system block diagram of an example of a video encoder that may be configured for use in one embodiment of this application. [Figure 3]This is a system block diagram of an example of a video decoder that may be configured for use in one embodiment of this application. [Figure 4] This is a block diagram of an example of an interpretation module that may be configured for use in one embodiment of this application. [Figure 5] This is a flowchart illustrating an example implementation of the merge prediction mode. [Figure 6] This is a flowchart illustrating an example implementation of the advanced motion vector prediction mode. [Figure 7] This is a flowchart illustrating an exemplary implementation of motion compensation by a video decoder that may be configured for use in one embodiment of this application. [Figure 8] This is a schematic diagram of an example of an encoding unit and an adjacent picture block associated with the encoding unit. [Figure 9] This is a flowchart illustrating an example implementation of constructing a list of candidate predicted motion vectors. [Figure 10] This is a schematic diagram illustrating an exemplary implementation where combined candidate motion vectors are added to the merge mode candidate predicted motion vector list. [Figure 11] This is a schematic diagram illustrating an exemplary implementation that adds scaled candidate motion vectors to the merge mode candidate predicted motion vector list. [Figure 12] This is a schematic diagram illustrating an exemplary implementation that adds a zero motion vector to the merge mode candidate predicted motion vector list. [Figure 13] This is a schematic flowchart of a method for updating motion vectors in video encoding according to one embodiment of the present application. [Figure 14] This is a schematic flowchart of a method for updating motion vectors in video decoding according to one embodiment of the present application. [Figure 15] This is a schematic flowchart for updating motion vectors according to one embodiment of the present application. [Figure 16] This is a schematic flowchart for updating motion vectors according to one embodiment of the present application. [Figure 17A] This is a schematic flowchart for updating motion vectors according to one embodiment of the present application. [Figure 17B] This is a schematic flowchart for updating motion vectors according to one embodiment of the present application. [Figure 18] This is a schematic flowchart for updating motion vectors according to one embodiment of the present application. [Figure 19] This is a schematic flowchart of a method for obtaining motion vectors in video encoding according to one embodiment of this application. [Figure 20] This is a schematic flowchart of a method for obtaining motion vectors in video decoding according to one embodiment of this application. [Figure 21] This is a schematic block diagram of an apparatus for acquiring motion vectors in video decoding according to one embodiment of the present application. [Figure 22] This is a schematic block diagram of a video encoding device according to one embodiment of the present application. [Modes for carrying out the invention]

[0056] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings of the embodiments of this application.

[0057] Figure 1 is a schematic block diagram of a video encoding system 10 according to one embodiment of the present application. As shown in Figure 1, the system 10 comprises a source device 12. The source device 12 generates encoded video data which is later decoded by a destination device 14. The source device 12 and the destination device 14 may include any one of a variety of devices, including desktop computers, notebook computers, tablet computers, set-top boxes, telephone handsets such as "smartphones", "smart" touchpads, televisions, cameras, display devices, digital media players, video game consoles, video streaming transmission devices, etc. In some applications, the source device 12 and the destination device 14 may be equipped for wireless communication.

[0058] The destination device 14 may receive the encoded video data to be decoded via link 16. Link 16 may include any type of medium or device capable of transferring the encoded video data from the source device 12 to the destination device 14. In a feasible implementation, 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 according to a communication standard (e.g., a wireless communication protocol) and then transmitted to the destination device 14. The communication medium may include any wireless or wired communication medium, such as a radio frequency band or one or more physical transmission lines. The communication medium may constitute part of a packet-based network (e.g., a local area network, a wide area network, or a global network such as the Internet). The communication medium may include routers, switches, base stations, or any other devices that may be used to facilitate communication from the source device 12 to the destination device 14.

[0059] Alternatively, the encoded data may be output to the storage device 24 via the output interface 22. Similarly, the encoded data from the storage device 24 may be accessed via the input interface. The storage device 24 may include one of several scattered or local data storage media, such as a hard disk drive, Blu-ray® disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage media configured to store encoded video data. In another feasible implementation, the storage device 24 may correspond to a file server or another intermediate storage device capable of holding encoded video generated by the source device 12. The destination device 14 may access the stored video data from the storage device 24 via streaming transmission or download. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to the destination device 14. In a feasible implementation, the file server may include a website server, a file transfer protocol server, a network-attached storage device, or a local disk drive. The destination device 14 may access the encoded video data via any standard data connection, including an internet connection. The data connection may include a wireless channel (e.g., Wi-Fi connection) or a wired connection (e.g., cable modem), or a combination thereof, suitable for accessing encoded video data stored on the file server. The encoded video data may be transmitted from the storage device 24 via streaming, download, or a combination thereof.

[0060] The technology of this application is not necessarily limited to wireless applications or settings. The technology may be applied to video decoding to support any one of several multimedia applications, for example, wireless television broadcasting, cable television transmission, satellite television transmission, video streaming transmission (e.g., over the Internet), encoding of digital video for storage on a data storage medium, decoding of digital video stored on a data storage medium, or another application. In some feasible implementations, system 10 may be configured to support unidirectional or bidirectional video transmission to support applications such as video streaming transmission, video playback, video broadcasting, and / or video phone.

[0061] In the feasible implementation shown in Figure 1, the source device 12 comprises a video source 18, a video encoder 20, and an output interface 22. In some applications, the output interface 22 may comprise a modulator / demodulator (modem) and / or transmitter. In the source device 12, the video source 18 may include, for example, the following sources: a video capture device (e.g., a video camera), a video archive containing previously captured video, a video feed-in interface for receiving video from a video content provider, and / or a computer graphics system for generating computer graphics data as source video, or a combination thereof. In a feasible implementation, if the video source 18 is a video camera, the source device 12 and the destination device 14 may constitute a camera-equipped mobile phone or videophone. For example, the technology described herein may be applied to video decoding and to wireless and / or wired applications.

[0062] The video encoder 20 can encode captured or pre-captured video, or computer-generated video. The encoded video data can be transmitted directly to the destination device 14 via the output interface 22 of the source device 12. The encoded video data can also (or alternatively) be stored in the storage device 24 so that the destination device 14 or another device can later access the encoded video data for decoding and / or playback.

[0063] The destination device 14 comprises an input interface 28, a video decoder 30, and a display device 32. In some applications, the input interface 28 may include a receiver and / or a modem. The input interface 28 of the destination device 14 receives encoded video data via link 16. The encoded video data transmitted or supplied to the storage device 24 via link 16 may include several syntax elements generated by the video encoder 20 and used by the video decoder 30 to decode the video data. These syntax elements may be included in the encoded video data transmitted over a communication medium and stored in a storage medium or a file server.

[0064] The display device 32 may be integrated with the destination device 14 or located outside of the destination device 14. In some feasible implementations, the destination device 14 may have an integrated display device and may also be configured to connect to an interface for an external display device. In other feasible implementations, the destination device 14 may be a display device. Generally, the display device 32 displays the decoded video data to the user and may include one of several display devices, such as a liquid crystal display, a plasma display, an organic light-emitting diode display, or another type of display device.

[0065] The video encoder 20 and video decoder 30 can operate, for example, in accordance with the next-generation video coding and compression standard (H.266) currently under development and can comply with the H.266 Test Model (JEM). Alternatively, the video encoder 20 and video decoder 30 can operate in accordance with other proprietary or industrial standards, such as the ITU-T Recommendation H.265 standard or the ITU-T Recommendation H.264 standard, or extensions of these standards. The ITU-T Recommendation H.265 standard is also known as the High Efficiency Video Coding Standard, and the ITU-T Recommendation H.264 standard is also known as MPEG-4 Part 10 or Advanced Video Coding (AVC). However, the technology of this application is not limited to any particular coding standard. In other feasible implementations, video compression standards include MPEG-2 and ITU-T Recommendation H.263.

[0066] Although not shown in Figure 1, in some embodiments, the video encoder 20 and video decoder 30 may be integrated with the audio encoder and audio decoder, respectively, and may include a suitable multiplexer-demultiplexer (MUX-DEMUX) unit or other hardware and software to encode both audio and video of the same data stream or separate data streams. Where applicable, in some feasible implementations, the MUX-DEMUX unit may conform to the ITU Recommendation H.223 Multiplexer Protocol or other protocols such as the User Datagram Protocol (UDP).

[0067] The video encoder 20 and video decoder 30 may each be implemented as one of several 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. If the technology is partially implemented in software, the device may store instructions for the software on a suitable non-temporary computer-readable medium and execute the instructions in hardware by using one or more processors to perform the technology of this application. The video encoder 20 and video decoder 30 may each be included in one or more encoders or decoders. Either the video encoder 20 or video decoder 30 may be integrated as part of a composite encoder / decoder (codec) of the corresponding device.

[0068] This application may relate, for example, to another device in which a video encoder 20 signals specific information to, for example, a video decoder 30. However, it should be understood that the video encoder 20 may associate specific syntax elements with an encoded portion of video data in order to signal information. That is, the video encoder 20 may store specific syntax elements in the header information of an encoded portion of video data in order to signal data. In some applications, these syntax elements may be encoded and stored (for example, stored in a storage system 34 or a file server 36) before they are received and decoded by the video decoder 30. Thus, the term “signaling” may mean, for example, the transmission of syntax or the transmission of other data used to decode compressed video data, regardless of whether the transmission is performed in real time, near real time, or within a time span. For example, the transmission may occur when the syntax elements are stored on the medium during encoding, and the syntax elements may then be re-examined by the decoder at any time after they have been stored on the medium.

[0069] JCT-VC is developing the H.265 (HEVC) standard. The HEVC standardization is based on an advanced model of the video decoder, which is called the HEVC Test Model (HM). The latest H.265 standard document is available at http: / / www.itu.int / rec / T-REC-H.265. The latest version of the standard document is H.265(12 / 16), and the entire standard document is incorporated herein by reference. In the HM, it is assumed that the video decoder has several additional features related to the existing algorithms of ITU-T Recommendation H.264 / AVC. For example, while H.264 provides nine intra-predictive coding modes, the HM can provide up to 35 intra-predictive coding modes.

[0070] JVET is working on the development of the H.266 standard. The H.266 standardization process is based on an advanced model of a video decoder, which is called the H.266 test model. A description of the H.266 algorithm is available at http: / / phenix.int-evry.fr / jvet, and the latest algorithm description is included in JVET-G1001-v1. The algorithm description document is incorporated herein by reference in its entirety. In addition, the reference software for the JEM test model is available at https: / / jvet.hhi.fraunhofer.de / svn / svn_HMJEMSoftware / , and is incorporated herein by reference in its entirety.

[0071] Generally, as described in the HM operating model, a video frame or picture can be divided into a series of tree blocks, or into the largest coding unit (LCU), which contains both luminance and chrominance samples. The LCU is also called the CTU. Tree blocks have a similar function to macroblocks in the H.264 standard. A slice contains several consecutive tree blocks in decoding order. A video frame or picture can be divided into one or more slices. Each tree block can be divided into coding units based on a quadtree. For example, a tree block acting as the root node of a quadtree may be divided into four child nodes, each of which can also act as a parent node and may be divided into four other child nodes. The last non-divisible child node, acting as a leaf node of the quadtree, contains a decoding node, e.g., a decoded video block. The syntactic data associated with the decoded bitstream may specify the maximum number of times a tree block can be divided and the minimum size of a decoding node.

[0072] An encoding unit (CU) includes a decoding node, a prediction unit (PU), and a transform unit (TU) associated with the decoding node. The size of the CU corresponds to the size of the decoding node, and the shape of the CU must be square. The size of the CU can range from 8x8 pixels to a maximum of 64x64 pixels or larger tree block sizes. Each CU may contain one or more PUs and one or more TUs. For example, syntactic data associated with a CU may describe splitting one CU into one or more PUs. The splitting pattern may differ depending on whether the CU is encoded in skip mode, direct mode, intra-prediction mode, or inter-prediction mode. The resulting PUs may be non-square in shape. For example, syntactic data associated with a CU may also describe splitting one CU into one or more TUs based on a quadtree. The TUs may be square or non-square in shape.

[0073] The HEVC standard enables TU-based conversion, where TUs can differ for different CUs. The size of a TU is typically set based on the size of PUs within a given CU, as defined for the partitioned LCUs. However, this is not always the case. The size of a TU is generally equal to or smaller than the size of a PU. In some feasible implementations, a quadtree structure called a "residual quadtree" (RQT) may be used to partition residual samples corresponding to a CU into smaller units. The leaf nodes of an RQT may be called TUs. Pixel differences associated with a TU may be transformed to generate transformation coefficients, which may be quantized.

[0074] Generally, a PU contains data related to the prediction process. For example, when a PU is encoded in intra-prediction mode, it may contain data describing the intra-prediction mode of the PU. In another feasible implementation, when a PU is encoded in inter-prediction mode, it may contain data defining the motion vector of the PU. For example, the data defining the motion vector of the PU may describe the horizontal component of the motion vector, the vertical component of the motion vector, the resolution of the motion vector (e.g., 1 / 4 pixel precision or 1 / 8 pixel precision), the reference picture pointed to by the motion vector, and / or a list of reference pictures for the motion vector (e.g., List 0, List 1, or List C).

[0075] Generally, the transformation and quantization processes are used for TUs. A given CU containing one or more PUs may also contain one or more TUs. After prediction, the video encoder 20 may calculate residual values ​​corresponding to the PUs. The residual values ​​include pixel differences. The pixel differences may be converted to transformation coefficients, which are quantized and undergo a TU scan to generate serialized transformation coefficients for entropy decoding. In this application, the term “video block” is typically used to refer to a decoding node of a CU. In some specific applications of this application, the term “video block” may also be used to refer to a tree block containing decoding nodes, PUs, and TUs, for example, the tree block being an LCU or CU.

[0076] A video sequence typically contains a series of video frames or pictures. For example, a group of pictures (GOP) contains a series of video pictures, or one or more video pictures. A GOP may contain header information for the GOP, header information for one or more pictures, or syntax data elsewhere, where the syntax data describes the number of pictures contained in the GOP. Each slice of a picture may contain slice syntax data describing the encoding mode of the corresponding picture. The video encoder 20 typically performs operations on video blocks in several video slices to encode the video data. A video block may correspond to a decoding node of the CU. The size of a video block may be fixed or variable and may vary depending on the specified decoding standard.

[0077] In feasible implementations, HM supports predictions of various PU sizes. Assuming a given CU size of 2N×2N, HM supports intra-predictions of 2N×2N or N×N PU sizes, and inter-predictions of symmetric PU sizes of 2N×2N, 2N×N, N×2N, or N×N. HM also supports asymmetric partitioning of inter-predictions of 2N×nU, 2N×nD, nL×2N, and nR×2N PU sizes. In asymmetric partitioning, the CU is not partitioned in one direction, but rather in two parts in the other direction, with one part accounting for 25% of the CU and the other part accounting for 75%. The part accounting for 25% of the CU is indicated by an indicator where "n" is followed by "U (Up)", "D (Down)", "L (Left)", or "R (Right)". Therefore, for example, "2N×nU" refers to a 2N×2N CU that is horizontally divided, with a 2N×0.5N PU on the top and a 2N×1.5N PU on the bottom.

[0078] In this application, "N×M" and "N by M," for example, 16×16 pixels or 16 by 16 pixels, may be used interchangeably to indicate the pixel size of a video block in the vertical and horizontal dimensions. Generally, a 16×16 block has 16 pixels vertically (y=16) and 16 pixels horizontally (x=16). Similarly, an N×N block has N pixels vertically and N pixels horizontally, where N is a non-negative integer. Pixels in a block can be arranged in rows and columns. In addition, the number of horizontal pixels and the number of vertical pixels in a block are not necessarily the same. For example, a block may contain N×M pixels, but M is not necessarily equal to N.

[0079] After performing intra- or inter-predictive decoding on the PU of the CU, the video encoder 20 may compute residual data for the TU of the CU. The PU may contain pixel data in its spatial domain (also called the pixel domain). The TU may contain coefficients in its transformation domain after a transformation (e.g., discrete cosine transform, DCT, integer transform, wavelet transform, or conceptually similar transformation) has been performed on the residual video data. The residual data may correspond to the pixel difference between the pixels of the unencoded picture and the predictors corresponding to the PU. The video encoder 20 may generate a TU containing the residual data of the CU and then transform the TU to generate the transformation coefficients of the CU.

[0080] After performing some transformation to generate the transformation coefficients, the video encoder 20 may quantize the transformation coefficients. Quantization refers to the process of quantizing the coefficients, for example, to reduce the amount of data used to represent the coefficients and to perform further compression. The quantization process can reduce the bit depth associated with some or all of the coefficients. For example, during quantization, an n-bit value may be reduced to an m-bit value by rounding, where n is greater than m.

[0081] The JEM model further improves the encoding structure of video pictures. Specifically, it introduces a block encoding structure called the "Quadratic-Binary Tree" (QTBT) structure. Without using concepts such as CU, PU, ​​and TU in HEVC, the QTBT structure supports more flexible partitioned CU shapes. A single CU can be square or rectangular in shape. A quadratic partition is performed first on the CTU, and a binary tree partition is performed further on the leaf nodes of the quadratic tree. In addition, there are two partitioning patterns for the binary tree: symmetric horizontal partitioning and symmetric vertical partitioning. The leaf nodes of the binary tree are called CUs. In the JEM model, CUs cannot be further partitioned during prediction and transformation. In other words, the CUs, PUs, and TUs in the JEM model have the same block size. In the existing JEM model, the maximum CTU size is 256x256 luminance pixels.

[0082] In some feasible implementations, the video encoder 20 may scan quantized transformation coefficients in a predefined scan order to generate a serialized vector that can be entropy encoded. In other feasible implementations, the video encoder 20 may perform an adaptive scan. After scanning the quantized transformation coefficients to form a one-dimensional vector, the video encoder 20 may perform entropy decoding on the one-dimensional vector by using context-based adaptive variable-length coding (CAVLC) or context-based adaptive binary arithmetic decoding (CABAC), syntax-based context-adaptive binary arithmetic decoding (SBAC), stochastic interval partitioning entropy (PIPE) decoding, or another entropy decoding method. The video encoder 20 may further perform entropy coding on syntax elements associated with the encoded video data so that the video decoder 30 can decode the video data.

[0083] To perform CABAC, the video encoder 20 can assign contexts within a context model to the transmitted symbols. Contexts may relate to whether the adjacent values ​​of the symbols are non-zero. To perform CAVLC, the video encoder 20 can select variable-length codes for the transmitted symbols. Variable-length coding (VLC) codewords can be constructed such that shorter codes correspond to higher-probability symbols, and longer codes correspond to lower-probability symbols. Thus, using VLC can reduce the bitrate compared to using codewords of the same length for all transmitted symbols. CABAC probabilities can be determined based on the contexts assigned to the symbols.

[0084] In this embodiment of the present application, the video encoder may perform interpretation to reduce temporal redundancy between pictures. As described above, a CU may have one or more prediction units PU, depending on different video compression coding standards. In other words, multiple PUs may belong to a CU, or the PU and CU may have the same size. In this specification, when the CU and PU have the same size, the division pattern of the CU is undivided, or the CU is divided into one PU, and the PU is used uniformly for description. When the video encoder performs interpretation, the video encoder may signal motion information of the PU to the video decoder. For example, the motion information of the PU may include a reference picture index, a motion vector, and a prediction direction identifier. The motion vector may indicate the displacement between the picture block (also called a video block, pixel block, pixel set, etc.) of the PU and the reference block of the PU. The reference block of the PU may be part of a reference picture similar to the picture block of the PU. The reference block may be located in a reference picture indicated by the reference picture index and the prediction direction identifier.

[0085] To reduce the number of encoded bits required to represent motion information for each PU, the video encoder may generate a list of candidate predicted motion vectors (MVs) for each PU, according to a merge prediction mode or an advanced motion vector prediction mode. Each candidate predicted motion vector in the list of candidate predicted motion vectors for a PU may represent motion information. The motion information represented by several candidate predicted motion vectors in the list may be based on the motion information of other PUs. If a candidate predicted motion vector represents motion information for one of a specified spatial candidate predicted motion vector position or a specified temporal candidate predicted motion vector position, the candidate predicted motion vector may be referred to herein as the “original” candidate predicted motion vector. For example, in a merge mode, also referred herein as merge prediction mode, there may be five original spatial candidate predicted motion vector positions and one original temporal candidate predicted motion vector position. In some examples, the video encoder may generate additional candidate predicted motion vectors by combining several motion vectors from different original candidate predicted motion vectors, modifying original candidate predicted motion vectors, or inserting only zero motion vectors as candidate predicted motion vectors. Additional candidate predicted motion vectors are not considered part of the original candidate predicted motion vectors and may be referred to in this application as artificially generated candidate predicted motion vectors.

[0086] The technology of this application typically includes a technique for generating a list of candidate predicted motion vectors in a video encoder and a technique for generating the same list of candidate predicted motion vectors in a video decoder. The video encoder and video decoder may generate the same list of candidate predicted motion vectors by implementing the same technique for constructing the list of candidate predicted motion vectors. For example, the video encoder and video decoder may construct a list using the same number of candidate predicted motion vectors (e.g., five candidate predicted motion vectors). The video encoder and video decoder may first consider spatially predicted motion vectors (e.g., adjacent blocks of the same picture), then temporally predicted motion vectors (e.g., candidate predicted motion vectors of different pictures), and finally consider artificially generated candidate predicted motion vectors until the required number of candidate predicted motion vectors are added to the list. According to the technology of this application, during the construction of a list of candidate predicted motion vectors, pruning operations may be performed on some types of candidate predicted motion vectors to remove duplicate candidate predicted motion vectors from the list, while not being performed on other types of candidate predicted motion vectors to reduce the complexity of the decoder. For example, pruning operations may be performed on sets of spatially predicted motion vectors and temporally predicted motion vectors to remove candidate predicted motion vectors with duplicate motion information from the list. However, artificially generated candidate predicted motion vectors may be added to the list of candidate predicted motion vectors without being pruned.

[0087] After generating a list of candidate predicted motion vectors for the CU's PU, the video encoder may select a candidate predicted motion vector from the list and output the candidate predicted motion vector index to the bitstream. The selected candidate predicted motion vector may be the one that generates the motion vector that most closely matches the predictor of the target PU being decoded. The candidate predicted motion vector index may indicate the position of the selected candidate predicted motion vector within the list of candidate predicted motion vectors. The video encoder may further generate predicted picture blocks of the PU based on the reference blocks indicated by the PU's motion information. The PU's motion information may be determined based on the motion information indicated by the selected candidate predicted motion vector. For example, in merge mode, the PU's motion information may be the same as the motion information indicated by the selected candidate predicted motion vector. In AMVP mode, the PU's motion information may be determined based on the difference of the PU's motion vectors and the motion information indicated by the selected candidate predicted motion vector. The video encoder may generate one or more residual picture blocks of the CU based on the CU's predicted picture blocks and the CU's original picture blocks. Next, the video encoder may encode one or more residual picture blocks and output one or more residual picture blocks to a bitstream.

[0088] The bitstream may contain data identifying selected candidate predicted motion vectors in the candidate predicted motion vector list of the PU. The video decoder may determine the motion information of the PU based on the motion information indicated by the selected candidate predicted motion vectors in the candidate predicted motion vector list of the PU. Based on the motion information of the PU, the video decoder may identify one or more reference blocks of the PU. After identifying one or more reference blocks of the PU, the video decoder may generate predicted picture blocks of the PU based on one or more reference blocks of the PU. The video decoder may reconstruct the picture blocks of the CU based on the predicted picture blocks of the PU and one or more residual picture blocks of the CU.

[0089] For the sake of clarity, in this application, a location or picture block may be described as having various spatial relationships with a CU or PU. This description can be explained as follows: a location or picture block has various spatial relationships with a picture block associated with a CU or PU. In addition, in this application, a PU currently being decoded by a video decoder may be called the current PU, or also called the picture block currently being processed. In this application, a CU currently being decoded by a video decoder may be called the current CU. In this application, a picture currently being decoded by a video decoder may be called the current picture. It should be understood that this application is also applicable when the PU and CU are the same size, or when the PU is a CU and the PU is used uniformly in the description.

[0090] As briefly explained above, the video encoder 20 can generate predicted picture block and motion information for the CU's PU through interpretation. In many examples, the motion information for a given PU may be the same as, or similar to, the motion information for one or more adjacent PUs (i.e., PUs whose picture blocks are spatially or temporally adjacent to the picture blocks of the given PU). Since adjacent PUs often have similar motion information, the video encoder 20 can encode the motion information for a given PU based on the motion information of adjacent PUs. Encoding the motion information for a given PU based on the motion information of adjacent PUs can reduce the number of encoded bits required in the bitstream to represent the motion information for a given PU.

[0091] The video encoder 20 can encode motion information of a given PU based on motion information of adjacent PUs in various ways. For example, the video encoder 20 may indicate that the motion information of a given PU is the same as the motion information of an adjacent PU. In this application, a merge mode may be used to indicate that the motion information of a given PU is the same as, or can be derived from, the motion information of an adjacent PU. In another feasible implementation, the video encoder 20 may calculate a Motion Vector Difference (MVD) of a given PU. The MVD represents the difference between the motion vector of a given PU and the motion vector of an adjacent PU. The video encoder 20 may include the MVD in place of the given PU's motion vector in the motion information of a given PU. In the bitstream, the number of encoded bits required to represent the MVD is less than the number of encoded bits required to represent the given PU's motion vector. In this application, an advanced motion vector prediction mode may be used to indicate that the motion information of a given PU is signaled to the decoder by using the MVD and an index value used to identify a candidate motion vector.

[0092] In merge mode or AMVP mode, the video encoder 20 may generate a list of candidate predicted motion vectors for a given PU in order to signal motion information for that PU to the decoder. The list of candidate predicted motion vectors may contain one or more candidate predicted motion vectors. Each of the candidate predicted motion vectors in the list of candidate predicted motion vectors for a given PU may specify motion information. The motion information indicated by each candidate predicted motion vector may include a motion vector, a reference picture index, and a prediction direction identifier. The candidate predicted motion vectors in the list of candidate predicted motion vectors may include "original" candidate predicted motion vectors, each "original" candidate predicted motion vector indicating motion information for one of the specified candidate predicted motion vector positions in a PU different from the given PU.

[0093] After generating a list of candidate predicted motion vectors for the PU, the video encoder 20 may select one candidate predicted motion vector from the list. For example, the video encoder may compare each candidate predicted motion vector with the PU being decoded and select a candidate predicted motion vector with a desired rate distortion cost. The video encoder 20 may output a candidate predicted motion vector index for the PU. The candidate predicted motion vector index can identify the position of the selected candidate predicted motion vector within the list of candidate predicted motion vectors.

[0094] In addition, the video encoder 20 may generate predicted picture blocks of the PU based on the reference blocks indicated by the motion information of the PU. The motion information of the PU may be determined based on the motion information indicated by the selected candidate predicted motion vectors in the list of candidate predicted motion vectors of the PU. For example, in merge mode, the motion information of the PU may be the same as the motion information indicated by the selected candidate predicted motion vectors. In AMVP mode, the motion information of the PU may be determined based on the difference of the PU's motion vectors and the motion information indicated by the selected candidate predicted motion vectors. As described above, the video encoder 20 may process predicted picture blocks of the PU.

[0095] When the video decoder 30 receives a bitstream, it may generate a list of candidate predicted motion vectors for each PU of the CU. The list of candidate predicted motion vectors generated by the video decoder 30 for a PU may be the same as the list of candidate predicted motion vectors generated by the video encoder 20 for a PU. Syntax elements obtained by parsing the bitstream may indicate the position of a selected candidate predicted motion vector in the list of candidate predicted motion vectors for the PU. After generating the list of candidate predicted motion vectors for the PU, the video decoder 30 may generate a predicted picture block for the PU based on one or more reference blocks indicated by the motion information of the PU. The video decoder 30 may determine the motion information of the PU based on the motion information indicated by the selected candidate predicted motion vector in the list of candidate predicted motion vectors for the PU. The video decoder 30 may reconstruct the picture block for the CU based on the predicted picture block for the PU and the residual picture block for the CU.

[0096] In feasible implementations, it should be understood that constructing a list of candidate predicted motion vectors on the decoder and parsing the bitstream to obtain the positions of selected candidate predicted motion vectors within that list are independent of each other and can be performed in any order or in parallel.

[0097] In another feasible implementation, the position of a selected candidate predicted motion vector within the candidate predicted motion vector list is first obtained by analyzing the bitstream, and then the candidate predicted motion vector list is constructed based on the positions obtained by the analysis. In this implementation, it is not necessary to construct all candidate predicted motion vector lists; specifically, only the candidate predicted motion vector lists for positions obtained by the analysis need to be constructed under conditions that the candidate predicted motion vector at that position can be determined. For example, if, by analyzing the bitstream, it is determined that the selected candidate predicted motion vector is the candidate predicted motion vector with index 3 in the candidate predicted motion vector list, then only the candidate predicted motion vector lists from index 0 to index 3 need to be constructed, and the candidate predicted motion vector with index 3 can be determined. This reduces complexity and improves decoding efficiency.

[0098] Figure 2 is a schematic block diagram of a video encoder 20 according to one embodiment of the present application. The video encoder 20 can perform intra-coding and inter-coding on video blocks in a video slice. Intra-coding relies on spatial prediction to reduce or eliminate spatial redundancy of video in a given video frame or picture. Inter-coding relies on temporal prediction to reduce or eliminate temporal redundancy of video in adjacent frames or pictures of a video sequence. The intra-mode (I-mode) can be any one of several space-based compression modes. The inter-mode, such as unidirectional prediction mode (P-mode) or bidirectional prediction mode (B-mode), can be any one of several time-based compression modes.

[0099] In the feasible implementation shown in Figure 2, the video encoder 20 comprises a splitting unit 35, a prediction unit 41, a reference picture memory 64, an adder 50, a transformation unit 52, a quantization unit 54, and an entropy coding unit 56. The prediction unit 41 comprises a motion estimation unit 42, a motion compensation unit 44, and an intra-prediction unit 46. For the reconstruction of video blocks, the video encoder 20 further comprises an inverse quantization unit 58, an inverse transformation unit 60, and an adder 62. The video encoder 20 may further comprise a deblocking filter (not shown in Figure 2) for filtering block boundaries to remove blocking artifacts from the reconstructed video. If necessary, the deblocking filter typically filters the output of the adder 62. In addition to the deblocking filter, additional loop filters (in-loop or after-loop) may be used.

[0100] As shown in Figure 2, the video encoder 20 receives video data, and the partitioning unit 35 partitions the data into video blocks. Such partitioning may further include partitioning into slices, picture blocks, or other larger units, as well as partitioning video blocks based on a quadtree structure of LCUs and CUs (for example). For example, the video encoder 20 is a component for encoding video blocks in the video slice to be encoded. Typically, a single slice can be partitioned into multiple video blocks (and into sets of video blocks called picture blocks).

[0101] Based on the encoding quality and cost calculation results (e.g., called rate distortion cost, RD cost, or rate distortion cost), the prediction unit 41 may select one of several possible decoding modes for the current video block, for example, one or more inter-decoding modes from several intra-decoding modes. The prediction unit 41 may provide the acquired intra-decoded or inter-decoded blocks to the adder 50 to generate residual block data, and may provide the acquired intra-decoded or inter-decoded blocks to the adder 62 to reconstruct the encoded blocks and use the reconstructed encoded blocks as reference pictures.

[0102] The motion estimation unit 42 and motion compensation unit 44 of the prediction unit 41 perform inter-prediction decoding for the current video block to one or more predicted blocks of one or more reference pictures in order to provide time compression. The motion estimation unit 42 may be configured to determine the inter-prediction mode of a video slice based on a pre-configured mode of the video sequence. In the pre-configured mode, video slices in the sequence may be designated as P slices, B slices, or GPB slices. The motion estimation unit 42 and the motion compensation unit 44 may be highly integrated, but are described separately for the sake of conceptual explanation. The motion estimation performed by the motion estimation unit 42 is the process of generating motion vectors for estimating video blocks. For example, the motion vectors may represent the displacement of the PU of a video block in the current video frame or picture relative to the predicted block of a reference picture.

[0103] A predicted block is a block of the PU that, based on pixel differences, is found to closely match the video block being decoded. Pixel differences can be determined based on the sum of absolute differences (SAD), the sum of squared differences (SSD), or another difference metric. In some feasible implementations, the video encoder 20 may compute values ​​for sub-integer pixel positions of a reference picture stored in the reference picture memory 64. For example, the video encoder 20 may interpolate values ​​for quarter-pixel, eighth-pixel, or other fractional pixel positions of the reference picture. Thus, the motion estimation unit 42 can perform motion searches for 1-pixel and fractional pixel positions and output motion vectors with fractional-pixel precision.

[0104] The motion estimation unit 42 calculates the motion vector of the PU for the video block in the inter-decoded slice by comparing the position of the PU with the position of the predicted block in the reference picture. The reference picture may be selected from a first reference picture list (list 0) or a second reference picture list (list 1). Each item in the list is used to identify one or more reference pictures stored in the reference picture memory 64. The motion estimation unit 42 transmits the calculated motion vector to the entropy coding unit 56 and the motion compensation unit 44.

[0105] Motion compensation performed by the motion compensation unit 44 may include extracting or generating predicted blocks based on motion vectors determined by motion estimation, and interpolation at the subpixel level may be performed. After receiving the motion vector of the current video block from the PU, the motion compensation unit 44 may identify the predicted block pointed to by the motion vector in one of the reference picture lists. The video encoder 20 obtains the residual video block and subtracts the pixel values ​​of the predicted block from the pixel values ​​of the current video block being decoded to obtain the pixel difference. The pixel difference constitutes the residual data of the block and may include both luminance difference components and chrominance difference components. The adder 50 is one or more components that perform subtraction operations. The motion compensation unit 44 may further generate syntax elements associated with the video block and video slice for the video decoder 30 to decode the video block in the video slice.

[0106] If the PU is located in a B-slice, the picture containing the PU may be associated with two reference picture lists called "List 0" and "List 1". In some feasible implementations, the picture containing the B-slice may be associated with a combination of lists, List 0 and List 1.

[0107] In addition, if the PU is located in a B slice, the motion estimation unit 42 may perform unidirectional or bidirectional prediction of the PU. In some feasible implementations, bidirectional prediction is a prediction performed separately based on the pictures in reference picture list 0 and the pictures in reference picture list 1. In some other feasible implementations, bidirectional prediction is a prediction performed separately in display order based on the reconstructed future frame and the reconstructed past frame, which are of the current frame. When the motion estimation unit 42 performs unidirectional prediction of the PU, it may search for the reference block of the PU in the reference pictures in list 0 or list 1. The motion estimation unit 42 may then generate a reference index indicating the reference picture containing the reference block in list 0 or list 1, and a motion vector indicating the spatial displacement between the reference block and the PU. The motion estimation unit 42 may output the reference index, prediction direction identifier, and motion vector as motion information for the PU. The prediction direction identifier may indicate that the reference index points to a reference picture in list 0 or list 1. The motion compensation unit 44 can generate a predicted picture block for the PU based on the reference block indicated by the motion information of the PU.

[0108] When the motion estimation unit 42 performs bidirectional prediction of the PU, it may search for reference blocks of the PU in the reference pictures in List 0 and further search for other reference blocks of the PU in the reference pictures in List 1. Next, the motion estimation unit 42 may generate reference indices indicating reference pictures containing the reference blocks in List 0 and List 1, and motion vectors indicating the spatial displacement between the reference blocks and the PU. The motion estimation unit 42 may output the reference indices and motion vectors of the PU as motion information for the PU. The motion compensation unit 44 may generate predicted picture blocks of the PU based on the reference blocks indicated by the motion information for the PU.

[0109] In some feasible implementations, the motion estimation unit 42 does not output the complete set of motion information for the PU to the entropy coding unit 56. Instead, the motion estimation unit 42 may signal the motion information for a PU by referencing motion information for another PU. For example, the motion estimation unit 42 may determine that the motion information for a PU is similar to the motion information for an adjacent PU. In this implementation, the motion estimation unit 42 may indicate an indicator value in the syntax structure associated with the PU, indicating to the video decoder 30 that the motion information for the PU is the same or can be derived from the motion information for an adjacent PU. In another implementation, the motion estimation unit 42 may identify a candidate predicted motion vector and a difference in motion vectors (MVD) associated with an adjacent PU in the syntax structure associated with the PU. The MVD shows the difference between the motion vector for the PU and the indicated candidate predicted motion vector associated with the adjacent PU. The video decoder 30 may use the indicated candidate predicted motion vector and the MVD to determine the motion vector for the PU.

[0110] As described above, the prediction unit 41 may generate a list of candidate predicted motion vectors for each PU of the CU. One or more of the list of candidate predicted motion vectors may include one or more original candidate predicted motion vectors and one or more additional candidate predicted motion vectors derived from one or more original candidate predicted motion vectors.

[0111] The intra-prediction unit 46 within the prediction unit 41 may perform intra-predictive decoding on the current video block for one or more adjacent blocks in the same picture or slice as the current block being decoded, in order to provide spatial compression. Thus, as an alternative to inter-prediction (as described above) performed by the motion estimation unit 42 and the motion compensation unit 44, the intra-prediction unit 46 may perform intra-prediction on the current block. Specifically, the intra-prediction unit 46 may determine an intra-prediction mode for encoding the current block. In some feasible implementations, the intra-prediction unit 46 may use various intra-prediction modes to encode the current block during a separate coding traversal (e.g.), and the intra-prediction unit 46 (or the mode selection unit 40 in some feasible implementations) may select an appropriate intra-prediction mode from the tested modes.

[0112] After the prediction unit 41 generates a prediction block of the current video block by inter-prediction or intra-prediction, the video encoder 20 subtracts the prediction block from the current video block to obtain the residual video block. The residual video data of the residual block is contained in one or more TUs and can be applied to the transformation processing unit 52. The transformation processing unit 52 performs a transformation, such as a discrete cosine transform (DCT) or a conceptually similar transformation (e.g., discrete sine transform DST), to convert the residual video data into residual transformation coefficients. The transformation processing unit 52 may transform the residual video data from pixel domain data to transformation domain (e.g., frequency domain) data.

[0113] The conversion processing unit 52 may transmit the acquired conversion coefficients to the quantization unit 54. The quantization unit 54 quantizes the conversion coefficients to further reduce the bit rate. The quantization process can reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting the quantization parameters. Next, in some feasible implementations, the quantization unit 54 may scan a matrix containing the quantized conversion coefficients. Alternatively, the entropy coding unit 56 may perform the scan.

[0114] After quantization, the entropy coding unit 56 may perform entropy coding on the quantized transformation coefficients. For example, the entropy coding unit 56 may perform context-adaptive variable-length decoding (CAVLC) or context-adaptive binary arithmetic decoding (CABAC), syntax-based context-adaptive binary arithmetic decoding (SBAC), stochastic interval partitioning entropy (PIPE) decoding, or another entropy coding method or technique. The entropy coding unit 56 may further perform entropy coding on the motion vector and other syntax elements of the current video slice being decoded. After the entropy coding unit 56 has performed entropy coding, the encoded bitstream may be sent to the video decoder 30 or archived for subsequent transmission or re-explosion by the video decoder 30.

[0115] The entropy coding unit 56 may, according to the technology of this application, encode information indicating a selected intra-prediction mode. The video encoder 20 may include in the transmitted bitstream configuration data which may include a plurality of intra-prediction mode index tables and a plurality of modified intra-prediction mode index tables (also called codeword mapping tables), definitions of coding contexts for various blocks, and instructions for the MPM, intra-prediction mode index tables, and modified intra-prediction mode index tables used for each context.

[0116] The inverse quantization unit 58 and the inverse transform unit 60 perform inverse quantization and inverse transform, respectively, to reconstruct the residual block of the pixel region so that it may later be used as a reference block for the reference picture. The motion compensation unit 44 may compute a reference block by adding the residual block and the predicted block in one of the reference pictures in the reference picture list. The motion compensation unit 44 may also apply one or more interpolation filters to the reconstructed residual block to compute sub-integer pixel values ​​for motion estimation. The adder 62 adds the reconstructed residual block and the motion-compensated predicted block generated by the motion compensation unit 44 to generate a reference block, which is stored in the reference picture memory 64. The reference block may be used by the motion estimation unit 42 and the motion compensation unit 44 as a reference block for performing interpretation on blocks of subsequent video frames or pictures.

[0117] Figure 3 is a schematic block diagram of a video decoder 30 according to one embodiment of the present application. In the feasible implementation shown in Figure 3, the video decoder 30 comprises an entropy decoding unit 80, a prediction unit 81, an inverse quantization unit 86, an inverse transform unit 88, an adder 90, and a reference picture memory 92. The prediction unit 81 comprises a motion compensation unit 82 and an intra-prediction unit 84. In some feasible implementations, the video decoder 30 may perform an exemplary decoding process that is the reverse of the encoding process described with respect to the video encoder 20 in Figure 4.

[0118] During decoding, the video decoder 30 receives from the video encoder 20 an encoded video bitstream representing a video block of the encoded video slice, along with associated syntax elements. The entropy coding unit 80 of the video decoder 30 performs entropy decoding on the bitstream to generate quantized coefficients, motion vectors, and other syntax elements. The entropy coding unit 80 transfers the motion vectors and other syntax elements to the prediction unit 81. The video decoder 30 may receive syntax elements at the video slice level and / or video block level.

[0119] When a video slice is decoded into an intra-decoded (I) slice, the intra-prediction unit 84 of the prediction unit 81 may generate prediction data for the video block of the current video slice based on the signaled intra-prediction mode and the data of the previously decoded block of the current frame or picture.

[0120] When a video picture is decoded into an inter-decoded slice (e.g., a B slice, a P slice, or a GPB slice), the motion compensation unit 82 of the prediction unit 81 generates a prediction block of the video block of the current video picture based on the motion vector and other syntax elements received from the entropy coding unit 80. The prediction block may be generated from one reference picture in one of the reference picture lists. The video decoder 30 may use default construction techniques to construct the reference picture lists (list 0 and list 1) based on the reference pictures stored in the reference picture memory 92.

[0121] The motion compensation unit 82 analyzes motion vectors and other syntax elements to determine the prediction information for the video blocks of the current video slice and uses the prediction information to generate the prediction blocks of the current video block being decoded. For example, the motion compensation unit 82 uses some of the received syntax elements to determine the prediction mode for decoding the video blocks of the video slice (e.g., intra-prediction or inter-prediction), the inter-prediction slice type (e.g., B-slice, P-slice, or GPB-slice), one or more configuration pieces of reference picture list for the slice, the motion vector for each inter-encoded video block of the slice, the inter-prediction state for each inter-decoded video block of the slice, and other information for decoding the video blocks of the current video slice.

[0122] The motion compensation unit 82 may perform further interpolation by using an interpolation filter. The motion compensation unit 82 may use, for example, an interpolation filter used by the video encoder 20 during video block coding to calculate the interpolated values ​​of the sub-integer pixels of the reference block. In this application, the motion compensation unit 82 may determine the interpolation filter used by the video encoder 20 based on the received syntax elements and use the interpolation filter to generate a predicted block.

[0123] If the PU is encoded by interpretation, the motion compensation unit 82 may generate a list of candidate predicted motion vectors for the PU. The bitstream may contain data for identifying the position of a selected candidate predicted motion vector within the list of candidate predicted motion vectors for the PU. After generating the candidate predicted motion vectors for the PU, the motion compensation unit 82 may generate a predicted picture block for the PU based on one or more reference blocks indicated by the motion information of the PU. The reference blocks for the PU may be located in a time picture different from the time picture of the PU. The motion compensation unit 82 may determine the motion information of the PU based on the selected motion information within the list of candidate predicted motion vectors for the PU.

[0124] The inverse quantization unit 86 performs inverse quantization (e.g., dequantization) on the quantized transformation coefficients provided in the bitstream and decoded by the entropy coding unit 80. The inverse quantization process may include the steps of determining the degree of quantization based on the quantization parameters calculated by the video encoder 20 for each video block in the video slice, and similarly determining the inverse quantization to be applied. The inverse transformation unit 88 performs an inverse transformation (e.g., inverse DCT, inverse integer transformation, or a conceptually similar inverse transformation process) on the transformation coefficients to generate pixel region residual blocks.

[0125] After the motion compensation unit 82 generates a predicted block for the current video block based on the motion vector and other syntax elements, the video decoder 30 adds the residual block from the inverse unit 88 and the corresponding predicted block generated by the motion compensation unit 82 to constitute the decoded video block. The adder 90 is one or more components that perform the addition operation. Deblocking filters may be further used to filter the decoded block to remove blocking artifacts, if necessary. Another loop filter may be further used (in the decoding loop or later) to smooth pixels, or the video quality may be improved in other ways. The decoded video block in a given frame or picture is then stored in the reference picture memory 92. The reference picture memory 92 stores reference pictures to be used for subsequent motion compensation. The reference picture memory 92 further stores the decoded video so that it may be later displayed on a display device such as the display device 32 in Figure 1.

[0126] As described above, the technology of this application relates, for example, to inter-decoding. The technology of this application may be performed by any video codec described in this application, and it should be understood that the video decoder includes (for example) the video encoder 20 and video decoder 30 shown and described in Figures 1 to 3. Specifically, in a feasible implementation, the prediction unit 41 shown in Figure 2 may perform certain techniques described below when inter-prediction is performed while encoding blocks of video data. In another feasible implementation, the prediction unit 81 shown in Figure 3 may perform certain techniques described below when inter-prediction is performed while decoding blocks of video data. Thus, a general reference to “video encoder” or “video decoder” may include video encoder 20, video decoder 30, or another video encoding unit or decoding unit.

[0127] Figure 4 is a schematic block diagram of an interpretation module according to one embodiment of the present application. The interpretation module 121 may comprise, for example, a motion estimation unit 42 and a motion compensation unit 44. The relationship between the PU and CU varies depending on the video compression encoding standard. The interpretation module 121 may divide the current CU into PUs according to a plurality of division patterns. For example, the interpretation module 121 may divide the current CU into PUs according to division patterns of 2N×2N, 2N×N, N×2N, and N×N. In another embodiment, the current CU is the current PU, and this is not limited thereto.

[0128] The interpretation module 121 may perform an integer motion estimation (IME) for each PU, and then a fractional motion estimation (FME). When the interpretation module 121 performs an IME on a PU, it may search for one or more reference pictures of the PU's reference blocks. After finding the PU's reference blocks, the interpretation module 121 may generate motion vectors that represent the spatial displacement between the PU and its reference blocks with integer precision. When the interpretation module 121 performs an FME on a PU, it may improve the motion vectors generated by performing an IME on the PU. The motion vectors generated by performing an FME on the PU may have sub-integer precision (e.g., 1 / 2 pixel precision or 1 / 4 pixel precision). After generating the PU's motion vectors, the interpretation module 121 may generate predicted picture blocks of the PU by using the PU's motion vectors.

[0129] In several feasible implementations in which the interpretation module 121 signals PU motion information to the decoder in AMVP mode, the interpretation module 121 may generate a list of candidate predicted motion vectors for the PU. The list of candidate predicted motion vectors may include one or more original candidate predicted motion vectors and one or more additional candidate predicted motion vectors derived from the one or more original candidate predicted motion vectors. After generating the list of candidate predicted motion vectors for the PU, the interpretation module 121 may select a candidate predicted motion vector from the list and generate a difference in motion vectors (MVD) for the PU. The MVD for the PU may show the difference between the motion vector indicated by the selected candidate predicted motion vector and the motion vector generated for the PU by the IME and FME. In these feasible implementations, the interpretation module 121 may output a candidate predicted motion vector index that identifies the position of the selected candidate predicted motion vector in the list of candidate predicted motion vectors. The interpretation module 121 may further output the MVD for the PU. The following describes in detail the feasible implementations of the Advanced Motion Vector Prediction (AMVP) mode shown in Figure 6 of this embodiment of the present application.

[0130] In addition to performing IME and FME on the PU to generate PU motion information, the interpretation module 121 may further perform a merge operation on the PU. When the interpretation module 121 performs a merge operation on the PU, it may generate a list of candidate predicted motion vectors for the PU. The list of candidate predicted motion vectors for the PU may include one or more original candidate predicted motion vectors and one or more additional candidate predicted motion vectors derived from one or more original candidate predicted motion vectors. The original candidate predicted motion vectors in the list of candidate predicted motion vectors may include one or more spatial candidate predicted motion vectors and temporal candidate predicted motion vectors. The spatial candidate predicted motion vector may indicate motion information for another PU of the current picture. The temporal candidate predicted motion vector may be based on the motion information of a corresponding PU of a picture different from the current picture. The temporal candidate predicted motion vector is sometimes called a time motion vector prediction (TMVP).

[0131] After generating a list of candidate predicted motion vectors, the interpretation module 121 may select one candidate predicted motion vector from the list. Next, the interpretation module 121 may generate a predicted picture block for the PU based on the reference block indicated by the motion information of the PU. In merge mode, the motion information of the PU may be the same as the motion information indicated by the selected candidate predicted motion vector. Figure 5, described below, is a flowchart of an example of merge mode.

[0132] After generating predicted picture blocks for the PU using IME and FME, and generating predicted picture blocks for the PU through a merge operation, the interprediction module 121 may select between the predicted picture blocks generated by performing an FME operation and the predicted picture blocks generated by performing a merge operation. In some feasible implementations, the interprediction module 121 may select between the predicted picture blocks for the PU by analyzing the rate distortion costs of the predicted picture blocks generated by performing an FME operation and the predicted picture blocks generated by performing a merge operation.

[0133] After the interprediction module 121 selects predicted picture blocks of PUs generated by partitioning the current CU according to each partitioning pattern (in some implementations, after the coding tree unit CTU is partitioned into CUs, the CUs are not partitioned into any smaller PUs, in which case the PUs are equivalent to the CUs), the interprediction module 121 may select a partitioning pattern for the current CU. In some implementations, the interprediction module 121 may select a partitioning pattern for the current CU by analyzing the rate distortion cost of the selected predicted picture blocks of PUs generated by partitioning the current CU according to each partitioning pattern. The interprediction module 121 may output the predicted picture blocks associated with the PUs belonging to the selected partitioning pattern to the residual generation module 102. The interprediction module 121 may output the syntax elements of the motion information of the PUs belonging to the selected partitioning pattern to the entropy coding module 116.

[0134] In the schematic diagram shown in Figure 4, the interpretation module 121 may include IME modules 180A to 180N (collectively referred to as "IME module 180"), FME modules 182A to 182N (collectively referred to as "FME module 182"), merge modules 184A to 184N (collectively referred to as "merge module 184"), PU pattern determination modules 186A to 186N (collectively referred to as "PU pattern determination module 186"), and CU pattern determination module 188 (which may also perform a pattern determination process from CTU to CU).

[0135] The IME module 180, FME module 182, and merge module 184 can perform IME operations, FME operations, and merge operations, respectively, on the PU of the current CU. In the schematic diagram shown in Figure 4, the interpretation module 121 is described as including a separate IME module 180, a separate FME module 182, and a separate merge module 184 for each PU in each partition pattern of the CU. In another feasible implementation, the interpretation module 121 does not include a separate IME module 180, a separate FME module 182, or a separate merge module 184 for each PU in each partition pattern of the CU.

[0136] As shown in the schematic diagram in Figure 4, the IME module 180A, FME module 182A, and merge module 184A can perform IME operations, FME operations, and merge operations, respectively, on the PUs generated by dividing the CUs according to a 2N × 2N division pattern. The PU pattern determination module 186A can select one of the predicted picture blocks generated by the IME module 180A, FME module 182A, and merge module 184A.

[0137] The IME module 180B, FME module 182B, and merge module 184B can perform IME operations, FME operations, and merge operations, respectively, on the left PU generated by dividing the CU according to an N × 2N division pattern. The PU pattern determination module 186B can select one of the predicted picture blocks generated by the IME module 180B, FME module 182B, and merge module 184B.

[0138] The IME module 180C, FME module 182C, and merge module 184C can perform IME operations, FME operations, and merge operations, respectively, on the right-hand PU generated by dividing the CU according to an N × 2N division pattern. The PU pattern determination module 186C can select one of the predicted picture blocks generated by the IME module 180C, FME module 182C, and merge module 184C.

[0139] The IME module 180N, FME module 182N, and merge module 184N can perform IME operations, FME operations, and merge operations, respectively, on the lower right PU generated by dividing the CU according to an N×N division pattern. The PU pattern determination module 186N can select one of the predicted picture blocks generated by the IME module 180N, FME module 182N, and merge module 184N.

[0140] The PU pattern determination module 186 can select a predictive picture block by analyzing the rate distortion cost of multiple possible predictive picture blocks, and can select a predictive picture block that provides the optimal rate distortion cost in a given decoding scenario. For example, in an application with limited bandwidth, the PU pattern determination module 186 can select a predictive picture block that increases the compression ratio, and in another application, the PU pattern determination module 186 can select a predictive picture block that improves the quality of the reconstructed video. After the PU pattern determination module 186 has selected a predictive picture block for the PU of the current CU, the CU pattern determination module 188 selects a division pattern for the current CU and outputs the predictive picture blocks and motion information of the PU belonging to the selected division pattern.

[0141] Figure 5 is a flowchart of an example of a merge mode according to one embodiment of the present application. A video encoder (e.g., video encoder 20) may perform a merge operation 200. In another feasible implementation, the video encoder may perform a merge operation different from the merge operation 200. For example, in another feasible implementation, the video encoder may perform a merge operation, which may involve more or fewer steps than those of the merge operation 200, or steps different from those of the merge operation 200. In another feasible implementation, the video encoder may perform the steps of the merge operation 200 in a different order or in parallel. The encoder may further perform a merge operation 200 on PUs encoded in skip mode.

[0142] After the video encoder initiates merge operation 200, the video encoder may generate a list of candidate predicted motion vectors for the current PU (202). The video encoder may generate the list of candidate predicted motion vectors for the current PU in various ways. For example, the video encoder may generate the list of candidate predicted motion vectors for the current PU according to one of the exemplary techniques described below in relation to Figures 8 to 12.

[0143] As described above, the current PU candidate predicted motion vector list may include time candidate predicted motion vectors. Time candidate predicted motion vectors may indicate motion information of co-located PUs in the corresponding time domain. Co-located PUs may be spatially positioned at the same location as the current PU in the picture frame of a reference picture, instead of the current picture. In this application, a reference picture containing the corresponding time domain PU may be referred to as an associated reference picture. In this application, the reference picture index of an associated reference picture may be referred to as an associated reference picture index. As described above, the current picture may be associated with one or more reference picture lists (e.g., List 0 and List 1). A reference picture index may indicate a reference picture by indicating its location within the reference picture list. In some feasible implementations, the current picture may be associated with a combined list of reference pictures.

[0144] In some video encoders, the associated reference picture index is the reference picture index of the PU that covers the reference index source location associated with the current PU. In these video encoders, the reference index source location associated with the current PU is adjacent to the left of the current PU or adjacent to the top of the current PU. In this application, a PU may "cover" a particular location if the picture block associated with the PU includes that location. In these video encoders, if the reference index source location is unavailable, the video encoder may use reference picture index 0.

[0145] However, in one example, the reference index source location associated with the current PU is located within the current CU. In this example, a PU covering the reference index source location associated with the current PU may be considered available if the PU is located above or to the left of the current CU. In this case, the video encoder may need to access motion information of another PU in the current CU to determine the reference picture containing the co-located PU. Thus, these video encoders may use motion information of PUs belonging to the current CU (e.g., reference picture index) to generate the time-candidate predicted motion vector for the current PU. In other words, these video encoders may use motion information of PUs belonging to the current CU to generate the time-candidate predicted motion vector. Therefore, the video encoder may not be able to generate a list of candidate predicted motion vectors for the current PU and the PUs covering the reference index source location associated with the current PU in parallel.

[0146] According to the technology of this application, a video encoder may explicitly set a relevant reference picture index without referring to the reference picture index of another PU. In this way, the video encoder may generate candidate predicted motion vector lists for the current PU and other PUs of the current CU in parallel. Because the video encoder explicitly sets the relevant reference picture index, the relevant reference picture index is not based on motion information of other PUs of the current CU. In some feasible implementations in which the video encoder explicitly sets the relevant reference picture index, the video encoder may always set the relevant reference picture index to a fixed, pre-set reference picture index (e.g., 0). In this way, the video encoder may generate time candidate predicted motion vectors based on the motion information of co-located PUs in the reference frame indicated by the pre-set reference picture index, and these time candidate predicted motion vectors may be included in the candidate predicted motion vector list of the current CU.

[0147] In a feasible implementation where the video encoder explicitly sets the relevant reference picture index, the video encoder may explicitly signal the relevant reference picture index in a syntax structure (e.g., picture header, slice header, APS, or another syntax structure). In this feasible implementation, the video encoder may signal the decoder the relevant reference picture index for each LCU (i.e., CTU), CU, PU, ​​TU, or another type of subblock. For example, the video encoder may signal that the relevant reference picture index for each PU in the CU is equal to "1".

[0148] In some feasible implementations, the relevant reference picture index may be set implicitly rather than explicitly. In these feasible implementations, the video encoder may generate each time candidate predicted motion vector in the list of candidate predicted motion vectors for the current CU's PU by using the motion information of the PU of the reference picture indicated by the reference picture index of the PU that covers these locations outside the current CU, even if the locations outside the current CU are not strictly adjacent to the current PU.

[0149] After generating a list of candidate predicted motion vectors for the current PU, the video encoder may generate predicted picture blocks associated with the candidate predicted motion vectors in the list (204). The video encoder may determine the motion information for the current PU based on the motion information of the indicated candidate predicted motion vectors, and then generate predicted picture blocks based on one or more reference blocks indicated by the motion information for the current PU in order to generate predicted picture blocks associated with the candidate predicted motion vectors. The video encoder may then select one candidate predicted motion vector from the list (206). The video encoder may select a candidate predicted motion vector in various ways. For example, the video encoder may select one candidate predicted motion vector by analyzing the rate distortion cost of each predicted picture block associated with the candidate predicted motion vector.

[0150] After selecting a candidate predicted motion vector, the video encoder may output a candidate predicted motion vector index (208). The candidate predicted motion vector index may indicate the position of the selected candidate predicted motion vector within the list of candidate predicted motion vectors. In some feasible implementations, the candidate predicted motion vector index may be represented as "merge_idx".

[0151] Figure 6 is a flowchart of an example of an advanced motion vector prediction (AMVP) mode according to one embodiment of the present application. A video encoder (e.g., video encoder 20) can perform the AMVP operation 210.

[0152] After the video encoder initiates AMVP operation 210, the video encoder may generate one or more motion vectors for the current PU (211). The video encoder may perform integer motion estimation and fractional motion estimation to generate the motion vector for the current PU. As described above, the current picture may be associated with two reference picture lists (list 0 and list 1). If the current PU is predicted unidirectionally, the video encoder may generate the motion vector for list 0 or the motion vector for list 1 for the current PU. The motion vector for list 0 may represent the spatial displacement between the picture block corresponding to the current PU and the reference block of the reference picture in list 0. The motion vector for list 1 may represent the spatial displacement between the picture block corresponding to the current PU and the reference block of the reference picture in list 1. If the current PU is predicted bidirectionally, the video encoder may generate the motion vector for list 0 and the motion vector for list 1 for the current PU.

[0153] After generating one or more motion vectors for the current PU, the video encoder may generate a predicted picture block for the current PU (212). The video encoder may generate a predicted picture block for the current PU based on one or more reference blocks indicated by one or more motion vectors for the current PU.

[0154] In addition, the video encoder may generate a list of candidate predicted motion vectors for the current PU (213). The video encoder may generate a list of candidate predicted motion vectors for the current PU in various ways. For example, the video encoder may generate a list of candidate predicted motion vectors for the current PU according to one or more of the feasible implementations described below in relation to Figures 8 to 12. In some feasible implementations, if the video encoder generates a list of candidate predicted motion vectors in AMVP operation 210, the list of candidate predicted motion vectors may be limited to two candidate predicted motion vectors. In contrast, if the video encoder generates a list of candidate predicted motion vectors in a merge operation, the list of candidate predicted motion vectors may contain more candidate predicted motion vectors (e.g., five candidate predicted motion vectors).

[0155] After generating a list of candidate predicted motion vectors for the current PU, the video encoder may generate a difference (MVD) of one or more motion vectors for each candidate predicted motion vector in the list (214). To generate a difference of motion vectors for a candidate predicted motion vector, the video encoder may determine the difference between the motion vector indicated by the candidate predicted motion vector and the corresponding motion vector of the current PU.

[0156] If the current PU is predicted in one direction, the video encoder may generate a single MVD for each candidate predicted motion vector. If the current PU is predicted in both directions, the video encoder may generate two MVDs for each candidate predicted motion vector. The first MVD may show the difference between the motion vector indicated by the candidate predicted motion vector and the motion vector in List 0 of the current PU. The second MVD may show the difference between the motion vector indicated by the candidate predicted motion vector and the motion vector in List 1 of the current PU.

[0157] The video encoder may select one or more candidate predicted motion vectors from a list of candidate predicted motion vectors (215). The video encoder may select one or more candidate predicted motion vectors in various ways. For example, the video encoder may select a candidate predicted motion vector that matches the associated motion vector of the motion vector to be encoded with the least error. This can reduce the number of bits required to represent the difference between the candidate predicted motion vector and the motion vector.

[0158] After selecting one or more candidate predicted motion vectors, the video encoder may output one or more reference picture indices of the current PU, one or more candidate predicted motion vector indices of the current PU, and the difference between one or more motion vectors of the one or more selected candidate predicted motion vectors (216).

[0159] In an example where the current picture is associated with two reference picture lists (List 0 and List 1) and the current PU is predicted in one direction, the video encoder may output the reference picture index of List 0 ("ref_idx_10") or the reference picture index of List 1 ("ref_idx_11"). The video encoder may further output a candidate predicted motion vector index ("mvp_10_flag") indicating the position of the selected candidate predicted motion vector for the motion vector of List 0 of the current PU in the candidate predicted motion vector list. Alternatively, the video encoder may output a candidate predicted motion vector index ("mvp_11_flag") indicating the position of the selected candidate predicted motion vector for the motion vector of List 1 of the current PU in the candidate predicted motion vector list. The video encoder may further output the MVD of the motion vector of List 0 or List 1 of the current PU.

[0160] In an example where the current picture is associated with two reference picture lists (List 0 and List 1) and the current PU is predicted bidirectionally, the video encoder may output the reference picture index of List 0 ("ref_idx_10") and the reference picture index of List 1 ("ref_idx_11"). The video encoder may further output a candidate predicted motion vector index ("mvp_10_flag") indicating the position of the selected candidate predicted motion vector for the motion vector of List 0 of the current PU within the candidate predicted motion vector list. In addition, the video encoder may output a candidate predicted motion vector index ("mvp_11_flag") indicating the position of the selected candidate predicted motion vector for the motion vector of List 1 of the current PU within the candidate predicted motion vector list. The video encoder may further output the MVD of the motion vector of List 0 of the current PU and the MVD of the motion vector of List 1 of the current PU.

[0161] Figure 7 is a flowchart of an example of motion compensation performed by a video decoder (e.g., video decoder 30) according to one embodiment of the present application.

[0162] When the video decoder performs motion compensation operation 220, the video decoder may receive an indication of the selected candidate predicted motion vector for the current PU (222). For example, the video decoder may receive a candidate predicted motion vector index indicating the position of the selected candidate predicted motion vector in the list of candidate predicted motion vectors for the current PU.

[0163] If the motion information of the current PU is encoded in AMVP mode and the current PU is predicted bidirectionally, the video decoder may receive a first candidate predicted motion vector index and a second candidate predicted motion vector index. The first candidate predicted motion vector index indicates the position of the selected candidate predicted motion vector for the motion vector of List 0 of the current PU in the candidate predicted motion vector list. The second candidate predicted motion vector index indicates the position of the selected candidate predicted motion vector for the motion vector of List 1 of the current PU in the candidate predicted motion vector list. In some feasible implementations, a single syntax element may be used to identify the two candidate predicted motion vector indices.

[0164] In addition, the video decoder may generate a list of candidate predicted motion vectors for the current PU (224). The video decoder may generate a list of candidate predicted motion vectors for the current PU in various ways. For example, the video decoder may generate a list of candidate predicted motion vectors for the current PU by using the techniques described below in relation to Figures 8 to 12. When the video decoder generates the time candidate predicted motion vectors for the candidate predicted motion vector list, the video decoder may explicitly or implicitly set a reference picture index that identifies a reference picture containing a co-located PU, as selected above in relation to Figure 5.

[0165] After generating a list of candidate predicted motion vectors for the current PU, the video decoder may determine the motion information for the current PU based on the motion information indicated by one or more selected candidate predicted motion vectors in the list of candidate predicted motion vectors for the current PU (225). For example, if the motion information for the current PU is encoded in merge mode, the motion information for the current PU may be the same as the motion information indicated by the selected candidate predicted motion vectors. If the motion information for the current PU is encoded in AMVP mode, the video decoder may reconstruct one or more motion vectors for the current PU by using one or more motion vectors indicated by one or more selected candidate predicted motion vectors and one or more MVDs indicated in the bitstream. The reference picture index and predicted direction identifier for the current PU may be the same as the reference picture index and predicted direction identifier of one or more selected candidate predicted motion vectors. After determining the motion information for the current PU, the video decoder may generate a predicted picture block for the current PU based on one or more reference blocks indicated by the motion information for the current PU (226).

[0166] Figure 8 is a schematic diagram of an example of an encoding unit (CU) and an adjacent position picture block associated with the encoding unit according to one embodiment of the present application. Figure 8 is a schematic diagram for showing CU250 and schematic candidate predicted motion vector positions 252A to 252E associated with CU250. In the present application, candidate predicted motion vector positions 252A to 252E may be collectively referred to as candidate predicted motion vector positions 252. Candidate predicted motion vector positions 252 represent spatial candidate predicted motion vectors in the same picture as CU250. Candidate predicted motion vector position 252A is located to the left of CU250. Candidate predicted motion vector position 252B is located above CU250. Candidate predicted motion vector position 252C is located to the upper right of CU250. Candidate predicted motion vector position 252D is located to the lower left of CU250. Candidate predicted motion vector position 252E is located to the upper left of CU250. Figure 8 shows a schematic implementation of a scheme in which the interpretation module 121 and the motion compensation module 162 can generate a list of candidate predicted motion vectors. This implementation will be described below in relation to the interpretation module 121. However, it should be understood that the motion compensation module 162 can implement the same technique and therefore generate the same list of candidate predicted motion vectors. In this embodiment of the present application, the picture block in which the candidate predicted motion vector positions are located is called a reference block. In addition, the reference block includes a spatial reference block, e.g., the picture block in which 252A to 252E are located, and a temporal reference block, e.g., the picture block in which the co-located block is located, or the spatially adjacent picture block of the co-located block.

[0167] Figure 9 is a flowchart illustrating an example of constructing a list of candidate predicted motion vectors according to one embodiment of the present application. The technique in Figure 9 is described based on a list containing five candidate predicted motion vectors, but the technique described herein may be used alternatively with lists of different sizes. The five candidate predicted motion vectors may each have an index (e.g., 0 to 4). The technique in Figure 9 is described based on a general video decoder. A general video decoder may be, for example, a video encoder (e.g., video encoder 20) or a video decoder (e.g., video decoder 30).

[0168] To reconstruct the list of candidate predicted motion vectors according to the implementation in Figure 9, the video decoder first considers four spatial candidate predicted motion vectors (902). The four spatial candidate predicted motion vectors may include candidate predicted motion vector positions 252A, 252B, 252C, and 252D. The four spatial candidate predicted motion vectors may correspond to motion information of four PUs located in the same picture as the current CU (e.g., CU250). The video decoder may consider the four spatial candidate predicted motion vectors in the list in a specified order. For example, candidate predicted motion vector position 252A may be considered first. If candidate predicted motion vector position 252A is available, it may be assigned to index 0. If candidate predicted motion vector position 252A is not available, the video decoder may not add it to the candidate predicted motion vector list. Candidate predicted motion vector positions may be unavailable for various reasons. For example, if a candidate predicted motion vector position is not located within the current picture, the candidate predicted motion vector position may be unavailable. In another feasible implementation, if the candidate predicted motion vector position undergoes intraprediction, the candidate predicted motion vector position may be unavailable. In another feasible implementation, if the candidate predicted motion vector position is located in a slice different from the current CU slice, the candidate predicted motion vector position may be unavailable.

[0169] After considering candidate predicted motion vector position 252A, the video decoder may consider candidate predicted motion vector position 252B. If candidate predicted motion vector position 252B is available and different from candidate predicted motion vector position 252A, the video decoder may add candidate predicted motion vector position 252B to the candidate predicted motion vector list. In this particular context, the terms “same” or “different” mean that the motion information associated with the candidate predicted motion vector positions is the same or different. Therefore, if two candidate predicted motion vector positions have the same motion information, the two candidate predicted motion vector positions are considered the same; if two candidate predicted motion vector positions have different motion information, the two candidate predicted motion vector positions are considered different. If candidate predicted motion vector position 252A is unavailable, the video decoder may assign candidate predicted motion vector position 252B to index 0. If candidate predicted motion vector position 252A is available, the video decoder may assign candidate predicted motion vector position 252 to index 1. If candidate predicted motion vector position 252B is unavailable or is the same as candidate predicted motion vector position 252A, the video decoder skips adding candidate predicted motion vector position 252B to the candidate predicted motion vector list.

[0170] Similarly, the video decoder considers the candidate predicted motion vector position 252C to determine whether to add it to the list. If the candidate predicted motion vector position 252C is available and different from the candidate predicted motion vector positions 252B and 252A, the video decoder can assign the candidate predicted motion vector position 252C to the next available index. If the candidate predicted motion vector position 252C is unavailable or is the same as at least one of the candidate predicted motion vector positions 252A and 252B, the video decoder does not add the candidate predicted motion vector position 252C to the list of candidate predicted motion vectors. Next, the video decoder considers the candidate predicted motion vector position 252D. If the candidate predicted motion vector position 252D is available and different from the candidate predicted motion vector positions 252A, 252B, and 252C, the video decoder can assign the candidate predicted motion vector position 252D to the next available index. If candidate predicted motion vector position 252D is unavailable or is the same as at least one of candidate predicted motion vector positions 252A, 252B, and 252C, the video decoder does not add candidate predicted motion vector position 252D to the candidate predicted motion vector list. The above implementation outlines an example in which candidate predicted motion vector positions 252A-252D are considered to determine whether or not they should be included in the candidate predicted motion vector list. However, in some implementations, all candidate predicted motion vector positions 252A-252D may be initially added to the candidate predicted motion vector list, and then any duplicate candidate predicted motion vector positions may be removed from the list.

[0171] After the video decoder has considered the first four spatial candidate predicted motion vectors, the candidate predicted motion vector list may contain four spatial candidate predicted motion vectors, or it may contain fewer than four spatial candidate predicted motion vectors. If the list contains four spatial candidate predicted motion vectors (904, yes), the video decoder considers the temporal candidate predicted motion vector (906). The temporal candidate predicted motion vector may correspond to motion information of a co-located PU of a picture different from the current picture. If the temporal candidate predicted motion vector is available and different from the first four spatial candidate predicted motion vectors, the video decoder assigns the temporal candidate predicted motion vector to index 4. If the temporal candidate predicted motion vector is unavailable or is the same as one of the first four spatial candidate predicted motion vectors, the video decoder does not add the temporal candidate predicted motion vector to the candidate predicted motion vector list. Therefore, after the video decoder has considered the time-predicted candidate motion vectors (906), the list of candidate-predicted motion vectors may contain five candidate-predicted motion vectors (the first four spatial candidate-predicted motion vectors considered in 902 and the time-predicted candidate-predicted motion vector considered in 906) or four candidate-predicted motion vectors (the first four spatial candidate-predicted motion vectors considered in 902). If the list of candidate-predicted motion vectors contains five candidate-predicted motion vectors (908, yes), the video decoder completes the construction of the list.

[0172] If the list of candidate predicted motion vectors contains four candidate predicted motion vectors (908, no), the video decoder may consider a fifth spatial candidate predicted motion vector (910). The fifth spatial candidate predicted motion vector may correspond to (for example) a candidate predicted motion vector position 252E. If a candidate predicted motion vector at position 252E is available and different from the candidate predicted motion vectors at positions 252A, 252B, 252C, and 252D, the video decoder may add the fifth spatial candidate predicted motion vector to the list of candidate predicted motion vectors and assign the fifth spatial candidate predicted motion vector to index 4. If a candidate predicted motion vector at position 252E is not available, or if it is the same as the candidate predicted motion vectors at positions 252A, 252B, 252C, and 252D, the video decoder may not add the candidate predicted motion vector at position 252E to the list of candidate predicted motion vectors. Therefore, after the fifth spatial candidate predicted motion vector has been considered (910), the list may contain five candidate predicted motion vectors (the first four spatial candidate predicted motion vectors considered in 902 and the fifth spatial candidate predicted motion vector considered in 910), or it may contain four candidate predicted motion vectors (the first four spatial candidate predicted motion vectors considered in 902).

[0173] If the list of candidate predicted motion vectors contains five candidate predicted motion vectors (912, yes), the video decoder completes the generation of the list of candidate predicted motion vectors. If the list of candidate predicted motion vectors contains four candidate predicted motion vectors (912, no), the video decoder adds artificially generated candidate predicted motion vectors (914) until the list contains five candidate predicted motion vectors (916, yes).

[0174] After the video decoder has considered the first four spatial candidate predicted motion vectors, if the list contains fewer than four spatial candidate predicted motion vectors (904, no), the video decoder may consider a fifth spatial candidate predicted motion vector (918). The fifth spatial candidate predicted motion vector may correspond to (for example) a candidate predicted motion vector position 252E. If a candidate predicted motion vector at position 252E is available and different from an existing candidate predicted motion vector in the list of candidate predicted motion vectors, the video decoder may add the fifth spatial candidate predicted motion vector to the list of candidate predicted motion vectors and assign the fifth spatial candidate predicted motion vector to the next available index. If a candidate predicted motion vector at position 252E is not available or is the same as one of the existing candidate predicted motion vectors in the list of candidate predicted motion vectors, the video decoder may not add the candidate predicted motion vector at position 252E to the list of candidate predicted motion vectors. Next, the video decoder may consider a temporal candidate predicted motion vector (920). If a time-predicted motion vector is available and differs from an existing candidate motion vector in the candidate motion vector list, the video decoder can add the time-predicted motion vector to the candidate motion vector list and assign it to the next available index. If a time-predicted motion vector is not available or is the same as one of the existing candidate motion vectors in the candidate motion vector list, the video decoder may not add the time-predicted motion vector to the candidate motion vector list.

[0175] After the fifth spatial candidate predicted motion vector (in 918) and the temporal candidate predicted motion vector (in 920) have been considered, if the candidate predicted motion vector list contains five candidate predicted motion vectors (922, yes), the video decoder completes the generation of the candidate predicted motion vector list. If the candidate predicted motion vector list contains fewer than five candidate predicted motion vectors (922, no), the video decoder adds artificially generated candidate predicted motion vectors (914) until the list contains five candidate predicted motion vectors (916, yes).

[0176] According to the technology of this application, additional merge candidate predicted motion vectors can be artificially generated after the spatial candidate predicted motion vectors and the temporal candidate predicted motion vectors, such that the size of the merge candidate predicted motion vector list is fixed and equal to a specified number of merge candidate predicted motion vectors (e.g., five in the feasible implementation shown in Figure 9 above). Examples of additional merge candidate predicted motion vectors may include a combined bipredicted merge candidate predicted motion vector (candidate predicted motion vector 1), a scaled bipredicted merge candidate predicted motion vector (candidate predicted motion vector 2), and a zero vector merge / AMVP candidate predicted motion vector (candidate predicted motion vector 3).

[0177] Figure 10 is a schematic diagram of an example of adding a combined candidate motion vector to a merged mode candidate predicted motion vector list according to one embodiment of the present application. A combined dual-prediction merged candidate predicted motion vector can be generated by combining the original merged candidate predicted motion vectors. Specifically, two original candidate predicted motion vectors (having mvL0 and refIdxL0 or mvL1 and refIdxL1) can be used to generate a dual-prediction merged candidate predicted motion vector. In Figure 10, two candidate predicted motion vectors are included in the original merged candidate predicted motion vector list. The prediction type of one candidate predicted motion vector is unidirectional prediction using List 0, and the prediction type of the other candidate predicted motion vector is unidirectional prediction using List 1. In this feasible implementation, mvL0_A and ref0 are obtained from List 0, and mvL1_B and ref0 are obtained from List 1. Next, a dual-prediction merge candidate predicted motion vector (having mvL0_A and ref0 in List 0, and mvL1_B and ref0 in List 1) may be generated, and it is checked whether the dual-prediction merge candidate predicted motion vector is different from an existing candidate predicted motion vector in the candidate predicted motion vector list. If the dual-prediction merge candidate predicted motion vector is different from an existing candidate predicted motion vector, the video decoder may add the dual-prediction merge candidate predicted motion vector to the candidate predicted motion vector list.

[0178] Figure 11 is a schematic diagram of an example of adding a scaled candidate motion vector to a merge mode candidate predicted motion vector list according to one embodiment of the present application. A scaled biprediction merge candidate predicted motion vector can be generated by scaling the original merge candidate predicted motion vector. Specifically, one original candidate predicted motion vector (having mvLX and refIdxLX) can be used to generate a biprediction merge candidate predicted motion vector. In the feasible implementation of Figure 11, two candidate predicted motion vectors are included in the original merge candidate predicted motion vector list. The prediction type of one candidate predicted motion vector is unidirectional prediction using List 0, and the prediction type of the other candidate predicted motion vector is unidirectional prediction using List 1. In this feasible implementation, mvL0_A and ref0 are taken from List 0, and ref0 may be duplicated in List 1 and shown as reference index ref0'. Next, mvL0'_A may be calculated by scaling mvL0_A with ref0 and ref0'. Scaling may depend on the Picture Order Count (POC) distance. Next, a list of predicted motion vectors for the dual-prediction merge candidate (having mvL0_A and ref0 in List 0, and mvL0'_A and ref0' in List 1) may be generated, and it is checked whether the dual-prediction merge candidate motion vectors overlap. If the dual-prediction merge candidate motion vectors do not overlap, they may be added to the merge candidate motion vector list.

[0179] Figure 12 is a schematic diagram of an example of adding a zero motion vector to a list of merge mode candidate predicted motion vectors according to one embodiment of the present application. A zero-vector merge candidate predicted motion vector can be generated by combining a zero vector with a reference index that can be referenced. If zero-vector merge candidate predicted motion vectors are not duplicates, they can be added to the merge candidate predicted motion vector list. The motion information of each generated merge candidate predicted motion vector can be compared with the motion information of previous candidate predicted motion vectors in the list.

[0180] In feasible implementations, if a newly generated candidate predicted motion vector differs from an existing candidate predicted motion vector in the candidate predicted motion vector list, the generated candidate predicted motion vector is added to the merged candidate predicted motion vector list. The process of determining whether a candidate predicted motion vector differs from an existing candidate predicted motion vector in the candidate predicted motion vector list is sometimes called pruning. Pruning allows each newly generated candidate predicted motion vector to be compared to an existing candidate predicted motion vector in the list. In some feasible implementations, the pruning operation may include comparing one or more new candidate predicted motion vectors to existing candidate predicted motion vectors in the candidate predicted motion vector list and skipping the addition of new candidate predicted motion vectors that are the same as existing candidate predicted motion vectors in the candidate predicted motion vector list. In some other feasible implementations, the pruning operation may include adding one or more new candidate predicted motion vectors to the candidate predicted motion vector list and then removing duplicate candidate predicted motion vectors from the list.

[0181] In a feasible implementation of the present application, a method for predicting motion information of a picture block to be processed during interpretation includes the steps of: obtaining motion information of at least one picture block in the picture in which the picture block to be processed is located such that a motion vector is determined, wherein the at least one picture block in which the motion vector is determined is not adjacent to the picture block to be processed and includes the picture block in which the motion vector is determined; obtaining first identification information, wherein the first identification information is used to determine target motion information in the motion information of the at least one picture block in which the motion vector is determined; and predicting motion information of the picture block to be processed based on the target motion information.

[0182] Figure 13 is a flowchart illustrating an example of updating motion vectors in video encoding according to one embodiment of the present application. The blocks to be processed are the blocks to be encoded.

[0183] S1301: Obtain the initial motion vector of the block to be processed based on the predicted motion vector of the block to be processed.

[0184] In feasible implementations, for example, in merge mode, the predicted motion vector of the block being processed is used as the initial motion vector of the block being processed.

[0185] In another feasible implementation, for example in AMVP mode, the difference between the predicted motion vector of the block being processed and the motion vector of the block being processed is added together to obtain the initial motion vector of the block being processed.

[0186] The predicted motion vector of the block to be processed may be obtained according to the method shown in Figures 9 to 12 in embodiments of this application, or by any existing method for obtaining predicted motion vectors in the H.265 standard or JEM reference mode, but not limited to this. The difference in motion vectors may be obtained by using the block to be processed as a reference, performing motion estimation within a search range determined based on the predicted motion vector of the block to be processed, and calculating the difference between the motion vector of the block to be processed obtained after motion estimation and the predicted motion vector of the block to be processed.

[0187] During bidirectional prediction, this step specifically includes obtaining an initial forward motion vector of the block to be processed based on the predicted forward motion vector of the block to be processed, and obtaining an initial backward motion vector of the block to be processed based on the predicted backward motion vector of the block to be processed.

[0188] S1302: Obtain the predicted block of the block to be processed based on the initial motion vector and one or more pre-set motion vector offsets. Specifically,

[0189] S13021: Obtain a picture block from the reference frame, which belongs to the block being processed and is indicated by the reference frame index of the block being processed, and the picture block indicated by the initial motion vector of the block being processed, and use the obtained picture block as a temporary prediction block for the block being processed.

[0190] S13022: To obtain one or more actual motion vectors, the initial motion vector of the block being processed is added to one or more pre-set motion vector offsets, so that each actual motion vector indicates a search position.

[0191] S13023: Obtain one or more candidate prediction blocks at search locations indicated by one or more actual motion vectors, with each search location corresponding to one candidate prediction block.

[0192] S13024: From one or more candidate prediction blocks, select the candidate prediction block with the smallest pixel difference from the temporary prediction block as the prediction block for the block to be processed.

[0193] It should be understood that pixel differences can be calculated in multiple ways. For example, the sum of absolute errors between the pixel matrices of candidate prediction blocks and temporary prediction blocks may be calculated, the mean squared error between pixel matrices may be calculated, or the correlation between pixel matrices may be calculated. This is not limited to these methods.

[0194] During bidirectional prediction, this step involves obtaining a first picture block from the forward reference frame, indicated by the forward initial motion vector of the block being processed, from the forward reference frame index of the block being processed, and obtaining a second picture block from the backward reference frame, indicated by the backward initial motion vector of the block being processed, from the backward reference frame, indicated by the backward reference frame index of the block being processed, and weighting the first and second picture blocks to obtain a temporary prediction block of the block being processed, and adding the forward initial motion vector of the block being processed and one or more preset motion vector offsets to obtain one or more actual forward motion vectors, and processing The process particularly includes the steps of: adding the initial backward motion vector of the block to be processed to one or more pre-set motion vector offsets; obtaining one or more forward candidate prediction blocks at a search position indicated by one or more forward actual motion vectors; obtaining one or more backward candidate prediction blocks at a search position indicated by one or more backward actual motion vectors; selecting from one or more forward candidate prediction blocks the candidate prediction block with the smallest pixel difference with a temporary prediction block as the forward prediction block of the block to be processed; selecting from one or more backward candidate prediction blocks the candidate prediction block with the smallest pixel difference with a temporary prediction block as the backward prediction block of the block to be processed; and weighting the forward and backward prediction blocks in order to obtain the prediction blocks of the block to be processed.

[0195] Depending on the circumstances and feasible implementation, the method may further include the following steps after step S13022.

[0196] S13025: If the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision, the motion vector resolution of the actual motion vector is rounded so that the motion vector resolution of the processed actual motion vector is equal to the pre-set pixel precision. The pre-set pixel precision is, but is not limited to, integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0197] It should be understood that motion vector resolution is the pixel precision that can be distinguished by motion vectors in motion estimation or motion compensation processes. Rounding may include, but is not limited to, rounding up, rounding down, etc., depending on the type of pixel precision.

[0198] For example, rounding may include the following operations:

[0199] The horizontal or vertical component of the motion vector being processed is decomposed into an integer part a, a fractional part b, and a sign bit. Naturally, a is a non-negative integer, b is a fraction greater than 0 and less than 1, and the sign bit is positive or negative.

[0200] The pre-set pixel precision can be assumed to be N-pixel precision, where N is greater than 0 and less than or equal to 1, and c is equal to the value of b divided by N.

[0201] If a rounding rule is used, the decimal part of c is rounded up; if a rounding up rule is used, the integer part of c is increased by 1 and the decimal part is discarded; and if a truncation rule is used, the decimal part of c is discarded. The resulting c can be assumed to be d.

[0202] The absolute value of the processed motion vector component is obtained by multiplying d by N and then adding a, and the sign of the motion vector component (positive or negative) is not changed.

[0203] For example, if the actual motion vector is (1.25,1) and the pre-set pixel precision is integer pixel precision, the actual motion vector is rounded to (1,1). If the actual motion vector is (-1.7,-1) and the pre-set pixel precision is 1 / 4 pixel precision, the actual motion vector is rounded to (-1.75,-1).

[0204] In some cases, in other feasible implementations, step S13024 includes the steps of: selecting an actual motion vector from one or more candidate prediction blocks that corresponds to a candidate prediction block with the smallest pixel difference from a temporary prediction block; rounding the motion vector resolution of the selected actual motion vector so that the motion vector resolution of the processed selected actual motion vector is equal to the pre-set pixel precision if the motion vector resolution of the selected actual motion vector is higher than the pre-set pixel precision; and determining that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the block being processed.

[0205] Similarly, the pre-configured pixel precision can be integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision. This is not limited to these. For rounding, please refer to the examples of feasible implementations described above. Further details will not be repeated.

[0206] It should be understood that higher pixel precision generally means that more complex pixel interpolation needs to be performed in the search domain of the motion estimation or motion compensation process to make the motion vector resolution equal to the pre-set pixel precision. This can reduce complexity.

[0207] Figure 14 is a flowchart illustrating an example of updating motion vectors in video decoding according to one embodiment of the present application. The blocks being processed are the blocks being decoded.

[0208] S1401: Obtain the initial motion vector of the block to be processed based on the predicted motion vector of the block to be processed.

[0209] In feasible implementations, for example, in merge mode, the predicted motion vector of the block being processed is used as the initial motion vector of the block being processed.

[0210] In another feasible implementation, for example in AMVP mode, the difference between the predicted motion vector of the block being processed and the motion vector of the block being processed is added together to obtain the initial motion vector of the block being processed.

[0211] The predicted motion vectors of the blocks to be processed may be obtained according to the methods shown in Figures 9 to 12 in embodiments of this application, or by any one of existing methods for obtaining predicted motion vectors in the H.265 standard or JEM reference mode, but not limited to this. The difference of motion vectors may be obtained by analyzing the bitstream.

[0212] During bidirectional prediction, this step specifically includes obtaining an initial forward motion vector of the block to be processed based on the predicted forward motion vector of the block to be processed, and obtaining an initial backward motion vector of the block to be processed based on the predicted backward motion vector of the block to be processed.

[0213] S1402: Obtain the predicted block of the block to be processed based on the initial motion vector and one or more pre-set motion vector offsets. Specifically,

[0214] S14021: Obtain a picture block from the reference frame, which belongs to the block being processed and is indicated by the reference frame index of the block being processed, and the picture block indicated by the initial motion vector of the block being processed, and use the obtained picture block as a temporary prediction block for the block being processed.

[0215] S14022: To obtain one or more actual motion vectors, the initial motion vector of the block being processed is added to one or more pre-set motion vector offsets, so that each actual motion vector indicates a search position.

[0216] S14023: Obtain one or more candidate prediction blocks at search locations indicated by one or more actual motion vectors, with each search location corresponding to one candidate prediction block.

[0217] S14024: From one or more candidate prediction blocks, select the candidate prediction block with the smallest pixel difference from the temporary prediction block as the prediction block for the block to be processed.

[0218] It should be understood that pixel differences can be calculated in multiple ways. For example, the sum of absolute errors between the pixel matrices of candidate prediction blocks and temporary prediction blocks may be calculated, the mean squared error between pixel matrices may be calculated, or the correlation between pixel matrices may be calculated. This is not limited to these methods.

[0219] During bidirectional prediction, this step involves obtaining a first picture block from the forward reference frame, indicated by the forward initial motion vector of the block being processed, from the forward reference frame index of the block being processed, and obtaining a second picture block from the backward reference frame, indicated by the backward initial motion vector of the block being processed, from the backward reference frame, indicated by the backward reference frame index of the block being processed, and weighting the first and second picture blocks to obtain a temporary prediction block of the block being processed, and adding the forward initial motion vector of the block being processed and one or more preset motion vector offsets to obtain one or more actual forward motion vectors, and processing The process particularly includes the steps of: adding the initial backward motion vector of the block to be processed to one or more pre-set motion vector offsets; obtaining one or more forward candidate prediction blocks at a search position indicated by one or more forward actual motion vectors; obtaining one or more backward candidate prediction blocks at a search position indicated by one or more backward actual motion vectors; selecting from one or more forward candidate prediction blocks the candidate prediction block with the smallest pixel difference with a temporary prediction block as the forward prediction block of the block to be processed; selecting from one or more backward candidate prediction blocks the candidate prediction block with the smallest pixel difference with a temporary prediction block as the backward prediction block of the block to be processed; and weighting the forward and backward prediction blocks in order to obtain the prediction blocks of the block to be processed.

[0220] Depending on the circumstances and feasible implementation, the method may further include the following steps after step S14022.

[0221] S14025: If the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision, the motion vector resolution of the actual motion vector is rounded so that the motion vector resolution of the processed actual motion vector is equal to the pre-set pixel precision. The pre-set pixel precision is, but is not limited to, integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0222] In some cases, in other feasible implementations, step S14024 includes the steps of: selecting an actual motion vector from one or more candidate prediction blocks that corresponds to a candidate prediction block with the smallest pixel difference from a temporary prediction block; rounding the motion vector resolution of the selected actual motion vector so that the motion vector resolution of the processed selected actual motion vector is equal to the pre-set pixel precision if the motion vector resolution of the selected actual motion vector is higher than the pre-set pixel precision; and determining that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the block being processed.

[0223] Similarly, the pre-configured pixel precision can be integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision. This is not limited to these. For rounding, please refer to the examples of feasible implementations described above. Further details will not be repeated.

[0224] By using several specific embodiments, the following describes in detail implementations for updating motion vectors. It should be understood that the motion vector updates are consistent between the encoder and decoder, as described in the encoding method in Figure 13 and the decoding method in Figure 14. Therefore, the following embodiments are described only from the perspective of either the encoder or the decoder. It should be understood that when a description is provided from the encoder, the implementation in the decoder is consistent with the implementation in the encoder, and when a description is provided from the decoder, the implementation in the encoder is consistent with the implementation in the decoder.

[0225] Embodiment 1 As shown in Figure 15, the current decoded block is the first decoded block, and the predicted motion information for the current decoded block is obtained. The forward motion vector predictor and backward motion vector predictor for the current decoded block are (-10,4) and (5,6), respectively. The POC of the picture in which the current decoded block is located is 4, and the POC of the reference picture, indicated by the index values ​​of the reference picture, is assumed to be 2 and 6, respectively. Therefore, the POC corresponding to the current decoded block is 4, the POC corresponding to the forward-predicted reference picture block is 2, and the POC corresponding to the backward-predicted reference picture block is 6.

[0226] Forward and backward predictions are performed separately on the current decoded block to obtain the initial forward prediction block (FPB) and initial backward prediction block (BPB), and it is assumed that the initial forward and backward prediction blocks are FPB1 and BPB1, respectively. The first decoding prediction block (DPB) of the current decoded block is obtained by performing a weighted sum of FPB1 and BPB1, and it is assumed that it is DPB1.

[0227] (-10,4) and (5,6) are used as reference inputs for the forward and backward motion vector predictors, and a first-precision motion search is performed separately for the forward and backward prediction reference picture blocks. In this case, the first precision is half-pixel precision over a 1-pixel range. The first decoded prediction block DPB1 is used as the reference. The corresponding new forward and backward decoded prediction blocks obtained in each motion search are compared to the first decoded prediction block DPB1 to obtain a new decoded prediction block with the smallest difference from DPB1, and the forward and backward motion vector predictors corresponding to the new decoded prediction blocks are used as target motion vector predictors, assumed to be (-11,4) and (6,6), respectively.

[0228] The target motion vector predictors are updated to (-11,4) and (6,6), and forward and backward predictions are performed on the first decoded block based on the target motion vector predictors. The target decoded prediction block is obtained by taking a weighted sum of the newly obtained forward and backward decoded prediction blocks, which is assumed to be DPB2, and the decoded prediction block of the current decoded block is updated to DPB2.

[0229] Note that when motion search with a first precision is performed on forward-predicting reference picture blocks and backward-predicting reference picture blocks, the first precision can be any specified precision, for example, integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0230] Embodiment 2 As shown in Figure 16, the current decoded block is the first decoded block, and the predicted motion information for the current decoded block is obtained. The forward motion vector predictor for the current decoded block is (-21, 18), the POC of the picture in which the current decoded block is located is 4, and it is assumed that the POC of the reference picture, indicated by the index value of the reference picture, is 2. Therefore, the POC corresponding to the current decoded block is 4, and the POC corresponding to the forward predicted reference picture block is 2.

[0231] Forward prediction is performed on the current decryption block to obtain the initial forward decryption prediction block for the current decryption block, and it is assumed that the initial forward decryption prediction block is FPB1. In this case, FPB1 is used as the first decryption prediction block for the current decryption block, and the first decryption prediction block is shown as DPB1.

[0232] (-21,18) is used as the reference input for the forward motion vector predictor, and a first-precision motion search is performed on the forward predictor reference picture block. In this case, the first precision is 1-pixel precision over a 5-pixel range. The first decoded predictor block DPB1 is used as the reference. The corresponding new forward decoded predictor block obtained in each motion search is compared with the first decoded predictor block DPB1 to obtain a new decoded predictor block with the smallest difference from DPB1, and the forward motion vector predictor corresponding to the new decoded predictor block is used as the target motion vector predictor, assumed to be (-19,19).

[0233] The target motion vector predictor is updated to (-19,19), a forward prediction is performed on the first decoded block based on the target motion vector predictor, the newly obtained forward decoded prediction block is used as the target decoded prediction block and is assumed to become DPB2, and the decoded prediction block of the current decoded block is updated to DPB2.

[0234] Note that when motion search with a first precision is performed on forward-predicting reference picture blocks and backward-predicting reference picture blocks, the first precision can be any specified precision, for example, integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0235] Embodiment 3 As shown in Figures 17A and 17B, the current coded block is the first coded block, and the predicted motion information for the current coded block is obtained. The forward motion vector predictor and backward motion vector predictor for the current coded block are (-6,12) and (8,4), respectively. The POC of the picture in which the current coded block is located is 8, and it is assumed that the POCs of the reference picture, indicated by the index values ​​of the reference picture, are 4 and 12, respectively. Therefore, the POC corresponding to the current coded block is 4, the POC corresponding to the forward-predicted reference picture block is 4, and the POC corresponding to the backward-predicted reference picture block is 12.

[0236] Forward and backward predictions are performed separately on the current coded block to obtain the initial forward and backward coding prediction blocks, and it is assumed that the initial forward and backward coding prediction blocks are FPB1 and BPB1, respectively. The first coding prediction block of the current coded block is obtained by performing a weighted sum of FPB1 and BPB1, and it is assumed that it is DPB1.

[0237] (-6,12) and (8,4) are used as reference inputs for the forward and backward motion vector predictors, and a first-accuracy motion search is performed separately for the forward and backward predictor reference picture blocks. The first coded prediction block DPB1 is used as the reference. The corresponding new forward and backward coded prediction blocks obtained in each motion search are compared with the first coded prediction block DPB1 to obtain a new coded prediction block with the smallest difference from DPB1, and the forward and backward motion vector predictors corresponding to the new coded prediction blocks are used as target motion vector predictors, assumed to be (-11,4) and (6,6), respectively.

[0238] The target motion vector predictors are updated to (-11,4) and (6,6), forward and backward predictions are performed on the first coded block based on the target motion vector predictors, and the target coded prediction block is obtained by taking a weighted sum of the newly obtained forward and backward coded prediction blocks, which is assumed to be DPB2, and the coded prediction block of the current coded block is updated to DPB2.

[0239] Next, (-11,4) and (6,6) are used as reference inputs for the forward and backward motion vector predictors, and a first-accuracy motion search is performed separately for the forward and backward predictor reference picture blocks. The coding prediction block DPB2 of the current coding block is used as a reference. The corresponding new forward and backward coding prediction blocks obtained in each motion search are compared with the first coding prediction block DPB2 to obtain a new coding prediction block with the smallest difference from DPB2, and the forward and backward motion vector predictors corresponding to the new coding prediction blocks are used as new target motion vector predictors, assumed to be (-7,11) and (6,5), respectively.

[0240] Next, the target motion vector predictors are updated to (-7,11) and (6,5), and forward and backward predictions are performed on the first coded block based on the latest target motion vector predictors. The target coded prediction block is obtained by taking a weighted sum of the newly obtained forward and backward coded prediction blocks, which is assumed to be DPB3, and the coded prediction block of the current coded block is updated to DPB3.

[0241] Furthermore, the target motion vector predictor can be continuously updated according to the method described above, and the number of cycles is not limited.

[0242] Note that when motion search with a first precision is performed on forward-predicting reference picture blocks and backward-predicting reference picture blocks, the first precision can be any specified precision, for example, integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0243] It should be understood that in some viable embodiments, the cycle terminates when a condition is met. For example, the cycle terminates when the difference between DPBn and DPBn-1 is less than a threshold, where n is a positive integer greater than 2.

[0244] Embodiment 4 As shown in Figure 18, the current decoded block is the first decoded block, and the predicted motion information for the current decoded block is obtained. The predicted forward and backward motion vectors of the current decoded block are (-10,4) and (5,6), respectively, and the difference between the forward and backward motion vectors of the current decoded block is (-2,1) and (1,1), respectively. It is assumed that the POC of the picture in which the current decoded block is located is 4, and that the POCs of the reference picture, indicated by the index values ​​of the reference picture, are 2 and 6, respectively. Therefore, the POC corresponding to the current decoded block is 4, the POC corresponding to the forward predicted reference picture block is 2, and the POC corresponding to the backward predicted reference picture block is 6.

[0245] Forward and backward predictions are performed separately on the current decoded block to obtain the initial forward decoded prediction block (FPB) and initial backward decoded prediction block (BPB), and it is assumed that the initial forward and backward decoded prediction blocks are FPB1 and BPB1, respectively. The first decoded prediction block (DPB) of the current decoded block is obtained by performing a weighted sum of FPB1 and BPB1, and it is assumed that it is DPB1.

[0246] The sum of the difference between the forward motion vector predictor and the forward motion vector, and the sum of the difference between the backward motion vector predictor and the backward motion vector, i.e., (-10,4)+(-2,1)=(-12,5) and (5,6)+(1,1)=(6,7), are used as the forward and backward motion vectors, respectively, and a motion search with first precision is performed separately for the forward prediction reference picture block and the backward prediction reference picture block. In this case, the first precision is 1 / 4 pixel precision over a 1-pixel range. The first decoded prediction block DPB1 is used as the reference. The corresponding new forward and backward decoded prediction blocks obtained in each motion search are compared with the first decoded prediction block DPB1 to obtain a new decoded prediction block with the smallest difference from DPB1, and the forward and backward motion vectors corresponding to the new decoded prediction block are used as target motion vector predictors, assumed to be (-11,4) and (6,6), respectively.

[0247] The target motion vectors are updated to (-11,4) and (6,6), and forward and backward predictions are performed separately for the first decoded block based on the target motion vectors. The target decoded prediction block is obtained by taking a weighted sum of the newly obtained forward and backward decoded prediction blocks, which is assumed to be DPB2, and the decoded prediction block of the current decoded block is updated to DPB2.

[0248] Figure 19 is a schematic flowchart of a method for obtaining motion vectors by an encoder according to one embodiment of the present application. The method includes the following steps:

[0249] S1901: Determine the reference block of the block to be processed.

[0250] Reference blocks are described above in relation to Figure 8. It should be understood that reference blocks include not only spatially adjacent blocks to the block being processed shown in Figure 8, but also other actual or virtual picture blocks that have a pre-defined temporal or spatial correlation with the block being processed.

[0251] It should be understood that the beneficial effects of this embodiment of the present application are reflected in scenarios where the motion vector of the reference block of the block being processed is updated. Specifically, the reference block has an initial motion vector and one or more preset motion vector offsets, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, and the predicted motion vector of the reference block is obtained based on the initial motion vector and one or more preset motion vector offsets.

[0252] Specifically, for the process of updating the motion vector of a reference block and obtaining the initial motion vector, please refer to the embodiment related to Figure 13 of this application. Please understand that the reference block in the embodiment related to Figure 19 is the same as the block being processed in the embodiment related to Figure 13.

[0253] In some feasible implementations, the step of determining the reference block of the block to be processed specifically includes the step of selecting from one or more candidate reference blocks of the block to be processed the candidate reference block that has the minimum rate distortion cost as the reference block of the block to be processed.

[0254] In some feasible implementations, after determining the reference block of the block to be processed in one or more candidate reference blocks of the block to be processed, the method further includes the step of encoding the identification information of the determined reference block in one or more candidate reference blocks into a bitstream.

[0255] S1902: Use the initial motion vector of the reference block as the predicted motion vector of the block being processed.

[0256] In some feasible implementations, for example, in merge mode, after step S1902, the method further includes a step of using the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed. Alternatively, in step S1902, the initial motion vector of the reference block is used as the initial motion vector of the block to be processed.

[0257] In another feasible implementation, for example in AMVP mode, after step S1902, the method further includes the step of adding the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain the initial motion vector of the block to be processed.

[0258] Figure 20 is a schematic flowchart of a method for obtaining motion vectors by a decoder according to one embodiment of the present application. The method includes the following steps:

[0259] S2001: Determine the reference block of the block to be processed.

[0260] It should be understood that the beneficial effects of this embodiment of the present application are reflected in scenarios where the motion vector of the reference block of the block being processed is updated. Specifically, the reference block has an initial motion vector and one or more preset motion vector offsets, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, and the predicted motion vector of the reference block is obtained based on the initial motion vector and one or more preset motion vector offsets.

[0261] Specifically, for the process of updating the motion vector of a reference block and obtaining the initial motion vector, please refer to the embodiment related to Figure 14 of this application. Please understand that the reference block in the embodiment related to Figure 20 is the block being processed in the embodiment related to Figure 14.

[0262] In some feasible implementations, the step of determining the reference block of the block to be processed specifically includes the step of parsing the bitstream to obtain a second identifier, and the step of determining the reference block of the block to be processed based on the second identifier.

[0263] S2002: Use the initial motion vector of the reference block as the predicted motion vector of the block being processed.

[0264] In feasible implementations, for example, in merge mode, after step S2002, the method further includes a step of using the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed. Alternatively, in step S2002, the initial motion vector of the reference block is used as the initial motion vector of the block to be processed.

[0265] In another feasible implementation, for example in AMVP mode, after step S2002, the method further includes a step of adding the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain the initial motion vector of the block to be processed, the difference of the motion vector of the block to be processed is obtained by analyzing a first identification information in the bitstream.

[0266] In the implementation described above, the initial motion vector before update is used to replace the actual motion vector and to predict the subsequent coded or decoded block. The prediction step may be performed for the subsequent coded or decoded block before the actual motion vector update is complete. This ensures the improvement in coding efficiency brought about by the motion vector update and eliminates processing delays.

[0267] Figure 21 is a schematic block diagram of a device 2100 for acquiring motion vectors according to one embodiment of the present application. The device 2100 is A determination module 2101 is configured to determine a reference block of the block to be processed, such that the reference block and the block to be processed have a pre-set temporal or spatial correlation, the reference block has an initial motion vector and one or more pre-set motion vector offsets, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, and the predicted motion vector of the reference block is obtained based on the initial motion vector and one or more pre-set motion vector offsets. The acquisition module 2102 is configured to use the initial motion vector of a reference block as the predicted motion vector of the block being processed. It is equipped with.

[0268] In feasible implementations, the acquisition module 2102 is further configured to use the predicted motion vector of the reference block as the initial motion vector of the reference block, or to add the difference between the predicted motion vector of the reference block and the motion vector of the reference block in order to obtain the initial motion vector of the reference block.

[0269] In a feasible implementation, the acquisition module 2102 is further configured to acquire a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, use the acquired picture block as a temporary prediction block for the reference block, add the initial motion vector of the reference block and one or more pre-set motion vector offsets to acquire one or more actual motion vectors, each actual motion vector indicates a search position, acquire one or more candidate prediction blocks at the search positions indicated by one or more actual motion vectors, each search position corresponds to one candidate prediction block, and select the candidate prediction block with the smallest pixel difference from the temporary prediction block from among the one or more candidate prediction blocks as the prediction block for the reference block.

[0270] In feasible implementations, the device 2100 is configured for bidirectional prediction, with a reference frame comprising a reference frame in a first direction and a reference frame in a second direction, an initial motion vector comprising an initial motion vector in a first direction and an initial motion vector in a second direction, and the acquisition module 2102 is specifically configured to acquire a first picture block indicated by the initial motion vector in the first direction of the reference block from the reference frame in the first direction of the reference block, a second picture block indicated by the initial motion vector in the second direction of the reference block from the reference frame in the second direction of the reference block, and to weight the first and second picture blocks in order to acquire a temporary prediction block of the reference block.

[0271] In a feasible implementation, the device 2100 further includes a rounding module 2103 configured to round the motion vector resolution of an actual motion vector so that the motion vector resolution of the processed actual motion vector becomes equal to the pre-set pixel precision if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision.

[0272] In feasible implementations, the acquisition module 2102 is specifically configured to select an actual motion vector from one or more candidate prediction blocks that corresponds to the candidate prediction block with the smallest pixel difference from the temporary prediction block, and if the motion vector resolution of the selected actual motion vector is higher than the pre-set pixel precision, round the motion vector resolution of the selected actual motion vector so that the processed motion vector resolution of the selected actual motion vector is equal to the pre-set pixel precision, and determine that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the reference block.

[0273] In feasible implementations, the pre-configured pixel precision can be integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0274] In a feasible implementation, the acquisition module 2102 is specifically configured to use the predicted motion vector of the block being processed as the initial motion vector of the block being processed.

[0275] In a feasible implementation, the acquisition module 2102 is specifically configured to add the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain the initial motion vector of the block to be processed.

[0276] In a feasible implementation, the device 2100 is configured for video decoding, and the difference in motion vectors of the blocks to be processed is obtained by analyzing a first identification information in the bitstream.

[0277] In a feasible implementation, the device 2100 is configured for video decoding, and the decision module 2101 is specifically configured to analyze the bitstream to obtain second identification information and, based on the second identification information, determine the reference block of the block to be processed.

[0278] In a possible implementation form, the device 2100 is configured for video encoding, and the determination module 2101 is specifically configured to select, from one or more candidate reference blocks of the block to be processed, the candidate reference block with the minimum rate distortion cost as the reference block of the block to be processed.

[0279] FIG. 22 is a schematic block diagram of a video encoding device according to an embodiment of the present application. The device 2200 may be applied to an encoder or a decoder. The device 2200 includes a processor 2201 and a memory 2202. The processor 2201 and the memory 2202 are interconnected (for example, interconnected via a bus 2204). In a possible implementation form, the device 2200 may further include a transceiver 2203. The transceiver 2203 is connected to the processor 2201 and the memory 2202 and is configured to receive / transmit data.

[0280] The memory 2202 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a compact disc read-only memory (CD-ROM). The memory 2202 is configured to store related program codes and video data.

[0281] The processor 2201 may be one or more central processing units (CPUs). When the processor 2201 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.

[0282] The processor 2201 is configured to read program code stored in memory 2202 and execute operations in any implementation solution and various feasible implementation forms of the implementation solution corresponding to Figures 13 to 20.

[0283] For example, one embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer is enabled to perform operations in any implementation solution corresponding to Figures 13 to 20 and in various feasible implementations of the implementation solution.

[0284] For example, one embodiment of this application further provides a computer program product including instructions. When the computer program product is executed on a computer, the computer is enabled to perform operations in any implementation solution corresponding to Figures 13 to 20 and in various feasible implementations of the implementation solution.

[0285] Those skilled in the art will understand that units and algorithmic steps can be implemented by electronic hardware or by a combination of computer software and electronic hardware, in combination with the examples described in each embodiment disclosed herein. Whether the function is performed in hardware or software will depend on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the functions described for each specific application, but such implementations should not be considered beyond the scope of this application.

[0286] Those skilled in the art will clearly understand that, for the sake of simplicity of explanation, the detailed operating processes of the above systems, apparatuses, and units should be referred to in the corresponding processes in the above embodiment of the method, and therefore, the details will not be repeated here.

[0287] All or part of the embodiments described above may be implemented using software, hardware, firmware, or any combination thereof. When software is used to implement an embodiment, the embodiment may be implemented all or partly in the form of a computer program product. The computer program product includes one or more computer instructions, and when the computer program instructions are loaded into a computer and executed, all or part of the procedures or functions according to the embodiments of the present invention are generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, optical fiber, or digital subscriber line) or wireless (e.g., infrared or microwave) method. The computer-readable storage medium may be any available medium accessible by a computer, or it may be a data storage device such as a server or data center that integrates one or more available media. The usable media may include magnetic media (e.g., floppy disks, hard disks, or magnetic tapes), optical media (e.g., DVDs), and semiconductor media (e.g., solid-state disks).

[0288] In the embodiments described above, each embodiment has its own emphasis. For parts not described in detail in one embodiment, please refer to the relevant descriptions in other embodiments.

[0289] The above description merely illustrates specific implementations of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications or substitutions that fall within the technical scope disclosed herein and are readily conceivable to those skilled in the art are included within the scope of protection of the present invention. Accordingly, the scope of protection of the present invention falls within the scope of protection of the claims.

[0290] Examples 1. A step of determining the reference block of the block to be processed, The steps include: the reference block and the block to be processed have a pre-defined temporal or spatial correlation; the reference block has an initial motion vector and one or more pre-defined motion vector offsets; the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block; and the predicted block of the reference block is obtained based on the initial motion vector and one or more pre-defined motion vector offsets; The steps include using the initial motion vector of the reference block as the predicted motion vector of the block being processed. A method for obtaining motion vectors, including the one described above.

[0291] 2. The initial motion vector of the reference block is determined in the following manner, namely: A step of using the predicted motion vector of the reference block as the initial motion vector of the reference block, or To obtain the initial motion vector of the reference block, the step is to add the difference between the predicted motion vector of the reference block and the motion vector of the reference block. The method described in Example 1, which is particularly obtained by [method name].

[0292] 3. The prediction block of the reference block is in the following manner, namely, The steps include: obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, and using the obtained picture block as a temporary prediction block of the reference block; A step of adding the initial motion vector of the reference block and the one or more pre-set motion vector offsets in order to obtain one or more actual motion vectors, wherein each actual motion vector indicates a search position, A step of obtaining one or more candidate prediction blocks at a search position indicated by one or more actual motion vectors, wherein each search position corresponds to one candidate prediction block. The step of selecting from the one or more candidate prediction blocks the candidate prediction block that has the smallest pixel difference with the temporary prediction block as the prediction block of the reference block. The method according to Example 1 or 2, which is particularly obtained by [method name].

[0293] 4. The step of using the method for bidirectional prediction, wherein the reference frame includes a reference frame for a first direction and a reference frame for a second direction, the initial motion vector includes an initial motion vector for a first direction and an initial motion vector for a second direction, and the step of obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, and using the obtained picture block as a temporary prediction block of the reference block, The steps include obtaining a first picture block from the reference frame of the reference block in the first direction, indicated by the initial motion vector of the reference block in the first direction, The steps include obtaining a second picture block from the reference frame of the reference block in the second direction, which is indicated by the initial motion vector of the reference block in the second direction, A step of weighting the first picture block and the second picture block to obtain the temporary prediction block of the reference block The method according to Example 3, including this.

[0294] 5. When the motion vector resolution of the actual motion vector is higher than the preset pixel accuracy, rounding the motion vector resolution of the actual motion vector so that the motion vector resolution of the processed actual motion vector is equal to the preset pixel accuracy The method according to Example 3 or 4, further including this.

[0295] 6. The step of selecting, as the prediction block of the reference block, the candidate prediction block with the smallest pixel difference from the temporary prediction block among the one or more candidate prediction blocks is A step of selecting the actual motion vector corresponding to the candidate prediction block with the smallest pixel difference from the temporary prediction block among the one or more candidate prediction blocks When the motion vector resolution of the selected actual motion vector is higher than the preset pixel accuracy, rounding the motion vector resolution of the selected actual motion vector so that the motion vector resolution of the processed selected actual motion vector is equal to the preset pixel accuracy A step of determining that the prediction block corresponding to the position indicated by the processed selected actual motion vector is the prediction block of the reference block The method according to Example 3 or 4, including this.

[0296] 7. The method according to Example 5 or 6, wherein the preset pixel accuracy is integer pixel accuracy, 1 / 2 pixel accuracy, 1 / 4 pixel accuracy, or 1 / 8 pixel accuracy.

[0297] 8. A step of using the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed. The method according to any one of Examples 1 to 7, further comprising:

[0298] 9. To obtain the initial motion vector of the block to be processed, add the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed. The method according to any one of Examples 1 to 7, further comprising:

[0299] 10. The method according to Embodiment 9, wherein the method is used for video decoding, and the difference of the motion vectors of the blocks being processed is obtained by analyzing the first identification information in the bitstream.

[0300] 11. The step of determining the reference block of the block to be processed, using the method described above, To obtain the second identification information, the bitstream is parsed, A step of determining the reference block of the block to be processed based on the second identification information. The method according to any one of Examples 1 to 9, including the method described above.

[0301] 12. The step of determining a reference block of a block to be processed, using the method described above for video encoding, The step of selecting from one or more candidate reference blocks of the block to be processed the candidate reference block that has the minimum rate distortion cost as the reference block of the block to be processed. The method according to any one of Examples 1 to 9, including the method described above.

[0302] 13 A determination module configured to determine a reference block of a block to be processed, wherein the reference block and the block to be processed have a pre-defined temporal or spatial correlation, the reference block has an initial motion vector and one or more pre-defined motion vector offsets, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, and the predicted motion vector of the reference block is obtained based on the initial motion vector and one or more pre-defined motion vector offsets, An acquisition module configured to use the initial motion vector of the reference block as the predicted motion vector of the block being processed, A device for acquiring motion vectors, equipped with the necessary components.

[0303] 14. The acquisition module, The predicted motion vector of the reference block is used as the initial motion vector of the reference block, or To obtain the initial motion vector of the reference block, the difference between the predicted motion vector of the reference block and the motion vector of the reference block is added together. The apparatus according to Example 13, further configured as follows.

[0304] 15. The acquisition module, From the reference frame of the reference block, a picture block indicated by the initial motion vector of the reference block is obtained, and the obtained picture block is used as a temporary prediction block of the reference block. To obtain one or more actual motion vectors, the initial motion vector of the reference block and the one or more pre-set motion vector offsets are added together, so that each actual motion vector indicates a search position. Obtain one or more candidate prediction blocks at the search position indicated by the one or more actual motion vectors, and each search position corresponds to one candidate prediction block. From the one or more candidate prediction blocks, the candidate prediction block that has the smallest pixel difference with the temporary prediction block is selected as the prediction block of the reference block. The apparatus according to Example 13 or 14, further configured as follows.

[0305] 16. The device is configured for bidirectional prediction, the reference frame includes a reference frame for a first direction and a reference frame for a second direction, the initial motion vector includes an initial motion vector for a first direction and an initial motion vector for a second direction, and the acquisition module is From the reference frame of the reference block in the first direction, obtain the first picture block indicated by the initial motion vector of the reference block in the first direction. From the reference frame of the reference block in the second direction, obtain a second picture block indicated by the initial motion vector of the reference block in the second direction. To obtain the temporary prediction block of the reference block, the first picture block and the second picture block are weighted. The apparatus according to Example 15, which is particularly configured as follows.

[0306] 17. A rounding module configured to round the motion vector resolution of the actual motion vector so that the motion vector resolution of the processed actual motion vector becomes equal to the pre-set pixel precision, if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision. The apparatus according to Example 15 or 16, further comprising the above.

[0307] 18. The acquisition module, From the one or more candidate prediction blocks, select the actual motion vector corresponding to the candidate prediction block that has the smallest pixel difference from the temporary prediction block. If the motion vector resolution of the selected actual motion vector is higher than the preset pixel precision, the motion vector resolution of the selected actual motion vector is rounded so that the motion vector resolution of the processed selected actual motion vector is equal to the preset pixel precision. The predicted block corresponding to the position indicated by the processed selected actual motion vector is determined to be the predicted block of the reference block. The apparatus according to Example 15 or 16, which is particularly configured as follows.

[0308] 19. The apparatus according to Example 17 or 18, wherein the pre-set pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

[0309] 20. The acquisition module, The predicted motion vector of the block to be processed is used as the initial motion vector of the block to be processed. The apparatus according to any one of Examples 13 to 19, which is particularly configured as follows.

[0310] 21. The acquisition module, To obtain the initial motion vector of the block to be processed, the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed is added together. The apparatus according to any one of Examples 13 to 19, which is particularly configured as follows.

[0311] 22. The apparatus according to Embodiment 21, wherein the apparatus is used for video decoding, and the difference of the motion vectors of the blocks to be processed is obtained by analyzing the first identification information in the bitstream.

[0312] 23. The apparatus is used for video decoding, and the decision module is, To obtain the second identification information, the bitstream is parsed, Based on the second identification information, the reference block of the block to be processed is determined. The apparatus according to any one of Examples 13 to 21, which is particularly configured as follows.

[0313] 24. The apparatus is used for video coding, and the decision module is, From one or more candidate reference blocks of the block to be processed, the candidate reference block with the minimum rate distortion cost is selected as the reference block of the block to be processed. The apparatus according to any one of Examples 13 to 22, which is particularly configured as follows.

[0314] 25. A device for acquiring motion vectors, wherein the device is used for video encoding or video decoding. A processor and memory, wherein the processor and the memory are connected to each other. The memory is configured to store program code and video data. The processor and memory are configured to read the program code stored in the memory in order to perform the method described in any one of the embodiments 1 to 12. A device equipped with the following features.

[0315] 26. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the instructions enable the computer to perform the method according to any one of Embodiments 1 to 12. [Explanation of Symbols]

[0316] 10 Video Encoding Systems 12. Source device 14 Destination device 18 Video Sources 20 Video Encoders 22 Output Interfaces 24 Storage device 28 Input Interfaces 30 video decoders 32 Display device 34 Memory Systems 35 divided units 36 File Server 40 Mode Selection Unit 41 prediction units 42 Motion Estimation Unit 44 Motion compensation unit 46 Intra Prediction Units 50 Adder 52 Conversion Processing Unit 54 Quantization Units 56 Entropy coding unit 58 Inverse Quantization Unit 60 Reverse Conversion Unit 62 Adder 64 Reference picture memory 80 Entropy coding units 81 prediction units 82 Motion Compensation Unit 84 Intra Prediction Units 86 Inverse Quantization Unit 88 Reverse Conversion Unit 90 Adder 92 Reference Picture Memory 102 Residual Generation Module 121 Interpretation Module 162 Motion Compensation Module 180 IME modules 182 FME Module 184 Merge Module 186 PU Pattern Determination Module 188 CU Pattern Determination Module 200 merge operations 210 AMVP operation 220 Motion compensation operation 250 coding units 2100 equipment 2101 Decision Module 2102 Acquisition Module 2103 Rounding Module 2200 devices 2201 Processor 2202 memory 2203 Transmitter / Receiver 2204 Bus 180A IME module 180B IME module 180C IME module 180N IME module 182A FME module 182B FME module 182C FME module 182N FME module 184A Merge Module 184B Merge Module 184C Merge Module 184N Merge Module 186A PU Pattern Detection Module 186B PU Pattern Detection Module 186C PU Pattern Recognition Module 186N PU Pattern Recognition Module 252 Candidate predicted motion vector positions 252A Candidate predicted motion vector position 252B Candidate predicted motion vector position 252C Candidate predicted motion vector position 252D Candidate predicted motion vector position 252E Candidate predicted motion vector position

Claims

1. A step of determining a reference block of a block to be processed, wherein the reference block and the block to be processed have a pre-defined temporal or spatial correlation, the reference block has an initial motion vector, the initial motion vector of the reference block is obtained based on a predicted motion vector of the reference block, the predicted block of the reference block is obtained based on the initial motion vector and a motion vector offset, and the motion vector offset is obtained based on the initial motion vector and one or more pre-defined motion vector offsets, A step of generating a bitstream based on the initial motion vector of the reference block, wherein the initial motion vector of the reference block is used as the predicted motion vector of the block being processed. A method for generating a bitstream, comprising the step of adding the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to obtain the initial motion vector of the block to be processed.

2. The initial motion vector of the aforementioned reference block is determined in the following manner, namely, A step of using the predicted motion vector of the reference block as the initial motion vector of the reference block, or To obtain the initial motion vector of the reference block, the step is to add the difference between the predicted motion vector of the reference block and the motion vector of the reference block. The method according to claim 1, which is particularly obtained by [method].

3. The prediction block of the aforementioned reference block is configured in the following manner, namely, The steps include: obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, and using the obtained picture block as a temporary prediction block of the reference block; A step of adding the initial motion vector of the reference block and the one or more pre-set motion vector offsets in order to obtain one or more actual motion vectors, wherein each actual motion vector indicates a search position, A step of obtaining one or more candidate prediction blocks at a search position indicated by one or more actual motion vectors, wherein each search position corresponds to one candidate prediction block. The step of selecting from the one or more candidate prediction blocks the candidate prediction block that has the smallest pixel difference with the temporary prediction block as the prediction block of the reference block. The method according to claim 1 or 2, which is particularly obtained by...

4. The step of using the method for bidirectional prediction, wherein the reference frame includes a reference frame for a first direction and a reference frame for a second direction, the initial motion vector includes an initial motion vector for a first direction and an initial motion vector for a second direction, and the step of obtaining a picture block indicated by the initial motion vector of the reference block from the reference frame of the reference block, and using the obtained picture block as a temporary prediction block of the reference block, The steps include obtaining a first picture block from the reference frame of the reference block in the first direction, indicated by the initial motion vector of the reference block in the first direction, The steps include obtaining a second picture block from the reference frame of the reference block in the second direction, which is indicated by the initial motion vector of the reference block in the second direction, To obtain the temporary prediction block of the reference block, the first picture block and the second picture block are weighted. The method according to claim 3, including the method described in claim 3.

5. If the motion vector resolution of the actual motion vector is higher than the preset pixel precision, the motion vector resolution of the actual motion vector is rounded so that the motion vector resolution of the processed actual motion vector is equal to the preset pixel precision. The method according to claim 3 or 4, further comprising:

6. The step of selecting from the one or more candidate prediction blocks the candidate prediction block that has the smallest pixel difference with the temporary prediction block as the prediction block of the reference block, The steps include selecting an actual motion vector from one or more candidate prediction blocks that corresponds to the candidate prediction block with the smallest pixel difference from the temporary prediction block, If the motion vector resolution of the selected actual motion vector is higher than the preset pixel precision, the motion vector resolution of the selected actual motion vector is rounded so that the motion vector resolution of the processed selected actual motion vector is equal to the preset pixel precision. The step of determining that the predicted block corresponding to the position indicated by the processed selected actual motion vector is the predicted block of the reference block. The method according to claim 3 or 4, including the method described in claim 3 or 4.

7. The method according to claim 5 or 6, wherein the pre-set pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

8. The step of using the predicted motion vector of the block to be processed as the initial motion vector of the block to be processed. The method according to any one of claims 1 to 7, further comprising:

9. The method is used for video decoding, and the step of determining the reference block of the block to be processed is, To obtain the second identification information, the bitstream is parsed, A step of determining the reference block of the block to be processed based on the second identification information. The method according to any one of claims 1 to 8, including the method described in any one of claims 1 to 8.

10. The method is used for video encoding, and the step of determining the reference block of the block to be processed is, The step of selecting from one or more candidate reference blocks of the block to be processed the candidate reference block that has the minimum rate distortion cost as the reference block of the block to be processed. The method according to any one of claims 1 to 8, including the method described in any one of claims 1 to 8.

11. A decision module is configured to determine a reference block of a block to be processed, wherein the reference block and the block to be processed have a pre-defined temporal or spatial correlation, the reference block has an initial motion vector, the initial motion vector of the reference block is obtained based on the predicted motion vector of the reference block, the predicted motion vector of the reference block is obtained based on the initial motion vector and motion vector offset, and the motion vector offset is obtained based on the initial motion vector and one or more pre-defined motion vector offsets, An acquisition module configured to use the initial motion vector of the reference block as the predicted motion vector of the block being processed, A device for acquiring motion vectors, comprising: The acquisition module is further configured to add the difference between the predicted motion vector of the block to be processed and the motion vector of the block to be processed in order to acquire the initial motion vector of the block to be processed. Device.

12. The acquisition module, The predicted motion vector of the reference block is used as the initial motion vector of the reference block, or To obtain the initial motion vector of the reference block, the difference between the predicted motion vector of the reference block and the motion vector of the reference block is added together. The apparatus according to claim 11, further configured as follows.

13. The acquisition module, From the reference frame of the reference block, a picture block indicated by the initial motion vector of the reference block is obtained, and the obtained picture block is used as a temporary prediction block of the reference block. To obtain one or more actual motion vectors, the initial motion vector of the reference block and the one or more pre-set motion vector offsets are added together, so that each actual motion vector indicates a search position. Obtain one or more candidate prediction blocks at the search position indicated by the one or more actual motion vectors, and each search position corresponds to one candidate prediction block. From the one or more candidate prediction blocks, the candidate prediction block that has the smallest pixel difference with the temporary prediction block is selected as the prediction block of the reference block. The apparatus according to claim 11 or 12, further configured as follows.

14. The device is configured for bidirectional prediction, the reference frame includes a reference frame for a first direction and a reference frame for a second direction, the initial motion vector includes an initial motion vector for a first direction and an initial motion vector for a second direction, and the acquisition module is From the reference frame of the reference block in the first direction, obtain the first picture block indicated by the initial motion vector of the reference block in the first direction. From the reference frame of the reference block in the second direction, obtain a second picture block indicated by the initial motion vector of the reference block in the second direction. To obtain the temporary prediction block of the reference block, the first picture block and the second picture block are weighted. The apparatus according to claim 13, which is particularly configured as follows.

15. A rounding module is configured to round the motion vector resolution of the actual motion vector so that the motion vector resolution of the processed actual motion vector becomes equal to the pre-set pixel precision, if the motion vector resolution of the actual motion vector is higher than the pre-set pixel precision. The apparatus according to claim 13 or 14, further comprising:

16. The acquisition module, From the one or more candidate prediction blocks, select the actual motion vector corresponding to the candidate prediction block that has the smallest pixel difference from the temporary prediction block. If the motion vector resolution of the selected actual motion vector is higher than the preset pixel precision, the motion vector resolution of the selected actual motion vector is rounded so that the motion vector resolution of the processed selected actual motion vector is equal to the preset pixel precision. The predicted block corresponding to the position indicated by the processed selected actual motion vector is determined to be the predicted block of the reference block. The apparatus according to claim 13 or 14, which is particularly configured as follows.

17. The apparatus according to claim 15 or 16, wherein the pre-set pixel precision is integer pixel precision, 1 / 2 pixel precision, 1 / 4 pixel precision, or 1 / 8 pixel precision.

18. The acquisition module, The predicted motion vector of the block to be processed is used as the initial motion vector of the block to be processed. The apparatus according to any one of claims 11 to 17, which is particularly configured as follows.

19. The aforementioned device is used for video decoding, and the decision module is, To obtain the second identification information, the bitstream is parsed, Based on the second identification information, the reference block of the block to be processed is determined. The apparatus according to any one of claims 11 to 18, which is particularly configured as follows.

20. The aforementioned device is used for video coding, and the decision module is, From one or more candidate reference blocks of the block to be processed, the candidate reference block with the minimum rate distortion cost is selected as the reference block of the block to be processed. The apparatus according to any one of claims 11 to 18, which is particularly configured as follows.

21. A device for acquiring motion vectors, wherein the device is used for video encoding or video decoding. A processor and memory, wherein the processor and the memory are connected to each other. The memory is configured to store program code and video data. The processor and memory are configured to read the program code stored in the memory in order to perform the method according to any one of claims 1 to 10. A device equipped with the following features.

22. A computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the instructions enable the computer to perform the method according to any one of claims 1 to 10.