Patent Description:
<NPL>, describes a scheme to implement multiprocessor interconnection intended for real-time image processing purposes.

<CIT> describes an image data buffer apparatus comprising a FIFO control unit configured to store image data as a plurality of blocks in the memory at respective positions successively indicated by the write pointer as the image data are supplied as the blocks contained in an image, to read one of the blocks from the memory at a position indicated by the read pointer, to read, from the memory, partial data that is part of at least one block adjacent to the one of the blocks, and to consolidate the one of the blocks and the partial data for transmission as one consolidated block.

A method for filtering a video frame stored in a frame buffer based on a division of the video frame into a plurality of processing units, the method comprising:.

An apparatus for filtering a video frame stored in a frame buffer based on a division of the video frame into a plurality of processing units, the apparatus comprising:.

These and other aspects of this disclosure are disclosed in the following detailed description of the implementations, the appended claims and the accompanying figures.

The description herein makes reference to the accompanying drawings described below, wherein like reference numerals refer to like parts throughout the several views.

Video compression schemes may include breaking respective images, or frames, of an input video stream into smaller portions, such as blocks, and generating a bitstream using techniques to limit the information included for respective blocks in the output. The compressed bitstream can be decoded to re-create the source images from the limited information. Video compression techniques performed by typical encoders include degrading an input video stream to reduce the data size when encoded to a bitstream. For example, lossy operations performed during the prediction, transform, and/or quantization stages of an encoder may remove certain video data from the input video stream, while preserving other video data which is later used by a decoder to reconstruct the compressed bitstream into an output video stream. Those lossy operations can result in undesirable blocking artifacts being introduced within encoded frames.

The encoder and decoder may also perform operations for filtering a video frame, such as after the video frame is reconstructed (e.g., within the reconstruction loop at the encoder or prior the outputting at the decoder). For example, the filtering may be performed to process a reconstructed video frame for use as a reference frame. The reference frame may then be used for predicting subsequent video frames of the input video stream or the bitstream. Depending on the particular codec used to encode and decode the video frame, the filtering can be performed using one of a number of different tools. For example, in the AV1 codec, the filtering can be performed using the loop restoration tool.

Loop restoration includes dividing a video frame into processing units. A processing unit is a square-shaped segment of the video frame of size 64x64, 128x128, or 256x256. However, a processing unit may instead be of a different shape and/or of a different size, subject to the capabilities of the codec that performs the loop restoration. A filtering technique is used during loop restoration to restore video data degraded from within some or all of the processing units. The filtering techniques available for loop restoration tool may include a Wiener filter (e.g., a separable symmetric normalized Wiener filter), a self-guided filter (e.g., a dual self-guided filter), or another filter.

However, a filtering technique performed using a loop restoration tool or another tool available to an encoder or a decoder typically uses a large amount of computing resources, such as memory. For example, in typical loop restoration approaches, processing units often overlap within a video frame, resulting in some pixels within the video frame being processed using multiple processing units. Given that each processing unit is used to perform filtering against pre-filtered pixel values, rather than already filtered pixel values, the overlapping regions of the video frame introduce a potential processing conflict.

Typical loop restoration approaches address this conflict by copying the pre-filtered video frame into an additional video frame buffer. After the entire video frame has been filtered, it is written from the additional video frame buffer, such as for display or storage. However, the allocating of an extra buffer for storing the entire video frame is an inefficient use of memory resources since the encoder or decoder is essentially required to maintain two complete copies of the video data for the video frame.

Implementations of this disclosure address problems such as these using a memory-efficient filtering approach is used to code images and video. A buffer having a fixed size based on a size of processing units to use for filtering a video frame is allocated. For each of the processing units, pre-filtered pixel values are copied from a respective region of the video frame to the buffer based on a writing point for the video frame and an offset applied to the writing point, filtering is performed against the pre-filtered pixel values from the buffer to produce filtered pixel values, and the filtered pixel values are written to the video frame based on the writing point and the offset.

The filtering may be performed using a loop restoration tool, such as where the pre-filtered pixel values are output from a constrained directional enhancement filter (CDEF) tool. Alternatively, the filtering may be performed using the CDEF tool or another coding tool. Thus, the memory-efficient filtering approach disclosed herein may represent operations performed at a filtering stage of an image or video coding process. As such, the memory-efficient filtering approach disclosed herein may be used in the encoding and/or decoding process for image and/or video data.

The fixed size buffer and writing point offset introduced by the implementations of this disclosure improve the encoding and decoding performance for image and video, and therefore introduce improvements to image and video coding technology. In particular, using the fixed size buffer and the writing point offset reduces the additional memory resource usage by a filtering tool to that of a single processing unit, rather than an entire video frame. Further, using the writing point offset to indicate locations of the processing units reduces or prevents the occurrence of processing units overlapping one another in the video frame.

Further details of techniques for a memory-efficient filtering approach for image and video coding are described herein with initial reference to a system in which they can be implemented. <FIG> is a schematic of an example of a video encoding and decoding system <NUM>. A transmitting station <NUM> can be, for example, a computer having an internal configuration of hardware such as that described in <FIG>. However, other implementations of the transmitting station <NUM> are possible. For example, the processing of the transmitting station <NUM> can be distributed among multiple devices.

A network <NUM> can connect the transmitting station <NUM> and a receiving station <NUM> for encoding and decoding of the video stream. Specifically, the video stream can be encoded in the transmitting station <NUM>, and the encoded video stream can be decoded in the receiving station <NUM>. The network <NUM> can be, for example, the Internet. The network <NUM> can also be a local area network (LAN), wide area network (WAN), virtual private network (VPN), cellular telephone network, or any other means of transferring the video stream from the transmitting station <NUM> to, in this example, the receiving station <NUM>.

The receiving station <NUM>, in one example, can be a computer having an internal configuration of hardware such as that described in <FIG>. However, other suitable implementations of the receiving station <NUM> are possible. For example, the processing of the receiving station <NUM> can be distributed among multiple devices.

Other implementations of the video encoding and decoding system <NUM> are possible. For example, an implementation can omit the network <NUM>. In another implementation, a video stream can be encoded and then stored for transmission at a later time to the receiving station <NUM> or any other device having memory. In one implementation, the receiving station <NUM> receives (e.g., via the network <NUM>, a computer bus, and/or some communication pathway) the encoded video stream and stores the video stream for later decoding. In an example implementation, a real-time transport protocol (RTP) is used for transmission of the encoded video over the network <NUM>. In another implementation, a transport protocol other than RTP may be used, e.g., a Hypertext Transfer Protocol (HTTP)-based video streaming protocol.

