Determination method of motion vector prediction (MVP) candidate, storage medium and electronic device

By acquiring multiple types of MVP candidates and performing template matching and deduplication, the problem of insufficient candidate types in AVS4 is solved, thereby improving coding efficiency and coding gain.

CN121099063APending Publication Date: 2025-12-09ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410740234.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2025-12-09

AI Technical Summary

Technical Problem

The AVS4 UMVE starting point selection algorithm has an insufficient number of candidate types and does not make full use of historical motion vector prediction and motion vector angle prediction, resulting in low coding gain and increased computational complexity.

Method used

Obtain an MVP candidate list, including spatial, temporal, historical motion vector prediction, and motion vector angle prediction candidates. Determine the best basic candidate MVP through template matching and deduplication algorithms.

Benefits of technology

It improves coding gain, reduces computational complexity, and enables efficient selection of the best basic candidate MVP.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121099063A_ABST
    Figure CN121099063A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a motion vector prediction (MVP) candidate determination method, a storage medium and an electronic device, and the method comprises the steps: obtaining an MVP candidate list, and enabling the candidate MVP types in the MVP candidate list to comprise a space-domain motion vector candidate MVP, a time-domain motion vector candidate MVP, a historical motion vector prediction (HMVP) candidate MVP, and a motion vector angle prediction (MVAP) candidate MVP; and determining a basic candidate MVP according to the MVP candidate list. The problem that the coding gain is low due to the fact that the optimal basic candidate MVP cannot be selected in the prior art is solved, and the effects of efficiently selecting the optimal basic candidate MVP and improving the coding gain are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of communications, and in particular, to a method for determining a motion vector prediction (MVP) candidate, a storage medium and an electronic device. BACKGROUND

[0002] The Ultimate Motion Vector Expression (UMVE) technology is a relatively important encoding tool for improving compression performance in a new generation of video encoding technology, AVS4. The technology is based on a starting point, base MVP, of a motion candidate, i.e., a motion vector prediction (MVP), and performs offset to obtain a more optimal motion candidate. The technology uses three parameters to express motion vector offset information, i.e., a starting point, a motion distance and a motion direction.

[0003] In related technologies, the UMVE starting point selection algorithm of AVS4 is relatively simple, and has the following problems: (1) the candidate types used to determine the base MVP are limited to spatial and / or temporal MVPs, the number of candidate types is insufficient, and history-based motion vector prediction (HMVP), motion vector angle prediction (MVAP) and other candidate types are not fully utilized to further improve encoding gain. (2) The selected candidate MVPs are partially the same, which introduces redundant calculation, increases calculation complexity and reduces encoding efficiency. (3) The entire process of determining the base MVP does not involve sorting the candidate MVPs according to certain criteria, and determining the best candidate MVP as the base MVP according to the sorting result.

[0004] Based on the above reasons, the base MVP selected by the UMVE starting point selection algorithm of AVS4 may not be the best, which will reduce the encoding gain to some extent. SUMMARY

[0005] Embodiments of the present application provide a method for determining a motion vector prediction (MVP) candidate, a storage medium and an electronic device to at least solve the problem of low encoding gain caused by the inability to select the best base candidate MVP in related technologies.

[0006] According to one embodiment of the present application, a method for determining a motion vector prediction (MVP) candidate is provided, comprising: obtaining an MVP candidate list, wherein the types of candidate MVPs in the MVP candidate list comprise: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, a history-based motion vector prediction (HMVP) candidate MVP, and a motion vector angle prediction (MVAP) candidate MVP; and determining a base candidate MVP according to the MVP candidate list.

[0007] According to another embodiment of the present application, a computer readable storage medium is also provided, wherein the computer readable storage medium stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.

[0008] According to still another embodiment of the present application, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.

[0009] According to still another embodiment of the present application, a computer program product is also provided, comprising computer programs / instructions, which, when executed by a processor, implement the steps in any of the above method embodiments.

[0010] By the present application, a method for determining a motion vector prediction (MVP) candidate is provided, comprising: obtaining an MVP candidate list, wherein the types of candidate MVPs in the MVP candidate list comprise: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, a history-based motion vector prediction (HMVP) candidate MVP, and a motion vector angle prediction (MVAP) candidate MVP; and determining a base candidate MVP according to the MVP candidate list. The problem that the best base candidate MVP cannot be selected in the related art, resulting in low coding gain, is solved, and the best base candidate MVP is efficiently selected, and the effect of improving coding gain is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 is a schematic diagram of motion derivation of UMVE in the related art;

[0012] Figure 2 is an example diagram of a top-left corner luma sample coordinate position of a current block in the related art;

[0013] Figure 3 is an example diagram of spatial neighboring blocks of a current block in the related art;

[0014] Figure 4 is an example diagram of left and top neighboring 4x4 blocks of a current block in the related art;

[0015] Figure 5 is a schematic diagram of the principle of a template matching method in the related art;

[0016] Figure 6 is a hardware structure block diagram of a computer terminal of the determination method of the MVP candidate in the embodiment of the application;

[0017] Figure 7 is a flow chart of the determination method of the motion vector prediction MVP candidate in the embodiment of the application;

[0018] Figure 8 is a schematic diagram of the principle of the determination method of the motion vector prediction MVP candidate in the embodiment of the application. DETAILED DESCRIPTION

[0019] Hereinafter, the embodiments of the application will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

[0020] It should be noted that the terms "first", "second", and the like in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.

[0021] In the related art, the UMVE technology is a motion vector offset compensation method proposed in AVS4 for direct / skip mode, and its technical features include: (1) the motion vector derived in the direct / skip mode is offset, and the MV of the direct / skip mode is further refined to better perform prediction; (2) the specific offset information of the motion vector is determined by the encoder and transmitted to the decoder in the code stream, and the motion vector information that needs to be transmitted by the UMVE technology includes: the starting point, the motion distance, and the motion direction. Figure 1 is a schematic diagram of the principle of motion derivation in the related art UMVE, as shown in Figure 1 , a motion candidate is taken as a starting point, and is offset in the up, down, left, and right four directions, the starting point has two (2base MV), so the selected initial point (two choices), the offset direction (four choices), and the offset distance (five choices or eight choices, determined by the identification bit in the image header) need to be indicated in the code stream. The offset distance is determined by the index in the code stream. The relationship between the index and the specific offset distance is shown in Table 1 or Table 2, and an identification bit is transmitted in the image header to determine whether Table 1 or Table 2 is used, and which table is used in the current image is determined according to the average offset selected in the UMVE mode of the previous image.

