Method and apparatus for down-sampling and up-sampling in matrix intra prediction for video
An apparatus includes a communication interface configured to receive a bitstream for a compressed video and a processor operably coupled to the communication interface. The processor is configured to decode the bitstream for the compressed video and obtain reference samples associated with a block of a video frame. The processor is also configured to select a down-sampling filter to use in down-sampling the reference samples. The processor is also configured to apply the selected down-sampling filter to the reference samples to obtain reduced reference samples. The processor is also configured to obtain a reduced intra prediction associated with the block using the reduced reference samples. The processor is also configured to select an up-sampling filter to use in up-sampling the reduced intra prediction. The processor is also configured to apply the selected up-sampling filter to the reduced intra prediction to obtain a full intra prediction of the block.
1 . An apparatus comprising:
a communication interface configured to receive a bitstream for a compressed video; and
a processor operably coupled to the communication interface, the processor configured to:
decode the bitstream for the compressed video and obtain reference samples associated with a block of a video frame;
select a down-sampling filter to use in down-sampling the reference samples;
apply the selected down-sampling filter to the reference samples to obtain reduced reference samples;
obtain a reduced intra prediction associated with the block using the reduced reference samples;
select an up-sampling filter to use in up-sampling the reduced intra prediction,
wherein a sum of losses, determined using a loss function, for a plurality of blocks with a same size as a block size of the block of the video frame, is minimized to obtain the at least one of the down-sampling and the up-sampling filter;
apply the selected up-sampling filter to the reduced intra prediction to obtain a full intra prediction of the block; and
output the full intra prediction of the block.
2 . The apparatus of claim 1 , wherein, to select the down-sampling filter, the processor is further configured to select the down-sampling filter from a set of filters based on a decimation factor.
3 . The apparatus of claim 1 , wherein the selection of at least one of the down-sampling filter and the up-sampling filter is based on block features including a variation metric of the reference samples.
4 . The apparatus of claim 3 , wherein, to select the down-sampling filter, the processor is further configured to:
determine whether the variation metric is above a variation threshold; and
if the variation metric is above the variation threshold, select the down-sampling filter from a set of filters based on a decimation factor, or
if the variation metric is below the variation threshold, select an averaging filter as the down-sampling filter.
5 . The apparatus of claim 3 , wherein, to select the up-sampling filter, the processor is further configured to:
determine whether the variation metric is above a variation threshold; and
if the variation metric is above the variation threshold, select a discrete cosine transform interpolation filter (DCTIF) as the up-sampling filter, or
if the variation metric is below the variation threshold, select a linear interpolation filter as the up-sampling filter.
6 . The apparatus of claim 5 , wherein the selected DCTIF filter is a discrete cosine transform type II filter.
7 . The apparatus of claim 3 , wherein the reference samples include left reference samples and top references samples relative to the block, and wherein the processor is further configured to:
determine the variation metric for each of the left reference samples and the top reference samples;
select a first down-sampling filter for the left reference samples and a second down-sampling filter for the top reference samples; and
select a first up-sampling filter for the left reference samples and a second up-sampling filter for the top reference samples.
8 . The apparatus of claim 1 , wherein the at least one of the down-sampling filter and the up-sampling filter are optimized using the loss function, wherein the loss function is based on a prediction residual, and wherein the prediction residual is a difference between an original block and a predicted block.
9 . A method comprising:
receiving and decoding a bitstream for a compressed video;
obtaining reference samples associated with a block of a video frame;
selecting a down-sampling filter to use in down-sampling the reference samples;
applying the selected down-sampling filter to the reference samples to obtain reduced reference samples;
obtaining a reduced intra prediction associated with the block using the reduced reference samples;
selecting an up-sampling filter to use in up-sampling the reduced intra prediction,
wherein a sum of losses, determined using a loss function, for a plurality of blocks with a same size as a block size of the block of the video frame, is minimized to obtain the at least one of the down-sampling and the up-sampling filter;
applying the selected up-sampling filter to the reduced intra prediction to obtain a full intra prediction of the block; and
outputting the full intra prediction of the block.
10 . The method of claim 9 , wherein selecting the down-sampling filter includes selecting the down-sampling filter from a set of filters based on a decimation factor.
11 . The method of claim 9 , wherein the selection of at least one of the down-sampling filter and the up-sampling filter is based on block features including a variation metric of the reference samples.
12 . The method of claim 11 , wherein selecting the down-sampling filter includes:
determining whether the variation metric is above a variation threshold; and
if the variation metric is above the variation threshold, selecting the down-sampling filter from a set of filters based on a decimation factor, or
if the variation metric is below the variation threshold, selecting an averaging filter as the down-sampling filter.
13 . The method of claim 11 , wherein selecting the up-sampling filter includes:
determining whether the variation metric is above a variation threshold; and
if the variation metric is above the variation threshold, selecting a discrete cosine transform interpolation filter (DCTIF) as the up-sampling filter, or
if the variation metric is below the variation threshold, selecting a linear interpolation filter as the up-sampling filter.
14 . The method of claim 13 , wherein the selected DCTIF filter is a discrete cosine transform type II filter.
15 . The method of claim 11 , wherein the reference samples include left reference samples and top references samples relative to the block, and wherein the method further comprises:
determining the variation metric for each of the left reference samples and the top reference samples;
selecting a first down-sampling filter for the left reference samples and a second down-sampling filter for the top reference samples; and
selecting a first up-sampling filter for the left reference samples and a second up-sampling filter for the top reference samples.
16 . The method of claim 9 , wherein the at least one of the down-sampling filter and the up-sampling filter are optimized using the loss function, wherein the loss function is based on a prediction residual, and wherein the prediction residual is a difference between an original block and a predicted block.
17 . An apparatus comprising:
a communication interface; and
a processor operably coupled to the communication interface, the processor configured to:
subdivide a video frame into a plurality of blocks of a plurality of block sizes;
obtain reference samples associated with a block of the plurality of blocks;
select a down-sampling filter to use in down-sampling the reference samples;
apply the selected down-sampling filter to the reference samples to obtain reduced reference samples;
obtain a reduced intra prediction associated with the block using the reduced reference samples;
select an up-sampling filter to use in up-sampling the reduced intra prediction,
wherein a sum of losses, determined using the loss function, of multiple blocks with a same size as a block size of the block, is minimized to obtain the at least one of the down-sampling filter and the up-sampling filter;
apply the selected up-sampling filter to the reduced intra prediction to obtain a full intra prediction of the block; and
encode and transmit the prediction residual as part of a bitstream, wherein the prediction residual is a difference between an original block and a predicted block.
18 . The apparatus of claim 17 , wherein the at least one of the down-sampling filter and the up-sampling filter are optimized using the loss function, wherein the loss function is based on the prediction residual.
19 . The apparatus of claim 17 , wherein, to select the down-sampling filter, the processor is further configured to:
determine whether a variation metric of the reference samples is above a variation threshold; and
if the variation metric is above the variation threshold, select the down-sampling filter from a set of filters based on a decimation factor, or
if the variation metric is below the variation threshold, select an averaging filter as the down-sampling filter.
20 . The apparatus of claim 17 , wherein, to select the up-sampling filter, the processor is further configured to:
determine whether a variation metric is above a variation threshold; and
if the variation metric is above the variation threshold, select a discrete cosine transform interpolation filter (DCTIF) as the up-sampling filter, or
if the variation metric is below the variation threshold, select a linear interpolation filter as the up-sampling filter.