WO2023136257A1 - 動画像符号化装置、動画像復号装置 - Google Patents

動画像符号化装置、動画像復号装置 Download PDF

Info

Publication number
WO2023136257A1
WO2023136257A1 PCT/JP2023/000408 JP2023000408W WO2023136257A1 WO 2023136257 A1 WO2023136257 A1 WO 2023136257A1 JP 2023000408 W JP2023000408 W JP 2023000408W WO 2023136257 A1 WO2023136257 A1 WO 2023136257A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
input
unit
output
idc
Prior art date
Application number
PCT/JP2023/000408
Other languages
English (en)
French (fr)
Inventor
将伸 八杉
圭一郎 高田
知宏 猪飼
健 中條
友子 青野
Original Assignee
シャープ株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by シャープ株式会社 filed Critical シャープ株式会社
Publication of WO2023136257A1 publication Critical patent/WO2023136257A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Definitions

  • Embodiments of the present invention relate to video encoding devices and video decoding devices.
  • a moving image encoding device that generates encoded data by encoding a moving image and a moving image that generates a decoded image by decoding the encoded data in order to efficiently transmit or record the moving image An image decoding device is used.
  • Specific video encoding methods include H.264/AVC and H.265/HEVC (High-Efficiency Video Coding).
  • the images (pictures) that make up the video are divided into slices obtained by dividing an image, and coding tree units (CTU: Coding Tree Units) obtained by dividing a slice. ), a coding unit obtained by dividing the coding tree unit (Coding Unit: CU)), and a transform unit obtained by dividing the coding unit (TU: Transform Unit), and encoded/decoded for each CU.
  • CTU Coding Tree Units
  • a predicted image is normally generated based on a locally decoded image obtained by encoding/decoding an input image, and the predicted image is generated from the input image (original image).
  • the prediction error obtained by subtraction (sometimes called the "difference image” or “residual image”) is encoded.
  • Inter-prediction and intra-prediction are methods for generating predicted images.
  • Non-Patent Document 1 can be cited as a technique for video encoding and decoding in recent years.
  • H.274 defines supplementary enhancement information SEI for transmitting the image properties, display method, timing, etc. along with the encoded data.
  • Non-Patent Document 1 Non-Patent Document 2, and Non-Patent Document 3 a method of explicitly defining SEI that transmits the topology and parameters of a neural network filter used as a post filter, and indirectly as reference information A method of defining is disclosed.
  • Non-Patent Document 1 and Non-Patent Document 2 have the problem that the input and output of postfiltering are not explicitly defined.
  • Non-Patent Document 2 the output color space and color difference subsampling are not specified, and there is the problem that it is not possible to specify what kind of output is obtained from the additional information.
  • Non-Patent Document 1 and Non-Patent Document 2 it is possible to analyze the input and output tensor types from the topology of the neural network, but the relationship between the tensor channels and the color components (color components) cannot be specified. For example, it is not possible to define how to set the luminance channel and chrominance channel in the input tensor, and what kind of color space the output tensor after processing is to be output as. Therefore, there is a problem that the process cannot be specified and executed. Also, the 4:0:0, 4:2:0, 4:2:2, 4:4:4 chrominance subsampling causes the width and height of the luminance and chrominance components of the image to differ. to derive the input tensor. Also, it is not specified how to generate an image from the output tensor in response to chrominance subsampling.
  • Non-Patent Document 3 defines the relationship between tensor channels and color components only when the input/output is 4:2:0 color difference subsampling, the input tensor has 10 channels, and the output tensor has 6 channels.
  • the input tensor has 10 channels
  • the output tensor has 6 channels.
  • other formats cannot execute processing.
  • a video decoding device is a video decoding device comprising a predicted image derivation unit that decodes a predicted image and a residual decoding unit that decodes a residual, It is characterized by deriving an input tensor from parameters specifying the number of channels of the input tensor and output tensor of the neural network model, or deriving an image from the output tensor.
  • a video decoding device comprising a predicted image derivation unit that decodes a predicted image and a residual decoding unit that decodes a residual, Input/output image information specifying the number of channels of the input/output tensor of the neural network model and additional input information are decoded, and a portion of the input tensor is derived from the first image using the input/output image information; using the additional input information to derive a second image different from the first or another portion of the input tensor using coding information related to the prediction image derivation or residual decoding; characterized by
  • a moving image decoding device comprising a predicted image deriving unit for decoding a predicted image and a residual decoding unit for decoding a residual, wherein the header contains an output related to chrominance subsampling when there is no filter update information. It is characterized by estimating the chrominance format in the chrominance format of the input.
  • a video encoding device is a video encoding device comprising a predicted image deriving unit that decodes a predicted image and a residual coding unit that decodes a residual, It is characterized by deriving an input tensor from parameters specifying the number of channels of the input tensor and output tensor of the neural network model, or deriving an image from the output tensor.
  • FIG. 1 is a schematic diagram showing the configuration of a moving image transmission system according to this embodiment
  • FIG. FIG. 4 is a diagram showing a hierarchical structure of encoded data
  • 4 is a conceptual diagram of an image to be processed in the moving image transmission system according to the embodiment
  • FIG. 1 is a schematic diagram showing the configuration of an image decoding device
  • FIG. 4 is a flowchart for explaining schematic operations of the image decoding device
  • It is a block diagram which shows the structure of an image coding apparatus.
  • FIG. 10 is a diagram showing the structure of a syntax table of the NN filter SEI in this embodiment
  • FIG. 10 is a diagram showing the configuration of the syntax table of the NN filter SEI when the parameter type of the neural network model is described by dividing it into numerical type and bit width;
  • FIG. 10 is a diagram showing the configuration of the syntax table of the NN filter SEI when the bit width of the parameter type of the neural network model is described in logarithmic representation; 6 is a diagram showing a flowchart of processing of an NN filter unit 611.
  • FIG. FIG. 10 is a diagram showing the configuration of a syntax table for post-filter purpose SEI; 6 is a diagram showing the configuration of a neural network of NN filter section 611.
  • FIG. FIG. 2 is a diagram showing an NNR encoding device/decoding device; FIG.
  • FIG. 10 is a diagram showing a syntax example of an NN filter SEI; 4 is a table showing input data formats defined by NN filters; 4 is a table showing output data formats defined by NN filters; 4 is a table showing a conversion method from a decoded image to an input data format defined by an NN filter; 4 is a table showing a conversion method from an output data format defined by an NN filter to an output image; FIG. 10 is a diagram showing a syntax example of an NN filter SEI; FIG. 3 is a diagram showing the relationship between the number of dimensions of an input tensor (the number of input channels) and the conversion method, and the number of dimensions of the output tensor (the number of output channels) and the conversion method.
  • FIG. 1 is a schematic diagram showing the configuration of a moving image transmission system according to this embodiment.
  • the moving image transmission system 1 is a system that transmits encoded data obtained by encoding images of different resolutions after resolution conversion, decodes the transmitted encoded data, inversely converts the image to the original resolution, and displays the image.
  • a moving image transmission system 1 includes a moving image encoding device 10 , a network 21 , a moving image decoding device 30 and an image display device 41 .
  • the video encoding device 10 includes a resolution conversion device (resolution conversion unit) 51, an image encoding device (image encoding unit) 11, an inverse transform information creating device (inverse transform information creating unit) 71, and an inverse transform information encoding device. (Inverse transform information encoding unit) 81 is provided.
  • the video decoding device 30 is composed of an image decoding device (image decoding section) 31, a resolution inverse conversion device (resolution inverse conversion section) 61, and an inverse conversion information decoding device (inverse conversion information decoding section) 91.
  • the resolution conversion device 51 converts the resolution of the image T included in the moving image, and supplies the variable resolution moving image T2 including images of different resolutions to the image encoding device 11. Also, the resolution conversion device 51 supplies the image encoding device 11 with inverse conversion information indicating whether or not the resolution of the image has been converted. When the information indicates resolution conversion, the video encoding device 10 sets the resolution conversion information to 1, and encodes it by including it in the sequence parameter set SPS (Sequence Parameter Set) of the encoded data Te.
  • SPS Sequence Parameter Set
  • the inverse transform information creating device 71 creates inverse transform information based on the image T1 included in the moving image.
  • the inverse transformation information is derived or selected from the relationship between the input image T1 before resolution transformation and the image Td1 after resolution transformation, encoding, and decoding. Additional information is information indicating what to select.
  • Inverse transform information is input to the inverse transform information encoding device 81 .
  • the inverse transform information encoding device 81 encodes the inverse transform information to generate encoded inverse transform information and sends it to the network 21 .
  • a variable resolution image T2 is input to the image encoding device 11.
  • the image coding device 11 uses the RPR (Reference Picture Resampling) framework to code the image size information of the input image in units of PPS, and sends it to the image decoding device 31 .
  • RPR Reference Picture Resampling
  • the inverse transform information coding device 81 is not connected to the image coding device 11, but the inverse transform information coding device 81 and the image coding device 11 may communicate necessary information as appropriate.
  • the network 21 transmits the encoded inverse transform information and encoded data Te to the image decoding device 31. Part or all of the coded inverse transform information may be included in the coded data Te as additional enhancement information SEI.
  • the network 21 is the Internet, a Wide Area Network (WAN), a Local Area Network (LAN), or a combination thereof.
  • the network 21 is not necessarily a two-way communication network, and may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. Also, the network 21 may be replaced by a storage medium such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blue-ray Disc: registered trademark) that records the encoded data Te.
  • the image decoding device 31 decodes each of the encoded data Te transmitted by the network 21, generates a variable resolution decoded image Td1, and supplies it to the resolution inverse conversion device 61.
  • the inverse transform information decoding device 91 decodes the encoded inverse transform information transmitted by the network 21 to generate inverse transform information and supplies it to the resolution inverse transforming device 61 .
  • the inverse transform information decoding device 91 is shown separately from the image decoding device 31 in FIG.
  • the inverse transform information decoding device 91 may be included in the image decoding device 31 separately from each functional unit of the image decoding device 31.
  • FIG. Although not connected to the image decoding device 31 in FIG. 1, the inverse transform information decoding device 91 and the image decoding device 31 may appropriately communicate necessary information.
  • the resolution inverse conversion device 61 When the resolution conversion information indicates resolution conversion, the resolution inverse conversion device 61 reverses the resolution-converted image through super-resolution processing using a neural network based on the image size information included in the encoded data. The conversion produces a decoded image of the original size.
  • the image display device 41 displays all or part of one or more decoded images Td2 input from the resolution inverse conversion device 61.
  • the image display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display.
  • the form of the display includes stationary, mobile, HMD, and the like.
  • the image decoding device 31 has high processing power, it displays an image with high image quality, and when it has only lower processing power, it displays an image that does not require high processing power and display power.
  • FIG. 3 is a conceptual diagram of an image to be processed in the moving image transmission system shown in FIG. 1, showing changes in resolution of the image over time. However, in FIG. 3, it is not distinguished whether the image is encoded or not.
  • FIG. 3 shows an example in which an image is transmitted to the image decoding device 31 with its resolution lowered in the process of the moving image transmission system. As shown in FIG. 3, the resolution conversion device 51 normally performs conversion to lower the resolution of the image in order to reduce the amount of information to be transmitted.
  • x ? y : z is a ternary operator that takes y if x is true (other than 0) and z if x is false (0).
  • abs(a) is a function that returns the absolute value of a.
  • Int(a) is a function that returns the integer value of a.
  • floor(a) is a function that returns the largest integer less than or equal to a.
  • ceil(a) is a function that returns the smallest integer greater than or equal to a.
  • a/d represents the division of a by d (truncated after the decimal point).
  • FIG. 2 is a diagram showing the hierarchical structure of data in the encoded data Te.
  • the encoded data Te illustratively includes a sequence and a plurality of pictures that constitute the sequence.
  • FIG. 2 shows a coded video sequence defining a sequence SEQ, a coded picture defining a picture PICT, a coded slice defining a slice S, a coded slice data defining a slice data, and a coded slice data included in the coded slice data.
  • a diagram showing a coding tree unit and coding units included in the coding tree unit is shown.
  • the encoded video sequence defines a set of data that the image decoding device 31 refers to in order to decode the sequence SEQ to be processed.
  • Sequence SEQ as shown in Figure 2, consists of video parameter set VPS (Video Parameter Set), sequence parameter set SPS (Sequence Parameter Set), picture parameter set PPS (Picture Parameter Set), adaptation parameter set (APS), picture PICT , and Supplemental Enhancement Information (SEI).
  • VPS Video Parameter Set
  • sequence parameter set SPS Sequence Parameter Set
  • picture parameter set PPS Picture Parameter Set
  • APS adaptation parameter set
  • SEI Supplemental Enhancement Information
  • a video parameter set VPS is a set of coding parameters common to multiple video images, a set of coding parameters common to multiple video images, and a set of coding parameters related to multiple layers and individual layers included in a video image. Sets are defined.
  • the sequence parameter set SPS defines a set of encoding parameters that the image decoding device 31 refers to in order to decode the target sequence. For example, the width and height of the picture are defined. A plurality of SPSs may exist. In that case, one of a plurality of SPSs is selected from the PPS.
  • the sequence parameter set SPS includes the following syntax elements.
  • pic_width_max_in_luma_samples A syntax element that specifies the width, in luma blocks, of the image with the largest width among the images in a single sequence. Also, the value of the syntax element is required to be non-zero and an integral multiple of Max(8, MinCbSizeY).
  • MinCbSizeY is a value determined by the minimum size of the luminance block.
  • pic_height_max_in_luma_samples A syntax element that specifies the height of the image with the largest height among the images in a single sequence, in units of luma blocks. Also, the value of the syntax element is required to be non-zero and an integral multiple of Max(8, MinCbSizeY).
  • the picture parameter set PPS defines a set of coding parameters that the image decoding device 31 refers to in order to decode each picture in the target sequence.
  • a plurality of PPSs may exist. In that case, one of a plurality of PPSs is selected from each picture in the target sequence.
  • the picture parameter set PPS includes the following syntax elements.
  • pic_width_in_luma_samples A syntax element that specifies the width of the target picture. The value of the syntax element is required to be not 0, but an integer multiple of Max(8, MinCbSizeY) and less than or equal to pic_width_max_in_luma_samples.
  • pic_height_in_luma_samples A syntax element that specifies the height of the target picture. The value of the syntax element is required to be not 0, but an integral multiple of Max(8, MinCbSizeY) and less than or equal to pic_height_max_in_luma_samples.
  • the encoded picture defines a set of data that the image decoding device 31 refers to in order to decode the picture PICT to be processed.
  • a picture PICT includes a picture header PH, slice 0 to slice NS-1 (NS is the total number of slices included in the picture PICT), as shown in FIG.
  • the coded slice defines a set of data that the image decoding device 31 refers to in order to decode the slice S to be processed.
  • a slice includes a slice header and slice data, as shown in FIG.
  • the slice header contains a group of coding parameters that the image decoding device 31 refers to in order to determine the decoding method for the target slice.
  • Slice type designation information (slice_type) that designates a slice type is an example of a coding parameter included in a slice header.
  • Slice types that can be specified by the slice type specifying information include (1) an I slice that uses only intra prediction during encoding, (2) simple prediction (L0 prediction) or intra prediction that uses during encoding. (3) B slices using uni-prediction (L0 prediction or L1 prediction), bi-prediction, or intra-prediction in encoding.
  • inter prediction is not limited to uni-prediction and bi-prediction, and a predicted image may be generated using more reference pictures.
  • P and B slices they refer to slices containing blocks for which inter prediction can be used.
  • the slice header may contain a reference (pic_parameter_set_id) to the picture parameter set PPS.
  • the encoded slice data defines a set of data that the image decoding device 31 refers to in order to decode slice data to be processed.
  • the slice data contains CTU, as shown in the encoded slice header in FIG.
  • a CTU is a block of a fixed size (for example, 64x64) that forms a slice, and is also called a maximum coding unit (LCU).
  • FIG. 2 defines a set of data that the image decoding device 31 refers to in order to decode the CTU to be processed.
  • CTU uses recursive quad tree partitioning (QT (Quad Tree) partitioning), binary tree partitioning (BT (Binary Tree) partitioning), or ternary tree partitioning (TT (Ternary Tree) partitioning) to perform coding processing. It is divided into coding units CU, which are basic units. A node of a tree structure obtained by recursive quadtree partitioning is called a coding node. Intermediate nodes of quadtrees, binary trees, and ternary trees are coding nodes, and the CTU itself is defined as a top-level coding node.
  • QT Quad Tree
  • BT Binary Tree partitioning
  • TT Ternary Tree partitioning
  • the CT includes, as CT information, a CU segmentation flag indicating whether to perform CT segmentation, a QT segmentation flag indicating whether to perform QT segmentation, an MT segmentation direction indicating a segmentation direction of MT segmentation, and a segmentation type of MT segmentation.
  • a CU segmentation flag indicating whether to perform CT segmentation
  • a QT segmentation flag indicating whether to perform QT segmentation
  • an MT segmentation direction indicating a segmentation direction of MT segmentation
  • a segmentation type of MT segmentation Contains the indicated MT split type.
  • split_cu_flag, qt_split_cu_flag, mtt_split_cu_vertical_flag and mtt_split_cu_binary_flag are transmitted for each encoding node.
  • FIG. 2 defines a set of data that the image decoding device 31 refers to in order to decode the encoding unit to be processed.
  • a CU is composed of a CU header CUH, prediction parameters, transform parameters, quantized transform coefficients, and the like.
  • a prediction mode and the like are defined in the CU header.
  • Intra prediction is prediction within the same picture
  • inter prediction is prediction processing performed between different pictures (for example, between display times, between layer images).
  • the transform/quantization process is performed in CU units, but the quantized transform coefficients may be entropy coded in subblock units such as 4x4.
  • flag indicating whether or not it is XX when the term "flag indicating whether or not it is XX" is used, when the flag is other than 0 (for example, 1), it is XX, and 0 is not XX. Treat 1 as true and 0 as false (same below). However, in actual devices and methods, other values can be used as true and false values.
  • motion vector A motion vector indicates the amount of shift between blocks on two different pictures.
  • the image decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, an inverse quantum It includes a normalization/inverse transformation unit 311 , an addition unit 312 , and a prediction parameter derivation unit 320 .
  • the image decoding device 31 may have a configuration in which the loop filter 305 is not included in accordance with the image encoding device 11 described later.
  • the parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), and the CU decoding unit 3022 further includes a TU decoding unit 3024. These may be collectively called a decoding module.
  • Header decoding section 3020 decodes parameter set information such as VPS, SPS, PPS, and APS, and slice headers (slice information) from encoded data.
  • CT information decoding section 3021 decodes CT from encoded data.
  • a CU decoding unit 3022 decodes a CU from encoded data.
  • TU decoding section 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from encoded data when prediction error is included in TU.
  • the predicted image generation unit 308 includes an inter predicted image generation unit 309 and an intra predicted image generation unit 310.
  • the prediction parameter derivation unit 320 includes an inter prediction parameter derivation unit 303 and an intra prediction parameter derivation unit 304.
  • the entropy decoding unit 301 performs entropy decoding on the encoded data Te input from the outside to decode individual codes (syntax elements).
  • syntax elements For entropy coding, a method of variable-length coding syntax elements using a context (probability model) adaptively selected according to the type of syntax elements and surrounding circumstances, a predetermined table, or There is a method of variable-length coding syntax elements using a formula.
  • the former CABAC Context Adaptive Binary Arithmetic Coding
  • stores the context CABAC state predominant symbol type (0 or 1) and probability state index pStateIdx specifying probability
  • the entropy decoding unit 301 initializes all CABAC states at the beginning of a segment (tile, CTU row, slice).
  • the entropy decoding unit 301 converts the syntax element into a binary string (Bin String) and decodes each bit of the Bin String. If the context is used, derive the context index ctxInc for each bit of the syntax element, decode the bit using the context, and update the CABAC state of the used context. Bits without context are decoded with equal probability (EP, bypass) and the ctxInc derivation and CABAC state are omitted.
  • the decoded syntax elements include prediction information for generating a predicted image and prediction error for generating a difference image.
  • the entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. Control of which code is to be decoded is performed based on an instruction from parameter decoding section 302 .
  • FIG. 5 is a flowchart for explaining a schematic operation of the image decoding device 31. As shown in FIG.
  • the header decoding unit 3020 decodes parameter set information such as VPS, SPS, and PPS from the encoded data.
  • the header decoding unit 3020 decodes the slice header (slice information) from the encoded data.
  • the image decoding device 31 derives a decoded image of each CTU by repeating the processing from S1300 to S5000 for each CTU included in the target picture.
  • the CT information decoding unit 3021 decodes the CTU from the encoded data.
  • the CT information decoding unit 3021 decodes the CT from the encoded data.
  • the CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data.
  • the CU decoding unit 3022 decodes CU information, prediction information, TU split flag split_transform_flag, CU residual flags cbf_cb, cbf_cr, cbf_luma, etc. from the encoded data.
  • TU decoding section 3024 decodes QP update information, quantized prediction error, and transform index mts_idx from encoded data when prediction error is included in TU.
  • the QP update information is a difference value from the quantization parameter prediction value qPpred, which is the prediction value of the quantization parameter QP.
  • the predicted image generation unit 308 generates a predicted image based on the prediction information for each block included in the target CU.
  • the inverse quantization/inverse transform unit 311 executes inverse quantization/inverse transform processing for each TU included in the target CU.
  • the addition unit 312 adds the predicted image supplied from the predicted image generation unit 308 and the prediction error supplied from the inverse quantization/inverse transform unit 311, thereby decoding the target CU. Generate an image.
  • the loop filter 305 generates a decoded image by applying loop filters such as deblocking filter, SAO, and ALF to the decoded image.
  • loop filters such as deblocking filter, SAO, and ALF
  • Inter prediction parameter derivation section 303 (motion vector derivation device) derives inter prediction parameters by referring to prediction parameters stored in prediction parameter memory 307 based on syntax elements input from parameter decoding section 302 . Also, inter prediction parameters are output to inter prediction image generation section 309 and prediction parameter memory 307 .
  • a loop filter 305 is a filter provided in the encoding loop, and is a filter that removes block distortion and ringing distortion to improve image quality.
  • a loop filter 305 applies filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the addition unit 312 .
  • the DF unit 601 is composed of a bS derivation unit 602 that derives the deblocking filter strength bS for each pixel, boundary, or line segment, and a DF filter unit 602 that performs deblocking filtering to reduce block noise.
  • the DF unit 601 has an edge degree edgeIdc indicating whether the input image resPicture before NN processing (processing by the NN filter unit 601) has a partition division boundary, a prediction block boundary, or a transformation block boundary, and the maximum filter of the deblocking filter. Derive the length maxFilterLength. Furthermore, the strength bS of the deblocking filter is derived from edgeIdc, the boundary of the transform block, and the encoding parameters. edgeIdc and bS may take values of 0, 1, 2, or other values.
  • the reference picture memory 306 stores the decoded image of the CU in a predetermined position for each target picture and target CU.
  • the prediction parameter memory 307 stores prediction parameters in predetermined positions for each CTU or CU. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302, the parameters derived by the prediction parameter deriving unit 320, and the like.
  • the parameters derived by the prediction parameter derivation unit 320 are input to the prediction image generation unit 308 .
  • the predicted image generation unit 308 reads a reference picture from the reference picture memory 306 .
  • a predicted image generation unit 308 generates a predicted image of a block or sub-block using parameters and a reference picture (reference picture block) in a prediction mode indicated by predMode.
  • a reference picture block is a set of pixels on a reference picture (usually rectangular and therefore called a block), and is an area referred to for generating a prediction image.
  • the inter prediction image generation unit 309 uses inter prediction parameters and reference pictures input from the inter prediction parameter derivation unit 303 to generate prediction images of blocks or sub-blocks by inter prediction.
  • the intra prediction image generation unit 310 performs intra prediction using the intra prediction parameters input from the intra prediction parameter derivation unit 304 and the reference pixels read from the reference picture memory 306 when the predMode indicates the intra prediction mode.
  • the inverse quantization/inverse transform unit 311 (residual decoding unit) inversely quantizes the quantized transform coefficients input from the parameter decoding unit 302 to obtain transform coefficients.
  • the addition unit 312 adds the predicted image of the block input from the predicted image generation unit 308 and the prediction error input from the inverse quantization/inverse transform unit 311 for each pixel to generate a decoded image of the block.
  • the adder 312 stores the decoded image of the block in the reference picture memory 306 and also outputs it to the loop filter 305 .
  • FIG. 12 is a diagram showing a configuration example of an interpolation filter, a loop filter, and a post filter using the neural network filter section (NN filter section 611).
  • An example of a post filter will be described below, but an interpolation filter or a loop filter may also be used.
  • a post-processing unit 61 after the video decoding device includes an NN filter unit 611.
  • the NN filter unit 611 When outputting the image in the reference picture memory 306, the NN filter unit 611 performs filter processing and outputs the image to the outside. The output image may be displayed, written to a file, re-encoded (transcoded), transmitted, and the like.
  • the NN filter unit 611 is means for filtering an input image using a neural network model. At the same time, reduction/enlargement may be performed by a factor of 1 or a rational number.
  • a neural network model (hereinafter referred to as NN model) means the elements and connections (topology) of the neural network, and the parameters (weights, biases) of the neural network. It should be noted that the topology may be fixed and only the parameters of the neural network model may be switched.
  • the NN filter unit uses the input image inSamples and input parameters (eg, QP, bS, etc.) to perform filtering using a neural network model.
  • the input image may be an image for each component, or may be an image having multiple components as channels. Also, the input parameters may be assigned to different channels than the image.
  • the NN filter part may apply the following processing repeatedly.
  • the NN filter unit convolves inSamples with kernel k[m][i][j] and derives the output image outSamples by adding bias.
  • n is the number of channels in outSamples
  • m is the number of channels in inSamples
  • width is the width of inSamples and outSamples
  • height is the height of inSamples and outSamples. of is the size of the padding area provided around inSamples so that inSamples and outSamples have the same size.
  • outSamples[nn][xx][yy] ⁇ (k[nn][i][j]*inSamples[nn][xx+i-of][yy+j-of]+bias[nn]) ⁇ represents the summation for i and j respectively.
  • n is the number of channels in outSamples and inSamples
  • width is the width of inSamples and outSamples
  • height is the height of inSamples and outSamples.
  • ReLU Activate
  • leakyReLU shown in the following formula may be used.
  • a is a predetermined value, such as 0.1 or 0.125.
  • all the above values of k, bias, and a may be taken as integers and a right shift may be performed after conv.
  • FIG. 7 is a diagram showing the configuration of the syntax table of the NN filter SEI of this embodiment.
  • This SEI contains neural network model complexity information.
  • ⁇ nnrpf_id This is the identification number of the NN filter.
  • ⁇ nnrpf_mode_idc Mode index indicating how to specify the neural network model used for the NN filter.
  • a value of 0 indicates that the NN filter associated with nnrpf_id is not specified in this SEI message.
  • a value of 1 indicates that the NN filter associated with nnrpf_id is a neural network model identified by a predetermined URI (Uniform Resource Identifier).
  • a URI is an identification string that indicates a logical or physical resource.
  • a value of 2 indicates that the NN filter associated with nnrpf_id is the neural network model represented by the ISO/IEC 15938-17 bitstream included in this SEI message. If the value is 3, the NN filter associated with nnrpf_id is identified in the NN filter SEI message used in the previous decoding, and the neural network model updated with the ISO/IEC 15938-17 bitstream contained in this SEI message. indicates that nnrpf_persistence_flag: A flag that specifies the persistence of this SEI message for the current layer. A value of 0 indicates that this SEI message applies only to the current decoded picture.
  • ⁇ nnrpf_uri[i] A character string that stores the reference URI of the neural network model used as the NN filter. i is the ith byte of a NULL-terminated UTF-8 string.
  • header encoding section 1110 and header decoding section 3020 decode nnrpf_uri, which is a URI indicating a neural network model used as an NN filter.
  • a neural network model corresponding to the character string indicated by nnrpf_uri is read from the memory provided in the video encoding device or video decoding device, or read from the outside via the network.
  • ⁇ nnrpf_payload_byte[i] Indicates the i-th byte of the bitstream conforming to ISO/IEC 15938-17.
  • the NN filter SEI includes the following syntax elements as neural network model complexity information (network model complexity information).
  • ⁇ nnrpf_parameter_type_idc Index indicating the variable type included in the NN model parameter. If the value is 0, the NN model will only use integer types. If the value is 1, the NN model uses floating point or integer types.
  • ⁇ nnrpf_num_parameters_idc Index indicating the number of parameters of the NN model used in the postfilter. A value of 0 indicates that the number of parameters for the NN model is not defined. If the value is not 0, the following process is performed using nnrpf_num_parameters_idc to derive the number of parameters of the NN model.
  • the header encoding unit 1110 and header decoding unit 3020 may derive the maximum number of parameters MaxNNParameters of the NN model as follows, and encode/decode the network model complexity information.
  • MaxNNParameters (UNITPARAM ⁇ nnrpf_num_parameters_idc) - 1
  • UNITPARAM is a predetermined constant
  • MaxNNParameters 2 ⁇ (nnrpf_num_parameters_idc+11) - 1
  • the unit of the number of parameters may be a combination of 2-fold units and 1.5-fold units as follows, instead of 2-fold units.
  • MaxNNParameters (nnrpf_num_parameters_idc & 1) : 2 ⁇ (nnrpf_num_parameters_idc+11)*1.5-1 : 2 ⁇ (nnrpf_num_parameters_idc+11)-1 That is, the value of nnrpf_num_parameter_idc in the header encoding unit 1110 is set to a value such that the actual number of parameters of the NN model is MaxNNParameters or less.
  • the header decoding unit 3020 decodes the encoded data set as described above.
  • a linear expression may be used to derive MaxNNParameters.
  • nnrpf_num_kmac_operations_idc A value indicating the scale of the number of operations required for postfilter processing. Header encoding section 1110 and header decoding section 3020 obtain MaxNNOperations as follows based on nnrpf_num_kmac_operations_idc. MaxNNOperations is the maximum number of operations required for postfilter processing.
  • MaxNNOperations nnrpf_num_kmac_operations_idc * 1000 * pictureWidth * pictureHeight
  • pictureWidth and pictureHeight are the width and height of the picture input to the postfilter.
  • the video encoding device sets the value of nnrpf_num_kmac_operations_idc according to the number of operations required for postfilter processing.
  • the syntax indicating the network model complexity information indicates the upper limit of the number of parameters or the number of operations, and the number of parameters or the number of operations is defined in units of 2 to the exponential power.
  • the number of parameters or the number of operations may be defined in units of 2 to the exponential power or 1.5 times 2 to the exponential power.
  • the number of parameters or the number of operations may be defined in multiples of ten.
  • nnrpf_operation_type_idc This is an index indicating the element restriction or topology restriction used in the NN model of the postfilter. Depending on the index value, for example, the following processing may be performed.
  • the element or topology is restricted to the following.
  • the maximum kernel size is 5x5
  • the maximum number of channels is 32
  • the activation function can be leaky ReLU or only ReLU
  • the maximum level of branching is 3 (excluding skip connections).
  • nnrpf_parameter_type_idc indicating network model complexity information
  • ⁇ nnrpf_parameter_type_idc This is an index indicating the parameter type of the neural network model.
  • the parameter type may be determined as follows according to the value of the parameter.
  • FIG. 8 is a diagram showing the configuration of the syntax table of the NN filter SEI with network model complexity information.
  • the parameter types of the neural network model are defined by dividing them into numerical types and bit widths.
  • ⁇ nnrpf_parameter_type_idc This is an index indicating the numerical type of the neural network model.
  • the numeric type may be determined according to the value of the parameter as follows. If the value is 0, it is defined as an integer type, and if the value is 1, it is defined as a floating point type.
  • FIG. 9 is a diagram showing the configuration of the syntax table of the NN filter SEI with network model complexity information.
  • the bit width of the parameter type of the neural network model is defined in logarithmic representation.
  • nnrpf_parameter_bit_width_idc nnrpf_log2_parameter_bit_width_minus3
  • This value indicates the bit width of the parameter of the neural network model in logarithmic expression of 2.
  • the bit width parameterBitWidth of the parameter is obtained as follows.
  • parameterBitWidth 1 ⁇ ( nnrpf_log2_parameter _bit_width_minus3 + 3 ) (SEI decoding and post-filtering)
  • the header decoder 3020 decodes the network model complexity information from the SEI message specified in FIGS. 7-9.
  • the SEI is additional information for processing related to decoding, display, and the like.
  • FIG. 10 is a diagram showing a flowchart of processing of the NN filter unit 611.
  • the NN filter unit 611 performs the following processing according to the parameters of the SEI message.
  • S6001 Read processing amount and accuracy from network model complexity information of SEI.
  • S6002 If the complexity exceeds the processability of the NN filter unit 611, the process ends. If not, proceed to S6003.
  • S6003 If the NN filter unit 611 exceeds the processing accuracy, the process ends. If not, proceed to S6004.
  • S6004 Identify the network model from the SEI and set the topology of the NN filter unit 611.
  • S6005 Derive network model parameters from SEI update information.
  • S6006 Load the derived parameters of the network model into the NN filter unit 611.
  • S6007 Execute the filtering process of the NN filter unit 611 and output to the outside.
  • the SEI is not necessarily required to construct the luminance and chrominance samples in the decoding process.
  • FIG. 14 is a diagram showing another configuration of the syntax table of the NN filter SEI of this embodiment.
  • This SEI includes information in the form of neural network model (NN model) data. Descriptions of the same syntax elements as the SEI containing neural network model complexity information already explained will be omitted.
  • ⁇ nnrpf_input_format_idc Input tensor identification parameter. This shows the format of the input data (input tensor) of the NN model used in the NN filter.
  • the header decoding unit 3020 derives the input data format (the number of channels (NumInChannels), data format) based on the value of nnrpf_input_format_idc.
  • the input data format is 1-channel (luminance) three-dimensional data (3D tensor).
  • luminance luminance
  • the three dimensions of the three-dimensional data are defined as the order of (C, H, W), but the order of the dimensions is not limited to this. For example, they may be stored in the order of (H, W, C). Also, since the number of channels is one in this case, it may be two-dimensional data (H, W).
  • the input data format is two-channel (color difference) three-dimensional data (3D tensor).
  • the two chrominance channels (U and V) of the decoded image are used as input data for the NN filter.
  • the input data format is three-dimensional data (3D tensor) with three channels (luminance and two color differences).
  • 3D tensor three channels (luminance and two color differences).
  • the format of the input data is 6-channel (4 luminance and 2 chrominance) three-dimensional data (3D tensor).
  • 4 channels and 2 chrominance channels derived from the luminance channel of a decoded image in 4:2:0 format are used as input data for the NN filter.
  • ⁇ nnrpf_output_format_idc Output tensor identification parameter.
  • the format of the output data (NN output data, output tensor) of the NN model used in the NN filter is shown.
  • the header decoding unit 3020 derives the output data format (number of channels (NumOutChannels), data format) based on the value of nnrpf_output_format_idc, as shown in FIG.
  • the format of NN output data is 1-channel (luminance) three-dimensional data (3D tensor).
  • luminance luminance
  • 3D tensor three-dimensional data
  • the format of NN output data is two-channel (color difference) three-dimensional data (3D tensor).
  • the output data of the NN filter are used as the two color difference channels (U and V) of the output image.
  • 3D tensor three channels
  • luminance and two color differences we show that the output data of the NN filter are used in 4:4:4 format as the luminance and two chrominance channels of the output image.
  • the format of NN output data is 3-dimensional data (3D tensor) of 6 channels (4 luminances and 2 chrominances).
  • 3D tensor 3D tensor
  • the output data of the NN filter is used in 4:2:0 format as one luminance channel and two chrominance channels derived by integrating 4 of the 6 channels.
  • the header encoding unit 1110 and the header decoding unit 3020 may set syntax values and variables of the image decoding device as variables for filter processing in the processing of the post-filter SEI.
  • PicWidthInLumaSamples pps_pic_width_in_luma_samples
  • PicHeightInLumaSamples pps_pic_height_in_luma_samples
  • ChromaFormatIdc sps_chroma_format_idc
  • pps_pic_width_in_luma_samples, pps_pic_height_in_luma_samples, and sps_chroma_format_idc are syntax values indicating image width, height, and color component subsampling, and BitDepth is the bit depth of the image.
  • Header encoding section 1110 and header decoding section 3020 derive the following variables according to ChromaFormatIdc.
  • SubWidthC 2
  • the header encoding unit 1110 and header decoding unit 3020 derive the width and height of the luminance image and the width and height of the color difference image to be filtered using the following variables.
  • LumaWidth PicWidthInLumaSamples
  • LumaHeight PicHeightInLumaSamples
  • ChromaWidth PicWidthInLumaSamples /
  • ChromaHeight PicHeightInLumaSamples /
  • SubHeithtC SW SubWidthC
  • it is a variable representing the ratio of chrominance resolution to luminance.
  • the header encoding unit 1110 and the header decoding unit 3020 may derive the output image width outWidth and the height outHeight according to the scale value indicating the ratio as follows.
  • the NN filter unit 611 converts the decoded image into NN input data inputTensor[][][], which is a three-dimensional array, as shown in FIG. 17 and below, based on the value of nnrpf_input_format_idc. do.
  • the NN filter unit 611 below handles this range.
  • the NN filter unit 611 derives the inputTensor as follows.
  • ChromaOffset ComponentSample[2][cx][cy] If ChromaFormatIdc is 0, ComponentSample is a luminance channel only image.
  • the NN filter unit 611 may set a constant ChromaOffset derived from the bit depth to the color difference data portion of the inputTensor. ChromaOffset can be other values such as 0.
  • the NN input data may be derived according to the pfp_component_idc described below, as shown in brackets.
  • Fig. 20 is a diagram showing the relationship between the number of tensor channels and conversion processing.
  • ChromaOffset ComponentSample[2][cx][cy]
  • a video decoding device comprising a predicted image derivation unit that decodes a predicted image and a residual decoding unit that decodes a residual, wherein the number of channels of the input tensor and the output tensor of the neural network model is specified.
  • ChromaOffset ComponentSample[2][x/SW][y/SH] (conversion from postfilter NN output data) Based on the value of nnrpf_output_format_idc, the NN filter unit 611 derives the output image outSamples from the NN output data outputTensor[][][] of the three-dimensional array, which is the output data of the NN filter.
  • the NN filter unit 611 derives an image as follows based on the value of nnrpf_output_format_idc and the color difference sub-sampling values outSW and outSH of the output image, as shown in FIG. 18 and below.
  • outSW and outSH use values derived based on OutputChromaFormatIdc decoded from encoded data.
  • the NN filter unit 611 below handles this range. outSamplesL, outSamplesCb, and outSamplesCr represent the luminance channel, chrominance (Cb) channel, and chrominance (Cr) channel of the output image, respectively.
  • the NN filter unit 611 derives outSamplesL as follows.
  • outSamplesL[x][y] outputTensor[0][y][x]
  • nnrpf_output_format_idc 1, outSamplesCb and outSamplesCr are derived as follows.
  • outSamplesCb and outSamplesCr may be derived as follows.
  • FIG. 20 is a diagram showing the relationship between the number of tensor channels and transform processing.
  • the NN filter unit 611 may derive NN input data as follows according to the number of channels NumOutChannels (numTensors) of the output tensor.
  • outSamplesL[x][y] outputTensor[0][y][x] If NumOutChannels is 2, outSamplesCb and outSamplesCr are derived as follows.
  • outSamplesCb and outSamplesCr may be derived as follows.
  • FIG. 19 is a diagram showing another embodiment of the syntax table of the NN filter SEI.
  • the syntax element nnrpf_io_idc in Non-Patent Document 3 the syntax element nnrpf_additional_input_idc is used.
  • the conversion method can be specified flexibly. Description of the same parts as in the first embodiment will be omitted.
  • nnrpf_mode_idc is 1 or 2 (indicating that the SEI is new postfilter data) as shown in FIG. Decrypt.
  • the number of channels may be directly decoded without using nnrpf_io_idc.
  • the same variables numInOutChannels and numTensors may be used without distinguishing between numInChannels and numOutChannels for conversion processing.
  • the header decoding unit 3020 derives the values of variables useSliceQPY, usebSY, and usebSC indicating the use of input channels other than image components common to input and output. Flags indicating whether or not to use SliceQPY, bSY, bSCb and bSCr as additional input channels, respectively. In this embodiment, one flag usebSC controls both bSCb and bSCr.
  • SliceQPY is a luminance quantization parameter in a slice to which certain coordinates belong.
  • bSY, bSCb, and bSCR are arrays that store deblocking filter strength (block strength) values at certain coordinates in the luminance and chrominance (Cb, Cr) channels of the decoded image, respectively. Derivation of the above flag from nnrpf_additional_info_idc is performed as follows, for example.
  • each bit of nnrpf_additional_indo_idc may be associated with each flag and derived by calculation as follows.
  • useSliceQPY nnrpf_additional_info_idc
  • 1 usebSY (nnrpf_additional_info_idc >> 1)
  • & 1 usebSC (nnrpf_additional_info_idc >> 2) & 1
  • the header decoding unit 3020 may decode the flags useSliceQPY, usebSY, and usebSC from the encoded data without encoding nnrpf_additional_indo_idc.
  • flags are not limited to those described above, and flags may be similarly derived for other information.
  • a chrominance slice quantization parameter SliceQPC a reference image, a predicted image, or a QP value for each coding block may be used.
  • the header decoding unit 3020 further decodes nnrpf_patch_size_minus1 indicating the size (the number of pixels in the horizontal and vertical directions)-1 of the processing unit (patch) of the model specified by the SEI.
  • the variable patchSize representing the size of the patch is derived by the following formula.
  • patchSize nnrpf_patch_size_minus1 + 1
  • the header decoding unit 3020 decodes nnrpf_overlap.
  • nnrpf_overlap indicates the width of the region adjacent to the patch and entered into the model with the patch.
  • the height x width size of the tensor input to the model is (nnrpf_overlap*2+patchSize)
  • x (nnrpf_overlap*2+patchSize) is a pixel.
  • the NN filter unit 611 in this embodiment performs STEP 1: conversion from the image ComponentSample to the input tensor inputTensor, STEP 2: applying neural network filtering postProcessingFilter to the inputTensor to output the outputTensor, and STEP 3: deriving the image from the derived outputTensor. Do 3 steps.
  • SliceQPY is the luminance quantization parameter qP in the slice to which a certain coordinate belongs.
  • bSY, bSCb, and bSCR are arrays that store values of deblocking filter strengths (block Strength, bS) at certain coordinates in the luminance and chrominance (Cb, Cr) channels of the decoded image, respectively.
  • bS may be a value derived from a prediction mode of a block, a motion vector, a difference value of pixel values, etc. in deblocking filter processing.
  • the NN filter unit 611 may perform the processing of STEP1, STEP2, and STEP3 in units of a predetermined patch size from the upper left coordinates of the image.
  • the following pseudocode outlines the processing on a per-patch basis.
  • ⁇ STEP1 Convert image and additional information to input tensor>
  • ⁇ STEP2 Apply Filtering>
  • ⁇ STEP3 Convert the output tensor to an image> ⁇ ⁇
  • rH and rW are variables that determine the amount of increment of the loop variable related to chrominance subsampling.
  • rH and rW are vertical and horizontal scaling factors for deriving the on-image size of the tensor patch.
  • the NN filter unit 611 derives patches containing overlaps. If you include the overlapping part, the size of the input data is patchSize+nnrpf_overlap*2 x patchSize+nnrpf_overlap*2 pixels. The NN filter unit 611 derives each element of one patch including overlaps in the input tensor as shown in the following pseudocode.
  • yP1 and xP1 are indices offset by the overlap magnitude to refer to the elements of the input tensor that contain the overlap region.
  • yT, yL, yB, xR are coordinate values on the luminance component corresponding to yP and xP in the patch to be processed.
  • cy,cx are coordinate values on the color difference component of the input image corresponding to yP and xP in the patch to be processed.
  • the NN filter unit 611 sets ChromaOffset to the chrominance channel.
  • ch_pos is an index indicating the next available channel in the input tensor. When appending data to the input tensor, use channels after the value of ch_pos.
  • the NN filter unit 611 adds additional information to the inputTensor based on the additional input information (flag). For example, if useSliceQPY is true, set the next channel of inputTensor (inputTensor[ch_pos]) to the value of SliceQPY. Note that when a value is set for the channel, the value of ch_pos is increased according to the number of channels used. Then, if usebSY is true, set the next channel of inputTensor to the value of bSY at the location corresponding to the region of the patch.
  • the NN filter unit 611 may set the values of SliceQPY, bSY, bSCb, and bSCr as they are, or may set the converted values.
  • the flag useRefPicY may be derived from nnrpf_additional_info_idc, or may be decoded from encoded data, similarly to other additional information flags such as useSliceQPY.
  • the size of the output tensor outputTensor in the height direction (H) ⁇ width direction (W) is patchSize ⁇ patchSize, and does not include the overlap area.
  • the present invention is not limited to this, and the output tensor including the overlap region may be cropped to the size of patchSize x patchSize and used.
  • the NN filter unit 611 derives image data from the output tensor outputTensor.
  • the NN filter unit 611 derives the pixel values of the components outSamplesL, outSamplesCb, and outSamplesCr of the output image from the data of the output tensor outputTensor.
  • image data is derived based on the number of channels (data format) of the output tensor and color difference subsampling of the output image.
  • the NN filter unit 611 uses 2 channels of the outputTensor to derive the 2 color difference components of the output image. Also, the NN filter unit 611 uses the luminance component of the input image as the luminance component of the output image.
  • the NN filter unit 611 derives the outputTensor from the luminance component and two color difference components of the output image.
  • the NN filter unit 611 uses 2 channels with outputTensor to derive the luminance component of the output image, and uses the other 2 channels to derive 2 chrominance components.
  • the NN filter unit 611 uses 4 channels with outputTensor to derive the luminance component of the output image, and uses the other 2 channels to derive 2 chrominance components.
  • numOutChannels if the output image does not have a chroma component, the chroma channel of the output tensor is not processed. If numOutChannels is 2 or more and includes chrominance channels, the values outSH and outSW derived from the chrominance subsampling of the output image are used to convert to conform to the chrominance component format of the output image. If numOutChannels is 2, the values SH(SubHightC) and SW(SubWidthC) derived from the chrominance subsampling of the input image are also referenced and converted to conform to the chrominance component format of the output image.
  • numOutChannels is other than 2 and pfp_component_idc is 1, the luminance component of the input image is used without updating the luminance component of the output image with the output tensor.
  • numOutChannels is not 1 and pfp_component_idc is 0, then the input image's chroma components are used instead of updating the output image's chroma components with the output tensor.
  • the NN filter unit 611 derives the pixel values of each component of the output image based on the number of channels of the output tensor and the color difference subsampling of the output image.
  • the NN filter unit 611 derives an rW*rH pixel on the output image corresponding to one pixel of the output tensor represented by yP, xP. This can be done with a loop (dy, dx) as in the above pseudocode where numOutChannels is 2 or 6, or the loop can be omitted or unrolled as in the other cases. Alternatively, you can always loop dy and dx twice each.
  • the NN filter unit 611 may derive multiple times for the same color difference coordinates of the output image, but if the coordinates overlap, the second and subsequent derivations may be omitted.
  • cTop and cLeft are configured to increment by patchSize*rH and patchSize*rW as coordinate values on the image, respectively, but this is not the only option. It may be configured as a loop that increments by patchSize*SH and patchSize*SW using color difference subsampling of the input image, or may be configured as a loop that always increments by 1 or 2. Similarly, ySrc and xSrc are configured to be incremented by rH and rW, respectively, as coordinate values on the image, but the present invention is not limited to this.
  • a loop that increments one by one may also be used.
  • a video decoding device comprising a predicted image derivation unit that decodes a predicted image and a residual decoding unit that decodes a residual as described above, wherein the input/output image specifies the number of channels of the input/output tensor of the neural network model. information and additional input information; using the input and output image information to derive a portion of an input tensor from the first image; 2, or by deriving another part of the input tensor using the encoded information related to the derivation of the predicted image or the decoding of the residual, the properties and features of the input image are applied to the neural network model in more detail. There is an effect that it can be transmitted and the filtering effect can be enhanced.
  • the addition value of the loop variable is changed using the chrominance subsampling parameter, loop processing is performed in a raster scan manner, and in the above loop, the input tensor is derived from the image, and By applying the deep learning filter to derive the output tensor, it is possible to derive the input tensor by the same process even in the case of different color sampling.
  • the present application may be configured to decode encoded data including input tensor identification parameters that specify correspondences between channels and color components of an input tensor of a neural network model.
  • the present application may be configured such that a relational expression for deriving an input tensor from an input image is defined according to an input tensor identification parameter and color difference subsampling of the input image.
  • the input tensor identification parameter of the present application may be configured to specify any one of 1 channel, 2 channels, 3 channels, and 6 channels.
  • the present application may also include means for deriving an input tensor from an input image according to an input tensor identification parameter.
  • the present application may be configured to decode encoded data including an output tensor identification parameter that specifies a correspondence relationship between channels of an output tensor of a neural network model and color components.
  • the present application may be configured such that a relational expression for deriving an output image from an output tensor is defined according to an output tensor identification parameter and color difference subsampling of the output image.
  • the output tensor identification parameter of the present application may be configured to include specifying one of 1 channel, 2 channels, 3 channels, and 6 channels.
  • the present application may include means for deriving an output image from the output tensor according to the output tensor identification parameter.
  • this SEI includes information on the input data format to the NN filter and the output data format of the NN filter.
  • the NN filter unit 611 may decode the input tensor identification parameter and the output tensor identification parameter from the coded data instead of decoding the additional data, or may derive them from the topology of the NN model identified by the URI or the like.
  • the NN filter unit 611 analyzes the number of dimensions of the input data and output data of the NN model transmitted or specified in the encoded data, and the analysis results (input tensor identification parameter, output tensor identification parameter ), convert the input image to the input tensor and the output tensor to the output image.
  • This has the effect of specifying relationships between color components and channels that are not specified in the NN model itself, preparing NN input data, and obtaining an output image from NN output data.
  • the SEI may include information on the neural network model complexity.
  • FIG. 6 is a block diagram showing the configuration of the image encoding device 11 according to this embodiment.
  • the image coding device 11 includes a predicted image generation unit 101, a subtraction unit 102, a transform/quantization unit 103, an inverse quantization/inverse transform unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, reference picture memory (reference image storage unit, frame memory) 109, coding parameter determination unit 110, parameter coding unit 111, prediction parameter derivation unit 120, and entropy coding unit 104.
  • the predicted image generation unit 101 generates a predicted image for each CU.
  • the predicted image generation unit 101 includes the already described inter predicted image generation unit 309 and intra predicted image generation unit 310, and the description thereof will be omitted.
  • the subtraction unit 102 subtracts the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the pixel values of the image T to generate prediction errors.
  • Subtraction section 102 outputs the prediction error to transform/quantization section 103 .
  • the transform/quantization unit 103 calculates transform coefficients by frequency transforming the prediction error input from the subtraction unit 102, and derives quantized transform coefficients by quantization.
  • the transform/quantization unit 103 outputs the quantized transform coefficients to the parameter coding unit 111 and the inverse quantization/inverse transform unit 105 .
  • the inverse quantization/inverse transform unit 105 is the same as the inverse quantization/inverse transform unit 311 (FIG. 4) in the image decoding device 31, and description thereof is omitted.
  • the calculated prediction error is output to addition section 106 .
  • the parameter encoding unit 111 includes a header encoding unit 1110, a CT information encoding unit 1111, and a CU encoding unit 1112 (prediction mode encoding unit).
  • CU encoding section 1112 further comprises TU encoding section 1114 . The general operation of each module will be described below.
  • a header encoding unit 1110 performs encoding processing of parameters such as header information, division information, prediction information, and quantized transform coefficients.
  • the CT information encoding unit 1111 encodes QT, MT (BT, TT) division information and the like.
  • a CU encoding unit 1112 encodes CU information, prediction information, division information, and the like.
  • the TU encoding unit 1114 encodes the QP update information and the quantized prediction error when the TU contains the prediction error.
  • the CT information encoding unit 1111 and the CU encoding unit 1112 supply the parameter encoding unit 111 with syntax elements such as inter prediction parameters, intra prediction parameters, and quantized transform coefficients.
  • the entropy coding unit 104 receives input from the parameter coding unit 111 of the quantized transform coefficients and coding parameters (division information, prediction parameters). The entropy encoding unit 104 entropy-encodes these to generate and output encoded data Te.
  • Prediction parameter derivation unit 120 is means including inter prediction parameter encoding unit 112 and intra prediction parameter encoding unit 113, and derives intra prediction parameters and intra prediction parameters from the parameters input from encoding parameter determination unit 110. .
  • the derived intra prediction parameters and inter prediction parameters are output to parameter coding section 111 .
  • the addition unit 106 adds pixel values of the prediction block input from the prediction image generation unit 101 and prediction errors input from the inverse quantization/inverse transformation unit 105 for each pixel to generate a decoded image.
  • the addition unit 106 stores the generated decoded image in the reference picture memory 109 .
  • a loop filter 107 applies a deblocking filter, SAO, and ALF to the decoded image generated by the addition unit 106.
  • the loop filter 107 does not necessarily include the three types of filters described above, and may be configured with only a deblocking filter, for example.
  • the prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in predetermined positions for each current picture and CU.
  • the reference picture memory 109 stores the decoded image generated by the loop filter 107 in a predetermined position for each target picture and CU.
  • the coding parameter determination unit 110 selects one set from a plurality of sets of coding parameters.
  • the coding parameter is the above-described QT, BT or TT division information, prediction parameters, or parameters to be coded generated in relation to these.
  • the predicted image generating unit 101 generates predicted images using these coding parameters.
  • the coding parameter determination unit 110 calculates an RD cost value indicating the magnitude of the information amount and the coding error for each of the multiple sets.
  • the RD cost value is, for example, the sum of the code amount and the value obtained by multiplying the squared error by the coefficient ⁇ .
  • the code amount is the information amount of the encoded data Te obtained by entropy-encoding the quantization error and the encoding parameter.
  • the squared error is the sum of squares of the prediction errors calculated in subtraction section 102 .
  • the coefficient ⁇ is a preset real number greater than zero. Coding parameter determination section 110 selects a set of coding parameters that minimizes the calculated cost value. Coding parameter determination section 110 outputs the determined coding parameters to parameter coding section 111 and prediction parameter derivation section 120 .
  • part of the image encoding device 11 and the image decoding device 31 in the above-described embodiment for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the prediction image generation unit 308, the inverse quantization/inverse transform unit 311, addition unit 312, prediction parameter derivation unit 320, prediction image generation unit 101, subtraction unit 102, transformation/quantization unit 103, entropy coding unit 104, inverse quantization/inverse transformation unit 105, loop filter 107, coding
  • the parameter determining unit 110, the parameter encoding unit 111, and the prediction parameter deriving unit 120 may be implemented by a computer.
  • a program for realizing this control function may be recorded in a computer-readable recording medium, and the program recorded in this recording medium may be read into a computer system and executed.
  • the “computer system” here is a computer system built into either the image encoding device 11 or the image decoding device 31, and includes hardware such as an OS and peripheral devices.
  • the term "computer-readable recording medium” refers to portable media such as flexible discs, magneto-optical discs, ROMs and CD-ROMs, and storage devices such as hard disks built into computer systems.
  • “computer-readable recording medium” means a medium that dynamically stores a program for a short period of time, such as a communication line for transmitting a program via a network such as the Internet or a communication line such as a telephone line. In that case, it may also include a memory that holds the program for a certain period of time, such as a volatile memory inside a computer system that serves as a server or client. Further, the program may be for realizing part of the functions described above, or may be capable of realizing the functions described above in combination with a program already recorded in the computer system.
  • part or all of the image encoding device 11 and the image decoding device 31 in the above-described embodiments may be implemented as an integrated circuit such as LSI (Large Scale Integration).
  • LSI Large Scale Integration
  • Each functional block of the image encoding device 11 and the image decoding device 31 may be individually processorized, or part or all of them may be integrated and processorized.
  • the method of circuit integration is not limited to LSI, but may be realized by a dedicated circuit or a general-purpose processor.
  • an integrated circuit based on this technology may be used.
  • NNR Neural Network Coding and Representation
  • FIG. 13 is a diagram showing an NNR encoding device/decoding device.
  • the NN coding device 801 has a preprocessing section 8011, a quantization section 8012, and an entropy coding section 8013.
  • NN encoding device 801 receives NN model O before compression, quantizes NN model O in quantization section 8012, and obtains quantized model Q.
  • NN encoding device 801 may repeatedly apply parameter reduction techniques such as pruning and sparsification in preprocessing section 8011 before quantization. Thereafter, an entropy coding unit 8013 applies entropy coding to the quantization model Q to obtain a bitstream S for storing and transmitting the NN model.
  • the NN decoding device 802 has an entropy decoding section 8021, a parameter restoration section 8022, and a post-processing section 8023.
  • the NN decoding device 802 receives the initially transmitted bitstream S, and the entropy decoding section 8021 performs entropy decoding on S to obtain an intermediate model RQ. If the operating environment of the NN model supports inference using the quantized representation used in RQ, RQ may be output and used for inference. Otherwise, a parameter restoration unit 8022 restores the parameters of RQ to the original representation, and obtains the intermediate model RP. If the sparse tensor representation used can be handled by the operating environment of the NN model, the RP may be output and used for inference. Otherwise, find and output a tensor different from the NN model O or a reconstructed NN model R that does not contain the structural representation.
  • the decoding method NNR_PT_INT decodes a model consisting of integer-valued parameters.
  • the decoding method NNR_PT_FLOAT extends NNR_PT_INT and adds a quantization step size delta. Multiply this delta by the integer value above to produce a scaled integer. delta is derived from the integer quantization parameter qp and the granularity parameter qp_density of delta as follows.
  • topological representation such as layer sizes and connections between layers
  • parameter representation such as weights and biases.
  • Topology representation is covered by native formats such as Tensorflow and PyTorch, but exchange formats such as Open Neural Network Exchange Format (ONNX) and Neural Network Exchange Format (NNEF) exist to improve interoperability.
  • native formats such as Tensorflow and PyTorch
  • exchange formats such as Open Neural Network Exchange Format (ONNX) and Neural Network Exchange Format (NNEF) exist to improve interoperability.
  • ONNX Open Neural Network Exchange Format
  • NEF Neural Network Exchange Format
  • topology information nnr_topology_unit_payload is transmitted as part of the NNR bitstream containing the compressed parameter tensor. This enables interoperability not only with the exchange format but also with the topology information expressed in the native format.
  • SEI postfilter purpose SEI indicates the purpose of postfiltering and describes input/output information according to the purpose of postfiltering.
  • Figure 11 shows an example of this SEI syntax.
  • pfp_id indicates the identification number of postfiltering specified by other mechanisms. In this embodiment, it is associated with the NN filter SEI. This SEI message is applied in output order to the current decoded image and all subsequent decoded images in the current layer until a new CLVS (Coded Layer Video Sequence) is started or the bitstream ends.
  • CLVS Coded Layer Video Sequence
  • pfp_id contains an identification number used to identify postfiltering.
  • the identification number shall take values from 0 to 2 ⁇ 20-1, with values from 2 ⁇ 20 to 2 ⁇ 21-1 reserved for future use.
  • pfp_purpose indicates the purpose of postfiltering identified by pfp_id. Values for pfp_purpose are in the range 0 to 2 ⁇ 32-2. Other pfp_purpose values are reserved for future specification. Note that the side information decoder ignores post_filter_purpose SEI messages that contain a reserved value for pfp_purpose.
  • a pfp_purpose value of 0 indicates improved visual quality. In other words, it means that post-filtering is applied to perform image restoration processing without image resolution conversion.
  • a value of 1 for pfp_purpose specifies the width or height of the cropped output image. In other words, it means that post-filtering with image resolution conversion is applied.
  • pfp_purpose When the value of pfp_purpose is 1, there are syntax elements pfp_pic_width_in_luma_samples and pfp_pic_height_in_luma_samples.
  • pfp_pic_width_in_luma_samples specifies the width of the luminance pixel array of the image resulting from applying the post-processing filter identified by pfp_id to the cropped output image.
  • pfp_pic_height_in_luma_samples specifies the height of the luminance pixel array of the image resulting from applying the post-processing filter identified by pfp_id to the cropped output image.
  • Non-Patent Document 1 In the examples of Non-Patent Document 1 and Non-Patent Document 2, information on resolution conversion and inverse conversion accompanying color difference format conversion could not be described well. In this embodiment, the above problem is solved by clarifying input/output information.
  • pfp_purpose indicates the color component to which postfiltering is applied and information on the color difference format of the output image. In other words, it means that post-filtering for chrominance format conversion is applied.
  • pfp_component_idc specifies the color component to apply postfiltering.
  • a value of 0 for pfp_component_idc indicates that postfiltering is applied only to the luminance component.
  • a value of 1 for pfp_component_idc indicates to apply postfiltering to the two chrominance components.
  • a value of 2 for pfp_component_idc indicates to apply postfiltering to all three color components.
  • pfp_output_diff_chroma_format_idc is filter update information, and indicates a difference value between the chrominance format identification value output by postfiltering and the input chrominance format identification value. Note that the value of pfp_output_diff_chroma_format_idc must be in the range of 0 to 2. Then, the variable OutputChromaFormatIdc, which is the identification value of the chrominance format output by postfiltering, is derived as follows.
  • OutputChromaFormatIdc InputChromaFormatIdc + pfp_output_diff_chroma_format_idc
  • InputChromaFormatIdc is described in the SPS of the encoded data
  • the value of sps_chroma_format_idc which is the identification value of the chrominance format of the decoded image.
  • a value of 0 indicates monochrome (4:0:0), a value of 1 indicates 4:2:0, a value of 2 indicates 4:2:2, and a value of 3 indicates 4:4:4.
  • variable OutputChromaFormatIdc which is the identification value of the chrominance format output by post-filtering, is similar to InputChromaFormatIdc, where value 0 is monochrome (4:0:0), value 1 is 4:2:0, and value 2 is 4: 2:2 and a value of 3 indicates 4:4:4.
  • OutputChromaFormatIdc in order to derive OutputChromaFormatIdc, the difference value between the identification value of the chrominance format to be output and the identification value of the chrominance format to be input is used, and the value of OutputChromaFormatIdc is equal to or greater than the value of InputChromaFormatIdc.
  • OutputChromaFormatIdc may be directly used as a syntax element without using the difference value.
  • the value of OutputChromaFormatIdc has the advantage that it can be defined independently of the value of InputChromaFormatIdc. In this case, if the syntax element OutputChromaFormatIdc does not exist, it is assumed to be the same as the value of InputChromaFormatIdc.
  • the NN filter unit 611 estimates php_output_diff_chroma_format_idc to be 0 when the update information php_output_diff_chroma_format_idc does not exist in the encoded data. Accordingly, the NN filter unit 611 may set as follows when php_output_diff_chroma_format_idc does not exist in the encoded data.
  • OutputChromaFormatIdc ChromaFormatIdc
  • a moving image decoding device comprising a predicted image derivation unit that decodes a predicted image as described above and a residual decoding unit that decodes a residual, and the header decoding unit 3020, when there is no filter update information,
  • the NN filter unit 611 derives variables indicating color difference subsampling of the output image as follows.
  • pfp_component_idc which specifies the color component to which post-filtering is applied, distinguishes between luminance and color difference, it may simply indicate the number of components. Specifically, the semantics may be as follows.
  • a value of 0 for pfp_component_idc indicates to apply post-filtering for one component.
  • a value of 1 for pfp_component_idc indicates to apply postfiltering to two components.
  • a value of 2 for pfp_component_idc indicates to apply postfiltering to all three components.
  • the NN filter unit 611 may switch the NN model according to pfp_component_idc.
  • the NN filter unit 611 selects an NN model that derives a 1-channel 3D tensor from a 1-channel 3D tensor, and performs filtering.
  • the NN filter unit 611 selects an NN model that derives a 2-channel 3D tensor from a 2-channel 3D tensor, and performs filtering.
  • the NN filter unit 611 selects an NN model that derives a 3-channel 3D tensor from a 3-channel 3D tensor, and performs filtering.
  • the NN filter unit 611 may derive nnrpf_input_format_idc as follows according to pfp_component_idc so that the NN model has 1 channel for 1 component, 2 channels for 2 components, and 3 channels for 3 components.
  • the NN filter unit 611 may derive nnrpf_input_format_idc according to pfp_component_idc as follows so that the NN model has 1 channel for 1 component, 2 channels for 2 components, and 6 channels for 3 components.
  • the NN filter unit 611 may derive the inputTensor directly according to pfp_component_idc as described above. Alternatively, the NN filter unit 611 may switch the value of the input image ComponentSample and the value of the NN output data outTensor according to pfp_component_idc to derive the output image by the following processing.
  • the postfilter objective SEI is defined independently of the NN postfilter SEI, and the input and output of postfiltering are defined. can solve the problem.
  • the moving image decoding device is characterized by comprising an inverse conversion information decoding device for decoding color component information to be input to the resolution inverse conversion device and color difference format information to be output.
  • the apparatus also has an image encoding device that encodes an image, and an inverse conversion information encoding device that encodes color component information to be input to a resolution inverse conversion device to convert the resolution of the encoded image and color difference format information to be output.
  • a video encoding device characterized by:
  • Embodiments of the present invention are preferably applied to a moving image decoding device that decodes encoded image data and a moving image encoding device that generates encoded image data. be able to. Also, the present invention can be suitably applied to the data structure of encoded data generated by a video encoding device and referenced by a video decoding device. (Cross reference to related applications) This application claims the benefit of priority to Japanese Patent Application: Japanese Patent Application No. 2022-004115 filed on January 14, 2022, and by referring to it, all of its contents are Included in this document.
  • Video transmission system 30 Video decoder 31 Image decoder 301 Entropy Decoder 302 Parameter decoder 303 Inter prediction parameter derivation unit 304 Intra prediction parameter derivation unit 305, 107 loop filter 306, 109 Reference picture memory 307, 108 prediction parameter memory 308, 101 Predictive image generator 309 Inter prediction image generator 310 Intra prediction image generator 311, 105 Inverse quantization/inverse transform section 312, 106 adder 320 prediction parameter derivation unit 10 Video encoder 11 Image encoding device 102 Subtractor 103 Transform/Quantization Unit 104 Entropy Encoder 110 Encoding parameter determination unit 111 Parameter encoder 112 Inter prediction parameter coding unit 113 Intra prediction parameter encoder 120 Prediction parameter derivation part 71 Inverse conversion information creation device 81 Inverse transform information encoder 91 Inverse transform information decoding device 611 NN filter section

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

