Grouping based adaptive reordering of merge candidate
In a method, coded information of a current block and neighboring blocks of the current block in a current picture is received from a coded video bitstream. A list of merge candidates of the current block is generated based on the neighboring blocks of the current block. The list of merge candidates of the current block is divided into a plurality of subgroups. Each of the plurality of subgroups includes one or more merge candidates. The one or more merge candidates are ordered within each subgroup by a respective template matching (TM) cost associated with each of the one or more merge candidates. The current block is reconstructed based on a merge candidate selected from the list of merge candidates of the current block.
1. A method of video decoding, the method comprising:
receiving coded information of a current block and neighboring blocks of the current block in a current picture from a coded video bitstream;
generating a list of merge candidates of the current block based on the neighboring blocks of the current block, the list of merge candidates including non-adjacent spatial motion vector predictors;
dividing the list of merge candidates of the current block into a plurality of subgroups, each of the plurality of subgroups including one or more merge candidates, wherein a first subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/4 with respect to a horizontal axis, a second subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/2 with respect to the horizontal axis, and a third subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of 3π/2 with respect to the horizontal axis;
sorting the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups;
after the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups are sorted, reordering the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups in the list of merge candidates based on a characteristic template matching (TM) cost value associated with each of the plurality of subgroups; and
reconstructing the current block based on a merge candidate selected from the reordered plurality of subgroups in the list of merge candidates of the current block.
2. The method of claim 1 , wherein the reordering further comprises:
determining the respective characteristic TM cost value associated with each of the plurality of subgroups; and
reordering the plurality of subgroups in the list of merge candidates based on an ascending order of the characteristic TM cost values associated with the plurality of subgroups such that the first subgroup of the plurality of subgroups in the reordered list is associated with a smallest characteristic TM cost value of the characteristic TM cost values.
3. The method of claim 2 , wherein the determining the respective characteristic TM cost value further comprises:
determining a plurality of template matching (TM) cost values of the one or more merge candidates in the first subgroup of the plurality of subgroups, each of the TM cost values being associated with a difference between adjacent neighboring samples of the current block and adjacent neighboring samples of a respective merge candidate in the first subgroup; and
reordering the one or more merge candidates in the first subgroup of the plurality of subgroups based on an ascending order of the plurality of TM cost values of the one or more merge candidates in the first subgroup such that a first merge candidate in the reordered first subgroup has a smallest TM cost value.
4. The method of claim 3 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as the smallest TM cost value of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
5. The method of claim 3 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as a median TM cost value of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
6. The method of claim 3 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as a median TM cost value of N smallest TM cost values of the plurality of TM cost values of the one or more merge candidates in the first subgroup, N being a positive integer and equal to or larger than 2.
7. The method of claim 3 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as an average value of first two smallest TM cost values of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
8. The method of claim 1 , wherein the generating the list of merge candidates comprises:
generating the list of merge candidates of the current block based on at least one of:
spatial motion vector (MV) predictors from spatial neighboring blocks of the neighboring blocks of the current block;
temporal MV predictors from collocated blocks of the current block;
history-based MV predictors from a first-in-first out (FIFO) table;
pairwise average MV predictors;
zero MVs; and
non-adjacent temporal MV predictors of the current block.
9. The method of claim 8 , wherein the dividing further comprises:
dividing the list of merge candidates into the first subgroup that includes a first group of the non-adjacent spatial motion vector predictors that are positioned along the line with the angle of π/4, the line with the angle of π/2, a line with an angle of 3π/4, a line with an angle of x, and a line with an angle of 5π/4 with respect to a horizontal axis; and
dividing the list of merge candidates into the second subgroup that includes a second group of the non-adjacent spatial motion vector predictors that are positioned along the line with the angle of π/4, a line with an angle of 3π/8, the line with the angle of π/2, a line with an angle of 5π/8, the line with the angle of 3π/4, a line with an angle of 7π/8, the line with the angle of π, a line with an angle of 9π/8, and the line with the angle of 5π/4 with respect to the horizontal axis.
10. The method of claim 9 , wherein the dividing further comprises:
dividing the list of merge candidates into the third subgroup that includes the non-adjacent temporal MV predictors.
11. The method of claim 1 , wherein the dividing further comprises:
dividing the list of merge candidates into the plurality of subgroups such that each of the plurality of subgroups includes one of a same number of merge candidates, a pre-defined number of merge candidates, or a same type of merge candidates.
12. A method for video encoding, comprising:
generating a list of merge candidates of a current block to be encoded based on neighboring blocks of the current block, the list of merge candidates including non-adjacent spatial motion vector predictors;
dividing the list of merge candidates of the current block into a plurality of subgroups, each of the plurality of subgroups including one or more merge candidates, wherein a first subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/4 with respect to a horizontal axis, a second subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/2 with respect to the horizontal axis, and a third subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of 3π/2 with respect to the horizontal axis;
sorting the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups;
after the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups are sorted, reordering the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups in the list of merge candidates based on a characteristic template matching (TM) cost value associated with each of the plurality of subgroups; and
encoding the current block based on a merge candidate selected from the reordered plurality of subgroups in the list of merge candidates of the current block.
13. The method of claim 12 , wherein the the reordering further comprises:
determining the respective characteristic TM cost value associated with each of the plurality of subgroups; and
reordering the plurality of subgroups in the list of merge candidates based on an ascending order of the characteristic TM cost values associated with the plurality of subgroups such that the first subgroup of the plurality of subgroups in the reordered list is associated with a smallest characteristic TM cost value of the characteristic TM cost values.
14. The method of claim 13 , wherein the determining the respective characteristic TM cost value further comprises:
determining a plurality of template matching (TM) cost values of the one or more merge candidates in the first subgroup of the plurality of subgroups, each of the TM cost values being associated with a difference between adjacent neighboring samples of the current block and adjacent neighboring samples of a respective merge candidate in the first subgroup; and
reordering the one or more merge candidates in the first subgroup of the plurality of subgroups based on an ascending order of the plurality of TM cost values of the one or more merge candidates in the first subgroup such that a first merge candidate in the reordered first subgroup has a smallest TM cost value.
15. The method of claim 14 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as the smallest TM cost value of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
16. The method of claim 14 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as a median TM cost value of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
17. The method of claim 14 , wherein the determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as a median TM cost value of N smallest TM cost values of the plurality of TM cost values of the one or more merge candidates in the first subgroup, N being a positive integer and equal to or larger than 2.
18. The method of claim 14 , wherein the circuitry is configured to determining the respective characteristic TM cost value further comprises:
determining the characteristic TM cost value associated with the first subgroup of the plurality of subgroups as an average value of first two smallest TM cost values of the plurality of TM cost values of the one or more merge candidates in the first subgroup.
19. The method of claim 1 , further comprising:
reordering the plurality of subgroups in the list of merge candidates based on a predefined order, the predefined order being indicating by signal information that is included in the coded video bitstream.
20. A method of processing visual media data, the method comprising:
processing a bitstream of the visual media data, wherein
the bitstream includes coded information of a current block and neighboring blocks of the current block in a current picture, and
the bitstream causes a decoder to:
generate a list of merge candidates of the current block based on the neighboring blocks of the current block, the list of merge candidates including non-adjacent spatial motion vector predictors;
divide the list of merge candidates of the current block into a plurality of subgroups, each of the plurality of subgroups including one or more merge candidates, wherein a first subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/4 with respect to a horizontal axis, a second subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of π/2 with respect to the horizontal axis, and a third subgroup of the plurality of subgroups includes motion vector predictors positioned along a line with an angle of 3π/8 with respect to the horizontal axis;
sort the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups;
after the one or more merge candidates in each of the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups are sorted, reorder the first subgroup, the second subgroup, and the third subgroup of the plurality of subgroups in the list of merge candidates based on a characteristic template matching (TM) cost value associated with each of the plurality of subgroups; and
reconstruct the current block based on a merge candidate selected from the reordered plurality of subgroups in the list of merge candidates of the current block.