Device and method for coding video data
A method of decoding video data by an electronic device is provided. The method receives the video data, and determines, from an image frame, a block unit and a plurality of neighboring regions neighboring the block unit according to the video data. In addition, the method filters the plurality of neighboring regions neighboring the block unit to generate a plurality of template gradients. The method then derives a plurality of intra candidate modes based on the plurality of template gradients, and generates a plurality of template predictions, each of which being associated with one of the plurality of intra candidate modes. The method reconstructs the block unit based on the plurality of template predictions.
1 . A method of decoding video data by an electronic device, the method comprising:
receiving the video data;
determining, from an image frame retrieved from the video data, a block unit and a plurality of neighboring regions neighboring the block unit;
filtering the plurality of neighboring regions to generate a plurality of template gradients;
deriving a plurality of intra candidate modes based on the plurality of template gradients;
determining a plurality of template blocks neighboring the block unit, wherein the plurality of template blocks is included in a template unit having a plurality of template samples reconstructed prior to reconstructing the block unit;
determining a plurality of template references neighboring the plurality of template blocks;
predicting the plurality of template blocks based on the plurality of template references by using the plurality of intra candidate modes to generate a plurality of template predictions each of which being associated with one of the plurality of intra candidate modes;
selecting, from the plurality of intra candidate modes derived based on the plurality of template gradients, a plurality of prediction modes based on the plurality of template predictions;
selecting a specific one of a plurality of reference lines, the plurality of reference lines neighboring the block unit;
predicting the block unit based on the specific one of the plurality of reference lines by using the plurality of prediction modes to generate a plurality of predicted blocks, each corresponding to one of the plurality of prediction modes;
weightedly combining the plurality of predicted blocks to generate a prediction block with a plurality of weighting parameters; and
reconstructing the block unit based on the prediction block.
2 . The method according to claim 1 , further comprising:
determining a plurality of cost values by comparing the template unit with each of the plurality of template predictions, wherein:
selecting the plurality of prediction modes is further based on the plurality of cost values, and
each of the plurality of cost values determined by a cost function corresponding to one of the plurality of template predictions.
3 . The method according to claim 1 , wherein:
the plurality of intra candidate modes is selected from a plurality of intra default modes based on the plurality of template blocks, and
the plurality of weighting parameters is determined based on the plurality of template blocks.
4 . The method according to claim 3 , wherein:
the plurality of weighting parameters is determined based on a plurality of cost values, and
the plurality of cost values is determined by comparing the template unit with each of the plurality of template predictions.
5 . The method according to claim 1 , wherein:
the plurality of neighboring regions comprises a plurality of reconstructed blocks neighboring the block unit,
the plurality of reconstructed blocks is reconstructed based on at least one reconstructed mode prior to reconstructing the block unit, and
the plurality of intra candidate modes comprises a plurality of most probable modes (MPMs) selected from a plurality of intra default modes based on the at least one reconstructed mode.
6 . The method according to claim 1 , further comprising:
generating a plurality of template angles and a plurality of template amplitudes based on the plurality of template gradients, wherein each of the plurality of template angles corresponds to one of the plurality of template amplitudes; and
generating a histogram of gradient (HoG) based on the plurality of template angles and the plurality of template amplitudes for selecting the plurality of intra candidate modes.
7 . The method according to claim 6 , further comprising:
mapping each of the plurality of template angles to one of a plurality of intra default modes based on a predefined relationship between the plurality of template angles and the plurality of intra default modes to generate at least one mapping mode; and
generating the HoG by accumulating the plurality of template amplitudes based on the at least one mapping mode, wherein the plurality of intra candidate modes is selected from the plurality of intra default modes based on the accumulated plurality of template amplitudes in the HoG.
8 . 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, from an image frame retrieved from the video data, a block unit and a plurality of neighboring regions neighboring the block unit;
filter the plurality of neighboring regions to generate a plurality of template gradients;
derive a plurality of intra candidate modes based on the plurality of template gradients;
determine a plurality of template blocks neighboring the block unit, wherein the plurality of template blocks is included in a template unit having a plurality of template samples reconstructed prior to reconstructing the block unit;
determine a plurality of template references neighboring the plurality of template blocks;
predict the plurality of template blocks based on the plurality of template references by using the plurality of intra candidate modes to generate a plurality of template predictions each of which being associated with one of the plurality of intra candidate modes;
select, from the plurality of intra candidate modes derived based on the plurality of template gradients, a plurality of prediction modes based on the plurality of template predictions;
select a specific one of a plurality of reference lines, the plurality of reference lines neighboring the block unit;
predict the block unit based on the specific one of the plurality of reference lines by using the plurality of prediction modes to generate a plurality of predicted blocks, each corresponding to one of the plurality of prediction modes;
weightedly combine the plurality of predicted blocks to generate a prediction block with a plurality of weighting parameters; and
reconstruct the block unit based on the prediction block.
9 . The electronic device according to claim 8 , 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 cost values by comparing the template unit with each of the plurality of template predictions, wherein:
selecting the plurality of prediction modes is further based on the plurality of cost values, and
each of the plurality of cost values determined by a cost function corresponding to one of the plurality of template predictions.
10 . The electronic device according to claim 8 , wherein:
the plurality of weighting parameters is determined based on a plurality of cost values, and
the plurality of cost values is determined by comparing the template unit with each of the plurality of template predictions.
11 . The electronic device according to claim 8 , wherein:
the plurality of neighboring regions comprises a plurality of reconstructed blocks neighboring the block unit,
the plurality of reconstructed blocks is reconstructed based on at least one reconstructed mode prior to reconstructing the block unit, and
the plurality of intra candidate modes comprises a plurality of most probable modes (MPMs) selected from a plurality of intra default modes based on the at least one reconstructed mode.
12 . The electronic device according to claim 8 , wherein the one or more computer-executable instructions, when executed by the at least one processor, further cause the electronic device to:
filter the plurality of neighboring regions by using a gradient filter to generate a plurality of template angles and a plurality of template amplitudes, wherein each of the plurality of template angles corresponds to one of the plurality of template amplitudes; and
generate a histogram of gradient (HoG) based on the plurality of template angles and the plurality of template amplitudes for selecting the plurality of intra candidate modes.
13 . The electronic device according to claim 12 , wherein the one or more computer-executable instructions, when executed by the at least one processor, further cause the electronic device to:
map each of the plurality of template angles to one of a plurality of intra default modes based on a predefined relationship between the plurality of template angles and the plurality of intra default modes to generate at least one mapping mode; and
generate the HoG by accumulating the plurality of template amplitudes based on the at least one mapping mode, wherein the plurality of intra candidate modes is selected from the plurality of intra default modes based on the accumulated plurality of amplitudes in the HoG.
14 . The method according to claim 1 , wherein:
the plurality of intra candidate modes is selected, based on the plurality of template gradients, from a plurality of intra extended modes,
the plurality of intra extended modes comprises a plurality of intra default modes and a plurality of additional modes different from the plurality of intra default modes, and
at least one of the plurality of additional modes is between two adjacent intra default modes in the plurality of intra default modes.