Method for determining motion vector prediction (MVP) candidate, and storage medium and electronic apparatus
By obtaining multiple types of MVP candidates and reordering them using template matching, the problem of insufficient candidate types in AVS4 is solved, which improves the encoding gain and reduces the computational complexity.
Patent Information
- Application Number
- PCT/CN2025/074090
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-07
- Filing Date
- 2025-01-22
- Publication Date
- 2025-12-11
AI Technical Summary
The AVS4 UMVE starting point selection algorithm suffers from insufficient candidate types when determining motion vector prediction MVP candidates, resulting in low coding gain and increased computational complexity.
By obtaining an MVP candidate list including spatial motion vector candidates, temporal motion vector candidates, historical motion vector prediction HMVP candidates, and motion vector angle prediction MVAP candidates, a template matching method is used to reorder the candidates, and the candidate with the lowest cost is selected as the base MVP.
It improves coding gain, reduces computational complexity, and enables efficient selection of the best basic candidate MVP.
Smart Images

Figure CN2025074090_11122025_PF_FP_ABST
Abstract
Description
Method for determining motion vector prediction (MVP) candidate, storage medium and electronic device
[0001] Cross-reference to Related Applications
[0002] The present disclosure is based on Chinese Patent Application No. CN202410740234.3 entitled “Method for determining motion vector prediction (MVP) candidate, storage medium and electronic device” filed on June 7, 2024, and claims priority to the patent application, the disclosure of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] Embodiments of the present disclosure relate to the field of communication, in particular, to a method for determining a motion vector prediction (MVP) candidate, a storage medium and an electronic device. BACKGROUND
[0004] The Ultimate Motion Vector Expression (UMVE) technique is a relatively important encoding tool for improving compression performance in a new generation of video coding technology, AVS4. The technique is based on the starting point base MVP of the already generated motion candidate, i.e., motion vector prediction (MVP), and performs offset to obtain a more optimal motion candidate. The technique uses three parameters to express motion vector offset information, i.e., starting point, motion distance and motion direction.
[0005] In some cases, the UMVE starting point selection algorithm of AVS4 is relatively simple, and the following problems exist: (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 the coding gain. (2) The selected candidate MVPs are partially the same, which introduces redundant calculation, increases the calculation complexity, and reduces the coding efficiency. (3) The entire process of determining the base MVP does not involve sorting the candidate MVPs according to certain criteria, and the process of determining the best candidate MVP as the base MVP according to the sorting result.
[0006] 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 coding gain to some extent. SUMMARY
[0007] Embodiments of the present disclosure 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 coding gain caused by the inability to select the best base candidate MVP in the related art.
[0008] According to an embodiment of the present disclosure, 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 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 determining a base candidate MVP according to the MVP candidate list.
[0009] According to another embodiment of the present disclosure, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program, wherein the computer program is configured to execute the steps in any of the method embodiments described above when running.
[0010] According to yet another embodiment of the present disclosure, 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 method embodiments described above.
[0011] According to yet another embodiment of the present disclosure, a computer program product is also provided, comprising computer programs / instructions, which, when executed by a processor, implement the steps in any of the method embodiments described above. BRIEF DESCRIPTION OF DRAWINGS
[0012] FIG. 1 is a schematic diagram of the principle of motion derivation of UMVE in the related art;
[0013] FIG. 2 is an example diagram of the coordinate position of the top-left corner of the luma sample of the current block in the related art;
[0014] FIG. 3 is an example diagram of the spatial neighboring blocks of the current block in the related art;
[0015] FIG. 4 is an example diagram of the left and top neighboring 4x4 blocks of the current block in the related art;
[0016] FIG. 5 is a schematic diagram of the principle of the template matching method in the related art;
[0017] FIG. 6 is a hardware structure block diagram of a computer terminal of the method for determining an MVP candidate according to an embodiment of the present disclosure;
[0018] FIG. 7 is a flowchart of the method for determining an MVP candidate according to an embodiment of the present disclosure;
[0019] FIG. 8 is a flowchart of a method for determining a motion vector prediction (MVP) candidate according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure will be described in detail below with reference to the drawings and in conjunction with embodiments.
[0021] It should be noted that the terms "first", "second", and the like in the description and claims of the present disclosure and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence.
[0022] In some cases, the UMVE technology is a motion vector offset compensation method proposed in AVS4 for direct / skip mode, and the technical features include: (1) offsetting the motion vector derived in the direct / skip mode to further refine the MV of the direct / skip mode for better 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 UMVE technology needs to transmit the motion vector information including the starting point, the motion distance, and the motion direction. FIG. 1 is a schematic diagram of the motion derivation of the UMVE in the related art, as shown in FIG. 1, a motion candidate is taken as a starting point, and is offset in the up, down, left, and right directions, the starting point has two (2base MV), so the selected initial point (two choices) needs to be indicated in the code stream, the offset direction (four choices) and the offset distance (five choices or eight choices, determined by the identification bit in the image header). 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, an identification bit in the image header is transmitted to determine whether Table 1 or Table 2 is used, and which table is used by the current image is determined according to the average offset selected in the UMVE mode of the previous frame image.
[0023] Table 1 UMVE mode MVD offset binary table
[0024] Table 2 UMVE mode MVD offset binary table
[0025] In some cases, 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 in the reference image queue 1 with the same reference index value 0 as the top-left corner luma sample coordinate position of the current block 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 top-left corner luma sample coordinate position of the current block is defined according to the AVS standard. FIG. 2 is an example diagram of the top-left corner luma sample coordinate position of the current block in the related art, as shown in FIG. 2, the current block is a 16x16 block, and the top-left corner luma sample coordinate position of the current block is the position of the 4x4 white block in the figure (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.
[0026] In some cases, the spatial-domain motion vector candidate derivation method, FIG. 3 is an example diagram of the spatially adjacent blocks of the current block in the related art, as shown in FIG. 3, the availability of the spatially adjacent blocks at the left-bottom F, right-top G (inside), right-top C (outside), left A, and top-left D positions is judged, if the spatially adjacent blocks exist at the left-bottom F, right-top G (inside), right-top 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.
[0027] In some cases, the MVAP motion vector candidate derivation method, FIG. 4 is an example diagram of the left and top adjacent 4x4 blocks of the current block in the related art, as shown in FIG. 4, the availability of the left and top adjacent 4x4 blocks of the current block is judged, if the available spatially adjacent blocks exist 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.
[0028] In some cases, the HMVP motion vector prediction candidate derivation method is the motion vector prediction based on the history information. The HMVP technology copies 8 motion information candidates from the previously encoded blocks 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 encoded, the repeated candidate is removed first, and the motion information of the current block is 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 is removed, and the latest motion information is added to the tail of the FIFO, so that the FIFO always retains 8 latest motion candidates.
[0029] In some cases, template matching is a coding technique used to refine the motion information of a current block so that the MV of the current block is more accurate. FIG. 5 is a schematic diagram of the principle of a template matching method in the related art. As shown in FIG. 5, template matching mainly finds an MV so that the matching error between the template of a current image (the top and / or left neighboring block of the current block) and the template of a reference image is minimized.
[0030] In some cases, the UMVE starting point selection algorithm of AVS4 is relatively simple, and the determination process is as follows: (1) judging the availability of the left-bottom, right-top (inside), right-top (outside), left and left-top spatial neighboring blocks; (2) if two or more of the left-bottom, right-top (inside), right-top (outside), left and left-top spatial neighboring blocks are available, taking the MVs of the first two available spatial neighboring blocks as the base MVPs; otherwise, if only one spatial neighboring block is available, taking the MV of the available spatial neighboring block as the first base MVP, and the other base MVP is the temporal MVP; otherwise, if all the spatial neighboring blocks are unavailable, the first base MVP is the temporal MVP, and the second base MVP is the default zero MVP.
[0031] In summary, the starting point selection algorithm in the above 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 some extent.
[0032] The method embodiments provided in the embodiments of the present disclosure can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the case of running on a computer terminal, FIG. 6 is a hardware structure block diagram of a computer terminal of a method for determining MVP candidates according to an embodiment of the present disclosure. As shown in FIG. 6, the computer terminal can include one or more (only one is shown in FIG. 6) processors 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, wherein the computer terminal can further include a transmission device 606 for communication function and an input and output device 608. Those skilled in the art can understand that the structure shown in FIG. 6 is only schematic, which 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.
[0033] The memory 604 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the method for determining a motion vector prediction (MVP) candidate in the embodiments of the present disclosure. The processor 602 can execute various functions and data processing, i.e., implement the method described above, by running the computer program stored in the memory 604. 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, flash memories, 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, which can be connected to the computer terminal through a network. Examples of the network can include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0034] The transmission device 606 is configured to receive or send data via a network. 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 (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 (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0035] The embodiments of the present disclosure provide a method for determining a motion vector prediction (MVP) candidate. FIG. 7 is a flowchart of the method for determining a motion vector prediction (MVP) candidate according to an embodiment of the present disclosure. As shown in FIG. 7, the method includes the following steps:
[0036] In step S702, a MVP candidate list is obtained, where 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.
[0037] In one example embodiment, the MVP candidate list is obtained by 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, respectively.
[0038] In one example embodiment, the spatial motion vector prediction candidate list or the MVAP motion vector prediction candidate list is constructed by: in a case where one of the width and the 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, where m is a preset positive integer.
[0039] In the embodiments of the present disclosure, 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.
[0040] In one example embodiment, after the MVAP motion vector prediction candidate list is constructed, the method further includes: performing the same MVP candidate deduplication on the MVAP motion vector prediction candidate list.
[0041] In one example embodiment, the method of constructing the spatial motion vector prediction candidate list includes: constructing the spatial motion vector prediction candidate list, wherein the number of spatial motion vector prediction candidates MVPs in the spatial motion vector prediction candidate list is less than or equal to n, where n is a preset positive integer.
[0042] In the embodiments of the present disclosure, the spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and at most 5 different spatial candidates are constructed.
[0043] Step S704: determining a base candidate MVP according to the MVP candidate list.
[0044] In one example embodiment, the method of determining the base candidate MVP according to the MVP candidate list includes: 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, 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 includes the first base candidate MVP and the second base candidate MVP;
[0045] 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, 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;
[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 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;
[0047] 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 HMVP motion vector prediction candidate list is greater than 1, the same MVP candidate is removed from the MVP candidate list, in the case that the number of candidate MVPs in the removed 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 removed MVP candidate list is greater than or equal to 2, the cost of each candidate MVP in the MVP candidate list is calculated, and the two candidate MVPs corresponding to the minimum cost value are determined as the base candidate MVPs.
[0048] In an example embodiment, the cost of each candidate MVP in the MVP candidate list is calculated, including: the cost of each candidate MVP in the MVP candidate list is calculated by a template matching method, to obtain the cost value of each candidate MVP.
[0049] In an example embodiment, in the case that the number of candidate MVPs in the removed MVP candidate list is greater than or equal to 2, after the cost of each candidate MVP in the MVP candidate list is calculated, further including: the two candidate MVPs corresponding to the minimum cost value are obtained, including the first candidate MVP and the second candidate MVP; the third candidate MVP is obtained by calculating the first candidate MVP and the second candidate MVP; the cost of the third candidate MVP is calculated by a template matching method, to obtain the cost value of the third candidate MVP; and the two candidate MVPs with the minimum cost value 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.
[0050] In the embodiments of the present disclosure, a new candidate MVP is generated by performing a mathematical operation, such as taking an average or taking a difference, on the horizontal component and the vertical component of the UMVE base candidate 0 and the base candidate 1, 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 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.
[0051] In an example embodiment, the third candidate MVP is obtained by calculating the first candidate MVP and the second candidate MVP, including: 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.
[0052] By the above steps, a method for determining a motion vector prediction MVP candidate is provided, the MVP candidate list is obtained, wherein the candidate MVP types 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 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.
[0053] The method for determining a motion vector prediction MVP candidate provided in the embodiments of the present disclosure can be applied to the encoding or decoding operation of the UMVE method in AVS4.
[0054] 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 implemented by means of software and the necessary universal hardware platform, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present disclosure can be embodied in the form of a software product in essence or in the part that contributes to the prior art, 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) to execute the methods described in the various embodiments of the present disclosure.
[0055] In the embodiments, a method for determining a motion vector prediction MVP candidate is also provided, and the method is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.
[0056] The apparatus for determining a motion vector prediction MVP candidate provided in the embodiments of the present disclosure includes: an acquisition list unit configured to acquire a MVP candidate list, wherein the candidate MVP types 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.
[0057] It should be noted that the above modules can be implemented by software or hardware, and the hardware can be implemented in the following manner, but is not limited thereto: all the modules are located in the same processor; or the modules are located in different processors in any combination.
[0058] It should be noted that the above modules can be implemented in different naming manners and function division manners, as long as the steps in the above method embodiments can be implemented.
[0059] Embodiments of the present disclosure further provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.
[0060] 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 disk or an optical disk, and various media that can store computer programs.
[0061] Embodiments of the present disclosure further provide an electronic device, which includes a memory storing a computer program and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
[0062] In an example embodiment, the above electronic device can further include a transmission device connected to the processor and an input / output device connected to the processor.
[0063] Embodiments of the present disclosure further provide a computer program product, which includes computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps in any of the above method embodiments.
[0064] The specific examples in the present embodiment can refer to the examples described in the above embodiments and example embodiments, and the present embodiment will not be described here again.
[0065] It is apparent to those skilled in the art that the modules or steps of the present disclosure described above can be implemented by general computing devices, which can be centralized on a single computing device or distributed on a network composed of multiple computing devices, and can be implemented 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 orders, or they can be made into individual integrated circuit modules or multiple modules or steps into a single integrated circuit module. Thus, the present disclosure is not limited to any specific combination of hardware and software.
[0066] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the following describes specific embodiments in conjunction with specific scenarios.
[0067] Embodiment one
[0068] The embodiment of the present disclosure 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 smallest cost in the reordered motion candidate list as the basic MVP, thereby improving compression performance.
[0069] FIG. 8 is a flow principle diagram of a method for determining a motion vector prediction (MVP) candidate according to an embodiment of the present disclosure, as shown in FIG. 8, comprising the following steps:
[0070] Step 1: Construct a spatial motion vector prediction candidate list.
[0071] 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, 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.
[0072] Step 2: Construct an HMVP motion vector prediction candidate list.
[0073] An HMVP motion vector prediction candidate list is constructed according to an HMVP motion vector candidate derivation method, and there are at most 8 different HMVP candidates MVP.
[0074] Step 3: Construct a temporal motion vector prediction candidate list.
[0075] A temporal motion vector prediction candidate list is constructed according to a temporal motion vector candidate derivation method.
[0076] A base candidate MVP of UMVE is selected 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.
[0077] The base candidate MVP of UMVE is selected according to the constructed number of spatial and HMVP candidates, wherein the spatial includes the spatial motion vector prediction candidate or the MVAP motion vector prediction candidate.
[0078] 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 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.
[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 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 a spatial candidate MVP, and the base candidate 1 is set as a temporal candidate MVP.
[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 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 a temporal candidate MVP, and the base candidate 1 is set as a HMVP candidate MVP.
[0081] 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 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 de-duplicated candidate list, 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.
[0082] 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 disclosure 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.
[0083] Table 3 sequence header adding umve_tm_enable_flag control flag
[0084] Embodiment Two
[0085] 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:
[0086] Step 1: constructing a spatial motion vector prediction candidate list.
[0087] 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.
[0088] Step 2: Constructing the HMVP motion vector prediction candidate list.
[0089] 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.
[0090] Step 3: Constructing the temporal motion vector prediction candidate list.
[0091] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[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 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.
[0097] 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 spatial MVP candidate, the temporal MVP candidate, and the HMVP candidate to make all the MVP candidates in the MVP candidate list 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 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.
[0098] 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 MVP selection method provided in the embodiments of the present disclosure 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.
[0099] Table 4 sequence header adding umve_tm_enable_flag control flag
[0100] Embodiment Three
[0101] In embodiment three, a scheme different from that in embodiment one is adopted for setting different base candidate MVP types in step 4, that is, the setting types of the two base candidate MVPs are exchanged, and the details are as follows:
[0102] Step 1: Construct a spatial motion vector prediction candidate list.
[0103] 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 a de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.
[0104] Step 2: Constructing the HMVP motion vector prediction candidate list.
[0105] 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.
[0106] Step 3: Constructing the temporal motion vector prediction candidate list.
[0107] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0108] 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.
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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 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.
[0114] 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 MVP selection method provided in the embodiment of the disclosure 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.
[0115] Table 5 sequence header adding umve_tm_enable_flag control flag
[0116] Embodiment Four
[0117] In embodiment four, a scheme different from that of embodiment two is adopted for setting different base candidate MVP types in step 4, that is, the setting types of the two base candidate MVPs are exchanged, and the details are as follows:
[0118] Step 1: Construct a spatial motion vector prediction candidate list.
[0119] 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 a de-duplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.
[0120] Step 2: Constructing the HMVP motion vector prediction candidate list.
[0121] 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.
[0122] Step 3: Constructing the temporal motion vector prediction candidate list.
[0123] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] In order to facilitate 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 in the embodiments of the present disclosure 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.
[0131] Table 6: Sequence header adding umve_tm_enable_flag control flag
[0132] Embodiment five
[0133] The embodiment of the present disclosure provides a method for determining a motion vector prediction (MVP) candidate, performing template matching-based reordering processing 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), selecting the first two motion vector candidates (MVP) with the minimum cost in the reordered motion vector candidate list, performing further mathematical operations on the selected first two motion vector candidates (MVP) with the minimum cost, obtaining a third motion vector candidate (MVP), and selecting the third motion vector candidate (MVP) according to the cost values of the first two motion vector candidates (MVP) and the third motion vector candidate (MVP), and further obtaining the two motion vector candidates (MVP) with the minimum cost from the three as the base MVP for encoding, thereby further improving the compression performance.
[0134] In the fifth embodiment, further calculations and selection are performed on the two base candidate MVPs obtained in step 4 in the above-described embodiments, and the specific process is as follows.
[0135] Step 1: Construct a spatial motion vector prediction candidate list.
[0136] 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.
[0137] Step 2: Construct an HMVP motion vector prediction candidate list.
[0138] 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.
[0139] Step 3: Construct a temporal motion vector prediction candidate list.
[0140] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0141] 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.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] Step 5: the new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.
[0148] 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.
[0149] 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 in the embodiments of the present disclosure 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 to ensure the consistency of coding and decoding.
[0150] Table 7 Sequence header adding umve_tm_enable_flag control flag
[0151] Embodiment six
[0152] 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:
[0153] Step 1: Constructing a spatial motion vector prediction candidate list.
[0154] 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 deduplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.
[0155] Step 2: Constructing an HMVP motion vector prediction candidate list.
[0156] 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.
[0157] Step 3: Constructing a temporal motion vector prediction candidate list.
[0158] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] Step 5: New MVP candidates generated from two base MVPs are compared with two base MVPs.
[0166] Performing some mathematical operations such as averaging, taking difference, etc. on the horizontal and vertical components of the UMVE base candidates 0 and 1 respectively generates a new candidate, calculates the template matching cost of the new candidate and compares it with the UMVE base candidates 0 and 1, and takes the two candidates with the minimum cost as the final UMVE base candidates, i.e. 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.
[0167] For the convenience of 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 MVP selection method provided in the embodiments of the present disclosure can take effect. The decoding end first parses umve_enable_flag. If umve_enable_flag is 1, it 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.
[0168] Table 8 Sequence header adding umve_tm_enable_flag control flag
[0169] Embodiment Seven
[0170] In embodiment seven, a scheme different from that of embodiment one is adopted for setting the types of different base MVPs in step 4, i.e. the setting types of the two base MVPs are exchanged. Meanwhile, further calculation and selection are performed on the two base MVPs obtained in step 4, which are as follows:
[0171] Step 1: Constructing the spatial motion vector prediction candidate list.
[0172] 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 deduplication algorithm is performed on the constructed MVAP motion vector prediction candidate list.
[0173] Step 2: Constructing the HMVP motion vector prediction candidate list.
[0174] 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.
[0175] Step 3: Constructing a temporal motion vector prediction candidate list.
[0176] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0177] 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.
[0178] 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.
[0179] 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.
[0180] 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.
[0181] 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.
[0182] 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.
[0183] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.
[0184] 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.
[0185] In order to facilitate 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 embodiments of the present disclosure 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.
[0186] Table 9 sequence header adding umve_tm_enable_flag control flag
[0187] Embodiment Eight
[0188] 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:
[0189] Step 1: Construct a spatial motion vector prediction candidate list.
[0190] 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, a spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method described above; otherwise, an 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.
[0191] Step 2: Construct an HMVP motion vector prediction candidate list.
[0192] An 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.
[0193] Step 3: Construct a temporal motion vector prediction candidate list.
[0194] One temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0195] Step 4: Select 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.
[0196] Base candidate MVPs of UMVE are selected according to the number of constructed spatial and HMVP candidates, wherein the spatial includes spatial motion vector prediction candidates or MVAP motion vector prediction candidates.
[0197] 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, base candidate 0 (i.e., the first base candidate MVP in the above embodiments) of UMVE is set as a temporal candidate MVP, and base candidate 1 (i.e., the second base candidate MVP in the above embodiments) is set as a zero candidate.
[0198] 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, base candidate 0 of UMVE is set as a temporal candidate MVP, and base candidate 1 is set as a spatial candidate MVP.
[0199] 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.
[0200] 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, first, 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, UMVE base candidate 0 is set as the candidate MVP, and 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 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.
[0201] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.
[0202] 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 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.
[0203] 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 in the embodiments of the present disclosure 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.
[0204] Table 10 Sequence header with umve_tm_enable_flag control flag
[0205] Embodiment Nine
[0206] In Embodiment Nine, a different construction method of spatial motion vector prediction candidate list is adopted, which is as follows:
[0207] Step 1: Construct spatial motion vector prediction candidate list.
[0208] 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.
[0209] Step 2: Construct HMVP motion vector prediction candidate list.
[0210] 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.
[0211] Step 3: Construct temporal motion vector prediction candidate list.
[0212] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0213] 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.
[0214] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] For the convenience of 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 embodiments of the present disclosure 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.
[0220] Table 11 sequence header adding umve_tm_enable_flag control flag
[0221] Embodiment Ten
[0222] In Embodiment Ten, a different construction method of the spatial motion vector prediction candidate list is adopted from Embodiment Two, which is as follows:
[0223] Step 1: constructing the spatial motion vector prediction candidate list.
[0224] 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.
[0225] Step 2: Construct the HMVP motion vector predictor candidate list.
[0226] 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.
[0227] Step 3: Construct the temporal motion vector predictor candidate list.
[0228] The temporal motion vector predictor candidate list is constructed according to the temporal motion vector candidate derivation method.
[0229] 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.
[0230] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.
[0231] 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.
[0232] 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.
[0233] 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.
[0234] 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 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 de-duplicated MVP candidate list. In an embodiment, if there is only one MVP candidate 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 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.
[0235] 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 embodiments of the present disclosure 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 base candidate MVP selection process as the encoding end is performed to ensure consistency of coding and decoding.
[0236] Table 12 sequence header adding umve_tm_enable_flag control flag
[0237] Embodiment Eleven
[0238] In Embodiment Eleven, a different method for constructing the spatial motion vector prediction candidate list is adopted than in Embodiment Three, and the method is as follows:
[0239] Step 1: Construct a spatial motion vector prediction candidate list.
[0240] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method, and there are at most five different spatial candidate MVPs.
[0241] Step 2: Construct a HMVP motion vector prediction candidate list.
[0242] 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.
[0243] Step 3: Constructing a temporal motion vector prediction candidate list.
[0244] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0245] 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.
[0246] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.
[0247] 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.
[0248] 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.
[0249] 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.
[0250] 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 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 a 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.
[0251] 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 embodiments of the present disclosure 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.
[0252] Table 13 sequence header adding umve_tm_enable_flag control flag
[0253] Embodiment Twelve
[0254] In Embodiment Twelve, a different method for constructing the spatial motion vector prediction candidate list is adopted than in Embodiment Four, which is as follows:
[0255] Step 1: Construct a spatial motion vector prediction candidate list.
[0256] According to the spatial motion vector candidate derivation method, the spatial motion vector prediction candidate list is constructed, and there are at most 5 different spatial candidate MVPs.
[0257] Step 2: Construct a HMVP motion vector prediction candidate list.
[0258] 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.
[0259] Step 3: Constructing a temporal motion vector prediction candidate list.
[0260] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0261] 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.
[0262] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.
[0263] 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.
[0264] 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.
[0265] 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.
[0266] 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 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 a 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.
[0267] 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 embodiments of the present disclosure 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.
[0268] Table 14 sequence header adding umve_tm_enable_flag control flag
[0269] Embodiment thirteen
[0270] 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:
[0271] Step 1: constructing a spatial motion vector prediction candidate list.
[0272] According to the spatial motion vector candidate derivation method, the spatial motion vector prediction candidate list is constructed, and there are at most 5 different spatial candidate MVPs.
[0273] Step 2: constructing a HMVP motion vector prediction candidate list.
[0274] According to the HMVP motion vector candidate derivation method, the HMVP motion vector prediction candidate list is constructed, and there are at most 8 different HMVP candidate MVPs.
[0275] Step 3: Constructing the temporal motion vector prediction candidate list.
[0276] A temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0277] 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.
[0278] The base candidate MVP of UMVE is selected according to the number of constructed spatial and HMVP candidates.
[0279] In the case where the number of candidate MVPs in the spatial motion vector prediction candidate list and the number of candidate MVPs in the HMVP motion vector prediction candidate list are 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.
[0280] 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.
[0281] 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 temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.
[0282] In the case where the sum of the number of candidate MVPs in the spatial motion vector prediction candidate list and the number of candidate MVPs in the HMVP motion vector prediction candidate list is greater than 1, first, 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 base candidate 0 of UMVE is set as the candidate MVP, and the base candidate 1 is set as the 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 candidate MVP 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.
[0283] Step 5: New MVPs are generated from the two base MVPs and the two base MVPs are compared.
[0284] 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 base candidate 1. The template matching cost of the new candidate is calculated and compared with the UMVE base candidate 0 and 1. The two candidates with the lowest cost are selected as the final UMVE base candidates, i.e., UMVE base candidate 0 is set as the candidate with the lowest cost and base candidate 1 is set as the candidate with the next lowest cost.
[0285] 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 in the embodiments of the present disclosure 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 base MVP selection process as the encoding end is performed to ensure consistency of encoding and decoding.
[0286] Table 15 Sequence header adding umve_tm_enable_flag control flag
[0287] Embodiment Fourteen
[0288] In Embodiment Fourteen, a different method for constructing the spatial motion vector prediction candidate list is used than in Embodiment Six, as follows:
[0289] Step 1: Construct the spatial motion vector prediction candidate list.
[0290] The spatial motion vector prediction candidate list is constructed according to the spatial motion vector candidate derivation method. There are at most 5 different spatial candidate MVPs.
[0291] Step 2: Construct the HMVP motion vector prediction candidate list.
[0292] 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.
[0293] Step 3: Construct the temporal motion vector prediction candidate list.
[0294] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0295] Step 4: Select the base MVP candidate of UMVE according to the number of candidate MVPs in the spatial MVP prediction candidate list and the HMVP MVP prediction candidate list.
[0296] Select the base MVP candidate of UMVE according to the number of constructed spatial and HMVP candidates.
[0297] In the case that the number of candidate MVPs in the spatial MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list are both 0, the base candidate 0 (i.e. the first base MVP candidate in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base MVP candidate in the above embodiment) is set as the zero candidate.
[0298] In the case that the number of candidate MVPs in the spatial 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 UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the spatial candidate MVP.
[0299] In the case that the number of candidate MVPs in the spatial 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 UMVE is set as the temporal candidate MVP, and the base candidate 1 is set as the HMVP candidate MVP.
[0300] In the case that the sum of the number of candidate MVPs in the spatial MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list is greater than 1, first, 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 base candidate 0 of UMVE is set as the candidate MVP, and the base candidate 1 is set as the 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.
[0301] Step 5: The new candidate MVP generated by the two base candidate MVPs is compared with the two base candidate MVPs.
[0302] 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 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 lowest cost are selected as the final UMVE base candidates, i.e. UMVE base candidate 0 is set as the candidate with the lowest cost, and base candidate 1 is set as the candidate with the second lowest cost.
[0303] To facilitate 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 in the embodiments of the present disclosure 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, ensuring the consistency of coding and decoding.
[0304] Table 16 sequence header adding umve_tm_enable_flag control flag
[0305] Embodiment Fifteen
[0306] In embodiment fifteen, a different construction method of the spatial motion vector prediction candidate list is used than in embodiment seven, as follows:
[0307] Step 1: Construct the spatial motion vector prediction candidate list.
[0308] 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.
[0309] Step 2: Construct the HMVP motion vector prediction candidate list.
[0310] 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.
[0311] Step 3: Construct the temporal motion vector prediction candidate list.
[0312] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0313] Step 4: Select the base MVP candidate of UMVE according to the number of candidate MVPs in the spatial MVP prediction candidate list and the HMVP MVP prediction candidate list.
[0314] Select the base MVP candidate of UMVE according to the number of constructed spatial and HMVP candidates.
[0315] In the case that the number of candidate MVPs in the spatial MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list are both 0, the base candidate 0 (i.e. the first base MVP candidate in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base MVP candidate in the above embodiment) is set as the zero candidate.
[0316] In the case that the number of candidate MVPs in the spatial 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 UMVE is set as the spatial candidate MVP, and the base candidate 1 is set as the temporal candidate MVP. In the case that the number of candidate MVPs in the spatial 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 UMVE is set as the HMVP candidate MVP, and the base candidate 1 is set as the temporal candidate MVP.
[0317] In the case that the sum of the number of candidate MVPs in the spatial MVP prediction candidate list and the number of candidate MVPs in the HMVP MVP prediction candidate list is greater than 1, first, 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. 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 the zero candidate. Otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, first, 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. 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.
[0318] Step 5: Select the new candidate MVP generated by the two base candidate MVPs and the two base candidate MVPs.
[0319] 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 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 lowest cost are selected as the final UMVE base candidates, i.e. UMVE base candidate 0 is set as the candidate with the lowest cost, and base candidate 1 is set as the candidate with the second lowest cost.
[0320] To facilitate 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 in the embodiments of the present disclosure 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, ensuring the consistency of coding and decoding.
[0321] Table 17 sequence header adding umve_tm_enable_flag control flag
[0322] Embodiment Sixteen
[0323] In Embodiment Sixteen, a different construction method of the spatial motion vector prediction candidate list is used than in Embodiment Eight, as follows:
[0324] Step 1: Construct the spatial motion vector prediction candidate list.
[0325] 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.
[0326] Step 2: Construct the HMVP motion vector prediction candidate list.
[0327] 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.
[0328] Step 3: Construct the temporal motion vector prediction candidate list.
[0329] The temporal motion vector prediction candidate list is constructed according to the temporal motion vector candidate derivation method.
[0330] Step 4: Select the base MVP candidate of UMVE according to the number of candidate MVPs in the spatial MVP prediction candidate list and the HMVP MVP prediction candidate list.
[0331] Select the base MVP candidate of UMVE according to the number of candidate MVPs in the spatial and HMVP candidate lists.
[0332] In the case that the number of candidate MVPs in the spatial and HMVP candidate lists is both 0, the base candidate 0 (i.e. the first base MVP candidate in the above embodiment) of UMVE is set as the temporal candidate MVP, and the base candidate 1 (i.e. the second base MVP candidate in the above embodiment) is set as the zero candidate.
[0333] In the case that the number of candidate MVPs in the spatial candidate list is 1, and the number of candidate MVPs in the HMVP 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.
[0334] In the case that the number of candidate MVPs in the spatial candidate list is 0, and the number of candidate MVPs in the HMVP 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.
[0335] In the case that the sum of the number of candidate MVPs in the spatial and HMVP candidate lists is greater than 1, first, a de-duplication algorithm is performed on the MVP candidate list composed of the spatial, temporal and HMVP candidate MVPs, so that all the MVP candidates in the MVP candidate list are different. 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 base candidate 0 of UMVE is set as the candidate MVP, and the base candidate 1 is set as the zero candidate; otherwise, if there are two or more candidate MVPs in the candidate list after de-duplication, first, 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 candidate 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.
[0336] Step 5: Select the new candidate MVP from the two base candidate MVPs.
[0337] A certain mathematical operation such as averaging, differencing, etc. is performed on the horizontal and vertical components of the UMVE base candidates 0 and 1 to generate a new candidate, 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 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.
[0338] 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 in the embodiments of the present disclosure 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 consistency of encoding and decoding.
[0339] Table 18 sequence header adding umve_tm_enable_flag control flag
[0340] In the above embodiments of the present disclosure, the above-mentioned "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 here.
[0341] In summary, the embodiments of the present disclosure provide a method for determining a motion vector prediction (MVP) candidate, a UMVE base MVP is selected based on template matching, a motion candidate list composed of a spatial motion candidate, a temporal motion candidate, a MVAP motion candidate and a HMVP motion candidate is subjected to a reordering process based on template matching, the first two motion candidates with the minimum cost in the reordered motion candidate list are taken as the base MVPs for encoding, or, the selected first two motion candidates MVPs are subjected to further mathematical operations to obtain a third motion candidate MVP, and selection is performed according to the cost values of the first two motion candidates MVPs and the cost value of the third motion candidate MVP, to further obtain the two motion candidate MVPs with the minimum cost among the three as the base MVPs 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 multiple candidate MVPs, thereby improving the compression performance.
[0342] The above only is the preferred embodiment of the present disclosure, and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for determining a motion vector predictor (MVP) candidate, comprising: obtaining an MVP candidate list, wherein types of candidate MVPs in the MVP candidate list comprise a spatial motion vector predictor (SMVP) candidate, a temporal motion vector predictor (TMVP) candidate, a history-based motion vector prediction (HMVP) candidate, and a motion vector angle prediction (MVAP) candidate; determining a base candidate MVP according to the MVP candidate list.
2. The method of claim 1, wherein, The obtaining of the MVP candidate list comprises: respectively constructing a SMVP candidate list, a MVAP candidate list, a HMVP candidate list, and a TMVP candidate list.
3. The method of claim 2, wherein, The constructing of the SMVP candidate list or the MVAP candidate list comprises: in a case where one of a width and a height of a current block is less than m or both of the width and the height of the current block are equal to m, constructing the SMVP candidate list; otherwise, constructing the MVAP candidate list, wherein m is a preset positive integer.
4. The method of claim 3, wherein, After the constructing of the MVAP candidate list, the method further comprises: performing same MVP candidate deduplication on the MVAP candidate list.
5. The method of claim 2, wherein, The constructing of the SMVP candidate list comprises: constructing the SMVP candidate list, wherein a number of SMVP candidates in the SMVP candidate list is less than or equal to n, wherein n is a preset positive integer.
6. The method of claim 1, wherein, The determining of the base candidate MVP according to the MVP candidate list comprises: in a case where a number of candidate MVPs in the SMVP candidate list or the MVAP candidate list and the HMVP candidate list is 0, determining a first base candidate MVP as a TMVP candidate and determining a second base candidate MVP as a zero candidate, wherein the base candidate MVPs comprise the first base candidate MVP and the second base candidate MVP; or, in a case where the number of candidate MVPs in the SMVP candidate list or the MVAP candidate list is 1 and the number of candidate MVPs in the HMVP candidate list is 0, determining one of the base candidate MVPs as a SMVP candidate or a MVAP candidate and determining the other as a TMVP candidate; or, in a case where the number of candidate MVPs in the SMVP candidate list or the MVAP candidate list is 0 and the number of candidate MVPs in the HMVP candidate list is 1, determining one of the base candidate MVPs as a HMVP candidate and determining the other as a TMVP candidate. 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 having stored therein a computer program, wherein, The computer program is executed by the processor to realize 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 realizes the method in any one of claims 1 to 9 when executing the computer program. 12.A computer program product comprising computer programs / instructions, wherein the computer programs / instructions realize the method in any one of claims 1 to 9 when executed by a processor.
Citation Information
Patent Citations
Video encoding method and related device
CN112291565A
Prediction mode decoding method, electronic equipment and machine readable storage medium
CN114339236A