[0022] Table 1 UMVE mode MVD offset binary table

[0023] MVD offset (pel) 1 / 4 1 / 2 1 2 4 Codeword of index 1 01 001 0001 0000

[0024] Table 2 UMVE mode MVD offset binary table

[0025] MVD offset (Pel) 1 / 4 1 / 2 1 2 4 8 16 32 Codeword of index 000 001 011 010 10 110 1110 1111

[0026] In the related art, the time-domain motion vector candidate derivation method is as follows: for the direct and skip modes, the L0 motion vector stored in the time-domain motion information storage unit of the luma sample with the same coordinate position as the top-left corner of the current block in the reference image queue 1 with the reference index value of 0 is scaled to derive the forward and backward motion vectors of the current block, and the L0 and L1 reference frame indexes of the current block are set to 0, wherein the coordinate position of the top-left corner of the current block is defined according to the AVS standard. Figure 2 is an example diagram of the coordinate position of the top-left corner of the current block in the related art, as shown in Figure 2 The current block is a 16x16 block, and the coordinate position of the top-left corner of the current block is the position of the 4x4 white block in the diagram (the coordinate position of each block in the AVS is defined in units of 4x4 blocks). If the L0 motion vector in the time-domain motion information storage unit is unavailable, the spatial domain derivation method is used to derive the motion vector of the current block.

[0027] In the related art, the spatial domain motion vector candidate derivation method, Figure 3 is an example diagram of the spatially adjacent blocks of the current block in the related art, as shown in Figure 3 The spatially adjacent block availability of the left-down F, right-up G (inside), right-up C (outside), left A, and top-left D positions is determined, and if there are spatially adjacent blocks at the left-down F, right-up G (inside), right-up C (outside), left A, and top-left D positions, the motion vector information of the spatially adjacent blocks is taken as the spatial domain motion vector candidate, and several are taken.

[0028] In the related art, the MVAP motion vector candidate derivation method, Figure 4 is an example diagram of the left and top adjacent 4x4 blocks of the current block in the related art, as shown in Figure 4 The availability of the left and top adjacent 4x4 blocks of the current block is determined, and if there are available spatially adjacent blocks at the left and top adjacent positions of the current block, the motion vector information of the available spatially adjacent blocks is taken as the motion vector prediction candidate of the MVAP, and several are taken.

[0029] In the related art, the HMVP motion vector prediction candidate derivation method is based on historical information motion vector prediction. The HMVP technology copies 8 motion information candidates from the previous coding block into the FIFO, and the FIFO keeps updating in a first-in, first-out manner. If the motion candidate in the FIFO is the same as the motion information just coded, the repeated candidate will be removed first, and the motion information of the current block will be added to the tail of the FIFO. If the motion information of the current block is different from the motion information of any candidate in the FIFO, the first candidate in the FIFO will be removed, and the latest motion information will be added to the end of the FIFO to ensure that the FIFO always retains 8 latest motion candidates.

[0030] In the related art, template matching is a coding technology used to refine the motion information of the current block to make the MV of the current block more accurate. Figure 5 is a schematic diagram of the principle of the template matching method in the related art, as shown in Figure 5 Template matching mainly finds an MV to minimize the matching error between the template of the current image (the top and / or left adjacent block of the current block) and the template of the reference image.

[0031] In the related art, the UMVE starting point selection algorithm of AVS4 is relatively simple, and the determination process is as follows: (1) judge the availability of the left lower, right upper (inside), right upper (outside), left and left upper spatial adjacent blocks; (2) if two or more of the left lower, right upper (inside), right upper (outside), left and left upper spatial adjacent blocks are available, take the MVs of the first two available spatial adjacent blocks as the base MVPs; otherwise, if only one spatial adjacent block is available, take the MV of the available spatial adjacent block as the first base MVP, and the other base MVP is the temporal MVP; otherwise, if all spatial adjacent blocks are unavailable, the first base MVP is the temporal MVP, and the second base MVP is the default zero MVP.

[0032] In summary, the starting point selection algorithm in the related art has the problems of partially same candidate MVPs, insufficient types of candidate MVPs, and not using sorting for optimization, which increases the calculation complexity and reduces the coding gain to a certain extent.

[0033] The method embodiments provided in the embodiments of the application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the execution on the computer terminal as an example, Figure 6 is a hardware structure block diagram of the computer terminal of the determination method of the MVP candidate of the embodiments of the application. As shown in Figure 6 The computer terminal can include one or more ( Figure 6The computer terminal shown in FIG. 6 only includes one processor 602 (the processor 602 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 604 for storing data. The computer terminal can further include a transmission device 606 for communication function and an input / output device 608. Those skilled in the art can understand that, Figure 6 The structure shown in FIG. 6 is only schematic and does not limit the structure of the computer terminal. For example, the computer terminal can include more or fewer components than those shown in FIG. 6, or have a different configuration from that shown in FIG. 6. Figure 6 Figure 6 The structure shown in FIG. 6 is only schematic and does not limit the structure of the computer terminal. For example, the computer terminal can include more or fewer components than those shown in FIG. 6, or have a different configuration from that shown in FIG. 6.

[0034] The memory 604 can be used to store computer programs, such as software programs of application software and modules, for example, a computer program corresponding to the method for determining a motion vector prediction MVP candidate in the embodiments of the present application. The processor 602 can execute various functional applications and data processing by running the computer program stored in the memory 604, that is, implement the method described above. The memory 604 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some examples, the memory 604 can further include a memory remotely arranged with respect to the processor 602, and the remote memory can be connected to the computer terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0035] The transmission device 606 is used to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 606 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

[0036] The embodiments of the present application provide a method for determining a motion vector prediction MVP candidate, Figure 7 is a flowchart of the method for determining a motion vector prediction MVP candidate in the embodiments of the present application, as shown in FIG. 7, the flow includes the following steps: Figure 7

[0037] In step S702, a MVP candidate list is obtained, wherein the types of the candidate MVPs in the MVP candidate list include: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, an HMVP candidate MVP, and an MVAP candidate MVP.​​

[0038] In an example embodiment, the MVP candidate list is acquired, comprising: respectively constructing a spatial motion vector prediction candidate list, an MVAP motion vector prediction candidate list, an HMVP motion vector prediction candidate list, and a temporal motion vector prediction candidate list.

[0039] In an example embodiment, the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is constructed, comprising: in a case that one of a width and a height of the current block is less than m or the width and the height of the current block are both equal to m, constructing the spatial motion vector prediction candidate list; otherwise, constructing the MVAP motion vector prediction candidate list, wherein m is a preset positive integer.

[0040] In an embodiment of the present application, in a case that one of the width and the height of the current block is less than 8 or the width and the height of the current block are both equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then a deduplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0041] In an example embodiment, after the MVAP motion vector prediction candidate list is constructed, it further comprises: performing the same MVP candidate deduplication on the MVAP motion vector prediction candidate list.

