Tool Selection for Feature Map Coding vs. Conventional Video Coding

By selectively encoding and decoding CNN feature maps using a subset of features and VVC standards, the method optimizes video data processing on edge devices, addressing complexity and memory issues while ensuring efficient and privacy-compliant operation.

JP7818129B2Active Publication Date: 2026-02-19CANON KK
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2025070796
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-04-07
Filing Date
2025-04-22
Publication Date
2026-02-19
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Existing video coding standards struggle to efficiently encode and decode tensors from convolutional neural networks (CNNs) due to high complexity and memory requirements, particularly when implementing CNNs on edge devices with limited processing power.

Method used

A method and apparatus for generating and decoding encoded data from CNNs by selectively using a subset of features for feature maps, leveraging VVC standards to optimize encoding and decoding processes, and utilizing a distributed machine task system that includes edge devices and cloud applications for efficient processing.

Benefits of technology

This approach reduces the computational burden on edge devices while maintaining effective video data processing, ensuring resilient task performance and compliance with privacy regulations like GDPR.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007818129000006
    Figure 0007818129000006
  • Figure 0007818129000007
    Figure 0007818129000007
  • Figure 0007818129000008
    Figure 0007818129000008
Patent Text Reader

Abstract

To provide a method, an apparatus, and a system for generating first encoded data and second encoded data.SOLUTION: A method comprises: determination means that determines whether an apparatus generates encoded data including encoded data of a feature map on the basis of a neural network; and encoding means that generates first encoded data using a plurality of functions for encoding video data, in a case where the apparatus generates the first encoded data in a form of encoded video data not including the encoded data of the feature map. The encoding means generates the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions, in a case where the apparatus generates second encoded data including the encoded data of the feature map.SELECTED DRAWING: Figure 15
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 convolutional neural networks. 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 convolutional neural networks using video compression techniques. [Background technology]

[0003] Video compression is a ubiquitous technology used to support many applications, including those 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 Organizations (SSOs): Study Group 16, Question 6 (SG16 / Q6) of the International Telecommunication Union's (ITU) Telecommunication Standardization Sector (ITU-T), also known as the "Video Coding Experts Group" (VCEG), and International Organization for Standardization / 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, with data passed from one layer to the next in the form of "tensors." The weights for each layer are determined in a training stage, during which a very large amount of training data is passed through the CNN and the determined results are compared to 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 at a desired level of accuracy. If a convolution stage has a "stride" greater than 1, the output tensor from the convolution has 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 dividing 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 the input and progressively transforming the input into an output is commonly called "inference."

[0006] Generally, tensors have four dimensions: batch, channel, height, and width. When inferring video data, the first dimension, "batch," of size "1" indicates that one frame is passed through the CNN at a time. When training a 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 predetermined "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 frame-by-frame. The "channel" dimension indicates the number of concurrent "feature maps" for a given tensor, and 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, 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 to be compatible with the dimensions of the tensor input to the first layer. The dimensions of the tensor depend on the CNN architecture, and generally have several 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 to the corresponding input image, capturing some characteristic, such as an edge. 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 CNN's results in performing a task using a particular input to provided ground truth (i.e., "training data"), typically prepared by humans and intended to represent the "correct" result.

[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 portions of the CNN while leaving weights in other portions of the network unchanged. The overall complexity of CNNs tends to be very high, with many multiply-and-accumulate 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 a 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., with higher resolutions and higher frame rates), and to address growing market demand for service delivery over WANs where bandwidth costs are relatively high. VVC is implementable in modern silicon processes and offers an acceptable trade-off 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, each of which contains 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 channels are commonly referred to as the "chroma" channels. Video data is typically displayed in the RGB (red-green-blue) color space, which has a high degree of correlation between each of its three components. Video data representations viewed by encoders or decoders often use color spaces such as YCbCr. YCbCr concentrates luminance, 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 key difference is that, after quantization, the chroma channels contain relatively fewer 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, and other applications. 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 defines a "block-based" architecture, in which 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 128 x 128 luma samples. However, the CTUs at the right and bottom 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 separate trees for each of the luma and chroma channels. The coding tree defines the decomposition of the CTU's area into a set of blocks, also called "coding blocks" (CBs). When a shared tree is in use, a single coding tree specifies the 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 a "prediction unit" (PU) and a "transform unit" (TU). A single tree with CUs spanning the color channels of 4:2:0 chroma format video data results in chroma blocks that are half the width and height of the corresponding luma block. When separate coding trees are used for a given area, the CB mentioned above, as well as a "prediction block" (PB) and a "transform block" (TB) are used.

[0013] Despite 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) is generated for the contents (sample values) of the corresponding region of the frame data ("prediction unit"). Furthermore, 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 can be transformed and coded as a sequence of residual coefficients, forming one or more TUs for a given CU. The applied transform can 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, producing 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, where each side dimension is 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 within a frame to generate a prediction of the current block of data samples within the frame. Inter-frame prediction involves using a block of samples obtained from a previously decoded frame to generate a prediction of the current block of samples in a frame. The block of samples obtained from the previously decoded frame is offset from the spatial location of the current block, often according to a filtered motion vector. An intra-frame prediction block can 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 specific direction ("angular intra-prediction"), or (iv) the result of matrix multiplication using neighboring samples and selected matrix coefficients. Further discrepancies between the predicted block and the corresponding input samples can 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 concomitant bitrate reduction 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 one 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 encoded data including encoded data of a feature map based on a neural network; an 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, and wherein the encoding means generates 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 that includes 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; 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 coded video data that does not include encoded data of the feature map, and wherein 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 encoded data and second encoded data, the method comprising: determining whether the device 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; When the apparatus generates the second encoded data including the encoded data of the feature map, the method generates 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.

[0020] According to another aspect of the present disclosure, there is provided 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; decoding the first encoded data using a plurality of functions for decoding video data when the device decodes the first encoded data as encoded video data that does not include encoding data of the feature map; When the device decodes the second encoded data, which includes the encoded data of the feature map, the method 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 device generates encodings, including encodings of the feature maps, based on a neural network; If the device 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 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 the encoded data of the feature map.

[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; decoding the first encoded data using a plurality of functions for decoding video data when the device decodes the first encoded data as encoded video data that does not include encoding data of the feature map; and when the device decodes the second encoded data, which includes 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 explanation of the drawings]

