Network based image filtering for video coding
A method and an apparatus for image filtering in video coding using a neural network are provided. The method includes: loading, a plurality of quantization parameter (QP) map (QpMap) values at a plurality of QpMap channels into the neural network; obtaining a QP scaling factor by adjusting a plurality of input QP values related to an input frame; and adjusting, according to a QP scaling factor, the plurality of QpMap values for the neural network to learn and filter the input frame to the neural network.
1 . A method for image filtering in video coding, comprising:
loading a plurality of quantization parameter (QP) map (QpMap) values at one or more QpMap channels into a neural network;
obtaining a QP scaling factor by adjusting a plurality of input QP values related to an input frame; and
adjusting, according to the QP scaling factor, the plurality of QpMap values for the neural network to learn and filter the input frame to the neural network;
wherein obtaining the QP scaling factor by adjusting the plurality of input QP values related to the input frame comprises:
obtaining a scaled QP step size by performing a subtraction or an addition on a corresponding QP input value, wherein the scaling operation of Qp step size is equivalent to the subtraction or addition operation of the corresponding QP input value; and
obtaining the QP scaling factor based on the scaled QP step size.
2 . The method of claim 1 , wherein adjusting the plurality of input QP values related to the input frame comprises:
obtaining a QP offset based on a QP offset step size, a lower bound, and an offset index, wherein the QP offset step size is a step size for adjusting each input QP value, the lower bound is an integer value determining a maximum QP value reduction, and the offset index is a signaled index value; and
subtracting the QP offset from a QP input value.
3 . The method of claim 2 , further comprising:
signalling, by an encoder, the QP offset step size, the low bound, and the offset index, wherein the offset index is an integer between 0 and 3.
4 . The method of claim 2 , further comprising:
predefining, by an encoder, the QP offset step size and the low bound; and
signalling, by the encoder, the offset index, wherein the offset index is an integer between 0 and 3.
5 . The method of claim 1 , further comprising:
loading a plurality of input patches associated with the input frame into the neural network at a plurality of input channels; and
scaling the plurality of input patches using element-wise multiplication based on the plurality of QP map values.
6 . The method of claim 1 , further comprising:
aligning resolution of a plurality of input patches at a plurality of input channels;
obtaining a concatenated input by concatenating, by a concatenation block in the neural network, the plurality of input patches and the plurality of QP map values;
loading the concatenated input into a residual network following the concatenation block, wherein the residual network comprises a plurality of residual blocks; and
respectively loading the plurality of QP map values as a sample value scaling factor input to one or more residual blocks in the residual network.
7 . The method of claim 6 , further comprising:
scaling an input to a residual block based on the sample value scaling factor before loading the input to the residual block.
8 . The method of claim 6 , further comprising:
scaling an output of a residual block based on the sample value scaling factor.
9 . The method of claim 6 , further comprising:
scaling the plurality of input patches by element-wise multiplication based on the plurality of QP map values.
10 . An apparatus for image filtering in video coding using a neural network, comprising:
one or more processors; and
a memory configured to store instructions executable by the one or more processors,
wherein the one or more processors, upon execution of the instructions, are configured to:
load a plurality of quantization parameter (QP) map (QpMap) values at one or more QpMap channels into a neural network;
obtain a QP scaling factor by adjusting a plurality of input QP values related to an input frame; and
adjust, according to the QP scaling factor, the plurality of QpMap values for the neural network to learn and filter the input frame to the neural network;
wherein the one or more processors are configured to obtain the QP scaling factor by adjusting the plurality of input QP values related to the input frame comprises that the one or more processors are configured to:
obtain a scaled QP step size by performing a subtraction or an addition on a corresponding QP input value, wherein the scaling operation of Qp step size is equivalent to the subtraction or addition operation of the corresponding QP input value; and
obtain the QP scaling factor based on the scaled QP step size.
11 . The apparatus of claim 10 , wherein the one or more processors configured to adjust the plurality of input QP values related to the input frame comprises:
obtain a QP offset based on a QP offset step size, a lower bound, and an offset index, wherein the QP offset step size is a step size for adjusting each input QP value, the lower bound is an integer value determining a maximum QP value reduction, and the offset index is a signaled index value; and
subtract the QP offset from a QP input value.
12 . The apparatus of claim 11 , the one or more processors further configured to:
signal the QP offset step size, the low bound, and the offset index, wherein the offset index is an integer between 0 and 3.
13 . The apparatus of claim 11 , the one or more processors further configured to:
predefine the QP offset step size and the low bound; and
signal the offset index, wherein the offset index is an integer between 0 and 3.
14 . A non-transitory computer readable storage medium storing a bitstream to be coded by a method for image filtering in video coding, wherein the method comprises:
loading a plurality of quantization parameter (QP) map (QpMap) values at one or more QpMap channels into a neural network;
obtaining a QP scaling factor by adjusting a plurality of input QP values related to an input frame; and
adjusting, according to the QP scaling factor, the plurality of QpMap values for the neural network to learn and filter the input frame to the neural network;
wherein obtaining the QP scaling factor by adjusting the plurality of input QP values related to the input frame comprises:
obtaining a scaled QP step size by performing a subtraction or an addition on a corresponding QP input value, wherein the scaling operation of Qp step size is equivalent to the subtraction or addition operation of the corresponding QP input value; and
obtaining the QP scaling factor based on the scaled QP step size.
15 . The non-transitory computer readable storage medium of claim 14 , wherein adjusting the plurality of input QP values related to the input frame comprises:
obtaining a QP offset based on a QP offset step size, a lower bound, and an offset index, wherein the QP offset step size is a step size for adjusting each input QP value, the lower bound is an integer value determining a maximum QP value reduction, and the offset index is a signaled index value; and
subtracting the QP offset from a QP input value.
16 . The non-transitory computer readable storage medium of claim 15 , the method further comprising:
signalling, by an encoder, the QP offset step size, the low bound, and the offset index, wherein the offset index is an integer between 0 and 3.
17 . The non-transitory computer readable storage medium of claim 15 , the method further comprising:
predefining, by an encoder, the QP offset step size and the low bound; and
signalling, by the encoder, the offset index, wherein the offset index is an integer between 0 and 3.