[0042] In an example embodiment, the spatial motion vector prediction candidate list is constructed, comprising: constructing the spatial motion vector prediction candidate list, wherein a number of spatial motion vector prediction candidates MVPs in the spatial motion vector prediction candidate list is less than or equal to n, wherein n is a preset positive integer.

[0043] In an embodiment of the present application, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates.

[0044] In step S704, a base candidate MVP is determined according to the MVP candidate list.

[0045] In an example embodiment, the base candidate MVP is determined according to the MVP candidate list, comprising: in a case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, determining a first base candidate MVP as a temporal motion vector prediction candidate MVP and determining a second base candidate MVP as a zero candidate, wherein the base candidate MVP comprises the first base candidate MVP and the second base candidate MVP.

[0046] Or, in the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1 and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, one of the base candidate MVPs is determined as the spatial motion vector prediction candidate MVP or the MVAP candidate MVP, and the other is determined as the temporal motion vector prediction candidate MVP;

[0047] Or, in the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0 and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, one of the base candidate MVPs is determined as the HMVP candidate MVP, and the other is determined as the temporal motion vector prediction candidate MVP;

[0048] Or, in the case that the sum of the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the number of candidate MVPs in the HMVP motion vector prediction candidate list is greater than 1, the same MVP candidate de-duplication is performed on the MVP candidate list, in the case that the number of candidate MVPs in the de-duplicated MVP candidate list is equal to 1, the first base candidate MVP is determined as the corresponding candidate MVP, and the second base candidate MVP is determined as zero candidate; in the case that the number of candidate MVPs in the de-duplicated MVP candidate list is greater than or equal to 2, the cost calculation is performed on each candidate MVP in the MVP candidate list, and the two candidate MVPs corresponding to the minimum cost value are determined as the base candidate MVPs.

[0049] In an example embodiment, the cost calculation on each candidate MVP in the MVP candidate list comprises: the cost calculation on each candidate MVP in the MVP candidate list is performed by a template matching method to obtain the cost value of each candidate MVP.

[0050] In an example embodiment, in the case that the number of candidate MVPs in the de-duplicated MVP candidate list is greater than or equal to 2, after the cost calculation on each candidate MVP in the MVP candidate list, the method further comprises: obtaining the two candidate MVPs corresponding to the minimum cost value, the candidate MVPs comprising a first candidate MVP and a second candidate MVP; calculating according to the first candidate MVP and the second candidate MVP to obtain a third candidate MVP; performing the cost calculation on the third candidate MVP by the template matching method to obtain the cost value of the third candidate MVP; and determining the two candidate MVPs with the minimum cost value as the base candidate MVPs according to the cost values of the first candidate MVP, the second candidate MVP and the third candidate MVP.

[0051] In the embodiment of the present application, a new candidate MVP is generated by performing certain mathematical operations, such as taking average, taking difference, etc., on the horizontal component and the vertical component of the UMVE base candidate 0 and the base candidate 1, respectively, the template matching cost of the new candidate MVP is calculated and compared with the UMVE base candidate 0 and the base candidate 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidate MVP, that is, the UMVE base candidate 0 is set as the candidate MVP with the minimum cost, and the base candidate 1 is set as the candidate MVP with the second minimum cost.

[0052] In one exemplary embodiment, the third candidate MVP is obtained according to the calculation of the first candidate MVP and the second candidate MVP, including: performing calculation on the horizontal component and the vertical component of the first candidate MVP and the second candidate MVP, respectively, to obtain the third candidate MVP.

[0053] Through the above steps, a determination method of a motion vector prediction MVP candidate is provided, and the MVP candidate list is obtained, wherein the types of the candidate MVPs in the MVP candidate list include: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, a history-based motion vector prediction HMVP candidate MVP, and a motion vector angle prediction MVAP candidate MVP; and the base candidate MVP is determined according to the MVP candidate list. The problem that the best base candidate MVP cannot be selected in the related art, resulting in low coding gain, is solved, and the effects of efficiently selecting the best base candidate MVP and improving the coding gain are achieved.

[0054] The determination method of the motion vector prediction MVP candidate provided in the embodiment of the present application can be applied to the encoding or decoding operation of the UMVE method in AVS4.

[0055] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and necessary general hardware platforms, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disc), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.

[0056] In the embodiment, a device for determining a motion vector prediction (MVP) candidate is also provided, which is configured to implement the above-described embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware or a combination of software and hardware is also possible and contemplated.

[0057] The device for determining a motion vector prediction (MVP) candidate provided by the embodiment includes: an acquisition unit configured to acquire an MVP candidate list, wherein the types of candidate MVPs in the MVP candidate list include: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, a history-based motion vector prediction (HMVP) candidate MVP, and a motion vector angle prediction (MVAP) candidate MVP; and a selection and determination unit configured to determine a base candidate MVP according to the MVP candidate list.

[0058] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the implementation can be achieved by the following ways, but is not limited thereto: all the above modules are located in the same processor; or each of the above modules is located in different processors in any combination.

[0059] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the implementation can be achieved by the following ways, but is not limited thereto: all the above modules are located in the same processor; or each of the above modules is located in different processors in any combination.

[0060] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0061] In an example embodiment, the above computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic or optical disk, and various media that can store computer programs.

