# Patent

## Title
Motion estimation aided noise reduction

## Abstract

A method and apparatus for performing motion estimation aided noise reduction encoding and decoding are provided. Motion estimation aided noise reduction encoding can include identifying a motion vector for encoding a current block in a video frame based on a reference block in a reference frame, identifying a noise reduction block for denoising the current block, aligning the noise reduction block with the current block, denoising the current block, identifying a motion vector for encoding the denoised block, generating a residual block for encoding the denoised block, and encoding the denoised block. Denoising the current block can include identifying a filter coefficient for a pixel in the current block based on a corresponding pixel in the noise reduction block, producing a denoised pixel based on the coefficient and the corresponding pixel, and determining whether to use the denoised pixel or the current pixel for encoding the block.

## Background
TECHNICAL FIELD
This application relates to video encoding and decoding.
BACKGROUND
Digital video can be used, for example, for remote business meetings via video conferencing, high definition video entertainment, video advertisements, or sharing of user-generated videos. Accordingly, it would be advantageous to provide high resolution video transmitted over communications channels having limited bandwidth.
SUMMARY
A method and apparatus for performing motion estimation aided noise reduction encoding and decoding are provided. Motion estimation aided noise reduction encoding can include identifying a motion vector for encoding a current block in a video frame based on a reference block in a reference frame, identifying a noise reduction block for denoising the current block, aligning the noise reduction block with the current block, denoising the current block, identifying a motion vector for encoding the denoised block, generating a residual block for encoding the denoised block, and encoding the denoised block. Denoising the current block can include identifying a filter coefficient for a pixel in the current block based on a corresponding pixel in the noise reduction block, producing a denoised pixel based on the coefficient and the corresponding pixel, and determining whether to use the denoised pixel or the current pixel for encoding the block.



BRIEF DESCRIPTION OF THE DRAWINGS
The description herein makes reference to the accompanying drawings wherein like reference numerals refer to like parts throughout the several views, and wherein:
FIG. 1 is a schematic of a video encoding and decoding system;
FIG. 2 is a diagram of a typical video stream to be encoded and decoded;
FIG. 3 is a block diagram of a video compression system in accordance with one embodiment;
FIG. 4 is a block diagram of a video decompression system in accordance with another embodiment;
FIG. 5 is a block diagram of motion estimation aided noise reduction encoding for a series of frames in accordance with implementations of this disclosure;
FIG. 6 is a diagram of motion estimation aided noise reduction encoding in accordance with implementations of this disclosure;
FIG. 7 is a diagram of generating a denoised block in accordance with implementations of this disclosure; and
FIG. 8 is a diagram of generating a denoised block using multiple noise reduction blocks in accordance with implementations of this disclosure.