[0024] At least one embodiment of the present invention will now be described with reference to the following drawings and appendices. [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 on which the distributed machine task system of FIG. 1 may be implemented. [Figure 2B] FIG. 2B forms a schematic block diagram of a general-purpose computer system on which the distributed machine task system of FIG. 1 may be implemented. [Figure 3A] FIG. 3A is a schematic block diagram showing the functional modules of the backbone part 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 an alternative backbone portion of a CNN. [Figure 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 illustrating the 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 inverse quantizer 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 shows how the grouping of feature maps is determined. [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 representing metadata related to feature map packing and quantization in a bitstream. DETAILED DESCRIPTION OF THE INVENTION

[0025] Where reference is made in any one or more of the accompanying drawings to steps and / or features having the same reference numerals, 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 can include edge devices, such as network cameras or smartphones, that generate intermediate compressed data. A distributed machine task system can 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 functionality 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 the compressed video bitstream, due to the availability of high-performance compression standards and their implementations. Video compression standards typically operate on integer samples of some given bit depth, such as 10 bits, arranged in a planar array. Color video has three planar arrays, 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 of 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 x 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 a bitstream, there are a set of constraints that indicate which capabilities of the VVC standard will not be used in the bitstream. The constraints are signaled along with the bitstream's "profile" and "level." A profile broadly indicates the set of tools that must be available to decode the bitstream. Constraints also provide finer granularity of control over 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 general constraint flag semantics are defined within the VVC standard. By defining a subset of tools (e.g., equivalent to defining a sub-profile) depending on the type of data being encoded by the video encoder, the decoder can know before starting bitstream decoding that a subset of the coding tools of the bitstream's indicated profile should be used.

[0030] 1 is a schematic block diagram illustrating the functional modules of a distributed machine task system 100. 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 excessively burdensome and the task performance of the decoded feature maps is resilient to changes in the bitstream bitrate.

[0031] System 100 includes a source device 110 for generating encoded data in the form of encoded video information. System 100 also includes a destination device 140. A communication channel 130 is used to communicate the encoded video information from source device 110 to destination device 130. In some configurations, one or both of source device 110 and destination device 140 may have a respective mobile phone handset (e.g., a “smartphone”) or network camera and cloud application. Communication channel 130 may be a wired connection, such as Ethernet, or a wireless connection, such as WiFi or 5G. Additionally, source device 110 and destination device 140 may include an application in which the encoded video data is captured onto 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 CNN backbone layer may, for example, generate multiple tensors as output 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, with 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 frames 119. The resolution of the frames 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 within 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 within 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 for a given tensor have a specific size determined from the additional dimensions 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, or selects packed feature map frame 117 if source device 110 is configured to encode feature map or frame data 113, and outputs frame 119 to an encoding unit in the form of video encoder 120. The selection between feature map and regular video data is encoded in the bitstream using the "frame_type" syntax element in a metadata SEI message, which is 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 can no longer 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, particularly in relation to European General Data Protection Regulation (GDPR) requirements for pseudonymization or anonymization.

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

[0036] Bitstream 121 is transmitted by transmitter 122 as coded video data (or "coded 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 coded video data may be provided to customers on demand over a wide area network (WAN) for video streaming applications.

[0037] Destination device 140 includes receiver 142, video decoder 144, demultiplexer 146, feature map unpacker and dequantizer 148, CNN head 150, CNN task 152, and display device 160. Receiver 142 receives encoded video data from communication channel 130 and passes the received video data as a bitstream to video decoder 144 (indicated by arrow 143). Video decoder 144 then outputs decoded frame data to demultiplexer 146 (indicated by arrow 145). Decoded metadata 155 is also extracted from bitstream 143 by video decoder 144 and passed to feature map unpacker and dequantizer 148. Decoded metadata 155 is typically obtained from a "supplemental enhancement information" (SEI) message 1413 (see FIG. 14 ) present in 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 inverse quantizer 148. If destination device 140 is instead configured to perform video data decoding, 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 subsequent layers of tasks initiated in CNN backbone 114 to generate task results 151 stored in task result buffer 152. Examples of display device 160 include a liquid crystal display such as a cathode ray tube, a smartphone, a tablet computer, a computer monitor, or a standalone television set. 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 source device 110 and 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, which may be configured as video source 112, a microphone 280, and output devices including a printer 215, a display device 214, which may be configured as display device 160, and a loudspeaker 217. An external modulator-demodulator (modem) transceiver device 216 may be used by computer module 201 to communicate with a communications network 220 via connection 221. Communications network 220, which may represent communications channel 130, may be a WAN (wide area network), such as the Internet, a cellular telecommunications network, or a private WAN. If connection 221 is a telephone line, modem 216 may be a conventional "dial-up" modem. Alternatively, the modem 216 may be a broadband modem if 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 communication network 220. The transceiver device 216 may provide the functionality of the transmitter 116 and receiver 142, and the communication 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 include semiconductor random access memory (RAM) and 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 computer system 200 to be coupled via a connection 223 to a local area communication network 222, known as a local area network (LAN). As shown in Figure 2A, the local communication network 222 can also be coupled via a connection 224 to a wide network 220, which typically includes a so-called "firewall" device or device of similar functionality. The local network interface 211 can be an Ethernet TM Circuit card, Bluetooth TMThe local network interface 211 may have a wireless or IEEE 802.11 wireless configuration, although numerous other types of interfaces may be implemented for the interface 211. The local network interface 211 may also provide the functionality of the transmitter 122 and receiver 142, and the communication channel 130 may also be embodied in a local communication network 222.

[0040] The I / O interfaces 208 and 213 can provide either or both 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 magnetic tape drive (not shown), may also be used. An optical disk drive 212 is typically provided to serve as a non-volatile source of data. For example, an optical disk (e.g., CD-ROM, DVD, Blu-ray Disc) may be used. 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, and networks 220 and 222 may be configured to operate as 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 which 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-PCs and compatibles, SunSPARCstations, Apple Macs, and the like. TM , or a similar computer system.

[0042] Where appropriate or desirable, video encoder 120 and video decoder 144, as well as the methods described below, may be implemented using computer system 200. In particular, video encoder 120, video decoder 144, and the methods described may be implemented as one or more software application programs 233 executable within computer system 200. In particular, video encoder 120, video decoder 144, and the steps of the methods described are performed by instructions 231 (see FIG. 2B ) in software 233 executed within 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 portions, with a first portion and corresponding code modules performing the methods described and a second portion and corresponding code modules managing a user interface between the first portion and a user.

[0043] The software may be stored on a computer-readable medium, including, for example, the storage devices described below. The software is loaded from the computer-readable medium into computer system 200 and then executed by computer system 200. Such software or a computer-readable medium having a computer program recorded thereon is a computer program product. Use of the computer program product in computer system 200 preferably results in advantageous apparatus for implementing source device 110 and 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, application program 233 may be provided to a user encoded on one or more CD-ROMs 225 and read via corresponding drive 212, or may be read by a user from network 220 or 222. Additionally, software may be loaded into computer system 200 from other computer-readable media. Computer-readable storage media refers to any non-transitory, tangible storage medium that provides recorded instructions and / or data to computer system 200 for execution and / or processing. Examples of such storage media include floppy disks, magnetic tape, CD-ROMs, DVDs, and Blu-ray Discs. TM, a hard disk drive, a ROM or integrated circuit, a USB memory, a magneto-optical 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 email transmissions and information stored on websites and the like.

[0046] A second portion of application program 233 and the corresponding code modules described above may be executed to implement one or more graphical user interfaces (GUIs) that are rendered or represented on display 214. A user of computer system 200 and applications, typically through operation of keyboard 202 and mouse 203, may manipulate the interface in a functionally adaptable manner to provide control commands and / or input to applications 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 within the computer module 201 to ensure proper functionality and typically checks the processor 205, 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, software application interface, and 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 run without conflicting 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 run effectively. Thus, the aggregate memory 234 is not intended to show how specific segments of memory are allocated (unless otherwise specified), but rather to provide a general view of the memory accessible by the computer system 200 and how such memory is used.

[0050] As shown in FIG. 2B, 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. Cache memory 248 typically includes several storage registers 244-246 within a register section. One or more internal buses 241 functionally interconnect these functional modules. Processor 205 also typically has one or more interfaces 242 for communicating with external devices via system bus 204 using connection 218. Memory 234 is coupled to bus 204 using connection 219.

[0051] Application program 233 includes a set of instructions 231, which may include conditional branch and loop instructions. Program 233 may also include data 232 used in the execution of program 233. Instructions 231 and data 232 are stored in memory locations 228, 229, 230 and 235, 236, 237, respectively. Depending on the relative sizes of instructions 231 and 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, an instruction may be segmented into several parts, each stored in a separate memory location, as indicated by the instruction segments shown in memory locations 228 and 229.

[0052] Generally, the processor 205 is given a set of instructions to execute therein. The processor 205 awaits 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 in some cases result in the output of data. Execution may also involve storing data or variables in memory 234.

[0053] Video encoder 120, video decoder 144, and the 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 the 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 perform 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 that fetches or reads instructions 231 from memory locations 228, 229, 230; a decoding operation in which the control unit 239 determines which instructions have been fetched; and an execution operation in which the control unit 239 and / or the ALU 240 execute the instruction.

[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 a CNN backbone portion 310 that may function as a CNN backbone 114. The backbone portion 114 is sometimes referred to as "DarkNet-53," although different backbones are possible, resulting in different numbers of layers and dimensions of tensors 115 per frame. The "backbone_id" syntax element in SEI message 1413, described with reference to FIG. 14 and Appendix A, indicates the type of backbone. If the backbone type 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] 3A, video data 113 is passed to a resizer module 304, which resizes frames to a resolution suitable for processing by a CNN backbone 310, generating resized frame data 312. If the resolution of frame data 113 is already suitable for the CNN backbone 310, the operation of resizer module 304 is unnecessary. The resized frame data 312 is passed to a convolutional batch normalization leaky rectified linear (CBL) module 314, which generates tensors 316. CBL 314 includes modules such as those described with reference to CBL module 360, as shown in FIG. 3D.

[0059] CBL module 360 ​​receives tensor 361 as input, which is passed to convolutional layer 362 to generate tensor 363. When convolutional layer 362 has a stride of 1, tensor 363 has the same spatial dimensions as tensor 361. When convolutional layer 362 has a larger stride, such as 2, tensor 363 has smaller spatial dimensions compared to tensor 361, e.g., half the size of a stride of 2. Regardless of the stride, the size of the channel dimensions of tensor 363 may vary compared to the channel dimensions of tensor 361 for a particular CBL block. Tensor 363 is passed to batch normalization module 364, which outputs tensor 365. Batch normalization module 364 normalizes input tensor 363 and applies scaling factors and offset values ​​to generate output tensor 365. The scaling factors and offset values ​​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 contains a concatenation of 11 residual units.

[0061] The residual block will be 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 in residual unit 346 outputs tensor 347. The residual unit will be 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 called a "shortcut" because the input tensor 351 effectively affects the output tensor 357. For untrained networks, the ResUnit 350 operates on 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 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 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 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], and [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) can be tapped as outputs 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], and [1, 128, 136, 76]. When all layers and operations of the YOLOv3 network are enumerated, the tapping tensor 363 in CBL modules 912, 926, and 940 corresponds 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] FIG. 4 is a schematic block diagram illustrating the functional modules of an alternative CNN backbone portion 400 that can 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, and 425 to a stem network 408, a res2 module 412, a res3 module 416, a res4 module 420, a res5 module 424, and a maxpooling module 428, which produces tensor 429 as output. The stem network 408 includes a 7x7 convolution with a stride of 2 and a maxpooling operation. The res2 module 412, the res3 module 416, the res4 module 420, and the res5 module 424 perform convolution operations and LeakyReLU activation. Each module 421, 416, 420, and 424 also achieves one-half 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 3x3 output convolution module 470 to produce output tensor P5 471. Tensor 441 is also passed to upsampler module 450 to produce upsampled tensor 451. Summation module 460 sums tensors 443 and 451 to produce tensor 461, which is passed to upsampler module 452 and 3x3 horizontal convolution module 472. Module 472 outputs P4 tensor 473. Upsampler module 452 produces an upsampled tensor 453. Sum module 462 sums tensors 445 and 453 to produce tensor 463, which is passed to a 3x3 transverse convolution module 474 and upsampler module 454. Module 474 outputs a P3 tensor 475.Upsampler module 454 outputs upsampled tensor 455. Sum module 464 sums tensors 447 and 455 to produce tensor 465, which is passed to 3x3 transverse convolution module 476. Module 476 outputs P2 tensor 477. Upsampler modules 450, 452, and 454 use nearest neighbor interpolation for low computational complexity. Tensors 429, 471, 473, 475, and 477 form the output tensor 115 of CNN backbone 400.

[0064] FIG. 5 is a schematic block diagram illustrating 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 performs 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 predetermined criteria or some measure of the data present in the tensor 115. The feature map groups 512 may span tensors in 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. For each group, the range determination module 514 determines 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 on 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 its 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 value before quantization within the feature map of the group to which the quantization range belongs. In another arrangement, separate quantization ranges are used for the most positive value within the feature map group and the most negative value within 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 values ​​are normalized using the quantization range of the feature map group to which the feature map belongs, resulting in values ​​ranging from [-1, 1]. Second, the normalized feature map values ​​are scaled to the 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 allowable 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 to possible overshoot in 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 could be used without introducing clipping. For regular video represented in the YCbCr color space, a "video range" is defined as 16 to 235 for 8-bit video data and 64 to 940 for 10-bit video data. Therefore, 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 × (1 << (bit_depth-1)). The offset factor used to shift negative tensor values ​​into the positive range is left at the midpoint, i.e., 1 << (bit_depth-1), which corresponds to the default predictor for unavailable reference samples for intra prediction, as described with reference to Figures 6 and 7. If the integer values ​​generated from 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 containing 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] Figure 6 is a schematic block diagram showing the functional modules of video encoder 120. Figure 7 is a schematic block diagram showing the functional modules of video decoder 144. Generally, data passes between functional modules in video encoder 120 and video decoder 144 in groups of samples or coefficients, such as division of blocks into fixed-size sub-blocks, or as arrays. Video encoder 120 and video decoder 144 may be implemented using a general-purpose computer system 200, as shown in Figures 2A and 2B, with the various functional modules implemented by dedicated hardware within computer system 200, by software executable within 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 processor 205. Alternatively, video encoder 120 and video decoder 144 may be implemented by a combination of dedicated hardware and software executable within computer system 200. Video encoder 120, video decoder 144, and the described methods may alternatively be implemented in dedicated hardware, such as one or more integrated circuits that perform functions or sub-functions of the described methods. 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 memory. In particular, video encoder 120 includes modules 610-690, and video decoder 144 includes modules 720-796, each of which may be implemented as one or more software code modules of 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 series of frames, each containing one or more color channels. The frame data 119 may be in 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 approximately square in shape and are configured to use a specific size for the CTUs. The maximum valid size of a CTU may be, for example, 32x32, 64x64, or 128x128 luma samples, as 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 the primary color channel. Each chroma channel may also be referred to as a secondary color channel. CBs can 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, denoted 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 a CTU using quadtree partitioning (partition into four subregions arranged as a 2x2 partition of the parent region), binary partitioning (partition of the parent region horizontally or vertically into two equally sized subregions), and ternary partitioning (partition of the parent region horizontally or vertically into three subregions with an area ratio of 1:2:1).