When used in a video conferencing system, for example, the transmitting station <NUM> and/or the receiving station <NUM> may include the ability to both encode and decode a video stream as described below. For example, the receiving station <NUM> could be a video conference participant who receives an encoded video bitstream from a video conference server (e.g., the transmitting station <NUM>) to decode and view and further encodes and transmits his or her own video bitstream to the video conference server for decoding and viewing by other participants.

In some implementations, the video encoding and decoding system <NUM> may instead be used to encode and decode data other than video data. For example, the video encoding and decoding system <NUM> can be used to process image data. The image data may include a block of data from an image. In such an implementation, the transmitting station <NUM> may be used to encode the image data and the receiving station <NUM> may be used to decode the image data.

Alternatively, the receiving station <NUM> can represent a computing device that stores the encoded image data for later use, such as after receiving the encoded or pre-encoded image data from the transmitting station <NUM>. As a further alternative, the transmitting station <NUM> can represent a computing device that decodes the image data, such as prior to transmitting the decoded image data to the receiving station <NUM> for display.

<FIG> is a block diagram of an example of a computing device <NUM> that can implement a transmitting station or a receiving station. For example, the computing device <NUM> can implement one or both of the transmitting station <NUM> and the receiving station <NUM> of <FIG>. The computing device <NUM> can be in the form of a computing system including multiple computing devices, or in the form of one computing device, for example, a mobile phone, a tablet computer, a laptop computer, a notebook computer, a desktop computer, and the like.

A processor <NUM> in the computing device <NUM> can be a conventional central processing unit. Alternatively, the processor <NUM> can be another type of device, or multiple devices, capable of manipulating or processing information now existing or hereafter developed. For example, although the disclosed implementations can be practiced with one processor as shown (e.g., the processor <NUM>), advantages in speed and efficiency can be achieved by using more than one processor.

A memory <NUM> in computing device <NUM> can be a read only memory (ROM) device or a random access memory (RAM) device in an implementation. However, other suitable types of storage device can be used as the memory <NUM>. The memory <NUM> can include code and data <NUM> that is accessed by the processor <NUM> using a bus <NUM>. The memory <NUM> can further include an operating system <NUM> and application programs <NUM>, the application programs <NUM> including at least one program that permits the processor <NUM> to perform the techniques described herein. For example, the application programs <NUM> can include applications <NUM> through N, which further include a video and/or image coding application that performs the techniques described herein.

The computing device <NUM> can also include a secondary storage <NUM>, which can, for example, be a memory card used with a mobile computing device. Because the video communication sessions may contain a significant amount of information, they can be stored in whole or in part in the secondary storage <NUM> and loaded into the memory <NUM> as needed for processing.

The computing device <NUM> can also include one or more output devices, such as a display <NUM>. The display <NUM> may be, in one example, a touch sensitive display that combines a display with a touch sensitive element that is operable to sense touch inputs. The display <NUM> can be coupled to the processor <NUM> via the bus <NUM>. Other output devices that permit a user to program or otherwise use the computing device <NUM> can be provided in addition to or as an alternative to the display <NUM>. When the output device is or includes a display, the display can be implemented in various ways, including by a liquid crystal display (LCD), a cathode-ray tube (CRT) display, or a light emitting diode (LED) display, such as an organic LED (OLED) display.

The computing device <NUM> can also include or be in communication with an image-sensing device <NUM>, for example, a camera, or any other image-sensing device <NUM> now existing or hereafter developed that can sense an image such as the image of a user operating the computing device <NUM>. The image-sensing device <NUM> can be positioned such that it is directed toward the user operating the computing device <NUM>. In an example, the position and optical axis of the image-sensing device <NUM> can be configured such that the field of vision includes an area that is directly adjacent to the display <NUM> and from which the display <NUM> is visible.

The computing device <NUM> can also include or be in communication with a sound-sensing device <NUM>, for example, a microphone, or any other sound-sensing device now existing or hereafter developed that can sense sounds near the computing device <NUM>. The sound-sensing device <NUM> can be positioned such that it is directed toward the user operating the computing device <NUM> and can be configured to receive sounds, for example, speech or other utterances, made by the user while the user operates the computing device <NUM>.

Although <FIG> depicts the processor <NUM> and the memory <NUM> of the computing device <NUM> as being integrated into one unit, other configurations can be utilized. The operations of the processor <NUM> can be distributed across multiple machines (wherein individual machines can have one or more processors) that can be coupled directly or across a local area or other network. The memory <NUM> can be distributed across multiple machines such as a network-based memory or memory in multiple machines performing the operations of the computing device <NUM>.

Although depicted here as one bus, the bus <NUM> of the computing device <NUM> can be composed of multiple buses. Further, the secondary storage <NUM> can be directly coupled to the other components of the computing device <NUM> or can be accessed via a network and can comprise an integrated unit such as a memory card or multiple units such as multiple memory cards. The computing device <NUM> can thus be implemented in a wide variety of configurations.

<FIG> is a diagram of an example of a video stream <NUM> to be encoded and subsequently decoded. The video stream <NUM> includes a video sequence <NUM>. At the next level, the video sequence <NUM> includes a number of adjacent frames <NUM>. While three frames are depicted as the adjacent frames <NUM>, the video sequence <NUM> can include any number of adjacent frames <NUM>. The adjacent frames <NUM> can then be further subdivided into individual frames, for example, a frame <NUM>.

At the next level, the frame <NUM> can be divided into a series of planes or segments <NUM>. The segments <NUM> can be subsets of frames that permit parallel processing, for example. The segments <NUM> can also be subsets of frames that can separate the video data into separate colors. For example, a frame <NUM> of color video data can include a luminance plane and two chrominance planes. The segments <NUM> may be sampled at different resolutions.

Whether or not the frame <NUM> is divided into segments <NUM>, the frame <NUM> may be further subdivided into blocks <NUM>, which can contain data corresponding to, for example, 16x16 pixels in the frame <NUM>. The blocks <NUM> can also be arranged to include data from one or more segments <NUM> of pixel data. The blocks <NUM> can also be of any other suitable size such as 4x4 pixels, 8x8 pixels, 16x8 pixels, 8x16 pixels, 16x16 pixels, or larger. Unless otherwise noted, the terms block and macroblock are used interchangeably herein.