DETAILED DESCRIPTION
Digital video is used for various purposes including, for example, remote business meetings via video conferencing, high definition video entertainment, video advertisements, and sharing of user-generated videos. Digital video streams can include formats such as VP8, promulgated by Google, Inc. of Mountain View, Calif., and H.264, a standard promulgated by ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG), including present and future versions thereof.
Video encoding and decoding can include performing motion estimation to generate a motion vector for encoding a block in a current frame based on a corresponding block in a reference frame of a video signal. The video signal can include noise, such as random variations of pixel values. For example, a pixel, such as a background pixel, may include noise, such as a random change in color or brightness when compared to a corresponding pixel in a previous frame. Noise reduction can be performed at the encoder to reduce the noise in the video signal. Motion estimation aided noise reduction can include using the motion vector identified during motion estimation in conjunction with a noise reduction block to efficiently reduce noise in the signal while minimizing blurring and/or artifacting, for example, by replacing a pixel value with an average pixel value. For example, the average pixel value can be generated using a motion compensated noise reduction pixel from the noise reduction block and the pixel value.
A noise reduction block can include pixels used for noise reduction of a block in another frame, such as previous frame in the video sequence. For example, a noise reduction block can be used for denoising a first block in a first frame in the video signal. The noise reduction frame can include information, such as denoised pixel values, from denoising the first block, and can be used for denoising a second block in a second frame in the video signal.
FIG. 1 is a schematic of a video encoding and decoding system. An exemplary transmitting station 12 can be, for example, a computing device having an internal configuration of hardware including a processor such as a central processing unit (CPU) 14 and a memory 16. The CPU 14 can be a controller for controlling the operations of the transmitting station 12. The CPU 14 is connected to the memory 16 by, for example, a memory bus. The memory 16 can be random access memory (RAM) or any other suitable memory device. The memory 16 can store data and program instructions which are used by the CPU 14. Other suitable implementations of the transmitting station 12 are possible. As used herein, the term “computing device” includes a server, a hand-held device, a laptop computer, a desktop computer, a special purpose computer, a general purpose computer, or any device, or combination of devices, capable of processing information, programmed to perform the methods, or any portion thereof, disclosed herein.
A network 28 can connect the transmitting station 12 and a receiving station 30 for encoding and decoding of the video stream. Specifically, the video stream can be encoded in the transmitting station 12 and the encoded video stream can be decoded in the receiving station 30. The network 28 can, for example, be the Internet. The network 28 can also be a local area network (LAN), wide area network (WAN), virtual private network (VPN), a mobile phone network, or any other means of transferring the video stream from the transmitting station 12.
The receiving station 30, in one example, can be a computing device having an internal configuration of hardware including a processor such as a central processing unit (CPU) 32 and a memory 34. The CPU 32 is a controller for controlling the operations of the receiving station 30. The CPU 32 can be connected to the memory 34 by, for example, a memory bus. The memory 34 can be RAM or any other suitable memory device. The memory 34 stores data and program instructions which are used by the CPU 32. Other suitable implementations of the receiving station 30 are possible.
A display 36 configured to display a video stream can be connected to the receiving station 30. The display 36 can be implemented in various ways, including by a liquid crystal display (LCD) or a cathode-ray tube (CRT). The display 36 can be configured to display a video stream decoded at the receiving station 30.
Other implementations of the encoder and decoder system 10 are possible. For example, one implementation can omit the network 28 and/or the display 36. In another implementation, a video stream can be encoded and then stored for transmission at a later time by the receiving station 30 or any other device having memory. In an implementation, the receiving station 30 receives (e.g., via network 28, a computer bus, and/or some communication pathway) the encoded video stream and stores the video stream for later decoding. In another implementation, additional components can be added to the encoder and decoder system 10. For example, a display or a video camera can be attached to the transmitting station 12 to capture the video stream to be encoded.
FIG. 2 is a diagram of a typical video stream 50 to be encoded and decoded. The video stream 50 includes a video sequence 52. At the next level, the video sequence 52 includes a number of adjacent frames 54. While three frames are depicted in adjacent frames 54, the video sequence 52 can include any number of adjacent frames. The adjacent frames 54 can then be further subdivided into a single frame 56. At the next level, the single frame 56 can be divided into a series of blocks 58. Although not shown in FIG. 2, a block 58 can include pixels. For example, a block can include a 16×16 group of pixels, an 8×8 group of pixels, an 8×16 group of pixels, or any other group of pixels. Unless otherwise indicated herein, the term ‘block’ can include a macroblock, a segment, a slice, or any other portion of a frame. A frame, a block, a pixel, or a combination thereof can include display information, such as luminance information, chrominance information, or any other information that can be used to store, modify, communicate, or display the video stream or a portion thereof.
FIG. 3 is a block diagram of an encoder 70 in accordance with one embodiment. The encoder 70 can be implemented, as described above, in the transmitting station 12 such as by providing a computer software program stored in memory 16, for example. The computer software program can include machine instructions that, when executed by CPU 14, cause transmitting station 12 to encode video data in the manner described in FIG. 3. Encoder 70 can also be implemented as specialized hardware included, for example, in transmitting station 12. Encoder 70 can also be implemented as specialized hardware included, for example, in transmitting station 12. The encoder 70 encodes an input video stream 50. The encoder 70 has the following stages to perform the various functions in a forward path (shown by the solid connection lines) to produce an encoded or a compressed bitstream 88: an intra/inter prediction stage 72, a transform stage 74, a quantization stage 76, and an entropy encoding stage 78. The encoder 70 can also include a reconstruction path (shown by the dotted connection lines) to reconstruct a frame for encoding of further blocks. The encoder 70 has the following stages to perform the various functions in the reconstruction path: a dequantization stage 80, an inverse transform stage 82, a reconstruction stage 84, and a loop filtering stage 86. Other structural variations of the encoder 70 can be used to encode the video stream 50.
When the video stream 50 is presented for encoding, each frame 56 within the video stream 50 is processed in units of blocks. At the intra/inter prediction stage 72, each block can be encoded using either intra-frame prediction, which may be within a single frame, or inter-frame prediction, which may be from frame to frame. In either case, a prediction block can be formed. In the case of intra-prediction, a prediction block can be formed from samples in the current frame that have been previously encoded and reconstructed. In the case of inter-prediction, a prediction block can be formed from samples in one or more previously constructed reference frames.
Next, still referring to FIG. 3, the prediction block can be subtracted from the current block at the intra/inter prediction stage 72 to produce a residual block. The transform stage 74 transforms the residual block into transform coefficients in, for example, the frequency domain. Examples of block-based transforms include the Karhunen-Loève Transform (KLT), the Discrete Cosine Transform (DCT), and the Singular Value Decomposition Transform (SVD). In one example, the DCT transforms the block into the frequency domain. In the case of DCT, the transform coefficient values are based on spatial frequency, with the lowest frequency (i.e. DC) coefficient at the top-left of the matrix and the highest frequency coefficient at the bottom-right of the matrix.
The quantization stage 76 converts the transform coefficients into discrete quantum values, which are referred to as quantized transform coefficients or quantization levels. The quantized transform coefficients are then entropy encoded by the entropy encoding stage 78. Entropy encoding can include using a probability distribution metric. The entropy-encoded coefficients, together with the information used to decode the block, which may include the type of prediction used, motion vectors, and quantizer value, are then output to the compressed bitstream 88. The compressed bitstream 88 can be formatted using various techniques, such as run-length encoding (RLE) and zero-run coding.
The reconstruction path in FIG. 3 (shown by the dotted connection lines) can be used to help provide that both the encoder 70 and a decoder 100 (described below) with the same reference frames to decode the compressed bitstream 88. The reconstruction path performs functions that are similar to functions that take place during the decoding process that are discussed in more detail below, including dequantizing the quantized transform coefficients at the dequantization stage 80 and inverse transforming the dequantized transform coefficients at the inverse transform stage 82 to produce a derivative residual block. At the reconstruction stage 84, the prediction block that was predicted at the intra/inter prediction stage 72 can be added to the derivative residual block to create a reconstructed block. The loop filtering stage 86 can be applied to the reconstructed block to reduce distortion such as blocking artifacts.
Other variations of the encoder 70 can be used to encode the compressed bitstream 88. For example, a non-transform based encoder 70 can quantize the residual block directly without the transform stage 74. In another embodiment, an encoder 70 can have the quantization stage 76 and the dequantization stage 80 combined into a single stage.
FIG. 4 is a block diagram of a decoder 100 in accordance with another embodiment. The decoder 100 can be implemented in a device, such as the receiving station 30 described above, for example, by providing a computer software program stored in memory 34. The computer software program can include machine instructions that, when executed by CPU 32, cause receiving station 30 to decode video data in the manner described in FIG. 4. Decoder 100 can also be implemented as specialized hardware included, for example, in transmitting station 12 or receiving station 30.
The decoder 100, similar to the reconstruction path of the encoder 70 discussed above, includes in one example the following stages to perform various functions to produce an output video stream 116 from the compressed bitstream 88: an entropy decoding stage 102, a dequantization stage 104, an inverse transform stage 106, an intra/inter prediction stage 108, a reconstruction stage 110, a loop filtering stage 112 and a deblocking filtering stage 114. Other structural variations of the decoder 100 can be used to decode the compressed bitstream 88.
When the compressed bitstream 88 is presented for decoding, the data elements within the compressed bitstream 88 can be decoded by the entropy decoding stage 102 (using, for example, Context Adaptive Binary Arithmetic Decoding) to produce a set of quantized transform coefficients. The dequantization stage 104 dequantizes the quantized transform coefficients, and the inverse transform stage 106 inverse transforms the dequantized transform coefficients to produce a derivative residual block that can be identical to that created by the inverse transformation stage 84 in the encoder 70. Using header information decoded from the compressed bitstream 88, the decoder 100 can use the intra/inter prediction stage 108 to create the same prediction block as was created in the encoder 70. At the reconstruction stage 110, the prediction block can be added to the derivative residual block to create a reconstructed block. The loop filtering stage 112 can be applied to the reconstructed block to reduce blocking artifacts. The deblocking filtering stage 114 can be applied to the reconstructed block to reduce blocking distortion, and the result is output as the output video stream 116.
Other variations of the decoder 100 can be used to decode the compressed bitstream 88. For example, the decoder 100 can produce the output video stream 116 without the deblocking filtering stage 114.
FIG. 5 is a block diagram of motion estimation aided noise reduction encoding for a series of frames in accordance with one embodiment of this disclosure. Implementations of motion estimation aided noise reduction encoding can include using a first noise reduction frame 500, a first unencoded frame 502, or both to generate a first denoised frame 504. In an implementation, generating the first denoised frame 504 can include including a pixel from the first noise reduction frame 500, a pixel from the first unencoded frame 502, a pixel based on a pixel from the first noise reduction frame 500 and a pixel from the first unencoded frame 502, or a combination thereof, in the first denoised frame 504. The first unencoded frame 502 can be a frame from a video sequence, such as the video sequence 52 shown in FIG. 2, for example.
Motion estimation aided noise reduction encoding can include using the first denoised frame 504 to generate a first encoded frame 506. Motion estimation aided noise reduction encoding can include using the first noise reduction frame 500, the first denoised frame 504, or both to generate a second noise reduction frame 510. Generating the second noise reduction frame 510 can include including a pixel from the first noise reduction frame 500, a pixel from the first denoised frame 504, a pixel based on a pixel from the first noise reduction frame 500 and a pixel from the first denoised frame 504, or a combination thereof, in the second noise reduction frame 510.
The second noise reduction frame 510, a second unencoded frame 512, or both can be used to generate a second denoised frame 514. The second unencoded frame 512 can be a second frame in the video sequence. The second denoised frame 514 can be used to generate a second encoded frame 516. The second noise reduction frame 510, the second denoised frame 514, or both can be used to generate a third noise reduction frame 520. The third noise reduction frame 520, a third unencoded frame 522, or both can be used to generate a third denoised frame 524. The third unencoded frame 514 can be a third frame in the video sequence. The third denoised frame 524 can be used to generate a third encoded frame 526. The first encoded frame 506, the second encoded frame 516, the third encoded frame 526, or a combination thereof can be used to generate an encoded video stream, such as the compressed bitstream 88 shown in FIGS. 3 and 5.
FIG. 6 is a diagram of motion estimation aided noise reduction encoding in accordance with one embodiment of this disclosure. Implementations of motion estimation aided noise reduction encoding can include identifying a frame at 600, identifying a current block in the frame at 610, identifying a motion vector for encoding the current block at 620, denoising the block at 630, identifying a motion vector for encoding the denoised block at 640, generating a residual block at 650, generating an encoded block at 660, determining whether to encode another block at 670, determining whether to encode another frame at 680, or a combination thereof. In an implementation, a device, such as the transmitting station 12 shown in FIG. 1, can perform motion estimation aided noise reduction encoding. For example, motion estimation aided noise reduction encoding, or any portion thereof, can be implemented in an encoder, such as the encoder 70 shown in FIG. 3.
As an example, a frame, such as frame 56 shown in FIG. 2, can be identified for encoding at 600. For example, the frame can include an 8×8 matrix of blocks as shown in FIG. 2. Identifying the frame can include identifying a current frame, a reference frame, a noise reduction frame, or a combination thereof.
A block (current block) in the current frame can be identified at 610. For example, the current block can be identified based on Cartesian coordinates. The current block can include pixels. For example, the current block can include a 16×16 matrix of pixels.
A motion vector (MV) for encoding the current block can be identified at 620. For example, the motion vector can be identified based on the current block and a reference block from a reference frame using a method of motion estimation, such as a motion search. Identifying a motion vector can include generating a prediction mode for encoding the current block, generating a sum of squared errors (SSE) for the current block, or both. Identifying the motion vector can include identifying a zero magnitude motion vector (MV0). The zero magnitude motion vector MV0 can indicate a block in the reference frame that is collocated with the current block in the current frame.
The current block can be denoised at 630. Denoising the current block can include identifying a noise reduction block at 632 and generating a denoised block at 634. Identifying the noise reduction block at 632 can include using a noise reduction block from a noise reduction frame (e.g., 500), determining whether a difference between the current block and the reference block is noise, aligning the noise reduction block with the current block, or a combination thereof.
Determining whether a difference between the current block and the reference block is noise can include determining whether the magnitude of the motion vector is less than a threshold (T1), which can indicate noise. On a condition that the magnitude of the motion vector is greater than the threshold T1, the noise reduction block can be aligned with the current block. The motion vector can, for example, include Cartesian coordinates, such as an X coordinate, a Y coordinate, or both, and the magnitude of the motion vector can be a function of the coordinates, such as a square root of the sum of the X coordinate squared and the Y coordinate squared.
The motion vector (MV) identified at 620 can be a non-zero motion vector for the current block that is identified based on noise, such as random variations in pixel values in the current frame, the reference frame, or both. For example, the motion search may determine that a location of the reference block in the reference frame that best matches the current block is slightly different than the location of the current block in the current frame based on noise.
Determining whether a difference between the current block and the reference block is noise can include determining whether the difference between a sum of squared errors (SSE) of the motion vector and an SSE of a zero magnitude motion vector is less than a threshold (T2). The SSEs can be determined based on the sum of squared differences between the pixels of the reference block and the current block.
For example, the current block may include an M×N matrix of pixels, such as a 16×16 matrix of pixels, and a pixel in the current block can be expressed as B(M,N). The reference block indicated by the motion vector may include an M×N matrix of pixels, and a pixel in the reference block can be expressed as RB(M,N). The block in the reference frame indicated by the zero magnitude motion vector MV0 may include an M×N matrix of pixels, and a pixel in the block in the reference frame indicated by the zero magnitude motion vector MV0 can be expressed as RB0(M,N). The motion vector can indicate a row offset MVx and a column offset MVy. In an implementation, the SSE associated with the motion vector SSEr may be expressed as:

SSEr=Σx=1;y=1M;NB(x,y)−RB(x,y).  [Equation 1]

The SSE associated with the zero magnitude motion vector SSE0 may be expressed as:

SSE0=Σx=1;y=1M;NB(x,y)−RB0(x,y).  [Equation 2]

On a condition that the magnitude of the motion vector identified at 620 is less than T1 and the difference between SSEr and SSE0 is less than T2, the motion vector may be a small motion vector that indicates noise. On a condition that the magnitude of the motion vector is less than T1, or the difference between SSEr and SSE0 is greater than T2, the noise reduction block may be aligned with the current block.
At 634, a denoised block can be generated using the current block and the noise reduction block. For example, a denoised block can be generated as shown in FIG. 7. As shown in FIG. 6, a motion vector for encoding the denoised block can be identified at 640. In an implementation, identifying the motion vector for encoding the denoised block can include using the motion vector identified for encoding the current block at 620 as the motion vector for encoding the denoised block.
In an implementation, identifying the motion vector for encoding the denoised block can include determining whether to use a zero magnitude motion vector to a reference frame for encoding the denoised block. For example, the motion vector identified for encoding the current block may indicate an intra prediction mode and a zero magnitude motion vector to a reference frame can be used for encoding the denoised block. In an implementation, a zero magnitude motion vector to the reference frame may produce a smaller residual than the motion vector identified at 620, and the zero magnitude motion vector can be used for encoding the denoised block. Alternatively, or in addition, identifying the motion vector for encoding the denoised block at 640 can include motion estimation, which can include generating a motion vector for encoding the denoised block based on the denoised block and the reference frame.
A residual block can be generated based on the denoised block at 650, and an encoded block can be generated using the residual block at 660. Whether to encode another block can be determined at 670. For example, unencoded blocks in the current frame can be encoded. Whether to encode another frame can be determined at 680. For example, the noise reduction block can be used to encode another frame, such as a future frame, in the video sequence.
Although not shown in FIG. 6, an encoded video stream, such as the compressed bit stream 88 shown in FIG. 3, can be generated using the encoded block(s) generated at 660. The encoded video stream can be transmitted, stored, further processed, or a combination thereof. For example, the encoded video stream can be stored in a memory, such as the memory 16 and/or 34 shown in FIG. 1. The encoded video stream can also be transmitted to a decoder, such as the decoder 100 shown in FIG. 4.
Other implementations of the diagram of motion estimation aided noise reduction encoding as shown in FIG. 6 are available. In implementations, additional elements of motion estimation aided noise reduction encoding can be added, certain elements can be combined, and/or certain elements can be removed. For example, in an implementation, motion estimation aided noise reduction encoding can include an additional element involving determining whether to denoise a block, and if the determination is not to denoise, the element at 630 of denoising a block can be skipped and/or omitted for one or more blocks and/or frames. Alternatively, or in addition, motion estimation aided noise reduction encoding can include controlling an amount of noise reduction, which can be based on an estimate of the amount of noise, such as an estimate of noise variance or a probability density function.
FIG. 7 is a diagram of generating a denoised block (e.g., at 634) in accordance with one embodiment of this disclosure. Implementations of, generating a denoised block can include identifying pixels at 700, identifying a coefficient at 710, applying a weight (e.g., weighting the coefficient) at 720, producing a denoised pixel at 730, evaluating the denoised pixel at 740, processing the pixels at 750, determining whether to produce another denoised pixel at 760, or a combination thereof.
More specifically, as an example, pixels for generating the denoised block can be identified at 700. Identifying the pixels can include identifying a current pixel (Pk) in a current block (e.g., as the block identified at 610) and/or identifying a noise reduction pixel (NRPk) in a noise reduction block (e.g., the noise reduction block identified at 632). Identifying the noise reduction pixel can be based on the current pixel. For example, the location of the current pixel in the current block may correspond with the location of the noise reduction pixel in the noise reduction block.
A coefficient (alpha′) can be identified at 710. The coefficient can be identified based on the current pixel and the noise reduction pixel. For example, the coefficient can be identified based on a function of the magnitude of the difference between the current pixel and the noise reduction pixel. In one implementation, the coefficient may be calculated as follows:

alpha′=1/(1+(|Pk−NRPk|)/8).  [Equation 3]

The coefficient can be weighted at 720. The coefficient can be weighted based on the motion vector. For example, the coefficient can be weighted based on a function of the coefficient and a magnitude of the motion vector (e.g., the motion vector identified at 620). In one implementation, the magnitude of the motion vector and a threshold can be used to indicate whether the current block includes noise. If noise is indicated in the current block, the coefficient can be increased. If noise is not indicated in the current block, the coefficient can be decreased. For example, in one implementation, the weighting can be expressed as:

alpha′=(|MV|2<2*T1)→alpha′+alpha′/(3+|MV|2/10);

alpha′=(|MV|2≧8*T1)→0;

alpha′=[0,1].  [Equation 4]

A denoised pixel Pk′ can be produced at 730. The denoised pixel can be produced based on a function of the current pixel Pk, the coefficient alpha′, the noise reduction pixel NRPk, or a combination thereof. In one implementation, a denoised pixel may be calculated (produced) as follows:

Pk′=alpha′*NRPk+(1−alpha′)*Pk.  [Equation 5]

The denoised pixel Pk′ can be evaluated at 740. Evaluating the denoised pixel Pk′ can include determining whether to include the denoised pixel in the denoised block being generated, determining whether to include the denoised pixel in the noise reduction block being used for generating the denoised block, determining whether to include the current pixel in the denoised block being generated, determining whether to include the current pixel in the noise reduction block being used for generating the denoised block, or a combination thereof. In at least one implementation, the current pixels and/or denoised pixels can be included in a noise reduction block used for generating a next denoised block instead of or in addition to the noise reduction block being used for generating the denoised block.
The evaluation can be based on the denoised pixel and the current pixel. For example, the difference between the current pixel and the denoised pixel can be less than a threshold (T3) and can indicate a small change. In one example, if a small change is indicated, the denoised pixel Pk′ can be included in the denoised block being generated and the noise reduction block being used for generating the denoised block. In another example, if a small change is not indicated, the current pixel Pk can be included in the denoised block being generated and the noise reduction block being used for generating the denoised block. Alternatively or additionally, if a small change is not indicated, the current pixel Pk can be included in the denoised block being generated and the denoised pixel Pk′ can be included in the noise reduction block being used for generating the denoised block. In an implementation, the noise reduction block used for generating the denoised block can include pixels from the current block, denoised pixels, or both, and can be used for denoising a block in a future frame.
Evaluating the denoised pixel Pk′ can also include evaluating the current block. Evaluating the current block can include determining whether the sum of squared errors (SSE) of the motion vector identified at 620 SSEr is less than a threshold (T4), which can indicate that the current block includes a shift in mean. For example, the SSEr can be less than or equal to the threshold T4 and the denoised pixel Pk′ can be included in the denoised block being generated and the noise reduction block being used for generating the denoised block. In another example, the SSEr can be greater than the threshold T4 and the current pixel Pk can be included in the denoised block being generated and the noise reduction block being used for generating the denoised block.
Although described separately, evaluating the difference between the current pixel and the denoised pixel, and evaluating the SSEr can be performed in combination. For example, the difference between the current pixel and the denoised pixel can be less than a threshold (T3) and the SSEr can be less than the threshold T4, and the denoised pixel Pk′ can be included in the denoised block being generated and the noise reduction block being used for generating the denoised block.
The pixels, such as the current pixel, the denoised pixel, the noise reduction pixel, or a combination thereof, can be processed at 750. Processing the pixels can include including the denoised pixel in the denoised block, including the current pixel in the denoised block, including the denoised pixel in the noise reduction block, including the current pixel in the noise reduction block, or a combination thereof. The denoised pixel, the current pixel, or a combination thereof can be included in the denoised block, the noise reduction block, or a combination thereof based on the evaluation above.
For example, in an implementation, the denoised pixel produced at 730 can be included in the denoised block being generated at 634 and the noise reduction block being used to generate the denoised block being generated at 634 on a condition that the evaluation indicates a small difference between the current pixel and the denoised pixel, which can be expressed as (Pk−Pk′)2<T2, and a small SSEr, which can be expressed as SSEr<T3. Including the denoised pixel in the noise reduction block can include replacing the noise reduction pixel with the denoised pixel. In an implementation, the difference between the current pixel and the denoised pixel may be greater than a threshold or the SSEr may be greater than a threshold, and the current pixel can be included in the noise reduction block, the denoised block, or both. In another implementation, the difference between the current pixel and the denoised pixel may be greater than a threshold or the SSEr may be greater than a threshold, and the denoised pixel can be included in the noise reduction block.
Although described separately for clarity, and while the terms are not used interchangeably, the current block and the denoised block can be the same block. For example, including a denoised pixel in the denoised block can include replacing the current pixel with the denoised pixel in the current block. The noise reduction block can be included in a noise reduction frame (e.g., 510) and can be used for encoding another frame, such as a future frame, in the video sequence.
Other implementations of the diagram of generating a denoised block as shown in FIG. 7 are available. In implementations, additional elements of generating a denoised block can be added, certain elements can be combined, and/or certain elements can be removed. For example, in an implementation, generating a denoised block at 730 can include a combination of evaluating the pixels as shown at 740 and processing the pixels as shown at 750.
Although FIG. 7 describes an example of denoising using one noise reduction block for simplicity, implementations of this disclosure can include using any number of noise reduction blocks. For example, motion estimation aided noise reduction can include using multiple blocks from N previous frames, which may be denoised frames, as noise reduction blocks. FIG. 8 is a diagram of generating a denoised block using multiple noise reduction blocks in accordance with one embodiment of this disclosure. Motion estimation aided noise reduction can include identifying noise reduction blocks at 800, identifying taps at 810, applying weights (e.g., weighting the taps) at 820, producing a denoised pixel at 830, evaluating the denoised pixel at 840, processing the pixels at 850, determining whether to produce another denoised pixel at 860, or a combination thereof.
More specifically, as an example, noise reduction blocks can be identified at 800. Each noise reduction block (NRBi,j) can be associated with a block (j) of a frame (i). For example, a first noise reduction block NRB1,j can be associated with a block from a first frame, which may be a previous frame in the video sequence, and a second noise reduction block NRB2,j can be associated with a block from a second frame, which may be a previous frame in the video sequence. The location of the first noise reduction block in the first frame can correspond with the location of the second noise reduction block in the second frame. The noise reduction blocks can be denoised blocks. The noise reduction blocks can be unencoded blocks. Identifying the noise reduction block can include aligning each of the noise reduction blocks with the current block. Aligning the noise reduction blocks can include finding the noise reduced block which, according to the motion vectors, match the current block. In an implementation, aligning can include adjusting positions of the noise reduction blocks within an noise reduction frame based on the motion vectors. In an implementation, a noise reduction pixel (NRPi,j,k) can be a pixel (k) in a noise reduction block (j) in a frame (i).
Taps can be identified at 810. A tap (TAPi,j,k) can be associated with a pixel (k) of a block (j) of a frame (i) and can indicate a pixel (k) value weighting metric. For example, a tap TAP0,j,k can be associated with the current block of a current frame and can indicate a metric for weighting the current pixel Pk. A tap TAP1,j,k can be associated with the first noise reduction block NRB1,1 and can indicate a metric for weighting a noise reduction pixel in the first noise reduction block NRB1. A tap TAP2,j,k can be associated with the second noise reduction block NRB2 and can indicate a metric for weighting a noise reduction pixel in the second noise reduction block.
The taps can be weighted at 820. The taps can indicate equal pixel value weights. For example, the magnitude of the motion vector can be zero and the weighting metrics can be equal. In an implementation, the taps can be weighted based on proximity, such as in cases where the magnitude of the motion vector is greater than zero. For example, a first tap can be associated with a first noise reduction block. The first noise reduction block can be based on a first previous frame, which can precede the current frame in the video sequence. A second tap can be associated with a second noise reduction block. The second noise reduction block can be based on a second previous frame, which can precede the first previous frame in the video sequence. The magnitude of the motion vector can be non-zero and the first tap can weighted more heavily than the second tap.
A denoised pixel Pk′ can be produced at 830. Producing the denoised pixel can include identifying a noise reduction pixel NRPi,j,k from each noise reduction block NRBi,j based on the location of the current pixel Pk in the current block of the current frame. Producing a denoised pixel Pk′ can include determining a weighted pixel value NRPi,j,k′ for each noise reduction pixel NRPi,j,k based on an associated tap, determining a weighted pixel value for the current pixel, and determining a sum of the weighted pixel values. For example, a first tap TAP1,1,k can be associated with the first noise reduction block NRB1,1 and can indicate a metric of 1⁄4 for weighting a noise reduction pixel NRP1,1,1 in the first noise reduction block. For example, producing a denoised pixel using N taps may be expressed as:

Pk′=TAP0,1,k*Pk+Σj=1N(TAPi,j,k*NRPi,j,k).  [Equation 6]

Producing the denoised pixel can include determining the variance among the weighted pixel values. For example, the variance can be the difference between the sum of the weighted pixel values and the mean of the weighted pixel values. Determining the variance may be expressed as:

Var(k)=(Σj=1N(NRPi,j,k2))−(1/NΣj=1NNRPi,j,k)2.  [Equation 7]

The denoised pixel can be evaluated at 840. The evaluation can be based on the denoised pixel and the current pixel. For example, the difference between the current pixel and the denoised pixel can be less than a threshold and can indicate a small change. The evaluation can include determining whether the variance is less than a threshold. For example, the variance can be less than a threshold and can indicate a small variance.
The pixels can be processed at 850 based on the indication of small change and/or the indication of small variance. Processing the pixels can include including the denoised pixel in the denoised block, including the current pixel in the denoised block, or a combination thereof. For example, the evaluation can indicate a small change and a small variance, and the denoised pixel can be included in the denoised block. Processing the pixels can include including the denoised pixel in a noise reduction block, including the current pixel in a noise reduction block, or a combination thereof. For example, the denoising can include using four noise reducing blocks, (e.g., identified at 800), and the denoised pixel can be included in the first noise reducing block.
Other implementations of the diagram of generating a denoised block using multiple noise reduction blocks as shown in FIG. 8 are available. In implementations, additional elements of generating a denoised block using multiple noise reduction blocks can be added, certain elements can be combined, and/or certain elements can be removed. For example, in an implementation, generating a denoised block using multiple noise reduction blocks can include combining in one element the evaluation of the pixels (as shown at 840) and the processing of the pixels (as shown at 850).
Motion estimation aided noise reduction encoding, or any portion thereof, can be implemented in a device, such as the transmitting station 12 shown in FIG. 1. For example, an encoder, such as the encoder 70 shown in FIG. 3, can implement motion estimation aided noise reduction encoding, or any portion thereof, using instruction stored on a tangible, non-transitory, computer readable media, such as memory 34 shown in FIG. 1.
The words “example” or “exemplary” are used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “example” or “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects or designs. Rather, use of the words “example” or “exemplary” is intended to present concepts in a concrete fashion. As used in this application, the term “or” is intended to mean an inclusive “or” rather than an exclusive “or”. That is, unless specified otherwise, or clear from context, “X includes A or B” is intended to mean any of the natural inclusive permutations. That is, if X includes A; X includes B; or X includes both A and B, then “X includes A or B” is satisfied under any of the foregoing instances. In addition, the articles “a” and “an” as used in this application and the appended claims should generally be construed to mean “one or more” unless specified otherwise or clear from context to be directed to a singular form. Moreover, use of the term “an embodiment” or “one embodiment” or “an implementation” or “one implementation” throughout is not intended to mean the same embodiment or implementation unless described as such. As used herein, the terms “determine” and “identify”, or any variations thereof, includes selecting, ascertaining, computing, looking up, receiving, determining, establishing, obtaining, or otherwise identifying or determining in any manner whatsoever using one or more of the devices shown in FIG. 1.
Further, for simplicity of explanation, although the figures and descriptions herein may include sequences or series of steps or stages, elements of the methods disclosed herein can occur in various orders and/or concurrently. Additionally, elements of the methods disclosed herein may occur with other elements not explicitly presented and described herein. Furthermore, not all elements of the methods described herein may be required to implement a method in accordance with the disclosed subject matter.
The embodiments of encoding and decoding described above illustrate some exemplary encoding and decoding techniques. However, it is to be understood that encoding and decoding, as those terms are used in the claims, could mean compression, decompression, transformation, or any other processing or change of data.
The embodiments of the transmitting station 12 and/or the receiving station 30 (and the algorithms, methods, instructions, etc. stored thereon and/or executed thereby) can be realized in hardware, software, or any combination thereof. The hardware can include, for example, computers, intellectual property (IP) cores, application-specific integrated circuits (ASICs), programmable logic arrays, optical processors, programmable logic controllers, microcode, microcontrollers, servers, microprocessors, digital signal processors or any other suitable circuit. In the claims, the term “processor” should be understood as encompassing any of the foregoing hardware, either singly or in combination. The terms “signal” and “data” are used interchangeably. Further, portions of the transmitting station 12 and the receiving station 30 do not necessarily have to be implemented in the same manner.
Further, in one embodiment, for example, the transmitting station 12 or the receiving station 30 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 specialized hardware for carrying out any of the methods, algorithms, or instructions described herein.
The transmitting station 12 and receiving station 30 can, for example, be implemented on computers in a real-time video system. Alternatively, the transmitting station 12 can be implemented on a server and the receiving station 30 can be implemented on a device separate from the server, such as a hand-held communications device. In this instance, the transmitting station 12 can encode content using an encoder 70 into an encoded video signal and transmit the encoded video signal to the communications device. In turn, the communications device can then decode the encoded video signal using a decoder 100. Alternatively, the communications device can decode content stored locally on the communications device, for example, content that was not transmitted by the transmitting station 12. Other suitable transmitting station 12 and receiving station 30 implementation schemes are available. For example, the receiving station 30 can be a generally stationary personal computer rather than a portable communications device and/or a device including an encoder 70 may also include a decoder 100.
Further, all or a portion of embodiments of the present invention can take the form of a computer program product accessible from, for example, a tangible computer-usable or computer-readable medium. A computer-usable or computer-readable medium can be any device that can, for example, tangibly contain, store, communicate, or transport the program for use by or in connection with any processor. The medium can be, for example, an electronic, magnetic, optical, electromagnetic, or a semiconductor device. Other suitable mediums are also available.
The above-described embodiments have been described in order to allow easy understanding of the present invention and do not limit the present invention. On the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the scope of the appended claims, which scope is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structure as is permitted under the law.