[0070] Although operations are generally described per CTU, video encoder 120 and video decoder 144 may operate on smaller 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. 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 full CTUs. When the CTU size is 128x128, restrictions are placed on the allowed coding trees to ensure that 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 (32x128 / 128x32, etc., or further decompositions thereof) cannot be processed in 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 partitioning 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 coded layer video sequence (CLVS) contains only I slices and is called an "intra picture." A CLVS may include periodic intra pictures that form "random access points" (i.e., intermediate frames in a video sequence where decoding can begin). Alternatively, a slice may be uni-predictive or bi-predictive ("P" or "B" slices, respectively), indicating the 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 the other for chroma. The use of separate trees allows for different block structures between luma and chroma within the luma 64x64 area of ​​a CTU. For example, a large chroma CB may be co-located 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, video encoder 120 operates in two stages. In the first stage (called the “search” stage), 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 with relatively low distortion. The testing generally involves Lagrangian optimization, whereby 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 bitstream 121. Included in the evaluation of 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. Consequently, both the coding tree and the CB itself are selected in the search stage.

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

[0075] A candidate coding block (CB) is a CB that results from one of the prediction modes available to video encoder 120 for the associated PB and the resulting residual. When combined with the predicted PB in 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., a prediction block (PB) combined 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 between sample values, such as the sum of absolute differences (SAD), the sum of squared differences (SSD), or a Hadamard transform applied to the difference. The resulting estimate from each candidate PB can be determined by a mode selector 686 using the differential 624 to determine a prediction mode 687. The prediction mode 687 indicates a particular prediction mode for the current CB, e.g., a decision to use intra-frame prediction or inter-frame prediction. Estimating the coding cost associated with each candidate prediction mode and the corresponding residual coding can be performed at a significantly lower cost than entropy coding of the residual. Thus, several candidate modes can be evaluated to determine the optimal mode for 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 a 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 that use separate trees, for each 64x64 luma region of the CTU, the luma coding tree is coded first, followed by the chroma coding tree. Only the luma CB is coded within the luma coding tree, and only the chroma CB is coded within the chroma coding tree. For CTUs that use a shared tree, a single tree describes the CUs (i.e., the luma CBs and chroma CBs) according to the common block structure of the shared tree.

