Tool Selection for Feature Map Coding vs. Conventional Video Coding.

The solution addresses the inefficiencies in encoding and decoding CNN tensors by using a selective set of functions based on the presence of feature maps, thereby enhancing processing efficiency and reducing resource overhead.

JP7672498B2Active Publication Date: 2025-05-07CANON KK
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023547314
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-04-07
Filing Date
2022-03-11
Publication Date
2025-05-07
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Existing video compression standards face challenges in efficiently encoding and decoding tensors from convolutional neural networks (CNNs), particularly in terms of memory consumption and processing power, especially when dealing with high-resolution video data and feature maps.

Method used

The proposed solution involves an apparatus and method for generating and decoding encoded data that includes encoded feature maps from CNNs, using a determination unit to decide on the encoding or decoding process. This process employs a subset of encoding or decoding functions, optimizing the use of resources by avoiding unnecessary computations when feature maps are present.

Benefits of technology

This approach enhances the efficiency of video data processing by optimizing resource utilization, improving task performance, and reducing overhead in bitstream encoding and decoding, especially in scenarios with varying bitrates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007672498000006
    Figure 0007672498000006
  • Figure 0007672498000007
    Figure 0007672498000007
  • Figure 0007672498000008
    Figure 0007672498000008
Patent Text Reader

Abstract

An apparatus for generating first and second encoded data, the apparatus having a determining means for determining whether the apparatus generates encoded data including encoded data of a feature map based on a neural network, the apparatus also having encoding means for generating the first encoded data using a plurality of features for encoding the video data when the apparatus generates the first encoded data in the form of encoded video data not including encoded data of the feature map, the encoding means for generating the encoded data of the feature map using a first portion of the plurality of features but without a second portion of the plurality of features when the apparatus generates the second encoded data including encoded data of the feature map.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] REFERENCE TO RELATED APPLICATIONS This application claims the benefit under 35 U.S.C. § 119 of the filing date of Australian Patent Application No. 2021202142, filed April 7, 2021, the entirety of which is incorporated herein by reference as if fully set forth herein.

[0002] The present invention relates generally to digital video signal processing, and more particularly to a method, apparatus, and system for encoding and decoding tensors from a convolutional neural network. The present invention also relates to a computer program product including a computer readable medium having recorded thereon a computer program for encoding and decoding tensors from a convolutional neural network using video compression techniques. [Background technology]

[0003] Video compression is a ubiquitous technology used to support many applications, including applications for the transmission and storage of video data. Many video coding standards have been developed and others are currently under development. Recent developments in video coding standardization have led to the formation of a group called the "Joint Video Experts Team" (JVET). The Joint Video Experts Team (JVET) includes members from two Standards Setting Organisations (SSOs): Study Group 16, Question 6 (SG16 / Q6) of the International Telecommunication Union's (ITU) Telecommunication Standardisation Sector (ITU-T), also known as the "Video Coding Experts Group" (VCEG), and International Organization for Standardisation / International Electrotechnical Commission Joint Technical Committee 1 / Subcommittee 29 / Working Group 11 (ISO / IEC JTC1 / SC29 / WG11), also known as the "Moving Picture Experts Group" (MPEG).

[0004] The Joint Video Experts Team (JVET) developed a video compression standard called "versatile video coding" (VVC).

[0005] Convolutional Neural Networks (CNNs) are an emerging technology that addresses use cases involving machine vision such as object recognition, object tracking, human pose estimation, and action recognition, among others. CNNs typically contain many layers, such as convolutional and fully connected layers, where data is passed from one layer to the next in the form of "tensors". The weights of each layer are determined in a training stage, where a very large amount of training data is passed through the CNN and the determined results are compared to the ground truth related to the training data. A process for updating the network weights, such as stochastic gradient descent, is applied to iteratively refine the network weights until the network performs with a desired level of accuracy. If a convolution stage has a "stride" greater than one, the output tensor from the convolution has a lower spatial resolution than the corresponding input tensor. Operations such as "max pooling" also reduce the spatial size of the output tensor compared to the input tensor. Max pooling generates an output tensor by splitting an input tensor into groups of data samples (e.g., 2x2 groups of data samples) and selecting the maximum value from each group as the output for the corresponding value in the output tensor. The process of running a CNN with an input and progressively transforming the input into an output is commonly called "inference".

[0006] In general, tensors have four dimensions: batch, channel, height, and width. The first dimension, “batch”, of size “1” when inferring video data indicates that one frame is passed through the CNN at a time. When training the network, the value of the batch dimension can be increased so that multiple frames are passed through the network before the network weights are updated according to a predefined “batch size”. Multi-frame videos can be passed through as a single tensor with the batch dimension increased in size according to the number of frames in a given video. However, due to practical considerations regarding memory consumption and access, inference on video data is typically performed on a frame-by-frame basis. The “channel” dimension indicates the number of concurrent “feature maps” for a given tensor, while the height and width dimensions indicate the size of the feature maps at a particular stage of the CNN. The channel count varies through the CNN according to the network architecture. Also, the feature map size varies depending on the subsampling that occurs at a particular network layer.

[0007] The input to the first layer of a CNN is typically an image or video frame, which is resized for compatibility with the dimensions of the tensor input to the first layer. The dimensions of the tensor depend on the CNN architecture, and generally have some dimensions related to the input width and height, plus an additional "channel" dimension.

[0008] Slicing a tensor based on channels results in a set of so-called "feature maps" since each slice of the tensor has some relationship with the corresponding input image, capturing some properties such as edges. At layers further away from the input to the network, the relationships may be more abstract. The "task performance" of a CNN is measured by comparing the results of the CNN in performing a task with a particular input to provided ground truth (i.e., "training data"), typically prepared by a human and intended to show the "correct" results.

[0009] Once the network topology is determined, the network weights can be updated over time as more training data becomes available. It is also possible to retrain a portion of the CNN and leave the weights in other portions of the network unchanged. The overall complexity of a CNN tends to be very high, with many multiply-add operations being performed and many intermediate tensors being written to and read from memory. In some applications, CNNs are implemented entirely in the "cloud", requiring high and expensive processing power. In other applications, CNNs are implemented on edge devices such as cameras or mobile phones, providing less flexibility but more distributed processing load.

[0010] VVC is expected to address the continuing demand for ever higher compression performance, particularly as video formats increase in capability (e.g., having higher resolutions and higher frame rates), and to address the growing market demand for service delivery over WANs where bandwidth costs are relatively high. VVC is implementable in modern silicon processes and provides an acceptable tradeoff between achieved performance and implementation cost. Implementation cost may be considered, for example, in terms of one or more of silicon area, CPU processor load, memory utilization, and bandwidth. Part of the versatility of the VVC standard lies in the wide selection of tools available for compressing video data, as well as the wide range of applications for which VVC is suitable.

[0011] Video data includes a sequence of frames of image data, with each frame including one or more color channels. Generally, one primary color channel and two secondary color channels are required. The primary color channel is commonly referred to as the "luma" channel, and the secondary color channel is commonly referred to as the "chroma" channel. Video data is typically displayed in the RGB (Red-Green-Blue) color space, which has a high degree of correlation between the three respective components. Video data representations seen by encoders or decoders often use color spaces such as YCbCr. YCbCr concentrates luminance, which is mapped to "luma" according to a transfer function, in the Y (primary) channel and chroma in the Cb and Cr (secondary) channels. Due to the use of uncorrelated YCbCr signals, the statistics of the luma channel differ significantly from those of the chroma channels. The main difference is that after quantization, the chroma channel contains a relatively small number of significant coefficients for a given block compared to the coefficients of the corresponding luma channel block. Additionally, the Cb and Cr channels may be spatially sampled (subsampled) at a lower rate compared to the luma channel, e.g., half horizontally and half vertically, known as the "4:2:0 chroma format". The 4:2:0 chroma format is commonly used for Internet video streaming, broadcast television, Blu-Ray, TM It is commonly used in "consumer" applications, such as saving to disk. If only luma samples are present, the resulting monochrome frame is said to use a "4:0:0 chroma format".

[0012] The VVC standard specifies a "block-based" architecture, where a frame is first divided into a square array of regions known as "coding tree units" (CTUs). Typically, a CTU occupies a relatively large area, such as 128x128 luma samples. However, the CTUs at the right and bottom edges of each frame may be smaller in area. Associated with each CTU is a "coding tree" for both the luma and chroma channels (a "shared tree"), or a separate tree for each of the luma and chroma channels. The coding trees define the decomposition of the area of ​​the CTU into a set of blocks, also called "coding blocks" (CBs). When a shared tree is in use, a single coding tree specifies blocks for both the luma and chroma channels, in which case the collection of co-located coding blocks is called a "coding unit" (CU) (i.e., each CU has a coding block for each color channel). The CBs are processed for encoding or decoding in a specific order. As a result of the use of the 4:2:0 chroma format, a CTU having a luma coding tree for a 128x128 luma sample area has a corresponding chroma coding tree for a 64x64 chroma sample area collocated with the 128x128 luma sample area. When a single coding tree is used for the luma and chroma channels, the collection of collocated blocks for a given area is generally referred to as a "unit", e.g., the CU mentioned above, as well as the "prediction unit" (PU) and the "transform unit" (TU). A single tree with CUs spanning the color channels of 4:2:0 chroma format video data makes the chroma blocks half the width and height of the corresponding luma blocks. When separate coding trees are used for a given area, the CB mentioned above, as well as the "prediction block" (PB) and the "transform block" (TB) are used.

[0013] Notwithstanding the above distinction between "units" and "blocks", the term "block" may be used as a generic term for an area or region of a frame where an operation is applied to all color channels.

[0014] For each CU, a prediction unit (PU) of the contents (sample values) of the corresponding region of the frame data is generated ("Prediction Unit"). In addition, a representation of the difference (or "spatial domain" residual) between the prediction and the contents of the region seen at the input to the encoder is formed. The differences in each color channel may be transformed and coded as a sequence of residual coefficients, forming one or more TUs for a given CU. The transform applied may be a discrete cosine transform (DCT) or other transform, applied to each block of residual values. The transform is applied separably (i.e., a two-dimensional transform is performed in two passes). The block is first transformed by applying a one-dimensional transform to each row of samples in the block. The partial results are then transformed by applying a one-dimensional transform to each column of the partial results to produce a final block of transform coefficients that substantially decorrelates the residual samples. Transforms of various sizes are supported by the VVC standard, including transforms of rectangular shaped blocks, with each side dimension being a power of two. The transform coefficients are quantized for entropy coding into the bitstream.

[0015] VVC features intra-frame prediction and inter-frame prediction. Intra-frame prediction involves the use of previously processed samples in a frame that are used to generate a prediction of a current block of data samples in the frame. Inter-frame prediction involves using a block of samples taken from a previously decoded frame to generate a prediction of a current block of samples in a frame. The block of samples taken from a previously decoded frame is offset from the spatial location of the current block, often according to a motion vector with filtering applied. An intra-frame prediction block may be (i) a uniform sample value ("DC intra-prediction"), (ii) a plane with an offset and horizontal and vertical gradients ("planar intra-prediction"), (iii) a population of blocks with neighboring samples applied in a particular direction ("angular intra-prediction"), or (iv) the result of a matrix multiplication using neighboring samples and selected matrix coefficients. Further discrepancies between the predicted block and the corresponding input samples may be corrected to some extent by encoding a "residual" into the bitstream. The residual is typically transformed from the spatial domain to the frequency domain to form residual coefficients in a "primary transform domain", which may be further transformed by application of a "secondary transform" to produce residual coefficients in a "secondary transform domain". The residual coefficients are quantized according to a quantization parameter, resulting in a loss of precision in the reconstruction of the samples produced at the decoder, but with a reduced bitrate in the bitstream. Summary of the Invention

[0016] It is an object of the present invention to substantially overcome, or at least ameliorate, one or more disadvantages of existing arrangements.

[0017] According to an aspect of the present disclosure, there is provided an apparatus for generating first encoded data and second encoded data, the apparatus comprising: a determining means for determining whether the device generates coded data including coded data of a feature map based on a neural network; and encoding means for generating the first encoded data using a plurality of features for encoding video data when the apparatus generates the first encoded data in the form of encoded video data that does not include encoded data of the feature map, the encoding means generating the encoded data of the feature map using a first portion of the plurality of features but without a second portion of the plurality of features when the apparatus generates the second encoded data including encoded data of the feature map.

[0018] According to another aspect of the present disclosure, there is provided an apparatus for decoding first encoded data and second encoded data, the apparatus comprising: a determining means for determining whether the device decodes coded data including coded data of a feature map based on a neural network; and decoding means for decoding the first encoded data using a plurality of functions for decoding video data when the apparatus decodes the first encoded data in the form of encoded video data that does not include encoded data of the feature map, the decoding means for decoding the feature map using a first portion of the plurality of functions but without a second portion of the plurality of functions when the apparatus decodes the second encoded data that includes encoded data of the feature map.

[0019] According to another aspect of the present disclosure, there is provided a method for generating first and second encoded data, the method comprising: determining whether the apparatus generates the encoded data, including the encoded data of the feature map, based on a neural network; if the apparatus generates the first encoded data in the form of encoded video data that does not include encoding data of the feature map, generating the first encoded data using a plurality of functions for encoding video data; A method is provided in which, when the apparatus generates the second encoded data including the encoded data of the feature map, the encoded data of the feature map is generated using a first portion of the plurality of features but without a second portion of the plurality of features.

[0020] According to another aspect of the present disclosure, there is provided a method of decoding first encoded data and second encoded data, the method comprising: determining whether the apparatus decodes the encoded data, including the encoded data of the feature map, based on a neural network; if the apparatus decodes the first encoded data as encoded video data that does not include encoding of the feature map, decoding the first encoded data using a plurality of functions for decoding video data; A method is provided in which, when the device decodes the second encoded data including the encoded data of the feature map, the device decodes the encoded data of the feature map using a first portion of the plurality of features but without a second portion of the plurality of features.

[0021] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing a program for performing a method for generating first encoded data and second encoded data, the method comprising: determining whether the apparatus generates encodings based on a neural network, the encodings including the encodings of the feature maps; if the apparatus generates the first encoded data in the form of encoded video data that does not include encoding data of the feature map, generating the first encoded data using a plurality of functions for encoding video data; and when the apparatus generates the second encoded data including the encoded data of the feature map, generating the encoded data of the feature map using a first portion of the plurality of features but without a second portion of the plurality of features.

[0022] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing a program for performing a method for decoding first encoded data and second encoded data, the method comprising: determining whether the device decodes the encoded data, including the encoded data of the feature map, based on a neural network; if the device decodes the first encoded data as encoded video data that does not include encoding of the feature map, decoding the first encoded data using a plurality of functions for decoding video data; and when the device decodes the second encoded data including the encoded data of the feature map, decoding the encoded data of the feature map using a first portion of the plurality of features but without a second portion of the plurality of features.

[0023] Other aspects are also disclosed. [Brief description of the drawings]

[0024] At least one embodiment of the present invention will now be described with reference to the following drawings and appendix. [Figure 1] FIG. 1 is a schematic block diagram illustrating a distributed machine task system. [Figure 2A] FIG. 2A forms a schematic block diagram of a general-purpose computer system upon which the distributed machine tasks system of FIG. 1 may be implemented. [Figure 2B] FIG. 2B forms a schematic block diagram of a general-purpose computer system upon which the distributed machine tasks system of FIG. 1 may be implemented. [Figure 3A] FIG. 3A is a schematic block diagram showing the functional modules of the backbone portion of the CNN. [Figure 3B] FIG. 3B is a schematic block diagram illustrating the residual block of FIG. 3A. [Figure 3C] FIG. 3C is a schematic block diagram of the residual unit of FIG. 3A. [Figure 3D] FIG. 3D is a schematic block diagram illustrating the CBL module of FIG. 3A. [Figure 4] FIG. 4 is a schematic block diagram showing the functional modules of the alternative backbone portion of the CNN. [Diagram 5] FIG. 5 is a schematic block diagram showing a feature map quantizer and packer as part of a distributed machine task system. [Figure 6] FIG. 6 is a schematic block diagram showing functional modules of a video encoder. [Figure 7] FIG. 7 is a schematic block diagram showing the functional modules of a video decoder. [Figure 8] FIG. 8 is a schematic block diagram showing a feature map dequantizer and unpacker as part of a distributed machine task system. [Figure 9A] FIG. 9A is a schematic block diagram showing the head section of a CNN. [Figure 9B] FIG. 9B is a schematic block diagram illustrating the upscaler module of FIG. 9A. [Figure 9C] FIG. 9C is a schematic block diagram illustrating the detection module of FIG. 9A. [Figure 10] FIG. 10 is a schematic block diagram showing an alternative head portion of a CNN. [Figure 11] FIG. 11 is a schematic block diagram illustrating a feature map packing arrangement in a monochrome frame. [Figure 12] FIG. 12 is a schematic block diagram illustrating an alternative feature map packing arrangement in a monochrome frame. [Figure 13] FIG. 13 is a schematic block diagram illustrating a feature map packing arrangement in a 4:2:0 chroma subsampled color frame. [Figure 14] FIG. 14 is a schematic block diagram illustrating a bitstream carrying encoded packed feature maps and associated metadata. [Figure 15] FIG. 15 shows a method for running the first part of the CNN and encoding the resulting feature maps. [Figure 16] FIG. 16 shows a method for decoding the feature maps and running the second part of the CNN. [Figure 17] FIG. 17 illustrates a method for determining groupings of feature maps. [Figure 18] 18 shows a method for selecting a set of coding tools or features from a video standard. Appendix A is a syntax table showing a supplemental enhancement information (SEI) message format for expressing metadata related to feature map packing and quantization in a bitstream. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0025] Where reference is made to steps and / or features having the same reference numbers in any one or more of the accompanying drawings, those steps and / or features have the same function or operation for the purposes of this description, unless intended to the contrary.

[0026] A distributed machine task system may include edge devices, such as network cameras or smartphones, that generate intermediate compressed data. A distributed machine task system may also include end devices, such as server farm-based ("cloud") applications, that manipulate the intermediate compressed data to generate some task result. In addition, edge device functions may be embodied in the cloud, and the intermediate compressed data may be stored for later processing, potentially for multiple different tasks as needed.

[0027] A convenient form of intermediate compressed data is a compressed video bitstream, due to the availability of high performance compression standards and their implementations. Video compression standards operate on integer samples of some given bit depth, such as 10 bits, typically arranged in planar arrays. Color video has three planar arrays, for example corresponding to the color components Y, Cb, Cr, or R, G, B, depending on the application. CNNs typically operate on floating-point data in the form of tensors, which generally have a much smaller spatial dimension compared to the incoming video data on which CNNs operate, but which have more channels than the typical three channels for color video data.