## Claims

1. A method for encoding a flame in a video stream, the frame having a plurality of blocks, the method comprising:
Identifying a noise reduction frame;
identifying a first motion vector for encoding a current block of the plurality of blocks;

wherein the first motion vector indicates a reference block in a reference frame, and wherein the noise reduction frame differs from the reference frame;
identifying a noise reduction block from the noise reduction frame using the first motion vector, such that the noise reduction block is collocated with the reference block;
generating a denoised block using the current block and the noise reduction block;
identifying a second motion vector for encoding the denoised block based on the first motion vector;
generating a residual block using the denoised block and the second motion vector; and
generating an encoded block based on the residual block and the second motion vector; and

Wherein the current block includes a plurality of current pixels;
the noise reduction block includes a plurality of noise reduction pixels; and
generating the denoised block includes:
identifying a filter coefficient based on a current pixel from the plurality of current pixels and a noise reduction pixel from the plurality of noise reduction pixels;
producing a denoised pixel based on the filter coefficient, the current pixel, and the noise reduction pixel;
on a condition that a difference between the current pixel and the denoised pixel is less than a first threshold and a sum of squared errors value is less than a second threshold, including the denoised pixel in the denoised block;
on a condition that the difference between the current pixel and the denoised pixel is greater than the first threshold, including the current pixel in the denoised block; and
on a condition that the difference between the current pixel and the denoised pixel is equal to the first threshold, including the current pixel in the denoised block; and

