Tool selection for feature map encoding vs regular video encoding
By selectively encoding and decoding CNN feature maps based on their presence, the method optimizes video data processing in edge devices, addressing computational challenges and ensuring efficient compression and privacy compliance.
Patent Information
- Application Number
- JP2025070796
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-04-07
- Filing Date
- 2025-04-22
- Publication Date
- 2025-07-30
- Estimated Expiration
- 2042-03-11
AI Technical Summary
Existing video compression technologies, such as VVC, face challenges in efficiently encoding and decoding tensors from convolutional neural networks (CNNs) due to high computational complexity and resource requirements, particularly in edge devices like smartphones and cameras, while maintaining effective compression performance.
A method and apparatus for generating and decoding encoded data that selectively uses different functions based on the presence of feature maps, optimizing the encoding and decoding process to reduce computational load and resource usage.
This approach enhances the efficiency of video data processing in edge devices by reducing computational overhead and maintaining effective compression performance, while ensuring compliance with privacy regulations like GDPR through secure storage of feature maps.
Smart Images

Figure 2025111610000001_ABST
Abstract
Description
Technical Field
[0001] Reference to Related Applications This application claims the benefit of 35 U.S.C § 119 based on the filing date of Australian Patent Application No. 2021202142, filed on Apr. 7, 2021, and is hereby incorporated by reference herein in its entirety as if fully set forth herein.
[0002] The present invention generally relates to digital video signal processing, and more particularly, to methods, apparatuses, and systems for encoding and decoding tensors from convolutional neural networks. The present invention also relates to a computer program product including a computer-readable medium having recorded thereon a computer program for encoding and decoding tensors from convolutional neural networks using video compression techniques.
Background Art
[0003] Video compression is a ubiquitous technology used to support many applications, including applications for the transmission and storage of video data. Many video coding standards have been developed, and others are currently under development. Recent developments in video coding standardization have led to the formation of a group called the "Joint Video Experts Team" (JVET). The Joint Video Experts Team (JVET) includes members from two standards setting organizations (SSOs), namely, Study Group 16, Question 6 (SG16 / Q6) of the Telecommunication Standardization Sector (ITU-T) of the International Telecommunication Union (ITU), also known as the "Video Coding Experts Group" (VCEG), and Working Group 11 (ISO / IEC JTC1 / SC29 / WG11) of the Joint Technical Committee 1 / Subcommittee 29 of the International Organization for Standardization / International Electrotechnical Commission, also known as the "Moving Picture Experts Group" (MPEG).
[0004] The Joint video Experts Team (JVET) developed a video compression standard called "versatile video coding" (VVC).
[0005] Convolutional Neural Networks (CNNs) are emerging technologies that address use cases involving machine vision, such as object recognition, object tracking, human pose estimation, and action recognition. CNNs typically include many layers, such as convolutional layers and fully connected layers, and data is passed from one layer to the next in the form of a "tensor". The weights of each layer are determined during the training stage, where a very large amount of training data passes through the CNN and the determined results are compared with the ground truth associated with 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 the desired level of accuracy. If the 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" also reduce the spatial size of the output tensor compared to the input tensor. Max pooling divides the input tensor into groups of data samples (e.g., 2×2 groups of data samples) and selects the maximum value from each group as the output for the corresponding value in the output tensor to generate the output tensor. The process of running the CNN with the input and progressively transforming the input to the output is generally called "inference".
[0006] Generally, a tensor has four dimensions, namely, batch, channel, height, and width. The first dimension "batch" of size "1" when inferring video data indicates that one frame passes through the CNN at a time. When training the network, the value of the batch dimension can be increased so that multiple frames pass through the network before the network weights are updated according to a given "batch size". A multi-frame video can be passed as a single tensor with a batch dimension whose size is increased according to the number of frames of a given video. However, due to practical considerations regarding memory consumption and access, the inference of video data is typically performed frame by frame. The "channel" dimension indicates the number of concurrent "feature maps" for a given tensor, and the height and width dimensions indicate the size of the feature maps at a particular stage of the CNN. The channel count varies through the CNN according to the network architecture. Also, the feature map size varies according to the subsampling that occurs at a particular network layer.
[0007] The input to the first layer of the CNN is typically an image or video frame that is resized for compatibility with the dimensions of the tensor input to the first layer. The dimensions of the tensor depend on the CNN architecture and generally have several dimensions related to the input width and height and an additional "channel" dimension.
[0008] Slicing the tensor based on the channel results in a set of so-called "feature maps", where each slice of the tensor has some relationship with the corresponding input image and is for capturing some characteristic such as an edge. At layers further away from the input to the network, the relationship can be more abstract. The "task performance" of the CNN is measured by comparing the result of the CNN when performing a task using a particular input with the provided ground truth (i.e., "training data"), which is generally prepared by humans and intended to show the "correct" result.
[0009] Once the network topology is determined, the weights of the network can be updated over time as more training data becomes available. It is also possible to re-train a portion of the CNN while leaving the weights in other parts (if any) of the network unchanged. The overall complexity of the CNN tends to be very high, with a large number of multiply-accumulate operations being performed, a large number of intermediate tensors being written to and read from memory. In some applications, the CNN is implemented entirely in the "cloud", requiring high and expensive processing power. In other applications, the CNN is implemented on edge devices such as cameras or mobile phones, where flexibility is lower but the processing load is more distributed.
[0010] VVC is expected to address the increasing market demand for service delivery over WANs with relatively high bandwidth costs, in particular, as the video format capabilities (e.g., having higher resolution and higher frame rate) increase, and to meet the continuous demand for ever higher compression performance. VVC is implementable in modern silicon processes, providing an acceptable trade-off between the achieved performance and the implementation cost. The implementation cost can be considered, for example, with respect to one or more of silicon area, CPU processor load, memory utilization, and bandwidth. Part of the generality of the VVC standard lies in the wide selection of tools available for compressing video data, as well as the wide range of applications for which VVC is suitable.
[0011] Video data includes a sequence of frames of image data, and each frame includes one or more color channels. Generally, one primary color channel and two secondary color channels are required. The primary color channel is generally referred to as the "luma" channel, and the secondary color channels are generally referred to as the "chroma" channels. Video data is typically displayed in the RGB (Red - Green - Blue) color space, but this color space has a high degree of correlation among its three respective components. The video data representation seen by an encoder or decoder often uses a color space such as YCbCr. YCbCr concentrates the luminance mapped to "luma" according to a transfer function in the Y (primary) channel and concentrates the chrominance in the Cb and Cr (secondary) channels. By using the uncorrelated YCbCr signal, 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 channels contain a relatively small number of significant coefficients for a given block compared to the coefficients of the corresponding luma channel blocks. Further, the Cb and Cr channels may be spatially subsampled, for example, horizontally by half and vertically by half, at a lower rate compared to the luma channel, known as the "4:2:0 chroma format". The 4:2:0 chroma format is commonly used in "consumer" applications such as Internet video streaming, broadcast television, Blu-Ray TM disk storage, etc. When only luma samples are present, the resulting monochrome frame is said to use the "4:0:0 chroma format".
[0012] The VVC standard defines a "block-based" architecture, where a frame is first divided into a square array of regions known as "Coding Tree Units" (CTUs). Generally, a CTU occupies a relatively large area, such as 128×128 luma samples. However, the CTUs at the right end and bottom end of each frame may have a smaller area. Associated with each CTU is a "Coding Tree" ("shared tree") for both the luma and chroma channels, or separate trees for each of the luma and chroma channels. The coding tree defines the decomposition of the CTU area 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, and in that case, a collection of collocated coding blocks is called a "Coding Unit" (CU) (i.e., each CU having coding blocks for each color channel). The CBs are processed in a specific order for encoding or decoding. As a result of using the 4:2:0 chroma format, a CTU having a luma coding tree for a 128×128 luma sample area has a corresponding chroma coding tree for a 64×64 chroma sample area collocated with the 128×128 luma sample area. When a single coding tree is used for the luma and chroma channels, a collection of collocated blocks for a given area is generally referred to as a "unit", such as the above-mentioned CU, as well as "Prediction Units" (PUs) and "Transformation Units" (TUs). A single tree having 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 above-mentioned CBs, as well as "Prediction Blocks" (PBs) and "Transformation Blocks" (TBs) are used.
[0013] Notwithstanding the above distinction between "unit" and "block", the term "block" may be used as a generic term for an area or region of a frame to which an operation is applied to all color channels.
[0014] For each CU, a prediction unit (PU) of the content (sample value) of the corresponding area of the frame data is generated ("prediction unit"). Further, an expression of the difference between the prediction and the content of the area seen as the input to the encoder (or "spatial area" residual) is formed. The difference in each color channel is converted as a sequence of residual coefficients and can be coded to form one or more TUs for a given CU. The transformation applied can be a discrete cosine transform (DCT) or other transformation applied to each block of residual values. The transformation is applied separately (i.e., the two-dimensional transformation is performed in two passes). The block is first transformed by applying a one-dimensional transformation to each row of samples within the block. The partial result is then transformed by applying a one-dimensional transformation to each column of the partial result, generating a final block of transformation coefficients that substantially decorrelates the residual samples. Transformations of various sizes are supported by the VVC standard, which includes the transformation of rectangular blocks, and each side dimension is a power of two. The transformation coefficients are quantized for entropy coding into the bitstream.
[0015] VVC features intra-frame prediction and inter-frame prediction. Intra-frame prediction involves the use of previously processed samples within the frame to generate a prediction of the current block of data samples within the frame. Inter-frame prediction involves generating a prediction of the current block of samples within the frame using a block of samples obtained from a previously decoded frame. The block of samples obtained from the previously decoded frame is often offset from the spatial position of the current block according to a motion vector to which filtering has been applied. Intra-frame prediction blocks can be (i) uniform sample values (“DC intra prediction”), (ii) a plane with an offset and horizontal and vertical gradients (“plane intra prediction”), (iii) a population of blocks with adjacent samples applied in a specific direction (“angular intra prediction”), or (iv) the result of matrix multiplication using adjacent samples and selected matrix coefficients. Further discrepancies between the predicted block and the corresponding input samples can be corrected to some extent by encoding the “residual” in the bitstream. The residual is generally transformed from the spatial domain to the frequency domain to form residual coefficients in the “primary transform domain,” which can be further transformed by the application of a “secondary transform” to generate residual coefficients in the “secondary transform domain.” The residual coefficients are quantized according to a quantization parameter, which results in a loss of accuracy in the reconstruction of the samples generated at the decoder but is accompanied by a reduction in the bitrate in the bitstream. Summary of the Invention
[0016] An object of the present invention is to substantially overcome or at least ameliorate one or more drawbacks of existing configurations.
[0017] According to one aspect of the present disclosure, an apparatus for generating first encoded data and second encoded data, determination means for determining whether the apparatus generates encoded data including encoded data of a feature map based on a neural network; When the device generates the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, encoding means for generating the first encoded data using a plurality of functions for encoding video data is provided, and when the device generates the second encoded data including the encoded data of the feature map, the encoding means generates the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions.
[0018] According to another aspect of the present disclosure, a device for decoding first encoded data and second encoded data, determination means for determining whether the device decodes the encoded data including the encoded data of the feature map based on a neural network, when the device decodes the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, decoding means for decoding the first encoded data using a plurality of functions for decoding video data is provided, and when the device decodes the second encoded data including the encoded data of the feature map, the decoding means decodes the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions.
[0019] According to another aspect of the present disclosure, a method for generating first encoded data and second encoded data, determining whether the device generates the encoded data including the encoded data of the feature map based on a neural network, when the device generates the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, generating the first encoded data using a plurality of functions for encoding video data, when the device generates the second encoded data including the encoded data of the feature map, generating the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions.
[0020] According to another aspect of the present disclosure, a method for decoding first encoded data and second encoded data, comprising: determining whether the device decodes the encoded data including the encoded data of the feature map based on a neural network; when the device decodes the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, decoding the first encoded data using a plurality of functions for decoding video data; when the device decodes the second encoded data including the encoded data of the feature map, there is provided a method of decoding the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions.
[0021] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing a program for executing a method for generating first encoded data and second encoded data, the method comprising: determining whether the device generates encoded data including the encoded data of the feature map based on a neural network; when the device generates the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, generating the first encoded data using a plurality of functions for encoding video data; when the device generates the second encoded data including the encoded data of the feature map, generating the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions. A non-transitory computer-readable storage medium is provided.
[0022] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing a program for executing a method for decoding first encoded data and second encoded data, the method comprising: Determining whether the device decodes encoded data including the encoded data of the feature map based on a neural network, When the device decodes the first encoded data in the form of encoded video data not including the encoded data of the feature map, decoding the first encoded data using a plurality of functions for decoding video data, When the device decodes the second encoded data including the encoded data of the feature map, decoding the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions, A non-transitory computer-readable storage medium is provided that includes:
[0023] Other aspects are also disclosed.
Brief Description of the Drawings
[0024] Next, at least one embodiment of the present invention will be described with reference to the following drawings and appendices.
Figure 1
Figure 2A
Figure 2B
Figure 3A
Figure 3B
Figure 3C
Figure 3D
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9A
Figure 9B
Figure 9C
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
[0025] In any one or more of the accompanying drawings, when steps and / or features having the same reference signs are referred to, those steps and / or features have the same function or operation for the purposes of this description, unless the contrary intention appears.
[0026] A distributed machine task system can include edge devices such as network cameras or smartphones that generate intermediate compressed data. The distributed machine task system can also include end devices such as server farm-based (``cloud'') applications that operate on the intermediate compressed data to produce some task result. Additionally, the edge device functionality may be embodied in the cloud, and the intermediate compressed data may potentially be stored for later processing for a plurality of different tasks as needed.
[0027] A convenient form of intermediate compressed data is a compressed video bitstream due to the availability of high-performance compression standards and their implementations. Video compression standards typically operate on integer samples of some given bit depth, such as 10 bits, arranged in a planar array. Color video has three planar arrays corresponding to color components Y, Cb, Cr, or R, G, B, depending on the application. A CNN typically operates on floating-point data in the form of a tensor, which generally has a much smaller spatial dimension compared to the incoming video data on which the CNN operates, but has more channels than the typical three channels of color video data.
[0028] Tensors typically have the following dimensions: frame, channel, height, and width. For example, a tensor of dimension [1, 256, 76, 136] is said to contain 256 feature maps, each of size 136×76. In the case of video data, inference is typically performed on one frame at a time, rather than using a tensor that contains multiple frames.
[0029] VVC encoders and decoders include an ability signaling mechanism known as "constraints". At the beginning of the bitstream, there is a set of constraints indicating which capabilities of the VVC standard are not used in the bitstream. Constraints are signaled along with the "profile" and "level" of the bitstream. The profile broadly indicates the set of tools that need to be available to decode the bitstream. Constraints also provide a fine-grained control of which tools are further constrained within the specified profile. The further constraint of tools is similar to "sub-profiling", but sub-profiles are defined outside the VVC standard and the general constraint flag semantics are defined within the VVC standard. Depending on the type of data being encoded by the video encoder, by defining (for example, equivalently to) a subset of tools as a sub-profile, the decoder can know before starting bitstream decoding that a subset of the coding tools of the indicated profile of the bitstream should be used.
[0030] FIG. 1 is a schematic block diagram showing the functional modules of a distributed machine task system 100. The system 100 can be used to implement a method for efficiently packing and quantizing feature maps into a planar frame for encoding and decoding feature maps from encoded data, such that the associated overhead data is not overly burdensome and the task performance of the decoded feature maps is resilient to changes in the bitrate of the bitstream.
[0031] System 100 includes a source device 110 for generating encoded data in the form of encoded video information. System 100 also includes a destination device 140. A communication channel 130 is used to communicate the encoded video information from the source device 110 to the destination device 130. In some configurations, one or both of the source device 110 and the destination device 140 may have respective mobile phone handsets (e.g., "smartphones") or network cameras and cloud applications. The communication channel 130 can be a wired connection such as Ethernet (registered trademark), or a wireless connection such as WiFi or 5G. Further, 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 hard disk drive within a file server.
[0032] As shown in FIG. 1, the source device 110 includes a video source 112, a CNN backbone 114, a feature map quantizer and packer 116, a multiplexer 118, a video encoder 120, and a transmitter 122. The 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. The video source 112 may also be the output of a computer graphics card, for example, displaying the video output of various applications and operating systems running on a computing device (e.g., a tablet computer). Examples of source devices 110 that may include an image capture sensor as the video source 112 include smartphones, video camcorders, professional video cameras, and network video cameras.
[0033] The CNN backbone 114 receives the video frame data 113 and executes specific layers of the overall CNN, such as the layers corresponding to the "backbone" of the CNN. The backbone layers of the CNN can generate, for example, multiple tensors corresponding to different spatial scales of the input image represented by the video frame data 113 as outputs. The "feature pyramid network" (FPN) architecture can provide three tensors corresponding to three layers output from the backbone 114 with various spatial resolutions and channel counts. The feature map quantizer and packer 116 receive the tensor 115 output from the CNN backbone 114. The feature map quantizer and packer 116 act to interface the internal layer of the overall CNN, which is the output of the CNN backbone 114, to the video encoder 120 by quantizing the floating-point values within the tensor 115 into data samples to be packed into the frame 119. The resolution of the frame 119 can be based on the total area of the feature map to be coded and the target aspect ratio. During packing, if excess unused areas occur within the frame 119, the frame size can be increased (e.g., the height can be increased), so that all feature maps can be placed within the frame 119. For example, the resolution of the frame 119 can be 2056×1224, and the bit depth of the frame 119 can be 10 bits. Determining the placement of the feature maps within the frame 119 needs to be performed only when the dimensions of the tensor 115 are established. Slicing the tensor 115 along the channel dimension results in extracting one feature map per channel, and the feature maps of a given tensor have specific sizes determined from the additional dimensions of the tensor. When the FPN is used, multiple tensors are generated for each incoming frame, including multiple sets of feature maps, and each set of feature maps has a different spatial resolution. The feature maps of all layers are packed into a planar video frame such as the packed feature map frame 117.When the multiplexer 118 is configured such that the source device 110 encodes video data, or when the source device 110 is configured to encode the feature map or frame data 113, it selects the packed feature map frame 117 and outputs the frame 119 to an encoding unit in the form of the video encoder 120. The selection between the feature map and normal video data is encoded in the bitstream using the "frame_type" syntax element within the metadata SEI message. The metadata SEI message is described with reference to Appendix A. The frame 119 is input to the video encoder 120, where irreversible compression is applied to the frame 119 to generate the bitstream 121. The bitstream 121 is supplied to the transmitter 122 for transmission via the communication channel 130, or the bitstream 121 is written to the storage device 132 for later use.
[0034] After conversion to a tensor by the CNN backbone 114, the content of the resulting feature map can no longer identify individuals who were clearly identifiable in the video data 113. Storing the feature map using the storage device 132 (e.g., in a compressed form) can be safer from a user privacy perspective, especially in relation to the requirements of the European General Data Protection Regulation (GDPR) for pseudonymization or anonymization.
[0035] The source device 110 supports a specific network for the CNN backbone 114. However, the destination device 140 may use one of several networks for the head CNN 150. In this way, the partially processed data in the form of the packed feature map can be stored for later use when performing various tasks without having to re-run the operation of the CNN backbone 114. The video encoder 120 uses a specific set of coding tools (or "profiles") of VVC to encode the frame data 119.
[0036] The bitstream 121 is transmitted by the transmitter 122 as encoded video data (or "encoded video information") over the communication channel 130. The bitstream 121 can be stored in the storage device 132 in some implementations, and the storage device 132 is a non-transitory storage device such as a "flash" memory or a hard disk drive until it is later transmitted over the communication channel 130 (or instead of transmission over the communication channel 130). For example, the encoded video data can be provided to a customer on demand over a wide area network (WAN) for a video streaming application.
[0037] The destination device 140 includes a receiver 142, a video decoder 144, a demultiplexer 146, a feature map unpacker and inverse quantizer 148, a CNN head 150, a CNN task 152, and a display device 160. The receiver 142 receives encoded video data from the communication channel 130 and passes the received video data as a bitstream to the video decoder 144 (indicated by arrow 143). Then, the video decoder 144 outputs the decoded frame data to the demultiplexer 146 (indicated by arrow 145). The decoded metadata 155 is also extracted from the bitstream 143 by the video decoder 144 and passed to the feature map unpacker and inverse quantizer 148. The decoded metadata 155 is typically obtained from the "Supplemental Enhancement Information" (SEI) message 1413 (see FIG. 14) present in the bitstream 143. Appendix A shows an exemplary syntax of the decoded metadata 155 along with the semantics of each exemplary syntax element. The decoded metadata 155 can be decoded and present in the bitstream of any frame. The decoded metadata 155 is present and decodable at a frequency less than all frames. For example, the decoded metadata 155 can be present and decodable only in intra pictures in the bitstream 143. When the decoded metadata 155 is not present for a given frame, the most recently available metadata is used. If the destination device 140 is configured to execute a CNN task as indicated by the "frame_type" syntax element in the SEI message 1413 of the bitstream 143, the frame data 145 is output as feature map frame data 147 to the feature map unpacker and inverse quantizer 148. Otherwise, if the destination device 140 is configured to perform decoding of video data, the frame data 145 is output as frame data 159 and supplied to the display device 160 for display as video. The feature map unpacker and inverse quantizer outputs the tensor 147 supplied to the CNN head 150.The CNN head 150 executes the layers subsequent to the task initiated by the CNN backbone 114 to generate the task result 151 stored in the task result buffer 152. Examples of the display device 160 include a cathode ray tube, a smartphone, a tablet computer, a computer monitor, or a liquid crystal display such as a stand-alone television set. The functionality of each of the source device 110 and the destination device 140 can also be embodied in a single device, examples of which include a mobile phone handset, a tablet computer, and a cloud application.
[0038] Notwithstanding the exemplary devices described above, each of the source device 110 and the destination device 140 can generally be configured within a general-purpose computing system through a combination of hardware components and software components. FIG. 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 can be configured as a video source 112, and a microphone 280, an output device including a printer 215, a display device 214 that can be configured as the display device 160, and a loudspeaker 217. The external modulator-demodulator (Modem) transceiver device 216 can be used by the computer module 201 to communicate with the communication network 220 via the connection 221. The communication network 220, which can represent the communication channel 130, can be a wide area network (WAN) such as the Internet, a cellular telecommunications network, or a private WAN. If the connection 221 is a telephone line, the modem 216 can be a conventional "dial-up" modem. Alternatively, if the connection 221 is a high-capacity (e.g., cable or optical) connection, the modem 216 can be a broadband modem. A wireless modem can also be used for a wireless connection to the communication network 220. The transceiver device 216 can provide the functions of the transmitter 116 and the receiver 142, and the communication channel 130 can be embodied in the connection 221.
[0039] Computer module 201 typically includes at least one processor unit 205 and a memory unit 206. For example, the memory unit 206 can have semiconductor RAM (random access memory) and semiconductor ROM (read only memory). Computer module 201 also includes an audio-video interface 207 coupled to a video display 214, loudspeakers 217 and a microphone 280, and an I / O interface 213 coupled 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, including several input / output (I / O) interfaces. The signal from the audio-video interface 207 to the computer monitor 214 is generally the output of a computer graphics card. In some implementations, the modem 216 can be incorporated within the computer module 201, for example, within the interface 208. Computer module 201 also has a local network interface 211 that enables the connection 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 Figure 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 with similar functionality. The local network interface 211 is an Ethernet TM circuit card, Bluetooth TMIt may have a wireless configuration, or an IEEE 802.11 wireless configuration, but a number of other types of interfaces can be implemented for interface 211. The local network interface 211 can also provide the functions of the transmitter 122 and the receiver 142, and the communication channel 130 can also be implemented in the local communication network 222.
[0040] The I / O interfaces 208 and 213 can provide either or both serial connectivity and parallel connectivity. The former is typically implemented according to the Universal Serial Bus (USB) standard and has a corresponding USB connector (not shown). A storage device 209 is provided, typically including a hard disk drive (HDD) 210. Other storage devices such as a floppy disk (registered trademark) drive or a magnetic tape drive (not shown) may also be used. The optical disk drive 212 is typically provided to function as a non-volatile source of data. For example, optical disks (e.g., CD-ROM, DVD, Blu ray Disc TM ) portable memory devices such as USB-RAM, portable external hard disks, and floppy disks can be used as a source of appropriate data for the computer system 200. Typically, any of the 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 stored for playback via the display 214. The source device 110 and the destination device 140 of the system 100 can be implemented in the computer system 200.
[0041] The components 205 - 213 of the computer module 201 typically communicate via an interconnected bus 204 to effect a conventional mode of operation of a computer system 200 known to those of ordinary skill in the art. For example, the processor 205 is coupled to the system bus 204 using connection 218. Similarly, the memory 206 and the optical disk drive 212 are coupled to the system bus 204 by connection 219. Examples of computers that can implement the described configuration include IBM-PC and compatibles, Sun SPARCstation, Apple Mac TM , or similar computer systems.
[0042] If appropriate or desirable, the video encoder 120 and video decoder 144, and the methods described below, may be implemented using the computer system 200. In particular, the video encoder 120, video decoder 144, and the methods described may be implemented as one or more software application programs 233 executable within the computer system 200. In particular, the steps of the video encoder 120, video decoder 144, and the methods described are performed by instructions 231 (see Figure 2B) within software 233 executed within the computer system 200. The software instructions 231 may be formed as one or more code modules for performing one or more specific tasks, respectively. The software may also be divided into two separate parts, with the first part and corresponding code modules performing the methods described, and the second part and corresponding code modules managing the user interface between the first part and the user.
[0043] Software can be stored, for example, on a computer-readable medium including a memory device 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 software or a computer program recorded thereon is a computer program product. The use of the computer program product in the computer system 200 preferably provides an advantageous apparatus for implementing the source device 110 and the destination device 140 and the method described.
[0044] Software 233 is typically stored in the HDD 210 or the memory 206. The software is loaded from the computer-readable medium into the computer system 200 and executed by the computer system 200. Thus, for example, the software 233 can be stored on an optically readable disk storage medium (e.g., CD-ROM) 225 read by the optical disk drive 212.
[0045] In some examples, the application program 233 may be supplied to the user encoded on one or more CD-ROMs 225 and read through the corresponding drive 212, or read by the user from the network 220 or 222. Further, the software can also be loaded from other computer-readable media into the computer system 200. 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 Disc TMIt includes computer-readable cards such as hard disk drives, ROMs or integrated circuits, USB memories, magneto-optical disks, or PCMCIA cards, etc., and these devices are internal or external to the computer module 201. Examples of temporary or non-tangible computer-readable transmission media that can 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 another computer or networked device, and the Internet or intranet including information recorded on email transmissions and websites, etc.
[0046] The second part of the application program 233 and the corresponding code module described above can be executed to implement one or more graphical user interfaces (GUIs) that are rendered or presented on the display 214. Typically, through the operation of the keyboard 202 and the mouse 203, the user of the computer system 200 and the application can operate the interface in a functionally adaptable manner to provide control commands and / or inputs to the application related to the GUI. Other forms of functionally adaptable user interfaces can also be implemented, such as an audio interface that utilizes speech prompts output via the loudspeaker 217 and user voice commands input via the microphone 280.
[0047] Figure 2B is a detailed schematic block diagram of the processor 205 and the "memory" 234. The memory 234 represents the logical collection of all memory modules (including the storage device 209 and the semiconductor memory 206) accessible by the computer module 201 of Figure 2A.
[0048] When 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 ROM 249 of semiconductor memory 206 in FIG. 2A. Hardware devices such as ROM 249 that store software are sometimes called firmware. The POST program 250 inspects the hardware within computer module 201 to ensure proper functionality and typically checks the processor 205, memory 234 (209, 206), and, similarly typically, the basic input / output system software (BIOS) module 251 stored in ROM 249 for correct operation. When the POST program 250 is executed successfully, the BIOS 251 boots the hard disk drive 210 in FIG. 2A. The booting of the hard disk drive 210 causes the bootstrap loader program 252 resident on the hard disk drive 210 to be executed via the processor 205. Thereby, the operating system 253 is loaded into the RAM memory 206 and the operating system 253 starts operating. The operating system 253 is a system-level application executable by the processor 205 and performs various high-level functions including processor management, memory management, device management, storage management, software application interface, and general-purpose user interface.
[0049] The operating system 253 manages the memory 234 (209, 206) to ensure that each process or application running on the computer module 201 has sufficient memory to execute without colliding with the memory allocated to another process. Further, the different types of memory available in the computer system 200 of FIG. 2A need to be used appropriately so that each process can be executed effectively. Thus, the aggregated memory 234 is not intended to indicate how specific segments of the memory are allocated (unless otherwise specified), but rather to provide a general view of the memory accessible by the computer system 200 and how such memory is used.
[0050] As shown in FIG. 2B, 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, which may also be referred to as a cache memory. The cache memory 248 typically includes several storage registers 244-246 within a register section. One or more internal buses 241 functionally interconnect these functional modules. The processor 205 also typically has one or more interfaces 242 for communicating with external devices via the system bus 204 using the connection 218. The memory 234 is coupled to the bus 204 using the connection 219.
[0051] The application program 233 includes a series of instructions 231 that can include conditional branch and loop instructions. Also, the program 233 may include data 232 used for 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, certain instructions can be stored in a single memory location as indicated by the instruction shown in memory location 230. Alternatively, the instructions can be segmented into several parts, each stored in a separate memory location, as indicated by the instruction segments shown in memory locations 228 and 229.
[0052] Generally, the processor 205 is provided with a set of instructions to be executed therein. The processor 205 waits for subsequent inputs that it reacts to by executing another set of instructions. Each input can be provided from one or more of several sources, all shown in FIG. 2A, 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 the corresponding reader 212. The execution of the set of instructions can, in some cases, result in the output of data. The execution can also involve storing data or variables in the memory 234.
[0053] The video encoder 120, the video decoder 144, and the described method can use input variables 254, which are stored in corresponding memory locations 255, 256, 257 in the memory 234. The video encoder 120, the video decoder 144, and the described method generate output variables 261, which are stored in corresponding memory locations 262, 263, 264 in the memory 234. Intermediate variables 258 can be stored in memory locations 259, 260, 266, and 267.
[0054] Referring to the processor 205 of FIG. 2B, the registers 244, 245, 246, the arithmetic logic unit (ALU) 240, and the control unit 239 cooperate to execute a sequence of micro-operations necessary to perform a "fetch, decode, and execute" cycle for each instruction within the instruction set that makes up the program 233. Each fetch, decode, and execute cycle includes: A fetch operation that fetches or reads the instruction 231 from the memory locations 228, 229, 230; A decode operation in which the control unit 239 determines which instruction was fetched, and An execution operation in which the control unit 239 and / or the ALU 240 execute the instruction.
[0055] Thereafter, further fetch, decode, and execute cycles for the next instruction may be performed. Similarly, a store cycle may be performed by the control unit 239 storing or writing a value to the memory location 232.
[0056] Each step or subprocess in the methods of FIGS. 15, 16, 17, and 18 described is associated with one or more segments of the program 233 and is typically executed by the register sections 244, 245, 247, the ALU 240, and the control unit 239 within the processor 205, and they cooperate to perform fetch, decode, and execute cycles for all instructions within the instruction set for the mentioned segments of the program 233.
[0057] FIG. 3A is a schematic block diagram showing functional modules of a backbone portion 310 of a CNN that can function as a CNN backbone 114. The backbone portion 114 is sometimes referred to as "DarkNet-53", but different backbones are possible, and as a result, the number and dimensions of the layers of the tensor 115 vary from frame to frame. The "backbone_id" syntax element within the SEI message 1413, described with reference to FIGS. 14 and Appendix A, indicates the type of the backbone. When the type of the backbone is unknown, the tensor dimensions are specified using the feature map count ("fm_cnt") for each layer and the feature map dimensions ("fm_width" and "fm_height") for each layer.
[0058] As seen in FIG. 3A, the video data 113 is passed to a resizer module 304 that resizes the frames to a resolution suitable for processing by the CNN backbone 310, generating resized frame data 312. If the resolution of the frame data 113 is already suitable for the CNN backbone 310, the operation of the resizer module 304 is unnecessary. The resized frame data 312 is passed to a convolutional batch normalisation leaky rectified linear (CBL) module 314, generating a tensor 316. The CBL 314 includes modules as described with reference to the CBL module 360 as shown in FIG. 3D.
[0059] The CBL module 360 receives the tensor 361 as input, which is passed to the convolutional layer 362 to generate the tensor 363. When the convolutional layer 362 has a stride of 1, the tensor 363 has the same spatial dimensions as the tensor 361. When the convolutional layer 362 has a larger stride such as 2, the tensor 363 has smaller spatial dimensions compared to the tensor 361. For example, the size of the stride of 2 is halved. Regardless of the stride, the size of the channel dimension of the tensor 363 can vary compared to the channel dimension of the tensor 361 of a particular CBL block. The tensor 363 is passed to the batch normalization module 364 that outputs the tensor 365. The batch normalization module 364 normalizes the input tensor 363 and applies scaling coefficients and offset values to generate the output tensor 365. The scaling coefficients and offset values are derived from the training process. The tensor 365 is passed to the leaky rectified linear activation ("LeakyReLU") module 366 to generate the tensor 367. The module 366 provides an "activation function" where positive values within the tensor are passed through and the magnitude of negative values is significantly reduced, e.g., to 0.1X of their previous values.
[0060] The tensor 316 is passed from the CBL block 314 to the residual block 11 module 320 that internally includes a concatenation of 11 residual units.
[0061] The residual block is described with reference to ResBlock340 shown in FIG. 3B. ResBlock340 receives tensor 341 zero-padded by zero-padding module 342 to generate tensor 343. Tensor 343 is passed to CBL module 344 to generate tensor 345. Tensor 345 is passed to residual unit 346, and residual block 340 includes a series of connected residual units. The last residual unit of residual unit 346 outputs tensor 347. The residual unit is described with reference to ResUnit350 as seen in FIG. 3C. ResUnit350 takes tensor 351 as input and passes it to CBL module 352 to generate tensor 353. Tensor 353 is passed to the 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 called a "shortcut" because the input tensor 351 substantially affects the output tensor 357. In the case of an untrained network, ResUnit350 acts on the pass-through tensor. When training is performed, CBL modules 352 and 354 operate to separate tensor 357 from tensor 351 according to the training data and the ground truth data.
[0062] The Res11 module 320 outputs a tensor 322, which is output as one of the layers from the backbone module 310 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, which is passed to the Res4 module 328 and is also output from the backbone module 310 as one of the layers. The Res4 module is a residual block (i.e., 340) that includes four residual units (i.e., 350). The Res4 module 324 generates a tensor 329 that is output from the backbone module 310 as one of the layers. Collectively, the layer tensors 322, 326, and 329 are output as tensor 115. The backbone CNN 310 can take a video frame with a resolution of 1088×608 as input and generate three tensors corresponding to three layers, having the following dimensions: [1, 256, 76, 136], [1, 512, 38, 68], [1, 1024, 19, 34]. The overall CNN shown in FIGS. 3 and 9 may be divided as shown, but other divisions of the overall CNN are possible. The tensors output from the first convolution in the CBL blocks 912, 926, and 940 (i.e., tensor 363 in each respective CBL module) can be tapped as output from the backbone, in which case the upscaler modules 922 and 936 and the first convolution of the CBL modules 912, 926, and 940 are included in the backbone CNN 310. The resulting dimensions of the tensors are [1, 512, 34, 19], [1, 256, 68, 38], [1, 128, 136, 76]. When all the layers and operations of the YOLOv3 network are enumerated, the tapping tensors 363 in the CBL modules 912, 926, and 940 correspond to the tapping tensors in the 75th module, 90th module, and 105th module, respectively, in the YOLOv3 network.The resulting tensor has half the number of feature maps at each resolution compared to the "Darknet-53" outputs (i.e., 322, 326, and 329).
[0063] FIG. 4 is a schematic block diagram showing the functional modules of an alternative backbone portion 400 of a CNN that can function as the CNN backbone 114. The backbone portion 400 implements a residual network with a Feature Pyramid Network (“ResNet FPN”) and is an alternative to the CNN backbone 114. Frame data 113 is input and passes through a stem network 408, a res2 module 412, a res3 module 416, a res4 module 420, a res5 module 424, and a max pool module 428 via tensors 409, 413, 417, 425, and the max pool module 428 generates a tensor 429 as output. The stem network 408 includes a 7x7 convolution with a stride of 2 and a max pooling operation. The res2 module 412, res3 module 416, res4 module 420, and res5 module 424 perform convolution operations and LeakyReLU activations. Each of the modules 421, 416, 420, and 424 also halves the resolution of the processed tensor via a stride setting of 2. Tensors 409, 413, 417, and 425 are passed to 1x1 lateral convolution modules 440, 442, 444, and 446 to generate tensors 441, 443, 445, and 447. Tensor 441 is passed to a 3x3 output convolution module 470 to generate an output tensor P5 471. Tensor 441 is also passed to an upsample module 450 to generate an upsampled tensor 451. Summation module 460 sums tensors 443 and 451 to generate tensor 461, which is passed to an upsample module 452 and a 3x3 lateral convolution module 472. Module 472 outputs a P4 tensor 473. Upsample module 452 generates an upsampled tensor 453. Summation module 462 sums tensors 445 and 453 to generate tensor 463, which is passed to a 3x3 lateral convolution module 474 and an upsample module 454. Module 474 outputs a P3 tensor 475.The upsampler module 454 outputs the upsampled tensor 455. The sum module 464 sums tensors 447 and 455 to generate tensor 465, which is passed to the 3x3 horizontal convolution module 476. Module 476 outputs the P2 tensor 477. The upsampler modules 450, 452, and 454 use nearest neighbor interpolation due to low computational cost. Tensors 429, 471, 473, 475, and 477 form the output tensor 115 of the CNN backbone 400.
[0064] FIG. 5 is a schematic block diagram showing the feature map quantizer and packer 116 as part of the distributed machine task system 100. The tensor 115 from the CNN backbone 114 is input to the group determination module 510, the range determination module 514, and the quantizer module 518. In other words, the quantizer module 518 implements a mapping function or transfer function from floating-point values to integer values. The group determination module 510 assigns the feature maps (channels) of the input tensor 115 to the feature map groups 512 based on a predetermined criterion or some measure of the data present in the tensor 115. The feature map groups 512 may span tensors of different layers or may be limited to individual layers. The feature map groups 512 are passed to the range determination module 514 and output as part of the metadata 125. The range determination module 514 determines, for each group, a quantization range indicating the maximum amplitude value present in the feature maps belonging to that group and generates the quantization range 516. The range determination module 514 can determine a new quantization range for all frames or, for example, only on intra-pictures and at a lower frequency.
[0065] The bitstream 121 includes a "qr_update" flag in the metadata (see Appendix A) indicating whether the quantization range has been updated. Using a single quantization range, it is possible to represent the maximum magnitude of any value before quantization within the feature maps of the group to which the quantization range belongs. In another arrangement, separate quantization ranges for the maximum positive value within the feature map group and the maximum negative value within the feature map are used, resulting in an asymmetric quantization range having two values per group.
[0066] The tensor 115 generally has 32-bit floating-point precision values, and thus each quantization range is also a floating-point value. Other floating-point precisions such as 16 bits and 8 bits are possible, as are various bit allocations for the exponent and fractional parts of the floating-point value.
[0067] The quantization range 516 is passed to the quantizer module 518 and output as part of the metadata 125. The quantizer module 518 quantizes the sample values of each feature map in two steps. First, the feature map values are normalized using the quantization range of the feature map group to which the feature map belongs, obtaining values in the range [-1, 1]. Second, the normalized feature map values are scaled to a sample range corresponding to the bit depth of the video encoder 120. In the case of 10-bit operations, the normalized feature map is multiplied by the feature map group 512, then the offset of the feature map group 512 is added, and the sum is converted to integer precision and output as the integerized feature map 520. The multiplication and addition operations result in the use of at least one of the minimum or maximum allowable sample values (i.e., 0 or 1023 for 10-bit video) within the feature maps of a given feature map group. To provide some resilience against overshoot that may occur at the output of the video decoder 144, the multiplication factor applied to the normalized feature map can be reduced compared to the maximum possible multiplication factor that can be used without introducing clipping. For regular video represented in the YCbCr color space, a "video range" of 16 - 235 or 8-bit video data, and a "video range" of 64 - 940 for 10-bit video data are defined. Thus, the multiplication factor can be reduced to 7 / 8 of the full value, resulting in a similar sample range as seen in the video range of YCbCr video data. The resulting multiplication factor is 7 / 8×(1<<(bit_depth - 1)). The offset factor used to shift negative tensor values to the positive range is left at the midpoint, i.e., 1<<(bit_depth - 1), corresponding to the default predictor of unavailable reference samples for intra prediction, as explained with reference to FIGS. 6 and 7. If the integer values generated from quantization exceed the range allowed by the bit depth of the samples within the frame, clipping is applied to ensure that the integer values remain within the bit depth of the samples within the frame.The integerized feature map 520 is passed to a packing module 522, which generates a packed feature map frame 117 that includes each feature map of the integerized feature map 520 arranged according to a packing format. The packing format will be further described with reference to FIGS. 11 to 13. The resulting packed feature map frame 117 is passed to a video encoder 120 via a multiplexer 118.
[0068] FIG. 6 is a schematic block diagram showing the functional modules of the video encoder 120. FIG. 7 is a schematic block diagram showing the functional modules of the video decoder 144. Generally, data passes between the functional modules in the video encoder 120 and the functional modules in the video decoder 144 in groups of samples or coefficients, such as by dividing the blocks into sub-blocks of a fixed size, or as an array. The video encoder 120 and the video decoder 144 can be implemented using the general-purpose computer system 200 as shown in FIGS. 2A and 2B, and the various functional modules can be implemented by software, such as one or more software code modules of a software application program 233 that resides on the hard disk drive 205 and is controlled in its execution by the processor 205, by dedicated hardware in the computer system 200. Alternatively, the video encoder 120 and the video decoder 144 can be implemented by a combination of dedicated hardware and software executable within the computer system 200. The video encoder 120, the video decoder 144, and the methods described can alternatively be implemented in dedicated hardware, such as one or more integrated circuits that perform the functions or sub-functions of the methods described. Such dedicated hardware can include a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific standard product (ASSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or one or more microprocessors and associated memories. In particular, the video encoder 120 includes modules 610-690, and the video decoder 144 includes modules 720-796, and these modules can each be implemented as one or more software code modules of a software application program 233.
[0069] The video encoder 120 of FIG. 6 is an example of a general-purpose video coding (VVC) video encoding pipeline, but other video codecs may also be used to perform the processing stages described herein. The video encoder 120 receives frame data 119, such as a series of frames, where each frame includes one or more color channels. The frame data 119 can be in any chroma format and bit depth supported by the profile in use, for example, with a sample accuracy of 8 - 10 bits, and can be 4:0:0, 4:2:0 for the "Main 10" profile of the VVC standard. The block partitioner 610 first divides the frame data 119 into coding tree units (CTUs) configured such that the shape is generally square and a specific size for the CTUs is used. The maximum valid size of a CTU can be, for example, 32×32, 64×64, or 128×128 luma samples, which is configured by the "sps_log2_ctu_size_minus5" syntax element present in the "sequence parameter set". The CTU size also provides the maximum coding unit (CU) size since a CTU without further division contains one CU. The block partitioner 610 further divides each CTU into one or more coding blocks (CBs) according to a luma coding tree and a chroma coding tree. The luma channel may also be referred to as the primary color channel. Each chroma channel may also be referred to as a secondary color channel. The CBs have various sizes and can include both square and non-square aspect ratios. However, in the VVC standard, the CBs, CUs, prediction units (PUs), and transform units (TUs) always have side lengths that are powers of two. Thus, the current CB, represented as 612, is output from the block partitioner 610, 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.CU or CB is generated by recursively splitting a CTU using quadtree splitting (split into four sub-regions arranged as a 2×2 split of the parent region), binary splitting (split horizontally or vertically into two equal-sized sub-regions of the parent region), and ternary splitting (split horizontally or vertically into three sub-regions with an area ratio of 1:2:1).
[0070] Operations are generally described per CTU, but the video encoder 120 and the video decoder 144 can operate on smaller-sized regions to reduce memory consumption. For example, each CTU can be split into smaller regions known as "virtual pipeline data units" (VPDUs) of size 64×64. The VPDUs form a data granularity more suitable for pipeline processing in the hardware architecture, and the reduction in the memory footprint reduces the silicon area and thus the cost compared to operating on a complete CTU. When the CTU size is 128×128, restrictions are placed on the allowed coding tree to ensure that the processing of one VPDU is completely finished before proceeding to the next VPDU. For example, at the root node of the coding tree for a 128×128 CTU, ternary splitting is prohibited because the resulting CUs (such as 32×128 / 128×32, etc., or further decomposition thereof) cannot be processed in the required progression from one 64×64 region to the subsequent 64×64 region. When the CTU size is 64×64, regardless of the coding tree selected by the encoder, the processing must complete one 64×64 region before proceeding to the next 64×64 region (i.e., from one CTU to the next).
[0071] The CTUs obtained from the first partitioning of frame data 119 can be scanned in raster scan order and grouped into one or more "slices". A slice can be an "intra" (or "I") slice. An intra slice (I slice) indicates that all CUs within the slice are intra predicted. Generally, the first picture in a coded layer video sequence (CLVS) contains only I slices and is called an "intra picture". The CLVS can include periodic intra pictures that form "random access points" (i.e., intermediate frames in the video sequence where decoding can start). Alternatively, a slice can be a single prediction or bi - prediction (a "P" or "B" slice respectively), each indicating the additional availability of single and bi - prediction within the slice.
[0072] When a chroma format other than 4:0:0 is used, in an I slice, the coding tree of each CTU can diverge into two separate coding trees below the 64×64 level, 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 CTU's luma 64×64 area. For example, large chroma CBs can be collocated with a number of smaller luma CBs and vice versa. In a P or B slice, a single coding tree for the CTU defines a common block structure for both luma and chroma. The blocks resulting from the single tree can be intra predicted or inter predicted.
[0073] For each CTU, video encoder 120 operates in two stages. In the first stage (referred to as the "search" stage), block partitioner 610 tests various potential configurations of the coding tree. Each potential configuration of the coding tree has an associated "candidate" CB. The first stage involves testing various candidate CBs to select a CB that provides a relatively high compression efficiency with a relatively low distortion. The testing generally involves Lagrangian optimization, whereby candidate CBs are evaluated based on a weighted combination of rate (i.e., coding cost) and distortion (i.e., error with respect to input frame data 119). The "best" candidate CB (i.e., the CB with the lowest evaluated rate / distortion) is selected for subsequent encoding into bitstream 121. Included in the evaluation of candidate CBs is the option of using a CB for a given area, or further dividing the area according to various partitioning options and coding each of the smaller resulting areas with a further CB, or the option of further dividing the area. As a result, both the coding tree and the CB itself are selected in the search stage.
[0074] Video encoder 120 generates a predicted block (PB) indicated by arrow 620 for each CB, e.g., CB612. PB620 is a prediction of the content of the associated CB612. Subtractor module 622 generates a difference (or "residual" referring to the difference in the spatial domain), indicated as 624, between PB620 and CB612. Difference 624 is the block size difference between corresponding samples in PB620 and CB612. Difference 624 is transformed, quantized, and represented as a transformed block (TB) indicated by arrow 636. PB620 and the associated TB636 are typically selected from among many possible candidate CBs, e.g., based on the evaluated cost or distortion.
[0075] A candidate coding block (CB) is a CB resulting from one of the prediction modes available to video encoder 120 for an associated PB and the resulting residual. When combined with the predicted PB in video encoder 120, TB636 reduces the difference between the decoded CB and the original CB612 at the expense of additional signals in the bitstream.
[0076] Accordingly, each candidate coding block (CB), i.e., a prediction block (PB) combined with a transform block (TB), has an associated coding cost (or "rate") and an associated difference (or "distortion"). The distortion of a CB is typically estimated as the difference of sample values, such as the sum of absolute differences (SAD), the sum of squared differences (SSD), or an Hadamard transform applied to the differences. The estimation resulting from each candidate PB can be determined by mode selector 686 using difference 624 to determine prediction mode 687. Prediction mode 687 indicates the 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 can be performed at a cost significantly lower than the entropy coding of the residual. Accordingly, several candidate modes can be evaluated to determine the optimal mode in rate-distortion detection, even in a real-time video encoder.
[0077] Determining the optimal mode with respect to rate-distortion is typically achieved using a variation of Lagrangian optimization.
[0078] The Lagrangian or similar optimization process can be used for both the selection of the optimal partitioning of CTUs into CUs (by the block partitioner 610), and the selection of the best prediction mode from multiple possibilities. Through the application of the Lagrangian optimization process for candidate modes in the mode selection module 686, the intra prediction mode having the lowest cost measurement value is selected as the "best" mode. The lowest cost mode includes the selected secondary transform index 688, which is also encoded in the bitstream 121 by the entropy encoder 638.
[0079] In the second stage of the operation of the video encoder 120 (referred to as the "coding" stage), an iteration over the determined coding tree for each CTU is performed in the video encoder 120. For CTUs that use separate trees, for each 64×64 luma region of the CTU, the luma coding tree is first encoded, and then the chroma coding tree is encoded. Only luma CUs are encoded within the luma coding tree, and only chroma CUs are encoded within the chroma coding tree. For CTUs that use a shared tree, a single tree describes the CUs (i.e., luma CUs and chroma CUs) according to the common block structure of the shared tree.
[0080] Entropy encoder 638 supports bitwise coding of syntax elements using variable-length and fixed-length codewords, and an arithmetic coding mode for syntax elements. A part of the bitstream, such as a "parameter set", for example, a sequence parameter set (SPS) and a picture parameter set (PPS), uses a combination of fixed-length and variable-length codewords. A slice, also called a continuous part, has a slice header that uses variable-length coding and slice data that follows and uses arithmetic coding. The slice header defines parameters specific to the current slice, such as a slice-level quantization parameter offset. The slice data includes the syntax elements of each CTU in the slice. The use of variable-length coding and arithmetic coding requires sequential syntax analysis within each part of the bitstream. The parts can be delimited by start codes for forming "network abstraction layer units" or "NAL units". Arithmetic coding is supported using a context-adaptive binary arithmetic coding process.
[0081] An arithmetically coded syntax element consists of a sequence of one or more "bins". A bin, like a bit, has a value of either "0" or "1". However, a bin is not encoded as discrete bits within a bitstream 121. A bin has 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, the "Most Probable Symbol" (MPS) is coded. Coding the most likely symbol is relatively inexpensive with respect to the consumed bits in the bitstream 121 and involves a cost equivalent to less than one discrete bit. When the actual bin to be coded does not match a likely value, the "Least Probable Symbol" (LPS) is coded. Coding the least likely symbol has a relatively high cost with respect to the consumed bits. The bin coding technique enables efficient coding of bins where the "0" vs. "1" probabilities are skewed. For a syntax element having two possible values (i.e., a "flag"), a single bin is appropriate. For a syntax element having many possible values, a sequence of bins is required.
[0082] The presence of later bins in the sequence can be determined based on the values of earlier bins in the sequence. Further, each bin can be associated with more than one context. The selection of a particular context can depend on previous bins in the syntax element, the bin values of adjacent syntax elements (i.e., from adjacent blocks), etc. Each time a context-coded bin is coded, the context selected for that bin (if any) is updated in a way that reflects the new bin value. Thus, the binary arithmetic coding scheme is said to be adaptive.
[0083] Also supported by the entropy encoder 638 are bins without context, called "bypass bins". Bypass bins are coded assuming an equiprobability distribution between "0" and "1". Thus, each bin has a coding cost of 1 bit in the bitstream 121. The lack of context saves memory and reduces complexity, and thus bypass bins are used when the distribution of the values of a particular bin is not distorted. An example of an entropy encoder that uses context and adaptation is known in the art as CABAC (Context-Adaptive Binary Arithmetic Coder), and many variants of this coder are used in video coding.
[0084] The entropy encoder 638 encodes the quantization parameter 692 and, when used for the current CB, encodes the LFNST index 388 using a combination of context-coded bins and bypass-coded bins. The quantization parameter 692 is encoded using "delta QP". Delta QP is signaled at most once in each area known as a "quantization group". The quantization parameter 692 is applied to the residual coefficients of the luma CB. The adjusted quantization parameter is applied to the residual coefficients of the collocated chroma CB. The adjusted quantization parameter may include mapping from the luma quantization parameter 692 according to a CU-level offset selected from a list of offsets and a mapping table. The secondary transform index 688 is signaled when the residual associated with the transform block contains significant residual coefficients only at the coefficient positions where the primary coefficients are transformed by the application of the secondary transform.
[0085] The multiplexer module 684 outputs PB620 from the intra-frame prediction module 664 according to the determined best intra prediction mode selected from the tested prediction modes of each candidate CB. The candidate prediction modes do not have to include all possible prediction modes supported by the video encoder 120. Intra prediction is divided into three types. First, "DC intra prediction" involves populating the PB with a single value representing the average of nearby reconstructed samples. Second, "plane intra prediction" involves populating the PB with samples according to a plane, where the DC offset and the vertical and horizontal gradients are derived from nearby reconstructed adjacent samples. The nearby reconstructed samples typically include a row of reconstructed samples above the current PB that extends to the right of the PB to some extent, a column of reconstructed samples to the left of the current PB that extends downward beyond the PB to some extent, and a third "angular intra prediction" that involves populating the PB with reconstructed neighboring samples that are filtered and propagated across the PB in a specific direction (or "angle"). In VVC, 65 angles are supported, and rectangular blocks can utilize additional angles not available to square blocks in order to generate a total of 87 angles.
[0086] Chroma PB can utilize a fourth type of intra prediction, whereby the PB is generated from collocated luma reconstruction samples according to the "Cross Component Linear Model" (CCLM) mode. Three different CCLM modes are available, and each mode uses a different model derived from adjacent luma and chroma samples. The derived model is used to generate a block of samples for chroma PB from the collocated luma samples. The luma block can be intra predicted using matrix multiplication of reference samples using one matrix selected from a pre-defined set of matrices. This Matrix Intra Prediction (MIP) achieves gains by using matrices trained on a large set of video data, and the matrices represent the relationship between reference samples and prediction blocks that are not easily captured in angular, planar, or DC intra prediction modes.
[0087] Module 664 can also generate a prediction unit by copying a block from near the current frame using the "Intra Block Copy" (IBC) method. The location of the reference block is restricted to an area corresponding to one CTU divided into 64×64 regions known as VPDUs, and that area covers the area limit of one CTU, the VPDU of the previous CTU, and the processed VPDU of the current CTU. This area is known as the "IBC virtual buffer", which limits the IBC reference area and thus the required memory. The IBC buffer is populated with the reconstructed samples 654 (i.e., before loop filtering), and thus a separate buffer to the frame buffer 672 is required.
[0088] The residual of the prediction block when encoding the feature map data is different from the residual seen for natural videos. Such natural videos are typically captured by image sensors or screen content, as commonly seen in the user interfaces of operating systems, for example. The feature map residual tends to contain a lot of detail, which is suitable for transforms that skip more coding of the various transforms than mainly the low-frequency coefficients. Experiments show that the feature map residual has sufficient local similarity to benefit from transform coding. However, the distribution of the feature map residual coefficients does not cluster towards the DC (top-left) coefficient of the transform block. In other words, there is sufficient correlation for the transform to show a gain when encoding the feature map data, which also holds when intra-block copy is used to generate the prediction block of the feature map data. Thus, the Hadamard cost estimation can be used when evaluating the residual resulting from the candidate block vectors of the intra-block copy when encoding the feature map data, rather than relying only on SAD or SSD cost estimation. SAD or SSD cost estimation tends to select block vectors with residuals more suitable for skip coding and may miss block vectors with residuals that are compactly encoded using transforms. The Multiple Transform Selection (MTS) tool of the VVC standard can be used when encoding the feature map data such that a combination of DST-7 and DCT-8 transforms is available horizontally and vertically for residual coding in addition to the DCT-2 transform.
[0089] An intra-predicted luma coding block can be partitioned into a set of prediction blocks of equal size, either vertically or horizontally, each block having a minimum area of 16 luma samples. This Intra-Sub-Partitioning (ISP) approach allows separate transform blocks to contribute to the prediction block generation from one sub-partition to the next within the luma coding block, improving the compression efficiency.
[0090] If there are no previously reconstructed adjacent samples available, e.g., at the edges of a frame, default halftone values that are half of the sample range are used. For example, in the case of 10-bit video, a value of 512 is used. Since there are no previous samples available for the CB located at the upper 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 the halftone value as the size).
[0091] In the case of inter-frame prediction, the prediction block 682 is generated by the motion compensation module 680 using samples from one or two frames preceding the current frame in the coding order frame within the bitstream, and is output as PB620 by the multiplexer module 684. Further, in the case of inter-frame prediction, a single coding tree is typically used for both the luma channel and the chroma channel. The order in which the frames in the bitstream are coded can be different from the order of the frames when captured or displayed. When one frame is used for prediction, the block is said to be "single predicted" and has one associated motion vector. When two frames are used for prediction, the block is said to be "bi-predicted" and has two associated motion vectors. In the case of a P slice, each CU can be intra predicted or single predicted. In the case of a B slice, each CU can be intra predicted, single predicted, or bi-predicted.
[0092] Frames are typically coded using a “group of pictures” structure, enabling a temporal hierarchy of frames. A frame may be divided into multiple slices, each of which encodes a portion of the frame. The temporal hierarchy of frames enables frames to reference previous and subsequent pictures in the order in which they are to be displayed. Images are coded in an order necessary to ensure that dependencies for decoding each frame are satisfied. Instead of using one or two motion vectors to select and filter reference sample blocks for a prediction unit, the prediction unit is divided into multiple smaller blocks, a motion field is generated, and thus an affine inter prediction mode with separate motion vectors for each smaller block is available. The motion field uses the motion vectors of points near the prediction unit as “control points”. Affine prediction enables coding of motion to different transforms with less need to use deeply divided coding trees. The dual prediction mode available in VVC performs a geometric blend of two reference blocks along a selected axis, having an angle and offset from the center of the signaled block. This geometric partitioning mode (“GPM”) enables use of a larger coding unit along the boundary between two objects, with the geometry of the coded boundary for the coding unit signaled as an angle and a center offset. Instead of using Cartesian (x, y) offsets, motion vector differences may be coded as a direction (up / down / left / right) and a distance, using a set of supported powers of two distances. The motion vector predictor is obtained from an adjacent block (“merge mode”) as if no offset were applied. The current block shares the same motion vector as the selected adjacent block.
[0093] Samples are selected according to motion vector 678 and reference picture index. Motion vector 678 and reference picture index are applied to all color channels, and thus, inter prediction is mainly described with respect to the operation in PU rather than PB. The decomposition of each CTU into one or more inter prediction blocks is described using a single coding tree. The inter prediction method may vary in the number of motion parameters and their accuracy. Motion parameters typically comprise a reference frame index indicating which reference frame from a list of reference frames should be used, and a spatial transformation for each of the reference frames, but may include more frames, dedicated frames, or complex affine parameters such as scaling and rotation. In addition, a predetermined motion refinement process may be applied to generate a dense motion estimate based on the referenced sample block.
[0094] When PB620 is determined and selected and PB620 is subtracted from the original sample block by subtractor 622, a residual with the lowest coding cost represented as 624 is obtained and undergoes irreversible compression. The irreversible compression process includes steps of transformation, quantization, and entropy coding. The forward primary transformation module 626 applies a forward transformation to the difference 624, transforms the difference 624 from the spatial domain to the frequency domain, and generates primary transformation coefficients represented by arrow 628. The maximum primary transformation size in one dimension is either a 32-point DCT-2 or a 64-point DCT-2 transformation configured by "sps_max_luma_transform_size_64_flag" in the sequence parameter set. When the encoded CB is larger than the maximum supported primary transformation size represented as the block size (e.g., 64×64 or 32×32), the primary transformation 626 is applied in a tile manner to transform all samples of the difference 624. When a non-square CB is used, tiling is also performed using the maximum available transformation size in each dimension of the CB. For example, when the maximum transformation size of 32 is used, a 64×16 CB uses two 32×16 primary transformations configured in a tile manner. When the CB is larger in size than the maximum supported transformation size, the CB is tiled with TBs. For example, a 128×128 CB with a 64-pt transformation maximum size is tiled with four 64×64 TBs in a 2×2 arrangement. A 64×128 CB with a 32-pt transformation maximum size is tiled with eight 32×32 TBs in a 2×4 arrangement.
[0095] The application of transformation 626 results in multiple TBs for a CB. When each application of the transformation operates on a difference 624 larger than 32×32, e.g., a 64×64 TB, all the resulting primary transformation coefficients 628 outside the 32×32 area in the upper left of the TB are set to zero (i.e., discarded). The remaining primary transformation coefficients 628 are passed to the quantizer module 634. The primary transformation coefficients 628 are quantized according to the quantization parameters 692 associated with the CB to generate the primary transformation coefficients 632. In addition to the quantization parameters 692, the quantizer module 634 may also apply a "scaling list" to enable non-uniform quantization within the TB by further scaling the residual coefficients according to their spatial positions within the TB. The quantization parameters 692 may be different for each luma CB and each chroma CB. The primary transformation coefficients 632 are passed to the forward secondary transformation module 630 to generate the transformation coefficients represented by the arrow 636 by performing a non-separable secondary transformation (NSST) operation or bypassing the secondary transformation. The forward primary transformation is typically separable and transforms a set of rows and then a set of columns for each TB. The forward primary transformation module 626 uses either a type II discrete cosine transform (DCT-2) in the horizontal and vertical directions, or a bypass of the transformation in the horizontal and vertical directions, or a combination of a type VII discrete sine transform (DST-7) and a type VIII discrete cosine transform (DCT-8) in the horizontal or vertical direction for a luma TB whose width and height do not exceed 16 samples. The use of the combination of DST-7 and DCT-8 is referred to as a "multiple transform selection set" (MTS) in the VVC standard.
[0096] The forward secondary transform of module 630 is generally a non-separable transform, which is applied only to the residuals of the intra-predicted CUs and can nevertheless be bypassed. The forward secondary transform operates on either 16 samples (configured as the top-left 4×4 sub-block of the primary transform coefficients 628) or 48 samples (configured as three 4×4 sub-blocks at the top-left 8×8 coefficients of the primary transform coefficients 628) to generate a set of secondary transform coefficients. The set of secondary transform coefficients may be fewer in number than the set of primary transform coefficients from which they are derived. By applying the secondary transform only to sets of coefficients that are adjacent to each other and include the DC coefficient, the secondary transform is called a "low-frequency non-separable secondary transform" (LFNST). Further, when the LFNST is applied, all remaining coefficients in the TB are zero in both the primary transform region and the secondary transform region.
[0097] The quantization parameter 692 is constant for a given TB, thus providing uniform scaling for the generation of residual coefficients in the primary transform region for the TB. The quantization parameter 692 can vary periodically together 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 using one of the CUs' TBs. That is, the delta QP is signaled once by the entropy encoder 638 for the first quantization group of the CU and is not signaled for any subsequent quantization groups of the CU. By applying a "quantization matrix", non-uniform scaling is also possible, whereby the scaling coefficient applied to each residual coefficient is derived from a combination of the quantization parameter 692 and the corresponding entry in the scaling matrix. The scaling matrix can have a size smaller than the size of the TB and, when applied to the TB, a nearest neighbor approach is used to provide the scaling value for each residual coefficient from the scaling matrix of a size smaller than the TB size. The residual coefficients 636 are supplied to the entropy encoder 638 for encoding in the bitstream 121. Typically, the residual coefficients of each TB having at least one significant residual coefficient of the TU are scanned according to a scan pattern to generate an ordered list of values. The scan pattern generally scans the TB as a sequence of 4×4 "sub-blocks", provides a regular scanning operation at the granularity of a 4×4 set 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 follow a backward diagonal scan pattern. Further, the quantization parameter 692 is encoded in the bitstream 121 using the delta QP syntax element, and the secondary transform index 688 is encoded in the bitstream 121.
[0098] As described above, the video encoder 120 needs to access the frame representation corresponding to the decoded frame representation found in the video decoder 144. Thus, the residual coefficient 636 passes through the inverse quadratic transform module 644 and operates according to the quadratic transform index 688 to generate the intermediate inverse transform coefficient represented by the arrow 642. The intermediate inverse transform coefficient 642 is inverse quantized by the inverse quantizer module 640 according to the quantization parameter 692 to generate the inverse transform coefficient represented by the arrow 646. The inverse quantizer module 640 may also perform inverse non-uniform scaling of the residual coefficients using a scaling list corresponding to the forward scaling performed in the quantizer module 634. The inverse transform coefficient 646 is passed to the inverse primary transform module 648 to generate the residual samples of the TU, represented by the arrow 650. The inverse primary transform module 648 applies the DCT-2 transform horizontally and vertically, constrained by the largest available transform size, as described with reference to the forward primary transform module 626. The type of inverse transform performed by the inverse quadratic transform module 644 corresponds to the type of forward transform performed by the forward quadratic transform module 630. The type of inverse transform performed by the inverse primary transform module 648 corresponds to the type of primary transform performed by the primary transform module 626. The addition module 652 adds the residual samples 650 and the PU 620 to generate the reconstructed samples of the CU (indicated by the arrow 654).
[0099] The reconstructed sample 654 is passed to a reference sample cache 656 and an in-loop filter module 668. Typically implemented using static RAM on an ASIC to avoid costly off-chip memory accesses, the reference sample cache 656 provides the minimum sample storage required to satisfy dependencies for generating intra-frame PBs for subsequent CUs within a frame. The minimum dependencies typically include a "line buffer" of samples along the bottom of a CTU row for use by the next row of the CTU and column buffering whose extent is set by the CTU height. The reference sample cache 656 supplies reference samples (represented by arrow 658) to a reference sample filter 660. The sample filter 660 applies a smoothing operation to generate filtered reference samples (indicated by arrow 662). The filtered reference samples 662 are used by an intra-frame prediction module 664 to generate an intra-predicted block of samples, represented by arrow 666. For each candidate intra-prediction mode, the intra-frame prediction module 664 generates a block of samples, i.e., 666. The block of samples 666 is generated by the module 664 using techniques such as DC, planar, or angular intra-prediction. The block of samples 666 can also be generated using a matrix multiplication approach that uses adjacent reference samples as input and a matrix selected from a set of matrices by the video encoder 120, where the selected matrix is signaled in the bitstream 120 using an index to identify which matrix of the set of matrices should be used by the video decoder 144.
[0100] The in-loop filter module 668 applies several filtering stages to the reconstructed samples 654. The filtering stages include a "deblocking filter" (DBF) that applies smoothing aligned at the CU boundaries to reduce artifacts resulting from discontinuities. The deblocking filter smooths the block edges where coding artifacts resulting from the transform basis functions causing misaligned boundaries along the block boundaries can be seen, and such artifacts are more visible at higher values of the quantization parameter 692. At lower values of the quantization parameter 692, the filtering strength of the deblocking filter is reduced. Another filtering stage present in the in-loop filter module 668 is the "adaptive loop filter" (ALF), which applies a Wiener-based adaptive filter to further reduce distortion. A further available filtering stage in the in-loop filter module 668 is the "sample adaptive offset" (SAO) filter. The SAO filter first classifies the reconstructed samples into one or more categories and operates by applying an offset at the sample level according to the assigned category.
[0101] The filtered samples represented by arrow 670 are output from the in-loop filter module 668. The filtered samples 670 are stored in the frame buffer 672. The frame buffer 672 typically has the capacity to store several (e.g., up to 16) pictures and is thus stored in the memory 206. The frame buffer 672 is typically not stored using on-chip memory due to the large memory consumption required. Thus, access to the frame buffer 672 is costly in terms of memory bandwidth. The frame buffer 672 provides the reference frames (represented by arrow 674) to the motion estimation module 676 and the motion compensation module 680.
[0102] The motion estimation module 676 estimates several "motion vectors" (shown as 678), each of which is a Cartesian space offset from the position of the current CB and refers to a block in one of the reference frames in the frame buffer 672. A filtered block of reference samples (represented as 682) is generated for each motion vector. The filtered reference samples 682 form additional candidate modes available for potential selection by the mode selector 686. Further, for a given CU, the PU 620 can be formed using one reference block ("uni-predicted") or two reference blocks ("bi-predicted"). For the selected motion vector, the motion compensation module 680 generates the PB 620 according to a filtering process that supports sub-pixel accuracy in the motion vector. Thus, the motion estimation module 676 (operating on many candidate motion vectors) can perform a simplified filtering process compared to that of the motion compensation module 680 (operating only on the selected candidates) to achieve a reduced computational load. When the video encoder 120 selects inter prediction for a CU, the motion vector 678 is encoded into the bitstream 121.
[0103] The video encoder 120 of FIG. 6 is described with reference to Versatile Video Coding (VVC), but other video coding standards or implementations may also adopt the processing stages of modules 610-690. The frame data 119 (and the bitstream 121) may also be stored in the memory 206, hard disk drive 210, CD-ROM, Blu-ray disc TMor can be read from (or written to) other computer-readable storage media. Further, the frame data 119 (and the bitstream 121) can be received (or transmitted to an external source) from an external source such as a server connected to the communication network 220 or a radio frequency receiver. The communication network 220 can provide a limited bandwidth and requires the use of rate control in the video encoder 120 to avoid saturating the network when it is difficult to compress the frame data 119. Further, the bitstream 121 can be constructed from one or more slices representing spatial sections (a collection of CTUs) of the frame data 119 generated by one or more instances of the video encoder 120 that operate cooperatively under the control of the processor 205.
[0104] The video decoder 144 is shown in FIG. 7. The video decoder 144 of FIG. 7 is an example of a general-purpose video coding (VVC) video decoding pipeline, but other video codecs can also be used to execute the processing stages described herein. As shown in FIG. 7, the bitstream 143 is input to the video decoder 144. The bitstream 143 can be read from the memory 206, the hard disk drive 210, a CD-ROM, a Blu-ray disc TM or other non-transitory computer-readable storage media. Alternatively, the bitstream 143 may be received from an external source such as a server connected to the communication network 220 or a radio frequency receiver. The bitstream 143 includes encoded syntax elements representing the captured frame data to be decoded.
[0105] The bitstream 143 is input to the entropy decoder module 720. The entropy decoder module 720 extracts syntax elements from the bitstream 143 by decoding a sequence of "bins" and passes the values of the syntax elements to other modules within the video decoder 144. The entropy decoder module 720 uses variable - length and fixed - length decoding to decode an arithmetic decoding engine, SPS, PPS, or slice header, 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", where a context describes 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 contexts available for decoding the bin. The process of decoding the bins forms a sequential feedback loop, and thus each slice can be decoded over the entire slice by a given instance of the entropy decoder 720. A single (or a small number of) high - performance entropy decoder 720 instances can decode all slices of a frame from the bitstream 143, and multiple low - performance entropy decoder 720 instances can decode slices of a frame from the bitstream 143 simultaneously.
[0106] Entropy decoder module 720 applies an arithmetic coding algorithm, such as "Context Adaptive Binary Arithmetic Coding" (CABAC), to decode syntax elements from bitstream 143. The decoded syntax elements are used to reconstruct parameters within video decoder 144. The parameters include mode selection information such as residual coefficients (represented by arrow 724), quantization parameter 774, secondary transform index 770, and intra prediction mode (represented by arrow 758). The mode selection information also includes information such as motion vectors and partitioning to one or more CBs of each CTU. The parameters are used to generate PBs and are typically combined with sample data from previously decoded CBs.
[0107] Residual coefficients 724 are passed to inverse secondary transform module 736, and according to the secondary transform index, secondary transform is applied or the operation is not performed (bypassed). Inverse secondary transform module 736 generates reconstructed transform coefficients 732, i.e., primary transform region coefficients, from the secondary transform region coefficients. The reconstructed transform coefficients 732 are input to inverse quantizer module 728. Inverse quantizer module 728 performs inverse quantization (or "scaling") in the primary transform coefficient region, i.e., residual coefficients 732, to create reconstructed intermediate transform coefficients, represented by arrow 740, according to quantization parameter 774. Inverse quantizer module 728 may also apply a scaling matrix to provide non-uniform inverse quantization within the TB corresponding to the operation of inverse quantizer module 640. If the use of a non-uniform inverse quantization matrix is indicated in bitstream 143, video decoder 144 reads the quantization matrix from bitstream 143 as a sequence of scaling factors and arranges the scaling factors in the matrix. Inverse scaling uses the quantization matrix in combination with the quantization parameter to create reconstructed intermediate transform coefficients 740.
[0108] The reconfigured transform coefficient 740 is passed to the inverse primary transform module 744. Module 744 transforms the coefficient 740 to convert it back from the frequency domain to the spatial domain. The inverse primary transform module 744 applies an inverse DCT-2 transform horizontally and vertically, constrained by the maximum available transform size, as described with reference to the forward primary transform module 626. The result of the operation of module 744 is a block of residual samples represented by arrow 748. The size of the block of residual samples 748 is equal to the corresponding CB. The residual samples 748 are supplied to the addition module 750.
[0109] In the addition module 750, the residual samples 748 are added to the decoded PB (represented as 752) to produce a block of reconstructed samples represented by arrow 756. The reconstructed samples 756 are supplied to the reconstructed sample cache 760 and the in-loop filtering module 788. The in-loop filtering module 788 produces a reconstructed block of frame samples represented as 792. The frame samples 792 are written to the frame buffer 796.
[0110] The reconstructed sample cache 760 operates in a similar manner to the reconstructed sample cache 656 of the video encoder 120. The reconstructed sample cache 760 provides storage for the reconstructed samples required for intra prediction of subsequent CBs without memory 206 (e.g., by instead using data 232, typically on-chip memory). The reference samples represented by arrow 764 are obtained from the reconstructed sample cache 760 and supplied to the reference sample filter 768 to generate the filtered reference samples indicated by arrow 772. The filtered reference samples 772 are supplied to the intra-frame prediction module 776. The module 776 generates a block of intra prediction samples represented by arrow 780 according to the intra prediction mode parameter 758 signaled in the bitstream 143 and decoded by the entropy decoder 720. The intra prediction module 776 supports the modes of module 664 including IBC and MIP. The block of samples 780 is generated using modes such as DC, planar, or angular intra prediction.
[0111] When the prediction mode of the CB is indicated to use intra prediction in the bitstream 143, the intra prediction samples 780 form the decoded PB 752 via the multiplexer module 784. Intra prediction generates a predicted block (PB) of samples, which is a block in one color component derived using the "adjacent samples" in the same color component. Adjacent samples are samples adjacent to the current block and have already been reconstructed by preceding in the block decoding order. When a luma block and a chroma block are collocated, the luma block and the chroma block may use different intra prediction modes. However, two chroma CBs share the same intra prediction mode.
[0112] When the prediction mode of CB is shown to be an inter prediction within bitstream 143, motion compensation module 734 generates a block of inter prediction samples represented as 738. The block of inter prediction samples 738 is generated using the motion vectors decoded from bitstream 143 by entropy decoder 720 and the reference frame index for selecting and filtering a block of samples 798 from frame buffer 796. The block of samples 798 is obtained from a previously decoded frame stored in frame buffer 796. In the case of dual prediction, two blocks of samples are generated and blended together to generate samples for decoded PB 752. Frame buffer 796 is populated with filtered block data 792 from in-loop filtering module 788. Similar to in-loop filtering module 668 of video encoder 120, in-loop filtering module 788 applies any of the DBF, ALF, and SAO filtering operations. Generally, the motion vectors are applied to both the luma channel and the chroma channel, but the filtering processes for subsample interpolation in the luma channel and the chroma channel are different.
[0113] Although not shown in FIGS. 6 and 7, it is a module for preprocessing video before encoding and postprocessing video after decoding to shift sample values so that a more uniform use of the range of sample values within each chroma channel is achieved. The multi-segment linear model is derived in video encoder 120 and signaled in the bitstream for use by video decoder 144 to cancel the sample shift. This linear model chroma scaling (LMCS) tool provides a compression advantage for certain color spaces and contents with some non-uniformity, particularly limited range utilization, in the utilization of the sample space that can result in higher quality loss from the application of quantization.
[0114] FIG. 8 is a schematic block diagram showing a feature map inverse quantizer and unpacker 148 as part of the distributed machine task system 100. The decoded frame 147 is input to the unpacker module 810 where the feature map is extracted from each frame according to the packing format to generate an unpacked feature map 812. The unpacked feature map 812 includes sample values present in the decoded frame 147. The packing format is further described with reference to FIGS. 11-13. The set of feature maps within the unpacked feature map 812 are assigned to groups according to the feature map groups 820 obtained from the decoded metadata 155 such that each feature map belongs to one group and one or more groups are shown within the feature map groups 820. The inverse quantizer 814 then performs scaling to convert the integer sample values present in the unpacked feature map 812 to floating point values present in the tensor 149. The scaling uses the quantization range for the groups of feature maps. The quantization range is obtained from the quantization range 822 extracted from the decoded metadata 155. The quantization range specifies the maximum magnitude of any floating point value found in the feature maps belonging to the corresponding group. The inverse quantizer 814 normalizes the samples from the feature maps 812 of each group to a range centered about zero and reaching 1 or -1 depending on whether the sign of the detected maximum amplitude value is positive or negative. In the rare case where the positive and negative values have equal maximum magnitudes, a range of [-1,1] is observed. The normalized samples of the groups of feature maps are then multiplied (scaled) by the quantization range of the groups of feature maps.
[0115] When all groups of the feature maps are scaled, the result is output as intermediate data in the form of tensor 149. Tensor 149 may include a plurality of tensors each having a different spatial resolution, for example, when the CNN backbone 114 includes an FPN. In addition to using zero-centered linear symmetric quantization processing, other quantization processes are also possible. For example, an asymmetric approach may be used where positive and negative quantization ranges are signaled for each group of feature maps. The positive and negative quantization ranges map the range utilized by the floating-point values of the group of features to the full sample range given by the bit depth of the samples, which results in asymmetric quantization as the midpoint of the sample range that is no longer guaranteed to correspond to a zero floating-point value. The "quant_type" syntax element within the SEI message 1413 selects the quantization approach and is described with reference to Appendix A.
[0116] The quantization range for a given group of feature maps is derived from the values within the group's feature maps, but the quantization range needs to hold the same data type as the values within the group's feature maps. A coarser floating-point precision may be used and rounding is applied so that the range when represented in the original floating-point format (e.g., 32-bit IEEE754 format) is not reduced. For example, at step 1550, a coarser floating-point precision can be used with upward rounding. Upward rounding can be achieved by adding a constant value ε to the quantization range qr, generating an adjusted quantization range qr adjust where ε = 2 floor(log2(qr)) / 2 fract_prec where frac_prec is the number of fractional bits to be preserved and the "floor" operator then rounds towards the next lower integer. Next, the leftmost bit of the fractional part of qr adjust with fract_prec is incorporated into the SEI message, coded, and the remaining bits are truncated, qr adjustIt does not become a value smaller than qr. The accuracy of the quantization range for the bits assigned to the fractional part is selected using the "qr_fraction_precision" syntax element described with reference to Appendix A. By setting qr_fraction_precision (fract_prec) to 5, the quantization range can be set accurately, with a worst-case increase of ~3% compared to the fractional precision of the original floating-point value, i.e., before reducing the fractional precision to 5 bits. To generate the mantissa of the quantization range, a leading "1" is added to the fractional part (i.e., the quantization range does not have to be a "subnormal" value). Since the quantization range is always positive, there is no need to encode a sign bit for each quantization range. Since the quantization range can be greater than 1 or less than 1, a sign bit for the quantization range exponent is required. In the arrangement of system 100, a quantization range less than 1.0 is not permitted, and the quantization exponent sign bit can be omitted from SEI message 1413. When the quantization exponent sign bit is not coded, in the quantization range determination module 514, a quantization range less than 1.0 is clipped to the value 1.0.
[0117] Despite the operations of the inverse quantizer module 814 and the quantizer module 518 being called "quantization", the operations of modules 518 and 814 are different from the quantization operations of the video encoder 120 and the video decoder 144, which involve the use of quantization parameters. Furthermore, the operations of modules 518 and 814 can be regarded as a form of tone mapping operation that involves a conversion between the floating-point domain of the tensor and the sampled domain of the frame. For the purpose of utilizing a wide range of sample value spaces, there is scaling (i.e., via the quantization range of each group of feature maps), but there are no quantization parameters applicable to modules 518 and 814 to further change the quantizer step size.
[0118] FIG. 9A is a schematic block diagram showing a head portion 150 of a CNN for object detection. Depending on the task to be executed in the destination device 140, a different network can be used instead of the CNN head 150. The input tensor 149 is separated into tensors of each layer (i.e., tensors 910, 920, and 934). Tensor 910 is passed to the CBL module 912 to generate tensor 914, and is passed to the detection module 916 and the upscaler module 922. The bounding box 918 in the form of a detection tensor is passed to the non-maximum suppression (NMS) module 948 to generate the detection result 151. Scaling by the original video width and height is performed before resizing the backbone portion of the network 114 to generate a bounding box that addresses coordinates within the original video data 113 (see "orig_source_width" and "orig_source_height", decoded from the SEI message 1413 and described with reference to Appendix A). The upscaler module 922 generates an upscaled tensor 924, which is passed to the CBL module 926 to generate tensor 928 as output. Tensor 928 is passed to the detection module 930 and the upscaler module 936. The detection module 930 generates a detection tensor 932 that is supplied to the NMS module 948. The upscaler module 936 is another instance of the module 960 and outputs an upscaled tensor 938. The upscaled tensor 938 is passed to the CBL module 940, and the CBL module outputs tensor 942 to the detection module 944. The CBL modules 912, 926, and 940 each include a concatenation of five CBL modules. The upscaler modules 922 and 936 are each instances of the upscaler module 960 as shown in FIG. 9B.
[0119] The upscaler module 960 receives the tensor 962 as input and passes it to the CBL module 966 to generate the tensor 968. The tensor 968 is passed to the upsampler 970 to generate the upsampled tensor 972. The concatenation module 974 generates the tensor 976 by concatenating the upsampled tensor 972 with the input tensor 964. The detection modules 916, 930, and 944 are instances of the detection module 980 as shown in FIG. 9C. The detection module 960 receives the tensor 982 and passes it to the CBL module 984 to generate the tensor 986. The tensor 986 is passed to the convolutional module 988 that implements the detection kernel. The detection kernel 1×1 kernel is applied to generate the output of the feature map in three layers. The detection kernel is 1×1×(Bx(5+C)), where B is the number of bounding boxes that a particular cell can predict, typically 3, C is the number of classes that can be 80, resulting in a kernel size of 255 detection attributes (i.e., tensor 990). The constant "5" represents four bounding box attributes (box center x, y and size scale x, y) and one object confidence level ("objectness"). The result of the detection kernel has the same spatial dimension as the input feature map, but the output depth corresponds to the detection attributes. The detection kernel is applied to each layer, typically three layers, resulting in a large number of candidate bounding boxes. The non-maximum suppression process is applied by the NMS module 948 to the resulting bounding boxes, discarding redundant boxes such as overlapping predictions at similar scales, resulting in a final set of bounding boxes as the output for object detection.
[0120] FIG. 10 is a schematic block diagram showing an alternative head portion 1000 of a CNN. The head portion 1000 forms part of an overall network known as “faster RCNN” and includes a feature network (i.e., backbone portion 400), a region proposal network, and a detection network. The input to the head portion 1000 is a tensor 149 including P2 - P6 layer tensors 1010, 1012, 1014, 1016, and 1018. The P2 - P6 tensors 1010, 1012, 1014, 1016, and 1018 are input to a region proposal network (RPN) head module 1020. The RPN head module 1020 performs a convolution on the input tensor and generates an intermediate tensor that is fed to two subsequent sibling layers, one for classification and one for bounding boxes or “regions of interest” (ROI), and regresses as classification and bounding boxes 1022. The classification and bounding boxes 1022 are passed to an NMS module 1024, which prunes redundant bounding boxes by removing overlapping boxes with lower scores to generate pruned bounding boxes 1026. The bounding boxes 1026 are passed to a region of interest (ROI) pooler 1028. The ROI pooler 1028 uses a max - pooling operation to generate a fixed - size feature map from various input - size maps, and the subsampling takes the maximum value within each group of input values to generate one output value within the output tensor.
[0121] The inputs to the ROI Pooler 1028 are the P2 - P5 feature maps 1010, 1012, 1014, and 1016, as well as the Region of Interest proposals 1026. Each proposal (ROI) from 1026 is associated with a portion of the feature maps (1010 - 1016) to generate a fixed - size map. The fixed - size map is of a size independent of the underlying portion of the feature maps 1010 - 1016. One of the feature maps 1010 - 1016 is selected such that the resulting cropped map has sufficient detail, for example, according to the rule: floor(4 + log2(sqrt(box_area) / 224)), where 224 is the normal box size. Thus, the ROI Pooler 1028 crops the input feature maps according to the proposals 1026 to generate the tensor 1030. The tensor 1030 is fed to the Fully - Connected (FC) neural network head 1032. The FC head 1032 executes two fully - connected layers to generate the class scores and the bounding box predictor delta tensor 1034. The class scores are generally an 80 - element tensor, where each element corresponds to the predicted score for the corresponding object category. The bounding box predictor delta tensor is an 80x4 = 320 - element tensor and contains the bounding boxes for the corresponding object categories. The final processing is performed by the output layer module 1036, which receives the tensor 1034 and executes filtering operations to generate the filtered tensor 1038. Low - scoring (low - classification) objects are excluded from further consideration. The Non - Maximum Suppression module 1040 removes overlapping bounding boxes by removing the overlapping boxes with lower classification scores, resulting in the inference output tensor 151.
[0122] FIG. 11 is a schematic block diagram showing a feature map packing arrangement 1100 in a two-dimensional array in the form of a monochrome frame 1102. Feature maps of three layers, such as feature map 1110, feature map 1112, and feature map 1114, can be arranged within frame 1102. In the example of FIG. 11, frame 1102 includes regions corresponding to each feature map (e.g., feature map 1110). Feature maps 1110, 1112, and 1114 are arranged in a raster scan arrangement that fills monochrome frame 1102. The size of frame 1102 is first set according to the area of all the feature maps arranged in frame 1102 and has an aspect ratio close to the aspect ratio of the target UHD frame, i.e., 3840 / 2160 ~= 1.78. The resolution can be increased, for example, to a multiple of the minimum block size such that the width and height are each a multiple of 4. When arranging the feature maps, due to the mismatch between the feature map size and the frame width, the final frame height can be increased to provide appropriate space, allowing some unused space resulting from the inability to pack the feature maps together without unused space. The sample values in the unused space within frame 1102, such as unused space 1104, are set to the mid-tone point of the frame's bit depth, i.e., 512 for a 10-bit frame. The size of the feature map depends on the CNN backbone 114. In the case of the "Darknet-53" backbone, the size is 136×76 for feature map 1110 and has 256 instances, 68×38 for feature map 1112 and has 512 instances, and 34×19 for feature map 1120 and has 1024 instances. For clarity, FIG. 12 shows a frame 1202 that includes fewer feature maps than exist in a typical application, but the three layers and relative resolution are represented in FIG. 12 as described below. Different CNNs and different splits between the "backbone" section and the "head" section of the CNN can result in different dimensions and numbers of feature maps for each layer, as well as different numbers of layers (i.e., amounts other than three layers).
[0123] When arranging the feature maps in the two-dimensional array in the form of the monochrome frame 1102, the feature maps of the same group of the frame are arranged adjacent to each other within the frame 1102. For example, the group 1106 includes the feature map 1110, and the groups 1108 and 1109 include the remaining feature maps in the layer. Similarly, the group 1114 includes the feature map 1112 having two additional groups for the layer. For the sake of brevity, the grouping for the layer including the smallest feature map (i.e., the feature map 1120) is not shown, but the same packing method for each group is used. Within each group, the feature maps exist in a determined ordering, and the arrangement within the monochrome frame 1102 reflects the ordering.
[0124] When arranging the feature maps in the monochrome frame 1202 of FIG. 12, alignment with respect to a specific boundary such as a 4×4 grid boundary can be maintained. If the feature map size is not a multiple of such an alignment, unused sample space exists between adjacent feature maps. For example, a feature map of size 34×19 is arranged occupying a sample region of 36×20, and the unused space is occupied by intermediate-tone sample values. The existence of the unused space between feature maps reduces the occurrence of coding artifacts in one feature map caused by the content in adjacent feature maps and improves the alignment of the feature maps with respect to the block structure underlying the video codec. For example, in the case of VVC, a minimum block size of 4×4 is typically used.
[0125] In addition to aligning the feature map to a specific alignment grid, it is also possible to perform minimum padding between feature maps, such as two samples. Minimum padding helps prevent artifacts in one feature map caused by the content in adjacent feature maps when the feature map size is a multiple of the alignment grid. For example, a feature map of size 136×76 fits into a 4×4 alignment grid without accompanying unused sample space inserted between itself and an adjacent feature map. The minimum padding area ensures some separation between adjacent feature maps, which can help reduce coding artifacts that cross from one feature map to an adjacent one.
[0126] FIG. 12 is a schematic block diagram showing an alternative feature map packing arrangement 1200 in the monochrome frame 1202. The feature map packing arrangement 1200 is suitable for feature map grouping where there are a number of groupings of four feature maps. The grouping in FIG. 12 can be based on the spatial similarity between the feature maps, resulting in a grouping of similar feature maps. The spatial similarity can be measured using the sum of absolute differences or the sum of squared differences or some other similarity metric. The grouping is applied to the feature maps within the same layer and does not span multiple layers. As seen in FIG. 12, the grouping 1210 includes four feature maps. The feature maps of the grouping 1210 are arranged in the monochrome frame 1202 using sample - wise interleaving so as to occupy an area of 2×2 of the component feature maps. The sample - wise interleaving results in a higher structural detail of the four feature maps shared by the same coding tree structure, and the details between the four feature maps are different for each sample. Thus, a common coding tree structure and shared residuals (excluding the local differences necessary to code adjacent samples of different feature maps) are achieved, resulting in an increase in compression efficiency. When all groups of size 4 are packed into the monochrome frame 1202 for a given layer, the remaining feature maps such as the feature map 1214 are packed adjacent to each other based on the grouping but not in an interleaved manner. The remaining feature maps can be assigned to groups of any size as their group configuration does not affect the packing process apart from the packing order. In the next layer, four groups such as the group 1220 are packed using the sample - wise interleaving method, followed by the packing of feature maps belonging to other - sized groups such as the feature map 1224. For the final layer, four groups such as the group 1230 are packed using the sample - wise interleaving method, followed by the packing of feature maps belonging to other - sized groups such as the feature map 1234.
[0127] FIG. 13 is a schematic block diagram showing a feature map packing arrangement 1300 in a 4:2:0 chroma subsampled color frame 1301. Feature map groups having a high degree of similarity and including two or three feature maps belonging to different layers are arranged in different color channels within a collocated region of the color frame 1301. Accordingly, at least a portion of the positions of a first feature map in one layer corresponds relatively to at least a portion of the positions of a second feature map in another layer. In the case of two feature maps in adjacent layers, the larger feature map is arranged within a luma plane 1302 such as feature map 1304. The smaller of the two feature maps is arranged within a chroma plane 1310 such as feature map 1314. When the group includes three feature maps, the third feature map is smaller in size than the feature map arranged in the chroma plane 1310, and the third feature map is packed into a second chroma plane 1320 so as to be twice in size, resulting in a twice-packed feature map 1324. Since the two or three feature maps of the group are grouped based on spatial similarity, in the example of FIG. 13, coding tools targeting inter-channel correlation are available to improve the compression efficiency when coding the color frame 1301. For example, tools that attempt to predict chroma samples from luma based on a difference model, such as a linear model targeting cross-color component prediction, can be applied. In the case of an inter-slice where a shared coding tree designates luma coding blocks and chroma coding blocks, instead of requiring separate coding trees as in the case where the feature maps are arranged at different positions, the block structures of the two or three feature maps are coded using a single coding tree.
[0128] FIG. 14 is a schematic block diagram showing a bitstream 1400 that holds an encoded and packed feature map and associated metadata. The bitstream 1400 corresponds to the bitstream 121 generated by the video encoder 120 or the bitstream 143 decoded by the video decoder 134. The bitstream includes a group of syntax preceded by a “network abstraction layer” unit header. For example, the NAL unit header 1408 precedes the sequence parameter set (SPS) 1410. The SPS 1410 may include a “profile level tier” (PLT) unit of syntax 1438 that may include a “general constraint information” (GCI) unit of syntax (i.e., constraint flag 1440). The constraint flag 1440 is present in the SPS 1410 when the “gci_present_flag” is present in the SPS 1410 and equal to 1, and is not present in the SPS 1410 otherwise. When the constraint flag is present in the SPS 1410, any one that is activated indicates that the bitstream 1400 conforms to a restricted subset of tools or functions (which may correspond to a sub-profile) shown within the signaled profile of the bitstream 1400. When the constraint flag is not present in the SPS 1410, each constraint flag that would otherwise be signaled is inferred to have a value of zero, and the bitstream conforms to the signaled profile of the bitstream 1400. When each flag within the constraint flag 1440 is set, it indicates the invalidation of a particular tool within the VVC standard, along with the semantics of the flag defined in the VVC standard. A separate set of syntax elements (zero or more instances of the ptl_num_sub_profiles and general_sub_profile_idc syntax elements) identifies the particular sub-profile to which the bitstream conforms, and the definition of the sub-profile is defined outside of the VVC standard. The GCI includes a set of flags, each flag constraining a particular coding tool not used in the bitstream 1400.PLT1438 can signal a specific set of tools known as "profiles" that can be used in bitstream 1400. An example of a profile is "Main10", which provides 8- to 10-bit video with either a 4:0:0 or 4:2:0 chroma format and targets wide deployment. GCI can indicate further restrictions on the set of profile tools to a subset of tools that can correspond to subprofiles. Generally, when video encoder 120 is encoding video samples (i.e., from video source 112 via multiplexer 118), all tools of a given profile can be used to efficiently encode frame data. When video encoder 120 is encoding feature maps packed in a frame (i.e., from module 116), some tools of the VVC standard no longer provide a compression benefit. Tools that do not provide a compression benefit to the packed feature maps need not be tried by video encoder 120 and can be signaled in GCI as not being used in bitstream 1400. SPS1410 also indicates the chroma format, bit depth, and resolution of the frame data represented by bitstream 1400.
[0129] The picture parameter set (PPS) 1412 includes syntax elements that control the low-level behavior of tools including the control of the deblocking filter. The PPS 1412 includes the pps_deblocking_filter_control_present_flag, which, when set, indicates that the deblocking filter settings are controlled in the PPS 1412. When the pps_deblocking_filter_control_present_flag is set, the pps_deblocking_filter_disabled_flag is present in the PPS 1412. When the pps_deblocking_filter_disabled_flag is present in the PPS 1412 and set to 1, the deblocking filter is disabled for all pictures that reference the PPS 1412, unless a further override of the deblocking control occurs in the picture header or slice header 1418 of the picture. When the pps_deblocking_filter_disabled_flag is present in the PPS 1412 and set to 1, the pps_deblocking_filter_override_enabled_flag is present in the PPS 1412. When the pps_deblocking_filter_override_enabled_flag is present and set to 1 in the PPS 1412, the slice header 1418 or picture header of each picture includes an additional flag that can override the enabling or disabling of the deblocking filter indicated by the pps_deblocking_filter_disabled_flag.
[0130] The SEI message 1413 encodes the feature map grouping 1430 as determined by the group determination module 510 and quantization range 1432, as determined by the range determination module 514. Appendix A shows the exemplary syntax and semantics of the SEI message 1413. The packing format used by the packing module 522 may also use an index to select one feature packing format from an enumeration of all available feature packing formats to be encoded in the SEI message 1413. The specific CNN backbone used to generate the feature map may be indicated within the SEI message 1413 using an index to select one CNN backbone from an enumeration of a set of predetermined CNN backbones, some or all of which may be available to the source device 110. From the CNN backbone type index, the number of layers and channels in each layer, as well as the resolution of each feature map in each layer, may be determined. In the case of grouping where the feature maps within a given group are in the same layer, a separate group list of feature map indices is coded for each layer. In the case of grouping where the feature maps within a given group can span multiple layers, the feature map index and layer index pairs are coded as items within each group. In the case of grouping where they exist in adjacent layers and there is at most one feature map in each layer, the layer index is only required for the first feature map within the group. If the group includes feature maps from all layers, for example, in all three layers, the feature map index is implicitly applied to one feature map in each layer, so the group index is not required. If all the feature maps of a given layer belong to one separate layer, one quantization range is coded per layer.
[0131] As shown in FIG. 14, each frame is encoded in the bitstream 1400 as an "access unit" such as the access unit 1414. Each access unit includes one or more slices such as the slice 1416. For the first access unit of the bitstream, generally for the "random access point" access unit, intra-slices are used to avoid any prediction dependencies on other access units in the bitstream 1400. The slice 1416 includes a slice header 1418 and subsequent slice data 1420. The slice data 1420 includes a sequence of CTUs that gives a coded representation of the frame data. The CTU is square and typically has a size of 128×128, which is not well-aligned with typical feature map sizes. Placing the feature map at a minimum block size such as a 4×4 grid partially improves this misalignment.
[0132] FIG. 15 shows a method 1500 for executing the first part of the CNN and encoding the resulting feature map for a frame of video data. The method 1500 can be implemented using a device such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1500 can be implemented by the source device 110 as one or more software code modules of the application program 233 under the execution of the processor 205. The software code modules of the application program 233 implementing the method 1500 can be resident, for example, on the hard disk drive 210 and / or the memory 206. The method 1500 is repeated for each frame of video data generated by the video source 112. The method 1500 can be stored in a computer-readable storage medium and / or the memory 206.
[0133] Method 1500 starts at execution CNN first part step 1510. At step 1510, CNN backbone 114 executes a subset of layers of a specific CNN under the execution of processor 205 to convert input frame 113 into intermediate tensor 115. Depending on the use of a prediction head or FPN, tensor 115 may include multiple tensors. Method 1500 operates to encode a tensor corresponding to one frame of video data from video source 112. Next, the control in processor 205 proceeds from step 1510 to feature map similarity determination step 1520. Intermediate tensor 115 may be stored, for example, in memory 206 and / or hard disk drive 210.
[0134] At feature map similarity determination step 1520, module 116 generates a similarity matrix including a measure of similarity of each feature map with each feature map within each layer under the execution of processor 205. The similarity matrix may be stored, for example, in memory 206 and / or hard disk drive 210. The similarity measure may be the mean squared error (MSE) of two feature maps, or the sum of absolute differences (SAD) of two feature maps, or some other measure of difference. If it is desired to measure the similarity of feature maps in different layers, a feature map with a lower spatial resolution may be upscaled (e.g., using nearest neighbor interpolation) to generate a resolution compatible with a higher spatial resolution for the purpose of the difference measurement. To reduce computational overhead, step 1520 may rarely be executed, for example, only for each random access point in CLVS or for the first picture of CLVS. Next, the control in processor 205 proceeds from step 1520 to feature map grouping determination step 1530.
[0135] In the feature map group determination step 1530, the group determiner 510 determines, under the execution of the processor 205, a set of groups to which the feature maps are assigned. The groups of feature maps can be stored, for example, in the memory 206 and / or the hard disk drive 210. With reference to FIG. 17, the operation of the group determiner 510 will be described. Step 1530 needs to be executed when the similarity matrix of step 1520 is determined, for example, for the first picture of the CLVS or for all random access points within the CLVS. The control in the processor 205 proceeds from step 1530 to the feature map placement determination step 1540.
[0136] In the feature map placement determination step 1540, the packer module 522 determines, under the execution of the processor 205, the positions at which each feature map is placed within the frame. When the frame is a monochrome frame, the feature maps are placed in raster scan order filling the frame area, and the frame area is initialized based on the total area of all the feature maps to be packed into the frame and the target aspect ratio. The packing arrangement is described with reference to FIGS. 11 to 13. The packing format in use is determined from the "packing_format" syntax element decoded from the SEI message 1413, which is described with reference to Appendix A. The feature maps belonging to a given group are packed sequentially and in the order in which the feature maps are listed within each group. As described with reference to FIG. 13, groups of size 2 or 3 feature maps having feature maps belonging to different layers are packed together spatially but in different color channels. Since the number and size of the feature maps do not change during the operation of the source device 110, the placement is determined once and can be saved for use with subsequent frames. The packed frame can be stored, for example, in the memory 206 and / or the hard disk drive 210. Next, the control in the processor 205 proceeds from step 1540 to the group range determination step 1550.
[0137] In group range determination step 1550, range determiner 514 determines, under the execution of processor 205, the range of floating-point data in each group of the feature maps determined in step 1530. The determined ranges can be stored, for example, in memory 206 and / or hard disk drive 210. In the case of symmetric operation, the range of a group is the largest magnitude (absolute) value of the values within the feature map belonging to the group. The range provides a value for the normalization of the feature map data before quantization and conversion to integer sample values. In the case of asymmetric operation, positive and negative ranges are determined for each group of the feature maps, indicating the largest positive and largest negative values encountered within the group of feature maps. The quantization range is determined for each group of feature maps within tensor 115. The quantization range can be determined for tensors of all frames of the video data, or a lower frequency of update can be applied. To reduce signaling overhead, the quantization range can be determined only for intra pictures or random access pictures in the video bitstream. The range of the floating-point data tensor of subsequent frames for which the quantization range has not been determined can exceed the previously determined quantization range. A safety margin can be introduced by increasing the size of the quantization range determined by some specified scaling factor. Multiplying the quantization range by a fixed factor, for example 8 / 7, compresses the sample range of the data used to a range that approximately corresponds to the video range used for YCbCr video data. Frames after which the quantization range may not be determined have some headroom beyond this range up to the limits of the sample bit depth, for example [0..1023] for 10-bit video. Next, control in processor 205 proceeds from step 1550 to feature map quantization step 1560.
[0138] In the feature map quantization step 1560, the quantizer module 518 quantizes each feature map from floating point values to integer sample values according to the quantization range of the group to which the feature map belongs under the execution of the processor 205. The determined integer sample values can be stored, for example, in the memory 206 and / or the hard disk drive 210. Scaling to a normalized range with a maximum value of 1.0 is first performed, followed by multiplication to the sample range and addition of an offset, resulting in the utilization of a substantial portion of the sample size. In the case of 10-bit video, the multiplication factor 512 is used, and the offset quant_offset512 is also used. A smaller multiplication factor can be used to reduce the non-linear effects from overshoots that may be introduced by the video encoder 120 and the video encoder 144. If not yet adjusted by a fixed factor such as 8 / 7 to align the quantization range with the video range commonly used in YCbCr video data, a scaling factor scale_f of 7 / 8x512 = 448 can be used. In the case of 8-bit video data, an offset of 128 and a scaling factor of 128 or 112 for video range aligned operation can be used. If the quantization range is determined for the tensor from the previous frame and not updated for the current frame, it is possible for the input floating point values to exceed the quantization range for the feature map group to which the feature map belongs. A clipping operation is applied to prevent overflow when mapping the floating point values to integer sample values. In one arrangement of the quantizer module 518, clipping to the range indicated by the quantization range of the floating point values is applied to prevent overflow. Clipping the floating point values to the quantization range ensures that all samples are within the range of [quant_offset - scale_f, quant_offset + scale_f]. In another arrangement of the quantizer module 518, clipping is applied after the application of quant_offset and scale_f, at which point the determined values can fall outside the range indicated by the bit depth and is applied before conversion to integer sample values.Clipping is applied to ensure that the integer sample values are within the range indicated by the bit depth, i.e., [0..(1<<bit_depth)-1]. Clipping after scaling and before integer conversion, in combination with the scale_f value that utilizes a smaller range such as the video range, allows some headroom in subsequent frames to exceed the quantization range determined from the previous frame. There is also some tolerance for a certain amount of overshoot in the operation of the video encoder 120 and video decoder 144 before clipping introduces non-linear distortion in the conversion from floating-point tensors to integers and back to floating-point tensors. Next, the control in the processor 205 proceeds from step 1560 to the feature map packing step 1570.
[0139] In the feature map packing step 1570, the packer module 522 packs the integer feature map 520 under the execution of the processor 205 to generate the packed feature map frame 117. The quantized feature map 520 corresponding to the feature map from each layer of the tensor 115 can be stored, for example, in a memory buffer configured within the memory 206 that holds one frame of video data and / or the hard disk drive 210. With reference to FIGS. 11 - 13, the packing format of the feature map will be described. Next, the control in the processor 205 proceeds from step 1570 to the metadata encoding step 1580.
[0140] In the metadata encoding step 1580, the entropy encoder 638, under the execution of the processor 205, encodes the feature map grouping 512 and the quantization range 516, i.e., the metadata 125, into the bitstream 121. The metadata 125 can be encoded for use as the SEI message 1413. The format of the SEI message 1413 is described with reference to Appendix A. Next, the control in the processor 205 proceeds from step 1580 to the frame encoding step 1590. In the first picture (where the picture order count is equal to 0), the "layers_update", "groups_update", and "qr_update" flags in the SEI message 1413 are set, and the feature map layers and dimensions, the feature map group definition, and the associated quantization range are encoded in the bitstream 121. The "qr_update" flag in the SEI message 1413 can be set periodically, and the quantization range information is updated accordingly. In the case of a random access configuration, all random access points or intra-pictures may include the updated quantization range. In the case of a low-latency configuration, the periodic update of the quantization range can be performed for one picture approximately every second corresponding to the intra-picture periodicity of the random access configuration. Updating the quantization range for several intra-pictures enables continuous adaptation (i.e., intra / inter-slice selection) to data independent of the bitstream structure, for example, when intra-pictures occur very rarely in the bitstream.
[0141] In frame encoding step 1590, video encoder 120 encodes frame 119 into bitstream 121 under the execution of processor 205. When source device 110 is configured to encode the feature map, frame 119 is obtained from feature map frame 117 packed via multiplexer 118. When source device 110 is configured to encode the feature map, video encoder 120 may use a subset of the coding tools available in the profile of the video coding standard. The subset of coding tools may be signaled using general constraint flags. For example, the "Main10" profile may be signaled in the profile level tier syntax 1438 in bitstream 120, and the general constraint flag 1440 may signal that the following tools: LFNST (via gci_no_lfnst_constraint_flag), MIP (via gci_no_mip_constraint_flag), LMCS (via gci_no_lmcs_constraint_flag), ISP (via gci_no_isp_constraint_flag), Affine (via gci_no_affine_motion_constraint_flag), GPM (via gci_no_gpm_constraint_flag), MMVD (via gci_no_mmvd_constraint_flag) are not used in bitstream 120. In addition to or instead of the use of GCI flags, the sub-profile may be defined outside the VVC standard for feature map encoding and may be identified within the bitstream using specific values of the general_sub_profile_idc syntax element included in SPS 1410. Disabling the deblocking filter improves the compression efficiency and task performance when encoding the feature map.In the VVC coding standard, for a picture referring to a picture parameter set in bitstream 121 with pps_deblocking_filter_disabled_flag set to "1", the deblocking filter is disabled for the picture unless overridden at the slice or picture level by coding sh_deblocking_filter_disabled_flag with a value of "1" or by coding ph_deblocking_filter_disabled_flag with a value of "1". Deblocking is not explicitly disabled using the constraint flag of VVC standard version 1. Thus, disabling the deblocking filter does not constitute part of a tool subset that may be equivalent to a subprofile for feature map coding, even though such disabling may have advantages. Method 1500 is complete and the processing in processor 205 proceeds to the next frame.
[0142] FIG. 16 shows a method 1600 for decoding a feature map from encoded data and executing the second part of the CNN. The method 1600 can be implemented by a device such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, the method 1600 can be implemented by the destination device 140 as one or more software code modules of the application program 233 under the execution of the processor 205. The method 1600 is repeated for each frame of the video data encoded in the bitstream 143. The software code module of the application program 233 implementing the method 1600 can be stored, for example, in the hard disk drive 210 and / or the memory 206. The method 1600 starts with a feature map grouping decoding step 1610. The method 1600 is configured to determine one or more parameters related to quantization and perform inverse quantization on the data samples decoded from the encoded data to derive a feature map according to the one or more parameters. In one configuration, the method 1600 is configured to de-interleave the feature maps corresponding to the groups of feature maps after the inverse quantization is performed. As will be described in detail below, the method 1600 can be used to determine a feature map based on an image of a first group of feature maps arranged in a first frame (or two-dimensional array) and a second group of feature maps arranged in a second frame (or two-dimensional array), where the first frame is different from the second frame.
[0143] In the feature map grouping decoding step 1610, the entropy decoder 720, under the execution of the processor 205, decodes from the SEI message 1413 a structure indicating the assignment of each feature map of each layer to one or more groups of feature maps (i.e., the feature map group 820). The decoded structure can be stored, for example, in the memory 206 and / or the hard disk drive 210. The syntax of the feature map grouping in the SEI message 1413 is described with reference to Appendix A. Next, the control in the processor 205 proceeds from step 1610 to the quantization range decoding step 1620.
[0144] In quantization range decoding step 1620, entropy decoder 720, under the execution of processor 205, decodes parameters in the form of quantization range 822 for each feature map group of 820 as determined from SEI message 1413 in step 1610. Quantization range 822 is shared by each of a plurality of feature maps within the feature map group. The quantization range 822 determined in step 1620 can be stored, for example, in memory 206 and / or hard disk drive 210. When symmetric quantization is used, in step 1620, a single value is decoded for each feature map group, representing the maximum magnitude of the floating point data within the feature maps belonging to each group. When asymmetric quantization is used in step 1620, a pair of values representing the maximum and minimum values of the floating point data within the feature maps belonging to each group are decoded for each feature map group. Processor 205 can be operative to execute step 1620 for all frames of the video data, or processor 205 can be operative to execute step 1620 at a less frequent rate. Step 1620 can be executed at a random access point or intra picture in bitstream 143. When step 1620 is not executed for all frames, the feature map grouping and quantization range data are carried over subsequent frames for reuse until a new set of feature map grouping and / or quantization range data is decoded from bitstream 143. Next, control in processor 205 proceeds from step 1620 to frame decoding step 1630.
[0145] In frame decoding step 1630, entropy decoder 114 operates under the execution of processor 205 to generate frame 145 by decoding a portion of bitstream 143 corresponding to access unit such as AU1414. Frame 145 may include a packed feature map or may include, for example, an image corresponding to a frame from video source 112. If frame 145 includes an image frame, i.e., does not include a packed feature map, method 1600 ends and then decoding proceeds to the next frame. The frame 145 generated in step 1630 may be stored, for example, in memory 206 and / or hard disk drive 210. If frame 145 includes a packed feature map, processor 205 proceeds from step 1630 to feature map placement determination step 1640.
[0146] In feature map placement determination step 1640, unpacker module 810 determines, under the execution of processor 205, the position of each feature map of each layer within frame 145. Using the spatial size of each feature map, feature map grouping, and the number of feature maps in each layer, the placement information is determined according to the approach of step 1540 as described with reference to FIGS. 11-13. If the feature map size, quantity, and packing format do not change compared to the previous frame, the feature map placement data is retained from the previous frame. Next, control in processor 205 proceeds from step 1640 to feature map unpack step 1650.
[0147] In feature map unpack step 1650, unpacker module 810 extracts samples from frame 147 under the execution of processor 205 and generates integer feature map 812 according to the determined feature map placement from step 1640. The integer feature map 812 determined in step 1650 may be stored, for example, in memory 206 and / or hard disk drive 210. Next, control in processor 205 proceeds from step 1650 to feature map inverse quantization step 1660.
[0148] In the feature map inverse quantization step 1660, the inverse quantization module 814, under the execution of the processor 205, converts the integer feature map 812 into a floating-point feature map, which is assembled into the tensor 149 as the input to the CNN head 150. The floating-point feature map can be stored, for example, in the memory 206 and / or the hard disk drive 210. The integer samples are converted to floating-point precision, and the quant_offset value and scale_f value in step 1560 are used to shift the samples to the normalized range. For each feature map within the feature map group, the quantization range 822 of the feature map group of 820 is multiplied by the normalized range value to create a floating-point feature map. The floating-point feature map is assembled into the tensor 119 as a multi-dimensional array, and generally, the dimensions are (frame, channel, height, width). When the FPN is used, the assembly operates to write the feature map from a set of tensors in 119 corresponding to the FPN layers into one tensor. The control in the processor 205 proceeds from step 1660 to the CNN second part execution step 1670.
[0149]
[0150] In the CNN second part execution step 1670, the CNN head 150, under the execution of the processor 205, executes the remaining stages of the CNN (i.e., the stages specific to a particular task). The decoded, unpacked, and inverse quantized tensor 149 is input to the CNN head 150. Inside the CNN head 150, a series of convolution, normalization, fully connected layer operations, and activation stages are executed to obtain the CNN result 151. The CNN result 151 is stored, for example, in the task result buffer 152 configured in the memory 206. The method 1600 ends, and the control in the processor 205 proceeds to the next frame.
[0150] In one arrangement of method 1600, steps 1610 and 1620 are performed when indicated by flags in the SEI message 1413. Step 1610 is performed when indicated by the "groups_update" flag decoded from the SEI message 1413, and step 1620 is similarly performed when indicated by the "qr_update" flag decoded from the SEI message 1413.
[0151] FIG. 17 shows a method for determining the grouping of feature maps. Method 1700 can be implemented by a device such as a configured FPGA, ASIC, or ASSP. Alternatively, as described above, method 1700 can be implemented by the source device 110 as one or more software code modules of the application program 233 under the execution of the processor 205. The software code module of the application program 233 implementing method 1700 can be stored, for example, in the hard disk drive 210 and / or the memory 206. Method 1700 starts with a list initialization step 1710.
[0152] In the list initialization step 1710, the group determiner 510 creates a set of groups under the execution of the processor 205 such that each feature map in a given layer is assigned to a single group. The groups are represented as an ordered list of feature maps having an adjacency relationship within one group to indicate the similarity of pairs of feature maps. The ordered list is initialized and can be stored in the memory 206 and / or the hard disk drive 210. Then, the control in the processor 205 proceeds from step 1710 to step 1720 of finding the most similar feature map pair.
[0153] In step 1720, the group determiner 510, under the execution of the processor 205, determines a pair of feature maps having the greatest similarity in the similarity matrix from step 1520. Since the similarity matrix is a measure of the difference between feature maps, the pair with the greatest similarity is identified by the position within the matrix having the minimum value. If the similarity matrix indicates that no further pairs of feature maps have similarity (i.e., all entries are set to "not-a-number" (NaN)), this value is returned. Next, control in the processor 205 proceeds from step 1720 to the remaining map test step 1730.
[0154] In the remaining map test step 1730, the group determiner 510, under the execution of the processor 205, determines whether all pairs of feature maps were identified in step 1720. If step 1720 returned NaN, then all groups of feature maps are considered for joining and there is no need to further connect the groups together (i.e., form one larger group from two smaller groups). If there is no need to further connect the groups together, method 1700 ends and a set of groups is obtained as a result. Otherwise, for pairs of feature maps having a measured similarity (i.e., the result of the minimum operation is not NaN), then control in the processor proceeds from step 1730 to the group index discovery step 1740.
[0155] In the group index determination step 1740, the group determiner 510, under the execution of the processor 205, determines to which group each feature map belongs and the index within each group of feature maps. Next, control in the processor 205 proceeds from step 1740 to the connectable group test step 1750.
[0156] In connectable group test step 1750, the group determiner 510, under the execution of the processor 205, determines whether pairs of feature maps can be connected to form one larger group. If any of the feature maps is in the center of the corresponding group, the nodes in the list may have only a preceding node and a succeeding node, so it is impossible to connect the feature maps to each other. The entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, preventing further consideration of this pair of feature maps. Also, if two feature maps belong to the same group, then the entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, preventing further consideration of combining these two feature maps. If both feature maps are at the start or end of their respective groups, the feature maps can be connected to each other to form one larger group from two initial groups. In a configuration where the group size is limited to a specific number of feature maps, for groups that can be combined, if the resulting group size exceeds the group size limit, the entry in the similarity matrix corresponding to the pair of feature maps is set to NaN, and the groups are not combined with each other. To reduce the iterations for determining the feature map groups, if the group size is limited and after combination the resulting group is equal to the group size, the rows and columns in the similarity matrix corresponding to each end point of the newly formed group are set to NaN, preventing further consideration of these feature maps for combination into a larger group. When the groups are connected, the control in the processor 205 proceeds to the group connection step 1760.
[0157] In group connection step 1760, group determiner 510 connects together two groups including the pair of feature maps identified in step 1720 under the execution of processor 205. This group is connected such that the pairs are adjacent in the newly formed larger group. The connected group determined in step 1760 may be stored, for example, in memory 206 and / or hard disk drive 210. When a feature map is in a previous group of two or more feature maps and is connected to another group, the feature map now occupies some position in the middle of the newly formed larger group. When a feature map becomes an intermediate node within a list or group, the rows and columns within the similarity matrix corresponding to that feature map are set to NaN, preventing further consideration of combining that feature map with other groups. The processor 205 then proceeds from step 1760 to step 1720 to determine the next pair of feature maps to consider for combination into a larger group.
[0158] In one arrangement, all the feature maps within each layer are merged into one group. When packed according to packing format 1100, the resulting feature map arrangement places similar feature maps relatively close together. Then, using the intra-block copy coding tool of VVC, a portion of one feature map can be predicted from previous and adjacent feature maps with some restrictions on the block selection resulting from the IBC virtual buffer. Since the residuals of the feature maps are continuous and tend to be coded more efficiently using various transforms, the IBC search may use Hadamard transform as a cost estimate in addition to, or instead of, SAD cost estimation.
[0159] In another arrangement, the group size is limited to 4. When the group size is limited to 4, the "four groups" feature map can be arranged using the sample-wise interleaving packing format 1200 to achieve compression efficiency from a shared block structure and a certain degree of shared prediction signals among the four feature maps. The similarity threshold can be applied in the execution of method 1700 such that only groups of four feature maps that are very similar are determined. Other less similar feature maps may be assigned to one larger remaining group packed in raster scan format.
[0160] In yet another arrangement, groups are determined across layers and the size may be limited to 3, which is particularly suitable for a three-layer FPN. Inter-layer grouping enables the use of the packing arrangement 1300 to be packed in a collocated manner and allows the use of the VVC cross-component prediction tool to improve compression efficiency. When the inter-layer group is used to collocate feature maps across layers, combined grouping is possible, while intra-layer grouping arranges the groups based on the layer that occupies the luma channel of the frame.
[0161] In yet another arrangement, there is one group per layer and all feature maps of the layer are within the group of that layer. Within the group, the ordering of the feature maps is encoded to allow tools such as IBC to predict one feature map from adjacent feature maps by arranging similar feature maps within the layer close to each other.
[0162] In yet another configuration, there is one group per layer and within each group, the feature maps are arranged according to the channel index of their tensors. In such a configuration, one quantization range is coded per layer, resulting in a lower overhead for quantization range coding in the SEI message 1413.
[0163] Since various grouping approaches are possible, the "grouping_type" syntax element is included in SEI message 1413 and is further described with reference to Appendix A.
[0164] FIG. 18 shows a method for selecting a set of coding tools or functions of a video standard according to the type of frame data to be encoded. Method 1800 can be implemented by a device such as a configured FPGA, ASIC, or ASSP. Alternatively, as described below, method 1800 can be implemented by source device 110 as one or more software code modules of application program 233 under the execution of processor 205. The software code modules of application program 233 that implement method 1800 can be stored, for example, in hard disk drive 210 and / or memory 206. The steps of method 1800 are configured to determine whether source device 120 generates encoded video data including encoded data of a feature map based on a convolutional neural network (CNN). The steps of method 1800 are also configured to generate encoded video data using a plurality of coding tools or functions for encoding video data when source device 120 generates encoded data including encoded video data of a feature map. Also, as described, the steps of method 1800 are configured to generate encoded data of a feature map that uses a first portion of a plurality of coding tools or functions but does not use a second portion of the plurality of coding tools or functions when source device 120 generates second encoded data including encoded data of a feature map.
[0165] Method 1800 begins with a frame type configuration determination step 1810.
[0166] In frame type configuration step 1810, source device 110 is configured to operate on either video data or feature map data under the execution of processor 205. The configuration may be the result of receiving a command via network 200 or 222, or may be by direct user control via a user interface (e.g., via keyboard 202, mouse 203). Next, the control in processor 205 proceeds from step 1810 to frame-containing feature map data test step 1820.
[0167] In step 1820, source device 110 determines, under the execution of processor 205, whether source device 110 generates encoded normal video frame data or encoded feature map data based on a convolutional neural network (CNN). The encoded data complies with a coding standard (e.g., the VVC standard). When source device 110 is configured for video frame data, the control in processor 205 proceeds from step 1820 to video data functions selection step 1830. When source device 110 is configured for feature map transmission, the control in processor 205 proceeds from step 1820 to feature map functions selection step 1840.
[0168] In video data function selection step 1830, multiplexer 118 directly routes frame data 113 to video encoder 120 under the execution of processor 205. A set of functions or coding tools is selected and used to encode frame data 119. The set of functions corresponds to the functions available in the profile of the video coding standard being used to encode frame data 119. The set of functions corresponds to the first part of the plurality of coding tools or functions described above. For example, in step 1830, a set of functions defined for the "Main10" profile of the VVC standard may be selected. Control in processor 205 proceeds from step 1830 to frame data encoding step 1850.
[0169] In feature map function selection step 1840, multiplexer 118 routes the packed feature map 117 to video encoder 120 as frame data 119 under the execution of processor 205. A set of functions or coding tools, which is a subset of the coding tools of the standard profile, is selected for use in encoding frame data 119. The subset of coding tools can be selected by activating a "constraint flag" to disable certain coding tools or functions of the video coding standard being used to encode frame data 119. The disabled coding tools or functions represent the second part of the coding tools or functions described above and can be at least one of low frequency non-separable transform (LFNST), matrix intra prediction (MIP), linear mode chroma scaling (LMCS), affine prediction mode, geometric partitioning mode (GPM), ISP, and deblocking filter. In this example, the prohibition of the use of the second part of the coding tools or functions can be indicated using the constraint flag. For video coding standards other than VVC, coding tools providing similar functions can be similarly disabled. Control in processor 205 proceeds from step 1840 to frame data encoding step 1850.
[0170] In frame data encoding step 1850, video encoder 120 encodes frame data 119 under the execution of processor 205 according to a set of functions or coding tools. Method 1800 ends and source device 110 proceeds to the next frame. As a result of method 1800, bitstream 121 includes (e.g., in the form of a set of constraint flags appearing at the beginning of the bitstream) that clearly indicates whether the contained data is normal video data or packed feature map data. Further, when bitstream 121 encodes packed feature map data, SEI message 1413 exists for at least one frame, enabling destination device 140 to further process the data after decoding the bitstream (e.g., processing decoded frame data 145 using modules 148 and 150). If destination device 140 is only intended to execute tasks according to CNN head 150, the destination device does not need to decode bitstream 143 when it is shown to include normal video data beyond the initial profile and constraint flag syntax. A destination device that only outputs task result 151 to task result buffer 152 and does not output the decoded video (e.g., to display device 160) does not need to implement coding tools or functions that are shown to be disabled via the constraint flag.
[0171] In the arrangement of method 1800, instead of indicating which tools are disabled for feature map coding by setting constraint flags, the tools are indicated, for example, in the sequence parameter set or equivalent syntax structure, by disabling enable flags.
[0172] In the arrangements of methods 1500 and 1600, steps 1580 and 1610 encode and decode the feature map group size as a log2 value (i.e., the feature map group size needs to be a power of 2 value), and an offset of 1 is applied so that a coding value of zero corresponds to a feature map group size of 1. The 'log2_group_size_minus1' syntax element is used to encode the feature map group size.
[0173] In another arrangement of methods 1500, 1600, and 1700, the feature map groups are constrained to include feature maps indexed in a monotonically increasing order within a given layer. When the feature maps are present in the index in a monotonically increasing order within each group, the group configuration can be encoded using a bitmap indicating the presence or absence of a given feature map within the group. For subsequent groups, the coding bitmap can be reduced in length to omit the feature map indices already assigned to previous groups.
[0174] In the arrangement of the CNN backbone 310, the dimensions of the tensor, and thus the size of the resulting feature maps, are selected to match the block size of the VVC standard. Generally, for rectangular videos and a default CTU size of 128×128, the width and height of the feature maps can be powers of 2. For example, the sizes of three layers can be 128×64, 64×32, and 32×16. When the feature map size is a power of 2, the alignment of the features packed in the block sizes available in the VVC standard due to quadtree, binary, or ternary partitioning is improved, and the possibility of coding artifacts within one feature map caused by the content of adjacent feature maps is reduced.
[0175] In the arrangement of bitstream 1400, as additional syntax present when the "sps_extension_flag" equal to 1 for SPS extension is active via the flag, SPS 1410 includes a sps_deblocking_filter_enabled_flag for controlling the deblocking filter. When sps_deblocking_filter_enabled_flag is equal to zero, pps_deblocking_filter_control_present_flag in PPS 1412 must be set to 1, thus the deblocking filter control is explicitly coded, pps_deblocking_filter_override_enabled_flag in PPS 1412 must be set to zero, thus the slice header or picture header override of the deblocking control set in PPS 1412 is prohibited, pps_deblocking_filter_disabled_flag in PPS 1412 must be set to zero, and in-loop filtering is disabled. When sps_deblocking_filter_enabled_flag is equal to 1, these constraints for pps_deblocking_filter_control_present_flag, pps_deblocking_filter_override_enabled_flag, and pps_deblocking_filter_disabled_flag are not applied. When gci_no_deblocking_filter_flag exists in constraint flag 1440 and is set to 1, sps_deblocking_filter_enabled_flag in SPS 1410 must be set to zero. When gci_no_deblocking_filter_flag is set to zero, no constraint is applied to sps_deblocking_filter_enabled_flag in SPS 1410.When the sps_deblocking_filter_enabled_flag does not exist in SPS1410, the constraints applicable to the pps_deblocking_filter_control_present_flag, pps_deblocking_filter_override_enabled_flag, and pps_deblocking_filter_disabled_flag are applied when the gci_no_deblocking_filter_flag is set to 1. By explicitly prohibiting the application of the deblocking filter via the constraint flag, it becomes possible to define a sub-profile for feature map encoding that excludes the application of the deblocking filter. The gci_no_deblocking_filter_flag may exist in the area of constraint flag 1440 including gci_reserved_zero_bits in version 1 of the VVC standard. When the application of system 100 requires high quality, i.e., a high bit rate, achieved using a low value of quantization parameter 692, deblocking may not be necessary and the constraint flag may be used, for example, for feature map encoding and deblocking may be completely omitted. Industrial Applicability
[0176] The described configuration is applicable to the computer and data processing industries, and in particular, to digital signal processing for encoding and decoding signals such as video and image signals that achieve high compression efficiency. By providing one or more of the above-described constraint flags, it becomes possible to select a subset of the tools of a given profile (equivalent to "sub-profiling"). The selection of a subset of tools provides several advantages, such as implementation advantages for vendors of VVC, since the vendor can specify a subset of the profile that excludes unnecessary or otherwise problematic coding tools, for example, from the perspective of complexity.
[0177] Configurations are also disclosed for quantizing floating-point tensor data within a group of channels or feature maps and packing the resulting integer values into a planar frame. Grouping methods and very coarse grouping of the trade-off are disclosed that have very fine granularity of grouping with low overhead for quantization range data and very high overhead for quantization range data, and the intermediate granularity of grouping provides advantages in task performance.
[0178] The above describes only some embodiments of the present invention, and modifications and / or changes can be made without departing from the scope and spirit of the present invention. The embodiments are illustrative and not limiting.
[0179] Appendix A: The SEI message format and related semantics for representing metadata related to feature map packing and quantization in a bitstream are as follows.
[0180] [Table 1]
[0181] Feature Map Packing Information Semantics The syntax structure unpacks the feature map planar frame and specifies the information necessary to convert it to a tensor for performing an inference task.
[0182] A syntax element with descriptor u(n) indicates that the syntax element is coded using n bits and interpreted as an unsigned integer value. A syntax element with descriptor ue(v) indicates that the syntax element is coded as an exponential Golomb value and interpreted as an unsigned integer value.
[0183] The persistence of the feature map information SEI message lasts from the associated AU until the next occurrence of the feature map information SEI message or until the CLVS ends.
[0184] A frame_type equal to 0 indicates that the feature map data does not contain the packed AU, and a frame_type equal to 1 indicates that the feature map data contains the packed AU.
[0185] A layers_update equal to 1 indicates that this instance of the feature map packing information SEI message defines the number, dimension, and amount of the feature maps in each layer.
[0186] A groups_update equal to 1 indicates that this instance of the feature map packing information SEI message defines the number and configuration of the feature map groups.
[0187] A qr_update equal to 1 indicates that this instance of the feature map packing information SEI message signals the update of the quantization range of the feature map groups.
[0188] The backbone_id indicates the type of the network backbone and the extraction point, implicitly signaling the layer count and dimension of the tensor, and thus the dimension of the feature map. The following table shows some pre-defined network backbones, the related layer count, the feature map count, and the dimension.
[0189]
Table 2
[0190] The layer_cnt specifies the number of layers present in the frame.
[0191] The fm_cnt[layer_idx] specifies the number of feature maps present at layer_idx.
[0192] The fm_width[layer_idx] specifies the width of the feature map at layer_idx.
[0193] fm_height[layer_idx] specifies the height of the feature map of layer_idx.
[0194] orig_source_width specifies the width of frame 112 in the luma samples before resizing for backbone operation, i.e., before the resizer module 304.
[0195] orig_source_height specifies the height of frame 112 in the luma samples before resizing for backbone operation, i.e., before the resizer module 304.
[0196] packing_format specifies the format of the packed feature map data within the frame. The formats are enumerated according to the following table.
[0197]
Table 3
[0198] grouping_type specifies the range of the feature map groups by setting the ExplicitGrouping flag, ExplicitGroupSize flag, and ExplicitLayerId flag.
[0199] An ExplicitGrouping flag equal to 1 indicates that the feature map grouping is explicitly signaled in the bitstream, and an ExplicitGrouping flag equal to 0 indicates that the feature map grouping is implicitly determined based on grouping_type.
[0200] An ExplicitGroupSize flag equal to 1 indicates that the size of each feature map group is explicitly signaled in the bitstream, and an ExplicitGroupSize flag equal to 0 indicates that the size of each feature map group is implicitly determined based on the grouping_type.
[0201] An ExplicitLayerId flag equal to 1 indicates that a group can contain feature maps in different layers, and an ExplicitLayerId flag equal to zero indicates that a group is implicitly limited to a single layer.
[0202] The following table shows the values assigned to the ExplicitGrouping flag, ExplicitGroupSize flag, and ExplicitLayerId according to the grouping_type. When implicit signaling is used, the implicit behavior is explained.
[0203]
Table 4
[0204] group_cnt exists when the ExplicitGrouping flag is equal to 1 and signals the number of feature map groups. When the ExplicitGroupingFlag is equal to zero, group_cnt is inferred based on the grouping_type according to the above table.
[0205] quant_type indicates the type of quantization operation according to the following table.
[0206]
Table 5
[0207] qr_fraction_precision specifies the precision with which the fractional part of the floating-point quantization range is coded in bits.
[0208] The group_size exists when the ExplicitGrouping flag is 1 and the ExplicitGroupSize flag is 1. The group_size specifies the size of group grp_idx. If the group_size does not exist, it is inferred according to the 'Implicit Rules' described in the 'grouping_type' table.
[0209] fm_idx[grp_idx][fm_idx] specifies the feature map index or channel index at position fm_idx within group grp_idx.
[0210] layer_id[grp_idx][fm_idx], if it exists, specifies the layer index for the corresponding feature map identified by fm_idx[grp_idx][fm_idx]. If the layer_idx does not exist, it is inferred. For group_type equal to 1, 2, or 3, the feature maps of layer 0 are first assigned to one or more groups. When all the feature maps of layer 0 are assigned to groups, the feature maps of layer 1 are assigned to one or more groups, and so on. For group_type equal to 4, one group contains all the feature maps of all layers.
[0211] qr_exp[grp_idx] specifies the exponent part of the quantization range of group grp_idx.
[0212] qr_exp_sign[grp_idx] specifies the sign of the exponent part of the quantization range of group grp_idx.
[0213] qr_fraction[grp_idx] specifies the fractional part of the quantization range of group grp_idx with the bit width specified by qr_precision.
[0214] If second_qr_exp[grp_idx] exists, it specifies the exponent part of the second quantization range for group grp_idx.
[0215] second_qr_exp_sign[grp_idx] specifies the sign of the exponent part of the quantization range for group grp_idx.
[0216] If it exists, second_qr_fraction[grp_idx] specifies the fractional part of the second quantization range for group grp_idx with the bit width specified by qr_precision.
[0217] When quant_type is equal to zero, the quantization range indicates the maximum magnitude of the values encountered in the feature map within the group to which the quantization range is applied.
[0218] When quant_type is equal to 1, the quantization range indicates the maximum positive value encountered in the feature map within the group to which the quantization range is applied, and the second quantization range indicates the maximum negative value encountered in the feature map within the group to which the second quantization range is applied. <{
[0219] The quantization range and the second quantization range (if it exists) may be adjusted to allow for some headroom, such as by multiplying by a value slightly greater than 1.0. Such headroom reduces the likelihood that tensor values need to be clipped in the quantization module 518 and enables the quantization range to be reused for subsequent frames in the frame associated with the feature map packing information SEI message for subsequent frames.
Claims
1. An apparatus for generating first encoded data and second encoded data, comprising: determination means for determining whether the apparatus generates encoded data including encoded data of a feature map based on a neural network; encoding means for generating the first encoded data using a plurality of functions for encoding video data when the apparatus generates the first encoded data in a form of encoded video data not including the encoded data of the feature map, wherein when the apparatus generates the second encoded data including the encoded data of the feature map, the encoding means generates the encoded data of the feature map using a first portion of the plurality of functions and not using a second portion of the plurality of functions.
2. The apparatus according to claim 1, wherein the second portion of the plurality of functions includes at least one of LFNSST, MIP, LMCS, and ISP.
3. The apparatus according to claim 1, wherein the second portion of the plurality of functions includes at least one of Affine, GPM, and MMVD.
4. The apparatus according to claim 1, wherein the second portion of the plurality of functions is restricted from being used for encoding the feature map.
5. The apparatus according to claim 1, wherein the encoding means encodes information indicating that the second portion of the plurality of functions is restricted from being used for decoding the feature map.
6. The apparatus according to claim 1, wherein the first encoded data complies with a first encoding standard and the second encoded data complies with a second encoding standard.
7. The apparatus according to claim 1, wherein the feature map is a slice of an intermediate data unit generated within a neural network along a dimension other than the spatial dimension of the intermediate data.
8. The apparatus according to claim 1, wherein the encoding means encodes metadata for representing a plurality of feature maps in a planar frame of video data, and the metadata is represented using an SEI message.
9. The apparatus according to claim 1, wherein the encoding means encodes a prohibition of using the second portion of the plurality of functions using a constraint flag.
10. An apparatus for decoding first encoded data and second encoded data, comprising: determination means for determining whether the apparatus decodes encoded data including encoded data of a feature map based on a neural network; When the apparatus decodes the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, the apparatus includes decoding means for decoding the first encoded data using a plurality of functions for decoding video data. When the apparatus decodes the second encoded data that includes the encoded data of the feature map, the decoding means decodes the encoded data of the feature map using a first portion of the plurality of functions without using a second portion of the plurality of functions.
11. The apparatus according to claim 10, wherein the second portion of the plurality of functions includes at least one of LFNSST, MIP, LMCS, and ISP.
12. The apparatus according to claim 10, wherein the second portion of the plurality of functions includes at least one of Affine, GPM, and MMVD.
13. The apparatus according to claim 10, wherein the second portion of the plurality of functions is restricted so as not to be used for decoding the feature map.
14. The apparatus according to claim 10, wherein the decoding means decodes information indicating that the second portion of the plurality of functions is restricted so as not to be used for decoding the feature map.
15. The method according to claim 10, wherein the first encoded data complies with a first encoding standard, and the second encoded data complies with a second encoding standard.
16. The apparatus according to claim 10, wherein the feature map is a slice of intermediate data units generated within a neural network along a dimension other than the spatial dimension of the intermediate data.
17. The apparatus according to claim 10, wherein the decoding means decodes metadata for representing a plurality of feature maps into a planar frame of video data, and the metadata is represented using a SEI message.
18. The apparatus according to claim 10, wherein the decoding means decodes the prohibition of use of the second portion of the plurality of functions using a constraint flag.
19. A method for generating first encoded data and second encoded data, comprising: determining whether an apparatus generates encoded data including encoded data of a feature map based on a neural network; when the apparatus generates the first encoded data in the form of encoded video data that does not include the encoded data of the feature map, generating the first encoded data using a plurality of functions for encoding video data; A method of generating the second encoded data including the encoded data of the feature map by the device, wherein the encoded data of the feature map is generated using a first portion of the plurality of functions but not using a second portion of the plurality of functions.
20. A method for decoding first encoded data and second encoded data, comprising: determining whether the device decodes the encoded data including the encoded data of the feature map based on a neural network; when the device decodes the first encoded data in the form of encoded video data not including the encoded data of the feature map, decoding the first encoded data using a plurality of functions for decoding video data; when the device decodes the second encoded data including the encoded data of the feature map, decoding the encoded data of the feature map using a first portion of the plurality of functions but not using a second portion of the plurality of functions.
21. A non-transitory computer-readable storage medium storing a program for executing a method of generating first encoded data and second encoded data, the method comprising: determining whether the device generates the encoded data including the encoded data of the feature map based on a neural network; when the device generates the first encoded data in the form of encoded video data not including the encoded data of the feature map, generating the first encoded data using a plurality of functions for encoding video data; when the device generates the second encoded data including the encoded data of the feature map, generating the encoded data of the feature map using a first portion of the plurality of functions but not using a second portion of the plurality of functions.
22. A non-transitory computer-readable storage medium storing a program for executing a method of decoding first encoded data and second encoded data, the method comprising: determining whether the device decodes the encoded data including the encoded data of the feature map based on a neural network; when the device decodes the first encoded data in the form of encoded video data not including the encoded data of the feature map, decoding the first encoded data using a plurality of functions for decoding video data; When the apparatus decodes the second encoded data including the encoded data of the feature map, it includes decoding the encoded data of the feature map using a first part of the plurality of functions but not using a second part of the plurality of functions, a non-transitory computer-readable storage medium.
Citation Information
Patent Citations
Systems and method for virtual reality video conversion and streaming
US20210195164A1
Method and apparatus for signaling decoding data using high level syntax elements
WO2020263646A1
High precision transform and quantization for image and video coding
WO2021052355A1