[0062] The embodiment of the present application also provides an electronic device, which includes a memory storing a computer program and a processor configured to run the computer program to execute the steps in any of the above method embodiments.

[0063] In an example embodiment, the above electronic device can further include a transmission device connected to the processor and an input and output device connected to the processor.

[0064] The embodiment of the present application also provides a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps in any of the method embodiments described above.

[0065] The specific examples in the embodiment can refer to the examples described in the above embodiments and exemplary embodiments, which are not described herein again.

[0066] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, which can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.

[0067] In order to enable those skilled in the art to better understand the technical solutions of the present application, the following describes the embodiments in combination with specific scenarios.

[0068] Embodiment one

[0069] The embodiment of the present application provides a method for determining a motion vector prediction (MVP) candidate, selects a UMVE basic MVP based on template matching, performs a template matching-based reordering process on an MVP candidate list composed of a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, an MVAP candidate MVP and an HMVP candidate MVP, and encodes the first two motion candidates with the minimum cost in the reordered motion candidate list as the basic MVP, thereby improving compression performance.

[0070] Figure 8 is a flow principle diagram of the method for determining a motion vector prediction (MVP) candidate of the embodiment of the present application, as shown in Figure 8 , comprising the following steps:

[0071] Step 1: Construct a spatial motion vector prediction candidate list.

[0072] If one of the width and height of the current block is less than 8 or the width and height are both equal to 8, a spatial motion vector prediction candidate list is constructed according to a spatial motion vector candidate derivation method; otherwise, an MVAP motion vector prediction candidate list is first constructed according to an MVAP motion vector candidate derivation method, and then a deduplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0073] Step 2: Constructing the HMVP motion vector prediction candidate list.

[0074] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0075] Step 3: Constructing the temporal motion vector prediction candidate list.

[0076] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0077] Step 4: Selecting the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0078] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0079] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0080] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0081] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.

[0082] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the MVP candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0083] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 3. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, then further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0084] Table 3 sequence header adding umve_tm_enable_flag control flag

[0085]

[0086] Embodiment two

[0087] In embodiment two, a scheme different from that in embodiment one is adopted for setting the types of different base candidate MVPs in step 4, that is, the setting types of the two base candidate MVPs are exchanged, and the details are as follows:

[0088] Step 1: constructing a spatial motion vector prediction candidate list.

[0089] If one of the width and height of the current block is less than 8 or both of the width and height of the current block are equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method as described above; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0090] Step 2: Construct the HMVP motion vector prediction candidate list.

[0091] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0092] Step 3: Construct the temporal motion vector prediction candidate list.

[0093] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0094] Step 4: Select the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0095] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0096] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0097] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0098] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.

[0099] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the MVP candidate list, and the candidate list is reordered in ascending order, and then the first two MVP candidates with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0100] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 4. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, then further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0101] Table 4 sequence header adding umve_tm_enable_flag control flag

[0102]

[0103] Embodiment three

[0104] In embodiment three, a scheme different from that in embodiment one is adopted for setting the types of different base candidate MVPs in step 4, that is, the setting types of the two base candidate MVPs are exchanged, and the details are as follows:

[0105] Step 1: constructing a spatial motion vector prediction candidate list.

[0106] If one of the width and height of the current block is less than 8 or both of the width and height of the current block are equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method as described above; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0107] Step 2: Construct the HMVP motion vector prediction candidate list.

[0108] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0109] Step 3: Construct the temporal motion vector prediction candidate list.

[0110] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0111] Step 4: According to the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list, the base candidate MVP of the UMVE is selected.

[0112] The base candidate MVP of the UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0113] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of the UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0114] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of the UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0115] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of the UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0116] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two MVP candidates with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0117] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 5. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, then further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0118] Table 5 sequence header adding umve_tm_enable_flag control flag

[0119]

[0120] Embodiment Four

[0121] In embodiment four, a scheme different from that in embodiment two is adopted for setting different types of base candidate MVPs in step 4, that is, the setting types of the two base candidate MVPs are exchanged, and the details are as follows:

[0122] Step 1: Construct a spatial motion vector prediction candidate list.

[0123] If one of the width and height of the current block is less than 8 or both of the width and height are equal to 8, the spatial motion vector predictor candidate list is constructed according to the spatial motion vector candidate derivation method as described above; otherwise, the MVAP motion vector predictor candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector predictor candidate list.

[0124] Step 2: Construct the HMVP motion vector predictor candidate list.

[0125] The HMVP motion vector predictor candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0126] Step 3: Construct the temporal motion vector predictor candidate list.

[0127] The temporal motion vector predictor candidate list is constructed according to the temporal motion vector candidate derivation method.

[0128] Step 4: Select the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector predictor candidate list or the MVAP motion vector predictor candidate list and the HMVP motion vector predictor candidate list.

[0129] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector predictor candidate or the MVAP motion vector predictor candidate.

[0130] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list or the MVAP motion vector predictor candidate list and the HMVP motion vector predictor candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0131] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list or the MVAP motion vector predictor candidate list is 1, and the number of candidate MVPs in the HMVP motion vector predictor candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0132] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list or the MVAP motion vector predictor candidate list is 0, and the number of candidate MVPs in the HMVP motion vector predictor candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0133] In the case that the sum of the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all candidate MVPs in the MVP candidate list are different, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidate, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0134] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 6. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided by the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0135] Table 6 sequence header adding umve_tm_enable_flag control flag

[0136]

[0137] Embodiment five

[0138] The embodiment of the present application provides a method for determining a motion vector prediction (MVP) candidate, and the method is based on template matching to select a UMVE basic MVP, performs a reordering process based on template matching on an MVP candidate list composed of a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, an MVAP candidate MVP and an HMVP candidate MVP, takes the first two motion vector candidates MVP with minimum cost in the reordered motion candidate list, performs further mathematical operation on the selected first two motion vector candidates MVP with minimum cost, obtains a third motion vector candidate MVP, selects according to the cost value of the first two motion vector candidates MVP and the cost value of the third motion vector candidate MVP, and further obtains two motion vector candidates MVP with minimum cost among the three as the basic MVP for encoding, thereby further improving the compression performance.

[0139] In the embodiment five, further calculation and selection are performed on the two basic candidate MVPs obtained in step 4 in the above embodiment, and the specific process is as follows:

[0140] Step 1: constructing a spatial motion vector prediction candidate list.

[0141] If one of the width and height of the current block is less than 8 or the width and height are both equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0142] Step 2: constructing an HMVP motion vector prediction candidate list.

[0143] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidate MVPs.

[0144] Step 3: constructing a temporal motion vector prediction candidate list.

[0145] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0146] Step 4: selecting the basic candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0147] The basic candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0148] In the case that the number of candidate MVPs in the spatial MVP prediction candidate list or the MVAP MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list are all 0, the UMVE base candidate 0 (i.e. the first base candidate MVP in the above embodiment) is set as a temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as a zero candidate.

[0149] In the case that the number of candidate MVPs in the spatial MVP prediction candidate list or the MVAP MVP prediction candidate list is 1, and the number of candidate MVPs in the HMVP MVP prediction candidate list is 0, the base candidate 0 of the UMVE is set as a spatial candidate MVP, and the base candidate 1 is set as a temporal candidate MVP.

[0150] In the case that the number of candidate MVPs in the spatial MVP prediction candidate list or the MVAP MVP prediction candidate list is 0, and the number of candidate MVPs in the HMVP MVP prediction candidate list is 1, the base candidate 0 of the UMVE is set as a temporal candidate MVP, and the base candidate 1 is set as a HMVP candidate MVP.

[0151] In the case that the sum of the number of candidate MVPs in the spatial MVP prediction candidate list or the MVAP MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the MVP candidate, and the base candidate 1 is set as a zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, a cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, i.e. the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0152] Step 5: the new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0153] A new candidate is generated by performing a mathematical operation such as taking an average, taking a difference, etc. on the horizontal component and the vertical component of the UMVE base candidate 0 and the base candidate 1, respectively, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidates, i.e. the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0154] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 7. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE basic candidate MVP selection method provided by the embodiment of the application can take effect. The decoding end first parses umve_enable_flag. If umve_enable_flag is 1, umve_tm_enable_flag is further parsed. If umve_tm_enable_flag is 1, the same UMVE basic candidate MVP selection process as the encoding end is performed, so as to ensure the consistency of coding and decoding.

[0155] Table 7 Sequence header adding umve_tm_enable_flag control flag

[0156]

[0157] Embodiment six

[0158] In embodiment six, a scheme different from that of embodiment one is adopted for setting the types of different basic candidate MVPs in step 4, that is, the setting types of two basic candidate MVPs are exchanged. Meanwhile, further calculation and selection are performed on the two basic candidate MVPs obtained in step 4, as follows:

[0159] Step 1: Constructing a spatial motion vector prediction candidate list.

[0160] If one of the width and height of the current block is less than 8 or the width and height are both equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method described above. Otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0161] Step 2: Constructing an HMVP motion vector prediction candidate list.

[0162] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method. There are at most 8 different HMVP candidate MVPs.

[0163] Step 3: Constructing a temporal motion vector prediction candidate list.

[0164] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0165] Step 4: Select the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial MVP candidate list or the MVAP MVP candidate list and the HMVP MVP candidate list.

[0166] Select the base candidate MVP of UMVE according to the number of spatial and HMVP candidates, wherein the spatial includes spatial MVP candidates or MVAP MVP candidates.

[0167] In the case that the number of candidate MVPs in the spatial MVP candidate list or the MVAP MVP candidate list and the HMVP MVP candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as a temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as a zero candidate.

[0168] In the case that the number of candidate MVPs in the spatial MVP candidate list or the MVAP MVP candidate list is 1, and the number of candidate MVPs in the HMVP MVP candidate list is 0, the base candidate 0 of UMVE is set as a temporal candidate MVP, and the base candidate 1 is set as a spatial candidate MVP.

[0169] In the case that the number of candidate MVPs in the spatial MVP candidate list or the MVAP MVP candidate list is 0, and the number of candidate MVPs in the HMVP MVP candidate list is 1, the base candidate 0 of UMVE is set as a temporal candidate MVP, and the base candidate 1 is set as an HMVP candidate MVP.

[0170] In the case that the sum of the number of candidate MVPs in the spatial MVP candidate list or the MVAP MVP candidate list and the number of candidate MVPs in the HMVP MVP candidate list is greater than 1, first, a de-duplication algorithm is performed on the MVP candidate list composed of spatial MVP candidates, temporal MVP candidates and HMVP candidates, so that all MVP candidates in the MVP candidate list are different, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the base candidate 0 of UMVE is set as the candidate MVP, and the base candidate 1 is set as a zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, first, a cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the smallest cost are taken as the base candidates of UMVE, i.e. the base candidate 0 of UMVE is set as the candidate with the smallest cost, and the base candidate 1 is set as the candidate with the second smallest cost.

[0171] Step 5: The new candidate MVP generated from the two base candidate MVPs is compared with the two base candidate MVPs.

[0172] A new candidate is generated by performing some mathematical operation such as averaging, differencing, etc. on the horizontal and vertical components of the UMVE base candidate 0 and 1, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the lowest cost are selected as the final UMVE base candidates, i.e. the UMVE base candidate 0 is set as the candidate with the lowest cost, and the base candidate 1 is set as the candidate with the second lowest cost.

[0173] To facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 8, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided by the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, then further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed, ensuring consistency of encoding and decoding.

[0174] Table 8 sequence header adding umve_tm_enable_flag control flag

[0175]

[0176] Embodiment seven

[0177] In embodiment seven, a scheme different from that of embodiment one is adopted for setting the types of different base candidate MVPs in step 4, i.e. the setting types of the two base candidate MVPs are exchanged, and further calculation and selection are performed on the two base candidate MVPs obtained in step 4, as follows:

[0178] Step 1: constructing the spatial motion vector prediction candidate list.

[0179] If one of the width and height of the current block is less than 8 or both the width and height are equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method described above; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0180] Step 2: constructing the HMVP motion vector prediction candidate list.

[0181] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0182] Step 3: Constructing a temporal motion vector prediction candidate list.

[0183] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0184] Step 4: Selecting the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0185] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0186] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0187] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0188] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0189] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more MVP candidates in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0190] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0191] A new candidate is generated by performing a mathematical operation such as taking an average, taking a difference, etc. on the horizontal component and the vertical component of the UMVE base candidate 0 and 1, respectively, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0192] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 9, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed, to ensure the consistency of coding and decoding.