<FIG> is a block diagram of an example of an encoder <NUM>. The encoder <NUM> can be implemented, as described above, in the transmitting station <NUM>, such as by providing a computer software program stored in memory, for example, the memory <NUM>. The computer software program can include machine instructions that, when executed by a processor such as the processor <NUM>, cause the transmitting station <NUM> to encode video data in the manner described in <FIG>. The encoder <NUM> can also be implemented as specialized hardware included in, for example, the transmitting station <NUM>. In one particularly desirable implementation, the encoder <NUM> is a hardware encoder.

The encoder <NUM> has the following stages to perform the various functions in a forward path (shown by the solid connection lines) to produce an encoded or compressed bitstream <NUM> using the video stream <NUM> as input: an intra/inter prediction stage <NUM>, a transform stage <NUM>, a quantization stage <NUM>, and an entropy encoding stage <NUM>. The encoder <NUM> may also include a reconstruction path (shown by the dotted connection lines) to reconstruct a frame for encoding of future blocks. In <FIG>, the encoder <NUM> has the following stages to perform the various functions in the reconstruction path: a dequantization stage <NUM>, an inverse transform stage <NUM>, a reconstruction stage <NUM>, and a loop filtering stage <NUM>. Other structural variations of the encoder <NUM> can be used to encode the video stream <NUM>.

When the video stream <NUM> is presented for encoding, respective adjacent frames <NUM>, such as the frame <NUM>, can be processed in units of blocks. At the intra/inter prediction stage <NUM>, respective blocks can be encoded using intra-frame prediction (also called intra-prediction) or inter-frame prediction (also called inter-prediction). In any case, a prediction block can be formed. In the case of intra-prediction, a prediction block may be formed from samples in the current frame that have been previously encoded and reconstructed. In the case of inter-prediction, a prediction block may be formed from samples in one or more previously constructed reference frames.

Next, the prediction block can be subtracted from the current block at the intra/inter prediction stage <NUM> to produce a residual block (also called a residual). The transform stage <NUM> transforms the residual into transform coefficients in, for example, the frequency domain using block-based transforms. The quantization stage <NUM> converts the transform coefficients into discrete quantum values, which are referred to as quantized transform coefficients, using a quantizer value or a quantization level. For example, the transform coefficients may be divided by the quantizer value and truncated.

The quantized transform coefficients are then entropy encoded by the entropy encoding stage <NUM>. The entropy-encoded coefficients, together with other information used to decode the block (which may include, for example, syntax elements such as used to indicate the type of prediction used, transform type, motion vectors, a quantizer value, or the like), are then output to the compressed bitstream <NUM>. The compressed bitstream <NUM> can be formatted using various techniques, such as variable length coding (VLC) or arithmetic coding. The compressed bitstream <NUM> can also be referred to as an encoded video stream or encoded video bitstream, and the terms will be used interchangeably herein.

The reconstruction path (shown by the dotted connection lines) can be used to ensure that the encoder <NUM> and a decoder <NUM> (described below with respect to <FIG>) use the same reference frames to decode the compressed bitstream <NUM>. The reconstruction path performs functions that are similar to functions that take place during the decoding process (described below with respect to <FIG>), including dequantizing the quantized transform coefficients at the dequantization stage <NUM> and inverse transforming the dequantized transform coefficients at the inverse transform stage <NUM> to produce a derivative residual block (also called a derivative residual).

At the reconstruction stage <NUM>, the prediction block that was predicted at the intra/inter prediction stage <NUM> can be added to the derivative residual to create a reconstructed block. The loop filtering stage <NUM> can apply an in-loop filter or other filter to the reconstructed block to reduce distortion such as blocking artifacts. Examples of filters which may be applied at the loop filtering stage <NUM> include, without limitation: a deblocking filter as in AVC, VP9, High Efficiency Video Coding (HEVC), and AV1; a CDEF as in AV1; a super resolution filter as in AV1; and a loop restoration filter as in AV1.

Other variations of the encoder <NUM> can be used to encode the compressed bitstream <NUM>. In some implementations, a non-transform based encoder can quantize the residual signal directly without the transform stage <NUM> for certain blocks or frames. In some implementations, an encoder can have the quantization stage <NUM> and the dequantization stage <NUM> combined in a common stage.

<FIG> is a block diagram of an example of a decoder <NUM>. The decoder <NUM> can be implemented in the receiving station <NUM>, for example, by providing a computer software program stored in the memory <NUM>. The computer software program can include machine instructions that, when executed by a processor such as the processor <NUM>, cause the receiving station <NUM> to decode video data in the manner described in <FIG>. The decoder <NUM> can also be implemented in hardware included in, for example, the transmitting station <NUM> or the receiving station <NUM>.

The decoder <NUM>, similar to the reconstruction path of the encoder <NUM> discussed above, includes in one example the following stages to perform various functions to produce an output video stream <NUM> from the compressed bitstream <NUM>: an entropy decoding stage <NUM>, a dequantization stage <NUM>, an inverse transform stage <NUM>, an intra/inter prediction stage <NUM>, a reconstruction stage <NUM>, a loop filtering stage <NUM>, and a post filter stage <NUM>. Other structural variations of the decoder <NUM> can be used to decode the compressed bitstream <NUM>.

When the compressed bitstream <NUM> is presented for decoding, the data elements within the compressed bitstream <NUM> can be decoded by the entropy decoding stage <NUM> to produce a set of quantized transform coefficients. The dequantization stage <NUM> dequantizes the quantized transform coefficients (e.g., by multiplying the quantized transform coefficients by the quantizer value), and the inverse transform stage <NUM> inverse transforms the dequantized transform coefficients to produce a derivative residual that can be identical to that created by the inverse transform stage <NUM> in the encoder <NUM>. Using header information decoded from the compressed bitstream <NUM>, the decoder <NUM> can use the intra/inter prediction stage <NUM> to create the same prediction block as was created in the encoder <NUM> (e.g., at the intra/inter prediction stage <NUM>).