[0028] Tensors typically have the following dimensions: frames, channels, height, and width. For example, a tensor of dimensions [1, 256, 76, 136] is said to contain 256 feature maps, each of size 136 × 76. For video data, inference is typically performed one frame at a time, rather than using tensors containing multiple frames.

[0029] VVC encoders and decoders include a capability signaling mechanism known as "constraints". Early in the bitstream there is a set of constraints that indicate which capabilities of the VVC standard are not used in the bitstream. The constraints are signaled along with the "profile" and "level" of the bitstream. The profile broadly indicates the set of tools that must be available to decode the bitstream. The constraints also provide a fine granularity of control of which tools are further constrained in a specified profile. Further constraints on tools are similar to "sub-profiling", except that sub-profiles are defined outside the VVC standard and the general constraint flag semantics are defined within the VVC standard. By defining a subset of tools depending on the type of data being encoded by the video encoder (e.g., equivalent to defining a sub-profile), the decoder can know before starting bitstream decoding that a subset of the coding tools of the indicated profile of the bitstream should be used.

[0030] 1 is a schematic block diagram showing functional modules of a distributed machine task system 100. The system 100 can be used to implement a method for efficiently packing and quantizing feature maps into planar frames for encoding and decoding feature maps from encoded data, such that the associated overhead data is not overly burdensome and the task performance of the decoded feature maps is resilient to changes in the bitstream bitrate.

[0031] The system 100 includes a source device 110 for generating encoded data in the form of encoded video information. The system 100 also includes a destination device 140. A communication channel 130 is used to communicate the encoded video information from the source device 110 to the destination device 130. In some configurations, one or both of the source device 110 and the destination device 140 may have a respective mobile phone handset (e.g., a "smartphone") or a network camera and a cloud application. The communication channel 130 may be a wired connection, such as Ethernet, or a wireless connection, such as WiFi or 5G. Additionally, the source device 110 and the destination device 140 may include an application in which the encoded video data is captured on some computer-readable storage medium, such as a hard disk drive in a file server.

[0032] As shown in FIG. 1, source device 110 includes video source 112, CNN backbone 114, feature map quantizer and packer 116, multiplexer 118, video encoder 120, and transmitter 122. Video source 112 typically comprises a source of captured video frame data (shown as 113), such as an image capture sensor, a previously captured video sequence stored on a non-transitory recording medium, or a video feed from a remote image capture sensor. Video source 112 may also be the output of a computer graphics card, for example, displaying the video output of various applications and operating systems running on a computing device (e.g., a tablet computer). Examples of source device 110 that may include an image capture sensor as video source 112 include smartphones, video camcorders, professional video cameras, and network video cameras.

[0033] The CNN backbone 114 receives the video frame data 113 and executes certain layers of the overall CNN, such as a layer corresponding to the "backbone" of the CNN. The backbone layer of the CNN may, for example, generate as output multiple tensors corresponding to different spatial scales of the input image represented by the video frame data 113. A "feature pyramid network" (FPN) architecture may result in three tensors corresponding to the three layers output from the backbone 114, at various spatial resolutions and channel counts. The feature map quantizer and packer 116 receives the tensors 115 output from the CNN backbone 114. The feature map quantizer and packer 116 acts to interface the inner layers of the overall CNN, which are the output of the CNN backbone 114, to the video encoder 120 by quantizing the floating-point values ​​in the tensors 115 into data samples that are packed into a frame 119. The resolution of the frame 119 may be based on the total area of ​​the feature maps to be coded and the target aspect ratio. During packing, if excess unused space in frame 119 occurs, the frame size may be increased (e.g., the height may be increased), so that all feature maps can be placed in frame 119. For example, the resolution of frame 119 may be 2056×1224, and the bit depth of frame 119 may be 10 bits. Determining the feature map placement in frame 119 only needs to be performed when the dimensions of tensor 115 are established. Slicing tensor 115 along the channel dimension results in extracting one feature map per channel, and the feature maps of a given tensor have a specific size determined from the additional dimension of the tensor. When FPN is used, multiple tensors are generated for each incoming frame, containing multiple sets of feature maps, each set of feature maps having a different spatial resolution. The feature maps of all layers are packed into a planar video frame, such as packed feature map frame 117.Multiplexer 118 selects packed feature map frame 117 if source device 110 is configured to encode video data, and outputs frame 119 to an encoding unit in the form of video encoder 120 if source device 110 is configured to encode feature map or frame data 113. The selection between feature map and regular video data is encoded in the bitstream using a "frame_type" syntax element in a metadata SEI message. Metadata SEI messages are described with reference to Appendix A. Frame 119 is input to video encoder 120, where lossy compression is applied to frame 119 to generate bitstream 121. Bitstream 121 is provided to transmitter 122 for transmission over communication channel 130, or bitstream 121 is written to storage device 132 for later use.

[0034] After conversion to tensors by the CNN backbone 114, the content of the resulting feature maps may no longer be able to identify individuals that are clearly identifiable in the video data 113. Storage of the feature maps (e.g., in compressed form) using the storage device 132 may be safer from a user privacy perspective, especially in relation to the European General Data Protection Regulation (GDPR) requirements for pseudonymization or anonymization.

[0035] The source device 110 supports a particular network for the CNN backbone 114. However, the destination device 140 may use one of several networks for the head CNN 150. In this manner, partially processed data in the form of packed feature maps may be stored for later use in performing various tasks without having to perform the operations of the CNN backbone 114 again. The video encoder 120 uses a particular set of VVC coding tools (or "profiles") to encode the frame data 119.

[0036] Bitstream 121 is transmitted by transmitter 122 as encoded video data (or "encoded video information") over communication channel 130. Bitstream 121 may in some implementations be stored in storage 132, which is a non-transitory storage device such as "flash" memory or a hard disk drive until later (or instead of) being transmitted over communication channel 130. For example, the encoded video data may be provided to customers on demand over a wide area network (WAN) for video streaming applications.

[0037] The destination device 140 includes a receiver 142, a video decoder 144, a demultiplexer 146, a feature map unpacker and dequantizer 148, a CNN head 150, a CNN task 152, and a display device 160. The receiver 142 receives encoded video data from the communication channel 130 and passes the received video data as a bitstream to the video decoder 144 (indicated by arrow 143). The video decoder 144 then outputs decoded frame data to the demultiplexer 146 (indicated by arrow 145). Decoded metadata 155 is also extracted from the bitstream 143 by the video decoder 144 and passed to the feature map unpacker and dequantizer 148. The decoded metadata 155 is typically obtained from a "supplemental enhancement information" (SEI) message 1413 (see FIG. 14) present in the bitstream 143. Appendix A shows an example syntax for decoded metadata 155 along with the semantics of each example syntax element. Decoded metadata 155 may be decoded and present from the bitstream for every frame. Decoded metadata 155 may be present and decoded less frequently than every frame. For example, decoded metadata 155 may be present and decoded only in intra pictures in bitstream 143. When decoded metadata 155 is not present for a given frame, the most recent available metadata is used. If destination device 140 is configured to perform a CNN task, as indicated by the "frame_type" syntax element in SEI message 1413 of bitstream 143, frame data 145 is output as feature map frame data 147 to feature map unpacker and dequantizer 148. If destination device 140 is instead configured to perform decoding of video data, frame data 145 is output as frame data 159 and provided to display device 160 for display as video. The feature map unpacker and inverse quantizer outputs tensors 147 that are fed to the CNN head 150.CNN head 150 executes later layers of tasks initiated in CNN backbone 114 to generate task results 151 that are stored in task result buffer 152. Examples of display device 160 include liquid crystal displays such as cathode ray tubes, smartphones, tablet computers, computer monitors, or standalone television sets. The functionality of each of source device 110 and destination device 140 may also be embodied in a single device, examples of which include a mobile phone handset, a tablet computer, and a cloud application.

[0038] Notwithstanding the exemplary devices described above, each of the source device 110 and the destination device 140 may generally be configured within a general-purpose computing system through a combination of hardware and software components. Figure 2A illustrates such a computer system 200, including a computer module 201, input devices such as a keyboard 202, a mouse pointer device 203, a scanner 226, a camera 227 that may be configured as a video source 112, a microphone 280, and output devices including a printer 215, a display device 214 that may be configured as a display device 160, and a loudspeaker 217. An external modulator-demodulator (Modem) transceiver device 216 may be used by the computer module 201 to communicate to and from a communication network 220 via a connection 221. The communication network 220, which may represent the communication channel 130, may be a (WAN), such as the Internet, a cellular telecommunications network, or a private WAN. If the connection 221 is a telephone line, the modem 216 may be a conventional "dial-up" modem. Alternatively, the modem 216 may be a broadband modem where the connection 221 is a high-capacity (e.g., cable or optical) connection. A wireless modem may also be used for wireless connection to the communications network 220. The transceiver device 216 may provide the functionality of the transmitter 116 and receiver 142, and the communications channel 130 may be embodied in the connection 221.

[0039] The computer module 201 typically includes at least one processor unit 205 and a memory unit 206. For example, the memory unit 206 can have a semiconductor random access memory (RAM) and a semiconductor read only memory (ROM). The computer module 201 also includes several input / output (I / O) interfaces, including an audio-video interface 207 that couples to a video display 214, a loudspeaker 217 and a microphone 280, an I / O interface 213 that couples to a keyboard 202, a mouse 203, a scanner 226, a camera 227, and optionally a joystick or other human interface device (not shown), and an interface 208 for an external modem 216 and a printer 215. The signal from the audio-video interface 207 to the computer monitor 214 is typically the output of a computer graphics card. In some implementations, the modem 216 can be integrated into the computer module 201, for example into the interface 208. The computer module 201 also has a local network interface 211 that allows the coupling of the computer system 200 via a connection 223 to a local area communication network 222, known as a local area network (LAN). As shown in Fig. 2A, the local communication network 222 can also be coupled to a wide network 220 via a connection 224, which typically includes a so-called "firewall" device or a device of similar functionality. The local network interface 211 can be an Ethernet TM Circuit card, Bluetooth TM2. The local network interface 211 may also provide the functionality of the transmitter 122 and the receiver 142, and the communication channel 130 may also be embodied in a local communications network 222.

[0040] The I / O interfaces 208 and 213 may provide either or both of serial and parallel connectivity, the former typically being implemented according to the Universal Serial Bus (USB) standard and having a corresponding USB connector (not shown). A storage device 209 is provided and typically includes a hard disk drive (HDD) 210. Other storage devices such as a floppy disk drive or a magnetic tape drive (not shown) may also be used. An optical disk drive 212 is typically provided to act as a non-volatile source of data. For example, an optical disk (e.g., CD-ROM, DVD, Blu ray Disc TM ), USB-RAM, portable, external hard disks, and portable memory devices such as floppy disks can be used as suitable sources of data to computer system 200. Typically, any of HDD 210, optical drive 212, networks 220 and 222 may be configured to operate as a video source 112 or as a destination for decoded video data to be stored for playback via display 214. Source device 110 and destination device 140 of system 100 may be embodied in computer system 200.

[0041] The components 205-213 of the computer module 201 typically communicate via an interconnected bus 204 and in a manner that results in a conventional mode of operation of the computer system 200 known to those skilled in the art. For example, the processor 205 is coupled to the system bus 204 using a connection 218. Similarly, the memory 206 and optical disk drive 212 are coupled to the system bus 204 by a connection 219. Examples of computers on which the described arrangements can be practiced include IBM-PC's and compatibles, Sun SPARCstations, Apple Macs, and similar computers. TM , or a similar computer system.

[0042] Where appropriate or desirable, the video encoder 120 and the video decoder 144, as well as the methods described below, may be implemented using the computer system 200. In particular, the video encoder 120, the video decoder 144, and the methods described may be implemented as one or more software application programs 233 executable within the computer system 200. In particular, the video encoder 120, the video decoder 144, and the steps of the methods described are performed by instructions 231 (see FIG. 2B) in the software 233 executed within the computer system 200. The software instructions 231 may be formed as one or more code modules, each for performing one or more specific tasks. The software may also be divided into two separate parts, with a first part and corresponding code modules performing the methods described, and a second part and corresponding code modules managing a user interface between the first part and a user.

[0043] The software may be stored in a computer readable medium, including, for example, the storage devices described below. The software is loaded from the computer readable medium into the computer system 200 and then executed by the computer system 200. Such software or a computer readable medium having a computer program recorded thereon is a computer program product. The use of the computer program product in the computer system 200 preferably results in an advantageous apparatus for implementing the source device 110 and the destination device 140 and the methods described.

[0044] The software 233 is typically stored on the HDD 210 or in the memory 206. The software is loaded into the computer system 200 from a computer-readable medium and executed by the computer system 200. Thus, for example, the software 233 may be stored on an optically readable disk storage medium (e.g., a CD-ROM) 225 that is read by the optical disk drive 212.

[0045] In some examples, the application program 233 may be provided to the user encoded on one or more CD-ROMs 225 and read via a corresponding drive 212 or may be read by the user from the network 220 or 222. Additionally, the software may be loaded into the computer system 200 from other computer readable media. A computer readable storage medium refers to any non-transitory tangible storage medium that provides recorded instructions and / or data to the computer system 200 for execution and / or processing. Examples of such storage media are floppy disks, magnetic tapes, CD-ROMs, DVDs, Blu-ray Discs, and the like. TM, a hard disk drive, a ROM or integrated circuit, a USB memory, an optical magnetic disk, or a computer readable card such as a PCMCIA card, these devices being internal or external to the computer module 201. Examples of transitory or non-tangible computer readable transmission media that may also participate in providing software, application programs, instructions, and / or video data or encoded video data to the computer module 201 include wireless or infrared transmission channels, as well as network connections to other computers or networked devices, and the Internet or intranets, including e-mail transmissions and information stored on websites, etc.

[0046] A second portion of the application programs 233 and corresponding code modules described above may be executed to implement one or more graphical user interfaces (GUIs) that are rendered or represented on the display 214. A user of the computer system 200 and applications, typically through manipulation of a keyboard 202 and mouse 203, may manipulate the interface in a functionally adaptable manner to provide control commands and / or input to the application associated with the GUI. Other forms of functionally adaptable user interfaces may also be implemented, such as an audio interface that utilizes speech prompts output via loudspeaker 217 and user voice commands input via microphone 280.

[0047] Figure 2B is a detailed schematic block diagram of processor 205 and "memory" 234. Memory 234 represents the logical collection of all memory modules (including storage devices 209 and semiconductor memory 206) accessible by computer module 201 of Figure 2A.

[0048] When the computer module 201 is first powered on, a power-on self-test (POST) program 250 is executed. The POST program 250 is typically stored in the ROM 249 of the semiconductor memory 206 of FIG. 2A. Hardware devices such as the ROM 249 that store software are sometimes referred to as firmware. The POST program 250 inspects the hardware in the computer module 201 to ensure proper functioning, and typically checks the processor 205, the memory 234 (209, 206), and a basic input / output system software (BIOS) module 251, also typically stored in the ROM 249, for correct operation. If the POST program 250 executes successfully, the BIOS 251 boots the hard disk drive 210 of FIG. 2A. The booting of the hard disk drive 210 causes a bootstrap loader program 252 resident on the hard disk drive 210 to execute via the processor 205. This loads the operating system 253 into the RAM memory 206, and the operating system 253 begins operation. Operating system 253 is a system level application executable by processor 205 and performs a variety of high-level functions, including processor management, memory management, device management, storage management, a software application interface, and a general-purpose user interface.

[0049] The operating system 253 manages the memory 234 (209, 206) to ensure that each process or application running on the computer module 201 has enough memory to execute without colliding with memory allocated to another process. Furthermore, the different types of memory available in the computer system 200 of FIG. 2A need to be used appropriately so that each process can execute effectively. Thus, the aggregate memory 234 is not intended to show how specific segments of memory are allocated (unless otherwise noted), but rather is intended to provide a general view of memory accessible by the computer system 200, and how such memory is used.

[0050] As shown in FIG. 2B, the processor 205 includes several functional modules, including a control unit 239, an arithmetic logic unit (ALU) 240, and a local or internal memory 248, sometimes referred to as a cache memory. The cache memory 248 typically includes several storage registers 244-246 in a register section. One or more internal buses 241 operatively interconnect these functional modules. The processor 205 also typically has one or more interfaces 242 for communicating with external devices via the system bus 204, using a connection 218. The memory 234 is coupled to the bus 204 using a connection 219.

[0051] The application program 233 includes a set of instructions 231, which may include conditional branch and loop instructions. The program 233 may also include data 232 used in the execution of the program 233. The instructions 231 and the data 232 are stored in memory locations 228, 229, 230 and 235, 236, 237, respectively. Depending on the relative sizes of the instructions 231 and the memory locations 228-230, a particular instruction may be stored in a single memory location, as indicated by the instruction shown in memory location 230. Alternatively, the instructions may be segmented into several portions, each stored in a separate memory location, as indicated by the instruction segments shown in memory locations 228 and 229.

[0052] In general, the processor 205 is given a set of instructions to execute therein. The processor 205 waits for a subsequent input to which the processor 205 responds by executing another set of instructions. Each input may be provided from one or more of several sources, including data generated by one or more of the input devices 202, 203, data received from an external source over one of the networks 220, 202, data retrieved from one of the storage devices 206, 209, or data retrieved from a storage medium 225 inserted into a corresponding reader 212, all shown in FIG. 2A. Execution of the set of instructions may result in the output of data in some cases. Execution may also involve storing data or variables in memory 234.

[0053] Video encoder 120, video decoder 144, and described methods may use input variables 254, which are stored in corresponding memory locations 255, 256, 257 in memory 234. Video encoder 120, video decoder 144, and described methods generate output variables 261, which are stored in corresponding memory locations 262, 263, 264 in memory 234. Intermediate variables 258 may be stored in memory locations 259, 260, 266, and 267.

[0054] 2B, registers 244, 245, 246, arithmetic logic unit (ALU) 240, and control unit 239 cooperate to execute the sequence of micro-operations required to perform a "fetch, decode, and execute" cycle for each instruction in the instruction set that makes up program 233. Each fetch, decode, and execute cycle: a fetch operation to fetch or read instructions 231 from memory locations 228, 229, 230; a decode operation in which the control unit 239 determines which instruction has been fetched; and an execute operation in which the control unit 239 and / or the ALU 240 execute the instructions.

[0055] A further fetch, decode, and execute cycle for the next instruction may then be performed. Similarly, a store cycle may be performed by the control unit 239 storing or writing a value to the memory location 232.

