Interaction between template matching-based local illumination compensation and a second merge list in video coding
Example devices, methods, and computer-readable media for decoding video data are described. An example method includes determining to decode a current block of the video data using a merge mode. The example method includes generating a first merge list for the current block, wherein generating the first merge list comprises applying template matching to candidates of the first merge list. The example method includes generating, based on the first merge list, a second merge list. The example method includes decoding the current block using the merge mode and based on the first merge list or the second merge list.
1 . A method of decoding video data, the method comprising:
determining to decode a current block of the video data using a merge mode;
generating a first merge list for the current block, wherein generating the first merge list comprises applying template matching to candidates of the first merge list;
generating, based on the first merge list for the current block, a second merge list for the current block;
obtaining a flag from a bitstream, the flag comprising a value indicative of the first merge list for the current block or the second merge list for the current block;
selecting, based on the value of the flag, a merge list from among the first merge list for the current block and the second merge list for the current block; and
decoding the current block using the merge mode and based on the selected merge list.
2 . The method of claim 1 , wherein generating the second merge list comprises, prior to applying template matching to the candidates of the first merge list, changing all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
3 . The method of claim 1 , wherein generating the second merge list comprises, after applying template matching to the candidates of the first merge list, changing all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
4 . The method of claim 1 , wherein generating the second merge list comprises, prior to applying template matching to the candidates of the first merge list, trimming candidates of the first merge list for the second merge list.
5 . The method of claim 1 , wherein generating the second merge list comprises, after applying template matching to the candidates of the first merge list, trimming candidates of the first merge list for the second merge list.
6 . The method of claim 1 , wherein generating the second merge list comprises:
determining that one or more candidates of the first merge list are bi-directional prediction merge candidates; and
for each of the bi-directional prediction merge candidates, changing a respective local illumination compensation (LIC) flag value associated with the first merge list to an opposite LIC flag value for the second merge list.
7 . The method of claim 1 , wherein generating the second merge list comprises:
determining whether a block size of the current block is greater than a threshold; and
based on a determination that the block size of the current block is greater than the threshold, determining either a) one or more local illumination compensation (LIC) flag values for the second merge list based on template matching cost, or b) the one or more LIC flag values for the second merge list by changing a respective value one or more LIC flags of the first merge list for the second merge list.
8 . The method of claim 1 , wherein selecting the merge list comprises:
selecting, based on the value of the flag, the second merge list for the current block.
9 . A device for decoding video data, the device comprising: one or more memories for storing the video data; and one or more processors implemented in circuitry and communicatively coupled to the one or more memories, the one or more processors configured to: determine to decode a current block of the video data using a merge mode; generate a first merge list for the current block including applying template matching to candidates of the first merge list for the current block; generate, based on the first merge list for the current block, a second merge list for the current block; obtaining a flag from a bitstream, the flag comprising a value indicative of the first merge list for the current block or the second merge list for the current block; select, based on the value of the flag, from among the first merge list for the current block and the second merge list for the current block, a merge list; and decode the current block using the merge mode and based on the selected merge list.
10 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to, prior to applying template matching to the candidates of the first merge list, change all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
11 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to, after applying template matching to the candidates of the first merge list, change all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
12 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to, prior to applying template matching to the candidates of the first merge list, trim candidates of the first merge list for the second merge list.
13 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to, after applying template matching to the candidates of the first merge list, trim candidates of the first merge list for the second merge list.
14 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to:
determine that one or more candidates of the first merge list are bi-directional prediction merge candidates; and
for each of the bi-directional prediction merge candidates, change a respective local illumination compensation (LIC) flag value associated with the first merge list to an opposite LIC flag value for the second merge list.
15 . The device of claim 9 , wherein as part of generating the second merge list, the one or more processors are configured to:
determine whether a block size of the current block is greater than a threshold; and
based on a determination that the block size of the current block is greater than the threshold, determine either a) one or more local illumination compensation (LIC) flag values for the second merge list based on template matching cost, or b) the one or more LIC flag values for the second merge list by changing a respective value one or more LIC flags of the first merge list for the second merge list.
16 . The device of claim 9 , wherein as part of selecting the merge list, the one or more processors are configured to: select, based on the value of the flag, the second merge list.
17 . Non-transitory computer-readable storage media storing instructions, which when executed, cause one or more processors to: determine to decode a current block of video data using a merge mode; generate a first merge list for the current block including applying template matching to candidates of the first merge list for the current block; generate, based on the first merge list for the current block, a second merge list for the current block; obtaining a flag from a bitstream, the flag comprising a value indicative of the first merge list for the current block or the second merge list for the current block; select, based on the value of the flag, from among the first merge list for the current block and the second merge list for the current block, a merge list; and decode the current block using the merge mode and based on the selected merge list or the second merge list.
18 . The non-transitory computer-readable storage media of claim 17 , wherein as part of generating the second merge list, the instructions cause the one or more processors to, prior to applying template matching to the candidates of the first merge list, change all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
19 . The non-transitory computer-readable storage media of claim 17 , wherein as part of generating the second merge list, the instructions cause the one or more processors to, after applying template matching to the candidates of the first merge list, change all of a plurality of local illumination compensation (LIC) flag values associated with the first merge list to opposite values for the second merge list.
20 . The non-transitory computer-readable storage media of claim 17 , wherein as part of selecting the merge list, the instructions cause the one or more processors to: and select, based on the value of the flag, the second merge list.