At the reconstruction stage <NUM>, the prediction block can be added to the derivative residual to create a reconstructed block. The loop filtering stage <NUM> can apply an in-loop filter or other filter to the reconstructed block to reduce distortion such as blocking artifacts. Examples of filters which may be applied at the loop filtering stage <NUM> include, without limitation: a deblocking filter as in AVC, VP9, HEVC, and AV1; a CDEF as in AV1; a super resolution filter as in AV <NUM>; and a loop restoration filter as in AV1.

Other filtering can also be applied to the reconstructed block. In this example, the post filter stage <NUM> is applied to the reconstructed block to reduce blocking distortion, and the result is output as the output video stream <NUM>. The output video stream <NUM> can also be referred to as a decoded video stream, and the terms will be used interchangeably herein.

Other variations of the decoder <NUM> can be used to decode the compressed bitstream <NUM>. In some implementations, the decoder <NUM> can produce the output video stream <NUM> without the post filter stage <NUM>.

<FIG> is a block diagram of an example of a video frame filtering stage <NUM> according to implementations of this disclosure. The video frame filtering stage <NUM> performs filtering against a video frame <NUM> to prepare the video frame <NUM> for display or storage. During encoding, the video frame filtering stage <NUM> may be the loop filtering stage <NUM> of the encoder <NUM> shown in <FIG> or a stage that performs some, but not all, of the operations performed at the loop filtering stage <NUM>. During decoding, the video frame filtering stage <NUM> may be the loop filtering stage <NUM> of the decoder <NUM> shown in <FIG> or a stage that performs some, but not all, of the operations performed at the loop filtering stage <NUM>. Thus, the video frame filtering stage <NUM> may represent, for example, functionality of a loop restoration tool of an encoder or of a decoder, functionality of a CDEF tool of an encoder or of a decoder, or functionality of another filtering tool of an encoder or of a decoder.

The video frame <NUM> is a video frame output from a reconstruction stage <NUM>. For example, the reconstruction stage <NUM> may be the reconstruction stage <NUM> of the encoder <NUM> or the reconstruction stage <NUM> may be the reconstruction stage <NUM> shown of the decoder <NUM>. After the filtering at the video frame filtering stage <NUM>, the video frame <NUM> is sent as output for display or storage <NUM>. The display or storage <NUM> may represent operations for storing the filtered video frame <NUM> in a reference frame buffer of the encoder <NUM> or of the decoder <NUM>. Alternatively, the display or storage <NUM> may represent operations for outputting the filtered video frame <NUM> within an output video stream for display at a device that receives the output video stream.

The video frame filtering stage <NUM> receives the video frame <NUM> after the video frame is output from the reconstruction stage <NUM> and prepares the video frame <NUM> for sending as output for the display or storage <NUM>. The video frame filtering stage <NUM> includes a pixel copying stage <NUM>, a filtering stage <NUM>, and a filtered pixel writing stage <NUM>. The video frame filtering stage <NUM> uses a buffer <NUM> to store portions of the video frame <NUM> to be filtered.

The video frame filtering stage <NUM> uses processing units to process individual regions of the video frame <NUM> one at a time. As previously stated, a processing unit is a coding structure of size MxN, where M and N may be the same or different numbers. The size of the processing units may be based on the size of the largest block within the video frame <NUM>. For example, if the largest block within the video frame <NUM> is 128x128, the processing units used by the video frame filtering stage <NUM> may be of size 128x128 or larger.

The processing units are typically square in shape. However, as the processing units may be of size MxN, the processing units may be square or rectangular in shape. The processing units are typically all of the same size and shape. However, in some cases, the processing units may be variably sized and/or variably shaped. For example, a variable size and/or variable shape processing unit partitioning scheme can be used to divide the video frame <NUM> into a plurality of processing units.

Each of the processing units includes pixel values from a region of the video frame <NUM>. Each of the pixel values of the video frame is included in a single processing unit. As such, the video frame filtering stage <NUM> filters each of the pixel values of the video frame <NUM> by processing each of the processing units. The video frame filtering stage <NUM> sequentially processes the processing units one at a time. The order for processing the processing units at the video frame filtering stage <NUM> may depend upon a scan order or other order for the encoding or decoding of the video frame <NUM>. For example, where a raster order is used, the video frame filtering stage <NUM> first processes a processing unit that includes top-left-most pixel values of the video frame <NUM>.

For each of the processing units, the video frame filtering stage <NUM> performs operations starting at the pixel copying stage <NUM>, then at the filtering stage <NUM>, and ending at the filtered pixel writing stage <NUM>. First, the pixel copying stage <NUM> copies pre-filtered pixel values from the region of the video frame <NUM> corresponding to a current processing unit into the buffer <NUM>. Next, the filtering stage <NUM> performs filtering against the pre-filtered pixel values within the buffer <NUM> to produce filtered pixel values. Finally, the filtered pixel writing stage <NUM> writes the filtered pixel values back to the region of the video frame <NUM> from which the corresponding pre-filtered pixel values were copied.

The particular technique for the filtering performed against the pre-filtered pixel values at the filtering stage <NUM> is based on the filtering tool or filtering tools used to perform the filtering. For example, where the filtering at the filtering stage <NUM> is performed using a loop restoration tool of an encoder (e.g., the encoder <NUM>) or of a decoder (e.g., the decoder <NUM>), the filtering stage <NUM> can use one or more filtering techniques to restore video data previously degraded from the video frame <NUM>.

For example, filtering techniques which may be used to restore video data previously degraded from the video frame <NUM> may include a Wiener filter (e.g., a separable symmetric normalized Wiener filter), a dual self-guided filter, another filter, or a combination thereof. The Wiener filter may be an MxN filter (where M and N may be the same or different numbers) for which parameters for each horizontal and vertical filter are signaled (e.g., within a bitstream). The dual self-guided filter may be an MxN filter (where M and N may be the same or different numbers) for which noise parameters are signaled and in which the output of one or more such filters are weighted.

The filtering stage <NUM> is not limited to performing filtering using a loop restoration tool. In some implementations, the filtering stage <NUM> may perform filtering using a CDEF tool of an encoder or of a decoder. In some implementations, another filtering tool used for encoding or decoding may be used by the filtering stage <NUM> to perform the filtering against the pre-filtered pixel values for the respective processing units.

The buffer <NUM> is allocated to have a fixed size based on the size of the processing units used for performing filtering at the filtering stage <NUM>. In particular, the size of the buffer <NUM> is based on an extended region of the processing units. The extended region of a processing unit refers to the processing unit and a number of pixels extended from the boundary of the processing unit on one or more sides of the processing unit. As such, the extended region, and therefore the fixed size of the buffer, is based on the filtering technique performed at the filtering stage <NUM>.