従来のSEIには、ニューラルネットワークモデルの対象画像と入力テンソルの関係、出力テンソルと出力画像の関係が未定義もしくは不十分であり、モデルだけでは処理できないという課題がある。また、出力画像の色コンポーネントと対象画像の色コンポーネントが異なる場合、処理できないという課題がある。本発明の一態様に係る動画像復号装置は、予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、ニューラルネットワークモデルの入力テンソルと出力テンソルのチャネル数を指定するパラメータから、入力テンソルを導出、もしくは、出力テンソルから画像を導出することを特徴とする。

Description

動画像符号化装置、動画像復号装置
 本発明の実施形態は、動画像符号化装置、動画像復号装置に関する。
 動画像を効率的に伝送または記録するために、動画像を符号化することによって符号化データを生成する動画像符号化装置、および、当該符号化データを復号することによって復号画像を生成する動画像復号装置が用いられている。
 具体的な動画像符号化方式としては、例えば、H.264/AVCやH.265/HEVC(High-Efficiency Video Coding)方式などが挙げられる。
 このような動画像符号化方式においては、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる符号化ツリーユニット(CTU:Coding Tree Unit)、符号化ツリーユニットを分割することで得られる符号化単位(符号化ユニット(Coding Unit:CU)と呼ばれることもある)、及び、符号化単位を分割することより得られる変換ユニット(TU:Transform Unit)からなる階層構造により管理され、CU毎に符号化/復号される。
 また、このような動画像符号化方式においては、通常、入力画像を符号化/復号することによって得られる局所復号画像に基づいて予測画像が生成され、当該予測画像を入力画像(原画像)から減算して得られる予測誤差(「差分画像」または「残差画像」と呼ぶこともある)が符号化される。予測画像の生成方法としては、画面間予測(インター予測)、および、画面内予測(イントラ予測)が挙げられる。
 また、近年の動画像符号化及び復号の技術として非特許文献1が挙げられる。
 H.274には、画像の性質や、表示方法、タイミングなどを符号化データと同時に伝送するための付加拡張情報SEIが規定されている。
 非特許文献1及び非特許文献2、非特許文献3においては、ポストフィルタとして利用されるニューラルネットワークフィルタのトポロジーとパラメータを伝送するSEIを、明示的に規定する方法と、間接的に参照情報として規定する方法が開示されている。