[0193] Table 9 sequence header adding umve_tm_enable_flag control flag

[0194]

[0195] Embodiment eight

[0196] In embodiment eight, a different scheme from embodiment two is adopted for setting the types of different base candidate MVPs in step 4, i.e., the setting types of two base candidate MVPs are exchanged, and further calculation and selection are performed for the two base candidate MVPs obtained in step 4, as follows:

[0197] Step 1: Construct the spatial motion vector prediction candidate list.

[0198] If one of the width and height of the current block is less than 8 or both the width and height are equal to 8, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method as described above; otherwise, the MVAP motion vector prediction candidate list is first constructed according to the MVAP motion vector candidate derivation method, and then the de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.

[0199] Step 2: Construct the HMVP motion vector prediction candidate list.

[0200] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidate MVPs.

[0201] Step 3: Construct the temporal motion vector prediction candidate list.

[0202] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0203] Step 4: Select the base candidate MVPs of UMVE according to the number of candidate MVPs in the motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0204] The base candidate MVPs of UMVE are selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.

[0205] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e., the first base candidate MVP in the above embodiments) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e., the second base candidate MVP in the above embodiments) is set as the zero candidate.

[0206] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0207] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0 and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, UMVE base candidate 0 is set as the HMVP candidate MVP and base candidate 1 is set as the temporal candidate MVP.

[0208] In the case that the sum of the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the number of candidate MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, UMVE base candidate 0 is set as the candidate MVP and base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as UMVE base candidates, that is, UMVE base candidate 0 is set as the candidate with the minimum cost and base candidate 1 is set as the candidate with the second minimum cost.

[0209] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0210] A new candidate is generated by performing a mathematical operation such as taking an average, taking a difference, etc. on the horizontal component and the vertical component of the UMVE base candidates 0 and 1, the template matching cost of the new candidate is calculated and compared with the UMVE base candidates 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidate MVP, that is, UMVE base candidate 0 is set as the candidate with the minimum cost and base candidate 1 is set as the candidate with the second minimum cost.

[0211] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 10, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided by the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed, to ensure the consistency of coding and decoding.

[0212] Table 10 Sequence header with umve_tm_enable_flag control flag

[0213]

[0214] Embodiment Nine

[0215] In Embodiment Nine, a different construction method of spatial motion vector prediction candidate list is adopted, which is as follows:

[0216] Step 1: Construct spatial motion vector prediction candidate list.

[0217] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates MVP.

[0218] Step 2: Construct HMVP motion vector prediction candidate list.

[0219] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0220] Step 3: Construct temporal motion vector prediction candidate list.

[0221] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0222] Step 4: Select the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0223] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.

[0224] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set to the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set to zero candidate.

[0225] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set to the spatial candidate MVP, and the base candidate 1 is set to the temporal candidate MVP.

[0226] In the case that the number of candidates in the spatial motion vector prediction candidate list is 0 and the number of candidates in the HMVP motion vector prediction candidate list is 1, the UMVE base candidate 0 is set as the temporal candidate MVP and the base candidate 1 is set as the HMVP candidate MVP.

[0227] In the case that the sum of the number of candidates in the spatial motion vector prediction candidate list and the number of candidates in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, i.e., the UMVE base candidate 0 is set as the candidate with the minimum cost and the base candidate 1 is set as the candidate with the second minimum cost.

[0228] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 11. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0229] Table 11 sequence header adding umve_tm_enable_flag control flag

[0230]

[0231] Embodiment Ten

[0232] In Embodiment Ten, a different construction method of the spatial motion vector prediction candidate list is adopted from Embodiment Two, which is as follows:

[0233] Step 1: constructing the spatial motion vector prediction candidate list.

[0234] The spatial motion vector predictor candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates MVP.

[0235] Step 2: Construct the HMVP motion vector predictor candidate list.

[0236] The HMVP motion vector predictor candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0237] Step 3: Construct the temporal motion vector predictor candidate list.

[0238] The temporal motion vector predictor candidate list is constructed according to the temporal motion vector candidate derivation method.

[0239] Step 4: According to the number of candidate MVPs in the spatial motion vector predictor candidate list and the HMVP motion vector predictor candidate list, select the base candidate MVP of UMVE.

[0240] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.

[0241] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list and the HMVP motion vector predictor candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0242] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list is 1, and the number of candidate MVPs in the HMVP motion vector predictor candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0243] In the case that the number of candidate MVPs in the spatial motion vector predictor candidate list is 0, and the number of candidate MVPs in the HMVP motion vector predictor candidate list is 1, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.

[0244] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a deduplication algorithm is performed on the candidate list composed of the spatial MVP candidates, the temporal MVP candidates, and the HMVP candidates, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are respectively performed according to the size of the deduplicated MVP candidate list. In an embodiment, if there is only one MVP candidate after deduplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as a zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after deduplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0245] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 12. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed, to ensure consistency of coding and decoding.

[0246] Table 12 sequence header adding umve_tm_enable_flag control flag

[0247]

[0248] Embodiment eleven

[0249] In embodiment eleven, a different method for constructing the spatial motion vector prediction candidate list is adopted, which is as follows:

[0250] Step 1: constructing a spatial motion vector prediction candidate list.

[0251] According to the spatial motion vector candidate derivation method, the spatial motion vector prediction candidate list is constructed, and there are at most five different spatial candidate MVPs.

[0252] Step 2: constructing a HMVP motion vector prediction candidate list.

[0253] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0254] Step 3: Constructing a temporal motion vector prediction candidate list.

[0255] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0256] Step 4: Selecting the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0257] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.

[0258] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0259] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0260] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0261] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidates, the temporal MVP candidates and the HMVP candidates, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the de-duplicated candidate list, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0262] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 13. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base candidate MVP selection method provided in the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base candidate MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0263] Table 13 sequence header adding umve_tm_enable_flag control flag

[0264]

[0265] Embodiment twelve

[0266] In embodiment twelve, a different method for constructing the spatial motion vector prediction candidate list is adopted, which is as follows:

[0267] Step 1: constructing the spatial motion vector prediction candidate list.

[0268] According to the spatial motion vector candidate derivation method, the spatial motion vector prediction candidate list is constructed, and there are at most five different spatial candidate MVPs.

[0269] Step 2: constructing the HMVP motion vector prediction candidate list.

[0270] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0271] Step 3: Constructing the temporal motion vector prediction candidate list.

[0272] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0273] Step 4: Selecting the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0274] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.

[0275] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0276] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0277] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0278] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidates, the temporal MVP candidates, and the HMVP candidates, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as a zero candidate; otherwise, if there are two or more candidate MVPs in the de-duplicated candidate list, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two MVP candidates with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0279] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 14. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base MVP selection method provided in the embodiment of the application takes effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0280] Table 14 sequence header adding umve_tm_enable_flag control flag

[0281]

[0282] Embodiment thirteen

[0283] In embodiment thirteen, a different method for constructing the spatial motion vector prediction candidate list is adopted than in embodiment five, and the method is as follows:

[0284] Step 1: constructing a spatial motion vector prediction candidate list.

[0285] According to the spatial motion vector candidate derivation method, the spatial motion vector prediction candidate list is constructed, and there are at most five different spatial candidate MVPs.

[0286] Step 2: constructing a HMVP motion vector prediction candidate list.

[0287] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0288] Step 3: Constructing the temporal motion vector prediction candidate list.

[0289] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0290] Step 4: Selecting the base candidate MVP of UMVE according to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list.

[0291] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.

[0292] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0293] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0294] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.

[0295] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate, and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are respectively performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidate MVP, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0296] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0297] A new candidate is generated by performing a mathematical operation such as taking an average, taking a difference, etc. on the horizontal component and the vertical component of the UMVE base candidate 0 and the base candidate 1, respectively, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidate, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0298] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 15, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base MVP selection method provided by the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0299] Table 15 sequence header adding umve_tm_enable_flag control flag

[0300]

[0301] Embodiment fourteen

[0302] In embodiment fourteen, the construction method of spatial motion vector prediction candidate list is different from that of embodiment six, and the details are as follows:

[0303] Step 1: Construct the spatial motion vector prediction candidate list.

[0304] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates MVP.

[0305] Step 2: Construct the HMVP motion vector prediction candidate list.

[0306] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0307] Step 3: Construct the temporal motion vector prediction candidate list.

[0308] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0309] Step 4: According to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list, select the base candidate MVP of UMVE.

[0310] According to the number of constructed spatial and HMVP candidates, select the base candidate MVP of UMVE.

[0311] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0312] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0313] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.

[0314] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated MVP candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0315] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0316] A mathematical operation such as taking the average, taking the difference, etc. is performed on the horizontal component and the vertical component of the UMVE base candidate 0 and 1 respectively to generate a new candidate, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0317] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 16, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base MVP selection method provided by the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0318] Table 16 sequence header adding umve_tm_enable_flag control flag

[0319]

[0320] Embodiment fifteen

[0321] In Embodiment Fifteen, a different construction method of spatial motion vector prediction candidate list is adopted, which is as follows:

[0322] Step 1: Construct the spatial motion vector prediction candidate list.

[0323] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates MVP.

[0324] Step 2: Construct the HMVP motion vector prediction candidate list.

[0325] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0326] Step 3: Construct the temporal motion vector prediction candidate list.

[0327] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0328] Step 4: According to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list, select the base candidate MVP of UMVE.

[0329] According to the number of constructed spatial and HMVP candidates, select the base candidate MVP of UMVE.

[0330] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0331] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP. In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0332] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the de-duplicated candidate list, firstly, cost calculation based on template matching is performed on each MVP candidate in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, i.e., the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0333] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0334] A new candidate is generated by performing a mathematical operation such as taking an average, taking a difference, etc. on the horizontal component and the vertical component of the UMVE base candidate 0 and 1, respectively, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidates, i.e., the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0335] For the convenience of flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 17, when umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base MVP selection method provided by the embodiment of the application can take effect, the decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0336] Table 17 sequence header adding umve_tm_enable_flag control flag

[0337]

[0338] Embodiment sixteen

[0339] In Embodiment Sixteen, a different construction method of spatial motion vector prediction candidate list is adopted, which is as follows:

[0340] Step 1: Construct the spatial motion vector prediction candidate list.

[0341] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most 5 different spatial candidates MVP.

[0342] Step 2: Construct the HMVP motion vector prediction candidate list.

[0343] The HMVP motion vector prediction candidate list is constructed according to the HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.

[0344] Step 3: Construct the temporal motion vector prediction candidate list.

[0345] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.

[0346] Step 4: According to the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list, select the base candidate MVP of UMVE.

[0347] According to the number of constructed spatial and HMVP candidates, select the base candidate MVP of UMVE.

[0348] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list and the HMVP motion vector prediction candidate list is both 0, the base candidate 0 (i.e. the first base candidate MVP in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base candidate MVP in the above embodiment) is set as the zero candidate.

[0349] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 1, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, the base candidate 0 of UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.

[0350] In the case that the number of candidate MVPs in the spatial motion vector prediction candidate list is 0, and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, the base candidate 0 of UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.

[0351] In the case that the sum of the number of MVPs in the spatial motion vector prediction candidate list and the number of MVPs in the HMVP motion vector prediction candidate list is greater than 1, firstly, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial MVP candidate, the temporal MVP candidate and the HMVP candidate, so that all the MVP candidates in the MVP candidate list are different from each other, and then different operations are performed according to the size of the de-duplicated MVP candidate list. In an embodiment, if there is only one candidate MVP after de-duplication, the UMVE base candidate 0 is set as the candidate MVP, and the base candidate 1 is set as zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, firstly, cost calculation based on template matching is performed on each candidate MVP in the candidate list, and the candidate list is reordered in ascending order, and then the first two candidate MVPs with the minimum cost are taken as the UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0352] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.

[0353] A mathematical operation such as taking the average, taking the difference, etc. is performed on the horizontal component and the vertical component of the UMVE base candidate 0 and 1 respectively to generate a new candidate, the template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1, and the two candidates with the minimum cost among the three are taken as the final UMVE base candidates, that is, the UMVE base candidate 0 is set as the candidate with the minimum cost, and the base candidate 1 is set as the candidate with the second minimum cost.