The extended region of the processing units is introduced for use at the filtering stage <NUM>. Certain filtering techniques which may be performed at the filtering stage <NUM> may require or otherwise use a number which pixels beyond the processing unit size. Thus, the extended region of a processing unit accommodates the size requirement for a filtering technique.

In some implementations, a Wiener filter may require an extension of <NUM> pixels on each side of the processing unit. As such, where the processing units are of size 64x64 and the filtering stage <NUM> performs loop restoration using a Wiener filter, the size of the buffer <NUM> is fixed to store data for a 67x67 region of the video frame <NUM>. In some implementations, a self-guided filter may require an extension of <NUM> pixel on each side of the processing unit. As such, where the processing units are of size 64x64 and the filtering stage <NUM> performs loop restoration using a self-guided filter, the size of the buffer <NUM> is fixed to store data for a 65x65 region of the video frame <NUM>.

An extended frame boundary is used to enable the extended regions of the processing units. The extended frame boundary is a boundary which surrounds the video frame <NUM> and which includes a number of pixels extended from the boundary of the video frame <NUM>. Thus, the extended frame boundary represents a size of the video frame <NUM> in which a number of pixels is extended from each side of the boundary of the video frame <NUM>.

The size of the extended frame boundary is based on a resolution of the video frame <NUM>. The extended frame boundary is used to align the video frame <NUM> with other video frames of the input video stream or bitstream, as applicable, based on the resolution indicated for displaying the video frame <NUM> and those other video frames. For example, each resolution (e.g., 720p, 1080p, <NUM>, <NUM>, or other resolutions) may use a particular frame size for displaying the video frames. In the event the size of the video frame <NUM> during encoding or decoding is not the particular frame size for the resolution at which to display the video frame <NUM>, the extended frame boundary is introduced to change the effective size of the video frame <NUM> to the particular frame size for the resolution.

The video frame <NUM> and the other video frames in the same input video stream or bitstream are aligned by half of the size of those video frames. For example, if the size of those video frames corresponds to the <NUM> resolution, the alignment is based on the size for the <NUM> resolution. Typically, each video frame in an input video stream or bitstream have the same alignment since they are set for display at the same resolution. However, in some cases, some of the video frames may have different alignments. For example, in cases where a user of a video streaming platform selects to change a resolution of a video stream while the video is streaming, video frames displayed after the change in resolution will likely be aligned differently than video frames displayed prior to the change in resolution.

In at least some cases, the alignment may correspond with a largest pixel extension required or used by the filtering techniques performed at the filtering stage <NUM>. For example, if the largest pixel extension for the filtering techniques is <NUM> pixels, the alignment may also be by <NUM> pixels to support each possible filtering technique used at the filtering stage <NUM>.

The extended frame boundary defines the locations of the regions to which processing unit for the video frame <NUM> correspond. To illustrate this, reference is now made to <FIG> is an illustration of an example of processing units used to filter a video frame <NUM>, which may, for example, be the video frame <NUM> shown in <FIG>. As shown, the video frame <NUM> is separated into <NUM> regions of equal size. Each of those regions includes a number of pixel values, and each of those regions corresponds to one processing unit. For reference, a size of such a processing unit is shown at <NUM>. Examples throughout the description of <FIG> refer to the processing unit size shown at <NUM> as being 64x64; however, other processing unit sizes can be used for filtering the video frame <NUM>.

A start point <NUM> of the video frame <NUM> indicates a location of a first pixel to filter (e.g., using a loop restoration tool, a CDEF tool, or another filter tool). Where the filtering follows the raster order, the start point <NUM> is the top-left-most pixel of the video frame <NUM>, such as is shown in <FIG>. Alternatively, where the filtering follows an order that does not begin at the top-left of the video frame <NUM>, the start point <NUM> may be located elsewhere about the video frame <NUM>.

An extended frame boundary <NUM> surrounds the video frame <NUM> and an additional number of pixels extended on one or more sides of the video frame <NUM>. As shown in <FIG>, the extended frame boundary <NUM> includes additional pixels extended on all four sides of the video frame <NUM>. The extended frame boundary <NUM> also defines a writing point <NUM> that accounts for the alignment of the video frame <NUM>. The writing point <NUM> indicates a starting location for an extended region of a first processing unit <NUM>. As shown in <FIG>, the writing point <NUM> is located at a top-left-most position of the extended frame boundary <NUM>. Thus, the writing point <NUM> represents a location extended beyond the original boundary of the video frame <NUM>.

Whereas the size of the first processing unit is 64x64 (i.e., the processing unit size shown at <NUM>), the size of the extended region of the first processing unit <NUM> is <NUM>+Mx64+N, where M and N represent the extended region of the processing unit based on the resolution for displaying the video frame <NUM>, the requirements of the filtering technique to be used for filtering the video frame, or both. For example, the extended region of the first processing unit <NUM> can be <NUM>+3x64+<NUM>, or 67x67.

The first processing unit is used for filtering a region of the video frame <NUM> starting at the start point <NUM>. For example, the pixel locations throughout the video frame <NUM> can be considered as a two-dimensional grid, such as with X- and Y-axes. Where the extended frame boundary <NUM> extends the size of the video frame <NUM> by <NUM> pixels on each side, the writing point <NUM> would be located at (-<NUM>, -<NUM>). The extended region of the first processing unit <NUM> extends from (<NUM>-<NUM>, <NUM>-<NUM>) to (<NUM>+<NUM>, <NUM>+<NUM>), or (-<NUM>, -<NUM>) to (<NUM>, <NUM>). The start point <NUM> would be located at (<NUM>, <NUM>) such that the first region filtered for the first processing unit starts at (<NUM>, <NUM>). That first region is of the same size as the first processing unit and therefore extends from (<NUM>, <NUM>) to (<NUM>, <NUM>).

That first region corresponding to the first processing unit is shown after filtering as a first filtered block <NUM>. Whereas the pixel values for that first region are pre-filtered pixel values before the filtering, the pixel values after the filtering are filtered pixel values. After being filtered, pixel values of the video frame <NUM> are shifted towards the writing point <NUM>. For example, the pre-filtered pixel values for that first region were located in the video frame <NUM> starting at the start point <NUM>; however, the filtered pixel values of the first filtered block <NUM> are shifted and written to the video frame <NUM> at the writing point <NUM>.