B. Choi, Z. Li, W. Wang, W. Jiang, X. Xu, S. Wenger and S. Liu,"AHG9/AHG11: SEI messages for carriage of neural network information for post-filtering," JVET-V0091 M. M. Hannuksela, E. B. Aksu, F. Cricri, H. R. Tavakoli and M. Santamaria, "AHG9: On post-filter SEI", JVET-X0112 M. M. Hannuksela, M. Santamaria, F. Cricri, E. B. Aksu and H. R. Tavakoli, "AHG9: On post-filter SEI", JVET-Y0115
 しかしながら、非特許文献1、非特許文献2ともにポストフィルタ処理の入力と出力が明示的に定義されていないという課題がある。
 非特許文献2では、出力の色空間と色差サブサンプリングが指定されておらず、どのような出力が得られるかを付加情報から特定できないという課題がある。
 非特許文献1、非特許文献2では、ニューラルネットワークのトポロジーから、入力と出力のテンソルの型を解析可能であるが、テンソルのチャネルと色成分(色コンポーネント)の関係が特定できない。例えば、輝度チャネルと色差チャネルを入力テンソルにどのように設定するか、処理後の出力テンソルをどのような色空間として出力されるかが定義できていない。従って、処理を特定し実行することができないという課題がある。また4:0:0、4:2:0、4:2:2、4:4:4の色差サブサンプリングにより画像の輝度成分と色差成分の幅、高さが異なるが、どのように処理して入力テンソルを導出するかが特定できない。また、色差サブサンプリングに応じて出力テンソルからどのように画像を生成するかが特定できない。
 非特許文献3では、入出力が4:2:0の色差サブサンプリング、入力テンソルが10チャネル、出力テンソルが6チャネルの場合に限り、テンソルのチャネルと色コンポーネントの関係を定めている。しかし、これ以外の形式は処理を実行できないという課題がある。また、付加情報の入力を必要としないモデルに対応できないという課題もある。
 本発明の一態様に係る動画像復号装置は、予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、
 ニューラルネットワークモデルの入力テンソルと出力テンソルのチャネル数を指定するパラメータから、入力テンソルを導出、もしくは、出力テンソルから画像を導出することを特徴とする。
 予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、
 ニューラルネットワークモデルの入出力テンソルのチャネル数を指定する入出力画像情報と、追加入力情報を復号し、上記入出力画像情報を用いて第1の画像から入力テンソルの一部を導出し、さらに、上記追加入力情報を用いて、第1のとは別の第2の画像もしくは、上記予測画像導出もしくは残差の復号に関わる符号化情報を用いて上記入力テンソルの別の一部を導出することを特徴とする。
 色差サブサンプリングのパラメータを用いてループ変数の加算値を変更して、ラスタスキャン状にループ処理を行い、上記ループ内で、画像から入力テンソルを導出し、入力テンソルに対して深層学習フィルタを適用して、出力テンソルを導出することを特徴とする。
 予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、上記ヘッダ部は、フィルタ更新情報がない場合には、色差サブサンプリングに関する出力の色差フォーマットを入力の色差フォーマットで推定することを特徴とする。
 本発明の一態様に係る動画像符号化装置は、予測画像を復号する予測画像導出部と、残差を復号する残差符号化部を備える動画像符号化装置であって、
 ニューラルネットワークモデルの入力テンソルと出力テンソルのチャネル数を指定するパラメータから、入力テンソルを導出、もしくは、出力テンソルから画像を導出することを特徴とする。
 このような構成にすることで、URIで指定されたニューラルネットワークモデルを解析することなく、NNフィルタで指定されるニューラルネットワークモデルの複雑度を参照することを可能とする。これによって、動画像復号装置がニューラルネットワークフィルタを用いたポストフィルタの処理能力を持っているかの判断を容易にする効果がある。