wherein generating the denoised block includes weighting the filter coefficient based on a weighting metric, wherein:
on a condition that a magnitude of the first motion vector is greater than a third threshold and a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is greater than a fourth threshold, the weighting metric is zero; and
on a condition that a magnitude of the first motion vector is less than the third threshold and a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is less than the fourth threshold, the weighting metric is the magnitude of the first motion vector.

2. The method of claim 1, wherein identifying the noise reduction block includes using the first motion vector to identify the noise reduction block that corresponds with the current block on a condition that a magnitude of the first motion vector is greater than a first threshold.

3. The method of claim 1, wherein identifying the noise reduction block includes using the first motion vector to identify the noise reduction block that corresponds with the current block on a condition that a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is greater than a second threshold.

4. The method of claim 1, wherein:
the current block includes a plurality of current pixels;
the noise reduction block includes a plurality of noise reduction pixels; and
generating the denoised block includes:
identifying a filter coefficient based on a current pixel from the plurality of current pixels and a noise reduction pixel from the plurality of noise reduction pixels,
producing a denoised pixel based on the filter coefficient, the current pixel, the noise reduction pixel, and
including the denoised pixel in the denoised block.

5. The method of claim 1, wherein identifying the second motion vector includes using the first motion vector as the second motion vector.

6. The method of claim 1, wherein:
identifying the noise reduction block includes identifying a plurality of noise reduction blocks from a plurality of noise reduction frames that includes the noise reduction frame, wherein a first noise reduction block in the plurality of noise reduction blocks is associated with the reference block and a second noise reduction block in the plurality of noise reduction blocks is associated with another reference block.

