Method, apparatus and system for encoding and decoding tensors - Patents.com
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- CANON KK
- Filing Date
- 2023-04-11
- Publication Date
- 2026-04-21
AI Technical Summary
Existing video compression standards face challenges in efficiently encoding and decoding tensors from convolutional neural networks (CNNs), particularly in distributed machine task systems where cooperative intelligence is employed.
A method for encoding and decoding tensors that involves upsampling a first set of feature maps, deriving basis vectors through a predetermined process on tensors with different feature map sizes, and using these basis vectors to encode and decode the tensors.
This approach enables efficient compression and transmission of tensor data across networks, reducing computational load and maintaining task performance resilience to bit rate changes.
Smart Images

Figure 00000000_0000_ABST
Abstract
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. 2022202473, filed April 13, 2022, which is incorporated by reference in its entirety as if fully set forth herein. The present invention relates generally to digital video signal processing, and more particularly to a method, apparatus, and system for encoding and decoding tensors from a convolutional neural network. The present invention also relates to a computer program product including a computer readable medium having recorded thereon a computer program for encoding and decoding tensors from a convolutional neural network using video compression techniques. [Background technology]
[0002] Video compression is a ubiquitous technology used to support many applications, including applications for the transmission and storage of video data. Many video coding standards have been developed and others are currently under development. Recent developments in video coding standardization have led to the formation of a group called the "Joint Video Experts Team" (JVET). The Joint Video Experts Team (JVET) includes members from two Standards Setting Organisations (SSOs): Study Group 16, Question 6 (SG16 / Q6) of the International Telecommunication Union's (ITU) Telecommunication Standardisation Sector (ITU-T), also known as the "Video Coding Experts Group" (VCEG), and International Organization for Standardisation / International Electrotechnical Commission Joint Technical Committee 1 / Subcommittee 29 / Working Group 11 (ISO / IEC JTC1 / SC29 / WG11), also known as the "Moving Picture Experts Group" (MPEG).
[0003] The Joint Video Experts Team (JVET) developed a video compression standard called "versatile video coding" (VVC).
[0004] Convolutional Neural Networks (CNNs) are an emerging technology that addresses use cases involving machine vision, among others. CNNs typically contain many layers, such as convolutional layers, including fully connected layers, and data is passed from one layer to the next in the form of "tensors". The weights of each layer are determined in a training phase, where 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 a lower spatial resolution than the corresponding input tensor. Operations such as "max pooling" (or "Maxpool") also reduce the spatial size of the output tensor compared to the input tensor. Max pooling generates an output tensor by splitting the input tensor into groups of data samples (e.g., 2 × 2 groups of data samples), and from each group, selects the maximum value as the output for the corresponding value in the output tensor. The process of running a CNN with an input and progressively transforming the input into an output is commonly called "inference."
[0005] In general, tensors have four dimensions: batch, channel, height, and width. The first dimension, “batch”, of size “1” when inferring video data indicates that one frame is passed through the CNN at a time. When training the network, the value of the batch dimension can be increased so that multiple frames are passed through the network before the network weights are updated according to a given “batch size”. Multi-frame videos can be passed as a single tensor with the batch dimension increased in size according to the number of frames in a given video. However, due to practical considerations regarding memory consumption and access, inference on video data is typically performed on a frame-by-frame basis. The “channel” dimension indicates the number of concurrent “feature maps” for a given tensor. The height and width dimensions indicate the size of the feature maps at a particular stage of the CNN. The channel count varies through the CNN according to the network architecture. Also, the feature map size varies depending on the subsampling that occurs at a particular network layer.
[0006] 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 some dimensions related to the input width and height, plus an additional "channel" dimension.
[0007] Slicing the tensor based on the channel dimension results in a set of so-called "feature maps", since each slice of the tensor has some relationship to the corresponding input image, capturing characteristics such as various edge types. At layers further away from the input to the network, properties may be more abstract. The "task performance" of a CNN is measured by comparing the CNN's results in performing a task with a particular input to a provided ground truth, which is generally prepared by humans and is considered to represent the "correct" result.
[0008] Once the network topology is determined, the network weights can be updated over time as more training data becomes available. It is also possible to retrain a portion of the CNN and leave the weights in other portions of the network unchanged. The overall complexity of CNNs tends to be high, with a relatively large number of multiply-add operations being performed and many intermediate tensors being written to and read from memory. In some applications, CNNs are implemented entirely in the "cloud", requiring expensive and expensive processing power. In other applications, CNNs are implemented on edge devices such as cameras or mobile phones, providing less flexibility but with a more distributed processing load. New architectures include splitting the network into parts, one of which runs on the edge device and another one in the cloud. Such distributed network architectures are sometimes called "collaborative intelligence". Collaborative intelligence offers benefits such as reusing partial results from a first portion of the network with several different second portions, perhaps with each portion optimized for a different task. Collaborative intelligence architectures introduce the need for efficient compression of tensor data for transmission over networks such as WANs. The tensor data can be stored in compressed form on a server in the cloud or on the device as partially processed data to be used later for various tasks.
[0009] VVC is expected to address the continuing demand for higher and higher compression performance, particularly as video formats increase in capability (e.g., having higher resolutions and higher frame rates), and to address the growing market demand for service delivery over WANs where bandwidth costs are relatively high. VVC is implementable in modern silicon processes and provides an acceptable tradeoff between achieved performance and implementation cost. Implementation cost may be considered, for example, in terms of one or more of silicon area, CPU processor load, memory utilization, and bandwidth. Part of the versatility of the VVC standard lies in the wide selection of tools available for compressing video data, as well as the wide range of applications for which VVC is suitable.
[0010] Video data includes a sequence of frames of image data, each frame including one or more color channels. Generally, one primary color channel and two secondary color channels are required. The primary color channel is commonly referred to as the "luma" channel, and the secondary color channel is commonly referred to as the "chroma" channel. Video data is typically displayed in the RGB (red-green-blue) color space, which has a high degree of correlation between the three respective components. Video data representations seen by encoders or decoders often use color spaces such as YCbCr. YCbCr concentrates luminance, which is mapped to "luma" according to a transfer function, in the Y (primary) channel and chroma in the Cb and Cr (secondary) channels. Due to the use of uncorrelated YCbCr signals, the statistics of the luma channel are significantly different from the statistics of the chroma channels. The main difference is that after quantization, the chroma channel contains a relatively small number of significant coefficients for a given block compared to the coefficients of the corresponding luma channel block. Additionally, the Cb and Cr channels may be spatially sampled (subsampled) at a lower rate compared to the luma channel, e.g., half horizontally and half vertically, known as the "4:2:0 chroma format". The 4:2:0 chroma format is commonly used for Internet video streaming, broadcast television, Blu-Ray,TM It is commonly used in "consumer" applications, such as saving to disk. If only luma samples are present, the resulting monochrome frame is said to use a "4:0:0 chroma format".
[0011] The VVC standard specifies a "block-based" architecture, where a frame is first divided into a square array of regions known as "coding tree units" (CTUs). Typically, a CTU occupies a relatively large area, such as 128x128 luma samples. Other possible CTU sizes when using the VVC standard are 32x32 and 64x64. However, the right-most and bottom-most CTUs of each frame may be smaller in area, and an implicit division occurs to ensure that the CBs remain within the frame. Associated with each CTU is a "coding tree" for both the luma and chroma channels (a "shared tree"), or a separate tree for each of the luma and chroma channels. The coding trees define the decomposition of the area of the CTU into a set of blocks, also called "coding blocks" (CBs). When a shared tree is in use, a single coding tree specifies blocks for both the luma and chroma channels, in which case the collection of co-located coding blocks is called a "coding unit" (CU) (i.e., each CU with a coding block for each color channel). The CBs are processed for encoding or decoding in a particular 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 CUs mentioned above, as well as the "prediction unit" (PU) and the "transform unit" (TU). A single tree with CUs spanning the color channels of 4:2:0 chroma format video data makes the chroma blocks half the width and height of the corresponding luma blocks. When separate coding trees are used for a given area, the CBs mentioned above, as well as the "prediction block" (PB) and the "transform block" (TB) are used.
[0012] Notwithstanding the above distinction between "units" and "blocks", the term "block" may be used as a generic term for an area or region of a frame where an operation is applied to all color channels.
[0013] For each CU, a prediction unit (PU) of the contents (sample values) of the corresponding region of the frame data is generated ("Prediction Unit"). In addition, a representation of the difference (or "spatial domain" residual) between the prediction and the contents of the region seen at the input to the encoder is formed. The differences in each color channel may be transformed and coded as a sequence of residual coefficients, forming one or more TUs for a given CU. The transform applied may be a discrete cosine transform (DCT) or other transform, applied to each block of residual values. The transform is applied separably (i.e., a two-dimensional transform is performed in two passes). The block is first transformed by applying a one-dimensional transform to each row of samples in the block. The partial results are then transformed by applying a one-dimensional transform to each column of the partial results to produce a final block of transform coefficients that substantially decorrelates the residual samples. Transforms of various sizes are supported by the VVC standard, including transforms of rectangular shaped blocks, with each side dimension being a power of two. The transform coefficients are quantized for entropy coding into the bitstream.
[0014] VVC features intra-frame prediction and inter-frame prediction. Intra-frame prediction involves the use of previously processed samples in a frame that are used to generate a prediction of a current block of data samples in the frame. Inter-frame prediction involves using a block of samples taken from a previously decoded frame to generate a prediction of a current block of samples in a frame. The block of samples taken from a previously decoded frame is offset from the spatial location of the current block, often according to a motion vector with filtering applied. An intra-frame prediction block may be (i) a uniform sample value ("DC intra-prediction"), (ii) a plane with an offset and horizontal and vertical gradients ("planar intra-prediction"), (iii) a population of blocks with neighboring samples applied in a particular direction ("angular intra-prediction"), or (iv) the result of a matrix multiplication using neighboring samples and selected matrix coefficients. Further discrepancies between the predicted block and the corresponding input samples may be corrected to some extent by encoding a "residual" into the bitstream. The residuals are generally 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 generate residual coefficients in a "secondary transform domain". The residual coefficients are quantized according to a quantization parameter, resulting in a loss of accuracy in the reconstruction of samples generated at the decoder, but with a reduced bit rate in the bitstream. A sequence of pictures may be coded according to a specified structure of pictures using intra prediction and pictures using intra or inter prediction, where the specified dependency on preceding pictures in the coding order may differ from the display or distribution order. A "random access" structure results in periodic intra pictures, forming an entry point at which the decoder and the decoder start decoding the bitstream. Other pictures in the random access structure generally use inter prediction to predict their content from pictures before and after the current picture in the display or distribution order, according to a specified depth hierarchical structure.The use of pictures after the current picture in display order to predict the current picture requires some degree of picture buffering and delay between the decoding of a given picture and its display (and removal from the buffer). Summary of the Invention
[0015] It is an object of the present invention to substantially overcome, or at least ameliorate, one or more disadvantages of existing arrangements.
[0016] One aspect of the disclosure provides a method for encoding a tensor including a first set of feature maps and a second set of feature maps, where the feature maps in the first set have a first size and the feature maps in the second set have a second size greater than the first size, the method including upsampling the first set of feature maps, deriving basis vectors by performing a predetermined operation on a tensor including the upsampled first set of feature maps and the second set of feature maps, and deriving coefficients of the tensor using the derived basis vectors to encode the tensor.
[0017] Another aspect of the disclosure provides a method for decoding, from encoded data, a tensor including a first set of feature maps and a second set of feature maps, the feature maps in the first set having a first size and the feature maps in the second set having a second size larger than the first size, decoding basis vectors and coefficients, deriving a tensor using at least the decoded basis vectors and the decoded coefficients, and deriving the first set of feature maps by downsampling a first portion of the derived tensor.
[0018] Another aspect of the present disclosure provides an encoder for encoding a tensor including a first set of feature maps and a second set of feature maps, where the feature maps in the first set have a first size and the feature maps in the second set have a second size larger than the first size, the encoder being configured to upsample the first set of feature maps, derive basis vectors by performing a predetermined operation on a tensor including the upsampled first set of feature maps and the second set of feature maps, and derive coefficients of the tensor using the derived basis vectors to encode the tensor.
[0019] Another aspect of the present disclosure provides a non-transitory computer-readable storage medium storing a program for performing a method for encoding a tensor including a first set of feature maps and a second set of feature maps, where the feature maps in the first set have a first size and the feature maps in the second set have a second size larger than the first size, the method including upsampling the first set of feature maps, deriving basis vectors by performing a predetermined operation on a tensor including the upsampled first set of feature maps and the second set of feature maps, and deriving coefficients of the tensor using the derived basis vectors to encode the tensor.
[0020] Another aspect of the disclosure provides a system having a memory and a processor configured to execute code stored in the memory for performing a method for encoding a tensor including a first set of feature maps and a second set of feature maps, the feature maps in the first set having a first size and the feature maps in the second set having a second size greater than the first size, the method including upsampling the first set of feature maps, deriving basis vectors by performing a predetermined operation on a tensor including the upsampled first set of feature maps and the second set of feature maps, and deriving coefficients of the tensor using the derived basis vectors to encode the tensor.
[0021] Another aspect of the disclosure provides a decoder for decoding, from encoded data, a tensor including a first set of feature maps and a second set of feature maps, the feature maps in the first set having a first size and the feature maps in the second set having a second size larger than the first size, the decoder being configured to decode basis vectors and coefficients, derive a tensor using at least the decoded basis vectors and the decoded coefficients, and derive the first set of feature maps by downsampling a first portion of the derived tensor.
[0022] Another aspect of the present disclosure provides a non-transitory computer-readable storage medium storing a program for performing a method of decoding a tensor including a first set of feature maps and a second set of feature maps, the feature maps in the first set having a first size, and the feature maps in the second set having a second size larger than the first size, from encoded data, the method including decoding basis vectors and coefficients, deriving a tensor using at least the decoded basis vectors and the decoded coefficients, and deriving the first set of feature maps by downsampling a first portion of the derived tensor.
[0023] Another aspect of the disclosure provides a system having a memory and a processor configured to execute code stored in the memory to implement a method of decoding a tensor including a first set of feature maps and a second set of feature maps, the feature maps in the first set having a first size, and the feature maps in the second set having a second size larger than the first size, from encoded data, the method including decoding basis vectors and coefficients, deriving a tensor using at least the decoded basis vectors and the decoded coefficients, and deriving the first set of feature maps by downsampling a first portion of the derived tensor.
[0024] Other aspects are also disclosed. [Brief description of the drawings]
[0025] At least one embodiment of the present invention will now be described with reference to the following drawings and appendix. [Figure 1] FIG. 1 is a schematic block diagram illustrating a distributed machine task system. [Figure 2A] FIG. 2A forms a schematic block diagram of a general-purpose computer system upon which the distributed machine tasks system of FIG. 1 may be implemented. [Figure 2B] FIG. 2B forms a schematic block diagram of a general-purpose computer system upon which the distributed machine tasks system of FIG. 1 may be implemented. [Figure 3A] FIG. 3A is a schematic block diagram showing the functional modules of the backbone portion of the CNN. [Figure 3B] FIG. 3B is a schematic block diagram illustrating the residual block of FIG. 3A. [Figure 3C] FIG. 3C is a schematic block diagram of the residual unit of FIG. 3A. [Figure 3D] FIG. 3D is a schematic block diagram illustrating the CBL module of FIG. 3A. [Figure 4] FIG. 4 is a schematic block diagram showing the functional modules of the alternative backbone portion of the CNN. [Diagram 5] FIG. 5 is a schematic block diagram illustrating an inter-channel decorrelation based tensor encoder as part of a distributed machine task system. [Figure 6] FIG. 6 is a schematic block diagram showing a feature map packer, a packed frame encoder, and an unpacker as part of an inter-channel decorrelation based tensor encoder. [Figure 7] FIG. 7 is a schematic block diagram showing functional modules of a video encoder. [Figure 8] FIG. 8 is a schematic block diagram illustrating an inter-channel decorrelation based tensor decoder as part of a distributed machine task system. [Figure 9] FIG. 9 is a schematic block diagram showing functional modules of a video decoder. [Figure 10A] FIG. 10A is a schematic block diagram showing the head section of a CNN. [Figure 10B] FIG. 10B is a schematic block diagram illustrating the upscaler module of FIG. 10A. [Figure 10C] FIG. 10C is a schematic block diagram showing the detection module of FIG. 10A. [Figure 11] FIG. 11 is a schematic block diagram showing an alternative head portion of a CNN. [Figure 12A] FIG. 12A is a schematic block diagram illustrating the arrangement of sub-pictures for holding inter-channel decorrelated tensor data. [Figure 12B] FIG. 12B is a schematic block diagram illustrating the arrangement of sub-pictures for holding inter-channel decorrelated tensor data. [Figure 13] FIG. 13 is a schematic block diagram illustrating a bitstream carrying encoded inter-channel decorrelation feature maps and associated metadata. [Figure 14] FIG. 14 shows a method for running the first part of the CNN, decorrelating, and encoding the resulting feature maps. [Figure 15] FIG. 15 shows a method for decoding the bitstream, reconstructing the decorrelated feature maps, and running the second part of the CNN. [Figure 16A] FIG. 16A shows two successive data sets and the associated eigenvectors. [Figure 16B] FIG. 16B shows two successive data sets and the associated eigenvectors. [Figure 17] FIG. 17 illustrates a method for adjusting the basis vectors resulting from successive decorrelation operations on tensors generated from the first part of the CNN. [Figure 18A] FIG. 18A is a schematic block diagram showing a tensor reduction module for combining tensors from different layers in an FPN before compressing them using decomposition. [Figure 18B]FIG. 18B is a schematic block diagram showing a tensor separation module for extracting tensors of different FPN layers from the combined tensor after decompression. [Figure 19] FIG. 19 illustrates a method for resampling a tensor from a multi-layer first part of a CNN for decorrelation with another tensor from the multi-layer first part of the CNN. [Figure 20] FIG. 20 shows a method for resampling the tensors reconstructed from the bitstream to the original resolution for the second part of the CNN. [Figure 21] FIG. 21 shows a method for determining basis vectors for encoding tensors from the first part of the CNN. [Figure 22] FIG. 22 shows how to decode the basis vectors used to encode the tensors from the first part of the CNN. [Diagram 23] FIG. 23 is a schematic block diagram showing the relationship between tensors of different layers at split points in the network and the resulting options for recovering encoded tensors from a tensor combiner.
[0026] Appendix A shows the SEI message format and associated semantics for expressing metadata related to basis vector packing in a bitstream. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0027] Where reference is made to steps and / or features having the same reference numbers in any one or more of the accompanying drawings, those steps and / or features have the same function or operation for the purposes of this description, unless intended to the contrary.
[0028] The distributed machine task system may include edge devices, such as network cameras or smartphones, that generate intermediate compressed data. The distributed machine task system may also include end devices, such as server farm-based ("cloud") applications, that operate on the intermediate compressed data to generate task results. Examples of task results include mAP (mean average precision), which is used to indicate performance of object detection and instance segmentation tasks, and MOTA (multiple object tracking accuracy), which is used to measure the accuracy of tracking objects across multiple video frames. Other examples of task results include human pose estimation and action recognition. In addition, edge device functions may be implemented in the cloud, and the intermediate compressed data may be stored for later processing, potentially for multiple different tasks as needed.
[0029] A convenient form of intermediate compressed data is a compressed video bitstream, due to the availability of high performance compression standards and their implementations. Video compression standards typically operate on integer samples of some given bit depth, such as 10 bits, arranged in planar arrays. Color video has three planar arrays, for example corresponding to the color components Y, Cb, Cr, or R, G, B, depending on the application. CNNs typically operate on floating-point data in the form of tensors. Tensors generally have a relatively small spatial dimensionality compared to the input video data on which CNNs operate. Tensors generally have more channels than the three channels typical for color video data.
[0030] Tensors typically have the following dimensions: frames, channels, height, and width. For example, a tensor with dimensions [1, 256, 76, 136] is said to contain 256 feature maps (channels), each of size 136 × 76. For video data, inference is typically performed one frame at a time (frame value 1) rather than using tensors that contain multiple frames.
[0031] VVC supports the division of a picture into multiple subpictures, each of which can be coded and decoded independently. In one approach, each subpicture is coded as one "slice" or as a contiguous sequence of coded CTUs. A "tiling" mechanism is also available to divide a picture into several independently decodable regions. Subpictures can be specified in a more or less flexible way, with different rectangular sets of CTUs coded as the respective subpictures. The flexible definition of subpicture dimensions allows to efficiently hold types of data that require different areas in one picture, and avoids large "unused" areas, i.e. areas of the frame that are not used for the reconstruction of tensor data.
[0032] FIG. 1 is a schematic block diagram showing the functional modules of a distributed machine task system 100. The concept of distributing machine tasks across multiple systems is sometimes called "collaborative intelligence" (CI). To split a particular neural network into two parts, a "split point" in the network must be specified. The layers in the network from the input layer to the split point are executed on a first device, and the resulting intermediate tensor(s) are compressed. The layers from the split point to the end of the network are executed using the decompressed tensors from the first device. At the split point, there may be one or more tensors that need to be compressed. The dimensions of the tensors may be the same or different. When a "feature pyramid network" (FPN) is used, it is common for layers to be related in width and height such that a given layer is half the width and height of the previous layer. FPN architectures may also define a halving of width and height that occurs on every alternating layer. In some architectures, multiple tensors of the same width and height are found. The channel count between layers may vary or may be the same. Therefore, a compression method that is applicable to the various network topologies used in modern CNNs would be beneficial for application in a wide range of scenarios.
[0033] The system 100 may be used to implement a method for decorrelating, packing, and quantizing feature maps into planar frames for encoding and decoding feature maps from encoded data. The system 100 may be used such that the computational burden of associated overhead data is acceptable and the task performance for the decoded feature maps is tolerant to changes in the bit rate of the bitstream. The system 100 may also be used such that the quantized representation of tensors does not unnecessarily consume bits that do not provide a commensurate benefit in terms of task performance.
[0034] The system 100 includes a source device 110 for generating encoded tensor data 115a from a CNN backbone 114 in the formation of an encoded video bitstream 121. The system 100 also includes a destination device 140 for decoding the tensor data in the formation of an encoded video bitstream 143. A communication channel 130 is used to communicate the encoded video bitstream 121 from the source device 110 to the destination device 140. In some configurations, the source device 110 and the destination device 140 may comprise either or both of a respective mobile telephone handset (e.g., a "smartphone") or a network camera and a cloud application. The communication channel 130 may be a wired connection, such as an Ethernet, or a wireless connection, such as WiFi or 5G, including a connection via a wide area network (WAN), or a connection via an ad-hoc connection. Additionally, the source device 110 and the destination device 140 may comprise an application in which the encoded video data is captured on some computer-readable storage medium, such as a file server or a hard disk drive in memory.
[0035] As shown in FIG. 1, source device 110 includes video source 112, CNN backbone 114, tensor combiner 162, principal component analysis (PCA) encoder 160, 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 an operating system and various applications 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. Video source 112 may generate independent images or may generate time-sequential images, i.e., videos.
[0036] The CNN backbone 114 receives the video frame data 113 and runs a particular layer of the overall CNN, such as a layer corresponding to the "backbone" of the CNN, and outputs tensor 115a. The backbone layer of the CNN may, for example, generate as output multiple tensors corresponding to different spatial scales of the input image represented by the video frame data 113. The different spatial scales may be referred to as a "feature pyramid network" (FPN) architecture. The FPN may, for example, result in three tensors corresponding to the three layers being output from the backbone 114 as tensor 115a when the "YOLOv3" network (used for object detection) is run by the system 100 and the spatial resolution and channel count vary. When the system 100 is running a network such as "Fast RCNN X101-FPN" (used for object detection) or "Mask RCNN X101-FPN" (used for instance segmentation), tensor 115a includes tensors for five layers P2-P5. The tensor combiner 162 may combine two layers by resampling the tensors for one layer and concatenating the resulting tensors with the tensors of another layer, e.g., an adjacent layer in an FPN, to generate a combined tensor 115. The PCA encoder 160 receives the tensors 115 output from the tensor combiner 162. Combining layers is suitable when there is sufficient inter-layer correlation for the combined layer to be represented using fewer basis vectors than would be required if the layers were individually decorrelated layers. The degree of inter-layer correlation is a property of the network itself and the input data provided. The degree of inter-layer correlation allows for a reduction in the total number of basis vectors of the combined tensor compared to the sum of the number of basis vectors if the tensors of each layer were individually decorrelated separately.For example, if one typically uses 25 basis vectors per layer and concatenates two layers, the number of basis vectors required by the concatenated layers may be set to less than 50. A configuration in which the number of basis vectors used is adaptive to the explained variance of the basis vectors can achieve a reduction in basis vector count by exploiting such inter-layer correlation, and is discussed with reference to Figures 21 and 22. To the extent that the inter-layer correlation is affected by the input data, the tensor combiner 162 can select whether to combine layers such that the basis vector area is minimized. If the network is understood to have some inter-layer correlation, a fixed configuration may be applied, for example downsampling the least decomposed layer of the FPN and combining the result with the second least decomposed layer of the FPN in a decorrelation step (i.e., 1480). If layer combining is not appropriate or necessary, the tensor combiner 162 does not perform any operation and the tensor 115 is equal to the tensor 115a.
[0037] The PCA encoder 160 operates to encode one or more inner layers of the overall CNN output by the CNN backbone 114. The PCA encoder 160 first decorrelates a DC-normalized version of the tensor across the channels of the respective tensor using a method such as Principal Component Analysis (PCA). The DC-normalized version of the tensor is generated by removing a "mean feature" from each channel of the tensor. The mean feature may be uniformly removed (subtracted) from all channels of the tensor, or the mean feature may be removed in a channel-dependent manner by application of a forward transform, resulting in a corresponding "mean coefficient" for each channel of the tensor. A subset of the eigenvectors resulting from the PCA are used as "basis vectors" (or interchangeably, the term "components" may be used to refer to the basis vectors) to represent the channels of the tensor to be encoded. Each channel of the tensor is transformed using the basis vectors to generate coefficients. The basis vectors, mean feature maps, and associated coefficients are quantized and packed into a video frame. The video frame is encoded using a video encoder and output as a bitstream 121. The bitstream 121 is provided to a transmitter 122 for transmission over a communication channel 130, or the bitstream 121 is written to a storage device 132 for later use.
[0038] The source device 110 supports a particular network for the CNN backbone 114. However, the destination device 140 may use one of several networks for the head CNN 150. In using one of several networks for the head CNN 150, partially processed data in the form of packed feature maps may be stored for later use in performing various tasks without having to perform the operations of the CNN backbone 114 again.
[0039] Bitstream 121 is transmitted by transmitter 122 as encoded video data (or "encoded video information") over communication channel 130. Bitstream 121 may in some implementations be stored in storage memory 132, which is a non-transitory storage device such as "flash" memory or a hard disk drive, until later transmitted over (or in lieu of transmission over) communication channel 130. For example, encoded video data may be provided on demand to a customer over a wide area network (WAN) for video analytics applications.
[0040] The destination device 140 includes a receiver 142, a PCA decoder 170, a tensor separator 172, a CNN head 150, and a CNN task result buffer 152. The receiver 142 receives the encoded video data from the communication channel 130 and passes the video bitstream 143 to the PCA decoder 170. The PCA decoder 170 outputs the decoded tensor 149a, which is fed to the tensor separator 172. The tensor separator performs the inverse operation of the tensor combiner 162 to generate the extracted tensor 149. The extracted tensor 149 is passed to the CNN head 150. In architectures where layer combining is not appropriate or required, the tensor separator 172 does not perform any operation and the tensor 149 is equal to the tensor 149a. The CNN head 150 executes the layers after the task initiated in the CNN backbone 114 to generate the task result 151. Task results 151 are stored in task result buffer 152. The contents of task result buffer 152 may be presented to a user via a graphical user interface, for example, or provided to an analysis application where some action is determined based on the task results, and the task results may include a summary-level presentation of aggregated task results to the user. The functionality of each of source device 110 and destination device 140 may also be implemented in a single device, examples of which include a mobile phone handset, a tablet computer, and a cloud application.
[0041] Notwithstanding the exemplary devices described above, each of the source device 110 and the destination device 140 may generally be configured within a general-purpose computing system through a combination of hardware and software components. Figure 2A shows such a computer system 200 including a computer module 201, input devices such as a keyboard 202, a mouse pointer device 203, a scanner 226, a camera 227 that may be configured as a video source 112, a microphone 280, and output devices including a printer 215, a display device 214, and a loudspeaker 217. An external modulator-demodulator (Modem) transceiver device 216 may be used by the computer module 201 to communicate to and from a communication network 220 via a connection 221. The communication network 220, which may represent the communication channel 130, may be a (WAN), such as the Internet, a cellular telecommunications network, or a private WAN. If the connection 221 is a telephone line, the modem 216 may be a conventional "dial-up" modem. Alternatively, the modem 216 may be a broadband modem where the connection 221 is a high-capacity (e.g., cable or optical) connection. A wireless modem may also be used for wireless connection to the communications network 220. The transceiver device 216 may provide the functionality of the transmitter 122 and receiver 142, and the communications channel 130 may be implemented in the connection 221.
[0042] 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 a semiconductor random access memory (RAM) and a semiconductor read only memory (ROM). The computer module 201 also includes several input / output (I / O) interfaces, including an audio-video interface 207 that couples to a video display 214, a loudspeaker 217 and a microphone 280, an I / O interface 213 that couples to a keyboard 202, a mouse 203, a scanner 226, a camera 227, and optionally a joystick or other human interface device (not shown), and an interface 208 for an external modem 216 and a printer 215. The signal from the audio-video interface 207 to the computer monitor 214 is typically the output of a computer graphics card. In some implementations, the modem 216 can be integrated into the computer module 201, for example into the interface 208. The computer module 201 also has a local network interface 211 that allows the coupling of the computer system 200 via a connection 223 to a local area communication network 222, known as a local area network (LAN). As shown in Fig. 2A, the local communication network 222 can also be coupled to a wide network 220 via a connection 224, which typically includes a so-called "firewall" device or a device of similar functionality. The local network interface 211 can be an Ethernet TM Circuit card, Bluetooth TM 2. The local network interface 211 may also provide the functionality of the transmitter 122 and the receiver 142, and the communication channel 130 may also be implemented in a local communications network 222.
[0043] The I / O interfaces 208 and 213 may provide either or both of serial and parallel connectivity, the former typically being implemented according to the Universal Serial Bus (USB) standard and having a corresponding USB connector (not shown). A storage device 209 is provided and typically includes a hard disk drive (HDD) 210. Other storage devices such as a floppy disk drive or a magnetic tape drive (not shown) may also be used. An optical disk drive 212 is typically provided to act as a non-volatile source of data. For example, an optical disk (e.g., CD-ROM, DVD, Blu ray Disc TM ), USB-RAM, portable, external hard drives, and portable memory devices such as floppy disks can be used as suitable sources of data to computer system 200. Typically, any of HDD 210, optical drive 212, networks 220 and 222 may be configured to operate as a video source 112 or as a destination for decoded video data to be stored for playback via display 214. Source device 110 and destination device 140 of system 100 may be implemented in computer system 200.
[0044] The components 205-213 of the computer module 201 typically communicate via an interconnected bus 204 and in a manner that results in a conventional mode of operation of the computer system 200 known to those skilled in the art. For example, the processor 205 is coupled to the system bus 204 using a connection 218. Similarly, the memory 206 and optical disk drive 212 are coupled to the system bus 204 by a connection 219. Examples of computers on which the described arrangements can be implemented include IBM-PC's and compatibles, Sun SPARC stations, Apple Macs, and similar computers. TM , or a similar computer system.
[0045] Where appropriate or desired, the PCA encoder 160 and the PCA decoder 170, as well as the methods described below, may be implemented using the computer system 200. In particular, the PCA encoder 160, the PCA decoder 170, and the methods described may be implemented as one or more software application programs 233 executable within the computer system 200. In particular, the PCA encoder 160, the PCA decoder 170, and the steps of the methods described are performed by instructions 231 (see FIG. 2B) in the software 233 executed within the computer system 200. The software instructions 231 may be formed as one or more code modules, each for performing one or more specific tasks. The software may also be divided into two separate parts, with a first part and corresponding code modules performing the methods described, and a second part and corresponding code modules managing a user interface between the first part and a user.
[0046] The software may be stored in a computer readable medium, including, for example, the storage devices described below. The software is loaded from the computer readable medium into the computer system 200 and then executed by the computer system 200. A computer readable medium having such a computer program or software recorded thereon is a computer program product. The use of the computer program product in the computer system 200 preferably results in an advantageous apparatus for implementing the source device 110 and the destination device 140 and the methods described.
[0047] 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.
[0048] In some examples, the application program 233 may be encoded on one or more CD-ROMs 225 and provided to the user and read via a corresponding drive 212 or may be read by the user from the network 220 or 222. Additionally, the software may be loaded into the computer system 200 from other computer readable media. A computer readable storage medium refers to any non-transitory tangible storage medium that provides recorded instructions and / or data to the computer system 200 for execution and / or processing. Examples of such storage media are floppy disks, magnetic tapes, CD-ROMs, DVDs, Blu-ray Discs, and the like. TM , hard disk drives, ROMs or integrated circuits, USB memory, magneto-optical disks, or computer readable cards such as PCMCIA cards, and the like, such devices being internal or external to the computer module 201. Examples of transitory or non-tangible computer readable transmission media that may also participate in providing software, application programs, instructions, and / or video data or encoded video data to the computer module 201 include wireless or infrared transmission channels, as well as network connections to other computers or networked devices, and the Internet or intranets, including e-mail transmissions and information stored on websites, etc.
[0049] A second portion of the application programs 233 and corresponding code modules described above may be executed to implement one or more graphical user interfaces (GUIs) that are rendered or represented on the display 214. A user of the computer system 200 and applications, typically through manipulation of a keyboard 202 and mouse 203, may manipulate the interfaces in a functionally adaptable manner to provide control commands and / or input to applications associated with the GUIs. 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.
[0050] 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.
[0051] When the computer module 201 is first powered on, a power-on self-test (POST) program 250 is executed. The POST program 250 is typically stored in the ROM 249 of the semiconductor memory 206 of FIG. 2A. Hardware devices such as the ROM 249 that store software are sometimes referred to as firmware. The POST program 250 inspects the hardware in the computer module 201 to ensure proper functioning, and typically checks the processor 205, the memory 234 (209, 206), and a basic input / output system software (BIOS) module 251, also typically stored in the ROM 249, for correct operation. If the POST program 250 executes successfully, the BIOS 251 boots the hard disk drive 210 of FIG. 2A. The booting of the hard disk drive 210 causes a bootstrap loader program 252 resident on the hard disk drive 210 to execute via the processor 205. This loads the operating system 253 into the RAM memory 206, and the operating system 253 begins operation. Operating system 253 is a system level application executable by processor 205 and performs a variety of high-level functions, including processor management, memory management, device management, storage management, a software application interface, and a general-purpose user interface.
[0052] The operating system 253 manages the memory 234 (209, 206) to ensure that each process or application running on the computer module 201 has enough memory to execute without colliding with memory allocated to another process. Furthermore, the different types of memory available in the computer system 200 of FIG. 2A need to be used appropriately so that each process can execute effectively. Thus, the aggregate memory 234 is not intended to show how specific segments of memory are allocated (unless otherwise noted), but rather is intended to provide a general view of memory accessible by the computer system 200, and how such memory is used.
[0053] As shown in FIG. 2B, the processor 205 includes several functional modules, including a control unit 239, an arithmetic logic unit (ALU) 240, and a local or internal memory 248, sometimes referred to as a cache memory. The cache memory 248 typically includes several storage registers 244-246 in a register section. One or more internal buses 241 operatively interconnect these functional modules. The processor 205 also typically has one or more interfaces 242 for communicating with external devices via the system bus 204, using a connection 218. The memory 234 is coupled to the bus 204 using a connection 219.
[0054] The application program 233 includes a set of instructions 231, which may include conditional branch and loop instructions. The program 233 may also include data 232 used in the execution of the program 233. The instructions 231 and the data 232 are stored in memory locations 228, 229, 230 and 235, 236, 237, respectively. Depending on the relative sizes of the instructions 231 and the memory locations 228-230, a particular instruction may be stored in a single memory location, as indicated by the instruction shown in memory location 230. Alternatively, the instructions may be segmented into several portions, each stored in a separate memory location, as indicated by the instruction segments shown in memory locations 228 and 229.
[0055] In general, the processor 205 is given a set of instructions to execute therein. The processor 205 waits for a subsequent input to which the processor 205 responds by executing another set of instructions. Each input may be provided from one or more of several sources, including data generated by one or more of the input devices 202, 203, data received from an external source over one of the networks 220, 202, data retrieved from one of the storage devices 206, 209, or data retrieved from a storage medium 225 inserted into a corresponding reader 212, all shown in FIG. 2A. Execution of the set of instructions may result in the output of data in some cases. Execution may also involve storing data or variables in memory 234.
[0056] The PCA encoder 160, PCA decoder 170, and described methods may use input variables 254, which are stored in corresponding memory locations 255, 256, 257 in memory 234. The PCA encoder 160, PCA decoder 170, and described methods generate output variables 261, which are stored in corresponding memory locations 262, 263, 264 in memory 234. Intermediate variables 258 may be stored in memory locations 259, 260, 266, and 267.
[0057] 2B, registers 244, 245, 246, arithmetic logic unit (ALU) 240, and control unit 239 cooperate to execute the sequence of micro-operations required to perform a "fetch, decode, and execute" cycle for each instruction in the instruction set that makes up program 233. Each fetch, decode, and execute cycle: a fetch operation to fetch or read instructions 231 from memory locations 228, 229, 230; a decode operation in which the control unit 239 determines which instructions have been fetched; and An execution operation in which the control unit 239 and / or the ALU 240 executes an instruction; Includes.
[0058] 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.
[0059] Each step or sub-process in the described methods of Figures 15-22 is associated with one or more segments of program 233 and is typically performed by register sections 244, 245, 246, 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.
[0060] 3A is a schematic block diagram 300 showing the functional modules of a CNN backbone portion 310 that may serve as an implementation of the 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 the tensors 115 for each frame.
[0061] As shown in FIG. 3A, the video data 113 is passed to a resizer module 304. The resizer module 304 resizes each frame of the video data 113 to a resolution suitable for processing by the CNN backbone 310, generating resized frame data 312. If the resolution of the video data 113 is already suitable for the CNN backbone 310, the operation of the resizer module 304 is not required. The resized frame data 312 is passed to a convolutional batch normalisation leaky rectified linear (CBL) module 314, generating tensors 316. The CBL 314 includes modules as described with reference to the CBL module 360, as shown in FIG. 3D.
[0062] The CBL module 360 takes as input a tensor 361 of the resized frame data 312. The tensor 361 is passed to a convolutional layer 362 to generate a tensor 363. If the convolutional layer 362 has a stride of 1, then the tensor 363 has the same spatial dimensions as the tensor 361. If the convolutional layer 362 has a larger stride, such as 2, then the tensor 363 has smaller spatial dimensions compared to the tensor 361, e.g., the width and height of a stride of 2 are halved. Regardless of the stride, the size of the channel dimensions of the tensor 363 may vary compared to the channel dimensions of the tensor 361 for a particular CBL block. The tensor 363 is passed to a batch normalization module 364, which outputs a tensor 365. The batch normalization module 364 normalizes the input tensor 363 and applies a scaling factor and an offset value to generate the output tensor 365. The scaling factor and offset values are derived from a training process. Tensor 365 is passed to a leaky modified linear activation ("LeakyReLU") module 366, which produces tensor 367. Module 366 provides a "leaky" 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.
[0063] The tensors 316 are passed from the CBL block 314 to a residual block module 320, such as a 1+2+8 module that internally includes a concatenation of one residual unit, two residual units, and eight residual units.
[0064] The residual block is described with reference to ResBlock 340 shown in FIG. 3B. ResBlock 340 receives tensor 341. Tensor 341 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. Residual unit 346 includes a series of concatenated residual units. The last residual unit of residual unit 346 outputs tensor 347.
[0065] As shown in FIG. 3C, the residual unit is described with reference to ResUnit 350. ResUnit 350 takes tensor 351 as input. Tensor 351 is passed 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. Addition module 356 is sometimes referred to as a "shortcut" since the input tensor 351 effectively affects the output tensor 357. For untrained networks, ResUnit 350 operates on the pass-through tensors. When training is performed, CBL modules 352 and 354 operate to separate tensor 357 from tensor 351 according to the training data and ground truth data.
[0066] Returning to FIG. 3A, the Res11 module 320 outputs a tensor 322. The tensor 322 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) that includes eight residual units (i.e., 350). The Res8 module 324 generates a tensor 326. The tensor 326 is passed to the Res4 module 328 and output from the backbone module 310 as one of the layers. The Res4 module is a residual block (i.e., 340) that includes four residual units (i.e., 350). The Res4 module 328 generates a tensor 329. The tensor 329 is output from the backbone module 310 as one of the layers. Collectively, the layer tensors 322, 326, and 329 are output as the tensor 115. The backbone CNN 310 can take as input a video frame with a resolution of 1088x608 and generate three tensors corresponding to three layers, with dimensions of [1, 256, 76, 136], [1, 512, 38, 68], and [1, 1024, 19, 34]. Another example of the three tensors 115 corresponding to the three layers may be [1, 512, 34, 19], [1, 256, 68, 38], and [1, 128, 136, 76], which are split at the 75th feature map, the 90th feature map, and the 105th feature map in the CNN 310, respectively. The separation point depends on the CNN 310.
[0067] Each of Res11 320, Res8 324, and Res4 328 operates similarly to ResBlock 340. Each of CBL 314, CBL 344, and CBL 354 operates similarly to CBL 360.
[0068] 4 is a schematic block diagram showing the functional modules of an alternative CNN backbone portion 400, which may serve as an implementation of the CNN backbone 114. The backbone portion 400 implements a residual network with a feature pyramid network ("ResNet FPN") and is an alternative version of the CNN backbone 114. Frame data 113 is input and passes through tensors 409, 413, 417, 421, 425, through a stem network 408, a res2 module 412, a res3 module 416, a res4 module 420, a res5 module 424, and a max pooling module 428, which produces a P6 tensor 429 as an output.
[0069] The stem network 408 includes a 7x7 convolution with a stride of 2 and a max pooling operation. The res2 module 412, the res3 module 416, the res4 module 420, and the res5 module 424 perform convolution operations such as LeakyReLU activation. Each module 412, 416, 420, and 424 also performs one half of the resolution of the processed tensor via a stride setting of 2. Each of the tensors 413, 417, 421, and 425 is passed to one of the 1x1 lateral convolution modules 446, 444, 442, and 440, respectively. The modules 446, 444, 442, and 440 generate tensors 447, 445, 443, and 441, respectively. The tensor 441 is passed to the 3x3 output convolution module 470, which generates the output tensor P5 471. Tensor 441 is also passed to upsampler module 450 to generate upsampled tensor 451. Summation module 460 sums tensors 443 and 451 to generate tensor 461, which is passed to upsampler module 452 and 3x3 horizontal convolution module 472. Module 472 outputs P4 tensor 473. Upsampler module 452 generates upsampled tensor 453. Summation module 462 sums tensors 445 and 453 to generate tensor 463, which is passed to 3x3 horizontal convolution module 474 and upsampler module 454. Module 474 outputs P3 tensor 475. Upsampler module 454 outputs upsampled tensor 455. The summation module 464 sums tensors 447 and 455 to produce tensor 465, which is passed to a 3x3 horizontal convolution module 476. Module 476 outputs a P2 tensor 477. The upsampler modules 450, 452, and 454 use nearest neighbor interpolation for low computational complexity. Tensors 429, 471, 473, 475, and 477 form the output tensor 115 of the CNN backbone 400.Figure 4 shows a specific backbone portion of the Faster RCNN network architecture (the "P-layer split point"), but different splits into backbone and head are possible. Splitting the network on the results of tensors 413, 417, 421, and 425 is referred to as the "res" split point. Splitting the network on tensor 409 is referred to as the "stem" split point. Splitting the network on tensors 447, 445, 443, and 441 is referred to as the "C-layer" split point.
[0070] FIG. 5 is a schematic block diagram 500 illustrating an inter-channel decorrelation based tensor encoder corresponding to an implementation of the encoder 160 (or “PCA encoder”) as part of the distributed machine task system 100. The PCA encoder 160 operates to reduce the dimensionality of the input tensor 115 so that a reconstructed version of the input tensor can be generated by the PCA decoder 170 with minimal loss of fidelity. Compared to the frame data 113, the tensor 115 has a lower spatial resolution but more channels. For example, the frame data 113 in RGB or YCbCr format may have three channels and the tensor may have 256 channels. As a result, packing the channels of the tensor 115 directly into a video frame results in a relatively large size of the frame that needs to be encoded. The channels of the tensor vary in content but exhibit some degree of inter-channel correlation. When packed into a frame, the inter-channel correlation is difficult to exploit using a video encoder because the packing format results in a certain spatial offset between the feature maps, and video encoders generally cannot exploit it. Furthermore, even in video encoders that expose inter-channel correlation for exploitation, the use of inter prediction or intra block copying to do so corresponds to predicting one channel from another channel, and the correspondence between channels is repeated to the extent that correlation between pairs of channels can be found in the video encoder when testing prediction modes and searching for motion or block vectors.
[0071] An approach to inter-channel decorrelation using Principal Component Analysis (PCA) or an equivalent method is used in the PCA encoder 160. PCA produces a set of vectors ("principal components" or "eigenvectors") that define an "eigenspace". The output of PCA is a one-dimensional vector. In the described configuration, it is understood that the output one-dimensional vector is converted to a two-dimensional form corresponding to the dimensionality of the width and height of the tensor on which the PCA is performed. Each eigenvector is orthogonal to the other eigenvectors that define the eigenspace. Orthogonality means that there is no redundancy in the contribution that each eigenvector makes in representing the feature map. The derivation of such a set of vectors from an input tensor is sometimes called "decomposition" or dimensionality reduction, when the set of vectors is smaller than the input tensor. The eigenspace is the space in which the channels of a tensor can be represented in terms of scalar multiples of the principal components. The ordering of the principal components is such that the maximum amount of variance in a component captures the maximum amount of remaining unexplained variance in the tensor that is not captured by the preceding components. Thus, selecting the first N components of a set of vectors, where N is smaller than the channel count of the tensor, compared to the original tensor, allows the tensor to be represented in a space with reduced dimensionality with minimal loss of accuracy when reconstructing (or "projecting") the tensor at the decoder. Transformation of tensors from one space to another is accomplished using a dot product operation, with the inputs appropriately arranged as one-dimensional arrays and transposed if necessary.
[0072] Methods for principal component analysis include "singular value decomposition" (SVD), which can serve as the decomposition function of the PCA encoder 160 (described in connection with module 548 below). Other methods of decomposition that can be used in the PCA encoder 160 at 548 include QR decomposition, which can be performed using a Gram-Schmidt process, Householder transformations, or Givens rotations, or LU (lower order) decomposition, or Cholesky decomposition. The value N used in each decomposition method can be substantially smaller than the number of channels in the tensor 115. For example, with 256 channels in the tensor 115, using only the first 25 principal components, the PCA decoder 170 can generate a reconstructed tensor of sufficiently high fidelity for the CNN head 150 to operate near lossless, i.e., there is no or negligible lossy compression between the CNN backbone 114 and the CNN head 150.
[0073] The principal components or basis vectors are encoded using lossy compression, which in some embodiments results in the need for the encoder to use a lossy representation of the basis vectors. The use of a lossy representation of the basis vectors in the encoder ensures that the forward transform used to generate the coefficients is more invertible compared to the inverse transform used to project the basis vectors back into the channels of the decoded tensor. The decomposition module 548 also generally requires or benefits from operating on zero-centered data, resulting in more accurate basis vectors. Since the principal components or basis vectors are relative to the origin, the tensors being decomposed must also be centered around the origin, i.e., zero-centered. The use of zero-centered tensors is orthogonal, allowing for the generation of basis vectors with the property that each successive basis vector accurately represents the maximum amount of unexplained variance in the tensor. When each successive basis vector explains the maximum amount of unexplained variance in the tensor, a reduced number of basis vectors are needed to explain the tensor to a given degree. In other words, the decomposition of zero-centered tensors allows for the greatest dimensionality reduction, and therefore the greatest compression efficiency.
[0074] The tensor encoder 500 receives the tensor 115 and inputs the tensor 115 to the extractive mean module 510. To allow the decomposition module 548 to operate on zero-centered data, the extractive mean module 510 operates to generate an average feature map 511 by performing an average over the channel dimension of the tensor. A version of the average feature map 511, the non-reversible average feature map 522, is forward transformed by the dot product module 540 using the derived non-reversible coefficients 538 to generate per-channel average feature maps 542. The dot product performed in module 240 is performed on a "flattened" version of the feature map, i.e., reshaped from a two-dimensional array into a one-dimensional array. When the dot product is performed on the feature map and the basis vectors, both the feature map and the basis vectors are flattened, one horizontally and the other vertically. In the remainder of this document, when it is said that the dot product is performed on a (two-dimensional) feature map or other data, it is understood that the reshaping to and from a one-dimensional representation is implicit. The per-channel average feature map 542 is subtracted from each channel in the tensor by a subtractor 544 to generate a DC-normalized tensor 546 .
[0075] To account for discrepancies resulting from the potential use of lossy encoding in the sample domain and quantization from the floating-point domain to / from the integer sample domain, the PCA encoder 160 quantizes, encodes, decodes, and dequantizes the average feature map 511 to generate the lossy average feature map 522. The average feature map 511 is quantized by a quantizer module 512 to generate an integer average feature map 513. The integer average feature map 513 is passed to a sub-picture encoder 514. The sub-picture encoder 514 packs the feature map 513 into a sub-picture. The sub-picture is encoded as a bitstream portion 515. The bitstream portion 515 corresponds to a compressed representation of the average feature map 511 averaged over the channels of a tensor. The sub-picture encoder 514 also outputs a reconstructed integer mean feature map 516, which corresponds to the unpacked decoded mean feature map 844 generated in the PCA decoder 170, both of which are lossy representations of the mean feature map 511. The reconstructed integer mean feature map 516 is converted back to the floating-point domain by the inverse quantizer module 520 to generate the lossy mean feature map 522. The lossy mean feature map 522 provides a floating-point representation of the integer mean feature map 516.
[0076] As the amplitude varies for each channel in the tensor 115, the degree to which the average feature map 522 is removed can be varied using "average coefficients" generated by a dot product module 524 that performs a dot product of the lossy average feature map 522 with each channel of the tensor 115. The dot product module generates a set of average coefficients 526, including one average coefficient for each channel of the tensor 115. The average coefficients 526 are quantized to the sample domain by a quantizer module 528 to generate integer average coefficients 530. The average coefficients 530 are packed into a sub-picture and encoded by a sub-picture encoder 532 to generate a bitstream portion 533 and a lossy sub-picture representation 534. The bitstream portion 533 corresponds to the coefficients 526 for the average tensor value 511. The lossy sub-picture representation 534, which represents the decoded average coefficients, is provided to an inverse quantizer module 536. The inverse quantizer module 536 outputs reconstructed mean coefficients 538, i.e., lossy floating-point versions of the mean coefficients 526. Thus, the zero-mean tensor 546 corresponds to the zero-mean tensor 852 derived in the PCA decoder 170.
[0077] Sources of loss include quantization and lossy coding. Due to the sensitivity of the generation of the average feature map per channel 542 to any loss on the average coefficient, the sub-picture encoder 532 operates at a higher quality level (smaller quantization step size or lower quantization parameter) than required for the sub-picture encoder 514. The sub-picture encoder 532 may be operated in a lossless mode for higher quality, at the expense of more bits being spent in the bitstream portion 533. Standards such as HEVC provide a "transform quantization bypass" mode for CUs as a means to locally provide lossless operation by bypassing the transform and quantization process. Standards such as VVC instead use a sufficiently low QP so that the quantization process is a lossless process, and a transform skip mode may be selected independently to avoid loss from the transform. Such local application of lossless coding allows for "mixed" lossy / lossless coding, where lossless coding is used in highly sensitive portions of the picture, such as for regions of the sub-picture that contain packed coefficients. The result of the mean or DC removal is a zero-centered tensor, the DC-normalized tensor 546, that is more suitable for basis vector derivation in the decomposition module 548.
[0078] The decomposition module operates to perform a decomposition function over the channels of the tensor 546 to generate basis vectors, which are components capable of representing the tensor with an acceptable tradeoff between the number of components and the precision of the representation. Various mechanisms for decomposition may be used in the decomposition module 548. Single value decomposition (SVD) is one common and computationally fast decomposition method suitable for use in the decomposition module 548. Although lossy coding may be used for different types of data (average features, coefficients, basis vectors) that need to be conveyed from the source device 110 to the destination device 140, the use of a sample representation of the data requires quantization from the floating-point domain to the integer domain, the range of which is constrained by the bit depth of the video encoding and decoding process. To generate a single coherent container for the quantized data, an image frame may be composed of multiple sub-pictures, each of which is independently coded, and a reconstructed version (i.e., a version of the sub-picture as generated in the corresponding decoder) that is made available in the PCA encoder 160. The placement of sub-pictures is described below with reference to Figures 13A and 13B. As a result of using the inverse quantization modules 520 and 536, compression losses due to lossy encoding are taken into account in the tensor encoding process performed by the system 500.
[0079] The decomposition module 548 generates a set of basis vectors 550. The size of the set of basis vectors 550 is generally a fraction of the number of channels of the tensor 115. The basis vectors 550 define a new subspace in which the tensor 115 can be approximately represented with minimal loss of fidelity. Generating basis vectors with fewer channels when decomposing a tensor is called "dimensionality reduction". Dimensionality reduction provides a means to achieve lossy compression by discarding or not generating basis vectors that make the least significant contribution to representing the channels of the tensor 115. For example, about 10% of the input channel count of 255 or 25 basis vectors may be generated by the decomposition module 548. The basis vectors form an eigenspace in which feature maps in the tensor 115 can be represented, and the dimension, and therefore the coded area in a picture or subpicture, is significantly reduced. The basis vectors 550 are quantized by a quantizer 552 to generate an integer basis vector tensor 554. The quantizer 552 operates to generate (integer) coefficients for the tensors using the basis vectors 550. The integer basis vector tensors 554 are packed into sub-pictures and encoded by the sub-picture encoder 556. The sub-picture encoder 556 outputs a bitstream portion 557 and, as a result of unpacking the reconstructed sub-picture, a reconstructed integer tensor 558. The bitstream portion 557 corresponds to the components 550 generated by the decomposition of the tensor 546 by the module 548. The inverse quantizer module 560 inverse quantizes the reconstructed integer tensor 558 to generate a reconstructed basis vector tensor 562.
[0080] The forward transform is performed by a dot product module 564, which generates a dot product of each channel of the zero-mean tensor 546 with each of the basis vectors in the reconstruction basis vector tensor 562 to generate a set of coefficients 566. With 256 channels in the zero-mean tensor 546 and twenty-five (25) components in the tensor 562, there are 256×25=6400 coefficients that are output as set 566. The coefficients 566 are quantized from the floating-point domain to the integer domain by a quantizer module 568. The quantizer module 568 outputs a set of coefficient samples 570. The coefficient samples 570 are packed into a sub-picture and encoded by a sub-picture encoder 572 into a bitstream portion 573. The bitstream portion 573 corresponds to the coefficients 566 associated with the components 550. Bitstream portions 515, 533, 557, and 573 correspond to four sub-pictures and are combined by sub-picture bitstream combiner 580 to generate encoded bitstream 121. Due to the sensitivity of task performance to the fidelity of the reconstructed coefficients 818 seen by the PCA decoder 170, the quality level used in sub-picture encoder 572 is relatively higher than the quality level used to encode the basis vectors, i.e., by sub-picture encoder 556.
[0081] In the configuration of the PCA encoder 160, the decomposition module 548 is operable to output a variable number of basis vectors 550 such that at least the minimum amount of variance of the tensor 115 is represented by the basis vectors 550, up to the limit of the maximum number of components M, e.g., 25 for a tensor having 256 channels. An "eigenvalue" is associated with each vector in the basis vectors 550, indicating how much variance is accommodated or "explained" by using the respective basis vector. The eigenvalues of the basis vectors 550 decrease in magnitude as one progresses through the vectors in the basis vectors 550, since each successive basis vector explains the maximum amount of unexplained variance in the tensor 115. A minimum variance threshold, such as 85%, 90%, or 95%, 98%, or other value, can be established. A maximum value N can be selected when the cumulative sum of the first Nth eigenvalues is less than the minimum variance threshold, where N is less than or equal to the number of basis vectors generated by the decomposition module 548. Alternatively, the minimum value N may be selected if the cumulative sum of the first N eigenvalues is greater than the minimum variance threshold and N is less than or equal to the number of basis vectors generated by the decomposition module 548. The subset of N basis vectors is output as basis vectors 550. The module 552, 556 for packing the basis vectors 550 into the subpicture 1216 and encoding into the bitstream portion 557 (as described in connection with FIG. 12A) may in some configurations encode the first N basis vectors and prevent the remaining vectors (if any) from being used in the forward transform and pack them into the subpicture 1216. For tensors 115 with smaller variance therein, the selected value N may be lower than a fixed threshold, such as 25. As a result of selecting N basis vectors, the area of the basis vectors to be packed into the subpicture 1216 and the number of coefficients to be packed into the subpicture 1214 (as described in connection with FIG. 12A) may be reduced, reducing the encoded size of the bitstream 121.If the split point of the network involves multiple tensors, e.g., if an FPN is used, the value N may be derived independently for each layer in the FPN, allowing for adaptation to differences in the complexity (and therefore variance) contained in the tensors generated for each layer of the FPN from the CNN backbone 114. The value N determined for each tensor being compressed is encoded into the bitstream 121 by the PCA encoder 160, allowing the PCA decoder 170 to unpack the correct number of basis vectors from the decoded picture. The PCA decoder 170 uses the unpacked number of basis vectors N to determine the basis vector tensor count, and the worst case basis vector count M to establish the packing position in the subpicture 1216. The PCA decoder 170 can use the decoded value N for the current and subsequent frames to unpack the basis vectors in the first N positions as basis vectors decoded from the bitstream 143, updating N as new values N are decoded.
[0082] To reduce losses, the sensitivity data such as the average coefficients 530 and the coefficient samples 570 may be losslessly encoded. The average coefficients 530 and the coefficient samples 570 may be encoded using a different encoding than VVC. Instead of packing 530 and 570 into their respective sub-pictures for encoding as video samples, they may be encoded using an alternative common scheme for lists of numbers. One scheme is "DeepCABAC", whereby a sequence of numbers with low magnitude clustered magnitudes and many zero-valued numbers (e.g., Gaussian or similar distribution) are efficiently encoded using context-adaptive binary arithmetic coding, along with a binarization scheme similar to that used for residual samples in standards such as VVC or HEVC. Regardless of the use of lossless or lossy encoding for coefficients in the integer domain, the conversion from the floating-point domain to the integer domain introduces some losses that are otherwise unavoidable (not very efficient unless floating-point values are represented in the bitstream 121). If the coefficients 530 and 570 are represented in the bitstream 121 using a scheme separate from VVC, such as DeepCABAC, the DeepCABAC bitstream may be associated with the frame using an SEI message, such as a "User Data SEI message" or other dedicated SEI message. For each picture coding basis vector, an associated SEI message accompanies the picture to enable reconstruction of feature maps from the coefficients and basis vectors.
[0083] Quantizers 512, 528, 552, and 568 generally all quantize floating-point values to an integer sample range that corresponds to the bit depth of the video frame, e.g., given by 0 to 1023 when 10-bit encoding is used. Quantization to samples means quantization to a closed range of values, but quantization to an open (unrestricted) range is possible if an alternative compression scheme to VVC is used. For example, if sub-picture encoders 532 and 572 use an algorithm such as DeepCABAC, there is no need to fit integer values to a range of values. When fitting floating-point values to a sample range, quantizers 512, 528, 552, and 568 each operate using a respective "quantization range" that can be set to various granularities. The quantization range of each respective quantizer can be determined each time a tensor is quantized. Each determined quantization range needs to be signaled in the bitstream 121 so that the PCA decoder 170 can dequantize the integer values back to the correct range in the floating-point domain.
[0084] The bitstream 115 is obtained from a stage of the neural network formed by the CNN backbone 114 and the CNN head 150. Thus, the tensor 546 is also from a stage of the neural network formed by the CNN backbone 114 and the CNN head 150. Although FIG. 5 shows PCA-based compression of one tensor 115, if the CNN is separated at the point where the feature pyramid network exists, there are multiple tensors that require compression. When the FPN is used, the PCA encoder 160 operates on each tensor of the FPN. The sub-picture encoders 514, 532, 556, and 572 may be shared between the tensors of the FPN, and the packing and unpacking may reserve an area in each sub-picture for the data corresponding to each tensor in the FPN. When the FPN is used, separate quantization ranges may be used for the quantizers 512, 528, 552, and 568, and the inverse quantizers 520, 536, 560 when processing each layer of the FPN. The separate quantization ranges are encoded in the bitstream 121 for use by the PCA decoder 170 in the SEI message described with reference to FIG.
[0085] In another configuration of the PCA encoder 160, the quantization ranges determined by the quantizers 512, 528, 552, and 568 are set to the previous quantization range of the respective quantizer and increased as necessary to accommodate the range of the data being quantized for the current PCA encoding operation (data 511, 526, 550, and 566). Setting the quantization ranges creates a picture-to-picture memory effect that causes the quantization range to "stretch" over a sequence of tensor compression operations. A quantization range that increases over a sequence of tensors reduces sensitivity to outliers found in certain tensors that change the sample values of most of the data, such as basis vectors. A quantization range that increases over a sequence of tensors can suppress the "flicker" effect that can be observed when packed pictures of successive tensor compression operations are viewed as a video sequence. Flicker suppression in packed pictures facilitates compression using a video encoder (e.g., encoders 514, 532, 556, and 572) by reducing luminance shifts that are difficult for an encoder to efficiently detect and represent in compressed form. If the video encoder uses periodic refresh, such as intra pictures in a random access configuration, the quantization range may be determined only from the current tensors of such pictures. For random access sequences, non-intra pictures may use inter-prediction coding tools to predict content, such as basis vectors, from previous pictures, achieving higher compression efficiency due to the relative stability of the distribution of sample values used to represent the basis vectors in successive frames.
[0086] In another configuration of the PCA encoder 160 and the PCA decoder 170, when FPN is used, a relationship is established between the quantization range (QR) of coefficients for basis vectors between layers. When the CNN backbone 114 and the CNN head 150 form a Faster RCNN or Mask RCNN network, the QR of the basis vector coefficients of layer N is set to twice the QR of layer N+1, and so on. Setting the QR to twice the QR of the previous layer includes cases where two layers are concatenated into a single layer for tensor compression, e.g., downsampled P2 and P3 are concatenated to form layer N, and P4 forms layer N+1. When one QR is signaled for the basis vector coefficients, the QR for each layer is derived based on the layer index. When the CNN backbone 114 and the CNN head 150 form a YOLOv3 network or similar, the resolution-based ordering is reversed such that layer N+1 has twice the QR of layer N. Signaling in the bitstream 121 indicates which ordering should be used in the PCA decoder 170 for dequantization of the coefficients for the basis vectors when FPN is used.
[0087] FIG. 6 is a schematic block diagram 600 of an encoder architecture. The encoder architecture 600 includes a feature map packer 610, a packed frame encoder 614, and an unpacker 620. The sub-picture encoders 514, 532, 556, and 572 are implemented as instances of the architecture 600. The packer 610 receives a tensor 608 having a given channel count, width, and height dimensions and containing integer values, i.e., already quantized, and the sub-picture encoder 514 receives an integer average feature map 513, for example. The packer 610 packs the received tensor into a 2D planar array of samples. Generally, in the described configuration, the feature maps of each channel of the tensor 608 are stored in a sub-picture frame 612 in a left-to-right and top-to-bottom manner. The sub-picture frame 612 needs to be of sufficient size to hold the channels of the tensor 608, including allowing for gaps in the packing due to mismatch between the feature map size and the dimensions of the sub-picture frame 612. With reference to FIG. 7, a packed frame encoder 614 is described, which is generally implemented as a VVC encoder. The encoder 614 generates an encoded bitstream portion 616 corresponding to each sub-picture. For example, the sub-picture encoder 514 outputs an encoded bitstream portion 515. The encoder 614 also outputs a reconstructed frame 618 corresponding to a lossy version reproduced when decoding the bitstream portion 616. The reconstructed frame 618 represents a reconstruction of the average feature map 513, and the loss caused due to the encoding is modeled or represented. The loss reflects the encoding loss, such as that incurred by the particular encoding method used in the encoder 614. In the example shown in FIG. 7, the encoder 614 is a VVC encoder. In another implementation, the encoder 614 can be a HEVC code that incurs different encoding loss. A lossless codec, such as JPEG LS or DeepCABAC, can be used for the encoder 614, in which case the reconstructed frame 618 is equal to the sub-picture frame 612.If HEVC or VVC is used for the encoder 614, they may be configured to perform lossless encoding for the coefficients.
[0088] The reconstructed frame 618 is passed to the unpacker 620, which extracts the feature map to generate a reconstructed tensor 622 with the same dimensionality as the tensor 608. As a result of the operation of the module 600, the PCA encoder 160 is permitted to use a version of the feature map (or coefficients) that corresponds to the version seen by the PCA decoder 170, and thus operates at a higher level of fidelity than if the loss source were not considered. The sub-picture encoders 514, 532, 556, and 572 are configured to disable loop filtering both internally and across sub-picture boundaries, since loop filtering is generally optimized for human consumption of the decoded picture. The system 100 uses video compression as a means to efficiently represent the data resulting from the dimensionality reduction performed on the intermediate tensor data that needs to be propagated from the CNN backbone 114 to the CNN head 150.
[0089] FIG. 7 is a schematic block diagram 700 showing the functional modules of the video encoder 614. The video encoder 614 encodes one sub-picture among a set of sub-pictures that define an overall picture. Although it is possible for all sub-pictures to be encoded as one picture in one encoding pass, the use of one encoding pass means that feedback in the PCA encoder 160 to take into account lossy encoding in the pipeline is not possible. In general, data passes between the functional modules in the video encoder 614 in groups of samples or coefficients, such as division of blocks into fixed-size sub-blocks, or as an array. The video encoder 614 may be implemented using a general-purpose computer system 200 as shown in FIGS. 2A and 2B, and the various functional modules may be implemented by dedicated hardware in the computer system 200, by software executable in the computer system 200, such as one or more software code modules of a software application program 233 residing on the hard disk drive 205 and controlled in its execution by the processor 205. Alternatively, the video encoder 614 may be implemented by a combination of dedicated hardware and software executable within the computer system 200. The video encoder 614 and the described methods may alternatively be implemented with dedicated hardware, such as one or more integrated circuits performing the functions or sub-functions of the described methods. Such dedicated hardware may include a graphic 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, the video encoder 614 includes modules 710-790, each of which may be implemented as one or more software code modules of the software application program 233.
[0090] While the video encoder 614 of FIG. 7 is an example of a generic video coding (VVC) video encoding pipeline, other video codecs may be used to perform the processing stages described herein. For example, HEVC may be used. The described example produces a bitstream of encoded data. If other codecs are used, some implementations may pack the data into a different format, such as a frame format. The video encoder 614 receives sub-picture frame data 612, such as a series of frames of a sub-picture, each frame including one or more color channels. The frame data 612 may be of any chroma format and bit depth supported by the profile in use, e.g., 4:0:0, 4:2:0 for the "Main 10" profile of the VVC standard, with 8-10 bits of sample precision. The block partitioner 710 first divides the frame data 612 into CTUs that are roughly square in shape and configured such that a specific size for the CTU is used. The maximum valid size of a CTU may be, for example, 32x32, 64x64, or 128x128 luma samples, configured by the "sps_log2_ctu_size_minus5" syntax element present in the "sequence parameter set". The CTU size also provides the maximum CU size, since a CTU without further division contains one CU. The block partitioner 710 further divides each CTU into one or more CBs according to the luma coding tree and the chroma coding tree. The luma channel may also be referred to as a primary color channel. Each chroma channel may also be referred to as a secondary color channel. The CBs may have various sizes and include both squared and non-squared aspect ratios. However, in the VVC standard, the CBs, CUs, PUs, and TUs always have side lengths that are powers of two. Thus, a current CB, denoted as 712, is output from block partitioner 710, which proceeds according to iterations over one or more blocks of the CTU according to the luma coding tree and chroma coding tree of the CTU.
[0091] The CTUs resulting from the initial partition of the frame data 614 may be scanned in raster scan order and grouped into one or more "slices." A slice may be an "intra" (or "I") slice. An intra slice (I slice) indicates that all CUs in the slice are intra predicted. Generally, the first picture in a coding layer video sequence (CLVS) contains only I slices and is called an "intra picture." A CLVS may contain periodic intra pictures that form "random access points" (i.e., intermediate frames in a video sequence where decoding may begin). Alternatively, a slice may be uni-predictive or bi-predictive ("P" or "B" slices, respectively), indicating additional availability of uni-prediction and bi-prediction in the slice, respectively.
[0092] The video encoder 614 encodes a sequence of pictures according to a picture structure. One picture structure is "low latency", where pictures using inter prediction may only reference pictures that occurred earlier in the sequence. Low latency allows each picture to be output as soon as it is decoded, in addition to being stored for possible reference by subsequent pictures. Another picture structure is "random access", where the coding order of pictures differs from the display order. Random access allows inter predicted pictures to reference other pictures that have been decoded but not yet output. A degree of picture buffering is required so that future reference pictures with respect to the display order are present in the decoded picture buffer, resulting in a delay of multiple frames.
[0093] When a chroma format other than 4:0:0 is used, in an I slice, the coding tree of each CTU may diverge below the 64x64 level into two separate coding trees, one for luma and another for chroma. The use of separate trees allows for different block structures to exist between luma and chroma within the luma 64x64 area of a CTU. For example, a large chroma CB may be colocated with multiple smaller luma CBs, and vice versa. In a P or B slice, a single coding tree for a CTU defines a common block structure for luma and chroma. The resulting blocks of the single tree may be intra-predicted or inter-predicted.
[0094] In addition to dividing a picture into slices, a picture may also be divided into "tiles". A tile is a sequence of CTUs that cover a rectangular area of the picture. CTU scanning occurs in a raster-scan fashion within each tile, proceeding from one tile to the next. A slice can be either an integer number of tiles, or an integer number of consecutive rows of CTUs within a given tile.
[0095] For each CTU, the video encoder 614 operates in two stages. In the first stage (called the "search" stage), the block partitioner 710 tests various potential configurations of the coding tree. Each potential configuration of the coding tree has an associated "candidate" CB. The first stage involves testing various candidate CBs to select a CB that provides relatively high compression efficiency at relatively low distortion. The testing generally involves Lagrangian optimization, whereby the candidate CBs are evaluated based on a weighted combination of rate (i.e., coding cost) and distortion (i.e., error relative to the input frame data 612). The "best" candidate CB (i.e., the CB with the lowest evaluated rate / distortion) is selected for subsequent encoding into the bitstream 616. Included in the evaluation of the candidate CBs are the options of using the CB for a given area, or further dividing the area according to various partitioning options and encoding each of the smaller resulting areas with additional CBs, or further dividing the area. As a result, both the coding tree and the CB itself are selected in the search stage.
[0096] The video encoder 614 generates, for each CB, e.g., CB 712, a prediction block (PB) indicated by arrow 720. The PB 720 is a prediction of the content of the associated CB 712. A subtractor module 722 generates a difference (or a "residual", referring to the difference in the spatial domain) indicated as 724 between the PB 720 and the CB 712. The difference 724 is a block-sized difference between corresponding samples in the PB 720 and the CB 712. The difference 724 is transformed and quantized, and represented as a transform block (TB) indicated by arrow 736. The PB 720 and the associated TB 736 are typically selected from one of many possible candidate CBs, e.g., based on an estimated cost or distortion.
[0097] A candidate coding block (CB) is a CB resulting from one of the prediction modes available to the video encoder 614 for an associated PB and the resulting residual. The TB 736, when combined with the predicted PB in the video encoder 614, reduces the difference between the decoded CB and the original CB 712, at the expense of additional signaling in the bitstream.
[0098] Thus, each candidate coding block (CB), i.e., prediction block (PB) in combination with a transform block (TB), has an associated coding cost (or "rate") and an associated differential (or "distortion"). The distortion of a CB is typically estimated as a difference in sample values, such as sum of absolute differences (SAD), sum of squared differences (SSD), or a Hadamard transform applied to the difference. The resulting estimate from each candidate PB may be determined by a mode selector 786 using the differentials 724 to determine a prediction mode 787. The prediction mode 787 indicates a decision to use a particular prediction mode for the current CB, e.g., intra-frame prediction or inter-frame prediction. The estimation of the coding cost associated with each candidate prediction mode and the corresponding residual coding may be performed at a significantly lower cost than entropy coding of the residual. Thus, several candidate modes may be evaluated to determine the optimal mode in rate-distortion detection, even in a real-time video encoder.
[0099] Determining the optimal mode in terms of rate-distortion is typically accomplished using a variation of Lagrangian optimization.
[0100] A Lagrangian or similar optimization process may be used both to select the optimal partitioning of the CTUs into CBs (by the block partitioner 710), 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 786, the intra-prediction mode having the lowest cost measure is selected as the "best" mode. The lowest cost mode includes the selected secondary transform index 788, which is also encoded in the bitstream 614 by the entropy encoder 738.
[0101] In the second stage of the operation of the video encoder 614 (called the "encoding" stage), iterations over the determined coding trees for each CTU are performed in the video encoder 614. For CTUs using separate trees, for each 64x64 luma region of the CTU, the luma coding tree is coded first, and then the chroma coding tree is coded. Only the luma CB is coded in the luma coding tree, and only the chroma CB is coded in the chroma coding tree. For CTUs using a shared tree, a single tree describes the CUs (i.e., luma CB and chroma CB) according to the common block structure of the shared tree.
[0102] The entropy encoder 738 supports bit-wise coding of syntax elements using variable-length and fixed-length codewords, as well as arithmetic coding modes for syntax elements. Some parts of the bitstream, such as "parameter sets," e.g., sequence parameter set (SPS) and picture parameter set (PPS), use a combination of fixed-length and variable-length codewords. Slices, also called contiguous parts, have a slice header that uses variable-length coding, followed by slice data that uses arithmetic coding. The slice header defines parameters specific to the current slice, such as slice-level quantization parameter offsets. The slice data includes syntax elements for each CTU in the slice. The use of variable-length and arithmetic coding requires sequential parsing within each part of the bitstream. Parts may be delimited by start codes to form "Network Abstraction Layer Units" or "NAL Units." Arithmetic coding is supported using a context-adaptive binary arithmetic coding process.
[0103] An arithmetically coded syntax element consists of a sequence of one or more "bins". Bins, like bits, have a value of "0" or "1". However, bins are not coded into the bitstream 614 as discrete bits. Bins have an associated predicted (or "likely" or "most likely") value and an associated probability known as a "context". When the actual bin to be coded matches the predicted value, a "most probable symbol" (MPS) is coded. Coding the most probable symbol is relatively inexpensive in terms of consumed bits in the bitstream 614 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 whose "0" vs. "1" probabilities are 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.
[0104] 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 previous bins in the syntax element, bin values of adjacent syntax elements (i.e., from adjacent blocks), etc. Each time a context-coded bin is coded, the context selected for that bin (if any) is updated in a manner that reflects the new bin value. In this manner, the binary arithmetic coding scheme is said to be adaptive.
[0105] Also supported by the entropy encoder 738 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 614. 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 undistorted. 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.
[0106] QP controller 790 determines a quantization parameter 792 that is used to establish the quantization step size for use by quantizer 734 and inverse quantizer 740. A larger quantization step size causes the primary transform coefficients 728 to be quantized to smaller values, reducing the bit rate of bitstream 121 at the expense of reducing the fidelity of the inverse transform coefficients 746.
[0107] The entropy encoder 738 uses a combination of context coded bins and bypass coded bins to code the quantization parameter 792 and the LFNST index 788 if used for the current CB. The quantization parameter 792 is coded at the beginning of each slice, and changes in the quantization parameter 792 within a slice are coded using the "delta QP" syntax element. The delta QP syntax element is signaled at most once in each area known as a "quantization group". The quantization parameter 792 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 792 according to a mapping table selected from a list of offsets and a CU level offset. The secondary transform index 788 is signaled when the residual associated with the transform block contains significant residual coefficients only at coefficient positions that are transformed to primary coefficients by application of a secondary transform.
[0108] The residual coefficients of each TB associated with a CB are coded using a residual syntax. The residual syntax is designed to efficiently code coefficients with low magnitudes by using primarily arithmetically coded bins to indicate the significance of the coefficients, along with lower value magnitudes, and reserving bypass bins for higher magnitude residual coefficients. Thus, residual blocks containing very low magnitude values and a sparse arrangement of significant coefficients are efficiently compressed. Furthermore, there are two residual coding schemes. The regular residual coding scheme is optimized for TBs with significant coefficients located primarily in the upper left corner of the TB, as seen when a transform is applied. The transform-skip residual coding scheme is available for TBs where no transform is performed, and can efficiently code the residual coefficients regardless of their distribution across the TB.
[0109] The multiplexer module 784 outputs the PB 720 from the intra-frame prediction module 764 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 614. 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 neighboring reconstructed samples typically include a row of reconstructed samples above the current PB that extends to the right of the PB to a certain extent, and a column of reconstructed samples to the left of the current PB that extends downward beyond the PB to a certain extent; and 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.
[0110] A fourth type of intra prediction is available for chroma PB, whereby the PB is generated from co-located luma reconstructed samples according to a "Cross-Component Linear Model" (CCLM) mode. Three different CCLM modes are available, each using a different model derived from adjacent luma and chroma samples. The derived model is used to generate a block of samples for the chroma PB from the co-located luma samples. The luma block may be intra predicted using a matrix multiplication of a reference sample using one matrix selected from a predefined set of matrices. This matrix intra prediction (MIP) achieves gains by using matrices trained on a large set of video data, where the matrices represent relationships between the predicted block and the reference samples that are not easily captured in angular, planar, or DC intra prediction modes.
[0111] Module 764 may also generate prediction units by copying blocks from nearby the current frame using the "intra block copy" (IBC) method. The location of the reference block is constrained to an area equivalent to one CTU divided into 64x64 regions known as VPDUs, and the area covering the processed VPDUs of the current CTU and VPDUs of the previous CTU in each row or CTU and in each slice or tile is up to an area limit corresponding to one 128x128 luma sample, regardless of the configured CTU size of the bitstream. This area is known as the "IBC virtual buffer" and limits the IBC reference area and therefore the required storage. The IBC buffer is populated with reconstructed samples 754 (i.e., before loop filtering), and therefore a buffer separate from the frame buffer 772 is required. When the CTU size is 128x128, the virtual buffer contains only samples from the CTU adjacent to and to the left of the current CTU. When the CTU size is 32x32 or 64x64, the virtual buffer contains up to 4 or 16 CTUs to the left of the current CTU. Regardless of the CTU size, access to neighboring CTUs to obtain samples for IBC reference blocks is constrained by boundaries such as picture, slice, or tile edges. In particular, for FPN layer feature maps with smaller dimensions, the use of CTU sizes such as 32x32 or 64x64 results in a reference region that is more aligned to cover the previous set of feature maps. When feature map arrangements are ordered based on SAD, SSE, or other difference metrics, access to similar feature maps for IBC prediction provides coding efficiency advantages.
[0112] The residuals of the predicted blocks when encoding feature map data are different from those seen for natural video. Natural video is usually captured by an image sensor or screen content, such as commonly found in operating system user interfaces. Feature map residuals tend to contain a lot of detail. The level of detail in the feature map residuals is more suitable for skip coding transformation than the low frequency coefficients of various transforms. Experiments by the inventors to measure the benefits of residual coding using DCT-2, MTS (a combination of DST-7, DCT-8 in horizontal and vertical directions), and LFNST (various trained non-separable transforms) show that the feature map residuals have enough local similarity to benefit from transform coding. However, the distribution of feature map residual coefficients is not clustered towards the DC (top left) coefficient of the transform block. In other words, there is enough correlation when encoding feature map data for the transform to show gain. There is also enough correlation when intra block copying is used to generate the predicted blocks of feature map data. Therefore, Hadamard cost estimation may be used when evaluating residuals resulting from candidate block vectors for intra block copies when encoding feature map data, rather than relying solely on SAD or SSD cost estimation. SAD or SSD cost estimation tends to select block vectors with residuals more suitable for transform coding skips, and may miss block vectors with residuals that are compactly encoded using transforms. The multiple transform selection (MTS) tool of the VVC standard may be used when encoding feature map data, such that in addition to the DCT-2 transform, a combination of DST-7 and DCT-8 transforms are available horizontally and vertically for residual encoding.
[0113] An intra-predicted luma coding block may 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 prediction block generation from one subpartition to the next in the luma coding block, improving compression efficiency.
[0114] If no previously reconstructed neighboring samples are available, e.g., at the edge of a frame, a default halftone value of half the range of samples is used. For example, for 10-bit video, a value of 512 is used. Since no previous samples are available for the CB located at the top-left position of the frame, the angular and planar intra prediction modes produce the same output as the DC prediction mode (i.e., a plane of samples with halftone values as magnitudes).
[0115] For inter-frame prediction, the prediction block 782 is generated by the motion compensation module 780 using samples from one or two frames preceding the current frame in the coding order frames in the bitstream, and output as the PB 720 by the multiplexer module 784. Furthermore, for inter-frame prediction, a single coding tree is typically used for both the luma and chroma channels. The order of encoding the frames in the bitstream may differ from the order of the frames when captured or displayed. When one frame is used for prediction, the block is said to be "uni-predictive" and has one associated motion vector. When two frames are used for prediction, the block is said to be "bi-predictive" and has two associated motion vectors. For P slices, each CU may be intra-predicted or uni-predicted. For B slices, each CU may be intra-predicted, uni-predicted, or bi-predicted.
[0116] Frames are typically coded using a "group of pictures" structure, allowing for a temporal hierarchy of frames. A frame may be divided into multiple slices, each of which codes a portion of the frame. The temporal hierarchy of frames allows frames to reference previous and subsequent pictures in the order in which they are displayed. Pictures are coded in the order required to ensure that dependencies for decoding each frame are satisfied. Instead of using one or two motion vectors to select and filter reference sample blocks for a prediction unit, an affine inter-prediction mode is available in which the prediction unit is divided into multiple smaller blocks and a motion field is generated, so that each smaller block has a separate motion vector. The motion field uses the motion vectors of points near the prediction unit as "control points". Affine prediction allows for coding of motions different from transforms, with less need to use deeply partitioned coding trees. The bi-prediction mode available for VVC performs a geometric blend of two reference blocks along a selected axis, with an offset and angle from the center of the signaled block. This geometric partition mode ("GPM") allows the use of larger coding units along the boundary between two objects, with the geometry of the boundary coded for the coding unit as an angle and center offset. Instead of using Cartesian (x,y) offsets, the motion vector difference may be coded as a direction (up / down / left / right) and distance, with a set of supported power-of-two distances. The motion vector predictor is obtained from the neighboring block ("merge mode") as if no offset was applied. The current block shares the same motion vector as the selected neighboring block.
[0117] The samples are selected according to the motion vector 778 and the reference picture index. The motion vector 778 and the reference picture index apply to all color channels, and therefore inter prediction is primarily described in terms of operation in Pu, not PB. The decomposition of each CTU into one or more inter prediction blocks is described with a single coding tree. Inter prediction methods may vary in the number of motion parameters and their precision. The motion parameters typically include a reference frame index indicating which reference frame from a list of reference frames should be used, and a spatial transformation for each of the reference frames, but may include more frames, dedicated frames, or complex affine parameters such as scaling and rotation. In addition, a certain motion refinement process may be applied to generate a dense motion estimate based on the referenced sample block.
[0118] Determining and selecting the PB 720 and subtracting it from the original sample block in a subtractor 722 results in a residual with the lowest coding cost represented as 724, which undergoes lossy compression. The lossy compression process includes the steps of transformation, quantization, and entropy coding. A forward primary transform module 726 applies a forward transform to the difference 724, transforming it from the spatial domain to the frequency domain and generating primary transform coefficients represented by arrow 728. 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 726 is applied in a tiled manner to transform all samples of the difference 724. When non-square CBs are used, tiling is also performed using the largest available transform size in each dimension of the CB. For example, when a maximum transform size of 32 is used, a 64x16 CB uses two 32x16 primary transforms arranged in a tiled fashion. When a CB is larger in size than the maximum supported transform size, the CB is filled with TBs in a tiled fashion. For example, a 128x128 CB with a 64-pt transform maximum size is filled with four 64x64 TBs in a 2x2 arrangement. A 64x128 CB with a 32-pt transform maximum size is filled with eight 32x32 TBs in a 2x4 arrangement.
[0119] Application of the transform 726 results in multiple TBs for the CB. If each application of the transform operates on a TB of the difference 724 larger than 32×32, e.g., 64×64, all resulting primary transform coefficients 728 outside the top-left 32×32 area of the TB are set to zero (i.e., discarded). The remaining primary transform coefficients 728 are passed to a quantizer module 734. The primary transform coefficients 728 are quantized according to a quantization parameter 792 associated with the CB to generate primary transform coefficients 732. In addition to the quantization parameter 792, the quantizer module 734 may also apply a "scaling list" to enable non-uniform quantization within the TB by further scaling the residual coefficients according to their spatial location within the TB. The quantization parameter 792 may be different for the luma CB versus each chroma CB. The primary transform coefficients 732 are passed to a forward secondary transform module 730 to generate transform coefficients represented by arrow 736 by performing a non-separable secondary transform (NSST) operation or by bypassing the secondary transform. The forward primary transform 726 is typically separable, transforming a set of rows and then a set of columns of each TB. The forward primary transform module 726 uses either a type II discrete cosine transform (DCT-2) in the horizontal and vertical directions, or bypassing the horizontal and vertical transforms, or a combination of a type VII discrete sine transform (DST-7) and a type VIII discrete cosine transform (DCT-8) in the horizontal or vertical directions for luma TBs whose width and height do not exceed 16 samples. The use of a combination of DST-7 and DCT-8 is referred to as a "multiple transform selection set" (MTS) in the VVC standard.
[0120] The forward secondary transform of module 730 is generally a non-separable transform, which is applied only to the residual of intra-predicted CUs, and may nevertheless be bypassed. The forward secondary transform operates on either 16 samples (configured as a 4×4 sub-block at the top left of the primary transform coefficients 728) or 48 samples (configured as three 4×4 sub-blocks at the top left 8×8 coefficients of the primary transform coefficients 728) to generate a set of secondary transform coefficients. The set of secondary transform coefficients may be fewer in number than the set of primary transform coefficients from which they are derived. By applying the secondary transform only to a set of coefficients that are adjacent to each other and include a DC coefficient, the secondary transform is referred to as a “low-frequency non-separable secondary transform” (LFNST). Such secondary transforms may be obtained through a training process and by virtue of their non-separable nature and trained origin, and can exploit additional redundancy in the residual signal that cannot be captured by separable transforms such as DCT and DST variants. Furthermore, when LFNST is applied, all remaining coefficients in the TB are zero, both in the primary transform domain and the secondary transform domain.
[0121] The quantization parameter 792 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 792 may vary periodically with the signaled "delta quantization parameter". The delta quantization parameter (delta QP) is signaled once for the CUs contained within a given area, called a "quantization group". If the CU is larger than the quantization group size, the delta QP is signaled once with one of the TBs of the CU. That is, the delta QP is signaled by the entropy encoder 738 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 792 and a corresponding entry in the scaling matrix. The scaling matrix may have a size smaller than the size of the TB, and when applied to the TB, a nearest neighbor approach is used to provide a scaling value for each residual coefficient from a scaling matrix of a size smaller than the TB size. The residual coefficients 736 are provided to an entropy encoder 738 for encoding in the bitstream 614. Typically, the residual coefficients of each TB having at least one significant residual coefficient of the TU are scanned to generate an ordered list of values according to a scan pattern. The scan pattern generally scans the TB as a sequence of 4×4 “sub-blocks”, providing a regular scanning operation with a granularity of 4×4 sets of residual coefficients, and the arrangement of the sub-blocks depends on the size of the TB. The scan within each sub-block and the progression from one sub-block to the next typically follows a backward diagonal scan pattern. Additionally, the quantization parameters 792 are coded into the bitstream 614 using a delta QP syntax element, and the slice QP of the initial value in a given slice or subpicture and secondary transform index 788 is coded into the bitstream 614.
[0122] As mentioned above, the video encoder 614 needs to access a frame representation that corresponds to the decoded frame representation seen by the video decoder. Thus, the residual coefficients 736 pass through the inverse secondary transform module 744, operating according to the secondary transform index 788 to generate intermediate inverse transform coefficients represented by arrow 742. The intermediate inverse transform coefficients 742 are inverse quantized by the inverse quantizer module 640 according to the quantization parameter 792 to generate inverse transform coefficients represented by arrow 746. The inverse quantizer module 740 may also perform inverse non-uniform scaling of the residual coefficients using a scaling list, which corresponds to the forward scaling performed in the quantizer module 734. The inverse transform coefficients 746 are passed to the inverse primary transform module 748 to generate residual samples of the TUs, represented by arrow 750. The inverse primary transform module 748 applies a DCT-2 transform horizontally and vertically, constrained by the maximum available transform size, as described with reference to the forward primary transform module 726. The type of inverse transform performed by the inverse secondary transform module 744 corresponds to the type of forward transform performed by the forward secondary transform module 730. The type of inverse transform performed by the inverse primary transform module 748 corresponds to the type of primary transform performed by the primary transform module 726. The summation module 752 sums the residual samples 750 and the PU 720 to generate reconstructed samples of the CU (indicated by arrow 754).
[0123] The reconstructed samples 754 are passed to a reference sample cache 756 and an in-loop filter module 768. The reference sample cache 756, typically implemented using static RAM on the ASIC to avoid costly off-chip memory accesses, provides the minimum sample storage required to satisfy the dependencies for generating intra-frame PBs for subsequent CUs in the frame. The minimum dependencies typically include a "line buffer" of samples along the bottom of a row of CTUs for use by the next row of CTUs, and column buffering whose extent is set by the height of the CTU. The reference sample cache 756 provides reference samples (represented by arrow 758) to a reference sample filter 760. The sample filter 760 applies a smoothing operation to generate filtered reference samples (indicated by arrow 762). The filtered reference samples 762 are used by an intra-frame prediction module 764 to generate an intra-predicted block of samples, represented by arrow 766. For each candidate intra-prediction mode, the intra-frame prediction module 764 generates a block of samples, i.e., 766. The block of samples 766 is generated by the module 764 using a technique such as DC, planar, or angular intra prediction. The block of samples 766 may also be generated using a matrix multiplication approach with a matrix selected by the video encoder 614 from a set of matrices and neighboring reference samples as input, where the selected matrix is signaled to the bitstream 614 using an index to identify which matrix from the set of matrices should be used by the video decoder.
[0124] The in-loop filter module 768 applies several filtering stages to the reconstructed samples 754. The filtering stages include a "deblocking filter" (DBF) that applies smoothing aligned to CU boundaries to reduce artifacts due to discontinuities. Another filtering stage present in the in-loop filter module 768 is the "adaptive loop filter" (ALF), which applies a Wiener-based adaptive filter to further reduce distortion. A further filtering stage available in the in-loop filter module 768 is the "sample adaptive offset" (SAO) filter. The SAO filter operates by first classifying the reconstructed samples into one or more categories and applying an offset at the sample level according to the assigned category.
[0125] The filtered samples, represented by arrow 770, are output from the in-loop filter module 768. The filtered samples 770 are stored in a frame buffer 772. The frame buffer 772 typically has a capacity to store several (e.g., up to 16) pictures and is therefore stored in the memory 206. The frame buffer 772 is not usually stored using on-chip memory due to the large memory consumption required. Access to the frame buffer 772 is therefore costly in terms of memory bandwidth. The frame buffer 772 provides a reference frame (represented by arrow 774) to a motion estimation module 776 and a motion compensation module 780. The reference frame 774 is output as a reconstructed frame 618 of the corresponding sub-picture encoder module 600 (514, 532, 556, 572) and provided to the unpacker module 620. In the example of FIG. 7, the reconstructed frame is the result of the operation of lossy VVC encoding resulting from the operation of modules 726-748 and 752-754.
[0126] The motion estimation module 776 estimates several "motion vectors" (denoted as 778), each of which is a Cartesian space offset from the position of the current CB and refers to a block in one of the reference frames in the frame buffer 772. A filtered block of reference samples (denoted as 782) is generated for each motion vector. The filtered reference samples 782 form further candidate modes available for potential selection by the mode selector 786. Furthermore, for a given CU, the PU 720 may be formed using one reference block ("uni-predicted") or may be formed using two reference blocks ("bi-predicted"). For a selected motion vector, the motion compensation module 780 generates the PB 720 according to a filtering process that supports sub-pixel accuracy in the motion vector. Thus, the motion estimation module 776 (operating on many candidate motion vectors) can perform a simplified filtering process compared to that of the motion compensation module 780 (operating only on the selected candidate) to achieve reduced computational complexity. When the video encoder 614 selects inter prediction for a CU, the motion vector 778 is encoded into the bitstream 616.
[0127] 7 is described with reference to Generic Video Coding (VVC), although other video coding standards or implementations may also employ the processing stages of modules 710-790. The frame data 612 (and bitstream 616) may also be transferred from the memory 206, the hard disk drive 210, a CD-ROM, a Blu-ray disc TM6, or other computer-readable storage medium. Additionally, the frame data 612 (and bitstream 616) may be received from (or transmitted to) an external source, such as a server connected to the communications network 220 or a radio frequency receiver. The communications network 220 may provide limited bandwidth, necessitating the use of rate control in the video encoder 120 to avoid saturating the network when it is difficult to compress the frame data 612.
[0128] The bitstream 616 may be constructed from one or more slices representing spatial sections (a collection of CTUs) of the frame data 612, generated by one or more instances of the video encoder 614, operating cooperatively under the control of the processor 205. The bitstream 616 may also include one slice corresponding to one subpicture to be output as a collection of subpictures forming one picture, each subpicture being independently encodable and independently decodable with respect to either other slices or subpictures in the picture. The ability to independently encode and decode any subpicture within a picture allows the effects of lossy compression on packed feature maps or coefficients contained in any given subpicture to be taken into account in the PCA encoder 160 by using a lossy version of the feature maps or coefficients in a later stage of tensor compression.
[0129] FIG. 8 is a schematic block diagram 800 illustrating an implementation of the inter-channel decorrelation based tensor decoder 170 as part of the distributed machine task system 100. The video bitstream 143 is passed to a picture decoder 804, which implements a VVC video decoder and decodes the bitstream generated by the PCA encoder 160. The picture decoder 804 decodes sub-pictures present in the video bitstream 143, each sub-picture corresponding to a different data type required to reconstruct the tensor 149. Each decoded sub-picture provides a unit of information for the decoded tensor, the unit corresponding to one of the average tensor value 511, the coefficient 526, the basis vector 550, and the coefficient 566. The average feature sub-picture 840 is output by the picture decoder 804 and passed to an unpacker 842. The unpacker 842 extracts an integer average feature map 844 based on the width and height of the tensor 149. The integer average feature map 844 is passed to an inverse quantizer 846 where a conversion from the sample domain to the floating point domain is performed using an appropriate quantization range, e.g. obtained from the bitstream 143, resulting in a decoded average feature map 848.
[0130] The average coefficient sub-picture 830 is also output by the picture decoder 804 and passed to an unpacker 832. The unpacker 832 extracts integer average coefficients 834 based on the channel counts of the tensor 149. The integer average coefficients 834 are passed to an inverse quantizer 836. The inverse quantizer 836 converts from the average coefficients 834 from the integer domain to the floating point domain using a quantization range obtained from the bitstream 143 and outputs floating point average coefficients 838. A dot product module 850 generates an average feature map 852 for each channel of the tensor 149 by performing a dot product of the average feature 848 with each coefficient of the average coefficients 838. The inverse quantizers 846, 836, 824, and 816 are the inverse of the corresponding quantization functions (512, 528, 552, and 568) used in the implementation 500 to encode the bitstream.
[0131] Subpictures 820 containing packed basis vectors (e.g., performing PCA) generated by the decomposition module 548 prior to quantization and lossy compression are also output by the picture decoder 804 and passed to an unpacker 822. The unpacker 822 extracts integer basis vectors 823 as a series of non-overlapping feature maps in the subpicture 820. The integer basis vectors 823 are passed to an inverse quantizer 824. The inverse quantizer 824 constructs floating-point basis vectors 826 and applies the quantization ranges obtained from the bitstream 143.
[0132] A sub-picture 810 containing coefficients with one coefficient per basis vector per feature map of the tensor 143 is also output by the picture decoder 804 and passed to the unpacker 812. The unpacker 812 extracts each coefficient from the sub-picture 810 based on the dimensionality of the tensor 149. One coefficient is required per basis vector per feature map or channel, which represents the contribution of each basis vector in reconstructing a given feature map or channel, collectively forming integer coefficients 814 output from the unpacker 812. The inverse quantizer 816 converts the integer coefficients 814 from the integer domain to the floating point domain according to the quantization range obtained from the bitstream 143, outputting floating point coefficients 818. The zero-centered tensor 854 is generated by a dot product module 828, which performs a dot product on the coefficients 818 and the basis vectors 826. The summing module 856 sums the zero-centered tensor 854 with the mean feature map 848 to generate the tensor 149 as output from the PCA decoder 170. A sequence of operations in the PCA decoder 170 restores the dimensionality of the compressed tensor to its original dimensionality, allowing the tensor 149 to be passed to the CNN head 150 for execution of a given machine task.
[0133] As described below in connection with Figures 12A and 12B, the information in each decoded picture 840, 830, 820, and 810 is arranged into a two-dimensional array of samples. Each of the decoded pictures 840, 830, 820, and 810 is independently decodable in the example described in connection with Figure 8 above. In other implementations, at least one of the decoded pictures 840, 830, 820, and 810 is independently decodable with respect to the others, depending on how the outputs of the quantizers 512, 528, 552, and 568 are packed and encoded into the bitstream. For example, independent and / or simultaneous decoding of the decoded pictures 840, 830, 820, and 810 may be performed to facilitate operation at higher frame rates than can be achieved by a single decoder sequentially decoding the decoded pictures 840, 830, 820, and 810. For example, when the destination device 140 is implemented on a server in the cloud, decoding performance may benefit from being distributed across multiple cores in the processor 205, especially when hardware modules are not available to offload more computationally demanding operations.
[0134] The reduced dimensional representation of tensor 149 in the form of various basis vectors (820) and associated coefficients (830 and 810) allows for reduced area when packing the vectors and coefficients into a picture or sub-picture per channel. The reduced area of the packed data results in a more efficient compressed representation compared to attempting to directly compress a frame containing the packed feature maps or channels of tensor 115.
[0135] Figure 9 shows an example implementation 900 of the picture decoder 804, also referred to as a video decoder. The video decoder 804 of Figure 9 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, such as HEVC. As shown in Figure 9, a bitstream 910 (corresponding to bitstream 143) is input to the video decoder 804. The bitstream 143 may be stored in memory 206, hard disk drive 210, a CD-ROM, a Blu-ray disc, etc. TM 9, or other non-transitory computer-readable storage medium and provided to the implementation 900 as bitstream 910. Alternatively, the bitstream 910 may be received from an external source, such as a server connected to the communications network 220 or a radio frequency receiver. The bitstream 143 includes encoded syntax elements representing captured frame data to be decoded. If the sub-pictures are decoded independently, the portion of the bitstream 143 corresponding to each sub-picture may be provided to a separate instance of the implementation 900. A separate instance of the implementation 910 for each sub-picture allows for parallel decoding of the sub-pictures to improve throughput.
[0136] The bitstream 910 is input to the entropy decoder module 920. The entropy decoder module 920 extracts syntax elements from the bitstream 910 by decoding a sequence of "bins" and passes the values of the syntax elements to other modules in the video decoder 804. The entropy decoder module 920 uses variable-length and fixed-length decoding to decode the SPS, PPS, or slice header, arithmetic decoding engine, and decodes the syntax elements of the slice data as a sequence of one or more bins. Each bin can use one or more "contexts", which describe the probability levels used to code the "1" and "0" values of the bin. If multiple contexts are available for a given bin, a "context modeling" or "context selection" step is performed to select one of the available contexts to decode the bin. The process of decoding the bins sequentially forms a feedback loop, and thus each slice can be decoded in its entirety by a given entropy decoder 920 instance. A single (or a small number of) high-performance entropy decoder 920 instances can decode all slices or sub-pictures of a frame or picture from the bitstream 910, and multiple low-performance entropy decoder 920 instances can simultaneously decode slices of a frame from the bitstream 910.
[0137] The entropy decoder module 920 applies an arithmetic coding algorithm, e.g., “context-adaptive binary arithmetic coding” (CABAC), to decode syntax elements from the bitstream 910. The decoded syntax elements are used to reconstruct parameters in the video decoder 804. The parameters include residual coefficients (represented by arrow 924), quantization parameters 974, secondary transform indexes 970, and mode selection information such as intra-prediction modes (represented by arrow 958). The mode selection information also includes information such as motion vectors and partitioning of each CTU into one or more CBs. The parameters are used to generate PBs, typically combined with sample data from previously decoded CBs.
[0138] The residual coefficients 924 are passed to an inverse secondary transform module 936, where a secondary transform is applied or no operation is performed (bypassed) according to the secondary transform index. The inverse secondary transform module 936 generates reconstructed transform coefficients 932, i.e., primary transform domain coefficients, from the secondary transform domain coefficients. The reconstructed transform coefficients 932 are input to an inverse quantizer module 928. The inverse quantizer module 928 performs inverse quantization (or "scaling") on the residual coefficients 932, i.e., in the primary transform coefficient domain, according to a quantization parameter 974 to create reconstructed intermediate transform coefficients, represented by arrow 940. The inverse quantizer module 928 may also apply a scaling matrix to provide non-uniform inverse quantization within the TB, corresponding to the operation of the inverse quantizer module 740. If the bitstream 143 indicates that a non-uniform inverse quantization matrix is to be used, the video decoder 804 reads the quantization matrix from the bitstream 143 as a sequence of scaling factors and places the scaling factors into a matrix. Inverse scaling uses a quantization matrix in combination with the quantization parameters to create reconstructed intermediate transform coefficients 940 .
[0139] The reconstructed transform coefficients 940 are passed to an inverse primary transform module 944. The module 944 converts the coefficients 940 from the frequency domain back to the spatial domain. The inverse primary transform module 944 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 726. The result of the operation of the module 944 is a block of residual samples, represented by an arrow 948. The size of the block of residual samples 948 is equal to the corresponding CB. The residual samples 948 are provided to a summation module 950.
[0140] In summation module 950, the residual samples 948 are added to the decoded PB (represented as 952) to generate a block of reconstructed samples, represented by arrow 956. The reconstructed samples 956 are provided to a reconstructed sample cache 960 and to an in-loop filtering module 988. The in-loop filtering module 988 generates a reconstructed block of frame samples, represented as 992. The frame samples 992 are written to a frame buffer 996. The frame buffer 996 outputs an image or video frame 914, which corresponds to tensor 149 of FIG. 1.
[0141] The reconstructed sample cache 960 operates similarly to the reconstructed sample cache 756 of the video encoder 614. The reconstructed sample cache 960 provides storage for reconstructed samples necessary to intra-predict subsequent CBs without the memory 206 (e.g., by using instead the data 232, which is typically an on-chip memory). Reference samples, represented by arrow 964, are obtained from the reconstructed sample cache 960 and fed to a reference sample filter 968 to generate filtered reference samples, indicated by arrow 972. The filtered reference samples 972 are fed to an intra-frame prediction module 976. The module 976 generates blocks of intra-predicted samples, represented by arrow 980, according to the intra-prediction mode parameters 958 signaled in the bitstream 910 and decoded by the entropy decoder 920. The intra-prediction module 976 supports the modes of the encoder-side module 764, including IBC and MIP. The blocks of samples 980 are generated using modes such as DC, planar, or angular intra-prediction.
[0142] When the prediction mode of a CB is indicated to use intra prediction in the bitstream 143, the intra prediction samples 980 form the decoded PB 952 via the multiplexer module 984. Intra prediction produces a predictive block of samples (PB), which is a block in one color component derived using "neighboring samples" in the same color component. Neighboring samples are samples that are adjacent to the current block and are already reconstructed because they precede it in the block decoding order. When a luma block and a chroma block are colocated, the luma block and the chroma block may use different intra prediction modes. However, the two chroma CBs share the same intra prediction mode.
[0143] When the prediction mode of the CB is indicated to be inter-predictive in the bitstream 910, the motion compensation module 934 generates a block of inter-predicted samples represented as 938. The block of inter-predicted samples 938 is generated using a motion vector decoded from the bitstream 143 by the entropy decoder 920 and a reference frame index to select and filter a block of samples 998 from the frame buffer 996. The block of samples 998 is obtained from a previously decoded frame stored in the frame buffer 996. In the case of bi-prediction, two blocks of samples are generated and blended together to generate samples for the decoded PB 952. The frame buffer 996 is populated with filtered block data 992 from the in-loop filtering module 988. Similar to the in-loop filtering module 768 of the video encoder 614, the in-loop filtering module 988 applies any of the DBF, ALF, and SAO filtering operations. In general, motion vectors are applied to both the luma and chroma channels, but the filtering processes for sub-sample interpolation in the luma and chroma channels are different.
[0144] Not shown in Figures 7 and 9 are modules for pre-processing the video before encoding and post-processing the video after decoding to shift sample values such that a more uniform use of the range of sample values in each chroma channel is achieved. A multi-segment linear model is derived in the video encoder 614 and signaled in the bitstream for use by the video decoder 804 to undo sample shifting. This Linear Model Chroma Scaling (LMCS) tool provides compression advantages for certain color spaces and content that have some degree of non-uniformity in sample space utilization, particularly limited range utilization, that may result in higher quality loss from the application of quantization.
[0145] FIG. 10A is a schematic block diagram illustrating an example implementation 1000 of a CNN head portion 150 for object detection, corresponding to a portion of the “YOLOv3” network excluding the “DarkNet-53” backbone portion. The implementation 1000 can be used when the CNN backbone is implemented, for example, as in FIG. 3A. Depending on the task to be performed at the destination device 140, a different network can be used instead of the CNN head 150. The input tensor 149 is separated into tensors for each layer (i.e., tensors 1010, 1020, and 1034). The tensor 1010 is passed to a CBL module 1012 to generate a tensor 1014. The tensor 1014 is passed to a detection module 1016 and an upscaler module 1022. The detection module outputs a bounding box 1018 in the formation of the detection tensor. The bounding box 1018 is passed to a non-maximum suppression (NMS) module 1048.
[0146] Scaling by the original video width and height is performed in the upscaler module 1022 before resizing the backbone portion of the network 114 to generate a bounding box that indicates coordinates in the original video data 113. The upscaler module 1022 receives the tensor 1014 and the tensor 1020 and generates an upscaled tensor 1024 that is passed to the CBL module 1026. The CBL module 1026 generates a tensor 1028 as an output. The tensor 1028 is passed to the detection module 1030 and the upscaler module 1036. The detection module 1030 generates a detection tensor 1032 that is fed to the NMS module 1048. The upscaler module 1036 is another example of a module 1020. The upscaler module 1036 receives the tensor 1028 and the tensor 1034 and outputs an upscaled tensor 1038. The upscaled tensor 1038 is passed to a CBL module 1040, which outputs a tensor 1042 to a detection module 1044. CBL modules 1012, 1026, and 1040 each include a concatenation of five CBL modules, e.g., CBL model 360 shown in FIG. 3D. Upscaler modules 1022 and 1036 are respective instances of upscaler module 1060, as shown in FIG. 10B. Module 1048 receives tensors 1018, 1032, and 1036 and outputs task result 151.
[0147] As shown in Figure 10B, upscaler module 1060 accepts tensor 1062 (e.g., tensor 1014 in Figure 10A) as an input. Tensor 1062 is passed to CBL module 1066 to generate tensor 1068. Tensor 1068 is passed to upsampler 1070 to generate upsampled tensor 1072. Concatenation module 1074 generates tensor 1076 by concatenating upsampled tensor 1072 with a second input tensor 1064 (e.g., tensor 1020 input to upscaler 1022 in Figure 10A).
[0148] The detection modules 1016, 1030, and 1044 are instances of the detection module 1080 as shown in FIG. 10C. The detection module 1080 receives a tensor 1082. The tensor 1082 is input to a CBL module 1084. The CBL module 1084 generates a tensor 1086. The tensor 1086 is passed to a convolution module 1088, which implements a detection kernel. In some configurations, the detection kernel applies a 1×1 kernel to generate output on the feature maps in each of the three layers of the tensor. The detection kernel is 1×1×(B×(5+C)), where B is the number of bounding boxes that 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 1090). 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 by the NMS module 1048 to the resulting bounding boxes to discard redundant boxes such as overlapping predictions at similar scales, resulting in a final set of bounding boxes as output for object detection.
[0149] FIG. 11 is a schematic block diagram illustrating an alternative head portion 1100 of a CNN. The head portion 1100 may be implemented as a CNN head 150, with the CNN backbone 114 being implemented, for example, as the backbone 400. The head portion 1100 forms part of an overall network known as "Fast RCNN" and includes a feature network (i.e., the backbone portion 400), a region proposal network, and a detection network. The input to the head portion 1100 is tensor 149, which includes P2-P6 layer tensors 1110, 1112, 1114, 1116, and 1118. The P2-P6 layer tensors 1110, 1112, 1114, 1116, and 1118 correspond to the P2-P6 outputs 477, 475, 473, 471, and 429 of FIG. 4. The P2-P6 tensors 1110, 1112, 1114, 1116, and 1118 are input to a region proposal network (RPN) head module 1120. The RPN head module 1120 performs convolutions on the input tensors to generate intermediate tensors. The intermediate tensors are fed to two subsequent sibling layers, (i) one for classification and (ii) one for bounding box, or "region of interest" (ROI) regression. The resulting output is the classification and bounding boxes 1122. The classification and bounding boxes 1122 are passed to an NMS module 1124. The NMS module 1124 prunes redundant bounding boxes by removing duplicate boxes with lower scores to generate pruned bounding boxes 1126. The bounding boxes 1126 are input to a region of interest (ROI) puller 1128. The ROI pooler 1128 uses some of the layer tensors (described further below) and bounding boxes 1126 of tensor 149 to generate fixed-size feature maps from the various input-size maps using a max pooling operation, where sub-sampling takes the maximum value within each group of input values to generate one output value in the output tensor.
[0150] In the configuration of the CNN backbone 400 and CNN head 1100, the "P6" layer tensor 429 is omitted from the output tensor 115 (received as tensor 149). In the configuration in which the P6 tensor is omitted, the CNN head 1100 generates the P6 input tensor 1118 by performing a "Maxpool" operation with a stride equal to 2 on the P5 tensor 1116. Since the P6 layer can be reconstructed from the P5 layer, there is no need to separately encode and decode the P6 layer as an explicit FPN layer in the PCA encoder 160, PCA decoder 170.
[0151] The inputs to the ROI puller 1128 are the P2-P5 feature maps 1110, 1112, 1114, and 1116, as well as the region of interest proposal 1126. Each proposal (ROI) from 1126 is associated with a portion of the feature maps (1110-1116) to generate a fixed-size map. The fixed-size map is a size independent of the underlying portion of the feature maps 1110-1116. One of the feature maps 1110-1116 is selected such that the resulting cropped map has sufficient detail, for example, according to the following rule: floor(4+log2(sqrt(box_area) / 224)), where 224 is the reference box size. The ROI puller 1128 operates to crop the input feature maps according to the proposal 1126 generating a tensor 1130.
[0152] The tensor 1130 is fed to a fully connected (FC) neural network head 1132. The FC head 1132 runs two fully connected layers to generate a class score and bounding box predictor delta tensor 1134. The class score is typically an 80 element tensor, with each element corresponding to a predicted score for the corresponding object category. The bounding box predictor delta tensor is an 80×4=320 element tensor, containing the bounding box for the corresponding object category. Final processing is performed by an output layer module 1136, which receives the tensor 1134 and performs a filtering operation to generate a filtered tensor 1138. Low scoring (low classification) objects are removed from further consideration. A non-max suppression module 1140 receives the filtered tensor 1138 and removes overlapping bounding boxes by removing overlapping boxes with lower classification scores, resulting in an inference output tensor 1140 corresponding to the tensor 151.
[0153] 12A and 12B are schematic block diagrams illustrating the division of a picture 1200 into sub-pictures 1210, 1212, 1214, and 1216, implemented, for example, by a sub-picture bitstream combiner 580. Each sub-picture is packed by a packer 610 of a corresponding one of the encoders 514, 532, 556, and 572. Each sub-picture includes information arranged in a two-dimensional array of samples. Referring to FIG. 12B, the sub-picture 1210 holds an average feature map, such as an average feature map 1220 of a tensor in a tensor of FPN. The average feature map 1220 corresponds to the bitstream 515 of the sub-picture encoder 514 in the configuration of FIG. 5. The sub-picture 1212 holds an average coefficient 1222, which corresponds to 533 in FIG. 5. The average coefficients 1222 are arranged into rows of values, with one row for each coding layer or FPN layer and one value for each channel of the corresponding tensor. The number and dimensions of the coding layers may differ from the number and dimensions of the FPN layers based on tensor resampling and / or concatenation, as described with reference to Figures 18A, 18B, 19, and 20. The sub-picture 1216 holds basis vectors corresponding to 557 in Figure 5. In the example of Figure 12B, the basis vectors include, among others, basis vector 1226, and the basis vectors are packed in an area of the sub-picture 1216 in a non-overlapping manner. The basis vectors may be packed contiguously or may include, for example, an interval of one or two samples between each set of basis vectors. The basis vectors of each coding layer or FPN layer are packed into the sub-picture 1216. Areas in picture 1200 that are not used to store data, such as 1208, may be occupied by sample values that correspond to the value "0" after application of inverse quantization to convert from sample values to the floating-point domain. Similarly, areas in sub-pictures 1210, 1212, 1214, and 1216 that are not used to store data may be occupied by sample values that correspond to the value "0" after application of inverse quantization to convert from sample values to the floating-point domain.Subpicture 1214 holds coefficients corresponding to 572 in Figure 5, with one coefficient for each basis vector for each channel in the tensor in the FPN tensor. For example, 25 basis vectors for 256 channels in a tensor, the coefficients for one tensor are arranged as a 256 x 25 sample array.
[0154] When multiple tensors are coded in the picture 1200, the corresponding sample arrays are stacked in the subpicture 1214. The use of a monochrome format for the picture 1200 is sufficient because the quantized feature maps are two-dimensional arrays of samples and the coefficients are also mapped to one- or two-dimensional arrays of samples. When the CNN backbone 114 generated the tensor 115 for the frame 113, the PCA encoder 160 can determine the size of the subpictures 1210, 1212, 1214, and 1216 based on the dimensions of the tensor 115. The subpictures 1210, 1212, and 1216 can be specified in width and height as an integer number of CTUs, i.e., as multiples of 128 luma samples. The width of the subpicture 1216 is equal to the sum of the widths of the horizontally arranged subpictures 1210, 1212, and 1214. The height of sub-picture 1216, which is disposed below sub-pictures 1210, 1212, and 1216, is set to provide sufficient area for packed basis vectors, such as basis vector 1226.
[0155] In the example of Figures 12A and 12B, sub-pictures 1210, 1212, 1214 corresponding to quantized coefficients 513, 530, and 568, respectively, are arranged horizontally and define the width of the picture 1200. Sub-picture 1216 corresponding to quantized coefficient 554 is located below the first, second, and third units, spanning the width of sub-pictures 1210, 1212, 1214 and extending to the bottom of the picture 1200. In another implementation, the quantized coefficients may be arranged in a format other than a sub-picture. For example, in the case of VVC or HEVC, the quantized coefficients may be arranged or packed as slices or tiles. In still other implementations, the quantized coefficients may be arranged differently depending on factors such as the coding type (e.g., VVC or HEVC) and expected data characteristics. For example, the quantized coefficients may be arranged in a scan order of small blocks with a transform skip applied such that residual coding is applied to an ordered set of quantized coefficients when no transform is used. For example, when the quantized coefficients are compressed using HEVC, a transform skip may be applied to the 4x4 blocks, and the quantized coefficients may be arranged in a diagonal scan pattern in the 4x4 blocks to take advantage of residual coding without the application of a transform to the 4x4 blocks. If the number of basis vectors is 16 or less, the quantized coefficients of each feature map may be stored in a separate 4x4 block. Within each 4x4 block, the compression efficiency of the quantized coefficients benefits from the application of adaptive Rice parameter coding within the 4x4 block. Instead of separate sub-pictures, a single picture may be used in other implementations, with separate slices corresponding to each set of quantized coefficients, or each sub-picture may be arranged differently from the picture 1200.
[0156] In the construction of picture 1200, the packing of coefficients 1222 into subpictures 1212 modifies the array from an N×1 array, where N is the number of channels, to a W×H array, where W×H is equal to N, and adjusts the aspect ratio of the subpicture to be as close to a square (1:1) or rectangular, such as a 2:1 ratio, as possible, but chosen to avoid the extremely elongated ratio of N×1. A closer to square aspect ratio results in fewer samples adjacent to the edges of the packed coefficient samples that are not used by the unpacker, but are still coded with relatively high fidelity, and thus contribute to the residual coding cost without any benefit to the tensor reconstruction.
[0157] In another configuration of the picture 1200, the packing of the coefficients 1222 or 1224 into the sub-picture 1212 or 1214 is performed such that each coefficient is packed into two or more samples. For example, the coefficients may be packed into a set of 2×2 samples by the packer 610. The unpacker 620 or 832 or 812 reads the 2×2 set of samples and performs a filtering operation to recover the coefficients. The packing into two or more samples provides a mechanism to compensate for errors introduced into the coefficient values due to the use of lossy encoding in the video encoder 614. Other configurations of sets of samples are possible, including 2×4, 4×2, 4×4.
[0158] FIG. 13 is a schematic block diagram illustrating a bitstream 1300 that holds encoded packed feature maps and associated metadata. The bitstream 1300 corresponds to the bitstream 121 generated by the PCA encoder 160 or the bitstream 143 decoded by the PCA decoder 170. The bitstream 1300 includes a group of syntaxes preceded by a "Network Abstraction Layer" unit header. For example, a NAL unit header 1308 precedes a sequence parameter set (SPS) 1310. The SPS 1310 may include a syntactic "profile level tier" (PLT) unit that specifies a profile (a set of coding tools) and a level and tier (e.g., jointly specifying an operating point in terms of maximum sample rate and compressed bitrate). The syntactic PLT unit may include a syntactic "general constraint information" (GCI) unit that further constrains the set of available tools compared to the selected profile. The SPS 1310 specifies the layout of the picture 1200, including the positions and sizes of the sub-pictures 1210, 1212, 1214, and 1216. The GCI includes a set of flags, each of which constrains certain coding tools not to be used in the bitstream 1300. The PLT signals that a certain set of tools is available for use in the bitstream 1300, the particular set of tools being known as a "profile." One example of a profile is "Main 10," which provides 8-10 bit video with either 4:0:0 or 4:2:0 chroma format, and targets wide deployment. The GCI may indicate further constraints on the set of tools of a profile to a subset of the tools, known as a "sub-profile." When the PCA encoder 160 encodes the frame-packed feature maps (i.e., operating according to FIG. 5), certain tools of the VVC standard do not provide compression benefits. Tools that do not provide a compression advantage to packed feature maps do not need to be tried by the video encoder 614 and may be signaled in the GCI as not being used in the bitstream 1300.The SPS 1310 also indicates the resolution, bit depth, and chroma format of the frame data represented by the bitstream 1300.
[0159] The packing format used by the PCA encoder 160 may be encoded in the SEI message 1313 using an index to select one feature packing format from an enumeration of all available feature packing formats. The particular CNN backbone used to generate the feature map may also be indicated in the SEI message 1313 using an index to select one CNN backbone from an enumeration of a set of predefined CNN backbones, some or all of which are available to the source device 110. From the CNN backbone type index, the number of channels and the number of layers in each layer, as well as the resolution of each feature map in each layer, may be determined. The size (i.e., width and height) of the basis vectors 550, the maximum number of basis vectors 550 (i.e., the maximum number of each layer of the FPN, or a reduced formation of the FPN obtained from the tensor combiner 162), and the number of basis vectors 550 used (i.e., obtained from the method 2100) are encoded as basis vector packing information 1391 in the SEI message 1313, described with reference to Appendix A. The operations performed in the tensor extractor 172 (determined by the tensor combiner 162) to recover tensors 149 having the same number and dimensionality as the tensors 115a are described as layer mapping 1390. The layer mapping 1390 is present in the SEI message 1313. The layer mapping 1390 includes layer_update_mapping_info, layer_extraction_flag, layer_upsample_flag, layer_downsampling_flag, resampling_filter_idx, resample_vertical_only_flag, resample_horizontal_only_flag, src_layer_idx, src_channel_offset, dst_layer_idx, described with reference to Appendix A.
[0160] A picture 1314 is coded in the bitstream 1300. Each picture includes one or more sub-pictures, such as coded sub-picture 1320, coded sub-picture 1210, etc. For the first picture of the bitstream, typically for a "random access point" access unit, intra slices are used to avoid any prediction dependency on other access units in the bitstream 1300. A coded sub-picture 1322 that codes the sub-picture 1212 includes a slice header 1330 followed by slice data 1340. The slice data 1340 includes a sequence of CTUs that provide a coded representation of the frame data. The CTUs are square and typically 128x128 in size, which is not well aligned to typical feature map sizes. Alignment of the feature map to a minimum block size, such as a 4x4 grid, partially remedies this misalignment. To allow conversion from the integer or sample domain to the floating-point domain, a quantization range 1392 is present in the bitstream 1300 and defines the minimum and maximum floating-point values from which samples are mapped in the inverse quantization process, as performed, for example, in 520, 536, 560, 846, 836, 824, 816. The quantization ranges are determined in the quantization modules, i.e., 512, 528, 552, and 568, and are coded in the bitstream 121 as the quantization range 1392 in the SEI message 1313. The coded subpicture 1324 codes the subpicture 1214, and the coded subpicture 1326 codes the subpicture 1216. The coded subpictures 1220, 1222, 1224, and 1226 correspond to the bitstream portions 515, 533, 557, and 573, respectively. Instead of separate sub-pictures, a single picture may be used with separate slices corresponding to sub-pictures 1320, 1322, 1324, and 1326.
[0161] FIG. 14 illustrates a method 1400 for performing a first portion of the CNN and encoding the resulting feature map for a frame of video data. In encoding the feature map, tensors are encoded into a bitstream. The method 1400 may be implemented using an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1400 may be implemented by the source device 110 as one or more software code modules of the application program 233 under execution of the processor 205. The software code modules of the application program 233 that implement the method 1400 may reside, for example, on the hard disk drive 210 and / or the memory 206. The method 1400 is repeated for each frame of video data generated by the video source 112. The method 1400 may be stored in a computer-readable storage medium and / or the memory 206.
[0162] The method 1400 begins with a CNN first part execution step 1410. In step 1410, the CNN backbone 114, under the execution of the processor 205, executes a subset of layers of a particular CNN to convert the input frame 113 into intermediate tensors 115a. The intermediate tensors 115a may be stored, for example, in the memory 206 and / or the hard disk drive 210. An example of a CNN is "Faster R-CNN" or "Mask R-CNN", as shown in FIG. 4, where the subset of layers corresponds to all layers up to the "P-layer" split point. For example, when multiple tensors are extracted from the CNN backbone 114 due to the use of FPN, the tensors 115a may include multiple tensors. The method 1400 operates to encode a tensor corresponding to one frame of video data from the video source 112. Control in the processor 205 passes from step 1410 to a tensor reduction execution step 1415.
[0163] In step 1415, the tensor combiner 162 operates under the execution of the processor 205 to resample a number of tensors. FIG. 19 illustrates a method 1900 implemented in step 1415. As a result of the operation of step 1415, the tensors 115a from the FPN can be (i) downsampled (reduced in number), (ii) upsampled (increased in number), or (iii) passed directly to generate the tensors 115. The upsampling or downsampling is performed such that the tensors from the two layers are concatenated with compatible widths and heights. The decision of whether to upsample or downsample a given one of the tensors 115a or to leave all of the tensors 115a unchanged is coded in the bitstream 121. Control in the processor 205 passes from step 1415 to an average feature map determination step 1420.
[0164] In an average feature map determination step 1420, module 510, under execution of processor 205, averages tensor 115 across the channel dimension to generate average features 511. In step 1420, average features 511 are quantized by quantizer 512, under execution of processor 205, to generate integer (quantized) average feature map 513. Control in processor 205 passes from step 1420 to an average feature encoding step 1430.
[0165] In a mean feature encoding step 1430, the sub-picture encoder 514, under execution of the processor 205, packs the integer mean feature map 513 into a sub-picture 1210 and encodes the sub-picture 1210 to generate a bitstream portion 515. Control in the processor 205 passes from step 1430 to a reconstructed mean feature recover step 1440.
[0166] In a reconstructed average feature recovery step 1440, the sub-picture encoder 514, under execution of the processor 205, outputs a reconstructed picture, e.g., 618, in an implementation of the encoder 514, that corresponds to a lossy version of the sub-picture input for video compression, e.g., 612. Control in the processor 205 passes from step 1440 to an average coefficient determination step 1450.
[0167] In an average coefficient determination step 1450, the inverse quantizer 520, under execution of the processor 205, operates to inverse quantize the integer average feature map 516 and convert the map 516 back to the floating point domain as a feature map 522. A dot product 524, under execution of the processor 205, uses the tensor 115 and the feature map 522 to generate a set of average coefficients 526 using a dot product function, with one average coefficient generated per channel in the tensor 115. Control in the processor 205 passes from step 1450 to an average coefficient encoding step 1460.
[0168] In an average coefficient encoding step 1460, the quantizer module 528, under the execution of the processor 205, quantizes the average coefficients 526m to generate or produce integer average coefficients 530. The sub-picture encoder 532, under the execution of the processor 205, packs the integer average coefficients 530 into a sub-picture 1212 and encodes the sub-picture 1212 to generate a bitstream portion 533. Control in the processor 205 passes from step 1460 to a reconstructed average coefficient recovery step 1470.
[0169] In a reconstructed average coefficient recover step 1470, the sub-picture encoder 532, under execution of the processor 205, outputs a reconstructed version of the sub-picture 1212 from which reconstructed average coefficients 534 are generated. The reconstructed average coefficients 534 are inverse quantized by module 536 to generate recovered average coefficients 538. In step 1470, the reconstructed version of the picture corresponds to 618 in the implementation of the encoder 532. Control in the processor 205 passes from step 1470 to a basis vector determination step 1480.
[0170] In a basis vector determination step 1480, the inverse quantizer 536, the dot product module 540, the subtractor 544, and the decomposition module 548 operate under the execution of the processor 205 to generate a set of basis vectors for the tensor 115. The inverse quantizer 536 outputs the floating-point mean coefficients 538. The dot product module 540 performs a dot product operation with the recovered mean feature map 522 and the hte coefficients 538 to generate an offset tensor 542. The tensor 542 has the same dimensions as the tensor 115 and contains predictions of the feature maps of each channel in the tensor 115, predicted using only the mean (average) feature map information. Thus, the tensor 542 allows for the generation of a zero-mean version of the tensor 115 by subtracting this per-channel mean feature map data. The offset feature map 542 is subtracted from the tensor 115 by module 544 to generate a zero-centered tensor 546. The decomposition module 548 receives the tensor 546 as an input and generates a set of basis vectors 550. Each basis vector in the set 550 may be referred to as a "component." The operation of the decomposition module 548 in generating the basis vectors 550 is described with reference to FIG. 21. The vectors 550 contain fewer basis vectors than channels in the tensor 115, corresponding to a reduction in the dimensionality of the tensor 115. The basis vectors in 550 represent the tensor 115 in a subspace that explains the maximum amount of variance in the tensor 115 relative to the number of components in the basis vector 550. In other words, the basis vectors 550 allow for the representation of the tensor 115 with minimal degradation in quality for a given number of components. Control in the processor 205 passes from step 1480 to a basis vector encoding step 1490.
[0171] In a basis vector encoding step 1490, the quantizer module 552 operates under execution of the processor 205 to quantize the basis vectors 550 into the integer domain. The resulting integer basis vectors 554 are packed into sub-pictures and encoded to generate bitstream portion 557 by the sub-picture encoder 556 under execution of the processor 205. Control in the processor 205 passes from step 1490 to a reconstructed basis vector recover step 14100.
[0172] In step 14100, the sub-picture encoder 556, under execution of the processor 205, operates to generate a reconstructed integer tensor 558 to obtain a reconstructed version of the sub-picture 1316, e.g., 618. The basis vectors 558 are unpacked from the reconstructed sub-picture and dequantized (as reconstructed basis vectors 562) to the floating-point domain by the inverse quantizer 560, under execution of the processor 205. Control in the processor 205 passes from step 14100 to a coefficient determination step 14110.
[0173] Each of steps 1440, 1470, and 14100 recovers reconstructed coefficients. The reconstructed coefficients produced at each step provide a reconstruction of the features or vectors quantized and coded at steps 1430, 140, and 1490. Each reconstruction makes it possible to model and take into account the losses due to the coding operation performed by the sub-picture encoder being modeled, so that the version of the features or vectors seen at the decoder side reflects the one used in coding the bitstream 121. Losses incurred due to the operation of the quantization functions (e.g., at 512, 528, and 552) used to generate the coded bitstream in implementation 500 are also taken into account.
[0174] In step 14110, the dot product module 564, under execution of the processor 205, performs a dot product of each channel in the tensor 546 against each vector in the reconstructed basis vectors 562 to generate a set of coefficients, i.e., coefficients 566. The coefficients 566 represent the contribution of each basis vector in reproducing the content of each feature map. Control in the processor 205 passes from step 14110 to a coefficient encoding step 14120.
[0175] In step 14120, the quantizer module 568, under execution of the processor 205, quantizes the coefficients 566 to generate integer coefficients 570. The integer coefficients 570 are passed to the sub-picture encoder 572 for packing into the sub-picture 1214. The sub-picture 1214 is encoded by the module 572 to generate the bitstream portion 573. Control in the processor 205 passes from step 14120 to a sub-picture compositing step 14130. If the tensor 115 contains more than one tensor, steps 1420-14120 are repeated for each tensor in the tensor 115 and the final compressed representation is composed into a single picture in step 14130.
[0176] As described above, modules 552-572 operate similarly to modules 512-532 to generate the bitstream. In step 14130, sub-picture bitstream combiner 580, under the execution of processor 205, combines bitstream portions 515, 533, 557, and 573 corresponding to sub-pictures 1210, 1212, 1216, and 1214, respectively, into a single bitstream, i.e., 121.
[0177] The method 1400 is complete and processing in the processor 205 proceeds to invoke the method 1400 for the next frame.
[0178] FIG. 15 shows a method 1500 for decoding the bitstream 143 to generate a decoded tensor 149 as implemented by the PCA decoder 800 to perform the second part of the split CNN. The method 1500 may be implemented using an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1500 may be implemented by the source device 110 as one or more software code modules of the application program 233 under execution of the processor 205. The software code modules of the application program 233 implementing the method 1500 may reside, for example, on the hard disk drive 210 and / or the memory 206. The method 1500 may be stored in a computer-readable storage medium and / or the memory 206. The method 1500 begins with an average feature decoding step 1510.
[0179] In step 1510, the picture decoder 804, under execution of the processor 205, decodes the sub-picture 1210 (which corresponds to the sub-picture 840) from the bitstream 143. Control in the processor 205 passes from step 1510 to an average coefficient decoding step 1520.
[0180] In step 1520, the picture decoder 804, under execution of the processor 205, decodes the sub-picture 1212 (which corresponds to the sub-picture 830) from the bitstream 143. Control in the processor 205 passes from step 1520 to a DC component determination step 1530.
[0181] In step 1530, the unpackers 842 and 832, the inverse quantizers 846 and 836, and the dot product module 850, under execution of the processor 205, generate a tensor 852. The unpackers 842 and 832 unpack the subpictures, each of which includes a quantized feature map for the average feature 511, and is quantized using the quantization function of the implementation 500. The inverse quantizer 846 inverse quantizes the average feature map unpacked from the subpicture 840 by the unpacker 842 to derive the average feature map 848. The inverse quantizer 836 inverse quantizes the average coefficients unpacked from the subpicture 830 by the unpacker 832 from the integer domain to the floating-point domain using the respective quantization ranges signaled in the bitstream 143 to generate the average coefficients 838. The dot product module 850 performs a dot product on the mean features 848 and the mean coefficients 838 to generate a tensor 852. The tensor 852 represents an offset for the reconstruction of a non-zero centered tensor from a zero centered tensor. Control in the processor 205 passes from step 1530 to a basis vector decoding step 1540.
[0182] In step 1540, the picture decoder 804, under execution of the processor 205, decodes the sub-picture 1216 (corresponding to the sub-picture 820) from the bitstream 143. The sub-picture 1216 is passed to the unpacker 822 as the decoded sub-picture 820. The unpacker 822 extracts the decoded basis vectors, e.g. 1226, for inverse quantization in step 1560. The operation of the destination device 140 in decoding the basis vectors from the bitstream 143 is described with reference to Figure 22. Control in the processor 205 passes from step 1540 to a coefficient decoding step 1550.
[0183] In step 1550, the picture decoder 804, under execution of the processor 205, decodes the subpicture 1214 (corresponding to the subpicture 810) from the bitstream 143. The subpicture 1214 is passed to the unpacker 812 as the decoded subpicture 810. The unpacker 812 extracts the decoded coefficients, e.g., 1224, for inverse quantization in step 1560. Control in the processor 205 passes from step 1550 to an AC component determination step 1560.
[0184] In step 1560, the unpackers 822 and 812, the inverse quantizers 824 and 816, and the dot product module 828 operate under the execution of the processor 205 to generate a zero-centered tensor 854. The unpacker 822 extracts basis vectors from the subpicture 820 and passes the basis vectors to the inverse quantizer 824 as integer feature maps 822. The inverse quantizer converts the basis vectors from the integer domain to the floating-point domain according to the quantization range obtained from the bitstream 143, generating basis vectors 826. The unpacker 812 extracts coefficients from the subpicture 810 and passes the coefficients to the inverse quantizer 816 as integer coefficients. The inverse quantizer 816 generates floating-point domain coefficients 818. The dot product module 828 performs a dot product of each of the coefficients 818 with the respective basis vectors in the vector 826 to generate a zero-centered reconstructed tensor, i.e., tensor 854. Control in the processor 205 passes from step 1560 to a tensor generation step 1570.
[0185] In step 1570, summing module 856, under execution of processor 205, sums zero-centered reconstruction tensor 854 with tensor 852 to generate reconstruction tensor 149. Due to the optimal or near-optimal dimensionality reduction of the PCA process, tensor 149 is substantially similar to tensor 115 and is therefore suitable for use by CNN head 150 to perform a given machine task. If FPN is used, steps 1510-1570 are performed for each tensor in the representation of the FPN layer resulting from method 1900. Control in processor 205 passes from step 1570 to a tensor extraction step 1575.
[0186] In step 1575, processor 205 executes to extract separate FPN layer tensors from any composite tensors by operation of tensor extractor 172. Tensor extractor 172 executes method 2000 shown in FIG. 20 to extract separate FPN layer tensors from any composite tensors of tensor 149a and passes the results along to tensor 149. Control in processor 205 passes from step 1575 to a neural network second portion execute step 1580.
[0187] In step 1580, the CNN head 150, under the execution of the processor 205, executes the latter stage of the neural network using the tensor 149 as input. For example, classification using the network described with reference to FIG. 10A or FIG. 11 can be performed depending on the dimensionality of the tensor 149 (and the number of tensors contained therein, if FPN is used). Furthermore, if some networks have matching architectures and weights in the backbone part, the completion of these different networks can be performed by executing different instances of the CNN head 150 using tensors encoded from such backbone part. Step 1580 is performed to output the task result 151.
[0188] 16A and 16B show two successive data sets and associated eigenvectors to illustrate the concept of eigenvector "instability," which occurs when decomposition is performed repeatedly on similar data sets. When decorrelated tensors are generated from a video, successive frames are strongly correlated, and therefore the resulting basis vectors are also highly similar. A first data set 1600 in FIG. 16A shows a two-dimensional data set, and a second data set 1640 in FIG. 16B shows a later version of the two-dimensional data set. Data sets 1600 and 1640 are similar but not identical and may be derived by performing a CNN backbone 114 operation on a sampling process such as frame capture from a video device 112. Although each sample in a feature map forms a separate dimension for purposes of decomposition in system 100, for purposes of illustration, a two-dimensional data set is shown in FIGS. 16A and 16B. A single eigenvector is generated, resulting in a reduction from two dimensions to one. For data set 1600, eigenvector 1610 is generated, and for data set 1640, eigenvector 1650 is generated. Since the data sets 1600 and 1640 are similar, the eigenvectors 1610 and 1650 have similar absolute gradients, with the "gradient" reflecting the direction of the vector in the case of a two-dimensional vector, noting that the intercepts of the principal components pass through the origin. However, due to slight differences in the data sets 1600 and 1640, the process for performing the decomposition may "flip" or invert the direction of the eigenvectors, resulting in vectors 1610 and 1650 having the opposite direction. In other words, the inversion of 1650 represents each element (i.e., the x and y components) being the negative of the respective elements of the vector 1610. The inversion of the direction of the basis vector corresponds to each element of the vector having the same (or similar) magnitude but opposite sign as the respective elements of the previously generated basis vector. In the case of the basis vectors, there are more dimensions than shown in the examples of Figures 16A and 16B. For example, a feature map size of 136x72 indicates a basis vector with 9792 elements or dimensions.Thus, multiplying vector 1650 by negative one results in a vector having substantially the same values as vector 1610.
[0189] When the decomposition over the feature maps of the tensor 115 is performed repeatedly, the same problem of element-wise inversion of the resulting basis vectors occurs. Individual basis vectors can reverse their direction from time to time, even if the content of the basis vectors is substantially similar. This polarity inversion can occur for any basis vector, and its occurrence for a given basis vector is independent of its occurrence for other basis vectors. When compressing successive frames containing packed basis vectors, the inversion reduces the ability of inter prediction to achieve high coding efficiency, since the inverted regions corresponding to the inverted basis vectors are not easily recognized for efficient tool selection by the video encoder 614.
[0190] FIG. 17 illustrates a method 1700 for encoding successive feature maps from a given layer from a first portion of a CNN, where successive feature maps have the same dimensionality. The method 1700 operates such that the representation in the reduced dimensional space is stabilized with respect to directionality between invocations of the PCA. The method 1700 is particularly suited for processing video data, where the reduced dimensional representation needs to be regenerated multiple times, perhaps as frequently as once per frame, where there are correlations in successive video frames, resulting in correlations in the basis vectors generated by performing PCA on tensors from successive video frames. In such cases, the orientation of the resulting basis vectors may flip from one invocation to the next across all samples of the basis vector, despite the overall basis and sample-by-sample magnitudes in the basis vector remaining relatively unchanged. Such "polarity flips" may be due to instabilities in the basis vector generation process, or sensitivity to small changes in the input tensors. The method 1700 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. The method 1700 may be implemented by the destination device 140 as one or more software code modules of the application program 233, for example as a function of the PCA encoder 160, under execution of the processor 205. The method 1700 is repeated for each frame of video data encoded in the bitstream 143. The software code modules of the application program 233 implementing the method 1700 may be stored, for example, on the hard disk drive 210 and / or in the memory 206. The method 1700 begins with a first PCA execution step 1710.
[0191] In step 1710, the PCA encoder 160, under execution of the processor 205, generates a first set of basis vectors for a first tensor generated from the CNN backbone 114 processing a given frame from the video source 112. For example, the decomposition module 548 may receive the tensor 546. Control in the processor 205 proceeds from step 1710 to a basis vector storage step 1720.
[0192] In step 1720, PCA encoder 160, under execution of processor 205, stores the first set of basis vectors in memory 206 for use in a subsequent invocation of decomposition module 548. Control in processor 205 passes from step 1720 to a second PCA execution step 1730.
[0193] In step 1730, the PCA encoder 160, under the execution of the processor 205, generates a second set of basis vectors for a second tensor, the second tensor being generated from the CNN backbone 114 processing a frame subsequent to the given frame of step 1710 from the video source 112. Step 1730 operates similarly to step 1720, i.e., using the decomposition module 548. The subsequent frame may be the next frame provided by the video source 112, or it may be a subsequent frame. The basis vectors generated in step 1730 provide the components of the current tensor, while the basis vectors stored in step 1720 relate to the preceding tensor. If the generation of basis vectors is performed less frequently for every frame, the generation may be periodic (every N frames) or may be driven by some criteria regarding the content of the frame, such as when the frame content is deemed to contain significant new information. For example, further generation of basis vectors may be performed for detection of large motion or other significant changes compared to the previous frame provided by the video source 112. Due to correlation in the video frames from the video source 112, the first and second sets of basis vectors have some degree of correlation, making the basis vectors suitable for compression using the inter-prediction tools in the packed representation of Figures 12A and 12B. However, noise or other small variations between the first and second frames may result in various basis vectors of the second set of basis vectors being generated in the opposite "direction" (or flipped) compared to the respective basis vectors of the first set of basis vectors. Control in the processor 205 passes from step 1730 to a basis vector flip check step 1740.
[0194] The basis vectors generated in step 1730 provide the components of the current tensor, while the basis vectors generated in step 1710 provide the components of the preceding tensor representing a previous frame in the video data 113. In step 1740, the current basis vectors are tested to check for polarity inversion. Checking for polarity inversion involves testing the currently (step 1730) and the earlier or preceding (step 1710) generated basis vectors for a given coded layer or layers of the FPN to determine whether the vectors would remain substantially similar except for swapping or inverting the signs of each element in the basis vector. For a given basis vector (starting with the first or preceding vector in step 1710), a sum is determined. The sum is the result of first performing an element-wise addition of the respective vectors from the first and second sets of basis vectors. A sum of the absolute values of the sims resulting from the element-wise addition is determined for each basis vector to generate a similarity score, which is a single scalar value for each basis vector.
[0195] A low value of the similarity score for a given basis vector indicates a second basis vector of the set that is substantially similar but of opposite polarity to the corresponding basis vector in the first set of basis vectors. Thus, a low value of the similarity score is indicative of a polarity reversal in the basis vectors between successive performances of the decomposition. If the sum is below the threshold, a polarity reversal is detected ("YES" at step 1740) and control in the processor 205 passes from step 1740 to a basis vector reversal step 1750. If the sum is not below the threshold, a polarity reversal is not detected ("NO" at step 1740) and control in the processor 205 passes from step 1740 to a last basis vector test step 1760. The similarity threshold is typically predetermined. In some embodiments, the similarity threshold is linearly related to at least one of the width and height of the current tensor, for example, 0.8 or 0.9 of the width and / or height. In other configurations, the similarity threshold may be equal to the log2 of the area of one channel of the tensor. The similarity threshold may be determined based on factors such as the filtered similarity score representing the non-inversion case. A median filter may be applied to the similarity scores to filter out outliers (e.g., low scores indicating polarity inversion). The median filtered similarity scores may then be scaled and compared to the similarity scores of a given frame to detect polarity inversion. Filtering may be performed on a per-basis-vector and per-layer granularity to account for different statistics between basis vectors and layers. Variations in the similarity scores as a result of expected content changes and content variations may be tolerated. Tolerance in setting the threshold may be based on the decomposition method used, etc.
[0196] In a basis vector inversion step 1750, the PCA encoder 160, under execution of the processor 205, inverts the polarity of the currently processed basis vector, for example by multiplying the vector by -1 (negative one), to generate an updated basis vector. In effect, an updated set of components from the current basis vector is generated, such that the components in the updated set of components are the inverse of the respective components in the basis vector generated in step 1730. As a result of this inversion, the current basis vector becomes substantially similar to the corresponding basis vector from the first set of basis vectors. Once the inversion is performed, if no further polarity inversion is performed in the next decomposition operation, the basis vector needs to continue to be inverted from subsequent decomposition operations to maintain a consistent polarity with the inverted basis vector of the current decomposition operation. A set of flags, one flag per basis vector, is used to indicate the inversion status of each basis vector for future basis vector generation operations, for example, to provide persistence of the basis vector inversion step for subsequent frames. A flag for the current basis vector is toggled or changed in the set of flags to indicate that a polarity reversal has occurred, allowing processing to start the inversion when a polarity reversal is first detected and stop the inversion when a second polarity reversal is detected. The set of flags provides a basis for whether components generated using any subsequent tensor decomposition functions should be inverted. Control in processor 205 passes from step 1750 to a last basis vector test step 1760.
[0197] In step 1760, processor 205 tests whether the current vector being processed is the last vector in the set of basis vectors. If not ("NO" at step 1760), processing proceeds to the next basis vector in the set of basis vectors and control in processor 205 proceeds from step 1760 to step 1740. If so ("YES" at step 1760), processing proceeds from step 1760 to a basis vector encoding step 1770.
[0198] In step 1770, the encoder 160, under execution of the processor 205, operates on the final basis vectors, which include the updated basis vectors for vectors for which inversion was performed in step 1750 and the basis vectors from the second set of basis vectors for vectors for which inversion was not performed. This final set of basis vectors is stored as a reference point for subsequent invocations of the method 1700, i.e., as the "first set of basis vectors". The final set of basis vectors is passed as basis vectors 550 to the quantizer module 552 and encoded by the sub-picture encoder 556. Furthermore, if inversion is performed once, a flag for each component indicates that in subsequent invocations of the method 1700, inversion needs to be performed for the respective component to ensure that the polarity matches that of the previous invocation of the method 1700. If inversion is detected a second time in the subsequent invocation of the method 1700, the flag is toggled, resulting in the stopping of inversion of the respective component upon further invocations of the method 1700. The method 1700 then terminates for the current frame and may be called again for the next frame, or a later frame, where the PCA encoder 160 is run less frequently than every frame.
[0199] Figure 18A is a schematic block diagram illustrating an example implementation 1800 of a module 162 for combining tensors from different FPN layers using either an upsampling or downsampling operation. The example of Figure 18A uses the P2-P5 layers from the CNN backbone portion 400. Layer P6 429 is omitted from consideration because the PCA decoder 170 can reconstruct the P6 layer from the decoded P5 layer. The example shown in Figure 18A is for resampling of one of P2 or P3 and is described with reference to Figure 19 below.
[0200] FIG. 18B is a schematic block diagram illustrating an implementation 1890 of a module 172 for extracting tensors from a composite representation back into separate tensors corresponding to FPN layers using either an upsampling or downsampling operation. The Tej example in FIG. 18B provides an exemplary P2-P5 layer for a CNN head 1100. Layer P6 1118 is derived by performing a max pooling operation on layer P5 1116 and therefore does not need to be compressed or decompressed. The example shown in FIG. 18B is for the case shown in FIG. 18A where P2 and P3 are combined, and is described with reference to FIG. 20 below.
[0201] FIG. 19 illustrates a method 1900 for resampling a tensor from a multi-layer first portion of a CNN for decorrelation with another tensor from the multi-layer first portion of the CNN. The method 1900 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1900 may be implemented by the source device 110 as one or more software code modules of an application program 233 under execution of the processor 205. The method 1900 is repeated for each frame of video data encoded in the bitstream 143. The software code modules of the application program 233 implementing the method 1900 may be stored, for example, in the hard disk drive 210 and / or memory 206. The method 1900 begins with a tensor mapping determination step 1910.
[0202] In step 1910, the tensor combiner 162, under the execution of the processor 205, determines whether tensors (of the tensor 115a) from two different layers of the FPN are to be combined. Combining typically occurs when the tensor 115a has at least a first set of feature maps having a first size and a second set of feature maps having a second size different from the first size. If not combined, the tensor 115a is passed through unchanged. If the tensors are to be combined, the tensor combiner 162 determines whether the tensors are to be combined by performing downsampling of the larger tensor or upsampling of the smaller tensor, or whether the tensors are to be combined without resampling. The upsampling and downsampling options are available when the tensor 115a contains at least two tensors, the widths and heights of the two tensors being two-fold related, i.e., generated from a layered network with strides equal to the two operations involved. The option to concatenate without resampling is available when tensor 115a contains at least two tensors and the two tensors have the same width and height. The dimensionality of tensor 115a is set by the network architecture and the split point, so the options available to tensor combiner 162 are constrained by the network architecture and the choice of split point. If tensor 115a contains only one tensor, there is no scope for combining tensors and the only option for tensor combiner 162 is to pass tensor 115a through unchanged as tensor 115. If downsampling or upsampling to a tensor of the same width but half or twice the height is evaluated, the resample_vertical_only_flag syntax element indicates the application of resampling in the vertical direction only. If downsampling or upsampling to a tensor of the same height but half or twice the width is evaluated, the resample_horizontal_only_flag syntax element indicates the application of resampling in the horizontal direction only.The options for resampling only vertically or only horizontally allow for tensor combinations in different layers, where a stride equal to 2 is applied only vertically or only horizontally, as may be encountered in some CNN architectures.
[0203] If a larger tensor is downsampled, the details in the larger tensor are lost. Thus, downsampling is more suitable for data lacking details, such as frame data 113 that contains mainly large objects. If it is determined that the frame data 113 contains smaller details, the processor 205 does not choose to downsample the larger tensor. Regardless of whether downsampling or upsampling, the result of combining tensors from two different layers before applying compression based on cross-channel decomposition is the ability to find redundancies across layers. If each layer is encoded independently by the PCA encoder 160, redundancies across channels of each tensor are found, but redundancies across layers cannot be found. If redundancies across layers are identified, the total number of basis vectors required to code a tensor combining two different FPN layers may be lower than the number of basis vectors allocated to the tensors of each FPN layer, where the tensors are not combined into a single layer. If a smaller tensor is upsampled, an advantage is seen in terms of exploiting inter-layer redundancy, resulting in little or no need to increase the number of basis vectors of the combined tensor. In the case of a layered network where the width and height between the two layers are the same (but the channel count may differ), the tensor combiner 162 may attempt to find cross-layer redundancies without resampling the tensors from the two layers with the same width and height. The processor 205 may try options to combine without resampling, upsampling, or downsampling, leaving the tensors unmodified, and select the option that results in the lowest coding cost for the resulting tensor 115. In other configurations, step 1910 may set a predetermined default behavior for whether resampling is performed. The mapping determined in step 1910 may be a predetermined mapping, or may be determined more periodically, such as every frame. If the mapping is predetermined, the mapping needs to be signaled only at the start of the bitstream.The layer_update_mapping_info syntax element in the SEI message 1313 allows a signaling instance of the SEI message 1313 in which the mapping should be communicated to the destination device 140. For a given mapping, one signaling instance of the mapping of the first picture 1200 of the CLVS is sufficient. Control in the processor 205 passes from step 1920 to a tensor mapping encoding step 1920.
[0204] In step 1920, the tensor combiner 162, under execution of the processor 205, encodes the decision resulting from the operation of step 1920 into the bitstream 121. The encoded decision represents the operation that needs to be performed in the tensor separator 172 to reverse the operation performed in the tensor combiner 162. The decision to upsample, downsample, or leave the FPN layer unchanged is encoded in the SEI message 1313 using either a flag or a variable length codeword. The syntax for encoding the decision made in step 1910 into the bitstream 121 is described with reference to Appendix A. The syntax encodes the operation to be performed in the tensor separator 172 such that the tensor 149 has the same number, dimensions, and channel count as the tensor 115a, i.e., before the operation of the tensor combiner 162. If the tensor is upsampled and combined with another tensor by tensor combiner 162, the signaling indicates that tensor separator 172 extracts two tensors from the decoded combined tensor. One of the extracted tensors is output as one of tensors 149, and the extracted tensor is downsampled to generate an additional tensor included in tensor 149. If the tensor is downsampled and combined with another tensor by tensor combiner 162, the signaling indicates that tensor separator 172 extracts two tensors from the decoded combined tensor. One of the extracted tensors is output as one of tensors 149, and the other is upsampled to generate an additional tensor included in tensor 149. If a tensor was not resampled by tensor combiner 162, but was combined with another tensor, the signaling indicates that tensor separator 172 extracts two tensors from the decoded combined tensor, both of which are output as tensors among tensors 149. An index to obtain the combined tensor, i.e., src_layer_idx, and an index to insert the resampled tensor, i.e., dst_layer_idx.The signaling of source and destination layer indices is flexible, for example, to support cases where concatenated layers are not adjacent between tensors 115a, or where a layer with half the spatial resolution of another layer appears earlier between tensors 115a, or later between tensors 115a. Coding in which upsampling is implemented specifies that feature maps that are upsampled at the time of encoding should be downsampled at the time of decoding, and vice versa. Control in the processor 205 passes from step 1920 to a tensor encoder mapping test step 1930.
[0205] In step 1930, if the decision made in step 1910 is to not combine tensors from different FPN layers of tensor 115a, method 1900 ends. Control in processor 205 returns to mean feature determination step 1420 of method 1400, where all tensors 115a are passed as tensors 115 for the remaining steps. If the decision made in step 1910 is to perform upsampling in tensor combiner 162 of tensors from FPN layers of tensor 115a, control in processor 205 passes from step 1930 to select tensor upsample step 1940. If the decision made in step 1910 is to perform downsampling in tensor combiner 162 of tensors from FPN layers of tensor 115a, control in processor 205 passes from step 1930 to select tensor downsample step 1950. If the decision made in step 1910 is to perform the concatenation in tensor combiner 162 of tensors among tensors 115a without applying a resampling filter, control in processor 205 proceeds from step 1958.
[0206] 18A, implementation 1800 receives inputs P3-P5 (1810-1813, respectively). Implementation 1800 includes a tensor upsampler 1822, a tensor downsampler 1831, concatenation modules 1818 and 1836, and a multiplexer 1844.
[0207] Upsampling is performed on the first tensor if the second size of the second set of feature maps (or tensors) is greater than the first size, or vice versa. In step 1940, the tensor upsampler 1822, under execution of the processor 205, upsamples a tensor, e.g., the P3 tensor 1811, from the tensor 115a to generate an upsampled P3 tensor 1824. The upsampled tensor 1824 may also be referred to as the set of upsampled feature maps 1824. The P3 tensor 1811 has a width w and a height h. The upsampled P3 tensor 1824 has a width 2d and a height 2h. The upsampling may be performed using an interpolation filter, a nearest neighbor filter, or other filters to generate the intermediate samples required for the upsampled P3 tensor 1824. Control in the processor 205 passes from step 1940 to a tensor concatenation step 1945.
[0208] In step 1945, the concatenation module 1818, under execution of the processor 205, concatenates the upsampled P3 tensor 1824 and the P2 tensor 1810 along the channel dimension to generate a concatenated tensor 1842. The concatenated tensor 1842 has a width 2w and a height 2h, and a channel count equal to the sum of the channel counts of the tensors 1824 and 1810. The multiplexer 1844 selects the tensor 1842 as the concatenated output tensor 1846. The tensors 1846, 1812, and 1813 are output as the tensor 115 for the remaining encoding steps. The method 1900 then ends, and control in the processor 205 resumes at step 1420 of the method 1400.
[0209] In step 1950, the tensor downsampler 1831, under execution of the processor 205, downsamples a tensor, e.g., the P2 tensor 1810, from the tensor 115a to generate a downsampled P2 tensor 1832. The P2 tensor 1810 has a width 2w and a height 2h. The downsampled P2 tensor 1832 is spatially downsampled to have half the width and half the height of the P2 tensor 1810, resulting in dimensions w, h. The downsampling may be performed using a subsampled bilinear, bicubic, or other filtering operation. Because downsampling or other filtering is not applied to the channel dimensions of the P2 tensor 1810, the channel count of the downsampled P2 tensor 1832 is unchanged. Control in the processor 205 passes from step 1950 to a tensor concatenation step 1955.
[0210] In step 1955, the concatenation module 1836, under execution of the processor 205, concatenates the P3 tensor 1811 and the downsampled P2 tensor 1832 along the channel dimension to generate a concatenated tensor 1839. The concatenated tensor 1839 has width w and height h, and a channel count equal to the sum of the channel counts of the tensors 1811 and 1832. The multiplexer 1844 selects the tensor 1839 as the concatenated output tensor 1846. The tensors 1846, 1812, and 1813 are output as the tensor 115 for the remaining encoding steps. If resampling was performed, the output tensor 1846 includes a resampled set of feature maps and a set of non-resampled feature maps, as described in FIG. 18A with respect to the operation of the P2 and P3 and the concatenators 1818 and 1836. The method 1900 then ends and control in the processor 205 resumes at step 1420 of the method 1400.
[0211] In step 1958, the concatenation module 1823, under execution of the processor 205, concatenates tensor 1811 and tensor 1832 (both of which in this case have the same width and height) to generate a concatenated tensor 1838. The multiplexer 1844 passes tensor 1838 as a concatenated output tensor 1846. Tensors 1846, 1812, and 1813 are passed on as tensor 115 for the remaining encoding steps. The method 1900 then ends, and control in the processor 205 resumes at step 1420 of the method 1400.
[0212] Method 1400 continues performing steps 1420-14120, e.g., determining basis vectors using the tensor output in step 2070 in step 1480, deriving coefficients associated with both feature maps in the concatenated tensor using the basis vectors in step 14110, and encoding the coefficients and basis vectors in steps 1490 and 14120.
[0213] As a result of the operation of the method 1900, the concatenated tensor is passed as one of the tensors 149 that combine the two separate layers of the FPN. The concatenated tensor is compressed using a decomposition method such as PCA. The decomposition method can also decorrelate along the two layers of the FPN where the upsampling / downsampling occurs, and the decorrelation is not limited to each layer of the FPN. Furthermore, if details need to be preserved, the source device 110 has the option to upsample tensors from a smaller FPN layer, e.g., P3, for the purposes of basis vector derivation and compression. The number of basis vectors generated for the concatenation of the upsampled P3 layer with the P2 layer does not need to be increased compared to the number of basis vectors generated purely for the P2 layer. Therefore, no additional area of basis vectors in the picture 1200 for the P3 layer is required.
[0214] FIG. 20 shows a method 2000 for resampling a tensor from the decoded joint representation, i.e., tensor 149a, to generate an output tensor 149 for providing to the CNN head 150. The method 2000 is used in decoding a tensor from encoded data. The method 2000 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 2000 may be implemented by the destination device 130 as one or more software code modules of an application program 233 under execution of the processor 205. The method 2000 is repeated for each frame of video data encoded in the bitstream 143. The software code modules of the application program 233 implementing the method 2000 may be stored, for example, in the hard disk drive 210 and / or memory 206. The method 2000 begins with a tensor mapping decoding step 2010.
[0215] In step 2010, the entropy decoder 920, under the execution of the processor 205, decodes a syntax element from the SEI message 1313 included in the bitstream 143 that indicates whether the tensor 149a includes a combined resampled tensor. The decoder determines whether to perform resampling, for example, based on decoding information that specifies whether resampling occurred during encoding or based on a default setting. That is, the entropy decoder decodes whether one of the tensors is a concatenation of a tensor from one FPN layer with a resampled (upsampled or downsampled) version of a tensor from another FPN layer, as implemented in the encoding of FIG. 19. The method 2000 is performed when the decoding of the basis vectors and coefficients in steps 1540 and 1550 has already been performed and the tensor has been derived in step 1570. The combined tensor may be a concatenation of tensors with the same final width and height, or there may be no concatenated tensor present in the tensor 149a.
[0216] The signaling in the SEI message 1313 indicates the operations that need to be performed by the tensor separator 172 to recover the tensor 149, i.e., to generate a set of tensors having the same number and dimensions as the tensor 115a suitable for use by the CNN head 150. If the tensor combiner 162 is downsampling the tensor to generate the concatenated tensor, the signaling in the bitstream 143 instructs the tensor separator 172 to upsample a portion of the concatenated tensor to recover the tensor. If the tensor combiner 162 is upsampling the tensor to generate the concatenated tensor, the signaling in the bitstream 143 instructs the tensor separator 172 to downsample a portion of the concatenated tensor to recover the tensor. If tensor combiner 162 has not resampled a tensor to generate the concatenated tensor, signaling in bitstream 143 instructs tensor separator 172 to extract a portion of the concatenated tensor to recover the tensor without applying a resampling filter. The extraction of a tensor from a concatenated tensor is determined from the decoded layer_extraction_flag syntax element. The application of a downsampling filter to the extracted tensor is signaled via the layer_downsample_flag syntax element. The application of an upsampling filter to the extracted tensor is signaled via the layer_upsample_flag. Which tensors among tensors 149a are concatenated tensors is signaled via the src_layer_idx syntax element. The offset at which the extracted tensor is inserted to generate tensor 149 is signaled via the dst_layer_idx syntax element. The channel index that delineates the boundary in the concatenated tensor between the two layers is signaled via the src_channel_offset syntax element. Control in the processor 205 passes from step 2010 to a tensor decoder mapping test step 2020.
[0217] In step 2020, if the result of step 2010 indicates that remapping is not applied, control in the processor 205 passes from step 2010 to a tensor output step 2070. If the result of step 2010 indicates that tensor downsampling should be applied, control in the processor 205 passes from step 2020 to a tensor extraction step 2030. If the result of step 2010 indicates that tensor upsampling should be applied, control in the processor 205 passes from step 2020 to a tensor extraction step 2050. If the result of step 2010 indicates that tensor extraction without resampling is applied, control in the processor 205 passes from step 2020 to a tensor extraction step 2035.
[0218] The implementation 1890 of Figure 18B receives inputs P2 / 3, P4 and P5 (1850, 1852 and 1854, respectively). Input P2 / 3 is, for example, a combined tensor generated by upsampling or downsampling on the encoding side by operations of the method 1900. The implementation 1890 includes a tensor slicer 1856, a downsampler 1862, an upsampler 1864 and selectors 1870 and 1872.
[0219] In step 2030, tensor slicer 1856, under execution of processor 205, slices combined P2 / P3 tensor 1850 along the channel dimension (at an index according to src_channel_offset) into two tensors, each with a channel count corresponding to the channel counts of the P2 and P3 layers, i.e., 256 channels. Tensor slicer 1856 outputs a first sliced tensor 1858 and a second sliced tensor 1860. Control in processor 205 passes from step 2030 to an extract tensor downsample step 2040.
[0220] In step 2035, the tensor slicer 1856, under execution of the processor 205, slices the combined P2 / P3 tensor 1850 into two tensors along the channel dimension (at an index according to src_channel_offset. The tensor slicer 1856 outputs the first sliced tensor 1858 to the selector 1870 and outputs the second sliced tensor 1860 to the selector 1872. Control in the processor 205 passes from step 2035 to a tensor output step 2070.
[0221] In step 2040, the downsampler 1862, under execution of the processor 205, downsamples the tensor 1858 to derive a rescaled tensor 1866. The rescaled tensor provides a set of feature maps used to decode the combined tensor, and the downsampler 1862 may use decimation, or a subsampled bilinear or bicubic or other filter to generate the rescaled tensor 1866. Control in the processor 205 passes from step 2040 to a tensor output step 2070.
[0222] In step 2050, tensor slicer 1856, under execution of processor 205, slices the combined P2 / P3 tensor 1850 along the channel dimension into two halves, each with a channel count corresponding to the channel count of the P2 and P3 layers, i.e., 256 channels. Tensor slicer 1856 outputs a first sliced tensor 1858 and a second sliced tensor 1860. Control in processor 205 passes from step 2050 to an extract tensor upsample step 2060.
[0223] In step 2060, the upsampler 1864, under execution of the processor 205, upsamples the tensor 1860 to generate a rescaled tensor 1868. The upsampling may use bilinear, bicubic, nearest neighbor, or other filter methods to derive the interpolated samples needed to populate the rescaled tensor 1868. Control in the processor 205 passes from step 2060 to a tensor output step 2070.
[0224] Steps 2040 and 2060 operate to derive a first set of feature maps by resampling (downsampling and upsampling, respectively) a first portion of the tensor derived in steps 2030 or 2050 to decode tensor 149a.
[0225] In step 2070, the output tensor 149 is provided for use by the CNN head 150. The P5 tensor 1854 and the P4 tensor 1852 are passed from tensor 149a to tensor 149. If no remapping or resampling operation was performed, the tensors corresponding to the P2 and P3 layers are passed from tensor 149a to tensor 149. If a remapping operation was performed, the P3 tensor 1882 and the P2 tensor 1880 are output as the corresponding FPN layers of the tensor 149. If downsampling was performed, the selector 1870 outputs the downsampled tensor 1866 as tensor 1882, and the selector 1872 outputs the tensor 1858 as tensor 1880. If upsampling was performed, the selector 1870 outputs the tensor 1860 as tensor 1882, and the selector 1872 outputs the tensor 1868 as tensor 1880. If resampling was performed, one of the output tensors 1880 and 1882 includes a resampled set of feature maps and a non-resampled set of feature maps, as described in FIG. 18B with respect to the operation of P2 and P3 and selectors 1870 and 1872. If resampling was not performed, selector 1870 outputs tensor 1860 as tensor 1882 and selector 1872 outputs tensor 1858 as tensor 1880. Method 2000 ends and control in processor 205 returns to method 1500.
[0226] In configurations of methods 1900 and 2000, step 1910 also determines which layers among P2-P5 should be upsampled or downsampled and selects a pair of adjacent layers, i.e., P2 and P3, P3 and P4, or P4 and P5. In step 1920, the selected pair of adjacent layers is encoded into bitstream 121. In step 2010, the selected pair of adjacent layers is decoded from bitstream 143 and the indicated tensor is reconstructed from the concatenated tensor.
[0227] FIG. 21 illustrates a method 2100 for determining basis vectors by the decomposition module 548 to encode a tensor 115 from a CNN backbone 114. The method 2100 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. The method 2100 is described with reference to the basis vector packing format information SEI message syntax present in Appendix A. Alternatively, as described below, the method 2100 may be implemented by the source device 110 as one or more software code modules of the application program 233 under execution of the processor 205. The method 2100 is repeated for each frame of video data encoded in the bitstream 121. The software code modules of the application program 233 implementing the method 2100 may be stored, for example, in the hard disk drive 210 and / or memory 206. The method 2100 begins with a maximum basis vector count encoding step 2110.
[0228] In step 2110, the entropy encoder 738, under the execution of the processor 205, encodes the value bv_max_cnt into the SEI message 1313. The value bv_max_cnt is encoded into the SEI message 1313 as part of the basis vector packing information 1391 corresponding to the number of basis vectors to be generated by the decomposition module 548 into the bitstream 121. The value bv_max_cnt indicates the maximum number of basis vectors of the tensor 115 that can be used to decompose the tensor. If no layer reduction occurs in the tensor combiner 162, one instance of bv_max_cnt is encoded for each FPN layer of the tensor 115. If the number of layers is reduced as a result of the tensor combiner 162, one bv_max_cnt value is encoded for each layer obtained in the reduced format, i.e., for each coded layer. Step 2110 only needs to be performed as an initialization step, and thus one or more bv_max_cnt values only need to be coded at an initialization or random access point in the bitstream 121. Further, in step 2110, the width and height of the basis vectors of each layer are coded as bv_width and bv_height in the SEI message 1313. A frame size is effectively determined for the coded data using the maximum number of basis vectors decoded in step 2110, the frame size being applicable to at least one frame of the coded data. Control in the processor 205 passes from step 2110 to a basis vector packing format determination step 2120.
[0229] In step 2120, the packer 610 for the sub-picture encoder 556 determines a packing format for the sub-picture 1216 and a size for the sub-picture 1216. The packing format and size are determined, for example, as shown with reference to FIG. 12B, such that basis vectors of a specified size and count bv_max_cnt for each tensor in the tensor 115 can be packed into the sub-picture 1216. Subsequent pictures (i.e., 1200) that contain packed basis vectors have the same size as determined in the first invocation of the method 2100, even if fewer basis vectors are used for the given picture. Thus, the sub-picture encoders (i.e., 514, 532, 556, and 572) use frames of the same size to encode successive sets of compressed tensors 115 and do not need to send new instances of the SPS 1310 to signal a change in picture resolution. Changing the picture resolution requires a reset of the frame buffer 772, which prevents subsequent pictures from referencing previous pictures in the frame buffer 772, as necessary for the inter prediction method to be used. Determining the size and packing format of the picture 1200 based on the maximum basis vector count allows inter prediction to be performed when the number of basis vectors utilized changes, since the frame buffer 772 does not need to be reset to accommodate a picture of an incompatible resolution. Thus, maintaining a fixed size of the picture 1200, even if the number of basis vectors packed changes, improves compression efficiency, since inter prediction can be used across the resulting packed picture. Control in the processor 205 passes from step 2120 to a basis vector set determination step 2130.
[0230] In step 2130, the decomposition module 548, under execution of the processor 205, generates a set of M basis vectors for each tensor of the tensor 115, where M corresponds to the value bv_max_cnt('M') of the respective tensor of the tensor 115. The value M may be set to a fixed value of 25 for a layer including 256 channels, such as P3 and P4. If two layers, such as P2 and P3, are concatenated in the combiner 162, the value M may be set to 50, corresponding to maintaining 25 basis vectors per layer of the tensor 115a, i.e., before any layer reduction from the tensor combiner 162. The M basis vectors of a tensor are an ordered set of principal components, each of which captures the maximum amount of variance of the tensor not already captured by the preceding principal components of the M basis vectors. The variance is "captured" or explained across the channel dimension of the tensor. Thus, the M basis vectors define a space in which each channel of a tensor may be represented with values that are fewer than the number of samples in a given channel of the tensor (i.e., width x height). The amount of variance explained by each basis vector is an eigenvalue. The M basis vectors have a corresponding set of M eigenvalues, which form a strictly decreasing array of numbers. Control in the processor 205 passes from step 2130 to an eigenvalue accumulation step 2140.
[0231] In step 2140, the decomposition module 548, under execution of the processor 205, generates an accumulated "explained variance" value for each value n, where n ranges from 1 to M. The accumulated explained variance value is equal to the sum of the eigenvalues from the first eigenvalue through the nth eigenvalue. The accumulated explained variance value indicates how much variance is explained by a subset of the total set of eigenvectors or principal components generated in step 2130. Control in the processor 205 passes from step 2140 to a basis vector subset determination step 2150.
[0232] In step 2150, the decomposition module 548, under execution of the processor 205, selects a subset of the basis vectors M that corresponds to an "explained variance threshold". The explained variance threshold determines the number of basis vectors used and can be selected to appropriately decompose the tensor according to the desired trade-off between accuracy, area, and coding efficiency. The explained variance threshold can be set based on the data in the basis vectors themselves, or based on the desired area or coding efficiency, or a minimum desired accuracy. The selection of the subset of basis vectors results in selecting the first N basis vectors of the M basis vectors, i.e., selecting the basis vectors from among the available (maximum) basis vectors. The explained variance threshold can be determined on a frame-by-frame basis, i.e., for each frame of data to be encoded. The selection of the subset omits basis vectors that contribute less to the reconstruction of the tensor due to their smaller contribution to the accumulated explained variance. The selection of the subset improves compression efficiency, since the sub-pictures 1216 have a smaller occupied area. The unoccupied areas of the sub-pictures 1216 can be occupied by constant sample values. Constant sample values are highly compressible due to the flexible block structure of VVC. Control in the processor 205 passes from step 2150 to a basis vector subset encoding step 2160.
[0233] In step 2160, the entropy encoder 738, under execution of the processor 205, encodes into the bitstream 121 a value bv_cnt of each tensor of the tensors 115. The value bv_cnt indicates the selected subset resulting from execution of step 2150. The value bv_cnt may indicate that the number of basis vectors 0 to N, i.e., the number of basis vectors used, may vary from 1 to M for a given tensor. Step 2160 encodes the number of basis vectors used to encode the tensor. The information specifying the number of basis vectors to be used may be considered to include the maximum number of basis vectors to be used as determined in step 2110 and the actual number of basis vectors to be used as determined in step 2150. The method 2100 ends and control in the processor 205 passes from step 2160 to step 1490, where in step 1490 a subset of the basis vectors is encoded in the bitstream.
[0234] FIG. 22 illustrates a method 2200 for decoding basis vectors used to encode tensors from a first portion of a CNN. The method 220 is used in decoding tensors from data encoded by the PCS encoder 160. The method 2200 may be implemented by an apparatus such as a configured FPGA, ASIC, or ASSP. The method 2100 is described with reference to the basis vector packing format information SEI message syntax present in Appendix A. Alternatively, as described below, the method 2200 may be implemented by the destination device 140 as one or more software code modules of the application program 233 under execution of the processor 205. The method 2200 is repeated for each frame of video data encoded in the bitstream 143. The software code modules of the application program 233 implementing the method 2200 may be stored, for example, in the hard disk drive 210 and / or memory 206. The method 2200 begins with a maximum basis vector count decoding step 2210.
[0235] In step 2210, the entropy decoder 920, under execution of the processor 205, decodes a bv_max_cnt syntax element from the SEI message 1313. The bv_max_cnt syntax element provides information that specifies or indicates the maximum number of basis vectors that may be used in packing the picture 1200. A separate maximum value may be decoded for each tensor in the combined representation resulting from the tensor combiner 162. In step 2210, the width and height of the basis vectors of each combined representation are also decoded from the SEI message 1313. The bv_max_cnt syntax element is decoded for a value that is retained for use by the first picture and subsequent pictures of a sequence of pictures until another instance of bv_max_cnt is indicated to be decoded from the bitstream 143. Another instance of bv_max_cnt may be indicated, for example, via a basis_vector_dimensions_update flag. Control in the processor 205 passes from step 2210 to a basis vector packing format determination step 2220 .
[0236] In step 2220, the unpacker 822, under execution of the processor 205, determines the spatial location of each basis vector when packed in the subpicture 1216 according to the basis vector width, height, and maximum number determined in step 2210. The basis vectors are generally packed first in a left-to-right manner, then in a top-to-bottom manner, proceeding through the ordered list of basis vectors. The basis vectors are generally packed in a contiguous, non-overlapping manner. If there are multiple layers, e.g., due to the use of FPN, the spatial location of the basis vectors of each layer is determined for the subpicture 1216. Step 2220 needs to be performed whenever bv_max_cnt is decoded from the bitstream 143, i.e., as indicated by the basis_vector_dimensions_update flag. When bv_max_cnt is not decoded from the bitstream 143, the packing configuration determined from performing step 2220 in an earlier invocation of the method 2200 may be reused. Control in the processor 205 passes from step 2220 to a basis vector subset decoding step 2230 .
[0237] In step 2230, the entropy decoder 920, under execution of the processor 205, decodes the bv_cnt syntax element from the SEI message 1313. The bv_cnt syntax element is decoded when the basis_vector_cnt_update, also decoded from the SEI message 1313, indicating an update of the basis vector count used needs to be conveyed to the destination device 140. Step 2230 operates to decode information indicating the number of basis vectors used for decoding. The information specifying the number of basis vectors to be used can be considered to include both the maximum number of vectors as derived in 2210 and the actual amount to be used as decoded in step 2230. Each layer in the tensor 115 may have a separate basis vector count. The signaled basis vector count indicates a value N, where N defines a subset that is the first N basis vectors of the M basis vectors selected to properly reconstruct the tensor according to a defined threshold. The use of a threshold to establish the number of basis vectors used allows for adaptation to the statistics of tensor 115. The bv_cnt syntax element can be determined or decoded on a frame-by-frame basis, i.e., for each frame of encoded data.
[0238] If fewer basis vectors are required to reach a specified quality level, i.e., a given accounted variance threshold, additional basis vectors may be omitted, improving compression efficiency. A threshold such as 98% or 99% may be used to retain the majority of the basis vectors. In most cases, all M basis vectors are retained, i.e., N is equal to M, but the value N may be reduced in a data-dependent manner. If lower quality is acceptable, a better bitrate or performance tradeoff is achieved by preferentially decreasing the threshold, i.e., increasing the quantization parameter, rather than further increasing the quantization step size. For example, a threshold of 85% reduces the bitrate, while increasing the QP to a higher level (e.g., a QP greater than 45) reduces task performance relatively more significantly, which may be preferred when a very bit-compressed rate is desired. A threshold of 95% reduces the bitrate with a moderate reduction in achievable task performance, and is suitable for use cases requiring performance between near-lossless compression and compression at a very low bitrate operating point. The thresholds and QPs may be jointly optimized to generate a "Pareto front," i.e., a bitrate or task performance frontier curve consisting of optimal threshold and QP values. Exhaustive testing of various threshold and QP values to derive this Pareto front is generally prohibitively expensive for the source device 110, and heuristic rules to indicate suitable values are desirable. Experiments show that for less significant bits per pixel (BPP), it is preferable to decrease the threshold instead of increasing the QP. Furthermore, the thresholds may be varied for different coding layers, e.g., for the FPN, or for the combined representation of the FPN obtained from the tensor combiner 162. Experiments show that more decomposed layers may be given slightly higher thresholds, achieving improved task performance at a relatively limited increase in bitrate. For example, thresholds of 90%, 94%, and 98% for the P2 / P3 concatenated layer, P4, and P5 layers of tensor 115 provide better performance than fixed thresholds such as 90% of 95% applied across all layers.The more decomposed layers (e.g., P4 and P5) have smaller areas compared to the less decomposed layers (e.g., P2 or P3). Thus, the incremental increase in packed area in the sub-picture 1216 is smaller than the similar additional basis vector count for the less decomposed layers. The maximum basis vector count may also be changed from layer to layer. Control in the processor 205 passes from step 2230 to a basis vector sub-picture decoding step 2240.
[0239] In step 2240, the picture decoder 804, under execution of the processor 205, decodes the sub-picture 1216, which contains the packed basis vectors. Step 2240 effectively derives the basis vectors from the encoded data in accordance with at least the information decoded in step 2230. Control in the processor 205 passes from step 2240 to a basis vector unpacking step 2250.
[0240] In step 2250, the unpacker 822, under execution of the processor 205, unpacks a number bv_cnt basis vectors from the sub-picture 1216 according to the number of basis vectors signaled to be used in the picture 1200 in step 2230. The number of basis vectors signaled to be used in the picture 1200 may be less than the maximum number of basis vectors given by the packing configuration determined in step 2220. Step 2250 derives basis vectors from the coded data according to information specifying at least the number of basis vectors to be used. If multiple layers are packed into the sub-picture 1216, the unpacking operates for each layer according to its respective basis vector count bv_cnt[layer_idx] value obtained from the SEI message 1313. The method 2200 ends and control in the processor 205 returns to the method 1500, where processing resumes at step 1550.
[0241] 23 is a schematic block diagram 2300 showing the relationship between tensors of different layers at a split point in the network and the resulting options for recovering from the encoded tensors from a tensor combiner such as tensor combiner 162. Combined tensor 2310 is the tensor of tensor 149a identified by src_layer_idx. From combined tensor 2310, either one or two output tensors, namely tensors 2320 and 2330, are output as part of tensor 149. Tensor 2320 remains at position src_layer_idx in tensor 149, and tensor 2330, if present, is inserted at position dst_layer_idx in tensor 149. FIG. 23 shows the spatial relationship of tensor 2330 compared to the width and height of tensor 2320 based on flags 2315 (i.e., layer_extraction_flag, layer_upsample_flag, layer_downsample_flag, resample_vertical_only_flag, resample_horizontal_only_flag), if present, decoded from the SEI message and described with reference to Appendix A. The flags 2315 are determined in step 1910 and encoded as layer mapping 1390 in step 1920. The flags 2315 are decoded in step 2010 to generate tensor 2320 and, if present, tensor 2330. The combined tensor 2310 has k1+k2 channels, where k1 corresponds to a channel of tensor 2320 and k2 corresponds to a channel of tensor 2330, and the boundaries are signaled using src_channel_offset. Flags 2315 provide signaling to enable various resampling options for the extracted tensor. Since tensor 149 must have the same dimensions as tensor 115a, the available combinations of flags 2315 that can be used depend on the dimensions of tensor 115a, which depends on the network and the split point.
[0242] In the configurations of the source device 110 and the destination device 140, the number of basis vectors to be packed or unpacked, i.e., bv_cnt, is expressed relative to the maximum number of basis vectors provided by the packing configuration, i.e., relative to bv_max_cnt. In general, most of the maximum available basis vectors (i.e., bv_max_cnt) may be used, and therefore the difference between bv_max_cnt and bv_cnt may be relatively small. When the difference between bv_max_cnt and bv_cnt is small, compression efficiency may be improved by encoding the difference between bv_max_cnt and bv_cnt using an exponential Golomb syntax element.
[0243] In the configuration of PCA encoder 160, sub-picture encoders 532 and 572 for average coefficients and coefficients applicable to basis vectors, respectively, are configured by QP controller 790 to apply a lower quantization parameter than that applied to encode the average feature or basis vector by sub-picture encoders 514 and 556, respectively. Each instance of QP controller module 790 in sub-picture encoders 532 and 572 can apply an offset to the base QP that is applied elsewhere, such as to the CU that encodes the basis vector. The QP offset can have a value such as minus 6 or minus 12, minus 18, or minus 24, or other value, to reduce the quantization step size used when encoding the residual of the average coefficient or coefficient applicable to the basis vector, such as in sub-pictures 1212 and 1214. Applying a QP offset to reduce the quantization step size of the sub-picture coding coefficients reduces the discrepancy between the decoded coefficients generated in the PCA decoder 170 compared to the coefficients generated by the forward transform (e.g., 524 and 564) in the PCA encoder 160. The coefficients have a multiplicative effect on the reconstruction of the feature maps due to the role of the coefficients in modulating the contribution of the respective mean feature or basis vector on the reconstructed feature map. Thus, the effect of lossy coding on the coefficients causes a substantial loss of fidelity in the reconstructed feature maps, adversely affecting the task performance in the CNN head 150. Therefore, the coefficients need to be coded at a higher quality level than the basis vectors. It is also possible to apply a fixed, relatively low QP to the sub-pictures or slices responsible for representing the coefficients. Since the coefficients occupy a relatively small area of the overall picture 1200, the increase in the bit rate used due to the use of a low QP is relatively small, and in any case, improves the fidelity of the reconstructed feature maps.The QP can be changed with finer granularity than the slice level by specifying an area known as a "quantization group" (QG), which corresponds to the maximum granularity of the area within each CTU for which the QP can be changed using the "delta QP" syntax element. Thus, when coefficients and basis vectors are to be coded in the same slice, delta QP provides another mechanism for coding the coefficients with greater precision than is required for the basis vectors.
[0244] The construction of the picture 1200 uses a division into tiles rather than subpictures. In the tiled construction, the mean feature map 1220, the mean coefficients 1222, the basis vectors 1226, and the basis vector coefficients 1224 are contained in separate tiles. The tiles can be independently coded in the PCA encoder 160 and decoded in the PCA decoder 170.
[0245] In another configuration of the PCA encoder 160 and the PCA decoder 170, the mean feature is applied uniformly to all feature maps of the tensor 115. In other words, all mean coefficients are assigned a value of "1" instead of being derived for each feature map by the dot product module 524. When the mean coefficient is assigned to "1", in the PCA encoder 160, the reconstructed mean feature map 522 does not need to be scaled by the mean coefficient, and therefore modules 524, 528, 532, 536, 540 are not required, and 522 is passed directly to module 544 as 542. In the PCA decoder 170, modules 832, 836, and 850 are not required, and the decoded mean feature map 848 is passed to the summation module 856 as 852. When the mean coefficient is assigned a value of "1", the sub-picture 1212 may be omitted from the picture 1200 since there is no need to encode a constant mean coefficient value. When sub-picture 1212 is omitted from picture 1200, sub-picture 1214 containing coefficients for the basis vectors may be increased in width compared to the minimum width required to pack the coefficients. The width of sub-picture 1214 may be set to 1.5 times the width of the packed coefficients (i.e., the maximum number of channels in the layer of packed tensor 115). Increasing the width of sub-picture 1214 results in picture 1200 having a wider aspect ratio, which is more suitable for the commonly encountered aspect ratios of individual basis vectors, and therefore less unused area in picture 1200. Sub-pictures 1210, 1214, and 1215 may be adjusted in width to maintain picture structure, such that the entirety of picture 1200 is occupied by sub-pictures. The use of constant average coefficients also eliminates the need for associated quantization and dequantization. The use of a constant mean factor still serves the purpose of “zero-centering” tensor 115 before the forward transformation (dot product) on the derived basis vectors, which is necessary to maintain the invertible operation of the forward and inverse transformations (projections).
[0246] The methods presented herein allow for efficient representation of tensors in a format suitable for compression using modern block-based compression standards such as VVC or HEVC. Block-based compression is not intuitively applicable to data such as coefficients for projecting basis vectors to reconstruct feature maps, but reveals additional unexpected redundancies within blocks, such as by using various transformations, including trained quadratic transformations. Although the methods presented herein are described with reference to the "Fast RCNN" and "YOLOv3" network architectures, and a particular division of these networks into "backbone" and "head" portions, the methods are applicable to any neural network operating on multidimensional tensor data, and to different divisions of such networks into "backbone" and "head" portions.
[0247] Industrial Applicability The described arrangements are applicable to the computer and data processing industries, and in particular to digital signal processing for encoding and decoding of signals, such as video and image signals, achieving high compression efficiency.
[0248] Also disclosed is an arrangement for quantizing floating-point tensor data within a group of channels or feature maps and packing the resulting integer values into a planar frame using a logarithmic quantization domain. Quantization and dequantization methods using a logarithmic quantization domain allow for greater compression efficiency due to no bits being spent on encoding exact values for large magnitude tensor values, where such precision does not result in further improvement of task performance for the network in use.
[0249] 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.
[0250] In the context of this specification, the word "comprising" means "including primarily, but not necessarily solely," or "having" or "including," and not "consisting only of." Variations of the word "comprising," such as "comprise" and "comprises," have correspondingly varying meanings.
[0251] Appendix A An example SEI message format and associated semantics for expressing metadata related to basis vector packing (i.e., 1391) in a bitstream is as follows:
[0252] [Table 1]
[0253] Basis Vector Packing Information Semantics The above syntax structure specifies the information necessary to unpack and convert a basis vector plane frame into basis vectors for projecting into a decoded tensor to perform an inference task.
[0254] A syntax element with the descriptor u(n) indicates that the syntax element is encoded using n bits and interpreted as an unsigned integer value. A syntax element with the descriptor ue(v) indicates that the syntax element is encoded as an exponential-Golomb value and interpreted as an unsigned integer value.
[0255] The persistence of a basis vector packing info SEI message is from the associated AU to the next occurrence of a basis vector packing info SEI message or the end of the CLVS. At the next occurrence of a basis vector packing info SEI message, the parameters are grouped based on the update flag. Parameters that are not updated (i.e., contained within a branch of the above syntax table and have the update flag of that branch set to zero) retain their previous value (if any).
[0256] A basis_vector_dimensions_update equal to 1 specifies the maximum basis vector count and basis vector dimension updates applicable to the current and subsequent frames, i.e., until the next occurrence of a Basis Vector Packing Information SEI message with basis_vector_dimensions_update equal to 1. It is a bitstream conformance requirement that the first instance of a Basis Vector Packing Information SEI message in CLVS have basis_vector_dimensions_update equal to 1.
[0257] NOTE: Typically, a basis vector packing information SEI message with basis_vector_dimensions_update equal to 1 is sent along with the first picture of a CLVS.
[0258] basis_vector_cnt_update equal to 1 specifies the update of basis vector count used applicable to the current and subsequent frames in CLVS. The basis vector count used indicates how many basis vectors of the maximum basis vector are used.
[0259] layer_cnt specifies the number of layers present in the frame.
[0260] bv_max_cnt[layer_idx] specifies the maximum number of basis vectors that may exist for layer_idx.
[0261] bv_width[layer_idx] specifies the width of the basis vectors for layer_idx.
[0262] bv_height[layer_idx] specifies the height of the basis vector map for layer_idx.
[0263] bv_cnt[layer_idx] specifies the number of basis vectors that exist for layer_idx. It is a bitstream conformance requirement that bv_cnt[layer_idx] be less than or equal to bv_max_cnt[layer_idx] for each value layer_idx in the range from 0 to layer_cnt-1. When bv_cnt[layer_idx] has not been decoded from the bitstream, the value bv_cnt[layer_idx] is set equal to bv_max_cnt[layer_idx] for layer_idx in the range from 0 to layer_cnt-1.
[0264] layer_update_mapping_info equal to one specifies updates to the configuration of tensor remapping determined by tensor combiner 162 and performed by tensor separator 172. When layer_update_mapping_info equal to zero, no updates to the configuration of tensor remapping are made and any previous configuration of tensor remapping continues to apply.
[0265] layer_extraction_flag equal to 1 specifies that the portion of the tensor corresponding to channel src_channel_offset relative to the last channel in the tensor is inserted into the list of tensors at dst_layer_idx from which tensors from layer src_layer_idx are extracted to generate the new layer. When layer_extraction_flag is equal to zero, no tensor extraction is performed, and as a result, tensor 149 is set equal to tensor 149a. If not previously parsed from the bitstream layer_extraction_flag is inferred to be zero.
[0266] layer_upsample_flag equal to 1 specifies that the portion of the tensor being extracted will be upsampled to produce a new tensor that is larger, e.g., twice the width and twice the height of the input tensor.
[0267] layer_downsample_flag equal to 1 specifies that the portion of the tensor being extracted will be downsampled to produce a new tensor that is smaller, e.g., has half the width and half the height of the input tensor.
[0268] It is a bitstream conformance requirement that layer_upsample_flag and layer_downsample_flag are not both equal to one in one instance of the basis vector packing information SEI message.
[0269] resampling_filter_idx specifies the type of filtering to be applied when resampling parts of a tensor to produce a new tensor. The resampling is applied horizontally, vertically, or both horizontally and vertically, according to resample_vertical_only_flag and resample_horizontal_only_flag. The following table lists the available filters:
[0270] [Table 2]
[0271] resample_vertical_only_flag equal to 1 specifies that the resampling operation is applied only in the vertical direction.
[0272] resample_horizontal_only_flag equal to 1 specifies that the resampling operation is applied only horizontally.
[0273] It is a bitstream conformance requirement that both resample_vertical_only_flag and resample_horizontal_only_flag are not equal to 1 in any instance of the basis vector mapping information SEI message.
[0274] src_layer_idx specifies which tensor of the portion of tensor 149a should be extracted from for resampling to generate the new tensor contained in tensor 149.
[0275] src_channel_offset specifies the channel offset into which the tensor identified by src_layer_idx is split. Channels 0 through src_channel_offset-1 of the tensor specified by src_layer_idx are preserved and output as the corresponding tensor in tensor 149. Channel src_channel_offset of the last channel of the tensor specified by src_layer_idx is subject to resampling, and the result is output as an additional tensor in tensor 149.
[0276] dst_layer_idx specifies the index at which the resampled tensor is inserted into tensor 149a to produce tensor 149. An index value of 0 specifies insertion at the beginning, i.e., creating a new first location, and an index value equal to layer_cnt specifies insertion after the last location, i.e., adding a new tensor and creating a new last location. Index values from 1 to layer_cnt-1 indicate insertion of the resampled tensor into a location between tensor 149a at positions dst_layer_idx and dst_layer_idx+1 to create tensor 149.
Claims
1. A step of decoding a frame from a bitstream, A step of decoding first information for determining the number of layers of tensors in the frame, The process of decoding second information for determining the width of a block within the frame, A step of decoding third information for determining the height of a block within the frame, A step of decoding a fourth piece of information for identifying the number of blocks in the frame, A step of deriving data having the width and height for the number of units indicated by the fourth information, based on the second information, the third information, the fourth information, and an unpacking process for unpacking the frame, A step of deriving one or more tensors having a number of channels greater than the number of data derived, based on the derived data. It has, A decoding method characterized in that the number of tensors in the one or more tensors is the same as the number of layers specified by the first information.
2. The decoding method according to claim 1, characterized in that the one or more tensors are multiple tensors.
3. The decoding method according to claim 2, characterized in that the width and height of one of the plurality of tensors are greater than the width and height indicated by the second information and the third information.
4. Means for decoding a frame from a bitstream, Means for decoding first information to identify the number of layers of tensors in the frame, means for decoding second information for determining the width of a block within the frame, means for decoding third information to determine the height of a block within the frame, Means for decoding fourth information for identifying the number of blocks in the frame, A means for deriving data having the width and height for the number of units indicated by the fourth information, based on the second information, the third information, the fourth information, and an unpacking process for unpacking the frame, A means for deriving one or more tensors having a number of channels greater than the number of data derived, based on the derived data. It has, A decoding device characterized in that the number of tensors in the one or more tensors is the same as the number of layers specified by the first information.
5. A non-temporary computer-readable storage medium for storing a program for executing a predetermined decoding method, wherein the predetermined decoding method is: The process of decoding the frame from the bitstream, A step of decoding first information for determining the number of layers of tensors in the frame, The process of decoding second information for determining the width of a block within the frame, A step of decoding third information for determining the height of a block within the frame, A step of decoding a fourth piece of information for identifying the number of blocks in the frame, A step of deriving data having the width and height for the number of units indicated by the fourth information, based on the second information, the third information, the fourth information, and an unpacking process for unpacking the frame, A step of deriving one or more tensors having a number of channels greater than the number of data derived, based on the derived data. It has, A non-temporary computer-readable storage medium characterized in that the number of tensors in the one or more tensors is the same as the number of layers specified by the first information.
6. A step of deriving data having width and height based on one or more tensors, and the number of data being less than the number of channels in the one or more tensors, The process of packing the aforementioned data into a frame, A step of encoding first information indicating the number of layers of the one or more tensors into a bitstream, A step of encoding second information indicating the width of the data within the frame into a bitstream, A step of encoding third information indicating the height of the data within the frame into a bitstream, A step of encoding a fourth piece of information indicating the number of the data within the frame into a bitstream. An encoding method characterized by having the following:
7. A means for deriving data having width and height based on one or more tensors, wherein the number of data is less than the number of channels in the one or more tensors. A means for packing the aforementioned data into a frame, Means for encoding first information indicating the number of layers of the one or more tensors into a bitstream, Means for encoding second information indicating the width of the data within the frame into a bitstream, Means for encoding third information indicating the height of the data within the frame into a bitstream, means for encoding a fourth piece of information indicating the number of the data within the frame into a bitstream. An encoding device characterized by having the following features.
8. A non-temporary computer-readable storage medium for storing a program for executing a predetermined encoding method, wherein the predetermined encoding method is: A step of deriving data having width and height based on one or more tensors, and the number of such data being less than the number of channels in the one or more tensors. The process of packing the aforementioned data into a frame, A step of encoding first information indicating the number of layers of the one or more tensors into a bitstream, A step of encoding second information indicating the width of the data within the frame into a bitstream, A step of encoding third information indicating the height of the data within the frame into a bitstream, A step of encoding a fourth piece of information indicating the number of the data within the frame into a bitstream. A non-temporary computer-readable storage medium characterized by having the following features.