本実施形態に係る動画像伝送システムの構成を示す概略図である。 符号化データの階層構造を示す図である。 本実施形態に係る動画像伝送システムにおいて処理の対象となる画像の概念図である。 画像復号装置の構成を示す概略図である。 画像復号装置の概略的動作を説明するフローチャートである。 画像符号化装置の構成を示すブロック図である。 本実施形態におけるNNフィルタSEIのシンタックス表の構成を示す図である。 ニューラルネットワークモデルのパラメータ型を、数値型とビット幅に分けて記述した場合のNNフィルタSEIのシンタックス表の構成を示す図である。 ニューラルネットワークモデルのパラメータ型のビット幅を対数表現で記述した場合のNNフィルタSEIのシンタックス表の構成を示す図である。 NNフィルタ部611の処理のフローチャートを示す図である。 ポストフィルタ目的SEIのシンタックス表の構成を示す図である。 NNフィルタ部611のニューラルネットワークの構成を示す図である。 NNRの符号化装置・復号装置について示す図である。 NNフィルタSEIのシンタックス例を示す図である。 NNフィルタで定義される入力データ形式を示す表である。 NNフィルタで定義される出力データ形式を示す表である。 復号画像からNNフィルタで定義される入力データ形式への変換方法を示す表である。 NNフィルタで定義される出力データ形式から出力画像への変換方法を示す表である。 NNフィルタSEIのシンタックス例を示す図である。 入力テンソルの次元数(入力チャネル数)と変換方法の関係、出力テンソルの次元数(出力チャネル数)と変換方法を示す図である。
  (第1の実施形態)
 以下、図面を参照しながら本発明の実施形態について説明する。
 図1は、本実施形態に係る動画像伝送システムの構成を示す概略図である。
 動画像伝送システム1は、解像度が変換された異なる解像度の画像を符号化した符号化データを伝送し、伝送された符号化データを復号し画像を元の解像度に逆変換して表示するシステムである。動画像伝送システム1は、動画像符号化装置10とネットワーク21と動画像復号装置30と画像表示装置41からなる。
 動画像符号化装置10は、解像度変換装置(解像度変換部)51、画像符号化装置(画像符号化部)11、逆変換情報作成装置(逆変換情報作成部)71、逆変換情報符号化装置(逆変換情報符号化部)81から構成される。
 動画像復号装置30は、画像復号装置(画像復号部)31、解像度逆変換装置(解像度逆変換部)61、及び逆変換情報復号装置(逆変換情報復号部)91から構成される。
 解像度変換装置51は、動画像に含まれる画像Tの解像度を変換し、異なる解像度の画像を含む可変解像度動画像T2を、画像符号化装置11に供給する。また、解像度変換装置51は、画像の解像度変換の有無を示す逆変換情報を画像符号化装置11に供給する。当該情報が解像度変換を示す場合、動画像符号化装置10は、解像度変換情報を1に設定し、符号化データTeのシーケンスパラメータセットSPS(Sequence Parameter Set)に含ませて符号化する。
 逆変換情報作成装置71は、動画像に含まれる画像T1に基づいて、逆変換情報を作成する。逆変換情報は、解像度変換前の入力画像T1と解像度変換及び符号化、復号後の画像Td1との関係性から導出もしくは選択される。付加情報は何を選択するかを示す情報である。
 逆変換情報符号化装置81には逆変換情報が入力される。逆変換情報符号化装置81は、逆変換情報を符号化して符号化された逆変換情報を生成し、ネットワーク21に送る。
 画像符号化装置11には可変解像度画像T2が入力される。画像符号化装置11は、RPR(Reference Picture Resampling)の枠組みを用いて、PPS単位で入力画像の画像サイズ情報を符号化し、画像復号装置31に送る。
 図1において、逆変換情報符号化装置81は画像符号化装置11とつながれていないが、逆変換情報符号化装置81と画像符号化装置11とは、適宜必要な情報を通信してもよい。
 ネットワーク21は、符号化された逆変換情報及び符号化データTeを画像復号装置31に伝送する。符号化された逆変換情報の一部または全部は、付加拡張情報SEIとして、符号化データTeに含められてもよい。ネットワーク21は、インターネット(Internet)、広域ネットワーク(WAN:Wide Area Network)、小規模ネットワーク(LAN:Local Area Network)またはこれらの組み合わせである。ネットワーク21は、必ずしも双方向の通信網に限らず、地上デジタル放送、衛星放送等の放送波を伝送する一方向の通信網であっても良い。また、ネットワーク21は、DVD(Digital Versatile Disc:登録商標)、BD(Blue-ray Disc:登録商標)等の符号化データTeを記録した記憶媒体で代替されても良い。
 画像復号装置31は、ネットワーク21が伝送した符号化データTeのそれぞれを復号し、可変解像度復号画像Td1を生成して解像度逆変換装置61に供給する。
 逆変換情報復号装置91は、ネットワーク21が伝送した符号化された逆変換情報を復号して逆変換情報を生成して解像度逆変換装置61に供給する。
 図1において、逆変換情報復号装置91は、画像復号装置31とは別に図示されているが、逆変換情報復号装置91は、画像復号装置31に含まれてもよい。例えば、逆変換情報復号装置91は、画像復号装置31の各機能部とは別に画像復号装置31に含まれてもよい。また、図1において、画像復号装置31とつながれていないが、逆変換情報復号装置91と画像復号装置31とは、適宜必要な情報を通信してもよい。
 解像度逆変換装置61は、解像度変換情報が解像度変換を示す場合、符号化データに含まれる画像サイズ情報に基づいて、ニューラルネットワークを用いた超解像処理を介して、解像度変換された画像を逆変換することによって、オリジナルサイズの復号画像を生成する。
 画像表示装置41は、解像度逆変換装置61から入力された1または複数の復号画像Td2の全部または一部を表示する。画像表示装置41は、例えば、液晶ディスプレイ、有機EL(Electro-luminescence)ディスプレイ等の表示デバイスを備える。ディスプレイの形態としては、据え置き、モバイル、HMD等が挙げられる。また、画像復号装置31が高い処理能力を有する場合には、画質の高い画像を表示し、より低い処理能力しか有しない場合には、高い処理能力、表示能力を必要としない画像を表示する。
 図3は、図1に示す動画像伝送システムにおいて処理の対象となる画像の概念図であって、時間の経過に伴う、当該画像の解像度の変化を示す図である。ただし、図3においては、画像が符号化されているか否かを区別していない。図3は、動画像伝送システムの処理過程において、解像度を低下させて画像復号装置31に画像を伝送する例を示している。図3に示すように、通常、解像度変換装置51は、伝送される情報の情報量を少なくするために画像の解像度を低下させる変換を行う。
 <演算子>
 本明細書で用いる演算子を以下に記載する。
 >>は右ビットシフト、<<は左ビットシフト、&はビットワイズAND、|はビットワイズOR、|=はOR代入演算子であり、||は論理和を示す。
 x ? y : zは、xが真(0以外)の場合にy、xが偽(0)の場合にzをとる3項演算子である。
 Clip3(a,b,c)は、cをa以上b以下の値にクリップする関数であり、c<aの場合にはaを返し、c>bの場合にはbを返し、その他の場合にはcを返す関数である(ただし、a<=b)。
 abs(a)はaの絶対値を返す関数である。
 Int(a)はaの整数値を返す関数である。
 floor(a)はa以下の最大の整数を返す関数である。
 ceil(a)はa以上の最小の整数を返す関数である。
 a/dはdによるaの除算(小数点以下切り捨て)を表す。
 a^bはpower(a,b)を表す。a=2の場合1<<bと等しい。
  <符号化データTeの構造>
 本実施形態に係る画像符号化装置11および画像復号装置31の詳細な説明に先立って、画像符号化装置11によって生成され、画像復号装置31によって復号される符号化データTeのデータ構造について説明する。
 図2は、符号化データTeにおけるデータの階層構造を示す図である。符号化データTeは、例示的に、シーケンス、およびシーケンスを構成する複数のピクチャを含む。図2には、シーケンスSEQを既定する符号化ビデオシーケンス、ピクチャPICTを規定する符号化ピクチャ、スライスSを規定する符号化スライス、スライスデータを規定する符号化スライスデータ、符号化スライスデータに含まれる符号化ツリーユニット、符号化ツリーユニットに含まれる符号化ユニットを示す図が示されている。
  (符号化ビデオシーケンス)
 符号化ビデオシーケンスでは、処理対象のシーケンスSEQを復号するために画像復号装置31が参照するデータの集合が規定されている。シーケンスSEQは、図2に示すように、ビデオパラメータセットVPS(Video Parameter Set)、シーケンスパラメータセットSPS(Sequence Parameter Set)、ピクチャパラメータセットPPS(Picture Parameter Set)、Adaptation Parameter Set(APS)、ピクチャPICT、及び、付加拡張情報SEI(Supplemental Enhancement Information)を含んでいる。
 ビデオパラメータセットVPSでは、複数のレイヤから構成されている動画像において、複数の動画像に共通する符号化パラメータの集合および動画像に含まれる複数のレイヤおよび個々のレイヤに関連する符号化パラメータの集合が規定されている。
 シーケンスパラメータセットSPSでは、対象シーケンスを復号するために画像復号装置31が参照する符号化パラメータの集合が規定されている。例えば、ピクチャの幅や高さが規定される。なお、SPSは複数存在してもよい。その場合、PPSから複数のSPSの何れかを選択する。
 ここで、シーケンスパラメータセットSPSには以下のシンタックス要素が含まれる。
・pic_width_max_in_luma_samples:単一のシーケンスにおける画像のうち、最大の幅を有する画像の幅を、輝度ブロック単位で指定するシンタックス要素である。また、当該シンタックス要素の値は、0ではなく、且つMax(8, MinCbSizeY)の整数倍であることが要求される。ここで、MinCbSizeYは、輝度ブロックの最小サイズによって定まる値である。
・pic_height_max_in_luma_samples:単一のシーケンスにおける画像のうち、最大の高さを有する画像の高さを、輝度ブロック単位で指定するシンタックス要素である。また、当該シンタックス要素の値は、0ではなく、且つMax(8, MinCbSizeY)の整数倍であることが要求される。
 ピクチャパラメータセットPPSでは、対象シーケンス内の各ピクチャを復号するために画像復号装置31が参照する符号化パラメータの集合が規定されている。なお、PPSは複数存在してもよい。その場合、対象シーケンス内の各ピクチャから複数のPPSの何れかを選択する。
 ここで、ピクチャパラメータセットPPSには以下のシンタックス要素が含まれる。
・pic_width_in_luma_samples:対象ピクチャの幅を指定するシンタックス要素である。当該シンタックス要素の値は、0ではなく、Max(8, MinCbSizeY)の整数倍であり、且つpic_width_max_in_luma_samples以下の値であることが要求される。
・pic_height_in_luma_samples:対象ピクチャの高さを指定するシンタックス要素である。当該シンタックス要素の値は、0ではなく、Max(8, MinCbSizeY)の整数倍であり、且つpic_height_max_in_luma_samples以下の値であることが要求される。
  (符号化ピクチャ)
 符号化ピクチャでは、処理対象のピクチャPICTを復号するために画像復号装置31が参照するデータの集合が規定されている。ピクチャPICTは、図2に示すように、ピクチャヘッダPH、スライス0~スライスNS-1を含む(NSはピクチャPICTに含まれるスライスの総数)。
 以下、スライス0~スライスNS-1のそれぞれを区別する必要が無い場合、符号の添え字を省略して記述することがある。また、以下に説明する符号化データTeに含まれるデータであって、添え字を付している他のデータについても同様である。
  (符号化スライス)
 符号化スライスでは、処理対象のスライスSを復号するために画像復号装置31が参照するデータの集合が規定されている。スライスは、図2に示すように、スライスヘッダ、および、スライスデータを含んでいる。
 スライスヘッダには、対象スライスの復号方法を決定するために画像復号装置31が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダに含まれる符号化パラメータの一例である。
 スライスタイプ指定情報により指定可能なスライスタイプとしては、(1)符号化の際にイントラ予測のみを用いるIスライス、(2)符号化の際に単予測(L0予測)、または、イントラ予測を用いるPスライス、(3)符号化の際に単予測(L0予測或いはL1予測)、双予測、または、イントラ予測を用いるBスライスなどが挙げられる。なお、インター予測は、単予測、双予測に限定されず、より多くの参照ピクチャを用いて予測画像を生成してもよい。以下、P、Bスライスと呼ぶ場合には、インター予測を用いることができるブロックを含むスライスを指す。
 なお、スライスヘッダは、ピクチャパラメータセットPPSへの参照(pic_parameter_set_id)を含んでいても良い。
  (符号化スライスデータ)
 符号化スライスデータでは、処理対象のスライスデータを復号するために画像復号装置31が参照するデータの集合が規定されている。スライスデータは、図2の符号化スライスヘッダに示すように、CTUを含んでいる。CTUは、スライスを構成する固定サイズ(例えば64x64)のブロックであり、最大符号化単位(LCU:Largest Coding Unit)と呼ぶこともある。
  (符号化ツリーユニット)
 図2には、処理対象のCTUを復号するために画像復号装置31が参照するデータの集合が規定されている。CTUは、再帰的な4分木分割(QT(Quad Tree)分割)、2分木分割(BT(Binary Tree)分割)あるいは3分木分割(TT(Ternary Tree)分割)により、符号化処理の基本的な単位である符号化ユニットCUに分割される。再帰的な4分木分割により得られる木構造のノードのことを符号化ノード(Coding Node)と称する。4分木、2分木、及び3分木の中間ノードは、符号化ノードであり、CTU自身も最上位の符号化ノードとして規定される。
 CTは、CT情報として、CT分割を行うか否かを示すCU分割フラグ、QT分割を行うか否かを示すQT分割フラグ、MT分割の分割方向を示すMT分割方向、MT分割の分割タイプを示すMT分割タイプを含む。split_cu_flag、qt_split_cu_flag、mtt_split_cu_vertical_flag、mtt_split_cu_binary_flagは符号化ノード毎に伝送される。
  (符号化ユニット)
 図2は、処理対象の符号化ユニットを復号するために画像復号装置31が参照するデータの集合が規定されている。具体的には、CUは、CUヘッダCUH、予測パラメータ、変換パラメータ、量子化変換係数等から構成される。CUヘッダでは予測モード等が規定される。
 予測の種類(予測モード)は、イントラ予測と、インター予測の2つがある。イントラ予測は、同一ピクチャ内の予測であり、インター予測は、互いに異なるピクチャ間(例えば、表示時刻間、レイヤ画像間)で行われる予測処理を指す。
 変換・量子化処理はCU単位で行われるが、量子化変換係数は4x4等のサブブロック単位でエントロピー符号化してもよい。
 なお、本明細書中「XXであるか否かを示すフラグ」と記す場合、フラグが0以外(たとえば1)をXXである場合、0をXXではない場合とし、論理否定、論理積などでは1を真、0を偽と扱う(以下同様)。但し、実際の装置や方法では真値、偽値として他の値を用いることもできる。
  (動きベクトル)
 動きベクトルは、異なる2つのピクチャ上のブロック間のシフト量を示す。
  (画像復号装置の構成)
 本実施形態に係る画像復号装置31(図4)の構成について説明する。
 画像復号装置31は、エントロピー復号部301、パラメータ復号部(予測画像復号装置)302、ループフィルタ305、参照ピクチャメモリ306、予測パラメータメモリ307、予測画像生成部(予測画像生成装置)308、逆量子化・逆変換部311、及び加算部312、予測パラメータ導出部320を含んで構成される。なお、後述の画像符号化装置11に合わせ、画像復号装置31にループフィルタ305が含まれない構成もある。
 パラメータ復号部302は、さらに、ヘッダ復号部3020、CT情報復号部3021、及びCU復号部3022(予測モード復号部)を備えており、CU復号部3022はさらにTU復号部3024を備えている。これらを総称して復号モジュールと呼んでもよい。ヘッダ復号部3020は、符号化データからVPS、SPS、PPS、APSなどのパラメータセット情報、スライスヘッダ(スライス情報)を復号する。CT情報復号部3021は、符号化データからCTを復号する。CU復号部3022は符号化データからCUを復号する。TU復号部3024は、TUに予測誤差が含まれている場合に、符号化データからQP更新情報(量子化補正値)と量子化予測誤差(residual_coding)を復号する。
 予測画像生成部308は、インター予測画像生成部309及びイントラ予測画像生成部310を含んで構成される。
 予測パラメータ導出部320は、インター予測パラメータ導出部303及びイントラ予測パラメータ導出部304を含んで構成される。
 エントロピー復号部301は、外部から入力された符号化データTeに対してエントロピー復号を行って、個々の符号(シンタックス要素)を復号する。エントロピー符号化には、シンタックス要素の種類や周囲の状況に応じて適応的に選択したコンテキスト(確率モデル)を用いてシンタックス要素を可変長符号化する方式と、あらかじめ定められた表、あるいは計算式を用いてシンタックス要素を可変長符号化する方式がある。前者のCABAC(Context Adaptive Binary Arithmetic Coding)は、コンテキストのCABAC状態(優勢シンボルの種別(0 or 1)と確率を指定する確率状態インデックスpStateIdx)をメモリに格納する。エントロピー復号部301は、セグメント(タイル、CTU行、スライス)の先頭で全てのCABAC状態を初期化する。エントロピー復号部301は、シンタックス要素をバイナリ列(Bin String)に変換し、Bin Stringの各ビットを復号する。コンテキストを用いる場合には、シンタックス要素の各ビットに対してコンテキストインデックスctxIncを導出し、コンテキストを用いてビットを復号し、用いたコンテキストのCABAC状態を更新する。コンテキストを用いないビットは、等確率(EP, bypass)で復号され、ctxInc導出やCABAC状態は省略される。復号されたシンタックス要素には、予測画像を生成するための予測情報および、差分画像を生成するための予測誤差などがある。
 エントロピー復号部301は、復号した符号をパラメータ復号部302に出力する。どの符号を復号するかの制御は、パラメータ復号部302の指示に基づいて行われる。
  (基本フロー)
 図5は、画像復号装置31の概略的動作を説明するフローチャートである。
 (S1100:パラメータセット情報復号)ヘッダ復号部3020は、符号化データからVPS、SPS、PPSなどのパラメータセット情報を復号する。
 (S1200:スライス情報復号)ヘッダ復号部3020は、符号化データからスライスヘッダ(スライス情報)を復号する。
 以下、画像復号装置31は、対象ピクチャに含まれる各CTUについて、S1300からS5000の処理を繰り返すことにより各CTUの復号画像を導出する。
 (S1300:CTU情報復号)CT情報復号部3021は、符号化データからCTUを復号する。
 (S1400:CT情報復号)CT情報復号部3021は、符号化データからCTを復号する。
 (S1500:CU復号)CU復号部3022はS1510、S1520を実施して、符号化データからCUを復号する。
 (S1510:CU情報復号)CU復号部3022は、符号化データからCU情報、予測情報、TU分割フラグsplit_transform_flag、CU残差フラグcbf_cb、cbf_cr、cbf_luma等を復号する。
 (S1520:TU情報復号)TU復号部3024は、TUに予測誤差が含まれている場合に、符号化データからQP更新情報と量子化予測誤差、変換インデックスmts_idxを復号する。なお、QP更新情報は、量子化パラメータQPの予測値である量子化パラメータ予測値qPpredからの差分値である。
 (S2000:予測画像生成)予測画像生成部308は、対象CUに含まれる各ブロックについて、予測情報に基づいて予測画像を生成する。
 (S3000:逆量子化・逆変換)逆量子化・逆変換部311は、対象CUに含まれる各TUについて、逆量子化・逆変換処理を実行する。
 (S4000:復号画像生成)加算部312は、予測画像生成部308より供給される予測画像と、逆量子化・逆変換部311より供給される予測誤差とを加算することによって、対象CUの復号画像を生成する。
 (S5000:ループフィルタ)ループフィルタ305は、復号画像にデブロッキングフィルタ、SAO、ALFなどのループフィルタをかけ、復号画像を生成する。
  (インター予測パラメータ導出部の構成)
 インター予測パラメータ導出部303(動きベクトル導出装置)は、パラメータ復号部302から入力されたシンタックス要素に基づいて、予測パラメータメモリ307に記憶された予測パラメータを参照してインター予測パラメータを導出する。また、インター予測パラメータをインター予測画像生成部309、予測パラメータメモリ307に出力する。
 ループフィルタ305は、符号化ループ内に設けたフィルタで、ブロック歪やリンギング歪を除去し、画質を改善するフィルタである。ループフィルタ305は、加算部312が生成したCUの復号画像に対し、デブロッキングフィルタ、サンプル適応オフセット(SAO)、適応ループフィルタ(ALF)等のフィルタを施す。
 DF部601は、画素や境界、線分単位でデブロッキングフィルタの強度bSを導出するbS導出部602、ブロックノイズを低減するためにデブロッキングフィルタ処理を行うDFフィルタ部602から構成される。
 DF部601は、NN処理(NNフィルタ部601の処理)前の入力画像resPictureに、パーティション分割境界、予測ブロックの境界、変換ブロックの境界があるかを示すエッジ度edgeIdcとデブロッキングフィルタの最大フィルタ長maxFilterLengthを導出する。さらに、edgeIdcと変換ブロックの境界、符号化パラメータから、デブロッキングフィルタの強度bSを導出する。edgeIdcとbSは0,1,2の値をとってもよいし、それ以外の値でもよい。
 参照ピクチャメモリ306は、CUの復号画像を、対象ピクチャ及び対象CU毎に予め定めた位置に記憶する。
 予測パラメータメモリ307は、CTUあるいはCU毎に予め定めた位置に予測パラメータを記憶する。具体的には、予測パラメータメモリ307は、パラメータ復号部302が復号したパラメータ及び予測パラメータ導出部320が導出したパラメータ等を記憶する。
 予測画像生成部308には予測パラメータ導出部320が導出したパラメータが入力される。また、予測画像生成部308は、参照ピクチャメモリ306から参照ピクチャを読み出す。予測画像生成部308は、predModeが示す予測モードで、パラメータと参照ピクチャ(参照ピクチャブロック)を用いてブロックもしくはサブブロックの予測画像を生成する。ここで、参照ピクチャブロックとは、参照ピクチャ上の画素の集合(通常矩形であるのでブロックと呼ぶ)であり、予測画像を生成するために参照する領域である。
 predModeがインター予測モードを示す場合、インター予測画像生成部309は、インター予測パラメータ導出部303から入力されたインター予測パラメータと参照ピクチャを用いてインター予測によりブロックもしくはサブブロックの予測画像を生成する。
 イントラ予測画像生成部310は、predModeがイントラ予測モードを示す場合、イントラ予測パラメータ導出部304から入力されたイントラ予測パラメータと参照ピクチャメモリ306から読み出した参照画素を用いてイントラ予測を行う。
 逆量子化・逆変換部311(残差復号部)は、パラメータ復号部302から入力された量子化変換係数を逆量子化して変換係数を求める。
 加算部312は、予測画像生成部308から入力されたブロックの予測画像と逆量子化・逆変換部311から入力された予測誤差を画素毎に加算して、ブロックの復号画像を生成する。加算部312はブロックの復号画像を参照ピクチャメモリ306に記憶し、また、ループフィルタ305に出力する。
  (NNフィルタ部611の構成例)
 図12は、ニューラルネットワークフィルタ部(NNフィルタ部611)を用いた補間フィルタ、ループフィルタ、ポストフィルタの構成例を示す図である。以下ではポストフィルタの例を説明するが、補間フィルタやループフィルタでもよい。
 動画像復号装置後の後処理部61は、NNフィルタ部611を備える。NNフィルタ部611は、参照ピクチャメモリ306の画像を出力する際に、フィルタ処理を行い外部に出力する。出力画像は、表示、ファイル書き出し、再エンコード(トランスコード)、伝送などをしてもよい。NNフィルタ部611は、入力画像に対して、ニューラルネットワークモデルによるフィルタ処理を行う手段である。同時に、等倍もしくは有理数倍の縮小・拡大を行ってもよい。
 ここで、ニューラルネットワークモデル(以下、NNモデル)とは、ニューラルネットワークの要素および結合関係(トポロジー)と、ニューラルネットワークのパラメータ(重み、バイアス)を意味する。なお、トポロジーを固定して、ニューラルネットワークモデルはパラメータのみを切り替えても良い。
  (NNフィルタ部611の詳細)
 NNフィルタ部は入力画像inSamplesと入力パラメータ(例えば、QP、bSなど)を用いて、ニューラルネットワークモデルによるフィルタ処理を行う。入力画像は、コンポーネントごとの画像であってもよいし、複数コンポーネントをそれぞれチャネルとして持つ画像であってもよい。また、入力パラメータは画像と異なるチャネルに割り当ててもよい。
 NNフィルタ部は、以下の処理を繰り返し適用してもよい。
 NNフィルタ部は、inSamplesにカーネルk[m][i][j]を畳み込み演算(conv,convolution)し、biasを加算した出力画像outSamplesを導出する。ここで、nn=0..n-1、xx=0..width-1、yy=0..height-1である。
 outSamples[nn][xx][yy]=ΣΣΣ(k[mm][i][j]*inSamples[mm][xx+i-of][yy+j-of]+bias[nn])1x1 Convの場合、Σは、各々mm=0..m-1、i=0、j=0の総和を表す。このとき、of=0を設定する。3x3 Convの場合、Σは各々mm=0..m-1、i=0..2、j=0..2の総和を表す。このとき、of=1を設定する。nはoutSamplesのチャネル数、mはinSamplesのチャネル数、widthはinSamplesとoutSamplesの幅、heightはinSamplesとoutSamplesの高さである。ofは、inSamplesとoutSamplesのサイズを同一にするために、inSamplesの周囲に設けるパディング領域のサイズである。以下、NNフィルタ部の出力が画像ではなく値(補正値)の場合には、outSamplesの代わりにcorrNNで出力を表わす。
 なお、CWH形式のinSamples、outSamplesではなくCHW形式のinTensor、outTensorで記述すると以下の処理と等価である。
 outTensor[nn][yy][xx]=ΣΣΣ(k[mm][i][j]*inTensor[mm][yy+j-of][xx+i-of]+bias[nn])
 また、Depth wise Convと呼ばれる以下の式で示す処理を行ってもよい。ここで、nn=0..n-1、xx=0..width-1、yy=0..height-1である。
 outSamples[nn][xx][yy]=ΣΣ(k[nn][i][j]*inSamples[nn][xx+i-of][yy+j-of]+bias[nn])