7. The method of claim 6, wherein:
the current block includes a plurality of current pixels;
the first noise reduction block includes a first plurality of noise reduction pixels;
the second noise reduction block includes a second plurality of noise reduction pixels; and
generating the denoised block includes:
identifying a first filter coefficient based on a current pixel from the plurality of current pixels;
identifying a first noise reduction pixel from the first plurality of noise reduction pixels;
identifying a second noise reduction pixel from the second plurality of noise reduction pixels;
producing a denoised pixel based on the filter coefficient, the current pixel, the first noise reduction pixel, and the second noise reduction pixel; and
including the denoised pixel in the denoised block.

8. The method of claim 7, wherein:
generating the denoised block includes generating a variance based on the first noise reduction pixel and the second noise reduction pixel; and
including the denoised pixel includes using the current pixel as the denoised pixel on a condition that the a difference between the current pixel and the denoised pixel is greater than a first threshold and the variance is greater than a second threshold.

9. An apparatus for encoding a frame in a video stream, the flame having a plurality of blocks, the apparatus comprising:
a memory; and
a processor configured to execute instructions stored in the memory to:
identifying a noise reduction frame;
identify a first motion vector for encoding a current block of the plurality of blocks, wherein the first motion vector indicates a reference block in a reference frame, and wherein the noise reduction frame differs from the reference frame;
identify a noise reduction block from the noise reduction frame such that the noise reduction block is collocated with the reference block;
generate a denoised block using the current block and the noise reduction block;
identify a second motion vector for encoding the denoised block based on the first motion vector;
generate a residual block using the denoised block and the second motion vector; and
generate an encoded block based on the residual block and the second motion vector; and
wherein the current block includes a plurality of current pixels;
the noise reduction block includes a plurality of noise reduction pixels; and
the processor is configured to generate the denoised block by:
identifying a filter coefficient based on a current pixel from the plurality of current pixels and a noise reduction pixel from the plurality of noise reduction pixels;
producing a denoised pixel based on the filter coefficient, the current pixel, and the noise reduction pixel;
on a condition that a difference between the current pixel and the denoised pixel is less than a first threshold and a sum of squared errors value is less than a second threshold, including the denoised pixel in the denoised block;
on a condition that the difference between the current pixel and the denoised pixel is greater than the first threshold, including the current pixel in the denoised block; and
on a condition that the difference between the current pixel and the denoised pixel is equal to the first threshold, including the current pixel in the denoised block; and
wherein the processor is configured to generate the denoised block by weighting the filter coefficient based on a weighting metric, wherein:
on a condition that a magnitude of the first motion vector is greater than a third threshold and a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is greater than a fourth threshold, the weighting metric is zero; and
on a condition that a magnitude of the first motion vector is less than the third threshold and a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is less than the fourth threshold, the weighting metric is the magnitude of the first motion vector.

10. The apparatus of claim 9, wherein the processor is configured to identify the noise reduction block by using the first motion vector to identify the noise reduction block that corresponds with the current block on a condition a magnitude of the first motion vector is less than a first threshold.

11. The apparatus of claim 9, wherein the processor is configured to identify the noise reduction block by using the first motion vector to identify the noise reduction block that corresponds with the current block on a condition that a difference between a sum of squared errors of the first motion vector and a sum of squared errors of a zero magnitude motion vector is greater than a second threshold.

12. The apparatus of claim 9, wherein:
the current block includes a plurality of current pixels;
the noise reduction block includes a plurality of noise reduction pixels; and
the processor is configured to generate the denoised block by:
identifying a filter coefficient based on a current pixel from the plurality of current pixels and a noise reduction pixel from the plurality of noise reduction pixels;
producing a denoised pixel based on the filter coefficient, the current pixel, and the noise reduction pixel; and
including the denoised pixel in the denoised block.

13. The apparatus of claim 9, wherein the processor is configured to execute instructions stored in the memory to:
determine whether an intra prediction mode is indicated by the first motion vector; and
identify a zero magnitude motion vector as the second motion vector if the intra prediction mode is indicated.

14. The apparatus of claim 9, wherein the processor is configured to identify the noise reduction block by identifying a plurality of noise reduction blocks from a plurality of noise reduction frames that includes the noise reduction frame, wherein a first noise reduction block in the plurality of noise reduction blocks is associated with the reference block and a second noise reduction block in the plurality of noise reduction blocks is associated with another reference block.

15. The method of claim 1, wherein the current block includes a plurality of current pixels, the noise reduction block includes a plurality of noise reduction pixels, and wherein generating the denoised block includes producing a denoised pixel based on a current pixel from the plurality of current pixels, and a noise reduction pixel from the plurality of noise reduction pixels, the method further comprising:
on a condition that a difference between the current pixel and the denoised pixel is within an identified threshold, including the denoised pixel in the noise reduction block; and
on a condition that a difference between the current pixel and the denoised pixel exceeds the identified threshold, including the current pixel in the noise reduction block.

16. The method of claim 1, wherein the frame is a first frame from a sequence of frames from the video stream, and wherein generating the denoised block includes generating an updated noise reduction block based on the noise reduction block and the current block, the method further comprising:
identifying a second frame from the sequence of frames, wherein the first frame precedes the second frame in the sequence of frames; and
generating a second denoised block using a block from the second frame and the updated noise reduction block.