[0080] The entropy encoder 638 supports bitwise coding of syntax elements using variable-length and fixed-length codewords, as well as arithmetic coding modes for syntax elements. Portions of the bitstream, such as "parameter sets," such as the sequence parameter set (SPS) and picture parameter set (PPS), use a combination of fixed-length and variable-length codewords. Slices, also called contiguous portions, 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 contains syntax elements for each CTU in the slice. The use of variable-length coding and arithmetic coding requires sequential parsing within each portion of the bitstream. Portions 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] Arithmetically coded syntax elements consist of a sequence of one or more "bins." Bins, like bits, have a value of "0" or "1." However, bins are not coded as discrete bits in the bitstream 121. 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. Bin coding techniques allow for efficient coding of bins where the probability of "0" versus "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 way, binary arithmetic coding schemes are 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 into 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," which involves populating the PB with a single value representing the average of nearby reconstructed samples; second, "planar intra-prediction," which 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 nearby reconstructed samples typically include a row of reconstructed samples above the current PB that extends to the right of the PB to some extent, a column of reconstructed samples to the left of the current PB that extends downward beyond the PB to some extent, and a third, "angular intra-prediction," which 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 PBs, 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. A luma block can be intra-predicted using 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 a matrix trained on a large set of video data, where the matrix represents a relationship between the reference sample and the predicted block that is not easily captured in angular, planar, or DC intra prediction modes.

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

[0088] Residuals of predicted blocks when encoding feature map data differ from those found for natural video. Such natural video is typically captured by an image sensor or screen content, such as that commonly found in operating system user interfaces. Feature map residuals tend to contain a lot of detail, which makes them suitable for transforms that skip coding more than the primarily low-frequency coefficients of various transforms. Experiments show that feature map residuals have sufficient 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 sufficient correlation for transforms to show gain when encoding feature map data, and this also holds true when intra-block copying is used to generate predicted blocks of feature map data. Therefore, Hadamard cost estimation can be used when evaluating residuals resulting from candidate block vectors for intra-block copying when encoding feature map data, rather than relying solely on SAD or SSD cost estimation. SAD or SSD cost estimation tends to select block vectors with residuals that are more suitable for transform skip coding, and may miss block vectors with residuals that are compactly coded using transforms. The VVC standard's Multiple Transform Selection (MTS) tool 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 can be partitioned either vertically or horizontally into a set of equally sized prediction blocks, each with a minimum area of ​​16 luma samples. This intra-subpartition (ISP) approach allows separate transform blocks to contribute to the generation of prediction blocks 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. Because no previous samples are available for the CB located in the upper left position of the frame, angular and planar intra prediction modes produce the same output as 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 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 coding order of frames in the bitstream may differ from the order of 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 can be intra-predicted or uni-predicted. For B slices, each CU can be intra-predicted, uni-predicted, or bi-predicted.

[0092] Frames are typically coded using a "group of pictures" structure, allowing for temporal hierarchy of frames. A frame may be divided into multiple slices, each of which encodes 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 necessary 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, the prediction unit is divided into multiple smaller blocks, a motion field is generated, and an affine inter-prediction mode is available, in which each smaller block has a separate motion vector. The motion field uses motion vectors of points near the prediction unit as "control points." Affine prediction allows for coding of motion to different transforms, reducing the need for 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 partitioning mode ("GPM") allows for the use of larger coding units along the boundary between two objects, with the boundary geometry coded for the coding unit as an angle and center offset. Instead of using Cartesian (x, y) offsets, motion vector differences can be coded as direction (up / down / left / right) and distance, using a set of supported power-of-two distances. The motion vector predictor is obtained from neighboring blocks ("merge mode") as if no offset was applied. The current block shares the same motion vector with the selected neighboring block.

[0093] Samples are selected according to a motion vector 678 and a reference picture index. The motion vector 678 and the reference picture index apply to all color channels; therefore, inter prediction is primarily described in terms of operation on the PU, not the PB. The decomposition of each CTU into one or more inter prediction blocks is described using 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 predetermined motion refinement process may be applied to generate a dense motion estimate based on the referenced sample block.