Σは各々i、jに対する総和を表す。nはoutSamplesとinSamplesのチャネル数、widthはinSamplesとoutSamplesの幅、heightはinSamplesとoutSamplesの高さである。
 またActivateと呼ばれる非線形処理、たとえばReLUを用いてもよい。
ReLU(x) = x >= 0 ? x : 0
また以下の式に示すleakyReLUを用いてもよい。
 leakyReLU(x) = x >= 0 ? x : a * x
ここでaは所定の値、例えば0.1や0.125である。また整数演算を行うために上記の全てのk、bias、aの値を整数として、convの後に右シフトを行ってもよい。
 ReLUでは0未満の値に対しては常に0、それ以上の値に対しては入力値がそのまま出力される。一方、leakyReLUでは、0未満の値に対して、aで設定された勾配で線形処理が行われる。ReLUでは0未満の値に対する勾配が消失するため、学習が進みにくくなる場合がある。leakyReLUでは0未満の値に対する勾配が残され、上記問題が起こりにくくなる。また、上記leakyReLU(x)のうち、aの値をパラメータ化して用いるPReLUを用いてもよい。
  (ニューラルネットワークモデル複雑度参照のためのSEI)
 図7は、本実施形態のNNフィルタSEIのシンタックス表の構成を示す図である。本SEIは、ニューラルネットワークモデル複雑度の情報を含む。
・nnrpf_id: NNフィルタの識別番号である。
・nnrpf_mode_idc: NNフィルタに使用するニューラルネットワークモデルの指定方法を示すモードのインデックスである。値が0の場合は、nnrpf_idに関連付けられるNNフィルタが、このSEIメッセージで指定されていないことを示す。値が1の場合は、nnrpf_idに関連付けられるNNフィルタが所定のURI(Uniform Resource Identifier)で識別されるニューラルネットワークモデルであることを示す。URIは、ロジカルもしくは物理的なリソースを示す識別用の文字列である。なおURIの示す場所に実際のデータが存在する必要はなく、文字列がリソースを特定できればよい。値が2の場合は、nnrpf_idに関連付けられるNNフィルタが、このSEIメッセージに含まれるISO/IEC 15938-17ビットストリームで表されるニューラルネットワークモデルであることを示す。値が3の場合は、nnrpf_idに関連付けられるNNフィルタが、前の復号で使用したNNフィルタSEIメッセージで識別され、このSEIメッセージに含まれるISO/IEC 15938-17ビットストリームで更新されるニューラルネットワークモデルであることを示す。
・nnrpf_persistence_flag: 現在の階層に対するこのSEIメッセージの持続性を指定するフラグである。値が0の場合は、このSEIメッセージは現在の復号されたピクチャにのみ適用されることを示す。値が1の場合は、現在の復号されたピクチャと、その後続のピクチャに、出力順で適用されることを示す。
・nnrpf_uri[i]: NNフィルタとして使用するニューラルネットワークモデルの参照先URIを格納する文字列である。iはNULLを終端とするUTF-8文字列のiバイト目である。nnrpf_mode_idc==1の場合、ヘッダ符号化部1110およびヘッダ復号部3020はNNフィルタとして使用するニューラルネットワークモデルを示すURIであるnnrpf_uriを復号する。nnrpf_uriの示す文字列に対応するニューラルネットワークモデルを動画像符号化装置もしくは動画像復号装置の備えるメモリから読み出すか、外部からネットワーク経由で読み出す。
・nnrpf_payload_byte[i]: ISO/IEC 15938-17に準拠したビットストリームのiバイト目を示す。
 NNフィルタSEIは、ニューラルネットワークモデル複雑度情報(ネットワークモデル複雑度情報)として以下のシンタックス要素を含む。
・nnrpf_parameter_type_idc: NNモデルのパラメータに含まれる変数型を示すインデックスである。値が0の場合、NNモデルは整数型のみを使用する。値が1の場合、NNモデルは、浮動小数点型か、或いは整数型を使用する。
・nnrpf_num_parameters_idc: ポストフィルタで使用するNNモデルのパラメータ数を示すインデックスである。値が0の場合、NNモデルのパラメータ数を定義しないことを示す。値が0でない場合、nnrpf_num_parameters_idcを用いて以下の処理を行い、NNモデルのパラメータ数を導出する。
 ヘッダ符号化部1110およびヘッダ復号部3020は、nnrpf_num_parameters_idcに基づいて、NNモデルのパラメータ数の最大値MaxNNParametersを以下のように導出し、ネットワークモデル複雑度情報を符号化・復号してもよい。
 MaxNNParameters = (UNITPARAM << nnrpf_num_parameters_idc) - 1
ここでUNITPARAMは所定の定数であり、UNITPARAM=2048=2^11でもよい。
なお、シフト演算は指数と同値であり、以下でもよい。
 MaxNNParameters = 2 ^ (nnrpf_num_parameters_idc+11) - 1
また、パラメータ数の単位は、2倍単位ではなく、以下のように2倍単位と1.5倍単位を組み合わせてもよい。
 MaxNNParameters = (nnrpf_num_parameters_idc & 1) ? (UNITPARAM2 << nnrpf_num_parameters_idc)-1 : (UNITPARAM << nnrpf_num_parameters_idc)-1
ここでUNITPARAM2はUNITPARAM*1.5となる所定の定数であってもよい。例えば、UNITPARAM=2048の場合、UNITPARAM2=3072である。
また、以下でもよい。
 MaxNNParameters = (nnrpf_num_parameters_idc & 1) : 2^(nnrpf_num_parameters_idc+11)*1.5-1 : 2^(nnrpf_num_parameters_idc+11)-1
すなわち、ヘッダ符号化部1110ではnnrpf_num_parameter_idcの値は、実際のNNモデルのパラメータ数がMaxNNParameters以下となるような値を設定する。ヘッダ復号部3020は、上記のように設定された符号化データを復号する。
 なお、MaxNNParametersの導出に線形の表現を用いてもよい。
 MaxNNParameters = (UNITPARAM * nnrpf_num_parameters_idc) -1
このとき、UNITPARAM=10000であってもよい。UNITPARAMは1000以上の値が好ましく、また10の倍数が好ましい。
・nnrpf_num_kmac_operations_idc: ポストフィルタの処理に必要なオペレーション数の規模を示す値である。ヘッダ符号化部1110およびヘッダ復号部3020は、nnrpf_num_kmac_operations_idcに基づいてMaxNNOperationsを以下のように求める。MaxNNOperationsはポストフィルタの処理に必要なオペレーション数の最大値である。
 MaxNNOperations = nnrpf_num_kmac_operations_idc * 1000 * pictureWidth * pictureHeight
ここで、pictureWidth, pictureHeightは、ポストフィルタに入力されるピクチャの幅、高さである。
 すなわち、動画像符号化装置は、nnrpf_num_kmac_operations_idcの値を、ポストフィルタの処理に必要なオペレーション数に応じて設定する。
 上記では、所定の定数を単位として定義される処理量に関わるネットワークモデル複雑度情報のシンタックスを伝送もしくは符号化もしくは復号することにより、簡潔に複雑度の伝送が可能であるという効果を奏する。さらに10の倍数を利用すると人間にも理解しやすい値となる効果がある。また1000以上の値にすれば、少ない区分数でモデルの規模を好適に表現することを可能とし、効率的に伝送できる。
 つまり、上記ネットワークモデル複雑度情報を示すシンタックスはパラメータ数もしくはオペレーション数の上限を示し、上記パラメータ数もしくはオペレーション数は、2の指数乗を単位として定義される。あるいは、上記パラメータ数もしくはオペレーション数は、2の指数乗もしくは2の指数乗の1.5倍を単位として定義されてもよい。また、上記パラメータ数もしくはオペレーション数は、10の倍数を単位として定義されてもよい。
 上記ではさらに、シフト表現もしくは指数表現によって定義される処理量に関わるネットワークモデル複雑度情報のシンタックスを伝送もしくは符号化もしくは復号することにより、より短い符号で効率的に複雑度の伝送が可能であるという効果を奏する。
・nnrpf_alignment_zero_bit: バイトアライメントのためのビットである。ヘッダ符号化部1110およびヘッダ復号部3020は、ビット位置がバイト境界に到達するまで1ビットずつ符号"0"を符号化、復号する。
 nnrpf_operation_type_idc: ポストフィルタのNNモデルで使用される要素の制限もしくはトポロジーの制限を示すインデックスである。インデックスの値によって、例えば、以下のように処理を行ってもよい。
 値が3の場合、前記要素もしくはトポロジーは以下に制限される。カーネルの最大サイズは5x5、最大チャネル数は32、活性化関数にleaky ReLU、或いはReLUのみ使用可能、分岐の最大レベルは3(スキップコネクションを除く)。
 値が2の場合、上記の制限に加えて、活性化関数でのleaky Reluの使用を禁止、スキップコネクション以外の分岐を禁止(例えば、U-Netやグループ化畳み込みを行わない)。
 値が1の場合、さらに上記の制限に加えて、空間からチャネルへの写像(例えば、Pixel Shuffler)を禁止、全体平均プーリングを禁止。
 値が0の場合、前記要素もしくはトポロジーは制限されない。
<別の構成例1>
 ネットワークモデル複雑度情報を示すパラメータnnrpf_parameter_type_idcは以下のように定義されてもよい。
・nnrpf_parameter_type_idc: ニューラルネットワークモデルのパラメータ型を示すインデックスである。例えば、パラメータの値に応じて以下のようにパラメータ型を決めてもよい。
値が0の場合、8bit符号なし整数型、値が1の場合、16bit符号なし整数型、値が2の場合、32bit符号なし整数型、値が3の場合、16bit浮動小数点型(bfloat16)、値が4の場合、16bit浮動小数点型(半精度)、値が5の場合、32bit浮動小数点型(単精度)と定義する。
<別の構成例2>
 図8は、ネットワークモデル複雑度情報を備えるNNフィルタSEIのシンタックス表の構成を示す図である。この例では、ニューラルネットワークモデルのパラメータ型を、数値型とビット幅に分けて定義する。
 この構成例では、図7のSEIのうち、以下のシンタックス情報の定義を変更する。
・nnrpf_parameter_type_idc: ニューラルネットワークモデルの数値型を示すインデックスである。例えば、パラメータの値に応じて以下のように数値型を決めてもよい。
値が0の場合、整数型、値が1の場合、浮動小数点型と定義する。
 また、図7のSEIのシンタックスに加えて、以下のシンタックス情報を含む。
・nnrpf_parameter_bit_width_idc: ニューラルネットワークモデルのビット幅を示すインデックスである。例えば、パラメータの値に応じて以下のようにビット幅を決めてもよい。
値が0の場合、8bit、値が1の場合、16bit、値が2の場合、32bitと定義する。
<別の構成例3>
 図9は、ネットワークモデル複雑度情報を備えるNNフィルタSEIのシンタックス表の構成を示す図である。ここでは、ニューラルネットワークモデルのパラメータ型のビット幅を対数表現で定義する。
 この構成例では、nnrpf_parameter_bit_width_idcに代えて、以下のシンタックス情報を含む。
・nnrpf_log2_parameter_bit_width_minus3: ニューラルネットワークモデルのパラメータのビット幅を2の対数表現で示した値である。nnrpf_log2_parameter_bit_width_minus3に基づいて、パラメータのビット幅parameterBitWidthを以下のように求める。
parameterBitWidth = 1 << ( nnrpf_log2_parameter _bit_width_minus3 + 3 )
 (SEIの復号とポストフィルタ処理)
 ヘッダ復号部3020は、図7~9で規定されたSEIメッセージから、ネットワークモデル複雑度情報を復号する。SEIは復号や表示などに関連する処理の付加情報である。
 図10は、NNフィルタ部611の処理のフローチャートを示す図である。NNフィルタ部611は、上記SEIメッセージのパラメータに従って以下の処理を行う。
S6001:SEIのネットワークモデル複雑度情報から処理量と精度を読み込む。
S6002:NNフィルタ部611が処理可能な複雑度を超える場合には終了する。超えない場合にはS6003へ進む。
S6003:NNフィルタ部611が処理可能な精度を超える場合には終了する。超えない場合にはS6004へ進む。
S6004:SEIからネットワークモデルを特定し、NNフィルタ部611のトポロジーを設定する。
S6005:SEIの更新情報からネットワークモデルのパラメータを導出する。
S6006:導出されたネットワークモデルのパラメータをNNフィルタ部611に読み込む。
S6007:NNフィルタ部611のフィルタ処理を実行し、外部に出力する。
ただし、復号処理における輝度サンプルや色差サンプルの構築にSEIは必ずしも必要とされない。
  (ニューラルネットワークモデルデータ形式参照のためのSEI)
 図14は、本実施形態のNNフィルタSEIのシンタックス表の別の構成を示す図である。本SEIは、ニューラルネットワークモデル(NNモデル)データ形式の情報を含む。既に説明したニューラルネットワークモデル複雑度の情報を含むSEIと同じシンタックス要素は、説明を省略する
 ・nnrpf_input_format_idc: 入力テンソル識別パラメータ。NNフィルタで用いられるNNモデルの入力データ(入力テンソル)の形式を示す。ヘッダ復号部3020は、図15に示すように、nnrpf_input_format_idcの値に基づいて入力データの形式(チャネル数(NumInChannels)、データフォーマット)を導出する。
 nnrpf_input_format_idc==0の場合、入力データの形式は1チャネル(輝度)の3次元データ(3Dテンソル)である。復号画像の輝度チャネルが、NNフィルタの入力データとして用いられることを示す。なお、本実施例において前記3次元データの3つの次元は(C,H,W)の順序と定義するが、次元の順序はこれに限らない。たとえば、(H,W,C)の順で格納する構成にしてもよい。また、この場合はチャネル数が1つであるため、2次元データ(H,W)としてもよい。
 nnrpf_input_format_idc==1の場合、入力データの形式は2チャネル(色差)の3次元データ(3Dテンソル)である。復号画像の2つの色差チャネル(UおよびV)が、NNフィルタの入力データとして用いられることを示す。
 nnrpf_input_format_idc==2の場合、入力データの形式は3チャネル(輝度および2つの色差)の3次元データ(3Dテンソル)である。復号画像の輝度および2つの色差チャネルが、4:4:4形式でNNフィルタへの入力データとして用いられることを示す。
 nnrpf_input_format_idc==3の場合、入力データの形式は6チャネル(4つの輝度および2つの色差)の3次元データ(3Dテンソル)である。4:2:0形式の復号画像の輝度チャネルから導出される4チャネルおよび2つの色差チャネルが、NNフィルタの入力データとして用いられることを示す。
 ・nnrpf_output_format_idc: 出力テンソル識別パラメータ。NNフィルタで用いられるNNモデルの出力データ(NN出力データ、出力テンソル)の形式を示す。ヘッダ復号部3020は、図16に示すように、nnrpf_output_format_idcの値に基づいて出力データの形式(チャネル数(NumOutChannels)、データフォーマット)を導出する。
 nnrpf_output_format_idc==0の場合、NN出力データの形式は1チャネル(輝度)の3次元データ(3Dテンソル)である。NNフィルタの出力データは、出力画像の輝度チャネルとして用いられることを示す。
 nnrpf_output_format_idc==1の場合、NN出力データの形式は2チャネル(色差)の3次元データ(3Dテンソル)である。NNフィルタの出力データは、出力画像の2つの色差チャネル(UおよびV)として用いられることを示す。
 nnrpf_output_format_idc==2の場合、NN出力データの形式は3チャネル(輝度および2つの色差)の3次元データ(3Dテンソル)である。NNフィルタの出力データは、出力画像の輝度および2つの色差チャネルとして4:4:4形式で用いられることを示す。
 nnrpf_output_format_idc==3の場合、NN出力データの形式は6チャネル(4つの輝度および2つの色差)の3次元データ(3Dテンソル)である。NNフィルタの出力データは、6チャネルのうち4チャネルを統合して導出される1つの輝度チャネルおよび2つの色差チャネルとして4:2:0形式で用いられることを示す。
  (ポストフィルタSEIの処理)
 ヘッダ符号化部1110、ヘッダ復号部3020は、ポストフィルタSEIの処理において、画像復号装置のシンタックス値、変数を、フィルタ処理用の変数に設定してもよい。
PicWidthInLumaSamples = pps_pic_width_in_luma_samples
PicHeightInLumaSamples = pps_pic_height_in_luma_samples
ChromaFormatIdc = sps_chroma_format_idc
BitDepthY= BitDepthC = BitDepth
ComponentSample[cIdx]は復号画像のcIdx番目の復号済み画素値を格納した2次元配列である。
ここで、pps_pic_width_in_luma_samples、pps_pic_height_in_luma_samples、sps_chroma_format_idcは、画像幅、高さ、色コンポーネントのサブサンプリングを示すシンタックス値、BitDepthは画像のビットデプスである。
 ヘッダ符号化部1110、ヘッダ復号部3020は、ChromaFormatIdcに応じて以下の変数を導出する。
SubWidthC = 1, SubHeghtC = 1 (ChromaFormatIdc == 0)
SubWidthC = 2, SubHeghtC = 2 (ChromaFormatIdc == 1)
SubWidthC = 2, SubHeghtC = 1 (ChromaFormatIdc == 2)
SubWidthC = 1, SubHeghtC = 1 (ChromaFormatIdc == 3)
 ヘッダ符号化部1110、ヘッダ復号部3020はフィルタ対象の輝度画像の幅、高さ、色差画像の幅、高さを以下の変数で導出する。
LumaWidth = PicWidthInLumaSamples
LumaHeight = PicHeightInLumaSamples
ChromaWidth = PicWidthInLumaSamples / SubWidthC
ChromaHeight = PicHeightInLumaSamples / SubHeithtC
SW = SubWidthC
SH = SubHeightC
SubWidthC(=SW)、SubHeightC(=SH)は色コンポーネントのサブサンプリングを示す。ここでは、輝度に対する色差の解像度の比を表わす変数である。
 また、ヘッダ符号化部1110、ヘッダ復号部3020は、以下のように比率を示すスケール値に応じて出力画像幅outWidthと高さoutHeightを導出してもよい。
outLumaWidth = LumaWidth * scale
outLumaHeight = LumaHeight * scale
outChromaWidth = LumaWidth * scale / outSW
outChromaHeight = LumaHeight * scale / outSH
outSW、outSHは出力画像の色差サブサンプリング値である。
  (ポストフィルタのNN入力データへの変換)
 NNフィルタ部611は、NNフィルタに画像データを入力するにあたり、nnrpf_input_format_idcの値に基づき、図17および以下に示すように復号画像を3次元配列であるNN入力データinputTensor[][][]に変換する。