An extended region of a second processing unit <NUM> is shown next to the extended region of the first processing unit <NUM>. After the first filtered block <NUM> is written to the video frame <NUM>, the second processing unit is used for filtering a next region of the video frame <NUM>. The location of a next region of the video frame <NUM> corresponding to the next (e.g., the second) processing unit is indicated based on an offset applied to the writing point <NUM>.

The offset specifies a distance from the writing point <NUM> based on a number of processing units for which filtering has already been performed. Here, since filtering has already been performed for one processing unit, the offset applied to the writing point <NUM> indicates to start the second processing unit based on where the first filtered block <NUM> ended within the video frame <NUM>. Thus, the offset for the second processing unit indicates that the second processing unit starts at a location that is <NUM>+<NUM>, or <NUM>, pixels from the writing point <NUM>. Referring back to the two-dimensional grid described above, the second processing unit would extend from (<NUM>, <NUM>) to (<NUM>, <NUM>), and the extended region of the second processing unit <NUM> would extend from (<NUM>-<NUM>, <NUM>-<NUM>) to (<NUM>+<NUM>, <NUM>+<NUM>), or (<NUM>, -<NUM>) to (<NUM>, <NUM>).

The region corresponding to the second processing unit is shown after filtering as the second filtered block <NUM>. Similar to how the filtered pixel values of the first filtered block <NUM> were shifted towards the writing point <NUM>, the filtered pixel values of the second filtered block <NUM> are shifted and written to the video frame <NUM> following the first filtered block <NUM>. The location at which to write the filtered pixel values of the second filtered block <NUM> can be determined based on the offset applied to the writing point <NUM>. For example, the offset can indicate that the second filtered block <NUM> is to be written to the video frame <NUM> at a location that is <NUM>-<NUM>, or <NUM> pixels, from the writing point <NUM>.

After the second filtered block <NUM> is written, an offset to apply to the writing point <NUM> for a third processing unit is determined. Here, since filtering has already been performed for two processing units, the offset applied to the writing point <NUM> would indicate to start the third processing unit based on where the second filtered block <NUM> ended within the video frame <NUM>.

Thus, the offset for the third processing unit would indicate that the third processing unit starts at a position that is <NUM>+<NUM>, or <NUM>, pixels from the writing point <NUM>. Referring back to the two-dimensional grid described above, the third processing unit would extend from (<NUM>, <NUM>) to (<NUM>, <NUM>), and the extended region of the third processing unit (not shown) would extend from (<NUM>-<NUM>, <NUM>-<NUM>) to (<NUM>+<NUM>, <NUM>+<NUM>), or (<NUM>, -<NUM>) to (<NUM>, <NUM>).

The processing units illustrated in <FIG> are particularly shown by example to be processing units used for loop restoration of the video frame <NUM>. However, other variations of the processing units may be used. For example, processing units used for filtering by a CDEF tool may have a different form or structure than what is shown in <FIG>.

Referring back to <FIG>, for a first processing unit, the pixel copying stage <NUM> copies pre-filtered pixel values from the video frame <NUM> to the buffer <NUM> starting at the start point of the video frame <NUM>. The buffered pre-filtered pixel values are then filtered at the filtering stage <NUM>, for example, based an extended region of the first processing unit, the location of which is determined based on an offset applied to a writing point for the video frame <NUM> (e.g., the offset being <NUM> here, since no processing units have already been processed).

The filtered pixel values output from the filtering stage <NUM> are then written at the filtered pixel writing stage <NUM> to the video frame <NUM>. The location within the video frame <NUM> at which the filtered pixel values for the first processing unit are written is determined based on a shift towards the writing point from the starting location of the processing unit (e.g., the starting location being the start point of the video frame <NUM> here, since no processing units have already been processed). In particular, since this is the first processing unit, the filtered pixel writing stage <NUM> writes the filtered pixel values to the video frame <NUM> starting at the writing point.

Next, for a second processing unit, the pixel copying stage <NUM> copies pre-filtered pixel values from the video frame <NUM> to the buffer <NUM> starting at a location defined by an offset applied to the writing point. Copying the second set of pre-filtered pixel values to the buffer <NUM> can include first clearing the buffer <NUM> to make space for the second set of pre-filtered pixel values. Alternatively, copying the second set of pre-filtered pixel values to the buffer <NUM> can include overwriting the prior video data stored in the buffer <NUM>.

The offset defining the location at which the start copying the pre-filtered pixel values for the second processing unit specifies a distance from the writing point and is based on a number of processing units for which filtering has already been performed. Here, since filtering has already been performed for one processing unit, the offset is equal to the size of the first processing unit in one dimension (e.g., the horizontal direction) plus a difference between the start point and the writing point along the same dimension.

The newly buffered pre-filtered pixel values are filtered at the filtering stage <NUM> and then written back to the video frame <NUM> at the filtered pixel writing stage <NUM>. The location within the video frame <NUM> at which the filtered pixel values for the second processing unit are written is determined based on a shift towards the writing point from the starting location of the processing unit. For example, the shift towards the writing point can be based on a difference between the start point and the writing point in two dimensions. For example, referring to a two-dimensional grid in which the start point of the frame is located at (<NUM>, <NUM>) and the writing point is located at (-M, -N), the filtered pixel values for the second processing unit are written to a location in the video frame <NUM> that is (-M, -N) from the offset applied to the writing point.

This process is repeated for the remaining processing units until each of the pixel values of the video frame <NUM> have been processed at the video frame filtering stage <NUM>, regardless of whether those pixel values are changed by such processing. After a last processing unit is processed, the video frame <NUM> is output for display or storage <NUM>.

The same writing point is typically used for each video frame of an input video stream or bitstream. However, in some cases, different video frames of an input video stream or bitstream may use a different writing point. In some implementations, where the resolution of the video stream is changed while the streaming is in progress, the writing point for video frames displayed after the change in resolution may be different from the writing point for video frames displayed prior to the change in resolution. In some implementations, an encoder can support changing the writing point between video frames using information signaled within the bitstream to indicate how to align the video frames, such as based on different resolutions for displaying the video.

