Device and method for decoding video data based on matching template size selection
A method of decoding video data performed by an electronic device is provided. The method receives the video data and determines a block unit from a current frame included in the video data. The method further selects, for the block unit, multiple reference matching blocks from the current frame, determines, from the current frame, a current matching template, neighboring the block unit, and multiple reference matching templates, and determines multiple reference filter models. Each of the reference matching templates neighbors a corresponding one of the reference matching blocks. Each of the reference filter models is derived based on a corresponding one of the reference matching templates and associated with a corresponding one of the reference matching blocks. The method then filters the reference matching blocks based on the reference filter models to generate multiple filtered reference blocks, and reconstructs the block unit based on the filtered reference blocks.
1 . A method of decoding video data performed by an electronic device, the method comprising:
receiving the video data;
determining a block unit from a current frame that is included in the video data;
selecting, for the block unit, a plurality of reference matching blocks from the current frame;
determining, from the current frame, a current matching template, neighboring the block unit, and a plurality of reference matching templates, each neighboring a corresponding one of the plurality of reference matching blocks;
determining a plurality of reference filter models, each derived based on the current matching template and a corresponding one of the plurality of reference matching templates;
filtering the plurality of reference matching blocks based on the plurality of reference filter models to generate a plurality of filtered reference blocks; and
reconstructing the block unit based on the plurality of filtered reference blocks, wherein:
the current matching template and the plurality of reference matching templates have a first matching template size when a block size of the block unit is greater than or equal to a threshold size,
the current matching template and the plurality of reference matching templates have a second matching template size when the block size of the block unit is less than the threshold size, and
the second matching template size is greater than the first matching template size.
2 . The method according to claim 1 , further comprising:
determining a plurality of reference candidate blocks from a search area of the block unit, the search area being included in the current frame;
determining, from the current frame, a current candidate template, neighboring the block unit, and a plurality of reference candidate templates, each neighboring a corresponding one of the plurality of reference candidate blocks; and
determining a plurality of reference template costs, each generated by comparing a corresponding one of the plurality of reference candidate templates with the current candidate template,
wherein selecting the plurality of reference matching blocks from the search area of the block unit is further based on the plurality of reference template costs.
3 . The method according to claim 2 , wherein a candidate template size of the current candidate template is different from a matching template size of the current matching template, the matching template size being selected from the first matching template size and the second matching template size.
4 . The method according to claim 1 , wherein the plurality of reference filter models comprises a plurality of linear filter models, each including a set of linear filter coefficients.
5 . The method according to claim 4 , wherein each set of linear filter coefficients in the plurality of reference filter models is different from other sets of linear filter coefficients in the plurality of reference filter models.
6 . The method according to claim 1 , wherein each of the plurality of filtered reference blocks is generated by filtering a corresponding one of the plurality of reference matching blocks based on one of the plurality of reference filter models that is associated with the one of the plurality of reference matching blocks.
7 . The method according to claim 1 , further comprising:
weightedly combining the plurality of filtered reference blocks to generate a predicted block, wherein reconstructing the block unit is further based on the predicted block.
8 . The method according to claim 7 , further comprising:
comparing each of the plurality of reference matching templates with the current matching template to generate a corresponding one of a plurality of comparing results; and
determining a plurality of weighting parameters based on the plurality of comparing results, wherein weightedly combining the plurality of filtered reference blocks is further based on the plurality of weighting parameters.
9 . An electronic device for decoding video data, the electronic device comprising:
at least one processor; and
at least one non-transitory computer-readable medium coupled to the at least one processor and storing one or more computer-executable instructions that, when executed by the at least one processor, cause the electronic device to:
receive the video data;
determine a block unit from a current frame that is included in the video data;
select, for the block unit, a plurality of reference matching blocks from the current frame;
determine, from the current frame, a current matching template, neighboring the block unit, and a plurality of reference matching templates, each neighboring a corresponding one of the plurality of reference matching blocks;
determine a plurality of reference filter models, each derived based on the current matching template and a corresponding one of the plurality of reference matching templates;
filter the plurality of reference matching blocks based on the plurality of reference filter models to generate a plurality of filtered reference blocks; and
reconstruct the block unit based on the plurality of filtered reference blocks, wherein:
the current matching template and the plurality of reference matching templates have a first matching template size when a block size of the block unit is greater than or equal to a threshold size,
the current matching template and the plurality of reference matching templates have a second matching template size when the block size of the block unit is less than the threshold size, and
the second matching template size is greater than the first matching template size.
10 . The electronic device according to claim 9 , wherein the one or more computer-executable instructions, when executed by the at least one processor, further cause the electronic device to:
determine a plurality of reference candidate blocks from a search area of the block unit, the search area being included in the current frame;
determine, from the current frame, a current candidate template, neighboring the block unit, and a plurality of reference candidate templates, each neighboring a corresponding one of the plurality of reference candidate blocks; and
determine a plurality of reference template costs, each generated by comparing a corresponding one of the plurality of reference candidate templates with the current candidate template,
wherein selecting the plurality of reference matching blocks from the search area of the block unit is further based on the plurality of reference template costs.
11 . The electronic device according to claim 10 , wherein a candidate template size of the current candidate template is different from a matching template size of the current matching template, the matching template size being selected from the first matching template size and the second matching template size.
12 . The electronic device according to claim 9 , wherein the plurality of reference filter models comprises a plurality of linear filter models, each including a set of linear filter coefficients.
13 . The electronic device according to claim 12 , wherein each set of linear filter coefficients in the plurality of reference filter models is different from other sets of linear filter coefficients in the plurality of reference filter models.
14 . The electronic device according to claim 9 , wherein each of the plurality of filtered reference blocks is generated by filtering a corresponding one of the plurality of reference matching blocks based on one of the plurality of reference filter models that is associated with the one of the plurality of reference matching blocks.
15 . The electronic device according to claim 9 , wherein the one or more computer-executable instructions, when executed by the at least one processor, further cause the electronic device to:
weightedly combine the plurality of filtered reference blocks to generate a predicted block, wherein reconstructing the block unit is further based on the predicted block.
16 . The electronic device according to claim 15 , wherein the one or more computer-executable instructions, when executed by the at least one processor, further cause the electronic device to:
compare each of the plurality of reference matching templates with the current matching template to generate a corresponding one of a plurality of comparing results; and
determine a plurality of weighting parameters based on the plurality of comparing results, wherein weightedly combining the plurality of filtered reference blocks is further based on the plurality of weighting parameters.