[0354] In order to facilitate flexible control, a control flag umve_tm_enable_flag is set in the sequence header, as shown in Table 18. When umve_enable_flag and umve_tm_enable_flag are both 1, the UMVE base MVP selection method provided by the embodiment of the application can take effect. The decoding end first parses umve_enable_flag, if umve_enable_flag is 1, further parses umve_tm_enable_flag, if umve_tm_enable_flag is 1, the same UMVE base MVP selection process as the encoding end is performed to ensure the consistency of coding and decoding.

[0355] Table 18 sequence header adding umve_tm_enable_flag control flag

[0356]

[0357] In the above-mentioned embodiments of the present application, the "block" can be a coding unit of video encoding of the UMVE method of AVS4, and can also be a decoding unit of video decoding of the UMVE method of AVS4, which is not limited herein.

[0358] In summary, the embodiments of the present application provide a method for determining a motion vector prediction (MVP) candidate, and the UMVE base MVP is selected based on template matching. The motion candidate list composed of spatial motion candidates, temporal motion candidates, MVAP motion candidates and HMVP motion candidates is reordered based on template matching. The first two motion candidates with the minimum cost in the reordered motion candidate list are selected as the base MVP for encoding. Alternatively, the first two motion candidates with the minimum cost are further mathematically operated to obtain a third motion candidate MVP. The base MVP is selected from the first two motion candidates with the minimum cost and the third motion candidate MVP. The two motion candidates with the minimum cost from the three are further obtained as the base MVP for encoding, thereby improving the compression performance. When the UMVE tool is enabled for encoding in AVS4, the spatial, temporal, HMVP (history-based motion vector prediction) and MVAP (motion vector angle prediction) candidate MVP information is fully utilized, and the template matching cost is used to select the optimal base MVP from the multiple candidate MVPs, thereby improving the compression performance.

[0359] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. The present application can be variously changed and altered by those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining a motion vector prediction (MVP) candidate, characterized in that, The method comprises the following steps: obtaining an MVP candidate list, wherein the candidate MVP types in the MVP candidate list comprise: a spatial motion vector candidate MVP, a temporal motion vector candidate MVP, a history-based motion vector prediction (HMVP) candidate MVP, and a motion vector angle prediction (MVAP) candidate MVP; determining a base candidate MVP according to the MVP candidate list.

2. The method of claim 1, wherein, The step of obtaining the MVP candidate list comprises: respectively constructing a spatial motion vector prediction candidate list, an MVAP motion vector prediction candidate list, an HMVP motion vector prediction candidate list, and a temporal motion vector prediction candidate list.

3. The method of claim 2, wherein, The step of constructing the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list comprises: in a case where one of the width and height of a current block is less than m or both the width and height of the current block are equal to m, constructing the spatial motion vector prediction candidate list; otherwise, constructing the MVAP motion vector prediction candidate list, wherein m is a preset positive integer.

4. The method of claim 3, wherein, After the step of constructing the MVAP motion vector prediction candidate list, the method further comprises: performing the same MVP candidate deduplication on the MVAP motion vector prediction candidate list.

5. The method of claim 2, wherein, The step of constructing the spatial motion vector prediction candidate list comprises: constructing the spatial motion vector prediction candidate list, wherein the number of spatial motion vector prediction candidate MVPs in the spatial motion vector prediction candidate list is less than or equal to n, wherein n is a preset positive integer.

6. The method of claim 1, wherein, The step of determining the base candidate MVP according to the MVP candidate list comprises: in a case where the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is 0, determining a first base candidate MVP as a temporal motion vector prediction candidate MVP and determining a second base candidate MVP as a zero candidate, wherein the base candidate MVP comprises the first base candidate MVP and the second base candidate MVP; or, in a case where the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 1 and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 0, determining one of the base candidate MVPs as a spatial motion vector prediction candidate MVP or an MVAP candidate MVP and determining the other as a temporal motion vector prediction candidate MVP; or, in a case where the number of candidate MVPs in the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is 0 and the number of candidate MVPs in the HMVP motion vector prediction candidate list is 1, determining one of the base candidate MVPs as an HMVP candidate MVP and determining the other as a temporal motion vector prediction candidate MVP. Or, in the case that the sum of the candidate MVP numbers of the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list and the HMVP motion vector prediction candidate list is greater than 1, the same MVP candidate de-duplication is performed on the MVP candidate list, in the case that the candidate MVP number of the de-duplicated MVP candidate list is equal to 1, the first base candidate MVP is determined as the corresponding candidate MVP, and the second base candidate MVP is determined as zero candidate; in the case that the candidate MVP number of the de-duplicated MVP candidate list is greater than or equal to 2, cost calculation is performed on each candidate MVP in the MVP candidate list, and the candidate MVPs corresponding to the two minimum cost values are determined as the base candidate MVPs.

7. The method of claim 6, wherein, The cost calculation on each candidate MVP in the MVP candidate list comprises: The cost calculation on each candidate MVP in the MVP candidate list is performed by a template matching method to obtain the cost value of each candidate MVP.

8. The method of claim 6, wherein, In the case that the candidate MVP number of the de-duplicated MVP candidate list is greater than or equal to 2, after the cost calculation on each candidate MVP in the MVP candidate list, the method further comprises: The candidate MVPs corresponding to the two minimum cost values are obtained, and the candidate MVPs comprise a first candidate MVP and a second candidate MVP. A third candidate MVP is obtained by calculation according to the first candidate MVP and the second candidate MVP. The cost calculation on the third candidate MVP is performed by a template matching method to obtain the cost value of the third candidate MVP. The two candidate MVPs with the minimum cost values are determined as the base candidate MVPs according to the cost values of the first candidate MVP, the second candidate MVP and the third candidate MVP.

9. The method of claim 8, wherein, The third candidate MVP is obtained by calculation according to the first candidate MVP and the second candidate MVP, which comprises: The horizontal component and the vertical component of the first candidate MVP and the second candidate MVP are calculated respectively to obtain the third candidate MVP.

10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method in any one of claims 1 to 9. 11.An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, The processor executes the computer program to implement the method in any one of claims 1 to 9.

12. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the method in any one of claims 1 to 9.