Other variations of the video frame <NUM>, the video frame filtering stage <NUM>, and/or other aspects shown in <FIG> are possible. In some implementations, the video frame <NUM> may be a video frame buffer, such as a reference frame buffer or other buffer to which video frames are stored for further use in an encoding or decoding process. For example, the reconstruction stage <NUM> can store a video frame into the video frame buffer. The video frame filtering stage <NUM> can then copy pixels of the video frame from the video frame buffer and subsequently write filtered pixels of the video frame back to the video frame buffer. In such an implementation, the display or storage <NUM> may include operations for finalizing the filtered video frame as a reference frame within the video frame buffer. Alternatively, in such an implementation, the display or storage <NUM> may be omitted.

In some implementations, the video frame filtering stage <NUM> may simultaneously process more than one region of the video frame <NUM>. For example, two or more processing units can be processed simultaneously to filter two or more respective regions of the video frame <NUM>. In some implementations, the buffer <NUM> may include two or more memory allocations for storing pre-filtered pixel values from respective two or more processing units. In some implementations, the buffer <NUM> may be one of a plurality of buffers that are each allocated for storing one of the two or more processing units. The filtering performed at the filtering stage <NUM> may be performed in parallel for each of the two or more processing units, such as using multi-threaded processing.

In some implementations, the size of the processing units used by the video frame filtering stage <NUM> may not be based on the size of the largest block within the video frame <NUM>. In some implementations, the size of the processing units may be based on a configuration of the encoder or decoder that uses the video frame filtering stage <NUM>. In some implementations, the size of the processing units may be based on a non-block partition of the video frame <NUM>. In some implementations, the size of the processing units may be less than the size of the largest block within the video frame <NUM>. In some implementations, the processing units can have different sizes and/or shapes from one another.

In some implementations, the size of the extended frame boundary is based on the filtering technique performed at the filtering stage <NUM> rather than the resolution of the video frame <NUM>. some implementations, where the video frame is of size MxN and the filtering stage <NUM> performs loop restoration using a Wiener filter, the extended frame boundary surrounds a M+3xN+<NUM> region about the video frame <NUM>. some implementations, where the video frame is of size MxN and the filtering stage <NUM> performs loop restoration using a self-guided filter, the extended frame boundary surrounds a M+1xN+<NUM> region about the video frame <NUM>.

Further details of techniques for a memory-efficient filtering approach for image and video coding are now described. <FIG> is a flowchart diagram of an example of a technique <NUM> for filtering performed using processing units for a video frame and a buffer allocated for the processing units. <FIG> is a flowchart diagram of an example of a technique <NUM> for copying and writing pixel values based on a writing point for a video frame.

The technique <NUM> and/or the technique <NUM> can be implemented, for example, as a software program that may be executed by computing devices such as the transmitting station <NUM> or the receiving station <NUM>. For example, the software program can include machine-readable instructions that may be stored in a memory such as the memory <NUM> or the secondary storage <NUM>, and that, when executed by a processor, such as the processor <NUM>, may cause the computing device to perform the technique <NUM> and/or the technique <NUM>. The technique <NUM> and/or the technique <NUM> can be implemented using specialized hardware or firmware. For example, a hardware component configured to perform the technique <NUM> and/or the technique <NUM>. As explained above, some computing devices may have multiple memories or processors, and the operations described in the technique <NUM> and/or the technique <NUM> can be distributed using multiple processors, memories, or both.

For simplicity of explanation, the technique <NUM> and the technique <NUM> are both depicted and described herein as a series of steps or operations. However, the steps or operations in accordance with this disclosure can occur in various orders and/or concurrently. Additionally, other steps or operations not presented and described herein may be used. Furthermore, not all illustrated steps or operations may be required to implement a technique in accordance with the disclosed subject matter.

Referring first to <FIG>, the technique <NUM> for filtering performed using processing units for a video frame and a buffer allocated for the processing units is shown. At <NUM>, a buffer of a fixed size is allocated. Allocating the buffer includes creating or identifying free space in memory for storing video data corresponding to the fixed size. The fixed size of the buffer is based on an extended region of the processing units. The extended region of a processing unit refers to the processing unit and a number of pixels extended from the boundary of the processing unit on one or more sides of the processing unit. For example, where the processing units are of size 64x64 and a <NUM> pixel extension is used, the buffer has a fixed size of 67x67.

At <NUM>, pre-filtered pixel values for a Nth processing unit are copied from a region of the video frame to the buffer. Copying the pre-filtered pixel values for the Nth processing unit from the region of the video frame to the buffer includes identifying the pre-filtered pixel values within the video frame based on an offset applied to a writing point of the video frame. The writing point represents a location extended beyond a boundary of the video frame. The offset specifies a distance from the writing point based on a number of processing units for which filtering has already been performed.

For example, the writing point can be identified by shifting a start point of the video frame by a number of pixels. The start point of the video frame represents a location of a first pre-filtered pixel value within the video frame according to an order for performing the filtering for the processing units. The number of pixels by which to shift the start point of the video frame is determined based on a resolution of the video frame. Shifting the start point of the video frame to the writing point includes determining an extended frame boundary of the video frame based on the resolution of the video frame. The extended boundary of the frame is defined by the number of pixels by which to shift the start point of the video frame.

The offset applied to the writing point changes for each of the processing units. This is because the offset for a processing unit indicates a location of a top-left-most position of the processing unit within an extended boundary of the video frame. For example, the offset for a first processing unit is zero such that the top-left-most position of the first processing unit is located at the writing point, whereas the offset for a second processing unit is based on a size of the first processing unit along at least one axis such that the top-left-most position of the second processing unit is located one pixel position over from a top-right-most pixel position of the first processing unit.

At <NUM>, filtering is performed against the buffered pre-filtered pixel values for the Nth processing unit. Performing the filtering against the buffered pre-filtered pixel values includes filtering those buffered pre-filtered pixel values using a filtering tool available to the encoder or decoder that is performing the technique <NUM>. In some implementations, the filtering may be performed using a loop restoration tool of a video decoder, such as where the pre-filtered pixel values from respective regions of the video frame are pixel values output from a CDEF filter tool of the video decoder. In some implementations, the filtering may be performed using a CDEF tool of a video decoder, such as where the pre-filtered pixel values from respective regions of the video frame are pixel values output from a deblocking filter tool of the video decoder.