以下、x,yは輝度画素の座標を表す。例えばComponentSampleにおいてxとyの範囲はそれぞれx=0..LumaWidth-1, y=LumaHeight-1である。cx,cyは色差画素の座標を表し、cxとcyの範囲はそれぞれcx=0..ChromaWidth-1, cy=ChromaHeight-1である。以下のNNフィルタ部611は、この範囲を処理する。
nnrpf_input_format_idcが0(pfp_component_idc==0)の場合、NNフィルタ部611はinputTensorを以下で導出する。
 inputTensor[0][y][x] = ComponentSample[0][x][y]
nnrpf_input_format_idcが1(pfp_component_idc==1)の場合、inputTensorを以下で導出する:
 inputTensor[0][cy][cx] = ComponentSample[1][cx][cy]
 inputTensor[1][cy][cx] = ComponentSample[2][cx][cy]
また以下でもよい:
 inputTensor[0][y/SH][x/SW] = ComponentSample[1][x/SW][y/SH]
 inputTensor[1][y/SH][x/SW] = ComponentSample[2][x/SW][y/SH]
nnrpf_input_format_idcが2(pfp_component_idc==2)の場合、inputTensorを以下で導出する:
 inputTensor[0][y][x] = ComponentSample[0][x][y]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[1][y][x] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][x/SW][y/SH]
 inputTensor[2][y][x] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][x/SW][y/SH]
nnrpf_input_format_idcが3の場合は、inputTensorは以下で導出する:
 inputTensor[0][cy][cx] = ComponentSample[0][cx*2 ][cy*2 ]
 inputTensor[1][cy][cx] = ComponentSample[0][cx*2+1][cy*2 ]
 inputTensor[2][cy][cx] = ComponentSample[0][cx*2 ][cy*2+1]
 inputTensor[3][cy][cx] = ComponentSample[0][cx*2+1][cy*2+1]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[4][cy][cx] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][cx][cy]
 inputTensor[5][cy][cx] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][cx][cy]
ChromaFormatIdcが0の場合、ComponentSampleは輝度チャネルのみの画像である。このとき、NNフィルタ部611はinputTensorの色差データ部分にビット深度から導出される定数ChromaOffsetを設定してもよい。ChromaOffsetは0など他の値でもよい。あるいは、括弧内で示したように、後述のpfp_component_idcに応じてNN入力データを導出してもよい。
 図20は、テンソルのチャネル数と変換処理の関係を示す図である。
 さらに、NNフィルタ部611は入力テンソルのチャネル数NumInChannels(numTensors)に応じて以下のようにNN入力データを導出してもよい。
NumInChannels==1の場合、inputTensorを以下で導出する。
 inputTensor[0][y][x] = ComponentSample[0][x][y]
NumInChannels==2の場合、inputTensorを以下で導出する。
 inputTensor[0][cy][cx] = ComponentSample[1][cx][cy]
 inputTensor[1][cy][cx] = ComponentSample[2][cx][cy]
また以下でもよい:
 inputTensor[0][y/SH][x/SW] = ComponentSample[1][x/SW][y/SH]
 inputTensor[1][y/SH][x/SW] = ComponentSample[2][x/SW][y/SH]
NumInChannels==3の場合、inputTensorを以下で導出する。
 inputTensor[0][y][x] = ComponentSample[0][x][y]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[1][y][x]
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][x/SW][y/SH]
 inputTensor[2][y][x] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][x/SW][y/SH]
NumInChannels==6の場合は、inputTensorを以下で導出する。
 inputTensor[0][cy][cx] = ComponentSample[0][cx*2 ][cy*2 ]
 inputTensor[1][cy][cx] = ComponentSample[0][cx*2+1][cy*2 ]
 inputTensor[2][cy][cx] = ComponentSample[0][cx*2 ][cy*2+1]
 inputTensor[3][cy][cx] = ComponentSample[0][cx*2+1][cy*2+1]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[4][cy][cx] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][cx][cy]
 inputTensor[5][cy][cx] 
  = ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][cx][cy]
上記のように、予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、ニューラルネットワークモデルの入力テンソルと出力テンソルのチャネル数を指定するパラメータから、入力テンソルを導出、もしくは、出力テンソルから画像を導出することにより、入力テンソルを確実に簡易に導出できるという効果を奏する。
 NNフィルタ部611は、1チャネルの輝度画像を、画素位置に応じて4チャネルに分離して入力データへと変換する。また、NNフィルタ部611は、以下で導出してもよい。以下では、4:2:0、4:2:2、4:4:4の違いを、色差サブサンプリングを示す変数で吸収するため、色差サンプルの違いによらずに処理できる:
 inputTensor[0][cy][cx] = ComponentSample[0][cx*2 ][cy*2 ]
 inputTensor[1][cy][cx] = ComponentSample[0][cx*2+1][cy*2 ]
 inputTensor[2][cy][cx] = ComponentSample[0][cx*2 ][cy*2+1]
 inputTensor[3][cy][cx] = ComponentSample[0][cx*2+1][cy*2+1]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[4][cy][cx] =
  ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][cx*2/SW][cy*2/SH]
 inputTensor[5][cy][cx] =
  ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][cx*2/SW][cy*2/SH]
 また、cx = x/2、cy = y/2であるので、NNフィルタ部611は、上述のx, yの範囲に対して以下で導出してもよい:
 inputTensor[0][y/2][x/2] = ComponentSample[0][x/2*2 ][y/2*2 ]
 inputTensor[1][y/2][x/2] = ComponentSample[0][x/2*2+1][y/2*2 ]
 inputTensor[2][y/2][x/2] = ComponentSample[0][x/2*2 ][y/2*2+1]
 inputTensor[3][y/2][x/2] = ComponentSample[0][x/2*2+1][y/2*2+1]
 ChromaOffset = 1<<(BitDepthC-1)
 inputTensor[4][y/2][x/2] =
  ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[1][x/SW][y/SH]
 inputTensor[5][y/2][x/2] =
  ChromaFormatIdc==0 ? ChromaOffset : ComponentSample[2][x/SW][y/SH]
  (ポストフィルタのNN出力データからの変換)
 NNフィルタ部611は、nnrpf_output_format_idcの値に基づき、NNフィルタの出力データである3次元配列のNN出力データoutputTensor[][][]から出力画像outSamplesを導出する。具体的には、NNフィルタ部611は、図18および以下に示すように、nnrpf_output_format_idcの値と出力画像の色差サブサンプリング値outSW、outSHに基づき、以下のように、画像を導出する。なお、outSW、outSHは、符号化データから復号したOutputChromaFormatIdcに基づいて導出される値を用いる。以下、x,yは出力画像の輝度画素の座標を表す。例えばoutputTensorにおいてxとyの範囲はそれぞれx = 0..outLumaWidth-1, y = outLumaHeight-1 である。cx,cyは出力画像の色差画素の座標を表し、cxとcyの範囲はそれぞれcx = 0..outChromaWidth-1, cy = 0..outChromaHeight-1である。以下のNNフィルタ部611は、この範囲を処理する。outSamplesL、outSamplesCb、outSamplesCrはそれぞれ出力画像の輝度チャネル、色差(Cb)チャネル、色差(Cr)チャネルを表す。
 nnrpf_output_format_idcが0の場合、NNフィルタ部611はoutSamplesLを以下で導出する。
 outSamplesL[x][y] = outputTensor[0][y][x]
nnrpf_output_format_idcが1の場合、outSamplesCb、outSamplesCrを以下で導出する。
 outSamplesCb[cx][cy] = outputTensor[0][cy][cx]
 outSamplesCr[cx][cy] = outputTensor[1][cy][cx]
nnrpf_output_format_idcが2の場合、outSamplesL、outSamplesCb、outSamplesCを以下で導出する。
 outSamplesL[x][y] = outputTensor[0][y][x]
 outSamplesCb[x/outSW][y/outSH] = outputTensor[1][y][x]
 outSamplesCr[x/outSW][y/outSH] = outputTensor[2][y][x]
またはoutSamplesCb、outSamplesCrを以下で導出してもよい。
 outSamplesCb[cx][cy] = outputTensor[1][cy*outSH][cx*outSW]
 outSamplesCr[cx][cy] = outputTensor[2][cy*outSH][cx*outSW]
nnrpf_output_format_idcが3の場合は、outSamplesLを以下で導出する:
 outSamplesL[x/2*2 ][y/2*2 ] = outputTensor[0][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2 ] = outputTensor[1][y/2][x/2]
 outSamplesL[x/2*2 ][y/2*2+1] = outputTensor[2][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2+1] = outputTensor[3][y/2][x/2]
またはoutSamplesLを以下で導出してもよい:
 outSamplesL[cx*2 ][cy*2 ] = outputTensor[0][cy][cx]
 outSamplesL[cx*2+1][cy*2 ] = outputTensor[1][cy][cx]
 outSamplesL[cx*2 ][cy*2+1] = outputTensor[2][cy][cx]
 outSamplesL[cx*2+1][cy*2+1] = outputTensor[3][cy][cx]
さらにnnrpf_output_format_idcが3の場合、出力画像が4:2:0形式(出力画像のChromaFormatIdcが1, SW=SH=2)であれば、outSamplesCb、outSamplesCrを以下で導出する: 
 outSamplesCb[cx][cy] = outputTensor[4][cy][cx]
 outSamplesCr[cx][cy] = outputTensor[5][cy][cx]
あるいは、出力画像が4:2:2形式(出力画像のChromaFormatIdcが2, SW=2, SH=1)であれば、outSamplesCb, outSamplesCrを以下で導出する:
 outSamplesCb[cx][cy/2*2 ] = outputTensor[4][cy][cx]
 outSamplesCb[cx][cy/2*2+1] = outputTensor[4][cy][cx]
 outSamplesCr[cx][cy/2*2 ] = outputTensor[5][cy][cx]
 outSamplesCr[cx][cy/2*2+1] = outputTensor[5][cy][cx]
あるいは、出力画像が4:4:4形式(出力画像のChromaFormatIdcが3, SW=SH=1)であれば、outSamplesCb, outSamplesCrを以下で導出する:
 outSamplesCb[cx/2*2 ][cy/2*2 ] = outputTensor[4][cy][cx]
 outSamplesCb[cx/2*2+1][cy/2*2+1] = outputTensor[4][cy][cx]
 outSamplesCr[cx/2*2 ][cy/2*2 ] = outputTensor[5][cy][cx]
 outSamplesCr[cx/2*2+1][cy/2*2+1] = outputTensor[5][cy][cx]
あるいは、以下のように導出してもよい:
for (j=0; j<outSH; j++)
 for (i=0; i<outSW; i++)
  outSamplesCb[cx/outSW*outSW+i][cy/outSH*outSH+j] = outputTensor[4][cy][cx]
  outSamplesCr[cx/outSW*outSW+i][cy/outSH*outSH+j] = outputTensor[5][cy][cx]また、YUV4:2:0形式の場合にはcx = x/2、cy = y/2であるので、NNフィルタ部611はoutSamplesL、outSamplesCb、outSamplesCrを以下で導出してもよい:
 outSamplesL[x/2*2 ][y/2*2 ] = outputTensor[0][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2 ] = outputTensor[1][y/2][x/2]
 outSamplesL[x/2*2 ][y/2*2+1] = outputTensor[2][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2+1] = outputTensor[3][y/2][x/2]
 outSamplesCb[x/outSW][y/outSH] = outputTensor[4][y/2][x/2]
 outSamplesCr[x/outSW][y/outSH] = outputTensor[5][y/2][x/2]
 なお、outSW、outSHを入力データの色差サンプリングと同じに設定し処理してもよい。
 outSW = SW
 outSW = SH
 図20は、テンソルのチャネル数と変換処理の関係を示す図である。
 さらに以下で示すように、NNフィルタ部611は出力テンソルのチャネル数NumOutChannels(numTensors)に応じて以下のようにNN入力データを導出してもよい。
 NumOutChannelsが1の場合、outSamplesLを以下で導出する。
 outSamplesL[x][y] = outputTensor[0][y][x]
 NumOutChannelsが2の場合、outSamplesCb、outSamplesCrを以下で導出する。
 outSamplesCb[cx][cy] = outputTensor[0][cy][cx]
 outSamplesCr[cx][cy] = outputTensor[1][cy][cx]
 NumOutChannelsが3の場合、outSamplesL、outSamplesCb、outSamplesCrを以下で導出する。
 outSamplesL[x][y] = outputTensor[0][y][x]
 outSamplesCb[x/outSW][y/outSH] = outputTensor[1][y][x]
 outSamplesCr[x/outSW][y/outSH] = outputTensor[2][y][x]
またはoutSamplesCb、outSamplesCrを以下で導出してもよい。
 outSamplesCb[cx][cy] = outputTensor[1][cy*outSH][cx*outSW]
 outSamplesCr[cx][cy] = outputTensor[2][cy*outSH][cx*outSW]
 NumOutChannelsが6の場合、outSamplesLとoutSamplesCb、outSamplesCrを以下で導出する。
 outSamplesL[x/2*2 ][y/2*2 ] = outputTensor[0][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2 ] = outputTensor[1][y/2][x/2]
 outSamplesL[x/2*2 ][y/2*2+1] = outputTensor[2][y/2][x/2]
 outSamplesL[x/2*2+1][y/2*2+1] = outputTensor[3][y/2][x/2]
 outSamplesCb[x/outSW][y/outSH] = outputTensor[4][y/2][x/2]
 outSamplesCr[x/outSW][y/outSH] = outputTensor[5][y/2][x/2]
  <第2の実施形態>
 図19は、NNフィルタSEIのシンタックス表の別の実施形態を示す図である。この実施形態では、非特許文献3におけるシンタックス要素nnrpf_io_idcに加えて、シンタックス要素nnrpf_additional_input_idcを用いる。これにより、入出力の種類が増えて組み合わせが増加しても変換方法を柔軟に特定できるという効果を奏する。なお、第1の実施形態と同じ部分の説明は省略する。
 ヘッダ復号部3020は、図19に示すようにnnrpf_mode_idcが1または2である場合(当該SEIが、新規のポストフィルタのデータであることを示す)に、入出力画像情報nnrpf_io_idcおよび追加入力情報nnrpf_additional_info_idcを復号する。
 ヘッダ復号部3020は、nnrpf_io_idcの値に基づいて以下のようにモデルの入力テンソルおよび出力テンソルの形式を導出する。
nnrpf_io_idc==0の場合: numInChannels = numOutChannels = 1
nnrpf_io_idc==1の場合: numInChannels = numOutChannels = 2
nnrpf_io_idc==2の場合: numInChannels = numOutChannels = 3
nnrpf_io_idc==3の場合: numInChannels = numOutChannels = 4
nnrpf_io_idc==4の場合:numInChannels = numOutChannels = 6
 なお、本実施形態では、numInChannelsとnumOutChannelsの値が等しくなるように導出するが、nnrpf_io_idcとnumInChannlesおよびnumOutChannelsの対応付けはこれに限らず、他の組み合わせを用いても構わない。また、nnrpf_io_idcを用いず、チャネル数を直接復号するようにしてもよい。また、numInChannels、numOutChannelsを区別せずに同じ変数numInOutChannels, numTensorsを用いて変換処理を行ってもよい。
 さらに、ヘッダ復号部3020は、nnrpf_additional_info_idcの値に基づいて、入出力に共通な画像コンポーネント以外の入力チャネルの使用を示す変数useSliceQPY、usebSY、usebSCの値を導出する。それぞれ、SliceQPY、bSY、bSCbとbSCrを追加の入力チャネルとして用いるか否かを示すフラグである。本実施形態においては、一つのフラグusebSCで、bSCbとbSCrの両方を制御する。なお、SliceQPYは、ある座標の属するスライスにおける輝度用量子化パラメータである。bSY、bSCb、bSCRは、それぞれ復号画像の輝度、色差(Cb,Cr)チャネルにおいて、ある座標におけるデブロッキングフィルタの強度(block strength)の値を格納する配列である。nnrpf_additional_info_idcからの上記フラグの導出は、例えば次のようにする。
nnrpf_additional_info_idc==0の場合:useSliceQPY = 0, usebSY = 0, usebSC = 0
nnrpf_additional_info_idc==1の場合:useSliceQPY = 1, usebSY = 0, usebSC = 0
nnrpf_additional_info_idc==2の場合:useSliceQPY = 0, usebSY = 1, usebSC = 0
nnrpf_additional_info_idc==3の場合:useSliceQPY = 1, usebSY = 1, usebSC = 0
nnrpf_additional_info_idc==4の場合:useSliceQPY = 0, usebSY = 0, usebSC = 1
nnrpf_additional_info_idc==5の場合:useSliceQPY = 1, usebSY = 0, usebSC = 1
nnrpf_additional_info_idc==6の場合:useSliceQPY = 0, usebSY = 1, usebSC = 1
nnrpf_additional_info_idc==7の場合:useSliceQPY = 1, usebSY = 1, usebSC = 1
 なお、nnrpf_additional_info_idcとuseSliceQPY、usebSY、usebSCの対応付けはこれに限らず、他の組み合わせを用いても構わない。
 または、次のように、nnrpf_additional_indo_idcの各ビットを各フラグに対応させ、演算により導出してもよい。
useSliceQPY = nnrpf_additional_info_idc & 1
usebSY = (nnrpf_additional_info_idc >> 1) & 1
usebSC = (nnrpf_additional_info_idc >> 2) & 1
 または、ヘッダ復号部3020は、nnrpf_additional_indo_idcを符号化せず、フラグuseSliceQPY、usebSY、usebSCを符号化データから復号してもよい。
 なお、フラグの種類は上記に限らず、他の情報についても同様にフラグを導出してよい。例えば、色差のスライス量子化パラメータSliceQPCや、参照画像、予測画像、符号化ブロック単位のQP値を用いてもよい。
 ヘッダ復号部3020はさらに、当該SEIで指定されるモデルの処理単位(パッチ)のサイズ(水平および垂直方向の画素数)-1を示すnnrpf_patch_size_minus1を復号する。このとき、パッチのサイズを表す変数patchSizeは、次の式で導出される。
patchSize = nnrpf_patch_size_minus1 + 1
 さらに、ヘッダ復号部3020は、nnrpf_overlapを復号する。nnrpf_overlapは、パッチに隣接し、パッチとともにモデルに入力される領域の幅を示す。つまり、モデルに入力されるテンソルの高さx幅のサイズは、
(nnrpf_overlap*2+patchSize) x (nnrpf_overlap*2+patchSize)
画素である。
 (NNフィルタ部611の詳細の別の例)
 本実施形態におけるNNフィルタ部611は、STEP1:画像ComponentSampleから入力テンソルinputTensorへの変換、STEP2:inputTensorにニューラルネットワークのフィルタ処理postProcessingFilterを適用しoutputTensorを出力、STEP3:導出したoutputTensorから画像を導出、の3ステップを行う。
 SliceQPYは、ある座標の属するスライスにおける輝度用量子化パラメータqPである。bSY、bSCb、bsCRは、それぞれ復号画像の輝度、色差(Cb,Cr)チャネルにおいて、ある座標におけるデブロッキングフィルタの強度(block Strength, bS)の値を保存する配列である。bSは、デブロッキングフィルタ処理において、ブロックの予測モード、動きベクトル、画素値の差分値などから導出される値であってもよい。
 (疑似コード)
 NNフィルタ部611は、画像の左上座標から所定のパッチサイズ単位でSTEP1、STEP2、STEP3の処理を行ってもよい。次の疑似コードは、パッチ単位での処理の概要である。
for(cTop=0; cTop<PicHeightInLumaSamples; cTop+=patchSize*rH) {
 for(cLeft=0; cLeft<PicWidthInLumaSamples; cLeft+=patchSize*rW) {
  <STEP1:画像および付加情報の入力テンソルへの変換>
  <STEP2:フィルタ処理の適用>
  <STEP3:出力テンソルの画像への変換>
 }
}
ここで、rHおよびrWは、色差サブサンプリングに係るループ変数のインクリメント量を定める変数である。また、rHおよびrWは、テンソルのパッチの画像上でのサイズを導出するための、縦および横方向の倍率である。
 NNフィルタ部611は、色差サブサンプリングを用いて以下のように導出してもよい。
rH = SH
rW = SW
 もしくは、NNフィルタ部611は、テンソルの入力チャネル数を用いて以下のように導出してもよい。
rH = numInChannles==6 ? 2 : 1
rW = (numInChannles==4 || numInChannels==6) ? 2 : 1
 もしくは、NNフィルタ部611は、テンソル内部の色差サブサンプリングと、入力画像の色差サブサンプリングを用いて、例えば以下の式でrWとrHを導出してもよい。
rH = numInChannels==2 ? SH : numInChannles==6 ? 2 : 1
rW = numInChannels==2 ? SW : (numInChannles==4 || numInChannels==6) ? 2 : 1
rH,rWは、パッチサイズ(高さx幅)patchSize x patchSizeのテンソルが、入力の輝度画像上(幅x高さ)ではpatchSize*rW x patchSize*rHの領域に対応することを示す。
以下では、STEP1からSTEP3での処理例を説明する。
  (STEP1)
 NNフィルタ部611は、オーバーラップを含むパッチを導出する。オーバーラップ部分を含めれば、入力データのサイズは縦横 patchSize+nnrpf_overlap*2 x patchSize+nnrpf_overlap*2 画素である。NNフィルタ部611は、入力テンソルにおけるオーバーラップを含む1パッチの各要素を、次の擬似コードのように導出する。
  for (yP= -nnrpf_overlap; yP<patchSize+nnprf_overlap; yP++) {
   for (xP= -nnrpf_overlap; xP<patchSize+nnprf_overlap; xP++) {
    yP1 = yP+nnrpf_overlap
    xP1 = xP+nnrpf_overlap
    yT = Clip3(0, PicHeightInLumaSamples-1, cTop+yP*rH)
    yL = Clip3(0, PicWidthInLumaSamples-1, cLeft+xP*rW)
    yB = Clip3(0, PicHeightInLumaSamples-1, yT+rH-1)
    xR = Clip3(0, PicWidthInLumaSamples-1, yL+rW-1)
    cy = yT/SH
    cx = yL/SW
    <入力テンソルの導出:入力画像の変換>
    <入力テンソルの導出:付加情報の変換>
   }
  }