[0056] Each step or sub-process in the described methods of Figures 15, 16, 17, and 18 is associated with one or more segments of program 233 and is typically performed by register sections 244, 245, 247, ALU 240, and control unit 239 within processor 205, which cooperate to perform fetch, decode, and execute cycles for all instructions in the instruction set for the referenced segment of program 233.

[0057] 3A is a schematic block diagram showing the functional modules of the CNN backbone portion 310 that may function as the CNN backbone 114. The backbone portion 114 is sometimes called "DarkNet-53", but different backbones are possible, resulting in different numbers of layers and dimensions of the tensors 115 for each frame. The "backbone_id" syntax element in the SEI message 1413, described with reference to FIG. 14 and Appendix A, indicates the type of backbone. If the type of backbone is unknown, the tensor dimensions are specified using the feature map count for each layer ("fm_cnt") and the feature map dimensions for each layer ("fm_width" and "fm_height").

[0058] As seen in Figure 3A, the video data 113 is passed to a resizer module 304 that resizes the frames to a resolution suitable for processing by the CNN backbone 310, generating resized frame data 312. If the resolution of the frame data 113 is already suitable for the CNN backbone 310, the operation of the resizer module 304 is unnecessary. The resized frame data 312 is passed to a convolutional batch normalisation leaky rectified linear (CBL) module 314, generating tensors 316. The CBL 314 includes modules as described with reference to the CBL module 360, as shown in Figure 3D.

[0059] The CBL module 360 ​​receives as input a tensor 361, which is passed to a convolutional layer 362 to generate a tensor 363. When the convolutional layer 362 has a stride of 1, the tensor 363 has the same spatial dimension as the tensor 361. When the convolutional layer 362 has a larger stride, such as 2, the tensor 363 has a smaller spatial dimension compared to the tensor 361, e.g., half the size of a stride of 2. Regardless of the stride, the size of the channel dimension of the tensor 363 may vary compared to the channel dimension of the tensor 361 for a particular CBL block. The tensor 363 is passed to a batch normalization module 364, which outputs a tensor 365. The batch normalization module 364 normalizes the input tensor 363 and applies a scaling factor and an offset value to generate the output tensor 365. The scaling factor and offset value are derived from a training process. Tensor 365 is passed to a leaky corrected linear activation ("LeakyReLU") module 366, which produces tensor 367. Module 366 provides an "activation function" where positive values ​​in the tensor are passed through and negative values ​​are significantly reduced in magnitude, e.g., to 0.1X their previous value.

[0060] The tensor 316 is passed from the CBL block 314 to a residual block 11 module 320 which internally comprises a concatenation of 11 residual units.

[0061] The residual block is described with reference to ResBlock 340 shown in FIG. 3B. ResBlock 340 receives tensor 341 which is zero padded by zero padding module 342 to generate tensor 343. Tensor 343 is passed to CBL module 344 to generate tensor 345. Tensor 345 is passed to residual unit 346, and residual block 340 includes a series of concatenated residual units. The last residual unit of residual unit 346 outputs tensor 347. The residual unit is described with reference to ResUnit 350 as seen in FIG. 3C. ResUnit 350 takes tensor 351 as input and passes it to CBL module 352 to generate tensor 353. Tensor 353 is passed to a second CBL unit 354 to generate tensor 355. Addition module 356 sums tensor 355 with tensor 351 to generate tensor 357. The addition module 356 is sometimes referred to as a "shortcut" since the input tensor 351 effectively affects the output tensor 357. For untrained networks, the ResUnit 350 operates on the pass-through tensors. When training is performed, the CBL modules 352 and 354 operate to separate tensor 357 from tensor 351 according to the training and ground truth data.

[0062] The Res11 module 320 outputs a tensor 322, which is output from the backbone module 310 as one of the layers, and is also provided to the Res8 module 324. The Res8 module 324 is a residual block (i.e., 340) containing eight residual units (i.e., 350). The Res8 module 324 generates a tensor 326, which is passed to the Res4 module 328 and is also output from the backbone module 310 as one of the layers. The Res4 module is a residual block (i.e., 340) containing four residual units (i.e., 350). The Res4 module 324 generates a tensor 329, which is output from the backbone module 310 as one of the layers. Collectively, the layer tensors 322, 326, and 329 are output as tensor 115. The backbone CNN 310 can take as input a video frame with a resolution of 1088x608 and generate three tensors corresponding to the three layers, with the following dimensions: [1, 256, 76, 136], [1, 512, 38, 68], [1, 1024, 19, 34]. The overall CNN shown in Figures 3 and 9 may be partitioned as shown, although other partitions of the overall CNN are possible. The tensors output from the first convolutions in the CBL blocks 912, 926, and 940 (i.e., tensor 363 in each respective CBL module) may be tapped as an output from the backbone, in which case the upscaler modules 922 and 936 and the first convolutions in the CBL modules 912, 926, and 940 are included in the backbone CNN 310. The dimensionality of the resulting tensors is [1, 512, 34, 19], [1, 256, 68, 38], [1, 128, 136, 76]. When all layers and operations of the YOLOv3 network are enumerated, the tapping tensors 363 in CBL modules 912, 926, and 940 correspond to the tapping tensors in the 75th, 90th, and 105th modules in the YOLOv3 network, respectively.The resulting tensors have half the number of feature maps at each resolution compared to the Darknet-53 outputs (i.e., 322, 326, and 329).

[0063] 4 is a schematic block diagram showing the functional modules of an alternative backbone portion 400 of a CNN that may function as the CNN backbone 114. The backbone portion 400 implements a residual network with a feature pyramid network ("ResNet FPN") and is an alternative to the CNN backbone 114. Frame data 113 is input and passes through tensors 409, 413, 417, 425 to a stem network 408, a res2 module 412, a res3 module 416, a res4 module 420, a res5 module 424, and a max pooling module 428, which produces a tensor 429 as an output. The stem network 408 includes a 7x7 convolution with a stride of 2 and a max pooling operation. The res2 module 412, the res3 module 416, the res4 module 420, and the res5 module 424 perform convolution operations, LeakyReLU activation. Each module 421, 416, 420, and 424 also implements one half of the resolution of the processed tensor via a stride setting of 2. Tensors 409, 413, 417, and 425 are passed to 1x1 horizontal convolution modules 440, 442, 444, and 446 to produce tensors 441, 443, 445, and 447. Tensor 441 is passed to a 3x3 output convolution module 470 to produce output tensor P5 471. Tensor 441 is also passed to an upsampler module 450 to produce an upsampled tensor 451. A summation module 460 sums tensors 443 and 451 to produce tensor 461, which is passed to an upsampler module 452 and a 3x3 horizontal convolution module 472. Module 472 outputs a P4 tensor 473. The upsampler module 452 produces an upsampled tensor 453. The summation module 462 sums tensors 445 and 453 to produce tensor 463, which is passed to a 3x3 horizontal convolution module 474 and to the upsampler module 454. Module 474 outputs a P3 tensor 475.The upsampler module 454 outputs an upsampled tensor 455. The summation module 464 sums tensors 447 and 455 to produce tensor 465, which is passed to a 3x3 transverse convolution module 476. Module 476 outputs a P2 tensor 477. The upsampler modules 450, 452, and 454 use nearest neighbor interpolation for low computational complexity. The tensors 429, 471, 473, 475, and 477 form the output tensor 115 of the CNN backbone 400.

[0064] FIG. 5 is a schematic block diagram showing the feature map quantizer and packer 116 as part of the distributed machine task system 100. Tensors 115 from the CNN backbone 114 are input to a group determination module 510, a range determination module 514, and a quantizer module 518. In other words, the quantizer module 518 implements a mapping or transfer function from floating-point values ​​to integer values. The group determination module 510 assigns the feature maps (channels) of the input tensor 115 to feature map groups 512 based on a predefined criterion or some measure of the data present in the tensor 115. The feature map groups 512 may span tensors of different layers or may be limited to individual layers. The feature map groups 512 are passed to the range determination module 514 and output as part of the metadata 125. The range determination module 514 determines, for each group, a quantization range that indicates the maximum amplitude value present in the feature maps belonging to the respective group, generating the quantization range 516. The range determination module 514 can determine new quantization ranges at every frame, or can determine new quantization ranges less frequently, for example, only on intra pictures.

[0065] The bitstream 121 includes a "qr_update" flag in the metadata (see Appendix A) that indicates whether the quantization ranges have been updated. A single quantization range can be used to represent the maximum magnitude of any pre-quantization value in the feature map of the group to which the quantization range belongs. In another arrangement, separate quantization ranges are used for the maximum positive value in the feature map group and the maximum negative value in the feature map, resulting in asymmetric quantization ranges with two values ​​per group.

[0066] Tensors 115 typically have 32-bit floating-point precision values, so each quantization range is also a floating-point value. Other floating-point precisions, such as 16-bit and 8-bit, are possible, as are various allocations of bits to the exponent and fractional parts of the floating-point values.

[0067] The quantization range 516 is passed to the quantizer module 518 and output as part of the metadata 125. The quantizer module 518 quantizes each feature map into sample values ​​in two stages. First, the feature map value is normalized using the quantization range of the feature map group to which the feature map belongs, resulting in a value ranging from [-1, 1]. Second, the normalized feature map value is scaled to a sample range corresponding to the bit depth of the video encoder 120. For 10-bit operations, the normalized feature map is multiplied by the feature map group 512, then the offset of the feature map group 512 is added, and the sum is converted to integer precision and output as the integerized feature map 520. The multiplication and addition operations result in the utilization of at least one value of the minimum or maximum allowed sample value (i.e., 0 or 1023 for 10-bit video) among the feature maps of a given feature map group. To provide some resilience against possible overshoots at the output of the video decoder 144, the multiplication factor applied to the normalized feature map may be reduced compared to the maximum possible multiplication factor that may be used without introducing clipping. For regular video represented in the YCbCr color space, a "video range" of 16 to 235 or 8-bit video data and a "video range" of 64 to 940 for 10-bit video data are defined. Thus, the multiplication factor can be reduced to 7 / 8 of the full value, resulting in a similar sample range as found in the video range of YCbCr video data. The resulting multiplication factor is 7 / 8 x (1 << (bit_depth-1)). The offset factor used to shift negative tensor values ​​to the positive range is left at the midpoint, i.e., 1 << (bit_depth-1), which corresponds to the default predictor of unavailable reference samples for intra prediction, as described with reference to Figures 6 and 7. If the integer values ​​generated from the quantization exceed the range allowed by the bit depth of the samples in the frame, clipping is applied to ensure that the integer values ​​remain within the bit depth of the samples in the frame.The integerized feature maps 520 are passed to a packer module 522, which generates a packed feature map frame 117 that includes each feature map of the integerized feature maps 520 arranged according to a packing format. The packing format is further described with reference to Figures 11-13. The resulting packed feature map frame 117 is passed to the video encoder 120 via a multiplexer 118.