At <NUM>, the filtered pixel values for the Nth processing unit are written from the buffer to the video frame. The filtered pixel values are written to the video frame at a location based on the writing point and based on the offset applied to the writing point for Nth processing unit. Writing the filtered pixel values for the Nth processing unit to the video frame includes shifting a location of a first pixel of the region from the video frame for the processing unit based on a difference between the start point and the writing point. The first pixel of the region from the video frame for the processing unit is indicated by the offset.

At <NUM>, a determination is made as to whether the Nth processing unit is the last processing unit. At <NUM>, responsive to a determination that the Nth processing unit is not the last processing unit, the value of N is increased by one. The technique <NUM> then returns to <NUM>, where the pre-filtered pixel values for the new Nth processing unit are copied to the buffer. The operations performed at <NUM> through <NUM> repeat until a then-current Nth processing unit is the last processing unit. At <NUM>, responsive to a determination that the Nth processing unit is the last processing unit, the video frame is output for display or storage.

In some implementations, the technique <NUM> may include clearing the buffer. In some implementations, the buffer may be cleared after writing the filtered pixel values for the Nth processing unit to the video frame and before copying the pre-filtered pixel values for the next Nth processing unit to the buffer. Clearing the buffer may, for example, include deleting the video data stored in the buffer to free up space for a next set of video data. In some implementations, clearing the buffer may include enabling a next set of video data to overwrite the video data then-currently stored in the buffer.

In some implementations, the filtered pixel values are written to a frame buffer, such as a reference frame buffer, instead of to the video frame. For example, the video frame may simply be the source of the pre-filtered pixel values and may not be written to. Instead, the filtered pixel values may be written directly to a reference frame buffer or other frame buffer. In such an implementation, outputting the video frame for display or storage may simply include verifying that filtered pixel values for a last processing unit have been written to the reference frame buffer or other frame buffer.

In some implementations, the technique <NUM> may include changing a head pointer of a frame buffer from the start point of the video frame to the writing point. For example, the frame buffer may be a reference frame buffer used to store reference frames for encoding or decoding further video frames. The head pointer of the frame buffer by default may point to the start point of the video frame, as the start point indicates the location of the first pixel of the video frame before filtering is performed. However, because the filtered regions of the video frame are shifted by the filtering based on the writing point, the head pointer of the frame buffer is changed for the video frame to indicate that the first pixel is located at the writing point, and not at the start point.

Referring next to <FIG>, the technique <NUM> for copying and writing pixel values based on a writing point for a video frame is shown. At <NUM>, a writing point is identified for the video frame. Identifying the writing point includes determining an extended frame boundary. The extended frame boundary may be determined based on an alignment for the video frame, such as based on a resolution for the video frame. The writing point represents a location of a first extended pixel value of the extended frame boundary.

At <NUM>, values for a first processing unit are copied to a buffer based on the writing point. The values for the first processing unit are pre-filtered pixel values from a first region of the video frame starting at a start point of the video frame, which may, for example, be the top-left-most pixel position of the video frame. The buffer is a buffer having a fixed size for storing an extended region of the processing units of the video frame.

At <NUM>, filtering is performed against the buffered values for the first processing unit. The filtering may include using one or more filtering tools available to the encoder or the decoder performing the technique <NUM>. For example, the filtering can include using a loop restoration tool or a CDEF tool to change one or more of the pre-filtered pixel values stored in the buffer.

At <NUM>, the filtered values for the first processing unit are written to the video frame. The filtered values for the first processing unit are written to the video frame at the writing point.

At <NUM>, values for a second processing unit are copied to a buffer based on an offset applied to the writing point, the values for the second processing unit are pre-filtered pixel values from a second region of the video frame. The second region of the video frame is identified based on the offset applied to the writing point.

At <NUM>, filtering is performed against the buffered values for the second processing unit. The filtering of the values for the second processing unit is performed using the same filtering tool as was used to previously filter the values for the first processing unit.

At <NUM>, the filtered values for the second processing unit are written to the video frame. The filtered values for the second processing unit are written to the video frame at a location defined based on the offset for the second processing unit.

At <NUM>, the video frame is output for display or storage. In some implementations, the video frame may be output for display within an output video stream. In some implementations, the video frame may be output for storage, such as in a reference frame buffer.

In some implementations, the technique <NUM> may include clearing the buffer. In some implementations, the buffer may be cleared after writing the filtered pixel values for the first processing unit to the video frame and before copying the pre-filtered pixel values for the second processing unit to the buffer. Clearing the buffer may, for example, include deleting the video data stored in the buffer to free up space for a next set of video data. In some implementations, clearing the buffer may include enabling a next set of video data to overwrite the video data then-currently stored in the buffer.

Further, in one unclaimed aspect, for example, the transmitting station <NUM> or the receiving station <NUM> can be implemented using a general purpose computer or general purpose processor with a computer program that, when executed, carries out any of the respective methods, algorithms, and/or instructions described herein. In addition, or alternatively, for example, a special purpose computer/processor can be utilized which can contain other hardware for carrying out any of the methods, algorithms, or instructions described herein.

Claim 1:
A method for filtering a video frame stored in a frame buffer based on a division of the video frame into a plurality of processing units, the method comprising:
defining a start point for the video frame, the start point representing a location within the frame buffer corresponding to a location of a first pixel to filter;
defining a writing point for the video frame, the writing point representing a location within the frame buffer extended beyond a boundary of the video frame and being shifted from said start point in two-dimensions;
allocating (<NUM>) a fixed size buffer having a size greater than a size of the processing units, wherein the fixed size of the buffer is configured for storing information associated with one of the processing units at a time;
for each of the processing units,
copying (<NUM>) pre-filtered pixel values from a corresponding region of the video frame buffer to the fixed size buffer, wherein the corresponding region of the video frame is selected based on an offset applied to said writing point, wherein the offset specifies a two-dimensional distance from the writing point based on a number of processing units for which filtering has already been performed such that the offset is different for each of the processing units, and where the corresponding region has said size of the buffer and encompasses the processing unit,
performing (<NUM>) filtering against the pre-filtered pixel values within the fixed size buffer to produce filtered pixel values corresponding to the processing unit, and writing (<NUM>), from the fixed size buffer, the filtered pixel values to the video frame buffer based on the writing point, the offset, and the shift between the starting point and the writing point such that the filtered pixel values are written to respective locations of the video frame buffer shifted relative to their previous locations; and
after the filtered pixel values are written to the video frame buffer for each of the processing units, outputting (<NUM>) the video frame for display or storage.