yPおよびxPは、テンソルの高さ方向(H)と幅方向(W)のループ変数である。yP1およびxP1は、オーバーラップ領域を含む入力テンソルの要素を参照するためにオーバーラップの大きさだけオフセットされた添字である。yT,yL,yB,xRは、処理対象のパッチにおけるyPおよびxPに対応する、輝度コンポーネント上の座標値である。cy,cxは、処理対象のパッチにおけるyPおよびxPに対応する、入力画像の色差コンポーネント上の座標値である。これらの変数は、以下に説明する各処理の途中で必要に応じて導出してもよい。
次に、入力画像の変換処理について説明する。
  (入力画像の変換)
 STEP1のループ内でNNフィルタ部611は、次の疑似コードに示すように、numInChannelsの値に応じて入力画像を変換し、テンソルの座標yP,xPに対応する各チャネルの値を導出する:
    if (numInChannels==1) {
     inputTensor[0][yP1][xP1] = ComponentSamples[0][yT][yL]
     ch_pos = 1
    }
    else if (numInChannels==2) {
     inputTensor[0][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[1][cx][cy]
     inputTensor[1][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[2][cx][cy]
     ch_pos = 2
    }
    else if (numInChannels==3) {
     inputTensor[0][yP1][xP1] = ComponentSamples[0][yT][yL]
     inputTensor[1][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[1][cx][cy]
     inputTensor[2][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[2][cx][cy]
     ch_pos = 3
    }
    else if (numInChannels==4) {
     inputTensor[0][yP1][xP1] = ComponentSamples[0][yL][yT]
     inputTensor[1][yP1][xP1] = ComponentSamples[0][yL][yB]
     inputTensor[2][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[1][cx][cy]
     inputTensor[3][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[2][cx][cy]
     ch_pos = 4
    }
    else if (numInChannels==6) {
     inputTensor[0][yP1][xP1] = ComponentSamples[0][yL][yT]
     inputTensor[1][yP1][xP1] = ComponentSamples[0][xR][yT]
     inputTensor[2][yP1][xP1] = ComponentSamples[0][yL][yB]
     inputTensor[3][yP1][xP1] = ComponentSamples[0][xR][yB]
     inputTensor[4][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[1][cx][cy]
     inputTensor[5][yP1][xP1]
      = ChromaFormatIdc==0 ? ChromaOffset : ComponentSamples[2][cx][cy]
     ch_pos = 6
    }
上記において、ch_pos = numInChannelsで導出してもよい。
 numInChannels==1の場合には、復号画像の輝度コンポーネントから入力テンソルの1チャネルの画像データを導出する。
 numInChannels==2の場合には、復号画像の2つの色差コンポーネントから入力テンソルの2チャネルの画像データを導出する。
 numInChannels==3の場合には、復号画像の輝度コンポーネントおよび色差コンポーネントから、3チャネルで表される4:4:4形式画像データを導出し、入力テンソルに設定する。
 numInChannels==4の場合には、復号画像の輝度コンポーネントおよび色差コンポーネントから、2チャネルの輝度画像と2チャネルの色差画像で表される4:2:2形式画像データを導出し、入力テンソルに設定する。
 numInChannels==6の場合には、復号画像の輝度コンポーネントおよび色差コンポーネントから、4チャネルの輝度画像と2チャネルの色差画像で表される4:2:0形式画像データを導出し、入力テンソルに設定する。
 いずれの場合も、復号画像が色差コンポーネントを持たない(ChromaFormatIdc==0)場合には、NNフィルタ部611は色差チャネルにChromaOffsetを設定する。
また、ch_posは、入力テンソルにおいて次に使用可能なチャネルを示す添字である。入力テンソルにデータを追加する場合には、ch_posの値以降のチャネルを用いるとよい。
  (付加情報の導出)
 次に、NNフィルタ部611は追加入力情報(フラグ)に基づいてinputTensorに付加情報を追加する。たとえば、useSliceQPYが真であれば、inputTensorの次のチャネル(inputTensor[ch_pos])に、SliceQPYの値を設定する。なお、チャネルに値を設定した場合、ch_posの値を使用したチャネル数に応じて増加させる。次に、usebSYが真であれば、inputTensorの次のチャネルに、パッチの領域に対応する位置のbSYの値を設定する。さらに、usebSCが真で復号画像が色差コンポーネントを持っていれば、inputTensorの次のチャネルに、パッチの領域に対応する位置のbSCbおよびbSCrの値を設定する。このとき、NNフィルタ部611は、SliceQPY、bSY、bSCb、bSCrの値をそのまま設定してもよいし、変換を施した値を設定してもよい。以下に、付加情報のチャネルの導出例を示す:
    if (useSliceQPY) {
     inputTensor[ch_pos][yP1][xP1] = 2^((SliceQPY-42)/6)
     ch_pos += 1
    }
    if (usebSY) {
     inputTensor[ch_pos][yP1][xP1] = Clip3(0,(1<<BitDepthY)-1, bSY[yL][yT]<<(BitDepthY-2))
     ch_pos += 1
    }
    if (usebSC && InputChromaFormatIdc!=0) {
     inputTensor[ch_pos][yP1][xP1] = Clip3(0, (1<<BitDepthC)-1, bSCb[cx][cy] << (BitDepthC-2))
     ch_pos += 1
     inputTensor[ch_pos][yP1][xP1] = Clip3(0, (1<<BitDepthC)-1, bSCr[cx][cy] << (BitDepthC-2))
     ch_pos += 1
    }
 上記以外の付加情報として、NNフィルタ部611が入力画像とは異なる第2の画像を入力テンソルに追加する例を示す。以下の例は、フラグuseRefPicYを用いて参照画像refPicYのチャネルを追加する場合の処理である:
    if (useRefPicY) {
     inputTensor[ch_pos][yP1][xP1] = refPicY[yL][yT]
     ch_pos += 1
    }
 フラグuseRefPicYはuseSliceQPYなど他の付加情報のフラグと同様に、nnrpf_additional_info_idcから導出してもよいし、符号化データから復号してもよい。
また、参照画像以外にも、1フレーム分の予測画像predPicYのチャネルを追加する場合も同様である:
    if (usePredPicY) {
     inputTensor[ch_pos][yP1][xP1] = predPicY[yL][yT]
     ch_pos += 1
    }
なお、付加情報のポストフィルタへの与え方は上記に限らない。inputTensorとは別のパラメータとして導出してポストフィルタ処理に入力してもよい。
  (STEP2)
 STEP2では、NNフィルタ部611は、導出したinputTensorを入力としてポストフィルタ処理を実行し、フィルタ処理の結果である出力テンソルoutputTensorを取得する:
  outputTensor = postProcessingFilter(inputTensor)
本実施形態においては、出力テンソルoutputTensorの高さ方向(H)×幅方向(W)のサイズは、patchSize x patchSizeであり、オーバーラップ領域は含まないものとする。ただし、これに限らず、オーバーラップ領域を含む出力テンソルをpatchSize x patchSizeのサイズにクロップして用いても構わない。
  (STEP3)
 STEP3では、NNフィルタ部611は、出力テンソルoutputTensorから画像データを導出する。NNフィルタ部611は、出力画像のコンポーネントoutSamplesL、outSamplesCb、outSamplesCrの各画素値を、出力テンソルoutputTensorのデータから導出する。このとき、次の擬似コードで示すように、出力テンソルのチャネル数(データ形式)と出力画像の色差サブサンプリングに基づいて画像データの導出を行う。以下に示す擬似コードは、STEP3の処理例である:
  for(yP=0, ySrc=cTop; yP<patchSize; yP++, ySrc+=rH)
   for(xP=0, xSrc=cLeft; xP<patchSize; xP++, xSrc+=rW) {
    if (numOutChannels==1) {  // rW=1, rH=1 
     if (pfp_component_idc!=1) {
      outSamplesL[xSrc][ySrc] = outputTensor[0][yP][xP]
     } else {
      outSamplesL[xSrc][ySrc] = ComponentSamples[0][xSrc][ySrc]
     }
     if (OutputChromaFormatIdc!=0 && pfp_component_idc!=0) {
      cyOut = ySrc/outSH
      cxOut = xSrc/outSW
      outSamplesCb[cxOut][cyOut] = ComponentSamples[1][ySrc/SH][xSrc/SW] 
      outSamplesCr[cxOut][cyOut] = ComponentSamples[2][ySrc/SH][xSrc/SW]
     }
    }
    else if (numOutChannels==2) {  // rW=SW,rH=SH
     for (dy=0; dy<rH, dy++) {
      for (dx=0; dx<rW, dx++) {
       outSamplesL[ySrc+dy][xSrc+dx] = ComponentSamples[0][ySrc+dy][xSrc+dx]
       if (OutputChromaFormatIdc!=0) {
        cyOut = (ySrc+dy)/outSH
        cxOut = (xSrc+dx)/outSW
        if (pfp_component_idc!=0) {
         outSamplesCb[cxOut][cyOut] = outputTensor[0][yP][xP]
         outSamplesCr[cxOut][cyOut] = outputTensor[1][yP][xP]
        } else {
         outSamplesCb[cxOut][cyOut] = ComponentSamples[1][(ySrc+dy)/SH][ (xSrc+dx)/SW ] 
         outSamplesCr[cxOut][cyOut] = ComponentSamples[2][(ySrc+dy)/SH][ (xSrc+dx)/SW ]
        }
       }
      }
     }
    }
    else if (numOutChannels==3) {  // rW=1, rH=1
     if (pfp_component_idc!=1) {
      outSamplesL[xSrc][ySrc] = outputTensor[0][yP][xP]
     } else {
      outSamplesL[xSrc][ySrc] = ComponentSamples[0][xSrc][ySrc]
     }
     if (OutputChromaFormatIdc!=0) {
      cyOut = ySrc/outSH
      cxOut = xSrc/outSW
      if (pfp_component_idc!=0) {
       outSamplesCb[cxOut][cyOut] = outputTensor[1][yP][xP]
       outSamplesCr[cxOut][cyOut] = outputTensor[2][yP][xP]
      } else {
       outSamplesCb[cxOut][cyOut] = ComponentSamples[1][xSrc/SW][ySrc/SH]
       outSamplesCr[cxOut][cyOut] = ComponentSamples[2][xSrc/SW][ySrc/SH]
      }
     }
    }
    else if (numOutChannels==4) {  // rW=2, rH=1
     if (pfp_component_idc!=1) {
      outSamplesL[xSrc ][ ySrc ] = outputTensor[0][yP][xP]
      outSamplesL[xSrc+1][ ySrc ] = outputTensor[1][yP][xP]
     } else {
      outSamplesL[xSrc ][ ySrc ] = ComponentSamples[0][xSrc ][ ySrc ]
      outSamplesL[xSrc+1][ ySrc ] = ComponentSamples[0][xSrc+1][ ySrc ]
     }
     if (OutputChromaFormatIdc!=0) {
      for (dx=0; dx<rW; dx++) {
       cyOut = (ySrc+dy)/outSH
       cxOut = (xSrc+dx)/outSW
       if (pfp_component_idc!=0) {
        outSamplesCb[cxOut][cyOut] = outputTensor[2][yP][xP]
        outSamplesCr[cxOut][cyOut] = outputTensor[3][yP][xP]
       } else {
        outSamplesCb[cxOut][cyOut] = ComponentSamples[1][(xSrc+dx)/SW] [(ySrc+dy)/SH]
        outSamplesCr[cxOut][cyOut] = ComponentSamples[2][(xSrc+dx)/SW] [(ySrc+dy)/SH]
       }
      }
     }
    }
    else if (numOutChannels==6) {  // rW=2, rH=2
     if (pfp_component_idc!=1) {
      outSamplesL[xSrc ][ySrc ] = outputTensor[0][yP][xP]
      outSamplesL[xSrc+1][ySrc ] = outputTensor[1][yP][xP]
      outSamplesL[xSrc ][ySrc+1] = outputTensor[2][yP][xP] 
      outSamplesL[xSrc+1][ySrc+1] = outputTensor[3][yP][xP]
     } else {
      outSamplesL[xSrc ][ySrc ] = ComponentSamples[0][xSrc ][ySrc ]
      outSamplesL[xSrc+1][ySrc ] = ComponentSamples[0][xSrc+1][ySrc ]
      outSamplesL[xSrc ][ySrc+1] = ComponentSamples[0][xSrc ][ySrc+1]
      outSamplesL[xSrc+1][ySrc+1] = ComponentSamples[0][xSrc+1][ySrc+1]
     }
     if (OutputChromaFormatIdc!=0) {
      for (dy=0; dy<rH; dy++) {
       for (dx=0; dx<rW; dx++) {
        cyOut = (ySrc+dy)/outSH
        cxOut = (xSrc+dx)/outSW
        if (pfp_component_idc!=0) {
         outSamplesCb[cxOut][cyOut] = outputTensor[4][yP][xP]
         outSamplesCr[cxOut][cyOut] = outputTensor[5][yP][xP]
        } else {
         outSamplesCb[cxOut][cyOut] = ComponentSamples[1][(xSrc+dx)/SW] [(ySrc+dy)/SH] 
         outSamplesCr[cxOut][cyOut] = ComponentSamples[2][(xSrc+dx)/SW] [(ySrc+dy)/SH]
        }
       }
      }
     }
    }
   }
  }
 numOutChannelsが1の場合、NNフィルタ部611はoutputTensorの1チャネルを用いて出力画像の輝度コンポーネントを導出する。出力画像が色差コンポーネントを含む場合、NNフィルタ部611は入力画像の色差コンポーネントをコピーして用いる。
 numOutChannelsが2の場合、NNフィルタ部611はoutputTensorの2チャネルを用いて出力画像の2つの色差コンポーネントを導出する。また、NNフィルタ部611は、入力画像の輝度コンポーネントを出力画像の輝度コンポーネントとして用いる。
 numOutChannelsが3の場合、NNフィルタ部611はoutputTensorを出力画像の輝度コンポーネントと2つの色差コンポーネントを導出する。
 numOutChannelsが4の場合、NNフィルタ部611は、outputTensorのある2チャネルを用いて出力画像の輝度コンポーネントを導出し、他の2チャネルを用いて2つの色差コンポーネントを導出する。
 numOutChannelsが6の場合、NNフィルタ部611は、outputTensorのある4チャネルを用いて出力画像の輝度コンポーネントを導出し、他の2チャネルを用いて2つの色差コンポーネントを導出する。
 numOutChannelsがいずれの場合も、出力画像が色差コンポーネントを持たない場合は出力テンソルの色差チャネルは処理しない。また、numOutChannelsが2以上で色差チャネルを含む場合、出力画像の色差サブサンプリングから導出される値outSH、outSWを用いて、出力画像の色差コンポーネント形式に適合するよう変換する。numOutChannelsが2の場合には、入力画像の色差サブサンプリングから導出される値SH(SubHightC)、SW(SubWidthC)も参照し、出力画像の色差コンポーネント形式に適合するよう変換する。
 さらに、numOutChannelsが2以外でpfp_component_idcが1である場合には、出力画像の輝度コンポーネントを出力テンソルによって更新せず入力画像の輝度コンポーネントを用いる。同様にnumOutChannelsが1以外でpfp_component_idcが0である場合には、出力画像の色差コンポーネントを出力テンソルによって更新せず入力画像の色差コンポーネントを用いる。
 このように、NNフィルタ部611は、出力テンソルのチャネル数と出力画像の色差サブサンプリングに基づいて、出力画像の各コンポーネントの画素値を導出する。NNフィルタ部611は、yP、xPで表される出力テンソルの1画素に対応する出力画像上のrW*rH画素を導出する。これは上記疑似コード中のnumOutChannelsが2または6の場合のようにループ(dy,dx)で処理してもよいし、他の場合のようにループを省略あるいは展開してもよい。あるいは、常にdy、dxともに2回ずつループするようにしてもよい。
 また、上記の例では、NNフィルタ部611が出力画像の同じ色差座標について複数回の導出を行うことがありえるが、座標が重複する場合には2回目以降の導出は省略しても構わない。
 さらに、上記の例ではcTop、cLeftは画像上の座標値としてそれぞれpatchSize*rH、patchSize*rWずつインクリメントするように構成したが、これに限らない。入力画像の色差サブサンプリングを用いてそれぞれpatchSize*SH、patchSize*SWずつインクリメントするようなループとして構成してもよいし、常に1あるいは2ずつインクリメントするようなループとしてもよい。同様にySrc、xSrcは画像上の座標値として、それぞれrH、rWずつインクリメントするように構成したが、これに限らない。入力画像の色差サブサンプリングを用いてそれぞれSH、SWずつインクリメントするようなループや、出力画像の色差サブサンプリングを用いてそれぞれoutSH、outSWずつインクリメントするようなループとして構成してもよいし、常に1ずつインクリメントするようなループとしてもよい。
 上記のように予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、ニューラルネットワークモデルの入出力テンソルのチャネル数を指定する入出力画像情報と、追加入力情報を復号し、上記入出力画像情報を用いて第1の画像から入力テンソルの一部を導出し、さらに、上記追加入力情報を用いて、第1のとは別の第2の画像もしくは、上記予測画像導出もしくは残差の復号に関わる符号化情報を用いて上記入力テンソルの別の一部を導出することによって、入力画像の性質や特徴をより詳細にニューラルネットワークモデルに伝達しフィルタリング効果を高められるという効果を奏する。
 さらに上記のように色差サブサンプリングのパラメータを用いてループ変数の加算値を変更して、ラスタスキャン状にループ処理を行い、上記ループ内で、画像から入力テンソルを導出し、入力テンソルに対して深層学習フィルタを適用して、出力テンソルを導出することによって、異なる色サンプリングの場合にも同一の処理で入力テンソルを導出できるという効果を奏する。
  (まとめ)
 本願は、ニューラルネットワークモデルの入力テンソルのチャネルと色コンポーネントとの対応関係を指定する入力テンソル識別パラメータを含む符号化データを復号する構成でもよい。
 また本願は、入力テンソル識別パラメータと入力画像の色差サブサンプリングに応じて、入力画像から入力テンソルを導出する関係式が定義される構成でもよい。
 また本願の入力テンソル識別パラメータは、1チャネル、2チャネル、3チャネル、6チャネルのいずれかを指定することを含む構成でもよい。
 また本願は、入力テンソル識別パラメータに応じて、入力画像から入力テンソルを導出する手段を含む構成でもよい。
 本願は、ニューラルネットワークモデルの出力テンソルのチャネルと色コンポーネントとの対応関係を指定する出力テンソル識別パラメータを含む符号化データを復号する構成でもよい。
 本願は、出力テンソル識別パラメータと出力画像の色差サブサンプリングに応じて、出力テンソルから出力画像を導出する関係式が定義される構成でもよい。
 本願の出力テンソル識別パラメータは、1チャネル、2チャネル、3チャネル、6チャネルのいずれかを指定することを含むことを構成でもよい。
 本願は、出力テンソル識別パラメータに応じて、出力テンソルから出力画像を導出する手段を含むことを構成でもよい。
 このように本SEIはNNフィルタへの入力データ形式およびNNフィルタの出力データ形式の情報を含む。これにより、復号画像をNNフィルタの入力データに適切に変換する方法や、NNフィルタの出力データを出力画像に適切に変換する方法を、モデルの読み込みおよび解析をすることなく容易に選択できるという効果を奏する。
 (入力テンソル識別パラメータ、出力テンソルパラメータを導出する構成)
 なお、NNフィルタ部611は入力テンソル識別パラメータ、出力テンソル識別パラメータを付加データから復号するのではなく、符号化データから復号、もしくは、URIなどにより識別されたNNモデルのトポロジーから導出してよい。
 NNフィルタ部611は、NNモデルの入力データinputTensorのチャネル数NumInChannelsに応じて以下のようにnnrpf_input_format_idcを導出する。
1チャネルの場合、nnrpf_input_format_idc=0
2チャネルの場合、nnrpf_input_format_idc=1
3チャネルの場合、nnrpf_input_format_idc=2
6チャネルの場合、nnrpf_input_format_idc=3
 NNフィルタ部611は、NNモデルの出力データoutputTensorのチャネル数NumOutChannelsに応じて以下のようにnnrpf_output_format_idcを導出する。
1チャネルの場合、nnrpf_output_format_idc=0
2チャネルの場合、nnrpf_output_format_idc=1
3チャネルの場合、nnrpf_output_format_idc=2
6チャネルの場合、nnrpf_output_format_idc=3
 上記の構成によれば、NNフィルタ部611は、符号化データで伝送もしくは指定されたNNモデルの入力データ、出力データの次元数を解析し、その解析結果(入力テンソル識別パラメータ、出力テンソル識別パラメータ)に応じて、入力画像から入力テンソルへの変換、出力テンソルから出力画像への変換を行う。これにより、NNモデル自体では指定されていない色コンポーネントとチャネルとの関係を特定し、NN入力データを準備し、NN出力データから出力画像を得ることができる効果がある。なお、本SEIに前記ニューラルネットワークモデル複雑度の情報を含めてもよい。
 (画像符号化装置の構成)
 次に、本実施形態に係る画像符号化装置11の構成について説明する。図6は、本実施形態に係る画像符号化装置11の構成を示すブロック図である。画像符号化装置11は、予測画像生成部101、減算部102、変換・量子化部103、逆量子化・逆変換部105、加算部106、ループフィルタ107、予測パラメータメモリ(予測パラメータ記憶部、フレームメモリ)108、参照ピクチャメモリ(参照画像記憶部、フレームメモリ)109、符号化パラメータ決定部110、パラメータ符号化部111、予測パラメータ導出部120、エントロピー符号化部104を含んで構成される。
 予測画像生成部101はCU毎に予測画像を生成する。予測画像生成部101は既に説明したインター予測画像生成部309とイントラ予測画像生成部310を含んでおり、説明を省略する。
 減算部102は、予測画像生成部101から入力されたブロックの予測画像の画素値を、画像Tの画素値から減算して予測誤差を生成する。減算部102は予測誤差を変換・量子化部103に出力する。
 変換・量子化部103は、減算部102から入力された予測誤差に対し、周波数変換によって変換係数を算出し、量子化によって量子化変換係数を導出する。変換・量子化部103は、量子化変換係数をパラメータ符号化部111及び逆量子化・逆変換部105に出力する。
 逆量子化・逆変換部105は、画像復号装置31における逆量子化・逆変換部311(図4)と同じであり、説明を省略する。算出した予測誤差は加算部106に出力される。
 パラメータ符号化部111は、ヘッダ符号化部1110、CT情報符号化部1111、CU符号化部1112(予測モード符号化部)を備えている。CU符号化部1112はさらにTU符号化部1114を備えている。以下、各モジュールの概略動作を説明する。
 ヘッダ符号化部1110はヘッダ情報、分割情報、予測情報、量子化変換係数等のパラメータの符号化処理を行う。
 CT情報符号化部1111は、QT、MT(BT、TT)分割情報等を符号化する。
 CU符号化部1112はCU情報、予測情報、分割情報等を符号化する。
 TU符号化部1114は、TUに予測誤差が含まれている場合に、QP更新情報と量子化予測誤差を符号化する。
 CT情報符号化部1111、CU符号化部1112は、インター予測パラメータ、イントラ予測パラメータ、量子化変換係数等のシンタックス要素をパラメータ符号化部111に供給する。
 エントロピー符号化部104には、パラメータ符号化部111から量子化変換係数と符号化パラメータ(分割情報、予測パラメータ)が入力される。エントロピー符号化部104はこれらをエントロピー符号化して符号化データTeを生成し、出力する。
 予測パラメータ導出部120は、インター予測パラメータ符号化部112、イントラ予測パラメータ符号化部113を含む手段であり、符号化パラメータ決定部110から入力されたパラメータからイントラ予測パラメータ及びイントラ予測パラメータを導出する。導出されたイントラ予測パラメータ及びインター予測パラメータは、パラメータ符号化部111に出力される。
 加算部106は、予測画像生成部101から入力された予測ブロックの画素値と逆量子化・逆変換部105から入力された予測誤差を画素毎に加算して復号画像を生成する。加算部106は生成した復号画像を参照ピクチャメモリ109に記憶する。
 ループフィルタ107は加算部106が生成した復号画像に対し、デブロッキングフィルタ、SAO、ALFを施す。なお、ループフィルタ107は、必ずしも上記3種類のフィルタを含まなくてもよく、例えばデブロッキングフィルタのみの構成であってもよい。
 予測パラメータメモリ108は、符号化パラメータ決定部110が生成した予測パラメータを、対象ピクチャ及びCU毎に予め定めた位置に記憶する。
 参照ピクチャメモリ109は、ループフィルタ107が生成した復号画像を対象ピクチャ及びCU毎に予め定めた位置に記憶する。
 符号化パラメータ決定部110は、符号化パラメータの複数のセットのうち、1つのセットを選択する。符号化パラメータとは、上述したQT、BTあるいはTT分割情報、予測パラメータ、あるいはこれらに関連して生成される符号化の対象となるパラメータである。予測画像生成部101は、これらの符号化パラメータを用いて予測画像を生成する。
 符号化パラメータ決定部110は、複数のセットの各々について情報量の大きさと符号化誤差を示すRDコスト値を算出する。RDコスト値は、例えば、符号量と二乗誤差に係数λを乗じた値との和である。符号量は、量子化誤差と符号化パラメータをエントロピー符号化して得られる符号化データTeの情報量である。二乗誤差は、減算部102において算出された予測誤差の二乗和である。係数λは、予め設定されたゼロよりも大きい実数である。符号化パラメータ決定部110は、算出したコスト値が最小となる符号化パラメータのセットを選択する。符号化パラメータ決定部110は決定した符号化パラメータをパラメータ符号化部111と予測パラメータ導出部120に出力する。
 なお、上述した実施形態における画像符号化装置11、画像復号装置31の一部、例えば、エントロピー復号部301、パラメータ復号部302、ループフィルタ305、予測画像生成部308、逆量子化・逆変換部311、加算部312、予測パラメータ導出部320、予測画像生成部101、減算部102、変換・量子化部103、エントロピー符号化部104、逆量子化・逆変換部105、ループフィルタ107、符号化パラメータ決定部110、パラメータ符号化部111、予測パラメータ導出部120をコンピュータで実現するようにしても良い。その場合、この制御機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって実現しても良い。なお、ここでいう「コンピュータシステム」とは、画像符号化装置11、画像復号装置31のいずれかに内蔵されたコンピュータシステムであって、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。
 また、上述した実施形態における画像符号化装置11、画像復号装置31の一部、または全部を、LSI(Large Scale Integration)等の集積回路として実現しても良い。画像符号化装置11、画像復号装置31の各機能ブロックは個別にプロセッサ化しても良いし、一部、または全部を集積してプロセッサ化しても良い。また、集積回路化の手法はLSIに限らず専用回路、または汎用プロセッサで実現しても良い。また、半導体技術の進歩によりLSIに代替する集積回路化の技術が出現した場合、当該技術による集積回路を用いても良い。
 以上、図面を参照してこの発明の一実施形態について詳しく説明してきたが、具体的な構成は上述のものに限られることはなく、この発明の要旨を逸脱しない範囲内において様々な設計変更等をすることが可能である。
  (NNR)
 Neural Network Coding and Representation(NNR)は、ニューラルネットワーク(NN)を効率的に圧縮するための国際標準規格である。学習済みのNNの圧縮を行うことで、NNを保存や伝送を行う際の効率化が可能となる。
 以下にNNRの符号化・復号処理の概要について説明する。
 図13は、NNRの符号化装置・復号装置について示す図である。
 NN符号化装置801は、前処理部8011、量子化部8012、エントロピー符号化部8013を有する。NN符号化装置801は、圧縮前のNNモデルOを入力し、量子化部8012にてNNモデルOの量子化を行い、量子化モデルQを求める。NN符号化装置801は、量子化前に、前処理部8011にて枝刈り(プルーニング)やスパース化などのパラメータ削減手法を繰り返し適用してもよい。その後、エントロピー符号化部8013にて、量子化モデルQにエントロピー符号化を適用し、NNモデルの保存、伝送のためのビットストリームSを求める。
 NN復号装置802は、エントロピー復号部8021、パラメータ復元部8022、後処理部8023を有する。NN復号装置802は、始めに伝送されたビットストリームSを入力し、エントロピー復号部8021にて、Sのエントロピー復号を行い、中間モデルRQを求める。NNモデルの動作環境がRQで使用された量子化表現を用いた推論をサポートしている場合、RQを出力し、推論に使用してもよい。そうでない場合、パラメータ復元部8022にてRQのパラメータを元の表現に復元し、中間モデルRPを求める。使用する疎なテンソル表現がNNモデルの動作環境で処理できる場合、RPを出力し、推論に使用してもよい。そうでない場合、NNモデルOと異なるテンソル、または構造表現を含まない再構成NNモデルRを求め、出力する。
 NNR規格には、整数、浮動小数点など、特定のNNパラメータの数値表現に対する復号手法が存在する。
 復号手法NNR_PT_INTは、整数値のパラメータからなるモデルを復号する。復号手法NNR_PT_FLOATは、NNR_PT_INTを拡張し、量子化ステップサイズdeltaを追加する。このdeltaに上記整数値を乗算し、スケーリングされた整数を生成する。deltaは、整数の量子化パラメータqpとdeltaの粒度パラメータqp_densityから、以下のように導き出される。
  mul = 2^(qp_density) + (qp & (2^(qp_density)-1))
  delta = mul * 2^((qp >> qp_density)-qp_density)
  (学習済みNNのフォーマット)
 学習済みNNの表現は、層のサイズや層間の接続などのトポロジー表現と、重みやバイアスなどのパラメータ表現の2つの要素からなる。
 トポロジー表現は、TensorflowやPyTorchなどのネイティブフォーマットでカバーされているが、相互運用性向上のため、Open Neural Network Exchange Format(ONNX)、Neural Network Exchange Format(NNEF)などの交換フォーマットが存在する。
 また、NNR規格では、圧縮されたパラメータテンソルを含むNNRビットストリームの一部として、トポロジー情報nnr_topology_unit_payloadを伝送する。これにより、交換フォーマットだけでなく、ネイティブフォーマットで表現されたトポロジー情報との相互運用を実現する。
 (ポストフィルタ目的SEI)
 ポストフィルタ目的SEIは、ポストフィルタ処理の目的を示し、ポストフィルタ処理の目的に応じた入出力の情報を記述する。図11は、このSEIのシンタックスの例を示している。
 まず、このSEIの入力として、入力画像のInputChromaFormatIdc (ChromaFormatIdc)を定義する。この値には、符号化データのsps_chroma_format_idcの値が代入される。
 pfp_idの値は、他のメカニズムで指定されたポストフィルタ処理の識別番号を示す。本実施の形態では、NNフィルタSEIと紐付けられる。このSEIメッセージは、現在の階層において、新しいCLVS(Coded Layer Video Sequence)が開始されるか、ビットストリームが終了するまで、現在の復号画像と後続のすべての復号画像に出力順に適用される。
 pfp_idには、ポストフィルタ処理を識別するために使用される識別番号が含まれる。識別番号は、0から2^20-1の値をとるものとし、2^20から2^21-1の値は将来のために予約する。
 pfp_purposeは、pfp_idによって識別されるポストフィルタ処理の目的を示す。pfp_purposeの値は、0から2^32-2の範囲である。それ以外のpfp_purposeの値は、将来の指定のために予約する。尚、付加情報の復号器は、pfp_purposeの予約値を含むpost_filter_purpose SEIメッセージを無視する。
 pfp_purposeの値0は、視覚的な品質の向上を示す。つまり、画像の解像度変換を伴わない画像復元処理を行うポストフィルタ処理が適用されることを意味する。
 pfp_purposeの値1は、トリミングされた出力画像の幅または高さを指定する。つまり画像の解像度の変換を伴うポストフィルタ処理が適用されることを意味する。
 pfp_purposeの値が1の場合、pfp_pic_width_in_luma_samplesとpfp_pic_height_in_luma_samplesというシンタックス要素が存在する。
 pfp_pic_width_in_luma_samplesは、トリミングされた出力画像にpfp_idで識別されるポスト処理フィルタを適用した結果の画像の、輝度画素配列の幅を指定する。
 pfp_pic_height_in_luma_samplesは、トリミングされた出力画像にpfp_idで識別されるポスト処理フィルタを適用した結果の画像の輝度画素配列の高さを指定する。
 非特許文献1及び非特許文献2の例では、色差フォーマット変換に伴う解像度変換及び逆変換の情報をうまく記述することができなかった。本実施の形態では、入出力の情報を明確化することで、上記の課題を解決する。
 pfp_purposeの値が2の場合は、ポストフィルタ処理が適用される色コンポーネントと、出力画像の色差フォーマットの情報を示すシンタックス要素が存在する。つまり、色差フォーマット変換に関するポストフィルタ処理が適用されることを意味する。
 pfp_purposeの値が2の場合、シンタックス要素pfp_component_idcと、pfp_output_diff_chroma_format_idcが存在する。
 pfp_component_idcは、ポストフィルタ処理を適用する色コンポーネントを指定する。
 pfp_component_idcの値0は、輝度コンポーネントのみにポストフィルタ処理を適用することを示す。
 pfp_component_idcの値1は、2つの色差コンポーネントにポストフィルタ処理を適用することを示す。
 pfp_component_idcの値2は、3つの全ての色コンポーネントにポストフィルタ処理を適用することを示す。
 シンタックス要素pfp_component_idcが存在しない場合は、pfp_component_idcの値は2として推定する。
 pfp_output_diff_chroma_format_idcは、フィルタ更新情報であり、ポストフィルタ処理が出力する色差フォーマットの識別値と入力の色差フォーマットの識別値の差分値を示す。尚、pfp_output_diff_chroma_format_idcの値は、0から2の範囲の値でなければならない。そして、ポストフィルタ処理の出力する色差フォーマットの識別値である変数OutputChromaFormatIdcは、次のように導出される。
 OutputChromaFormatIdc = InputChromaFormatIdc + pfp_output_diff_chroma_format_idc
 ここで、InputChromaFormatIdcは、符号化データのSPSで記述されている
sps_chroma_format_idcの値で、復号画像の色差フォーマットの識別値である。値0がモノクロ(4:0:0)で、値1が4:2:0で、値2が4:2:2で、値3が4:4:4を示している。ポストフィルタ処理の出力する色差フォーマットの識別値である変数OutputChromaFormatIdcは、InputChromaFormatIdcと同様に、値0がモノクロ(4:0:0)で、値1が4:2:0で、値2が4:2:2で、値3が4:4:4を示す。
 なお、本実施の形態では、OutputChromaFormatIdcを導出するために、出力する色差フォーマットの識別値と入力の色差フォーマットの識別値の差分値を用いて、OutputChromaFormatIdcの値がInputChromaFormatIdcの値と同じか、それ以上になるように設定したが、差分値を用いずに、直接OutputChromaFormatIdcをシンタクス要素としてもよい。この場合、OutputChromaFormatIdcの値は、InputChromaFormatIdcの値と独立に定義することができるという利点がある。この場合、シンタクス要素OutputChromaFormatIdcが存在しない場合は、InputChromaFormatIdcの値と同じと推定する。
 NNフィルタ部611は、更新情報php_output_diff_chroma_format_idcが符号化データ中に存在しない場合にはphp_output_diff_chroma_format_idcを0と推定する。これにより、NNフィルタ部611は、php_output_diff_chroma_format_idcが符号化データ中に存在しない場合には、以下のように設定してもよい。
OutputChromaFormatIdc = ChromaFormatIdc
 上記のように予測画像を復号する予測画像導出部と、残差を復号する残差復号部を備える動画像復号装置であって、上記ヘッダ復号部3020は、フィルタ更新情報がない場合には、色差サブサンプリングに関する出力の色差フォーマットを入力の色差フォーマットで推定することにより、フィルタ更新情報が指定されない場合にも的確なフィルタ処理による更新が可能という効果を奏する。
 NNフィルタ部611は、出力画像の色差サブサンプリングを示す変数を以下のように導出する。
 outSubWidthC = outSW = 1, outSubHeightC = outSH = 1 (OutputChromaFormatIdc == 0)
 outSubWidthC = outSW = 2, outSubHeightC = outSH = 2 (OutputChromaFormatIdc == 1)
 outSubWidthC = outSW = 2, outSubHeightC = outSH = 1 (OutputChromaFormatIdc == 2)
 outSubWidthC = outSW = 1, outSubHeightC = outSH = 1 (OutputChromaFormatIdc == 3)
 このように、色差フォーマット変換のポストフィルタ処理の入力コンポーネントと出力フォーマットを定義することで、色差フォーマット変換のポストフィルタ処理の入出力のデータを明確化できる。
 尚、上記のポストフィルタ処理を適用する色コンポーネントを指定するpfp_component_idcは輝度と色差を区別したが、単にコンポーネント数を示すようにしてもよい。具体的には、次のようなセマンティクスにしてもよい。
 pfp_component_idcの値0は、1つのコンポーネントのポストフィルタ処理を適用することを示す。
 pfp_component_idcの値1は、2つのコンポーネントにポストフィルタ処理を適用することを示す。
 pfp_component_idcの値2は、3つの全てのコンポーネントにポストフィルタ処理を適用することを示す。
 NNフィルタ部611は、pfp_component_idcに応じて、NNモデルを切り替えてもよい。
 pfp_component_idc==0の場合:NNフィルタ部611は、1チャネルの3次元テンソルから1チャネルの3次元テンソルを導出するNNモデルを選択し、フィルタ処理を行う。
 pfp_component_idc==1の場合:NNフィルタ部611は、2チャネルの3次元テンソルから2チャネルの3次元テンソルを導出するNNモデルを選択し、フィルタ処理を行う。
 pfp_component_idc==2の場合:NNフィルタ部611は、3チャネルの3次元テンソルから3チャネルの3次元テンソルを導出するNNモデルを選択し、フィルタ処理を行う。
 以上により、適用する色コンポーネントに応じて適切なNNモデルを選択するため処理量を削減する効果がある。
 NNフィルタ部611は、pfp_component_idcに応じて、1コンポーネントなら1チャネル、2コンポーネントなら2チャネル、3コンポーネントなら3チャネルのNNモデルとなるようにnnrpf_input_format_idcを次のように導出してもよい。
nnrpf_input_format_idc = 0 (pfp_component_idc==0)
nnrpf_input_format_idc = 1 (pfp_component_idc==1)
nnrpf_input_format_idc = 2 (pfp_component_idc==2)
つまり、nnrpf_input_format_idc = pfp_component_idc
 別の例としてNNフィルタ部611は、pfp_component_idcに応じて、1コンポーネントなら1チャネル、2コンポーネントなら2チャネル、3コンポーネントなら6チャネルのNNモデルとなるようにnnrpf_input_format_idcを次のように導出してもよい。
nnrpf_input_format_idc = 0 (pfp_component_idc==0)
nnrpf_input_format_idc = 1 (pfp_component_idc==1)
nnrpf_input_format_idc = 3 (pfp_component_idc==2)
つまり、nnrpf_input_format_idc = pfp_component_idc < 2 ? pfp_component_idc : 3
 以上により、適用する色コンポーネントに応じて適切なNNモデルのテンソル形式を選択して処理を行うことができるという効果がある。
 NNフィルタ部611は、上述のようにpfp_component_idcに応じて、直接inputTensorを導出してもよい。あるいは、NNフィルタ部611は、pfp_component_idcに応じて、入力画像ComponentSampleの値と、NN出力データoutTensorの値を切り替えて以下の処理で出力画像を導出してもよい。
pfp_component_idc==0の場合
 outSamplesL[x][y] = outTensor[0][y][x]
 outSamplesCb[x*2/outSW][y*2/outSH] = ComponentSample[1][x*2/SW][y*2/SH]
 outSamplesCr[x*2/outSW][y*2/outSH] = ComponentSample[2][x*2/SW][y*2/SH]
pfp_component_idc==1の場合
 outSamplesL[x][y] = ComponentSample[0][x][y]
 outSamplesCb[x*2/outSW][y*2/outSH] = outTensor [0][x*2/SW][y*2/SH]
 outSamplesCr[x*2/outSW][y*2/outSH] = outTensor [1][x*2/SW][y*2/SH]
pfp_component_idc==2の場合
 outSamplesL[x][y] = outTensor[0][x][y]
 outSamplesCb[x*2/outSW][y*2/outSH] = outTensor[1][x*2/SW][y*2/SH]
 outSamplesCr[x*2/outSW][y*2/outSH] = outTensor[2][x*2/SW][y*2/SH]
 また、上記の例では、ポストフィルタ処理の出力する色差フォーマットの識別値を入力の色差フォーマットの識別値との差分値で示したが、シンタックス要素で直接記述してもよい。
 本実施の形態では、NNポストフィルタSEIと独立にポストフィルタ目的SEIを定義して、ポストフィルタ処理の入出力を定義したが、NNポストフィルタSEIに同様のシンタックスを定義してもよく、同様に課題を解決することができる。
 本実施の形態を図1に基づいて説明すると、画像を符号化した符号化データを復号する画像復号装置と、前記画像復号装置で復号した画像の解像度を変換する解像度逆変換装置を有し、前記解像度逆変換装置に入力する色コンポーネント情報と出力する色差フォーマット情報を復号する逆変換情報復号装置を有することを特徴とする動画像復号装置である。
 また、画像を符号化する画像符号化装置と、符号化した画像の解像度を変換する解像度逆変換装置に入力する色コンポーネント情報と出力する色差フォーマット情報を符号化する逆変換情報符号化装置を有することを特徴とする動画像符号化装置である。
 本発明の実施形態は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
 本発明の実施形態は、画像データが符号化された符号化データを復号する動画像復号装置、および、画像データが符号化された符号化データを生成する動画像符号化装置に好適に適用することができる。また、動画像符号化装置によって生成され、動画像復号装置によって参照される符号化データのデータ構造に好適に適用することができる。
(関連出願の相互参照)
 本出願は、2022年1月14日に出願された日本国特許出願:特願2022-004115に対して優先権の利益を主張するものであり、それを参照することにより、その内容の全てが本書に含まれる。
1 動画像伝送システム
30 動画像復号装置
31 画像復号装置
301 エントロピー復号部
302 パラメータ復号部
303 インター予測パラメータ導出部
304 イントラ予測パラメータ導出部
305、107 ループフィルタ
306、109 参照ピクチャメモリ
307、108 予測パラメータメモリ
308、101 予測画像生成部
309 インター予測画像生成部
310 イントラ予測画像生成部
311、105 逆量子化・逆変換部
312、106 加算部
320 予測パラメータ導出部
10 動画像符号化装置
11 画像符号化装置
102 減算部
103 変換・量子化部
104 エントロピー符号化部
110 符号化パラメータ決定部
111 パラメータ符号化部
112 インター予測パラメータ符号化部
113 イントラ予測パラメータ符号化部
120 予測パラメータ導出部
71 逆変換情報作成装置
81 逆変換情報符号化装置
91 逆変換情報復号装置
611 NNフィルタ部

Claims (4)

  1.  符号化データから画像を復号する画像復号装置と、前記画像復号装置で復号した画像に対して、ポストフィルタ処理を行うためのニューラルネットワークモデルの入力テンソルの形式とチャネル数チャネル数を指定する情報、及び、出力テンソルの形式とチャネル数を指定する情報を補助情報として復号する補助情報復号装置を有することを特徴とする動画像復号装置。
  2.  前記補助情報復号装置は、さらに適用するニューラルネットワークモデルを特定する情報を復号することを特徴とする請求項1記載の動画像復号装置。
  3.  入力画像を符号化する画像符号化装置と、前記画像符号化装置の復号画像に対して、ポストフィルタ処理を行うためのニューラルネットワークモデルの入力テンソルの形式とチャネル数を指定する情報、及び出力テンソルの形式とチャネル数を指定する情報を補助情報として符号化する補助情報符号化装置を有することを特徴とする動画像符号化装置。
  4.  前記補助情報符号化装置は、ポストフィルタ処理を行うためのニューラルネットワークモデルの入力テンソルの形式とチャネル数を指定する情報、及び、出力テンソルの形式とチャネル数を指定する情報に対して、適用するニューラルネットワークを特定する情報を補助情報として符号化することを特徴とする請求項3記載の動画像符号化装置。
PCT/JP2023/000408 2022-01-14 2023-01-11 動画像符号化装置、動画像復号装置 WO2023136257A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2022004115A JP2023103544A (ja) 2022-01-14 2022-01-14 動画像復号装置
JP2022-004115 2022-01-14

Publications (1)

Publication Number Publication Date
WO2023136257A1 true WO2023136257A1 (ja) 2023-07-20

Family

ID=87279183

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2023/000408 WO2023136257A1 (ja) 2022-01-14 2023-01-11 動画像符号化装置、動画像復号装置

Country Status (2)

Country Link
JP (2) JP2023103544A (ja)
WO (1) WO2023136257A1 (ja)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200304836A1 (en) * 2019-03-22 2020-09-24 Tencent America LLC Supplemental enhancement information messages for neural network based video post processing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW202134958A (zh) * 2019-10-01 2021-09-16 弗勞恩霍夫爾協會 神經網路表示型態格式

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200304836A1 (en) * 2019-03-22 2020-09-24 Tencent America LLC Supplemental enhancement information messages for neural network based video post processing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
B. CHOI (TENCENT), Z. LI (TENCENT), W. WANG (TENCENT), W. JIANG (TENCENT), X. XU (TENCENT), S. WENGER (TENCENT), S. LIU (TENCENT): "AHG9/AHG11: SEI messages for carriage of neural network information for post-filtering", 22. JVET MEETING; 20210420 - 20210428; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 21 April 2021 (2021-04-21), XP030294187 *
M. M. HANNUKSELA (NOKIA), E. B. AKSU, F. CRICRI, H. R. TAVAKOLI, M. SANTAMARIA (NOKIA): "AHG9: On post-filter SEI", 136. MPEG MEETING; 20211011 - 20211015; ONLINE; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), 30 September 2021 (2021-09-30), XP030297705 *
Y. YASUGI, T. CHUJOH, K. TAKADA, T. IKAI (SHARP): "AHG9: Data conversion description for NNR post-filter SEI message", 25. JVET MEETING; 20220112 - 20220121; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 6 January 2022 (2022-01-06), XP030300289 *

Also Published As

Publication number Publication date
JP2024027132A (ja) 2024-02-29
JP2023103544A (ja) 2023-07-27

Similar Documents

Publication Publication Date Title
CN113115047A (zh) 视频编解码方法和设备
JP2022539786A (ja) 画像成分の予測方法、エンコーダ、デコーダ及び記憶媒体
KR20210135337A (ko) 적응적 루프 필터 기반 비디오 또는 영상 코딩
TW202139695A (zh) 用於將編碼樹單元編碼與解碼的方法、設備及系統
JP2023544705A (ja) ビデオコーディング中の、ジョイント成分ニューラルネットワークベースのフィルタ処理
TW202123708A (zh) 用於將編碼樹單元編碼與解碼的方法、設備及系統
KR20170016892A (ko) 그래프 템플릿으로부터 유도된 변환을 이용하여 비디오 신호를 디코딩/인코딩하는 방법 및 장치
KR20160145117A (ko) 색 공간 스케일러빌리티에 대한 3d 칼라 예측을 위한 비트 심도 값들의 시그널링
KR20210122863A (ko) 스케일링 리스트 데이터의 시그널링 기반 비디오 또는 영상 코딩
JP2024506156A (ja) ビデオ符号化のための残差および係数の符号化
KR20180009048A (ko) 영상의 부호화/복호화 방법 및 이를 위한 장치
CN111034198A (zh) 图像编码和解码方法、编码和解码设备及对应计算机程序
CN112616057A (zh) 图像预测方法、编码器、解码器以及存储介质
WO2023136257A1 (ja) 動画像符号化装置、動画像復号装置
WO2022191064A1 (ja) 動画像符号化装置、復号装置
CN115699775A (zh) 视频或图像编码系统中基于单色颜色格式的色度去块参数信息的图像编码方法
CN112532997A (zh) 图像预测方法、编码器、解码器以及存储介质
KR20220050203A (ko) 변환 스킵 및 팔레트 코딩 관련 고급 문법 요소 기반 영상 또는 비디오 코딩
WO2024142580A1 (ja) 動画像符号化装置、復号装置
WO2023112784A1 (ja) 動画像復号装置、ポスト画像処理装置、動画像符号化装置、動画像復号方法及び動画像符号化方法
US20230209074A1 (en) Image decoding apparatus, image encoding apparatus, and image decoding method
US20230328292A1 (en) Video coding apparatus and video decoding apparatus
JP2020068462A (ja) 画像ビット階調拡張フィルタ装置及び画像符号化装置、画像復号装置
JP2024076475A (ja) 動画像符号化装置、復号装置
EP4346213A1 (en) Video coding apparatus and video decoding apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23740266

Country of ref document: EP

Kind code of ref document: A1