[0068] FIG. 6 is a schematic block diagram showing the functional modules of the video encoder 120. FIG. 7 is a schematic block diagram showing the functional modules of the video decoder 144. In general, data passes between the functional modules in the video encoder 120 and the functional modules in the video decoder 144 in groups of samples or coefficients, such as division of blocks into fixed-size sub-blocks, or as arrays. The video encoder 120 and the video decoder 144 may be implemented using a general-purpose computer system 200, as shown in FIG. 2A and FIG. 2B, and the various functional modules may be implemented by dedicated hardware in the computer system 200, by software executable within the computer system 200, such as one or more software code modules of a software application program 233 residing on a hard disk drive 205 and controlled in its execution by the processor 205. Alternatively, the video encoder 120 and the video decoder 144 may be implemented by a combination of dedicated hardware and software executable within the computer system 200. The video encoder 120, the video decoder 144, and the methods described may alternatively be implemented in dedicated hardware, such as one or more integrated circuits performing the functions or sub-functions of the methods described. Such dedicated hardware may include a graphics processing unit (GPU), a digital signal processor (DSP), an application specific standard product (ASSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or one or more microprocessors and associated memories. In particular, the video encoder 120 comprises modules 610-690, and the video decoder 144 comprises modules 720-796, each of which may be implemented as one or more software code modules of the software application program 233.

[0069] The video encoder 120 of FIG. 6 is an example of a generic video coding (VVC) video encoding pipeline, although other video codecs may be used to perform the processing stages described herein. The video encoder 120 receives frame data 119, such as a sequence of frames, each frame including one or more color channels. The frame data 119 may be of any chroma format and bit depth supported by the profile in use, e.g., 4:0:0, 4:2:0 for the "Main 10" profile of the VVC standard, with 8-10 bits of sample precision. The block partitioner 610 first divides the frame data 119 into CTUs that are roughly square in shape and configured such that a specific size for the CTU is used. The maximum valid size of the CTU may be, for example, 32×32, 64×64, or 128×128 luma samples, configured by the "sps_log2_ctu_size_minus5" syntax element present in the "sequence parameter set". The CTU size also provides the maximum CU size since a CTU without further division contains one CU. The block partitioner 610 further divides each CTU into one or more CBs according to the luma coding tree and the chroma coding tree. The luma channel may also be referred to as a primary color channel. Each chroma channel may also be referred to as a secondary color channel. The CBs may have various sizes and include both square and non-square aspect ratios. However, in the VVC standard, CBs, CUs, PUs, and TUs always have side lengths that are powers of two. Thus, a current CB, represented as 612, is output from the block partitioner 610, which proceeds according to the iteration over one or more blocks of the CTU according to the luma coding tree and the chroma coding tree of the CTU.CUs or CBs are generated by recursively partitioning the CTU using quadtree partitioning (partitioning into four subregions arranged as a 2x2 partition of the parent region), binary partitioning (partitioning horizontally or vertically into two equally sized subregions of the parent region), and ternary partitioning (partitioning horizontally or vertically into three subregions with an area ratio of 1:2:1).

[0070] Although the operations are generally described per CTU, the video encoder 120 and the video decoder 144 may operate on smaller sized regions to reduce memory consumption. For example, each CTU may be divided into smaller regions known as "virtual pipeline data units" (VPDUs) of size 64x64. The VPDUs form a data granularity more suitable for pipeline processing in hardware architectures, and the reduced memory footprint reduces silicon area, and therefore cost, compared to operating on a full CTU. When the CTU size is 128x128, restrictions on the allowed coding trees are placed to ensure that the processing of one VPDU is fully completed before proceeding to the next VPDU. For example, at the root node of a coding tree for a 128x128 CTU, ternary splitting is prohibited because the resulting CUs (such as 32x128 / 128x32, or further decompositions thereof) cannot be processed with the required progression from one 64x64 region to a subsequent 64x64 region. If the CTU size is 64x64, then regardless of the coding tree selected by the encoder, processing always completes one 64x64 region before proceeding to the next 64x64 region (i.e., from one CTU to the next).

[0071] The CTUs resulting from the initial partition of frame data 119 may be scanned in raster scan order and grouped into one or more "slices." A slice may be an "intra" (or "I") slice. An intra slice (I slice) indicates that all CUs in the slice are intra predicted. Generally, the first picture in a coding layer video sequence (CLVS) contains only I slices and is called an "intra picture." A CLVS may contain periodic intra pictures that form "random access points" (i.e., intermediate frames in a video sequence where decoding may begin). Alternatively, a slice may be uni-predictive or bi-predictive ("P" or "B" slices, respectively), indicating additional availability of uni-prediction and bi-prediction in the slice, respectively.

[0072] When a chroma format other than 4:0:0 is used, in an I slice, the coding tree of each CTU may diverge below the 64x64 level into two separate coding trees, one for luma and another for chroma. The use of separate trees allows for different block structures to exist between luma and chroma within the luma 64x64 area of ​​a CTU. For example, a large chroma CB may be colocated with multiple smaller luma CBs, and vice versa. In a P or B slice, a single coding tree for a CTU defines a common block structure for luma and chroma. The resulting blocks of the single tree may be intra-predicted or inter-predicted.

[0073] For each CTU, the video encoder 120 operates in two stages. In the first stage (called the "search" stage), the block partitioner 610 tests various potential configurations of the coding tree. Each potential configuration of the coding tree has an associated "candidate" CB. The first stage involves testing various candidate CBs to select a CB that provides relatively high compression efficiency at relatively low distortion. The testing generally involves Lagrangian optimization, whereby the candidate CBs are evaluated based on a weighted combination of rate (i.e., coding cost) and distortion (i.e., error relative to the input frame data 119). The "best" candidate CB (i.e., the CB with the lowest evaluated rate / distortion) is selected for subsequent encoding into the bitstream 121. Included in the evaluation of the candidate CBs are the options of using a CB for a given area, or further dividing the area according to various partitioning options and coding each of the smaller resulting areas with additional CBs, or further dividing the area. As a result, both the coding tree and the CB itself are selected in the search stage.

[0074] For each CB, e.g., CB 612, the video encoder 120 generates a prediction block (PB), indicated by arrow 620. The PB 620 is a prediction of the content of the associated CB 612. A subtractor module 622 generates a difference (or a "residual", referring to the difference in the spatial domain) between the PB 620 and the CB 612, indicated as 624. The difference 624 is a block-sized difference between corresponding samples in the PB 620 and the CB 612. The difference 624 is transformed and quantized, and represented as a transform block (TB), indicated by arrow 636. The PB 620 and the associated TB 636 are typically selected from one of many possible candidate CBs, e.g., based on an estimated cost or distortion.

[0075] A candidate coding block (CB) is a CB resulting from one of the prediction modes available to the video encoder 120 for an associated PB and the resulting residual. When combined with the predicted PB in the video encoder 120, the TB 636 reduces the difference between the decoded CB and the original CB 612 at the expense of additional signal in the bitstream.

[0076] Thus, each candidate coding block (CB), i.e., prediction block (PB) in combination with a transform block (TB), has an associated coding cost (or "rate") and an associated differential (or "distortion"). The distortion of a CB is typically estimated as a difference in sample values, such as sum of absolute differences (SAD), sum of squared differences (SSD), or a Hadamard transform applied to the difference. The resulting estimate from each candidate PB may be determined by a mode selector 686 using the differentials 624 to determine a prediction mode 687. The prediction mode 687 indicates a decision to use a particular prediction mode for the current CB, e.g., intra-frame prediction or inter-frame prediction. The estimation of the coding cost associated with each candidate prediction mode and the corresponding residual coding may be performed at a significantly lower cost than entropy coding of the residual. Thus, several candidate modes may be evaluated to determine the optimal mode in rate-distortion detection, even in a real-time video encoder.

[0077] Determining the optimal mode in terms of rate-distortion is typically accomplished using a variation of Lagrangian optimization.

[0078] A Lagrangian or similar optimization process may be used both to select the optimal partitioning of the CTUs into CBs (by the block partitioner 610) as well as to select the best prediction mode from multiple possibilities. Through application of a Lagrangian optimization process of the candidate modes in the mode selection module 686, the intra-prediction mode with the lowest cost measure is selected as the "best" mode. The lowest cost mode includes the selected secondary transform index 688, which is also encoded in the bitstream 121 by the entropy encoder 638.

[0079] In the second stage of operation of the video encoder 120 (called the "coding" stage), iterations over the determined coding trees for each CTU are performed in the video encoder 120. For CTUs using separate trees, for each 64x64 luma region of the CTU, the luma coding tree is coded first, and then the chroma coding tree is coded. Only the luma CB is coded in the luma coding tree, and only the chroma CB is coded in the chroma coding tree. For CTUs using a shared tree, a single tree describes the CUs (i.e., luma CB and chroma CB) according to the common block structure of the shared tree.

[0080] The entropy encoder 638 supports bit-wise coding of syntax elements using variable-length and fixed-length codewords, as well as arithmetic coding modes for syntax elements. Some parts of the bitstream, such as "parameter sets," e.g., sequence parameter set (SPS) and picture parameter set (PPS), use a combination of fixed-length and variable-length codewords. Slices, also called contiguous parts, have a slice header that uses variable-length coding, followed by slice data that uses arithmetic coding. The slice header defines parameters specific to the current slice, such as slice-level quantization parameter offsets. The slice data includes syntax elements for each CTU in the slice. The use of variable-length and arithmetic coding requires sequential parsing within each part of the bitstream. Parts may be delimited by start codes to form "Network Abstraction Layer Units" or "NAL Units." Arithmetic coding is supported using a context-adaptive binary arithmetic coding process.

[0081] An arithmetically coded syntax element consists of a sequence of one or more "bins". Bins, like bits, have a value of "0" or "1". However, bins are not coded into the bitstream 121 as discrete bits. Bins have an associated predicted (or "likely" or "most likely") value and an associated probability known as a "context". When the actual bin to be coded matches the predicted value, a "most probable symbol" (MPS) is coded. Coding the most probable symbol is relatively inexpensive in terms of consumed bits in the bitstream 121 and involves a cost equivalent to less than one discrete bit. When the actual bin to be coded does not match a possible value, a "least probable symbol" (LPS) is coded. Coding the least probable symbol has a relatively high cost in terms of consumed bits. The bin coding technique allows for efficient coding of bins where the probability of "0" vs. "1" is skewed. For syntax elements with two possible values ​​(i.e., "flags"), a single bin is appropriate. For syntax elements with many possible values, a sequence of bins is required.

[0082] The presence of a later bin in the sequence may be determined based on the value of a previous bin in the sequence. Furthermore, each bin may be associated with two or more contexts. The selection of a particular context may depend on the previous bin in the syntax element, the bin values ​​of adjacent syntax elements (i.e., from adjacent blocks), etc. Each time a context-coded bin is coded, the context selected for that bin (if any) is updated in a manner that reflects the new bin value. In this manner, the binary arithmetic coding scheme is said to be adaptive.

[0083] Also supported by the entropy encoder 638 are bins that lack context, called "bypass bins." Bypass bins are coded assuming an equal probability distribution between "0" and "1." Thus, each bin has a coding cost of 1 bit in the bitstream 121. The lack of context saves memory and reduces complexity, and thus bypass bins are used when the distribution of values ​​for a particular bin is skewed. One example of an entropy coder that uses context and adaptation is known in the art as CABAC (context-adaptive binary arithmetic coder), and many variations of this coder are used in video coding.

[0084] The entropy encoder 638 encodes the quantization parameter 692 and, if used for the current CB, encodes the LFNST index 388 using a combination of context-coded and bypass-coded bins. The quantization parameter 692 is coded using a "delta QP". The delta QP is signaled at most once in each area known as a "quantization group". The quantization parameter 692 is applied to the residual coefficients of the luma CB. An adjusted quantization parameter is applied to the residual coefficients of the co-located chroma CB. The adjusted quantization parameter may include mapping from the luma quantization parameter 692 according to a CU level offset selected from a list of offsets and a mapping table. The secondary transform index 688 is signaled when the residual associated with the transform block contains significant residual coefficients only at coefficient positions that are transformed to primary coefficients by application of a secondary transform.

[0085] The multiplexer module 684 outputs the PB 620 from the intra-frame prediction module 664 according to the determined best intra-prediction mode selected from the tested prediction modes of each candidate CB. The candidate prediction modes need not include all possible prediction modes supported by the video encoder 120. Intra-prediction is divided into three types: first, "DC intra-prediction" involves populating the PB with a single value representing the average of nearby reconstructed samples; second, "planar intra-prediction" involves populating the PB with samples according to a plane, where the DC offset and vertical and horizontal gradients are derived from nearby reconstructed neighboring samples. The neighboring reconstructed samples typically include a row of reconstructed samples above the current PB that extends to the right of the PB to a certain extent, a column of reconstructed samples to the left of the current PB that extends downward beyond the PB to a certain extent, and a third, "angular intra-prediction" that involves populating the PB with reconstructed neighboring samples that have been filtered and propagated across the PB in a particular direction (or "angle"). In VVC, 65 angles are supported, and rectangular blocks can utilize additional angles not available to square blocks, yielding a total of 87 angles.

[0086] A fourth type of intra prediction is available for chroma PB, whereby the PB is generated from co-located luma reconstructed samples according to a "Cross-Component Linear Model" (CCLM) mode. Three different CCLM modes are available, each using a different model derived from adjacent luma and chroma samples. The derived model is used to generate a block of samples for the chroma PB from the co-located luma samples. The luma block may be intra predicted using a matrix multiplication of a reference sample with one matrix selected from a predefined set of matrices. This matrix intra prediction (MIP) achieves gains by using matrices trained on a large set of video data, where the matrices represent relationships between reference samples and predicted blocks that are not easily captured in angular, planar, or DC intra prediction modes.

[0087] Module 664 may also generate prediction units by copying blocks from nearby the current frame using the "intra block copy" (IBC) method. The location of the reference block is constrained to an area equivalent to one CTU divided into 64x64 regions known as VPDUs, which covers the VPDUs of the previous CTU and the processed VPDUs of the current CTU up to the area limit of one CTU. This area is known as the "IBC virtual buffer" and limits the IBC reference area and therefore the storage required. The IBC buffer is populated with the reconstructed samples 654 (i.e., before loop filtering), therefore a separate buffer to the frame buffer 672 is required.

[0088] Residuals of predicted blocks when encoding feature map data are different from those found for natural videos. Such natural videos are typically captured by image sensors or screen content, such as commonly found in operating system user interfaces. Feature map residuals tend to contain a lot of detail, which lends itself to transforms that skip coding more than the predominantly low frequency coefficients of various transforms. Experiments show that feature map residuals have enough local similarity to benefit from transform coding. However, the distribution of feature map residual coefficients is not clustered toward the DC (top left) coefficient of the transform block. In other words, there is enough correlation for the transform to show gain when encoding feature map data, which is also true when intra block copies are used to generate predicted blocks of feature map data. Thus, Hadamard cost estimates may be used when evaluating residuals resulting from candidate block vectors for intra block copies when encoding feature map data, rather than relying solely on SAD or SSD cost estimates. The SAD or SSD cost estimation tends to select block vectors whose residuals are more suitable for transform skip coding and may miss block vectors whose residuals are compactly coded using transforms. The Multiple Transform Selection (MTS) tool of the VVC standard can be used when encoding feature map data, so that in addition to the DCT-2 transform, a combination of DCT-7 and DCT-8 transforms are available horizontally and vertically for residual coding.

[0089] An intra-predicted luma coding block may be partitioned either vertically or horizontally into a set of equally sized prediction blocks, with each block having a minimum area of ​​16 luma samples. This intra-subpartition (ISP) approach allows separate transform blocks to contribute to the prediction block generation from one subpartition to the next in the luma coding block, improving compression efficiency.

[0090] If no previously reconstructed neighboring samples are available, e.g., at the edge of a frame, a default halftone value of half the range of samples is used. For example, for 10-bit video, a value of 512 is used. Since no previous samples are available for the CB located at the top-left position of the frame, the angular and planar intra prediction modes produce the same output as the DC prediction mode (i.e., a plane of samples with halftone values ​​as magnitudes).

[0091] For inter-frame prediction, the prediction block 682 is generated by the motion compensation module 680 using samples from one or two frames preceding the current frame in the coding order frames in the bitstream, and output as the PB 620 by the multiplexer module 684. Furthermore, for inter-frame prediction, a single coding tree is typically used for both the luma and chroma channels. The order of coding the frames in the bitstream may differ from the order of the frames when captured or displayed. When one frame is used for prediction, the block is said to be "uni-predictive" and has one associated motion vector. When two frames are used for prediction, the block is said to be "bi-predictive" and has two associated motion vectors. For P slices, each CU may be intra-predicted or uni-predicted. For B slices, each CU may be intra-predicted, uni-predicted, or bi-predicted.

[0092] Frames are typically coded using a "group of pictures" structure, allowing for a temporal hierarchy of frames. A frame may be divided into multiple slices, each of which codes a portion of the frame. The temporal hierarchy of frames allows frames to reference previous and subsequent pictures in the order in which they are displayed. Pictures are coded in the order required to ensure that dependencies for decoding each frame are satisfied. Instead of using one or two motion vectors to select and filter reference sample blocks for a prediction unit, an affine inter-prediction mode is available in which the prediction unit is divided into multiple smaller blocks and a motion field is generated, so that each smaller block has a separate motion vector. The motion field uses the motion vectors of points near the prediction unit as "control points". Affine prediction allows for coding of motion to different transformations with less need to use deeply partitioned coding trees. The bi-prediction mode available for VVC performs a geometric blend of two reference blocks along a selected axis with an angle and offset from the center of the signaled block. This geometric partition mode ("GPM") allows the use of larger coding units along the boundary between two objects, with the geometry of the boundary coded for the coding unit as the angle and center offset. Instead of using Cartesian (x, y) offsets, the motion vector difference may be coded as a direction (up / down / left / right) and distance, using a set of supported power-of-two distances. The motion vector predictor is obtained from the neighboring block ("merge mode") as if no offset was applied. The current block shares the same motion vector as the selected neighboring block.

[0093] The samples are selected according to the motion vector 678 and the reference picture index. The motion vector 678 and the reference picture index apply to all color channels, and therefore inter prediction is primarily described in terms of operation on the PU rather than the PB. The decomposition of each CTU into one or more inter prediction blocks is described with a single coding tree. Inter prediction methods may vary in the number of motion parameters and their precision. The motion parameters typically comprise a reference frame index indicating which reference frame from a list of reference frames should be used and a spatial transformation for each of the reference frames, but may include more frames, dedicated frames, or complex affine parameters such as scaling and rotation. In addition, a certain motion refinement process may be applied to generate a dense motion estimate based on the referenced sample block.

[0094] Determining and selecting the PB 620 and subtracting it from the original sample block in a subtractor 622 results in a residual with the lowest coding cost represented as 624, which undergoes lossy compression. The lossy compression process includes the steps of transformation, quantization, and entropy coding. A forward primary transform module 626 applies a forward transform to the difference 624, transforming it from the spatial domain to the frequency domain and generating primary transform coefficients represented by arrow 628. The maximum primary transform size in one dimension is either a 32-point DCT-2 or a 64-point DCT-2 transform, configured by the "sps_max_luma_transform_size_64_flag" in the sequence parameter set. If the CB being coded is larger than the maximum supported primary transform size, represented as a block size (e.g., 64x64 or 32x32), the primary transform 626 is applied in a tiled manner to transform all samples of the difference 624. When non-square CBs are used, tiling is also performed using the largest available transform size in each dimension of the CB. For example, when a maximum transform size of 32 is used, a 64x16 CB uses two 32x16 primary transforms arranged in a tiled fashion. When a CB is larger in size than the maximum supported transform size, the CB is filled with TBs in a tiled fashion. For example, a 128x128 CB with a 64-pt transform maximum size is filled with four 64x64 TBs in a 2x2 arrangement. A 64x128 CB with a 32-pt transform maximum size is filled with eight 32x32 TBs in a 2x4 arrangement.

[0095] Application of the transform 626 results in multiple TBs for the CB. If each application of the transform operates on a difference 624 larger than 32×32, e.g., a 64×64 TB, all resulting primary transform coefficients 628 outside the top-left 32×32 area of ​​the TB are set to zero (i.e., discarded). The remaining primary transform coefficients 628 are passed to a quantizer module 634. The primary transform coefficients 628 are quantized according to a quantization parameter 692 associated with the CB to generate primary transform coefficients 632. In addition to the quantization parameter 692, the quantizer module 634 may also apply a "scaling list" to enable non-uniform quantization within the TB by further scaling the residual coefficients according to their spatial location within the TB. The quantization parameter 692 may be different for the luma CB versus each chroma CB. The primary transform coefficients 632 are passed to a forward secondary transform module 630 to generate transform coefficients represented by arrow 636 by performing a non-separable secondary transform (NSST) operation or by bypassing the secondary transform. The forward primary transform is typically separable, transforming a set of rows and then a set of columns of each TB. The forward primary transform module 626 uses either a type II discrete cosine transform (DCT-2) in the horizontal and vertical directions, or bypasses the transform in the horizontal and vertical directions, or a combination of a type VII discrete sine transform (DST-7) and a type VIII discrete cosine transform (DCT-8) in the horizontal or vertical directions for luma TBs whose width and height do not exceed 16 samples. The use of a combination of DST-7 and DCT-8 is referred to as a "multiple transform selection set" (MTS) in the VVC standard.

[0096] The forward secondary transform of module 630 is generally a non-separable transform, which is applied only to the residual of intra-predicted CUs, and may nevertheless be bypassed. The forward secondary transform operates on either 16 samples (configured as a 4×4 sub-block at the top left of the primary transform coefficients 628) or 48 samples (configured as three 4×4 sub-blocks at the top left 8×8 coefficients of the primary transform coefficients 628) to generate a set of secondary transform coefficients. The set of secondary transform coefficients may be fewer in number than the set of primary transform coefficients from which they are derived. By applying the secondary transform only to a set of coefficients that are adjacent to each other and that include a DC coefficient, the secondary transform is referred to as a “low-frequency non-separable secondary transform” (LFNST). Furthermore, when LFNST is applied, all remaining coefficients in the TB are zero, both in the primary transform domain and the secondary transform domain.

[0097] The quantization parameter 692 is constant for a given TB, thus resulting in uniform scaling for the generation of residual coefficients in the primary transform domain for the TB. The quantization parameter 692 may vary periodically with the signaled "delta quantization parameter". The delta quantization parameter (delta QP) is signaled once for the CUs contained within a given area, called a "quantization group". If the CU is larger than the quantization group size, the delta QP is signaled once with one of the TBs of the CU. That is, the delta QP is signaled by the entropy encoder 638 once for the first quantization group of the CU and not for any subsequent quantization groups of the CU. Non-uniform scaling is also possible by applying a "quantization matrix", whereby the scaling factor applied to each residual coefficient is derived from a combination of the quantization parameter 692 and a corresponding entry in the scaling matrix. The scaling matrix may have a size smaller than the size of the TB, and when applied to the TB, a nearest neighbor approach is used to provide a scaling value for each residual coefficient from a scaling matrix of a size smaller than the TB size. The residual coefficients 636 are provided to an entropy encoder 638 for encoding in the bitstream 121. Typically, the residual coefficients of each TB having at least one significant residual coefficient of a TU are scanned to generate an ordered list of values ​​according to a scan pattern. The scan pattern generally scans the TB as a sequence of 4×4 “subblocks”, providing a regular scanning operation with a granularity of 4×4 sets of residual coefficients, the arrangement of the subblocks being dependent on the size of the TB. The scan within each subblock and the progression from one subblock to the next typically follows a backward diagonal scan pattern. Additionally, a quantization parameter 692 is coded into the bitstream 121 using a delta QP syntax element, and a secondary transform index 688 is coded into the bitstream 121.

[0098] As mentioned above, the video encoder 120 needs to access a frame representation that corresponds to the decoded frame representation seen by the video decoder 144. Thus, the residual coefficients 636 pass through an inverse secondary transform module 644, operating according to a secondary transform index 688 to generate intermediate inverse transform coefficients represented by arrow 642. The intermediate inverse transform coefficients 642 are inverse quantized by an inverse quantizer module 640 according to a quantization parameter 692 to generate inverse transform coefficients represented by arrow 646. The inverse quantizer module 640 may also perform inverse non-uniform scaling of the residual coefficients using a scaling list, which corresponds to the forward scaling performed in the quantizer module 634. The inverse transform coefficients 646 are passed to an inverse primary transform module 648 to generate residual samples of the TUs, represented by arrow 650. The inverse primary transform module 648 applies a DCT-2 transform horizontally and vertically, constrained by the maximum available transform size, as described with reference to the forward primary transform module 626. The type of inverse transform performed by the inverse secondary transform module 644 corresponds to the type of forward transform performed by the forward secondary transform module 630. The type of inverse transform performed by the inverse primary transform module 648 corresponds to the type of primary transform performed by the primary transform module 626. The summation module 652 sums the residual samples 650 and the PU 620 to generate reconstructed samples of the CU (indicated by arrow 654).

[0099] The reconstructed samples 654 are passed to a reference sample cache 656 and an in-loop filter module 668. The reference sample cache 656, typically implemented using static RAM on the ASIC to avoid costly off-chip memory accesses, provides the minimum sample storage required to satisfy the dependencies for generating intra-frame PBs for subsequent CUs in the frame. The minimum dependencies typically include a "line buffer" of samples along the bottom of a row of CTUs for use by the next row of CTUs, and column buffering whose extent is set by the height of the CTU. The reference sample cache 656 provides reference samples (represented by arrow 658) to a reference sample filter 660. The sample filter 660 applies a smoothing operation to generate filtered reference samples (indicated by arrow 662). The filtered reference samples 662 are used by an intra-frame prediction module 664 to generate an intra-predicted block of samples, represented by arrow 666. For each candidate intra-prediction mode, intra-frame prediction module 664 generates a block of samples, i.e., 666. The block of samples 666 is generated by module 664 using a technique such as DC, planar, or angular intra prediction. The block of samples 666 may also be generated using a matrix multiplication approach with neighboring reference samples as input and a matrix selected by video encoder 120 from a set of matrices, with the selected matrix being signaled in bitstream 120 using an index to identify which matrix of the set of matrices should be used by video decoder 144.

[0100] The in-loop filter module 668 applies several filtering stages to the reconstructed samples 654. The filtering stages include a "deblocking filter" (DBF) that applies smoothing aligned to CU boundaries to reduce artifacts due to discontinuities. The deblocking filter smooths block edges where coding artifacts resulting from transform basis functions causing misaligned boundaries along block boundaries may be seen, and such artifacts are more visible at higher values ​​of the quantization parameter 692. At lower values ​​of the quantization parameter 692, the filtering strength of the deblocking filter is reduced. Another filtering stage present in the in-loop filter module 668 is the "adaptive loop filter" (ALF), which applies a Wiener-based adaptive filter to further reduce distortion. A further filtering stage available in the in-loop filter module 668 is the "sample adaptive offset" (SAO) filter. The SAO filter operates by first classifying the reconstructed samples into one or more categories and applying an offset at the sample level according to the assigned category.

[0101] The filtered samples, represented by arrow 670, are output from the in-loop filter module 668. The filtered samples 670 are stored in a frame buffer 672. The frame buffer 672 typically has the capacity to store several (e.g., up to 16) pictures and is therefore stored in the memory 206. The frame buffer 672 is typically not stored using on-chip memory due to the large memory consumption required. Therefore, access to the frame buffer 672 is costly in terms of memory bandwidth. The frame buffer 672 provides reference frames (represented by arrow 674) to a motion estimation module 676 and a motion compensation module 680.

[0102] The motion estimation module 676 estimates several "motion vectors" (denoted as 678), each of which is a Cartesian space offset from the position of the current CB and refers to a block in one of the reference frames in the frame buffer 672. A filtered block of reference samples (denoted as 682) is generated for each motion vector. The filtered reference samples 682 form further candidate modes available for potential selection by the mode selector 686. Furthermore, for a given CU, the PU 620 may be formed using one reference block ("uni-predicted") or may be formed using two reference blocks ("bi-predicted"). For a selected motion vector, the motion compensation module 680 generates the PB 620 according to a filtering process that supports sub-pixel accuracy in the motion vector. Thus, the motion estimation module 676 (operating on many candidate motion vectors) can perform a simplified filtering process compared to that of the motion compensation module 680 (operating only on the selected candidate) to achieve a reduced amount of computation. When video encoder 120 selects inter prediction for a CU, motion vector 678 is encoded into bitstream 121.

[0103] 6 is described with reference to Generic Video Coding (VVC), other video coding standards or implementations may also employ the processing stages of modules 610-690. The frame data 119 (and bitstream 121) may also be stored in memory 206, hard disk drive 210, CD-ROM, Blu-ray disc TM2, or other computer-readable storage medium. Additionally, the frame data 119 (and bitstream 121) may be received from (or transmitted to) an external source, such as a server connected to the communications network 220 or a radio frequency receiver. The communications network 220 may provide limited bandwidth, necessitating the use of rate control in the video encoder 120 to avoid saturating the network when it is difficult to compress the frame data 119. Additionally, the bitstream 121 may be constructed from one or more slices representing spatial sections (a collection of CTUs) of the frame data 119, generated by one or more instances of the video encoder 120 operating cooperatively under the control of the processor 205.

[0104] The video decoder 144 is shown in Figure 7. The video decoder 144 of Figure 7 is an example of a generic video coding (VVC) video decoding pipeline, although other video codecs may be used to perform the processing stages described herein. As shown in Figure 7, a bitstream 143 is input to the video decoder 144. The bitstream 143 may be received from a memory 206, a hard disk drive 210, a CD-ROM, a Blu-ray disc TM or other non-transitory computer-readable storage medium. Alternatively, bitstream 143 may be received from an external source, such as a server connected to communications network 220 or a radio frequency receiver. Bitstream 143 includes encoded syntax elements representing captured frame data to be decoded.

[0105] The bitstream 143 is input to the entropy decoder module 720. The entropy decoder module 720 extracts syntax elements from the bitstream 143 by decoding a sequence of "bins" and passes the values ​​of the syntax elements to other modules in the video decoder 144. The entropy decoder module 720 uses variable-length and fixed-length decoding to decode the arithmetic decoding engine, SPS, PPS, or slice headers and decodes the syntax elements of the slice data as a sequence of one or more bins. Each bin can use one or more "contexts", which describe the probability levels used to code the "1" and "0" values ​​of the bin. If multiple contexts are available for a given bin, a "context modeling" or "context selection" step is performed to select one of the available contexts to decode the bin. The process of decoding the bins sequentially forms a feedback loop, so that each slice can be decoded in its entirety by a given entropy decoder 720 instance. A single (or a small number of) high-performance entropy decoder 720 instances can decode all slices of a frame from bitstream 143, and multiple low-performance entropy decoder 720 instances can simultaneously decode slices of a frame from bitstream 143.

[0106] The entropy decoder module 720 applies an arithmetic coding algorithm, such as "context-adaptive binary arithmetic coding" (CABAC), to decode syntax elements from the bitstream 143. The decoded syntax elements are used to reconstruct parameters in the video decoder 144. The parameters include residual coefficients (represented by arrow 724), quantization parameters 774, secondary transform indexes 770, and mode selection information such as intra-prediction modes (represented by arrow 758). The mode selection information also includes information such as motion vectors and partitioning of each CTU into one or more CBs. The parameters are used to generate PBs, typically combined with sample data from previously decoded CBs.

[0107] The residual coefficients 724 are passed to an inverse secondary transform module 736, where a secondary transform is applied or no operation is performed (bypassed) according to the secondary transform index. The inverse secondary transform module 736 generates reconstructed transform coefficients 732, i.e., primary transform domain coefficients, from the secondary transform domain coefficients. The reconstructed transform coefficients 732 are input to an inverse quantizer module 728. The inverse quantizer module 728 performs inverse quantization (or "scaling") on the residual coefficients 732, i.e., in the primary transform coefficient domain, according to a quantization parameter 774 to create reconstructed intermediate transform coefficients, represented by arrow 740. The inverse quantizer module 728 may also apply a scaling matrix to provide non-uniform inverse quantization within the TB, corresponding to the operation of the inverse quantizer module 640. If the use of a non-uniform inverse quantization matrix is ​​indicated in the bitstream 143, the video decoder 144 reads the quantization matrix from the bitstream 143 as a sequence of scaling factors and places the scaling factors into a matrix. Inverse scaling uses a quantization matrix in combination with the quantization parameters to create reconstructed intermediate transform coefficients 740 .

[0108] The reconstructed transform coefficients 740 are passed to an inverse primary transform module 744. The module 744 converts the coefficients 740 from the frequency domain back to the spatial domain. The inverse primary transform module 744 applies an inverse DCT-2 transform horizontally and vertically, constrained by the maximum available transform size, as described with reference to the forward primary transform module 626. The result of the operation of the module 744 is a block of residual samples, represented by the arrow 748. The size of the block of residual samples 748 is equal to the corresponding CB. The residual samples 748 are provided to a summation module 750.

[0109] In the summing module 750, the residual samples 748 are added to the decoded PB (represented as 752) to generate a block of reconstructed samples, represented by arrow 756. The reconstructed samples 756 are provided to a reconstructed sample cache 760 and to an in-loop filtering module 788. The in-loop filtering module 788 generates a reconstructed block of frame samples, represented as 792. The frame samples 792 are written to a frame buffer 796.

[0110] The reconstructed sample cache 760 operates similarly to the reconstructed sample cache 656 of the video encoder 120. The reconstructed sample cache 760 provides storage for reconstructed samples necessary to intra-predict subsequent CBs without the memory 206 (e.g., by using instead the data 232, which is typically an on-chip memory). Reference samples, represented by arrow 764, are obtained from the reconstructed sample cache 760 and provided to a reference sample filter 768 to generate filtered reference samples, indicated by arrow 772. The filtered reference samples 772 are provided to an intra-frame prediction module 776. The module 776 generates blocks of intra-predicted samples, represented by arrow 780, according to the intra-prediction mode parameters 758 signaled in the bitstream 143 and decoded by the entropy decoder 720. The intra-prediction module 776 supports the modes of the module 664, including IBC and MIP. The blocks of samples 780 are generated using modes such as DC, planar, or angular intra-prediction.

[0111] When the prediction mode of a CB is indicated to use intra prediction in the bitstream 143, the intra prediction samples 780 form the decoded PB 752 via the multiplexer module 784. Intra prediction produces a predictive block of samples (PB), which is a block in one color component derived using "neighboring samples" in the same color component. Neighboring samples are samples that are adjacent to the current block and have already been reconstructed by preceding it in the block decoding order. When a luma block and a chroma block are colocated, the luma block and the chroma block may use different intra prediction modes. However, the two chroma CBs share the same intra prediction mode.

[0112] When the prediction mode of the CB is indicated to be inter-predictive in the bitstream 143, the motion compensation module 734 generates a block of inter-predicted samples represented as 738. The block of inter-predicted samples 738 is generated using a motion vector decoded from the bitstream 143 by the entropy decoder 720 and a reference frame index to select and filter a block of samples 798 from the frame buffer 796. The block of samples 798 is obtained from a previously decoded frame stored in the frame buffer 796. In the case of bi-prediction, two blocks of samples are generated and blended together to generate samples for the decoded PB 752. The frame buffer 796 is populated with filtered block data 792 from the in-loop filtering module 788. Similar to the in-loop filtering module 668 of the video encoder 120, the in-loop filtering module 788 applies any of the DBF, ALF, and SAO filtering operations. In general, motion vectors are applied to both the luma and chroma channels, but the filtering processes for sub-sample interpolation in the luma and chroma channels are different.

[0113] Not shown in Figures 6 and 7 are modules for pre-processing the video before encoding and post-processing the video after decoding to shift sample values ​​such that a more uniform use of the range of sample values ​​in each chroma channel is achieved. A multi-segment linear model is derived in the video encoder 120 and signaled in the bitstream for use by the video decoder 144 to undo the sample shift. This Linear Model Chroma Scaling (LMCS) tool provides compression advantages for certain color spaces and content that have some degree of non-uniformity in sample space utilization, particularly limited range utilization, that may result in higher quality loss from the application of quantization.

[0114] FIG. 8 is a schematic block diagram illustrating a feature map inverse quantizer and unpacker 148 as part of the distributed machine task system 100. The decoded frames 147 are input to the unpacker module 810, where feature maps are extracted from each frame according to a packing format to generate an unpacked feature map 812. The unpacked feature map 812 includes sample values ​​present in the decoded frames 147. The packing format is further described with reference to FIGS. 11-13. The set of feature maps in the unpacked feature map 812 are assigned to groups according to the feature map groups 820 obtained from the decoded metadata 155, with each feature map belonging to one group, and one or more groups, as shown in the feature map groups 820. The inverse quantizer 814 then performs a scaling to convert the integer sample values ​​present in the unpacked feature map 812 to floating point values ​​present in the tensor 149. The scaling uses a quantization range for the group of feature maps. The quantization range is obtained from the quantization range 822 extracted from the decoded metadata 155. The quantization range specifies the maximum magnitude of any floating-point value found in the feature maps belonging to the corresponding group. The inverse quantizer 814 normalizes the samples from the feature maps 812 of each group to a range centered on zero and reaching 1 or -1 depending on whether the sign of the maximum amplitude value detected is positive or negative. In the rare cases where positive and negative values ​​have equal maximum magnitudes, the range [-1,1] is observed. The normalized samples of the group of feature maps are then multiplied (scaled) by the quantization range of the group of feature maps.

[0115] Once all groups of feature maps have been scaled, the result is output as intermediate data in the form of tensors 149. Tensors 149 may include multiple tensors, each with a different spatial resolution, for example when the CNN backbone 114 includes an FPN. In addition to using a zero-centered linear symmetric quantization process, other quantization processes are possible. For example, an asymmetric approach may be used in which positive and negative quantization ranges are signaled for each feature map group. The positive and negative quantization ranges map the range utilized by the floating-point values ​​of the group of features to the full sample range given by the bit depth of the samples, which results in asymmetric quantization as the midpoint of the sample range is no longer guaranteed to correspond to a zero floating-point value. The "quant_type" syntax element in the SEI message 1413 selects the quantization approach and is described with reference to Appendix A.

[0116] The quantization range for a given group of feature maps is derived from the values ​​in the group's feature map, but the quantization range must have the same data type as the values ​​in the group's feature map. A coarser floating-point precision may be used, and rounding is applied so that the range is not reduced when expressed in the original floating-point format (e.g., 32-bit IEEE754 format). For example, in step 1550, the coarser floating-point precision may be used with upward rounding. The upward rounding may be achieved by adding a constant value ε to the quantization range qr, resulting in an adjusted quantization range qr. adjust and ε=2 floor(log2(qr)) / 2 fract_prec where frac_prec is the number of fractional bits to preserve, and the "floor" operator then rounds towards negative integers. adjust The fract_prec leftmost bits of the fractional part of are taken into the SEI message and coded, the remaining bits are truncated, and the qr adjustcannot be smaller than qr. The precision of the quantization range in terms of bits allocated to the fractional part is selected using the "qr_fraction_precision" syntax element described with reference to Appendix A. By setting qr_fraction_precision(fract_prec) to 5, the quantization range can be set precisely, with a worst case increase of ~3% compared to the fractional precision of the original floating-point value, i.e., before reducing the fractional precision to 5 bits. A leading "1" is added to the fractional part to generate the mantissa of the quantization range (i.e., the quantization range does not have to be a "denormal" value). Since the quantization ranges are always positive, there is no need to code a sign bit for each quantization range. Since the quantization ranges may be greater than or less than 1, a sign bit for the quantization range exponent is required. In the arrangement of the system 100, a quantization range less than 1.0 is not permitted, and the quantization exponent sign bit may be omitted from the SEI message 1413. If the quantization exponent sign bit is not coded, then quantization ranges less than 1.0 are clipped to the value 1.0 in the quantization range determination module 514 .

[0117] Although the operations of the inverse quantizer module 814 and the quantizer module 518 are referred to as "quantization," the operations of the modules 518 and 814 are distinct from the quantization operations of the video encoder 120 and the video decoder 144, which involve the use of quantization parameters. Furthermore, the operations of the modules 518 and 814 may be considered a form of tone mapping operation, which involves conversion between the floating-point domain of tensors and the sample domain of frames. Although there is scaling (i.e., via the quantization range of each group of feature maps) to take advantage of the wide range of sample value space, there is no quantization parameter applicable to the modules 518 and 814 to further modify the quantizer step size.

[0118] FIG. 9A is a schematic block diagram showing a head portion 150 of a CNN for object detection. Depending on the task to be performed in the destination device 140, different networks can be used instead of the CNN head 150. The input tensor 149 is separated into tensors for each layer (i.e., tensors 910, 920, and 934). The tensor 910 is passed to a CBL module 912 to generate a tensor 914, which is passed to a detection module 916 and an upscaler module 922. A bounding box 918 in the form of a detection tensor is passed to a non-maximum suppression (NMS) module 948 to generate a detection result 151. To generate a bounding box that addresses a coordinate in the original video data 113, a scaling by the original video width and height is performed before the resizing of the backbone portion of the network 114 (see "orig_source_width" and "orig_source_height", decoded from the SEI message 1413 and described with reference to Appendix A). The upscaler module 922 generates an upscaled tensor 924, which is passed to a CBL module 926, which generates a tensor 928 as an output. The tensor 928 is passed to a detection module 930 and an upscaler module 936. The detection module 930 generates a detection tensor 932, which is fed to the NMS module 948. The upscaler module 936 is another instance of a module 960, which outputs an upscaled tensor 938. The upscaled tensor 938 is passed to a CBL module 940, which outputs a tensor 942 to the detection module 944. The CBL modules 912, 926, and 940 each include a concatenation of five CBL modules. The upscaler modules 922 and 936 are each an instance of the upscaler module 960 as shown in FIG. 9B.

[0119] The upscaler module 960 accepts a tensor 962 as an input, which is passed to a CBL module 966 to generate a tensor 968. The tensor 968 is passed to an upsampler 970 to generate an upsampled tensor 972. The concatenation module 974 generates a tensor 976 by concatenating the upsampled tensor 972 with the input tensor 964. The detection modules 916, 930, and 944 are instances of a detection module 980 as shown in FIG. 9C. The detection module 960 receives a tensor 982, which is passed to a CBL module 984 to generate a tensor 986. The tensor 986 is passed to a convolution module 988 that implements a detection kernel. The detection kernel 1×1 kernel is applied to generate an output of feature maps in the three layers. The detection kernel is 1x1x(Bx(5+C)), where B is the number of bounding boxes a particular cell can predict, typically 3, and C is the number of classes, which can be 80, resulting in a kernel size of 255 detection attributes (i.e., tensor 990). The constant "5" represents four bounding box attributes (box center x, y and size scale x, y) and one object confidence level ("object-ness"). The result of the detection kernel has the same spatial dimension as the input feature map, but the depth of the output corresponds to the detection attribute. The detection kernel is applied to each layer, typically three layers, resulting in a large number of candidate bounding boxes. A process of non-maximum suppression is applied by the NMS module 948 to the resulting bounding boxes to discard redundant boxes, such as overlapping predictions at similar scales, resulting in a final set of bounding boxes as output for object detection.

[0120] FIG. 10 is a schematic block diagram showing an alternative head portion 1000 of a CNN. The head portion 1000 forms part of an overall network known as "faster RCNN" and includes a feature network (i.e., backbone portion 400), a region proposal network, and a detection network. The input to the head portion 1000 is a tensor 149 including the P2-P6 layer tensors 1010, 1012, 1014, 1016, and 1018. The P2-P6 tensors 1010, 1012, 1014, 1016, and 1018 are input to a region proposal network (RPN) head module 1020. The RPN head module 1020 performs convolutions on the input tensors to generate intermediate tensors that are fed to two subsequent sibling layers, one for classification and one for bounding boxes, or "regions of interest" (ROIs), to be regressed as classification and bounding boxes 1022. The classification and bounding boxes 1022 are passed to an NMS module 1024, which prunes redundant bounding boxes by removing duplicate boxes with lower scores to generate a pruned bounding box 1026. The bounding boxes 1026 are passed to a region of interest (ROI) pooler 1028, which uses a max pooling operation to generate a fixed size feature map from the various input size maps, and subsampling takes the maximum value within each group of input values ​​to generate one output value in the output tensor.

[0121] The inputs to the ROI puller 1028 are the P2-P5 feature maps 1010, 1012, 1014, and 1016, and the region of interest proposals 1026. Each proposal (ROI) from 1026 is associated with a portion of the feature maps (1010-1016) to generate a fixed-size map that is independent of the size of the underlying portions of the feature maps 1010-1016. One of the feature maps 1010-1016 is selected such that the resulting cropped map has sufficient detail, for example according to the following rule: floor(4+log2(sqrt(box_area) / 224), where 224 is the regular box size. Thus, the ROI puller 1028 crops the input feature map according to the proposal 1026 generating a tensor 1030. The tensor 1030 is fed to a fully connected (FC) neural network head 1032, which runs two fully connected layers to generate a class score and a bounding box predictor delta tensor 1034. The class score is typically calculated using a tensor size of 80%. The bounding box predictor delta tensor is an 80x4=320 element tensor, with each element corresponding to a predicted score for the corresponding object category. The bounding box predictor delta tensor is an 80x4=320 element tensor, containing the bounding boxes for the corresponding object category. Final processing is performed by the output layer module 1036, which receives the tensor 1034 and performs a filtering operation to produce a filtered tensor 1038. Low scoring (low classification) objects are removed from further consideration. The non-max suppression module 1040 removes overlapping bounding boxes by removing overlapping boxes with lower classification scores, resulting in the inference output tensor 151.

[0122] FIG. 11 is a schematic block diagram illustrating a feature map packing arrangement 1100 in a two-dimensional array in the form of a monochrome frame 1102. Three layers of feature maps, such as feature map 1110, feature map 1112, and feature map 1114, can be arranged in the frame 1102. In the example of FIG. 11, the frame 1102 includes an area, each corresponding to a feature map (e.g., feature map 1110). The feature maps 1110, 1112, and 1114 are arranged in a raster scan arrangement to fill the monochrome frame 1102. The size of the frame 1102 is first set according to the area of ​​all feature maps to be arranged in the frame 1102, and has an aspect ratio close to the aspect ratio of the target UHD frame, i.e., 3840 / 2160=1.78. The resolution can be increased, for example, to a multiple of the minimum block size, such that the width and height are multiples of 4, respectively. In arranging the feature maps, due to mismatch between feature map size and frame width, the final frame height may be increased to provide adequate space, allowing for some unused space due to the inability to pack feature maps together without unused space. Sample values ​​in unused spaces in frame 1102, such as unused space 1104, are set to the midtone point of the bit depth of the frame, i.e., 512 for a 10-bit frame. The size of the feature maps depends on the CNN backbone 114. For the "Darknet-53" backbone, the sizes are 136x76 for feature map 1110, with 256 instances, 68x38 for feature map 1112, with 512 instances, and 34x19 for feature map 1120, with 1024 instances. For clarity, FIG. 12 shows a frame 1202 with fewer feature maps than are present in a typical application, but the three layers and relative resolutions are represented in FIG. 12 as described below. Different CNNs and different splits between the "backbone" and "head" sections of the CNN may result in different dimensions and numbers of feature maps for each layer, as well as a different number of layers (i.e., amounts other than three layers).

[0123] In arranging the feature maps in a two-dimensional array in the form of a monochrome frame 1102, feature maps of the same group of frames are arranged adjacently in the frame 1102. For example, group 1106 includes feature map 1110, while groups 1108 and 1109 include the remaining feature maps in the layer. Similarly, group 1114 includes feature map 1112 with two additional groups for the layer. For simplicity, the grouping for the layer containing the smallest feature map (i.e., feature map 1120) is not shown, but the same group-wise packing approach is used. Within each group, the feature maps are in a determined ordering, and the arrangement in the monochrome frame 1102 reflects the ordering.

[0124] When aligning feature maps in monochrome frame 1202 of FIG. 12, alignment to a particular boundary, such as a 4×4 grid boundary, may be maintained. If the feature map size is not a multiple of such an alignment, unused sample space exists between adjacent feature maps. For example, a feature map of size 34×19 may be aligned occupying a 36×20 sample region, with the unused space occupied by mid-tone sample values. The presence of unused space between feature maps reduces the occurrence of coding artifacts in one feature map caused by content in an adjacent feature map and improves alignment of the feature maps to the underlying block structure of the video codec. For example, for VVC, a minimum block size of 4×4 is typically used.

[0125] In addition to aligning feature maps to a particular alignment grid, a minimum padding between feature maps, such as two samples, can also be implemented. The minimum padding helps to prevent artifacts in one feature map caused by content in neighboring feature maps when the feature map size is a multiple of the alignment grid. For example, a feature map of size 136x76 fits into a 4x4 alignment grid with no unused sample space inserted between itself and the neighboring feature map. The minimum padding area ensures some separation between neighboring feature maps, which can help to reduce coding artifacts crossing from one feature map to the neighboring feature map.

[0126] FIG. 12 is a schematic block diagram illustrating an alternative feature map packing arrangement 1200 in a monochrome frame 1202. The feature map packing arrangement 1200 is suitable for feature map groupings where there are multiple groupings of four feature maps. The groupings in FIG. 12 can be based on spatial similarity between the feature maps, resulting in grouping of similar feature maps. The spatial similarity can be measured using sum of absolute differences or sum of squared differences or some other similarity measure. The groupings are applied to feature maps in the same layer and do not span multiple layers. As seen in FIG. 12, grouping 1210 includes four feature maps. The feature maps of grouping 1210 are arranged in monochrome frame 1202 using sample-wise interleaving to occupy an area 2×2 of the constituent feature maps. Sample-wise interleaving results in higher structural details of the four feature maps shared by the same coding tree structure, and details between the four feature maps vary from sample to sample. Thus, a common coding tree structure and shared residuals (except for local differences required to code adjacent samples of different feature maps) are achieved, resulting in increased compression efficiency. Once all groups of size 4 are packed into monochrome frame 1202 for a given layer, the remaining feature maps, such as feature map 1214, are packed contiguously based on grouping, but not in an interleaved manner. The remaining feature maps may be assigned to groups of any size, since their group configuration does not affect the packing process, apart from the order of packing. In the next layer, four groups, such as group 1220, are packed in a sample-wise interleaved manner, followed by feature maps belonging to other sized groups, such as feature map 1224. For the final layer, four groups, such as group 1230, are packed in a sample-wise interleaved manner, followed by feature maps belonging to other sized groups, such as feature map 1234.

[0127] FIG. 13 is a schematic block diagram illustrating a feature map packing arrangement 1300 in a 4:2:0 chroma subsampled color frame 1301. A feature map group including two or three feature maps that have a high degree of similarity and belong to different layers is placed in different color channels in a collocated region of the color frame 1301. Thus, the location of at least a part of a first feature map in one layer corresponds relatively to the location of at least a part of a second feature map in another layer. For two feature maps in adjacent layers, the larger feature map is placed in the luma plane 1302, such as feature map 1304. The smaller of the two feature maps is placed in the chroma plane 1310, such as feature map 1314. If a group includes three feature maps, the third feature map is smaller in size than the feature map placed in the chroma plane 1310, and the third feature map is packed in the second chroma plane 1320 to be twice as large in size, resulting in a double packed feature map 1324. Since the two or three feature maps of a group are grouped based on spatial similarity, in the example of FIG. 13, a coding tool targeting inter-channel correlation can be utilized to improve compression efficiency when coding the color frame 1301. For example, a tool that attempts to predict chroma samples from luma based on a model of difference, such as a linear model targeting cross-color component prediction, can be applied. In the case of inter-slice, where a shared coding tree specifies the luma coding block and the chroma coding block, the block structure of the two or three feature maps is coded using a single coding tree instead of requiring separate coding trees as in the case where the feature maps are located at different positions.

[0128] FIG. 14 is a schematic block diagram illustrating a bitstream 1400 that holds encoded packed feature maps and associated metadata. The bitstream 1400 corresponds to the bitstream 121 generated by the video encoder 120 or the bitstream 143 decoded by the video decoder 134. The bitstream includes a group of syntaxes preceded by a "Network Abstraction Layer" unit header. For example, a NAL unit header 1408 precedes a sequence parameter set (SPS) 1410. The SPS 1410 may include a "Profile Level Tier" (PLT) unit of syntax 1438, which may include a "General Constraint Information" (GCI) unit of syntax (i.e., constraint flag 1440). The constraint flag 1440 is present in the SPS 1410 when "gci_present_flag" is present in the SPS 1410 and equal to 1, otherwise the constraint flag 1440 is not present in the SPS 1410. When constraint flags are present in SPS 1410, any one that is activated indicates that bitstream 1400 conforms to a restricted subset of tools or functions (which may correspond to a sub-profile) indicated in the signaled profile of bitstream 1400. When constraint flags are not present in SPS 1410, each constraint flag that would otherwise be signaled is inferred to have a value of zero, and the bitstream conforms to the signaled profile of bitstream 1400. Each flag in constraint flags 1440, when set, indicates the disabling of a particular tool within the VVC standard, with the flag's semantics defined in the VVC standard. A separate set of syntax elements (zero or more instances of the ptl_num_sub_profiles and general_sub_profile_idc syntax elements) identifies the particular sub-profile to which the bitstream conforms, with the definition of the sub-profile being defined outside the VVC standard. The GCI contains a set of flags, each of which constrains a particular coding tool not to be used in bitstream 1400.PLT 1438 may signal a particular set of tools, known as a "profile," that may be used in bitstream 1400. One example of a profile is "Main10," which provides 8-10 bit video with either 4:0:0 or 4:2:0 chroma format, and targets wide deployment. GCI may indicate further constraints on the set of tools of a profile to a subset of tools, which may correspond to a sub-profile. In general, when video encoder 120 is encoding video samples (i.e., from video source 112 via multiplexer 118), all tools of a given profile may be used to efficiently encode frame data. When video encoder 120 is encoding feature maps (i.e., from module 116) that have been packed into a frame, some tools of the VVC standard no longer provide a compression advantage. Tools that do not provide a compression advantage to packed feature maps need not be tried by video encoder 120 and may be signaled in the GCI as not being used in bitstream 1400. The SPS 1410 also indicates the chroma format, bit depth, and resolution of the frame data represented by the bitstream 1400 .

[0129] The Picture Parameter Set (PPS) 1412 contains syntax elements that control the lower level behavior of tools, including control of the deblocking filter. The PPS 1412 includes pps_deblocking_filter_control_present_flag, which, when set, indicates that the deblocking filter settings are controlled in the PPS 1412. When pps_deblocking_filter_control_present_flag is set, pps_deblocking_filter_disabled_flag is present in the PPS 1412. When pps_deblocking_filter_disabled_flag is present in the PPS 1412 and set to 1, the deblocking filter is disabled for all pictures that reference the PPS 1412, unless a further override of the deblocking control occurs in the picture header or slice header 1418 of the picture. When pps_deblocking_filter_disabled_flag is present in the PPS 1412 and set to 1, pps_deblocking_filter_override_enabled_flag is present in the PPS 1412. When pps_deblocking_filter_override_enabled_flag is present and set to 1 in the PPS 1412, the slice header 1418 or picture header of each picture includes an additional flag that may override the enabling or disabling of the deblocking filter indicated by pps_deblocking_filter_disabled_flag.

[0130] The SEI message 1413 encodes the feature map groupings 1430 as determined by the group determination module 510 and the quantization range 1432 as determined by the range determination module 514. Appendix A shows an example syntax and semantics of the SEI message 1413. The packing format used by the packer module 522 may also be encoded in the SEI message 1413 using an index to select one feature packing format from an enumeration of all available feature packing formats. The particular CNN backbone used to generate the feature map may be indicated in the SEI message 1413 with an index to select one CNN backbone from an enumeration of a set of predefined CNN backbones, some or all of which are available to the source device 110. From the CNN backbone type index, the number of layers and the number of channels in each layer, as well as the resolution of each feature map in each layer, may be determined. For groupings where the feature maps in a given group are in the same layer, a separate group list of feature map indexes is coded for each layer. For groupings where the feature maps in a given group may span multiple layers, a feature map index and layer index pair are coded as items in each group. For groupings where the feature maps are in adjacent layers and there is at most one feature map in each layer, a layer index is only needed for the first feature map in the group. If a group contains feature maps from all layers, e.g., in all three layers, a group index is not needed since the feature map index implicitly applies to one feature map in each layer. If all feature maps of a given layer belong to one distinct layer, one quantization range per layer is coded.

[0131] Each frame is coded in the bitstream 1400 as an "access unit", such as access unit 1414, as seen in FIG. 14. Each access unit contains one or more slices, such as slice 1416. For the first access unit of the bitstream, typically a "random access point" access unit, intra slices are used to avoid any prediction dependency on other access units in the bitstream 1400. Slice 1416 contains a slice header 1418 followed by slice data 1420. Slice data 1420 contains a sequence of CTUs that provide a coded representation of the frame data. CTUs are square and typically 128x128 in size, which is not well aligned with typical feature map sizes. Placing the feature maps on a minimum block size, such as a 4x4 grid, partially remedies this misalignment.

[0132] FIG. 15 illustrates a method 1500 for performing a first portion of a CNN and encoding a resulting feature map for a frame of video data. The method 1500 may be implemented using an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1500 may be implemented by the source device 110 as one or more software code modules of the application program 233 under execution of the processor 205. The software code modules of the application program 233 implementing the method 1500 may reside, for example, on the hard disk drive 210 and / or the memory 206. The method 1500 is repeated for each frame of video data generated by the video source 112. The method 1500 may be stored in a computer-readable storage medium and / or the memory 206.

[0133] The method 1500 begins with a run CNN first part step 1510. In step 1510, the CNN backbone 114, under execution of the processor 205, executes a subset of layers of a particular CNN to convert the input frame 113 into an intermediate tensor 115. Depending on the use of a prediction head or FPN, the tensor 115 may include multiple tensors. The method 1500 operates to encode a tensor corresponding to one frame of video data from the video source 112. Control in the processor 205 then passes from step 1510 to a feature map similarity determination step 1520. The intermediate tensor 115 may be stored, for example, in the memory 206 and / or the hard disk drive 210.

[0134] In a feature map similarity determination step 1520, the module 116, under execution of the processor 205, generates a similarity matrix including a measure of similarity of each feature map with each feature map in each layer. The similarity matrix may be stored, for example, in the memory 206 and / or the hard disk drive 210. The similarity measure may be the mean square difference (MSE) of the two feature maps, or the sum of absolute differences (SAD) of the two feature maps, or some other difference measure. If it is desired to measure the similarity of feature maps in different layers, the feature map with the lower spatial resolution may be upscaled (e.g., using nearest neighbor interpolation) to produce a resolution compatible with the higher spatial resolution for the purpose of the difference measurement. To reduce computational overhead, step 1520 is performed infrequently, for example, only for each random access point in the CLVS or for the first picture of the CLVS. Control in the processor 205 then passes from step 1520 to a feature map grouping determination step 1530.

[0135] In a feature map group determination step 1530, the group determiner 510, under execution of the processor 205, determines a set of groups to which the feature maps are assigned. The groups of feature maps may be stored, for example, in the memory 206 and / or the hard disk drive 210. The operation of the group determiner 510 is described with reference to Figure 17. Step 1530 needs to be performed when the similarity matrix of step 1520 has been determined, for example, for the first picture in the CLVS or for all random access points in the CLVS. Control in the processor 205 passes from step 1530 to a feature map placement determination step 1540.

[0136] In a feature map placement determination step 1540, the packer module 522, under execution of the processor 205, determines where each feature map is placed within the frame. When the frame is a monochrome frame, the feature maps are arranged in a raster scan order that fills the frame area, which is initialized based on the total area of ​​all feature maps to be packed into the frame and the target aspect ratio. The packing arrangement is described with reference to Figures 11-13. The packing format in use is determined from the "packing_format" syntax element decoded from the SEI message 1413, described with reference to Appendix A. The feature maps belonging to a given group are packed sequentially, and in the order in which the feature maps are listed within each group. As described with reference to Figure 13, groups of size 2 or 3 feature maps with each feature map belonging to a different layer are packed together spatially, but with different color channels. Since the number and size of the feature maps do not change during operation of the source device 110, the placement can be determined once and stored for use with subsequent frames. The packed frames may be stored, for example, in memory 206 and / or hard disk drive 210. Control in processor 205 then passes from step 1540 to a group range determination step 1550.

[0137] In a group range determination step 1550, the range determiner 514, under the execution of the processor 205, determines the range of the floating-point data in each group of feature maps determined in step 1530. The determined range may be stored, for example, in the memory 206 and / or the hard disk drive 210. In the case of symmetric operation, the range of a group is the maximum magnitude (absolute) value of the values ​​in the feature map belonging to the group. The range provides values ​​for normalization of the feature map data before quantization and conversion to integer sample values. In the case of asymmetric operation, a positive and negative range is determined for each group of feature maps, indicating the maximum positive and maximum negative values ​​encountered in the group of feature maps. A quantization range is determined for each group of feature maps in the tensor 115. The quantization range may be determined for the tensor of all frames of video data, or less frequent updates may be applied. To reduce signaling overhead, the quantization range may be determined for intra pictures or random access pictures only in the video bitstream. The range of the floating-point data tensors of subsequent frames for which the quantization range has not been determined may exceed the previously determined quantization range. A safety margin may be introduced by increasing the magnitude of the determined quantization range by some specified scaling factor. Multiplying the quantization range by a fixed factor, for example 8 / 7, compresses the sample range of the data used to a range that corresponds approximately to the video range used in YCbCr video data. Subsequent frames for which the quantization range may not be determined have some headroom beyond this range up to the limit of the sample bit depth, for example [0..1023] for 10-bit video. Control in the processor 205 then passes from step 1550 to a feature map quantization step 1560.

[0138] In a feature map quantization step 1560, the quantizer module 518, under the execution of the processor 205, quantizes each feature map from floating-point values ​​to integer sample values ​​according to the quantization range of the group to which the feature map belongs. The determined integer sample values ​​may be stored, for example, in the memory 206 and / or the hard disk drive 210. Scaling to a normalized range with a maximum value of 1.0 is performed first, followed by multiplication to the sample range and addition of an offset, resulting in utilization of a substantial portion of the sample magnitude. For 10-bit video, a multiplication factor 512 is used, and an offset quant_offset 512 is also used. A smaller multiplication factor may be used to reduce nonlinear effects from overshoots that may be introduced by the video encoder 120 and the video encoder 144. If the quantization range has not already been adjusted by a fixed factor, such as 8 / 7, to align with the video range commonly used in YCbCr video data, a scaling factor scale_f of 7 / 8x512=448 may be used. For 8-bit video data, an offset of 128 and a scaling factor of 128 or 112 for video range aligned operations may be used. If the quantization range was determined for a tensor from a previous frame and not updated for the current frame, it is possible for the input floating-point values ​​to exceed the quantization range for the feature map group to which the feature map belongs. A clipping operation is applied to prevent overflow when mapping floating-point values ​​to integer sample values. In one arrangement of the quantizer module 518, clipping to the range indicated by the quantization range of the floating-point values ​​is applied to prevent overflow. Clipping of the floating-point values ​​to the quantization range ensures that all samples are within the range [quant_offset-scale_f, quant_offset+scale_f]. In another arrangement of the quantizer module 518, clipping is applied after application of quant_offset and scale_f, at which point the determined values ​​can fall outside the range indicated by the bit depth, and is applied before conversion to integer sample values.Clipping is applied to ensure that the integer sample values are within the range indicated by the bit depth, i.e., [0..(1<<bit_depth)-1]. Clipping after scaling and before integer conversion, in combination with the scale_f value that utilizes a smaller range such as the video range, allows some headroom in subsequent frames to exceed the quantization range determined from the previous frame. There is also some tolerance for a certain amount of overshoot in the operation of video encoder 120 and video decoder 144 before clipping introduces non-linear distortion into the conversion from floating-point tensor to integer and back to floating-point tensor. Next, the control in processor 205 proceeds from step 1560 to feature map packing step 1570.

[0139] In feature map packing step 1570, pack module 522 packs integer feature map 520 under the execution of processor 205 to generate packed feature map frame 117. The quantized feature map 520 corresponding to the feature map from each layer of tensor 115 can be stored, for example, in a memory buffer configured in memory 206 that holds one frame of video data and / or hard disk drive 210. With reference to FIGS. 11 - 13, the packing format of the feature map will be described. Next, the control in processor 205 proceeds from step 1570 to metadata encoding step 1580.

[0140] In a metadata encoding step 1580, the entropy encoder 638, under execution of the processor 205, encodes the feature map groupings 512 and quantization ranges 516, i.e., metadata 125, into the bitstream 121. The metadata 125 may be encoded using an SEI message 1413, the format of which is described with reference to Appendix A. Control in the processor 205 then passes from step 1580 to a frame encoding step 1590. For the first picture (picture order count equals 0), the "layers_update", "groups_update", and "qr_update" flags in the SEI message 1413 are set, and the feature map layers and dimensions, feature map group definitions, and associated quantization ranges are encoded in the bitstream 121. The "qr_update" flag in the SEI message 1413 may be set periodically, and the quantization range information is updated accordingly. In the case of a random access configuration, every random access point or intra picture may include an updated quantization range. In the case of a low latency configuration, periodic updates of the quantization range may be done for inter pictures, e.g., approximately one picture per second, corresponding to the intra picture periodicity of the random access configuration. Updating the quantization range for some inter pictures allows for continuous adaptation to the structure-independent data of the bitstream (i.e., intra / inter slice selection), e.g., when intra pictures occur very rarely in the bitstream.

[0141] In a frame encoding step 1590, video encoder 120, under execution of processor 205, encodes frame 119 into bitstream 121. When source device 110 is configured to encode feature maps, frame 119 is obtained from packed feature map frame 117 via multiplexer 118. When source device 110 is configured to encode feature maps, video encoder 120 may use a subset of coding tools available for a profile of a video coding standard. The subset of coding tools may be signaled using a general constraint flag. For example, the “Main10” profile may be signaled in the profile level tier syntax 1438 in the bitstream 120, and the general constraint flags 1440 may signal that the following tools: LFNST (via gci_no_lfnst_constraint_flag), MIP (via gci_no_mip_constraint_flag), LMCS (via gci_no_lmcs_constraint_flag), ISP (via gci_no_isp_constraint_flag), Affine (via gci_no_affine_motion_constraint_flag), GPM (via gci_no_gpm_constraint_flag), MMVD (via gci_no_mmvd_constraint_flag) are not used in the bitstream 120. In addition to or instead of using GCI flags, sub-profiles may be identified in the bitstream using specific values ​​of the general_sub_profile_idc syntax element that may be defined outside the VVC standard for feature map encoding and included in SPS 1410. Disabling the deblocking filter improves compression efficiency when encoding feature maps, improving task performance.In the VVC coding standard, the deblocking filter is disabled for pictures that reference picture parameter sets in the bitstream 121 that have pps_deblocking_filter_disabled_flag set to "1", unless overridden at the slice or picture level by coding sh_deblocking_filter_disabled_flag with a value of "1" or by coding ph_deblocking_filter_disabled_flag with a value of "1". Deblocking is not explicitly disabled using a constraint flag in the VVC standard version 1, and thus disabling the deblocking filter does not form part of a tool subset that may be equivalent to a sub-profile for feature map coding, even though such disabling may present advantages. Method 1500 is complete, and processing in the processor 205 proceeds to the next frame.

[0142] FIG. 16 illustrates a method 1600 for decoding feature maps from encoded data and performing a second part of the CNN. The method 1600 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1600 may be implemented by the destination device 140 as one or more software code modules of the application program 233 under execution of the processor 205. The method 1600 is repeated for each frame of video data encoded in the bitstream 143. The software code modules of the application program 233 implementing the method 1600 may be stored, for example, in the hard disk drive 210 and / or the memory 206. The method 1600 begins with a feature map grouping decoding step 1610. The method 1600 is configured to determine one or more parameters related to quantization and perform inverse quantization on data samples decoded from the encoded data to derive feature maps according to the one or more parameters. In one configuration, the method 1600 is configured to deinterleave feature maps corresponding to a group of feature maps after inverse quantization has been performed. As described in more detail below, the method 1600 may be used to determine feature maps based on images of a first group of feature maps arranged in a first frame (or two-dimensional array) and a second group of feature maps arranged in a second frame (or two-dimensional array), where the first frame is different from the second frame.

[0143] In a feature map grouping decoding step 1610, the entropy decoder 720, under execution of the processor 205, decodes from the SEI message 1413 a structure indicating the assignment of each feature map of each layer to one or more groups of feature maps (i.e., feature map groups 820). The decoded structure may be stored, for example, in the memory 206 and / or the hard disk drive 210. The syntax of the feature map grouping in the SEI message 1413 is described with reference to Appendix A. Control in the processor 205 then passes from step 1610 to a quantization range decoding step 1620.

[0144] In a quantization range decoding step 1620, the entropy decoder 720, under the execution of the processor 205, decodes parameters in the form of a quantization range 822 for each feature map group 820 as determined from the SEI message 1413 in step 1610. The quantization range 822 is shared by each of the multiple feature maps in the feature map group. The quantization range 822 determined in step 1620 may be stored in the memory 206 and / or the hard disk drive 210, for example. When symmetric quantization is used, in step 1620, a single value is decoded for each feature map group, representing the maximum magnitude of the floating-point data in the feature maps belonging to the respective group. When asymmetric quantization is used in step 1620, a pair of values ​​is decoded for each feature map group, representing the maximum and minimum values ​​of the floating-point data in the feature maps belonging to the respective group. The processor 205 may be operable to perform step 1620 for every frame of the video data, or the processor 205 may be operable to perform step 1620 less frequently. Step 1620 may be performed at random access points or intra-pictures in the bitstream 143. When step 1620 is not performed for every frame, the feature map grouping and quantization range data are carried across subsequent frames for reuse until a new set of feature map grouping and / or quantization range data is decoded from the bitstream 143. Control in the processor 205 then passes from step 1620 to a frame decoding step 1630.

[0145] In a frame decoding step 1630, the entropy decoder 114, under execution of the processor 205, operates to generate a frame 145 by decoding a portion of the bitstream 143 corresponding to an access unit such as AU 1414. The frame 145 may include a packed feature map or may include an image corresponding to a frame from the video source 112, for example. If the frame 145 includes an image frame, i.e., does not include a packed feature map, the method 1600 ends and the decoding then proceeds to the next frame. The frame 145 generated in step 1630 may be stored, for example, in the memory 206 and / or the hard disk drive 210. If the frame 145 includes a packed feature map, the processor 205 proceeds from step 1630 to a feature map placement determination step 1640.

[0146] In a feature map placement determination step 1640, the unpacker module 810, under execution of the processor 205, determines the location of each feature map in each layer within the frame 145. Using the spatial size of each feature map, the feature map grouping, and the number of feature maps in each layer, placement information is determined according to the approach of step 1540 and as described with reference to Figures 11-13. If the feature map size, quantity, and packing format do not change compared to the previous frame, the feature map placement data is retained from the previous frame. Control in the processor 205 then passes from step 1640 to a feature map unpack step 1650.

[0147] In a feature map unpacking step 1650, the unpacker module 810, under execution of the processor 205, extracts samples from the frame 147 and generates an integer feature map 812 according to the determined feature map arrangement from step 1640. The integer feature map 812 determined in step 1650 may be stored, for example, in the memory 206 and / or the hard disk drive 210. Control in the processor 205 then passes from step 1650 to a feature map dequantization step 1660.

[0148] In a feature map inverse quantization step 1660, the inverse quantization module 814, under execution of the processor 205, converts the integer feature maps 812 to floating point feature maps, which are assembled into tensors 149 as input to the CNN head 150. The floating point feature maps may be stored, for example, in the memory 206 and / or the hard disk drive 210. The integer samples are converted to floating point precision, and the quant_offset and scale_f values ​​of step 1560 are used to shift the samples into a normalized range. For each feature map in the feature map group, the normalized range value is multiplied by the quantization range 822 of the feature map group in 820 to create a floating point feature map. The floating point feature maps are assembled into tensors 119 as a multidimensional array, typically with dimensions (frame, channel, height, width). If FPN is used, the assembly operates to write the feature maps into one tensor from the set of tensors in 119 corresponding to the FPN layer. Control in the processor 205 passes from step 1660 to a CNN second portion execution step 1670 .

[0149] In a execute CNN second part step 1670, the CNN head 150 executes the remaining stages of the CNN (i.e., stages specific to a particular task) under the execution of the processor 205. The decoded, unpacked, and dequantized tensors 149 are input to the CNN head 150. Within the CNN head 150, a series of convolution, normalization, fully connected layer operations, and activation stages are performed to obtain the CNN results 151. The CNN results 151 are stored in a task result buffer 152, configured, for example, in the memory 206. The method 1600 ends and control in the processor 205 proceeds to the next frame.

[0150] In one arrangement of method 1600, steps 1610 and 1620 are performed as indicated by flags in SEI message 1413. Step 1610 is performed as indicated by a “groups_update” flag decoded from SEI message 1413, and step 1620 is performed as indicated by a “qr_update” flag also decoded from SEI message 1413.

[0151] 17 illustrates a method for determining groupings of feature maps. Method 1700 may be embodied by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described above, method 1700 may be implemented by source device 110 as one or more software code modules of application program 233 under execution of processor 205. Software code modules of application program 233 implementing method 1700 may be stored, for example, in hard disk drive 210 and / or memory 206. Method 1700 begins with a list initialization step 1710.

[0152] In a list initialization step 1710, the group determiner 510, under execution of the processor 205, creates a set of groups such that each feature map in a given layer is assigned to a single group. A group is represented as an ordered list of feature maps with adjacent relationships within a group to indicate the similarity of the pair of feature maps. The ordered list is initialized and may be stored in the memory 206 and / or the hard disk drive 210. Control in the processor 205 then passes from step 1710 to step 1720, which involves finding the most similar feature map pairs.

[0153] In step 1720, the group determiner 510, under execution of the processor 205, determines the pair of feature maps that have the greatest similarity in the similarity matrix from step 1520. Since the similarity matrix is ​​a measure of the differences between the feature maps, the pair with the greatest similarity is identified by the position in the matrix that has the minimum value. If the similarity matrix indicates that no further pairs of feature maps have similarity (i.e., all entries are set to "not-a-number" (NaN)), this value is returned. Control in the processor 205 then passes from step 1720 to a remaining maps test step 1730.

[0154] In a remaining map test step 1730, the group determiner 510, under the execution of the processor 205, determines whether all pairs of feature maps have been identified in step 1720. If step 1720 returns NaN, then all groups of feature maps are considered for combination and no further groups need to be connected together (i.e., form one larger group from two smaller groups). If no further groups need to be connected together, the method 1700 ends and a set of groups results. Otherwise, if there are pairs of feature maps with the measured similarity (i.e., the result of the minimum operation is not NaN), then control in the processor passes from step 1730 to a group indication discovery step 1740.

[0155] In a group index determination step 1740, the group determiner 510, under execution of the processor 205, determines which group each feature map belongs to and the index of the feature map within each group. Control in the processor 205 then passes from step 1740 to a connectable group test step 1750.

[0156] In a connectable group test step 1750, the group determiner 510, under the execution of the processor 205, determines whether the pair of feature maps can be connected to form one larger group. If either feature map is in the middle of the corresponding group, it is not possible to connect the feature maps to each other, since the nodes in the list may only have predecessor and successor nodes. The entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, preventing further consideration of this pair of feature maps. Also, if two feature maps belong to the same group, then the entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, preventing further consideration of combining these two feature maps. If both feature maps are at the beginning or end of their respective groups, the feature maps can be connected to each other to form one larger group from the two initial groups. In a configuration in which the group size is limited to a certain number of feature maps, for groups that can be combined, if the resulting group size exceeds the group size limit, the entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, and the groups are not combined to each other. To reduce the iterations for determining the feature map groups, the group size is limited and, if after merging, the resulting group is equal to the group size, the rows and columns in the similarity matrix corresponding to each end point of the newly formed group are set to NaN to prevent further consideration of these feature maps for merging into larger groups. If the groups are to be connected, control in the processor 205 proceeds to a group connection step 1760.

[0157] In a group connection step 1760, the group determiner 510, under the execution of the processor 205, connects together two groups containing the pairs of feature maps identified in step 1720. The groups are connected so that the pairs are adjacent in the newly formed larger group. The connection groups determined in step 1760 may be stored, for example, in the memory 206 and / or the hard disk drive 210. When a feature map is in a previous group of two or more feature maps and is connected to another group, the feature map now occupies some position in the middle of the newly formed larger group. When a feature map becomes an intermediate node in a list or group, the row and column in the similarity matrix corresponding to that feature map are set to NaN, preventing further consideration of combining that feature map into other groups. The processor 205 then proceeds from step 1760 to step 1720 to determine the next pair of feature maps to consider combining into the larger group.

[0158] In one arrangement, all feature maps in each layer are merged into one group. When packed according to the packing format 1100, the resulting feature map arrangement places similar feature maps relatively close together. The intra block copy coding tool of VVC can then be used to predict portions of one feature map from previous and adjacent feature maps, with some restrictions on block selection resulting from the IBC virtual buffer. Because feature map residuals are continuous and tend to be coded more efficiently using various transforms, the IBC search may use the Hadamard transform as a cost estimate in addition to, or instead of, the SAD cost estimate.

[0159] In another arrangement, the group size is limited to four. When the group size is limited to four, the "group of four" feature maps may be arranged using the sample-wise interleaving packing format 1200 to achieve compression efficiency from the shared block structure and some degree of shared prediction signal among the four feature maps. A similarity threshold may be applied in the execution of the method 1700 such that only groups of four feature maps are determined where the four feature maps are very similar. The other, less similar feature maps may be assigned to one larger residual group that is packed in a raster scan format.

[0160] In yet another arrangement, groups may be determined across layers and limited in size to three, particularly suited for 3-layer FPN. Inter-layer grouping is packed in a collocated manner using packing arrangement 1300, allowing cross-component prediction tools in VVC to be used to improve compression efficiency. When inter-layer grouping is used to collocate feature maps across layers, combinatorial grouping is possible, while intra-layer grouping arranges groups based on the layer that occupies the luma channel of the frame.

[0161] In yet another arrangement, there is one group per layer, and all feature maps of a layer are in that layer's group. Within a group, an ordering of the feature maps is encoded, allowing similar feature maps in a layer to be located nearby, such that tools such as IBC can predict one feature map from its neighbors.

[0162] In yet another configuration, there is one group per layer, and within each group, the feature maps are arranged according to their tensor's channel index. In such a configuration, one quantization range is coded per layer, resulting in low overhead of quantization range coding in the SEI message 1413.

[0163] Since various grouping approaches are possible, the “grouping_type” syntax element is included in SEI message 1413 and is further described with reference to Appendix A.

[0164] FIG. 18 illustrates a method for selecting a set of coding tools or functions of a video standard according to a type of frame data to be encoded. The method 1800 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1800 may be implemented by the source device 110 as one or more software code modules of the application program 233 under execution of the processor 205. The software code modules of the application program 233 implementing the method 1800 may be stored, for example, in the hard disk drive 210 and / or the memory 206. The steps of the method 1800 are configured to determine whether the source device 120 generates encoded video data including the encoded data of the feature map based on a convolutional neural network (CNN). The steps of the method 1800 are also configured to generate the encoded video data using multiple coding tools or functions for encoding the video data if the source device 120 generates encoded video data including the encoded video data of the feature map. Also, as described, the steps of method 1800 are configured such that when source device 120 generates second encoded data including encoded data of the feature map, the encoded data of the feature map uses a first portion of the plurality of coding tools or functions but does not use a second portion of the plurality of coding tools or functions.

[0165] The method 1800 begins with a frame type configuration determination step 1810 .

[0166] In a frame type configuration step 1810, source device 110, under execution of processor 205, is configured to operate on either video data or feature map data. The configuration may be the result of receiving a command over network 200 or 222, or may be by direct user control via a user interface (e.g., via keyboard 202, mouse 203). Control in processor 205 then passes from step 1810 to a frame containing feature map data test step 1820.

[0167] In step 1820, the source device 110, under execution of the processor 205, determines whether the source device 110 generates encoded normal video frame data or encoded feature map data based on a convolutional neural network (CNN). The encoded data conforms to a coding standard (e.g., the VVC standard). When the source device 110 is configured for video frame data, control in the processor 205 passes from step 1820 to a video data functions selection step 1830. When the source device 110 is configured for feature map transmission, control in the processor 205 passes from step 1820 to a feature map functions selection step 1840.

[0168] In a video data feature selection step 1830, the multiplexer 118, under execution of the processor 205, routes the frame data 113 directly to the video encoder 120. A set of functions or coding tools is selected to be used to encode the frame data 119. The set of functions corresponds to the functions available in the profile of the video coding standard being used to encode the frame data 119. The set of functions corresponds to a first part of the plurality of coding tools or functions mentioned above. For example, in step 1830, a set of functions defined for the "Main10" profile of the VVC standard may be selected. Control in the processor 205 passes from step 1830 to a frame data encoding step 1850.

[0169] In a feature map function selection step 1840, the multiplexer 118, under execution of the processor 205, routes the packed feature map 117 to the video encoder 120 as the frame data 119. A set of functions or coding tools that is a subset of the coding tools of the standard profile is selected for use in encoding the frame data 119. The subset of coding tools may be selected by activating a "constraint flag" to disable certain coding tools or features of the video coding standard being used to encode the frame data 119. The disabled coding tools or features represent a second part of the coding tools or features described above and may be at least one of low frequency non-separable transform (LFNST), matrix intra prediction (MIP), linear mode chroma scaling (LMCS), affine prediction mode, geometric partitioning mode (GPM), ISP, deblocking filter. In this example, the prohibition of use of the second part of the coding tools or features may be indicated using the constraint flag. For video coding standards other than VVC, coding tools that provide similar functionality may be similarly disabled. Control in the processor 205 passes from step 1840 to a frame data encoding step 1850 .

[0170] In a frame data encoding step 1850, the video encoder 120, under execution of the processor 205, encodes the frame data 119 according to a set of functions or coding tools. The method 1800 ends and the source device 110 proceeds to the next frame. As a result of the method 1800, the bitstream 121 includes an explicit indication (e.g., in the form of a set of constraint flags appearing at the beginning of the bitstream) of whether the data included is normal video data or packed feature map data. Furthermore, when the bitstream 121 encodes packed feature map data, the SEI message 1413 is present for at least one frame, allowing the destination device 140 to further process the data after decoding the bitstream (e.g., process the decoded frame data 145 using modules 148 and 150). If the destination device 140 is only intended to perform tasks according to the CNN head 150, the destination device does not need to decode the bitstream 143 when it is indicated to contain normal video data beyond the initial profile and constraint flag syntax. A destination device that outputs only task results 151 to task result buffer 152 and does not output decoded video (e.g., to display device 160) does not need to implement coding tools or features that are indicated as disabled via constraint flags.

[0171] In an arrangement of method 1800, instead of indicating which tools are disabled for feature map coding by setting a constraint flag, the tools are indicated by disabling an enable flag, for example, in a sequence parameter set or equivalent syntax structure.

[0172] In the arrangement of methods 1500 and 1600, steps 1580 and 1610 encode and decode the feature map group size as a log2 value (i.e., the feature map group size must be a power of 2 value), and an offset of 1 is applied so that a coded value of zero corresponds to a feature map group size of 1. The 'log2_group_size_minus1' syntax element is used to encode the feature map group size.

[0173] In another arrangement of methods 1500, 1600, and 1700, the feature map groups are constrained to contain feature maps indexed in monotonically increasing order within a given layer. When feature maps are present by index in monotonically increasing order within each group, the group configuration may be coded using a bitmap indicating the presence of an absence of a given feature map within the group. For subsequent groups, the coding bitmap may be reduced in length to omit feature map indexes already assigned to previous groups.

[0174] In the CNN backbone 310 arrangement, the tensor dimensions, and therefore the resulting feature map sizes, are selected to be aligned to the block sizes of the VVC standard. For generally rectangular videos and a default CTU size of 128x128, the feature map widths and heights can be powers of two, e.g., the three layer sizes can be 128x64, 64x32, and 32x16. Powers of two feature map sizes allow for greater alignment of packed features with the block sizes available in the VVC standard due to quad-tree, binary, or ternary partitioning, and reduce the likelihood of coding artifacts in one feature map caused by the contents of neighboring feature maps.

[0175] In the arrangement of bitstream 1400, SPS 1410 includes sps_deblocking_filter_enabled_flag for controlling the deblocking filter as additional syntax present when the SPS extension is active via flag "sps_extension_flag" equal to 1. When sps_deblocking_filter_enabled_flag is equal to zero, pps_deblocking_filter_control_present_flag in PPS 1412 must be set to 1, thus explicitly coding the deblocking filter control, pps_deblocking_filter_override_enabled_flag in PPS 1412 must be set to zero, thus disabling slice header or picture header override of the deblocking control set in PPS 1412, and pps_deblocking_filter_disabled_flag in PPS 1412 must be set to zero, disabling in-loop filtering. These constraints on the pps_deblocking_filter_control_present_flag, pps_deblocking_filter_override_enabled_flag, and pps_deblocking_filter_disabled_flag flags are not applied when sps_deblocking_filter_enabled_flag is equal to 1. When gci_no_deblocking_filter_flag is present in constraint flags 1440 and set to 1, sps_deblocking_filter_enabled_flag in SPS 1410 must be set to zero. When gci_no_deblocking_filter_flag is set to zero, no constraints are applied to sps_deblocking_filter_enabled_flag in SPS 1410.If sps_deblocking_filter_enabled_flag is not present in the SPS 1410, the constraints applicable to the pps_deblocking_filter_control_present_flag, pps_deblocking_filter_override_enabled_flag, and pps_deblocking_filter_disabled_flag flags apply when gci_no_deblocking_filter_flag is set to 1. Explicitly prohibiting deblocking filter application via the constraint flags allows for defining sub-profiles for feature map coding that exclude application of the deblocking filter. gci_no_deblocking_filter_flag may be present in the field of constraint flags 1440, including gci_reserved_zero_bits in version 1 of the VVC standard. When the application of the system 100 requires high quality, i.e., high bit rate, achieved using a low value of the quantization parameter 692, deblocking may not be necessary and the constraint flags may be used, for example, for feature map coding, and deblocking may be omitted entirely. Industrial Applicability

[0176] The described arrangements are applicable to the computer and data processing industry, and in particular to digital signal processing for encoding and decoding of signals, such as video and image signals, to achieve high compression efficiency. Providing one or more of the constraint flags described above allows for the selection of a subset of tools for a given profile (equivalent to "sub-profiling"). The selection of a subset of tools provides several advantages, such as a vendor implementation advantage of VVC, since the vendor can specify a subset of a profile that excludes unnecessary or otherwise problematic coding tools, for example from a complexity standpoint.

[0177] Arrangements are also disclosed for quantizing floating-point tensor data in groups of channels or feature maps and packing the resulting integer values ​​into planar frames. Grouping methods and tradeoffs are disclosed that have low overhead for quantization range data and very fine granularity of grouping with high overhead for quantization range data, while a medium granularity of grouping provides task performance advantages.

[0178] The above describes only some embodiments of the present invention, modifications and / or variations may be made without departing from the scope and spirit of the present invention, and the embodiments are illustrative and not limiting.

[0179] Appendix A: SEI message format and associated semantics for expressing metadata related to feature map packing and quantization in the bitstream are as follows.

[0180] [Table 1]

[0181] Feature Map Packing Information Semantics The syntax construct specifies the information necessary to unpack feature map planar frames and convert them into tensors to perform inference tasks.

[0182] A syntax element with the descriptor u(n) indicates that the syntax element is coded using n bits and is interpreted as an unsigned integer value. A syntax element with the descriptor ue(v) indicates that the syntax element is coded as an exponential-Golomb value and is interpreted as an unsigned integer value.

[0183] The persistence of a feature map information SEI message lasts until the next occurrence of a feature map information SEI message from the associated AU or until the end of CLVS.

[0184] A frame_type equal to 0 indicates that the AU does not contain packed feature map data, and a frame_type equal to 1 indicates that the AU does contain packed feature map data.

[0185] layers_update equal to 1 indicates that this instance of the Feature Map Packing Information SEI message defines the number of layers, dimensionality, and amount of feature maps at each layer.

[0186] groups_update equal to 1 indicates that this instance of the Feature Map Packing Information SEI message defines the number and configuration of feature map groups.

[0187] qr_update equal to 1 indicates that this instance of the Feature Map Packing Information SEI message signals an update to the quantization range of a feature map group.

[0188] backbone_id indicates the type of network backbone and extracted points, and implicitly signals the layer count and dimensionality of the tensor, and therefore the dimension of the feature map. The following table shows some predefined network backbones and their associated layer counts, feature map counts, and dimensions.

[0189] [Table 2]

[0190] layer_cnt specifies the number of layers present in the frame.

[0191] fm_cnt[layer_idx] specifies the number of feature maps present in layer_idx.

[0192] fm_width[layer_idx] specifies the width of the feature map for layer_idx.

[0193] fm_height[layer_idx] specifies the height of the feature map for layer_idx.

[0194] orig_source_width specifies the width of the frame 112 in luma samples before resizing for backbone operations, i.e., before the resizer module 304.

[0195] orig_source_height specifies the height of the frame 112 in luma samples before resizing for backbone operations, i.e., before the resizer module 304.

[0196] packing_format specifies the format of the packed feature map data in the frame. The formats are listed according to the following table.

[0197] [Table 3]

[0198] The grouping_type specifies the scope of the feature map group by setting the ExplicitGrouping flag, the ExplicitGroupSize flag, and the ExplicitLayerId flag.

[0199] An ExplicitGrouping flag equal to 1 indicates that the feature map grouping is explicitly signaled in the bitstream, while an ExplicitGrouping flag equal to 0 indicates that the feature map grouping is implicitly determined based on grouping_type.

[0200] An ExplicitGroupSize flag equal to 1 indicates that the size of each feature map group is explicitly signaled in the bitstream, and an ExplicitGroupSize flag equal to 0 indicates that the size of each feature map group is implicitly determined based on the grouping_type.

[0201] An ExplicitLayerId flag equal to one indicates that the group may contain feature maps in different layers, while an ExplicitLayerId flag equal to zero indicates that the group is implicitly limited to a single layer.

[0202] The following table shows the values ​​assigned to the flags ExplicitGrouping, ExplicitGroupSize, and ExplicitLayerId according to grouping_type. If implicit signals are used, the implicit behavior is described.

[0203] [Table 4]

[0204] group_cnt is present when ExplicitGroupingFlag is equal to 1 and signals the number of feature map groups. When ExplicitGroupingFlag is equal to zero, group_cnt is inferred based on grouping_type according to the table above.

[0205] quant_type indicates the type of quantization operation according to the table below.

[0206] [Table 5]

[0207] qr_fraction_precision specifies the precision with which the fractional part of the floating-point quantization range is coded in bits.

[0208] group_size is present if the ExplicitGrouping flag is 1 and the ExplicitGroupSize flag is 1. group_size specifies the size of the group grp_idx. If group_size is not present, it is inferred according to the 'Implicit Rules' described in the 'grouping_type' table.

[0209] fm_idx[grp_idx][fm_idx] specifies the feature map index or channel index at position fm_idx within group grp_idx.

[0210] layer_id[grp_idx][fm_idx], if present, specifies the layer index for the corresponding feature map identified by fm_idx[grp_idx][fm_idx]. If layer_idx is not present, it is inferred. For group_type equal to 1, 2, or 3, the feature maps of layer 0 are assigned to one or more groups first, and once all feature maps of layer 0 have been assigned to groups, the feature maps of layer 1 are assigned to one or more groups, and so on. For group_type equal to 4, one group contains all feature maps of all layers.

[0211] qr_exp[grp_idx] specifies the exponent part of the quantization range of group grp_idx.

[0212] qr_exp_sign[grp_idx] specifies the sign of the exponent part of the quantization range of group grp_idx.

[0213] qr_fraction[grp_idx] specifies the fractional part of the quantization range of group grp_idx, with the bit width specified by qr_precision.

[0214] second_qr_exp[grp_idx], if present, specifies the exponent part of the second quantization range for group grp_idx.

[0215] second_qr_exp_sign[grp_idx] specifies the sign of the exponent part of the quantization range of group grp_idx.

[0216] second_qr_fraction[grp_idx], if present, specifies the fractional part of the second quantization range for group grp_idx, with the bit width specified by qr_precision.

[0217] When quant_type is equal to zero, the quantization range indicates the maximum magnitude of values ​​that will be encountered in the feature maps in the group to which the quantization range applies.

[0218] When quant_type is equal to 1, the quantization range indicates the maximum positive value encountered in the feature map in the group to which the quantization range applies, and the second quantization range indicates the maximum negative value encountered in the feature map in the group to which the second quantization range applies.

[0219] The quantization range and the second quantization (if present) range may be adjusted to allow for some headroom, such as by multiplying by a value slightly greater than 1.0. Such headroom allows the quantization range to be reused for frames subsequent to the frame associated with the feature map packing information SEI message with a reduced likelihood of needing to clip tensor values ​​in the quantization module 518.

Claims

1. A determination means for determining whether to generate encoded data of a frame in which a plurality of feature maps obtained at least based on processing of an input image by a neural network are arranged; an encoding means for generating encoded data of the input image using a plurality of functions including at least a matrix intra prediction (MIP) when generating encoded data of the input image instead of the frame in which the plurality of feature maps are arranged; Equipped with When it is determined that encoded data of the frame in which the plurality of feature maps are arranged is to be generated, the encoding means generates the encoded data of the frame in which the plurality of feature maps are arranged, using a first part of the plurality of functions and without using a second part of the plurality of functions including at least the matrix intra prediction (MIP).

2. 2. The encoding device of claim 1, wherein the second portion of the plurality of functions further includes at least one of an LFNST, an LMCS, and an ISP.

3. 2. The encoding device of claim 1, wherein the second portion of the plurality of functions includes at least one of Affine, GPM, and MMVD.

4. 2. The encoding device of claim 1, wherein the second portion of the plurality of functions is constrained not to be used in generating encoded data for a frame in which the plurality of feature maps are located.

5. 2. The encoding device according to claim 1, wherein the encoding means encodes information indicating that the second part of the plurality of functions is constrained not to be used in decoding encoded data of the frame in which the plurality of feature maps are arranged.

6. The encoding device according to claim 1, characterized in that the encoded data of the input image conforms to a first encoding standard, and the encoded data of the frame in which the multiple feature maps are arranged conforms to a second encoding standard.

7. The encoding device described in claim 1, characterized in that each of the multiple feature maps is arranged in the frame according to a raster scan arrangement.

8. A feature map having a first width and a first height among the plurality of feature maps is disposed in a first area of ​​the frame; The encoding device according to claim 1, characterized in that among the plurality of feature maps, a feature map having a second width smaller than the first width and a second height smaller than the first height is placed in a second area different from the first area of ​​the frame.

9. The encoding device described in Claim 1, characterized in that the multiple feature maps are multiple feature maps obtained by performing quantization on each of multiple feature maps that constitute a tensor obtained at least based on neural network processing of the input image.

10. 2. The encoding device according to claim 1, wherein said encoding means encodes a restriction flag for prohibiting use of said second part of said plurality of functions.

11. The encoding device described in Claim 1, characterized in that the encoding means encodes information for determining whether to decode the encoded data of the frame in which the multiple feature maps are arranged.

12. A determination means for determining whether to decode encoded data of a frame in which a plurality of feature maps obtained at least based on processing of an input image by a neural network are arranged; a decoding means for decoding the coded data of the input image using a plurality of functions including at least a matrix intra prediction (MIP) when decoding the coded data of the input image rather than the frame in which the plurality of feature maps are arranged, a decoding unit for decoding the encoded data of the frame in which the plurality of feature maps are arranged, the decoding unit decodes the encoded data of the frame in which the plurality of feature maps are arranged, using a first part of the plurality of functions and without using a second part of the plurality of functions that includes at least the matrix intra prediction (MIP).

13. 13. The decoding device of claim 12, wherein the second portion of the plurality of functions further includes at least one of an LFNST, an LMCS, and an ISP.

14. 13. The decoding device of claim 12, wherein the second portion of the plurality of functions includes at least one of Affine, GPM, and MMVD.

15. 13. The decoding device of claim 12, wherein the second portion of the plurality of functions is constrained so as not to be used in decoding encoded data of a frame in which the plurality of feature maps are located.

16. The decoding device of claim 12, characterized in that the decoding means decodes information indicating that the second portion of the plurality of functions is constrained not to be used in decoding the encoded data of the frame in which the plurality of feature maps are located.

17. The decoding device according to claim 12, characterized in that the encoded data of the input image complies with a first encoding standard, and the encoded data of the frame in which the multiple feature maps are arranged complies with a second encoding standard.

18. The decoding device described in Claim 12, characterized in that each of the multiple feature maps is arranged in the frame according to a raster scan arrangement.

19. A feature map having a first width and a first height among the plurality of feature maps is disposed in a first area of ​​the frame; The decoding device of claim 12, characterized in that among the plurality of feature maps, a feature map having a second width smaller than the first width and a second height smaller than the first height is placed in a second area different from the first area of ​​the frame.

20. The decoding device described in Claim 12, characterized in that the multiple feature maps are multiple feature maps obtained by performing quantization on each of multiple feature maps that constitute a tensor obtained at least based on neural network processing of the input image.

21. 13. The decoding device according to claim 12, wherein the decoding means decodes a restriction flag for prohibiting use of the second part of the plurality of functions.

22. The decoding means decodes information for determining whether to decode encoded data of the frame in which the plurality of feature maps are arranged, 13. The decoding device according to claim 12, wherein the determination is made by the determining means based on the information.

23. A method for determining whether to generate encoded data for a frame in which a plurality of feature maps obtained based at least on processing an input image by a neural network are arranged, When generating encoded data of the input image rather than the frame in which the plurality of feature maps are arranged, generating encoded data of the input image using a plurality of functions including at least matrix intra prediction (MIP); a coding method for coding the frame in which the plurality of feature maps are arranged, the coding method comprising: generating, when it is determined that encoded data of the frame in which the plurality of feature maps are arranged, the encoded data of the frame in which the plurality of feature maps are arranged, using a first portion of the plurality of functions and not using a second portion of the plurality of functions including at least the matrix intra prediction (MIP).

24. A method for determining whether to decode encoded data of a frame in which a plurality of feature maps obtained at least based on processing of an input image by a neural network are arranged, When decoding the encoded data of the input image other than the frame in which the plurality of feature maps are arranged, decoding the encoded data of the input image using a plurality of functions including at least a matrix intra prediction (MIP); a decoding method for decoding the encoded data of the frame in which the plurality of feature maps are arranged, using a first part of the plurality of functions and without using a second part of the plurality of functions, the second part including at least the matrix intra prediction (MIP).

25. A computer program for causing a computer to function as each of the means of the encoding device described in claim 1.

26. A computer program for causing a computer to function as each of the means of the decoding device described in claim 12.

Citation Information

Patent Citations

  • Method and apparatus for transmitting and receiving 360° video including camera lens information

    JP2021505069A

  • Method and apparatus for signaling decoding data using high level syntax elements

    WO2020263646A1

  • High precision transform and quantization for image and video coding

    WO2021052355A1