Image encoder, image decoder, image encoding method, and image decoding method
An image encoder includes circuitry, and a memory connected to the circuitry. The circuitry, in operation, determines a first region and a second region in an input image, generates a first image from the input image by applying a first prefilter to the first region and a second prefilter to the second region, determines a first parameter relating to the first region and a second parameter relating to the second region, and generates a bitstream by encoding the first region based on the first parameter, encoding the second region based on the second parameter, encoding the first prefilter or a first postfilter corresponding to the first prefilter, and encoding the second prefilter or a second postfilter corresponding to the second prefilter.
1 . An image encoder comprising:
circuitry; and
a memory connected to the circuitry,
wherein the circuitry, in operation,
determines a first region and a second region in an input image,
selects, based on usage information regarding image usage at an image decoder, a prefilter set including a first prefilter and a second prefilter from among a plurality of prefilter sets,
generates a first image from the input image by applying the first prefilter to the first region and the second prefilter to the second region,
determines a first parameter relating to the first region and a second parameter relating to the second region, and
generates a bitstream by encoding the first region based on the first parameter, encoding the second region based on the second parameter, encoding the first prefilter or a first postfilter corresponding to the first prefilter, and encoding the second prefilter or a second postfilter corresponding to the second prefilter.
2 . The image encoder according to claim 1 , wherein the image usage includes at least one machine task and human vision.
3 . The image encoder according to claim 1 , wherein the first parameter and the second parameter each include at least one of a quantization parameter, a partitioning size, a prediction type, and a bounding box.
4 . The image encoder according to claim 3 , wherein
the first parameter and the second parameter each include the quantization parameter, and
the circuitry determines a value of the quantization parameter, or a parity of the quantization parameter based on the first prefilter or the second prefilter.
5 . The image encoder according to claim 3 , wherein
the first parameter and second parameter each include the partitioning size, and
the circuitry determines a total number of pixels of the partitioning size, an aspect ratio of the partitioning size, or a number of horizontal pixels and a number of vertical pixels of the partitioning size based on the first prefilter or the second prefilter.
6 . The image encoder according to claim 3 , wherein
the first parameter and the second parameter each include the prediction type, and
the circuitry determines an intra prediction or an inter prediction as the prediction type based on the first prefilter or the second prefilter.
7 . The image encoder according to claim 3 , wherein
the first parameter and the second parameter each include the bounding box, and
the circuitry determines the bounding box based on the first prefilter or the second prefilter.
8 . The image encoder according to claim 1 , wherein the circuitry stores filter information in a header of the bitstream, the filter information relating to the first prefilter or the first postfilter and the second prefilter or the second postfilter.
9 . The image encoder according to claim 8 , wherein the filter information includes the usage information, the image usage being that of when the prefilter set including the first prefilter and the second prefilter is selected from the plurality of prefilter sets.
10 . The image encoder according to claim 8 , wherein
the header includes a supplemental enhancement information (SEI) region, and
the circuitry stores the filter information in the SEI region.
11 . An image decoder comprising:
circuitry; and
a memory connected to the circuitry,
wherein the circuitry, in operation,
decodes a first prefilter or a first postfilter corresponding to the first prefilter, a second prefilter or a second postfilter corresponding to the second prefilter, a first parameter, and a second parameter from a bitstream, decodes a first region of a first image from the bitstream based on the first parameter, and decodes a second region of the first image from the bitstream based on the second parameter, and
generates a second image by applying a first postfilter corresponding to the first prefilter decoded from the bitstream or the first postfilter decoded from the bitstream to the first region of the first image, and applying a second postfilter corresponding to the second prefilter decoded from the bitstream or the second postfilter decoded from the bitstream to the second region of the first image, and outputs the second image, and
wherein the circuitry, in operation, selects, based on usage information regarding image usage of the second image, a postfilter set including the first postfilter and the second postfilter from among a plurality of postfilter sets including a postfilter set acquired from the bitstream.
12 . The image decoder according to claim 11 , wherein the image usage includes at least one machine task and human vision.
13 . The image decoder according to claim 11 , wherein the first parameter and the second parameter each include at least one of a quantization parameter, a partitioning size, a prediction type, and a bounding box.
14 . The image decoder according to claim 13 , wherein
the first parameter and the second parameter each includes the quantization parameter, and
the circuitry applies the first postfilter or the second postfilter based on a value of the quantization parameter or a parity of the quantization parameter.
15 . The image decoder according to claim 13 , wherein
the first parameter and second parameter each include the partitioning size, and
the circuitry applies the first postfilter or the second postfilter based on a total number of pixels of the partitioning size, an aspect ratio of the partitioning size, or a number of horizontal pixels and a number of vertical pixels of the partitioning size.
16 . The image decoder according to claim 13 , wherein
the first parameter and the second parameter each include the prediction type, and
the circuitry applies the first postfilter or the second postfilter based on whether the prediction type is an intra prediction or an inter prediction.
17 . The image decoder according to claim 13 , wherein
the first parameter and the second parameter each include the bounding box, and
the circuitry applies the first postfilter or the second postfilter based on whether to be a region within the bounding box or a region outside the bounding box.
18 . The image decoder according to claim 11 , wherein the circuitry extracts filter information from a header of the bitstream, the filter information relating to the first prefilter or the first postfilter and the second prefilter or the second postfilter.
19 . The image decoder according to claim 18 , wherein the filter information includes the usage information, the image usage being that of when the filter information is generated in the image encoder.
20 . The image decoder according to claim 18 , wherein
the header includes a supplemental enhancement information (SEI) region, and
the circuitry extracts the filter information from the SEI region.
21 . An image encoding method comprising:
by an image encoder,
determining a first region and a second region in an input image;
selecting, based on usage information regarding image usage at an image decoder, a prefilter set including a first prefilter and a second prefilter from among a plurality of prefilter sets,
generating a first image from the input image by applying the first prefilter to the first region and applying the second prefilter to the second region;
determining a first parameter relating to the first region and a second parameter relating to the second region; and
generating a bitstream by encoding the first region based on the first parameter, encoding the second region based on the second parameter, encoding the first prefilter or a first postfilter corresponding to the first prefilter, and encoding the second prefilter or a second postfilter corresponding to the second prefilter.
22 . An image decoding method comprising:
by an image decoder,
decoding a first prefilter or a first postfilter corresponding to the first prefilter, a second prefilter or a second postfilter corresponding to the second prefilter, a first parameter, and a second parameter from a bitstream, decoding a first region of a first image from the bitstream based on the first parameter, and decoding a second region of the first image from the bitstream based on the second parameter;
generating a second image by applying a first postfilter corresponding to the first prefilter decoded from the bitstream or the first postfilter decoded from the bitstream to the first region of the first image, and applying a second postfilter corresponding to the second prefilter decoded from the bitstream or the second postfilter decoded from the bitstream to the second region of the first image; and
outputting the second image,
wherein the circuitry, in operation, selects, based on usage information regarding image usage of the second image, a postfilter set including the first postfilter and the second postfilter from among a plurality of postfilter sets including a postfilter set acquired from the bitstream.