[0094] Determining and selecting PB 620 and subtracting PB 620 from the original sample block in 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 transform, quantization, and entropy coding. A forward primary transform module 626 applies a forward transform to the difference 624, converting 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 linear transforms arranged in a tiled fashion. When a CB is larger 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 maximum transform size is filled with four 64x64 TBs arranged in a 2x2 configuration. A 64x128 CB with a 32-pt maximum transform size is filled with eight 32x32 TBs arranged in a 2x4 configuration.

[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 32x32, e.g., a 64x64 TB, all resulting primary transform coefficients 628 outside the top-left 32x32 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 position 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, which generates 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 for 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 bypassing 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 in the VVC standard as a "Multiple Transform Selection Set" (MTS).

[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 (organized as a 4x4 sub-block at the top left of the primary transform coefficients 628) or 48 samples (organized as three 4x4 sub-blocks at the top left 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 sets of coefficients that are adjacent to each other and include a DC coefficient, the secondary transform is referred to as a "low-frequency non-separable secondary transform" (LFNST). Furthermore, when the LFNST is applied, all remaining coefficients in the TB are zero in both 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 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 can have a size smaller than the TB size, 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 according to a scan pattern to generate an ordered list of values. The scan pattern generally scans the TB as a sequence of 4x4 "subblocks," providing a regular scanning operation with a granularity of 4x4 sets of residual coefficients, with the arrangement of the subblocks depending on the size of the TB. The scanning 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, video encoder 120 needs to access a frame representation that corresponds to the decoded frame representation seen by video decoder 144. Accordingly, residual coefficients 636 pass through inverse secondary transform module 644, operating according to secondary transform indices 688 to generate intermediate inverse transform coefficients represented by arrow 642. The intermediate inverse transform coefficients 642 are inverse quantized by inverse quantizer module 640 according to quantization parameters 692 to generate inverse transform coefficients represented by arrow 646. Inverse quantizer module 640 may also perform inverse non-uniform scaling of the residual coefficients using a scaling list, corresponding to the forward scaling performed in quantizer module 634. The inverse transform coefficients 646 are passed to inverse primary transform module 648 to generate residual samples of TUs, represented by arrow 650. 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 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 an 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, the extent of which is set by the height of the CTU. The reference sample cache 656 supplies 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 intra-predicted blocks 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 techniques 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, the selected matrix being signaled in bitstream 120 using an index to identify which matrix from 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 visible; 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 an “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 a “sample adaptive offset” (SAO) filter. The SAO filter operates by first classifying the reconstructed samples into one or more categories and then 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 pictures (e.g., up to 16) 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. Access to the frame buffer 672 is therefore 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” (shown as 678), each a Cartesian spatial offset from the position of the current CB and referencing a block in one of the reference frames in the frame buffer 672. A filtered block of reference samples (shown 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 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 motion vectors. 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 on only the selected candidate). This allows for reduced computational complexity. When video encoder 120 selects inter prediction for a CU, motion vector 678 is coded 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. Frame data 119 (and bitstream 121) may also be stored in memory 206, hard disk drive 210, CD-ROM, Blu-ray disc TMor other computer-readable storage medium. Additionally, frame data 119 (and bitstream 121) may be received from (or transmitted to) an external source, such as a server connected to communications network 220 or a radio frequency receiver. Communications network 220 may provide limited bandwidth, necessitating the use of rate control in video encoder 120 to avoid saturating the network when it is difficult to compress frame data 119. Furthermore, bitstream 121 may be constructed from one or more slices representing spatial sections (a collection of CTUs) of frame data 119, generated by one or more instances of video encoder 120 operating cooperatively under the control of 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 stored in a memory 206, a hard disk drive 210, a CD-ROM, a Blu-ray disc, or any other suitable storage medium. 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 header and decodes the slice data syntax elements 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 bin's "1" and "0" values. 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 for decoding 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 instance of the entropy decoder 720. A single (or a few) 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 decode slices of a frame from bitstream 143 simultaneously.

[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 within the video decoder 144. The parameters include residual coefficients (represented by arrow 724), quantization parameters 774, secondary transform indices 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 the 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, which applies a secondary transform or performs no operation (bypass) 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 arranges 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. 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 module 744 is a block of residual samples, represented by 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 summing module 750, 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 needed to intra-predict subsequent CBs without the memory 206 (e.g., by instead using data 232, which is typically on-chip memory). Reference samples, represented by arrow 764, are retrieved 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 parameter 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-predicted samples 780 form the decoded PB 752 via the multiplexer module 784. Intra prediction generates 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 neighbor the current block and have already been reconstructed by preceding it in block decoding order. When a luma block and a chroma block are co-located, 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 as inter-prediction 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 a frame buffer 796. The block of samples 798 is obtained from a previously decoded frame stored in the frame buffer 796. In the bi-predictive case, 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 DBF, ALF, and SAO filtering operations. Generally, 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] 6 and 7 are modules for pre-processing video before encoding and post-processing video after decoding to shift sample values ​​to achieve more uniform use of the range of sample values ​​within each chroma channel. A multi-segment linear model is derived in video encoder 120 and signaled in the bitstream for use by video decoder 144 to undo the sample shift. This linear model chroma scaling (LMCS) tool provides compression advantages for certain color spaces and content with a degree of non-uniformity in sample space utilization, particularly limited range utilization, that can 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. 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 contains sample values ​​present in the decoded frame 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 indicated in the feature map groups 820. The inverse quantizer 814 then performs 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 the 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 each group's feature maps 812 to a range centered around zero and reaching 1 or -1, depending on whether the sign of the maximum amplitude value detected is positive or negative. In the rare case where positive and negative values ​​have equal maximum magnitude, a range of [-1, 1] is observed. The normalized samples of a 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 results are output as intermediate data in the form of tensor 149. Tensor 149 may include multiple tensors, each with a different spatial resolution, for example, when 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 feature group to the full sample range given by the sample bit depth, resulting 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 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 maps, but the quantization range must have the same data type as the values ​​in the group's feature maps. Coarser floating-point precision may be used, and rounding is applied to avoid a reduction in range when expressed in the original floating-point format (e.g., 32-bit IEEE 754 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 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. To generate the quantization range mantissa, a leading "1" is appended to the fractional part (i.e., the quantization range does not need to be a "denormal" value). Since the quantization ranges are always positive, there is no need to encode a sign bit for each quantization range. Since the quantization ranges can be greater than or less than 1, a sign bit for the quantization range exponent is required. In the arrangement of system 100, quantization ranges less than 1.0 are not allowed, and the quantization exponent sign bit can be omitted from the SEI message 1413. If the quantization exponent sign bit is not coded, then quantization ranges below 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 modules 518 and 814 differ from the quantization operations of video encoder 120 and video decoder 144, which involve the use of quantization parameters. Furthermore, the operations of modules 518 and 814 may be considered a form of tone mapping operation, which involves converting between the floating-point domain of tensors and the sample domain of frames. While there is scaling (i.e., via the quantization range of each group of feature maps) to utilize a wide range of sample value space, there are no quantization parameters applicable to modules 518 and 814 to further modify the quantizer step size.

[0118] 9A is a schematic block diagram illustrating a head portion 150 of a CNN for object detection. Depending on the task to be performed at the destination device 140, different networks can be used in place 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 coordinates within the original video data 113, scaling by the original video width and height is performed prior to resizing 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). Upscaler module 922 generates an upscaled tensor 924, which is passed to CBL module 926, which generates tensor 928 as an output. Tensor 928 is passed to detection module 930 and upscaler module 936. Detection module 930 generates a detected tensor 932, which is fed to NMS module 948. Upscaler module 936 is another instance of module 960 and outputs an upscaled tensor 938. Upscaled tensor 938 is passed to CBL module 940, which outputs tensor 942 to detection module 944. CBL modules 912, 926, and 940 each comprise a concatenation of five CBL modules. Upscaler modules 922 and 936 are each instances of upscaler module 960 as shown in FIG. 9B.

[0119] The upscaler module 960 accepts a tensor 962 as 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 the 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, which implements a detection kernel. The detection kernel, a 1×1 kernel, is applied to generate output feature maps in the three layers. The detection kernel is 1 × 1 × (B × (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 ("objectness"). 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 to the resulting bounding boxes by the NMS module 948 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 illustrating 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 containing 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 box 1026 is passed to a region of interest (ROI) pooler 1028, which uses a max pooling operation to generate a fixed-size feature map from various input size maps, and subsampling takes the maximum value within each group of input values ​​to generate a single output value in an 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 whose size is independent of the underlying portion of the feature maps 1010-1016. One of the feature maps 1010-1016 is selected so 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 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 box for the corresponding object category. Final processing is performed by the output layer module 1036, which receives 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 within 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 by increasing the width and height to a multiple of the minimum block size, for example, so that the width and height are each a multiple of 4. When arranging feature maps, due to mismatches 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. The sample values ​​in unused space in frame 1102, such as unused space 1104, are set to the midpoint of the frame's bit depth, 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 136 x 76 with 256 instances for feature map 1110, 68 x 38 with 512 instances for feature map 1112, and 34 x 19 with 1024 instances for feature map 1120. For clarity, FIG. 12 shows frame 1202 with fewer feature maps than would be present in a typical application, but the three layers and relative resolutions are represented in FIG. 12 as described below. Different CNNs and different divisions 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 different numbers of layers (i.e., amounts other than three layers).

[0123] When arranging the feature maps in a two-dimensional array in the form of monochrome frame 1102, feature maps of the same group of frames are arranged adjacently within frame 1102. For example, group 1106 contains feature map 1110, while groups 1108 and 1109 contain the remaining feature maps in the layer. Similarly, group 1114 contains feature map 1112, which has 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-by-group packing approach is used. Within each group, the feature maps exist in a determined ordering, and their arrangement within monochrome frame 1102 reflects the ordering.

[0124] When aligning feature maps in monochrome frame 1202 of FIG. 12, alignment with respect 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 alignment, unused sample space exists between adjacent feature maps. For example, a feature map of size 34×19 may be aligned across 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 within one feature map caused by content in adjacent feature maps and improves alignment of feature maps with respect 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 specific alignment grid, minimum padding between feature maps, such as two samples, can also be implemented. Minimum padding helps 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 without any unused sample space inserted between it and the neighboring feature map. The minimum padding area ensures some separation between neighboring feature maps, which can help reduce coding artifacts that cross over 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. Spatial similarity may be measured using sum of absolute differences, sum of squared differences, or some other similarity measure. The grouping applies to feature maps within the same layer and does 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 component feature maps. Sample-wise interleaving results in greater structural detail of the four feature maps shared by the same coding tree structure, and the detail between the four feature maps varies from sample to sample. Thus, a common coding tree structure and shared residuals (except for local differences necessary for coding 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 can be assigned to groups of any size because their group configuration, apart from the packing order, does not affect the packing process. In the next layer, four groups, such as group 1220, are packed in a sample-wise interleaved manner, followed by feature maps belonging to groups of other sizes, 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 groups of other sizes, 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 containing two or three feature maps with a high degree of similarity and belonging to different layers is placed in different color channels within a collocated region of the color frame 1301. Thus, the location of at least a portion of a first feature map in one layer corresponds relatively to the location of at least a portion 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 contains three feature maps, the third feature map is smaller in size than the feature map placed in the chroma plane 1310, and is packed into the second chroma plane 1320 to be twice as large, resulting in a double-packed feature map 1324. Because 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 used to improve compression efficiency when coding color frame 1301. For example, a tool that attempts to predict chroma samples from luma based on a difference model, such as a linear model targeting cross-color component prediction, can be applied. In the case of an inter-slice case 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 would be the case if the feature maps were located in different positions.

[0128] FIG. 14 is a schematic block diagram illustrating a bitstream 1400 holding 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 syntax 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., a 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 subprofile) indicated in bitstream 1400's signaled profile. 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 bitstream 1400's signaled profile. When set, each flag in constraint flags 1440 indicates the disabling of a specific 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 specific subprofile to which the bitstream conforms; the definition of the subprofile is defined outside the VVC standard. The GCI contains a set of flags, each of which constrains a specific coding tool not to be used in bitstream 1400.PLT 1438 can signal specific sets of tools, known as "profiles," that can 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 can further constrain the set of tools in a profile to subsets of tools, which may correspond to subprofiles. In general, when video encoder 120 is encoding video samples (i.e., from video source 112 via multiplexer 118), all tools in a given profile can be used to efficiently encode frame data. When video encoder 120 is encoding feature maps packed into a frame (i.e., from module 116), some tools in the VVC standard no longer provide a compression advantage. Tools that do not provide a compression advantage for packed feature maps need not be tried by video encoder 120 and can be signaled in 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 low-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 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 maps may be indicated in the SEI message 1413 using an index to select one CNN backbone from an enumeration of a set of predetermined 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 channels in each layer, as well as the resolution of each feature map in each layer, may be determined. For groupings where feature maps in a given group are in the same layer, a separate group list of feature map indices is coded for each layer. For groupings where feature maps within a given group may span multiple layers, a feature map index and layer index pair is coded for each group item. For groupings where the feature maps are in adjacent layers and there is at most one feature map per layer, a layer index is only needed for the first feature map in the group. If a group includes feature maps from all layers, e.g., all three layers, a group index is not needed because the feature map index implicitly applies to one feature map in each layer. If all feature maps from a given layer belong to one separate 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 shown in FIG. 14. Each access unit contains one or more slices, such as slice 1416. For the first access unit in the bitstream, typically a "random access point" access unit, intra-slice coding is used to avoid any prediction dependencies on other access units in the bitstream 1400. Slice 1416 contains a slice header 1418 followed by slice data 1420. The slice data 1420 contains a sequence of CTUs that provide a coded representation of the frame data. CTUs are square, typically 128x128 in size, which is not well aligned with typical feature map sizes. Arranging feature maps on a minimum block size, such as a 4x4 grid, partially ameliorates this misalignment.

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

[0133] Method 1500 begins with a run CNN first portion step 1510. In step 1510, the CNN backbone 114, under execution by the processor 205, executes a subset of layers of a particular CNN to transform an 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. 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 feature map similarity determination step 1520, module 116, under execution of processor 205, generates a similarity matrix containing a measure of similarity of each feature map with each feature map in each layer. The similarity matrix may be stored, for example, in memory 206 and / or hard disk drive 210. The similarity measure may be the mean squared difference (MSE) of two feature maps, or the sum of absolute differences (SAD) of two feature maps, or some other difference measure. If it is desired to measure the similarity of feature maps in different layers, feature maps with 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, for each random access point in the CLVS or only for the first picture of the CLVS. Control in processor 205 then passes from step 1520 to feature map grouping determination step 1530.

[0135] In feature map group determination step 1530, group determiner 510, under execution of processor 205, determines a set of groups to which feature maps are assigned. Feature map groups may be stored, for example, in memory 206 and / or hard disk drive 210. The operation of group determiner 510 is described with reference to Figure 17. Step 1530 should be performed when the affinity 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 processor 205 passes from step 1530 to feature map placement determination step 1540.

[0136] In a feature map placement determination step 1540, the packer module 522, under the execution of the processor 205, determines where each feature map will be 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 region, 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. Feature maps belonging to a given group are packed sequentially, 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 in different color channels. Because the number and size of feature maps do not change during operation of the source device 110, the placement can be determined once and saved 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 group range determination step 1550, range determiner 514, under execution of processor 205, determines the range of floating-point data in each group of feature maps determined in step 1530. The determined range may be stored, for example, in memory 206 and / or hard disk drive 210. For symmetric operation, the range of a group is the maximum magnitude (absolute) value of the values ​​in the feature maps belonging to the group. The range provides values ​​for normalization of the feature map data before quantization and conversion to integer sample values. For asymmetric operation, positive and negative ranges are determined for each group of feature maps, indicating the maximum positive and negative values ​​encountered within the group of feature maps. A quantization range is determined for each group of feature maps in tensor 115. The quantization range may be determined for tensors for 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 tensor for 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 size of the determined quantization range by some specified scaling factor. Multiplying the quantization range by a fixed factor, e.g., 8 / 7, compresses the sample range of the data used to a range that roughly corresponds 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, e.g., [0..1023] for 10-bit video. Control in processor 205 then passes from step 1550 to feature map quantization step 1560.

[0138] In the 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 first performed, 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 is not already 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 / 8 x 512 = 448 may be used. For 8-bit video data, an offset of 128 and a scaling factor of 128 or 112 may be used for video range-aligned operations. If the quantization range was determined for a tensor from the previous frame and not updated for the current frame, it is possible for 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 of floating-point values ​​to the range indicated by the quantization range is applied to prevent overflow. Clipping of 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 the 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 an allowance for some 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 pack step 1570.

[0139] In feature map pack 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 within memory 206 that holds one frame of video data and / or hard disk drive 210. Referring 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 the SEI message 1413 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 performed 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 several inter pictures allows for continuous adaptation to the data (i.e., intra / inter slice selection) that does not depend on the structure of the bitstream, for example, 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 profile level tier syntax 1438 in bitstream 120, and general constraint flags 1440 may signal that the following tools are not used in bitstream 120: 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). 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, which may be defined outside the VVC standard for feature map coding and included in SPS 1410. Disabling the deblocking filter improves compression efficiency and task performance when encoding feature maps.In the VVC coding standard, the deblocking filter is disabled for pictures that reference picture parameter sets in bitstream 121 that set pps_deblocking_filter_disabled_flag 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 constraint flags in VVC Standard Version 1, and therefore 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 processor 205 continues with the next frame.

[0142] FIG. 16 illustrates a method 1600 for decoding feature maps from encoded data and executing a second portion of the CNN. Method 1600 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, method 1600 may be implemented by destination device 140 as one or more software code modules of application program 233 under execution by processor 205. Method 1600 is repeated for each frame of video data encoded in bitstream 143. Software code modules of application program 233 implementing method 1600 may be stored, for example, on hard disk drive 210 and / or memory 206. Method 1600 begins with a feature map grouping decoding step 1610. 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, 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, 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 in 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 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 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, a single value is decoded for each feature map group in step 1620, 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 ​​representing the maximum and minimum values ​​of the floating-point data in the feature maps belonging to the respective group is decoded for each feature map group. Processor 205 may be operable to perform step 1620 for every frame of video data, or processor 205 may be operable to perform step 1620 less frequently. Step 1620 may be performed at random access points or intra-pictures in bitstream 143. When step 1620 is not performed for every frame, the feature map grouping and quantization range data are carried over to subsequent frames for reuse until a new set of feature map grouping and / or quantization range data is decoded from bitstream 143. Control in 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 by 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 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 feature map placement determination step 1640, unpacker module 810, under execution of processor 205, determines the location of each feature map in each layer within frame 145. Using the spatial size of each feature map, 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 FIGS. 11-13. If feature map size, quantity, and packing format do not change compared to the previous frame, feature map placement data is retained from the previous frame. Control in processor 205 then passes from step 1640 to 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 by 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 an 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 processor 205 passes from step 1660 to execute CNN second portion step 1670.

[0149] In a execute CNN second portion step 1670, the CNN head 150, under the execution of the processor 205, executes the remaining stages of the CNN (i.e., stages specific to a particular task). The decoded, unpacked, and dequantized tensors 149 are input to the CNN head 150. Within the CNN head 150, a series of convolutions, normalizations, 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 by processor 205. Software code modules of application program 233 that implement method 1700 may be stored on hard disk drive 210 and / or memory 206, for example. 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 finds the most similar feature map pair.

[0153] In step 1720, group determiner 510, under execution of processor 205, determines the pair of feature maps that have the greatest similarity in the similarity matrix from step 1520. Because the similarity matrix is ​​a measure of the differences between feature maps, the pair with the greatest similarity is identified by the position in the matrix that has the smallest 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 processor 205 then passes from step 1720 to a remaining maps test step 1730.

[0154] In a remaining maps test step 1730, the group determiner 510, under 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 feature map groups are considered for combining, 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 that have 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 find step 1740.

[0155] In a group index determination step 1740, the group determiner 510, under execution of the processor 205, determines to which group each feature map belongs 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 a pair of feature maps can be connected to form a 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 because a node in the list can only have a predecessor and a successor. The entry in the similarity matrix corresponding to the pair of feature maps is set to NaN to prevent 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 to prevent 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 a larger group from the two initial groups. In configurations where 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 feature map groups, the group size is limited, and if, after merging, the resulting group equals the group size, the rows and columns in the affinity matrix corresponding to each endpoint 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 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 connected 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 center 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 affinity 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 for combining into the larger group.

[0158] In one arrangement, all feature maps in each layer are merged into one group. When packed according to packing format 1100, the resulting feature map arrangement places similar feature maps relatively close together. VVC's intra-block copy coding tools 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 performing the method 1700 so that only groups of four feature maps in which the four feature maps are very similar are determined. 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 suitable for three-layer FPN. Inter-layer grouping is packed in a collocated manner using packing arrangement 1300, allowing the cross-component prediction tool of 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 for a layer reside in that layer's group. Within a group, the ordering of feature maps is encoded, allowing similar feature maps within a layer to be placed nearby, allowing tools such as IBC to 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 channel index. In such a configuration, one quantization range is coded per layer, resulting in low overhead for quantization range coding in the SEI message 1413.

[0163] Because various grouping approaches are possible, the "grouping_type" syntax element is included in the 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 for a video standard according to the type of frame data to be encoded. Method 1800 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, method 1800 may be implemented by source device 110 as one or more software code modules of application program 233 under execution by processor 205. The software code modules of application program 233 that implement method 1800 may be stored, for example, on hard disk drive 210 and / or memory 206. The steps of method 1800 are configured to determine whether source device 120 generates encoded video data including feature map encoded data based on a convolutional neural network (CNN). The steps of method 1800 are also configured to generate the encoded video data using multiple coding tools or functions for encoding the video data if source device 120 generates encoded video data including feature map encoded video data. 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 is generated using a first portion of the plurality of coding tools or functions but not 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, source device 110, under execution of processor 205, determines whether source device 110 will generate encoded regular 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 source device 110 is configured for video frame data, control in processor 205 passes from step 1820 to a video data functions selection step 1830. When source device 110 is configured for feature map transmission, control in 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 the 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 portion 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 frame data 119. A set of functions or coding tools that is a subset of the coding tools of a 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 specific 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 portion 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, and deblocking filter. In this example, the prohibition of use of the second portion of the coding tools or features may be indicated using a constraint flag. For video coding standards other than VVC, coding tools that provide similar functionality may be similarly disabled. Control in processor 205 passes from step 1840 to a frame data encoding step 1850 .

[0170] In a frame data encoding step 1850, video encoder 120, under execution of processor 205, encodes frame data 119 according to a set of functions or coding tools. Method 1800 ends, and source device 110 proceeds to the next frame. As a result of method 1800, 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 included data is regular video data or packed feature map data. Furthermore, when bitstream 121 encodes packed feature map data, SEI message 1413 is present for at least one frame, allowing destination device 140 to further process the data after decoding the bitstream (e.g., process decoded frame data 145 using modules 148 and 150). If destination device 140 is intended only to perform tasks according to CNN head 150, the destination device does not need to decode bitstream 143 when it is indicated to contain regular 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 any coding tools or features that are indicated as disabled via the constraint flag.

[0171] In the 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, 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, group configuration can 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 can be reduced in length to omit feature map indices already assigned to previous groups.

[0174] In the CNN backbone 310 arrangement, the tensor dimensions, and therefore the resulting feature map sizes, are chosen to be aligned with the block size of the VVC standard. For generally rectangular video and a default CTU size of 128x128, the width and height of the feature maps can be powers of two; for example, the sizes of the three layers can be 128x64, 64x32, and 32x16. Feature map sizes that are powers of two allow for greater alignment of packed features with the block sizes available in the VVC standard due to quadtree, binary, or ternary partitioning, reducing the likelihood of coding artifacts within 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 do not apply 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 apply to sps_deblocking_filter_enabled_flag in SPS 1410.If sps_deblocking_filter_enabled_flag is not present in 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 a constraint flag makes it possible to define sub-profiles for feature map coding that exclude the application of the deblocking filter. gci_no_deblocking_filter_flag may be present in the constraint flags 1440 field, including gci_reserved_zero_bits in Version 1 of the VVC standard. When the application of system 100 requires high quality, i.e., high bitrate, achieved using a low value of quantization parameter 692, deblocking may not be necessary, and a constraint flag may be used, for example, for feature map coding, to omit deblocking entirely. Industrial Applicability

[0176] The described arrangements are applicable to the computer and data processing industries, and in particular to digital signal processing for encoding and decoding 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"). Selecting a subset of tools provides several advantages, such as a vendor implementation advantage for 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] Also disclosed are arrangements for quantizing floating-point tensor data within 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, which has high overhead for quantization range data, while 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 needed 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 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 interpreted as an unsigned integer value.

[0183] The persistence of the Feature Map Information SEI message lasts until the next Feature Map Information SEI message is received from the associated AU or the CLVS ends.

[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 in 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 dimension of the tensor, and therefore the dimension of the feature map. The table below 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 range 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, and an ExplicitGrouping flag equal to 0 indicates that the feature map grouping is implicitly determined based on the 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 grouping_type.

[0201] An ExplicitLayerId flag equal to 1 indicates that the group may contain feature maps in different layers, and 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 when 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 of the position fm_idx within the 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 first assigned to one or more groups, 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 from 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 in 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 a bit width specified by qr_precision.

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

[0218] When quant_type is equal to 1, the first 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 range (if present) 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 coded data of a frame in which a plurality of feature maps obtained at least based on neural network processing of an input image are arranged; an encoding means for generating the encoded data of the frame in which the plurality of feature maps are arranged, using a first part of a plurality of functions and not using a second part of the plurality of functions including at least matrix intra prediction (MIP), when it is determined that encoded data of the frame in which the plurality of feature maps are arranged is to be generated; An encoding device comprising:

2. 2. The encoding device of claim 1, wherein the second portion of the plurality of functions further includes at least one of LFNST, LMCS, and 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 restricted so as not to be used in decoding encoded data of the frame in which the plurality of feature maps are arranged.

6. 2. The encoding device according to claim 1, wherein the encoded data of the input image conforms to a first encoding standard, and the encoded data of the frame in which the plurality of 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 arranged in a first area of ​​the frame; 2. The encoding device according to claim 1, wherein a feature map among the plurality of feature maps having a second width smaller than the first width and a second height smaller than the first height is arranged 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 coded data of a frame in which a plurality of feature maps obtained at least based on neural network processing of an input image are arranged; a decoding means for decoding the coded data of the frame in which the plurality of feature maps are arranged, using a first part of a plurality of functions and without using a second part of the plurality of functions including at least matrix intra prediction (MIP), when it is determined that the coded data of the frame in which the plurality of feature maps are arranged is to be decoded; A decoding device comprising:

13. 13. The decoding device of claim 12, wherein the second portion of the plurality of functions further includes at least one of LFNST, LMCS, and 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. 13. The decoding device according to claim 12, wherein the decoding means decodes information indicating that the second part of the plurality of functions is restricted so as not to be used in decoding the encoded data of the frame in which the plurality of feature maps are arranged.

17. The decoding device according to claim 12, 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.

18. A decoding device as 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 arranged 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 by the determining means is based on the information.

23. A method for determining whether to generate coded data for 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, generating the encoded data of the frame in which the plurality of feature maps are arranged, using a first part of a plurality of functions and not using a second part of the plurality of functions including at least matrix intra prediction (MIP); 10. A coding method comprising:

24. A method for determining whether to decode coded 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 it is determined that the encoded data of the frame in which the plurality of feature maps are arranged is to be decoded, decoding the encoded data of the frame in which the plurality of feature maps are arranged using a first part of a plurality of functions and without using a second part of the plurality of functions including at least matrix intra prediction (MIP). A decoding method comprising:

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

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

Citation Information

Patent Citations

  • Systems and method for virtual reality video conversion and streaming

    US20210195164A1

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

    WO2020263646A1

  • High precision transform and quantization for image and video coding

    WO2021052355A1