1. Field of Invention
The present invention relates generally to pixel based temporal video processing, and more specifically to reducing undesirable contouring artifacts due to bit limiting by applying temporal dithering at a preprocessing stage, and applying temporal filtering at a post-processing stage prior to presentation.
2. Background of Invention
Dithering is a video processing technique used to improve the quality of video images which are displayed on a device with a lower resolution lower than the original image. An example of this would be displaying 10-bit video on a 6 or 8-bit display device. Simple truncation or rounding to nearest integer produces contouring artifacts in the areas of the still video with slow spatially varying brightness or color. In order to avoid contouring artifacts, the least significant truncated bits are used to generate a dither signal. The dither signal is a single bit signal, which is added to the least significant bit of the image after truncation. By proper selection of the dithering signal, many contouring artifacts can be eliminated. Different dithering techniques exist to create dither signals. Most important techniques are evaluated with respect to the quality of the result and cost of implementation.
There are two main prior art approaches to dithering. One approach to dither generation is by use of an error diffusion algorithm. A binary threshold (equal to the half of the maximum signal amplitude) is applied to the input signal 105. The error from the threshold operation is added to the neighboring pixels so that it does not accumulate. Hence, the average dithering signal value approaches the amplitude of the input signal 105. The binary dither pattern exhibits random structure. The error can be diffused spatially, by adding four spatially neighboring weighted error terms to the input pixel prior to apply the threshold. This approach can be simplified by using two error terms. Prior art error diffusion dithering is traditionally applied spatially, such that the dithering algorithm does not change from one frame to another. In this case, although the contouring artifacts are greatly reduced, the dithering pattern is static and can be perceptually annoying.
Another known approach is to construct a binary dither signal using predetermined fixed size binary patterns. A unique dither pattern exists for each discreet input signal 105 amplitude. The average signal value in a dither pattern corresponds to the signal amplitude that this pattern represents.
Several prior art methods have been proposed to improve the visual appearance of the dither patterns by applying temporal perturbations to the dither pattern itself. One such proposal is to use pseudo-random spatial-temporal dither. A 4 by 4 by 4 dither matrix is constructed such that the mean value along the horizontal, vertical and temporal axes is always zero. This zero mean dither signal is added to input signal 105 prior to truncation. Another proposal is spatial dithering with pixel adaptive spatial dither patterns and deterministic temporal perturbations. This approach also uses predetermined dither patterns. In order to dither a two bit signal, a 2 by 2 dither matrix is proposed with the number of ones equal to the input 2-bit magnitude. The 2 by 2 matrix changes for odd and even frames. Although applying these temporal patterns reduces contouring artifacts and the visual static pattern to some extent, a greater level of reduction at a lower computational cost would be desirable.
Furthermore, dithering is typically performed at a display level, to truncate video output according to the limitations of specific display hardware. For example, where a 10 bit single is being dithered for output on an 8 bit display, no provision is made for display of that signal on hardware with a limitation greater than 8 bits. It would be further desirable to condition a signal for transmission to any output device independent of output resolution, such that the signal can be displayed at the native resolution of the device, or at a simulated higher resolution if the device supports such display.
A temporal dithering manager uses temporal dithering to reduce contouring artifacts due to bit limiting. The temporal dithering manager truncates low order bits of an input signal, creates a temporal dither signal based on the truncated low order bits and applies the temporally created dither signal to the truncated signal. In some embodiments, a temporal filtering manager applies a temporal filter to the truncated signal, thereby improving the quality of the truncated signal. In some embodiments, creating the temporal dither signal comprises applying a binary threshold to the input signal. In other embodiments, deterministic dither patterns are used to create the dither signal. In some embodiments in which a temporal filter is applied to the truncated signal, an infinite impulse response filter is used. In other embodiments, a finite impulse response filter is applied. In some embodiments, the temporal dithering is applied at a preprocessing stage, and the temporal filtering at a post-processing stage.
The features and advantages described in this summary and the following detailed description are not all-inclusive, and particularly, many additional features and advantages will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims hereof. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter, resort to the claims being necessary to determine such inventive subject matter.
The figures depict embodiments of the present invention for purposes of illustration only. One skilled in the art will readily recognize from the following discussion that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the invention described herein.
In the embodiments illustrated in
The temporal dithering manager 101 can apply random threshold perturbations (not illustrated) to the error 107 to further reduce any visible correlation in a dither pattern therein. An important advantage of this method over the traditional error diffusion methods is that the dithering pattern changes with each frame 113, because temporal error 107 is used. The dithering pattern is not static and hence, perceptual quality of the dithered result is superior compared to any spatial error diffusion technique.
Another important advantage is that the method breaks dependency between the pixels within the scan line, and hence can be efficiently implemented for a single instruction stream, multiple data stream (SIMD) processor. Since horizontally neighboring pixels are processed independently, they can be processed in parallel. The memory cost of applying this method is one frame buffer memory, which is utilized to keep the temporal error terms. This additional memory cost overhead (although it can be quite significant for an embedded consumer device) is not significant for a modern computer system.
For example, in an embodiment on which this methodology is instantiated to execute on Altivec® (Motorola's PowerPC SIMD extension), the computational cost is 12 vector instructions per a vector of 16 elements:
Consider the case of 3 bit truncation, in which the magnitude of the truncated component of the pixel is in the range from 0 to 7.
The number of ones in a sub-table 303 is equal to the value that this sub-table 303 is assigned to dither. The sub-table 303 for input zero has no elements equal to one. The sub-table 303 for input seven has seven elements equal to one. The dither sub-table 303 can be addressed by the 3 bit value of the truncated component. The dither entry in turn can be selected by uniform pseudo-random variable in the range 0 to 7. Alternatively the entries in the sub-tables 303 can be perturbed temporally in a pseudo random order. In that case the sub-tables 303 can be accessed sequentially, which simplifies the table addressing.
In one embodiments, in order to reduce spatial correlations horizontally and vertically, neighboring pixels access the dithering look up table 301 using different temporal phases. The phase vector 305 provides the initial phase (offset for the look up table 301 starting address) for the pixels within one horizontal line. The collection of phase vectors 305 provides different initial phases for the pixels within the neighboring lines. The horizontal and vertical phase values are pseudo random numbers. The length of the horizontal phase vector 305 determines the period of the pseudo random horizontal phase in horizontal direction. The number of the horizontal phase vectors 305 determines the period of the pseudo random phase in vertical direction. If the initial signal is highly correlated as in the case of large areas of constant color, the length of the phase vector 305 and the number of phase vectors 305 will determine the amount of randomness that would be added by the dithering process spatially.
In embodiments in which the methodology is not hardwired but implemented with an instruction set, programmable options such has the following are available design parameters:
Some advantages of this method, compared to other methods of dithering with fixed patterns or random noise, include:
The cost of the dither look up table 301 is negligible compared to the size of the video frame buffer. The Altivec® computational cost of the dithering operation is 7 vector instructions per vector of 16 pixel elements, assuming availability of a vector look-up:
As illustrated in
The temporal filtering manager 501 can apply the IIR filter in the case of error diffusion or temporal dither. Typically, an IIR filter uses only one frame delay. The temporal filtering manager 501 adjusts the IIR filter coefficient, to make it adaptive to the level of noise and motion. If the noise variance (Sv) is small or the motion (Mv) at the filtered pixel is high, then the temporal filtering manager 501 makes the coefficient K large and the filter is weak. If the noise variance is high and the motion is undetectable, then the temporal filtering manager 501 makes the coefficient K small and the filter is strong.
The temporal filtering manager 501 can apply the known Kalman equations to provide a motion adaptive filter. For example, the temporal filtering manager 501 can compute motion activity for every frame by computing square of the difference of the 2×2 pixel means of the current and previous frames. Such a small block size achieves higher precision of motion detection. Of course, in other embodiments, the temporal filtering manager 501 can use a different block size as desired.
Two specific formulas for IIR filters are illustrated in Table 1. Of course, variations on the formulas illustrated in Table 1 can be used as desired. The application mechanics of such variations will be readily apparent to those of ordinary skill in the relevant art in light of this specification.
In some embodiments of the present invention, the temporal filtering manager 501 uses a FIR filter in conjunction with temporal dither. In some embodiments, the support of the FIR averaging filter is equal to the period of the temporal dither. For example, 2-bit dither requires 4 frames buffer queue. Although this type of filter fully recovers the original dynamic range, the cost of this filter is higher than of the IIR filter due to larger frame queue size.
A specific formula for FIR filters is illustrated in Table 2. Of course, variations on this formula can be used as desired. The application mechanics of such variations will be readily apparent to those of ordinary skill in the relevant art in light of this specification.
Some embodiments of the present invention comprise two stages: the pixel dynamic range reduction stage that utilizes temporal dither, and the pixel dynamic range expansion stage that utilizes a temporal filter 407. In some embodiments, a novel temporal dithering methodology is applied with or without the filtering stage as desired.
Some embodiments of the present invention are instantiated in a high end computer based professional video editing system. Digital video production workflow can include capture, post-production, archival, distribution, and presentation. Modern high end video cameras can capture digital video in 10 or 12 bit per component resolution using high throughput channels such as 4×Infiniband over fiber optic, Dual HD-SDI over copper cable (SMPTE 372M) or HD-SDI over copper cable (SMPTE 292M). In some instances, for production or distribution purposes, it is desirable to reduce the component dynamic range to 8 bits per component. The temporal dithering stage of the present invention can be used to perform bit limiting with minimum perceptual quality degradation.
High quality digital cinema presentation requires 10 bits per component for contrast ratio 1000:1, 11 bits per component for contrast ration 2000:1, and 12 bits per component for contrast ration 4000:1. The filtering stage of the present invention can be utilized to expand the dynamic range and, in some cases, achieve the video quality identical to the quality produced by the capturing device.
As will be understood by those familiar with the art, the invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Likewise, the particular naming and division of the modules, features, attributes, methodologies, managers and other aspects are not mandatory or significant, and the mechanisms that implement the invention or its features may have different names, divisions and/or formats. Furthermore, as will be apparent to one of ordinary skill in the relevant art, the modules, features, attributes, methodologies, managers and other aspects of the invention can be implemented as software, hardware, firmware or any combination of the three. Of course, wherever a component of the present invention is implemented as software, the component can be implemented as a standalone program, as part of a larger program, as a plurality of separate programs, as a statically or dynamically linked library, as a kernel loadable module, as a device driver, and/or in every and any other way known now or in the future to those of skill in the art of computer programming. Additionally, the present invention is in no way limited to implementation in any specific programming language, or for any specific operating system or environment. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4730185 | Springer et al. | Mar 1988 | A |
4901265 | Kerr et al. | Feb 1990 | A |
5600731 | Sezan et al. | Feb 1997 | A |
6040876 | Pettitt et al. | Mar 2000 | A |
6101001 | Tresser et al. | Aug 2000 | A |
6476824 | Suzuki et al. | Nov 2002 | B1 |
6868108 | Clark | Mar 2005 | B1 |
6894664 | Thebault et al. | May 2005 | B2 |
20020001416 | Zhou et al. | Jan 2002 | A1 |
20030142878 | Willis et al. | Jul 2003 | A1 |
20050152614 | Daly et al. | Jul 2005 | A1 |