The present invention relates generally to video processing, and more particularly to video scaling in video processing.
In TV systems, video scaling is often required when the native resolution of an incoming video frame does not fit the display resolution. Without loss of generality, assume the scaling ratio is L/M and the greatest common divisor gcd(L,M)=1. A conventional scaling system 100 as shown in
In the video scaling system of
In order to prevent aliasing, the sequence v(k) should be filtered prior to down-sampling with a low-pass filter that has a cutoff frequency π/M . The cascade of two low-pass filters with cutoff frequencies π/L and π/M is equivalent to a single low-pass interpolation filter HL,M with a cutoff frequency min(π/L,π/M). Therefore, the frequency characteristics of the interpolation filter HL,M depend on the values of L and M.
Because the interpolation filter HL,M is a low-pass filter, the scaled video lacks in high frequency components, whereby the scaled video is often blurred and not as sharp as the original input video sequence.
In one embodiment, the present invention provides a video scaling process and system wherein the high frequency components of the input video sequence are compensated for prior to video scaling. The video scaling system comprises a high frequency component extractor, a noise detector and a shoot suppressor. The high frequency component extractor extracts the high frequency compensation component from an input video sequence. The noise detector adjusts the gain of the compensation to avoid the enhancement of the noise component. The shoot suppressor further adjusts the gain of the compensation to avoid shoot artifacts. The adjusted high frequency compensated video is added back to the input video. The pre-compensated video sequence is then passed through a video scaler to obtain the scaled video. As such, the sharpness or details of the scaled video is maintained or even enhanced.
Other embodiments, features and advantages of the present invention will be apparent from the following specification taken in conjunction with the following drawings.
FIGS. 7(a)-(d) show four examples of luminance pattern where shoot artifacts may occur at the boundary between flat area and increasing or decreasing area during the pre-compensation of the high frequency component.
In one embodiment, the present invention provides a video scaling process and system wherein the high frequency components of the input video sequence are compensated for prior to video scaling. An example video scaling system according to the present invention includes a pre-compensator for compensation of the high frequency components of the input video sequence, and a video scaler.
The pre-compensator comprises a high frequency component extractor, a noise detector and a shoot suppressor. The high frequency component extractor extracts the high frequency compensation component from an input video sequence. The noise detector adjusts the gain of the compensation to avoid the enhancement of the noise component. The shoot suppressor further adjusts the gain of the compensation to avoid shoot artifacts. The adjusted high frequency compensated video is added back to the input video. The pre-compensated video sequence is then passed through a video scaler to obtain the scaled video. As such, the sharpness of the scaled video is maintained or even enhanced.
In the pre-compensator 202, a pre-compensation gain g0 is multiplied by the gain adjustment parameter g1(k) at a multiplier 306 to generate the product (g0·g1(k)). The product (g0·g1(k)) is further multiplied by the suppression factor g2(k) at a multiplier 308 to generate the product (g0·g1(k)·g2(k)). Then, the product (g0·g1(k)·g2(k)) is multiplied by the high frequency compensation component d(k) at the multiplier 310 to generate the product (g0·g1(k)·g2(k)·d(k)). Then, the product (g0·g1(k)·g2(k)·d(k)) is added to the input signal x(k) at the adder 312 to generate the pre-compensated signal x′(k) as:
x′(k)=x(k)+g0·g1(k)·g2(k)·d(k).
In order to obtain the high frequency compensation component d(k) above, the input signal x(k) is first passed through a high-pass filter in the high frequency component extractor 300 to obtain a high frequency component α(k). For example, a high pass filter [−1,2,−1] can be used to extract α(k). Other high pass filters can also be used.
If t1<|α(k)|≦t2, the signal α(k) is bypassed since the compensation will not be significant in small high frequency area. If t2<|α(k)|≦t3, then the amplitude of α(k) is enlarged to obtain a significant compensation, i.e. β(k)=sign(α(k))·(t2+√{square root over ((|α(k)|−t2)(t3−t2))}), where sign(.) denotes the sign function. If |α(k)>t3, then the signal α(k) is bypassed to avoid the overcompensation. The thresholds t1, t2 and t3 satisfy 0≦t1≦t2≦t3, which can be either manually preset or dynamically calculated.
An example of dynamically calculating the thresholds t1, t2 and t3 is now described. A signal p(k) is calculated as p(k)=|α(k)−
Once the signal β(k) is obtained, the high frequency compensation component d(k) thus can be calculated as:
d(k)=β(k)−α(k).
Referring back to
In a two dimensional video frame, the local standard deviation σ(k) is often calculated based on a rectangular neighboring window centered at the current pixel. Other methods can also be used to calculate the local standard deviation. The gain adjustment parameter g1(k) is a monotonically increasing function of the local standard deviation.
The thresholds τ1 and τ2 can be set to constant values or dynamically adjusted based on noise estimation value. When the noise estimation value is high and the video sequence is considered noisy, then τ1 and τ2 should also be set to relatively large values. When the noise estimation value is low and the video sequence is considered clean, then τ1 and τ2 could be set to relatively small values so that the fine details in the video frame can be better pre-compensated. The relation between noise detection thresholds τ1, τ2 and the noise estimation value σe can be expressed as:
τ1=c1*σe,
τ2=c2*σe,
where c1 and c2 are two pre-defined values satisfying c2≧c1≧0. The noise estimation value σe can be obtained by the method described in commonly assigned patent application Ser. No. 10/991,265, titled “Methods to estimate noise variance from a video sequence”, filed on Nov. 17, 2004, which is incorporated herein by reference. The inventors have further noted that the pre-compensation in horizontal and vertical directions can share the same noise detector to save the computational cost.
In the pre-compensation of the high frequency components, shoot artifacts usually occur around edge areas. More specifically, shoot artifacts usually occur around a sharp turning point of pixel luminance that is transitioning from a relatively smooth area. FIGS. 7(a)-(d) show four example luminance patterns 702, 704, 706 and 708, respectively, where shoot artifacts may occur during the pre-compensation of the high frequency component. In each pattern, eight pixels 700 (•) are shown for illustration purposes. The number of pixels 700 actually involved can vary depending on the number of filter taps of the high pass filter in high frequency component extractor 300 (
Based on the above analysis, the shoot suppressor 302 (
The goal of the symmetry checking is to detect the patterns shown in FIGS. 7(a)-(d). Within the filtering range, if the pixel luminance curve is close to any pattern in FIGS. 7(a)-(d), then the pre-compensation at that position should be suppressed. Let N be the value such that (2*N+1) is the length of the high pass filter in the high frequency component extractor 300. In order to check the symmetry of pixel luminance curve with reference to the position of x(k) and calculate a symmetric factor s(k), the two values Ml and Mr are first calculated as follows:
Ml=max(d0,−N,d0,−N+1, . . . ,d0,−l),
Mr=max(dN,0,dN−1,0, . . . ,d1,0),
where di,j represents the absolute difference between x(k+i) and x(k+j) as
di,j=|x(k+i)−x(k+j)|
The value Ml is the maximum absolute difference between x(k) and any pixel on its left side within the filtering range. Likewise, the value Mr is the maximum absolute difference between x(k) and any pixel on its right side within the filtering range. If both values Ml and Mr are equal to zero, then x(k) is in a flat area. In this case, the symmetry factor s(k) is set to 1 indicating no suppression is necessary because the high frequency compensation component d(k) would be zero. If one and only one of Ml and Mr is equal to zero, then the pixel luminance pattern is close to one of those shown in FIGS. 7(a)-(d). Therefore, it is very likely for shoot artifacts to appear at such position. In this case, the symmetry factor s(k) is set to 0 to fully suppress the gain of the pre-compensation. If neither of Ml and Mr is equal to zero, then two more values, Al and Ar, are calculated as:
where Al is the average of the absolute difference values on the left side of x(k), and Ar is the average of the absolute difference values on the right side of x(k). The symmetry factor s(k) can then be calculated as:
Similarly, a more strict condition can also be used to calculate the symmetry factor s(k) as:
where ml is the minimum of the absolute difference values on the left side of x(k), and mr is the minimum of the absolute difference values on the right side of x(k), wherein:
ml=min(d0,−N,d0,−N+1, . . . d0,−l)
mr=min(dN,0,dN−1,0, . . . d1,0).
In intensity checking, an intensity factor r(k) is computed as a monotonically increasing function of the absolute value of the high frequency component α(k).
With both the symmetry factor s(k) and the intensity factor r(k) obtained, the suppression factor g2(k) can be calculated as:
g2(k)=1−(1−s(k))*r(k).
When r(k)=1, the high frequency component α(k) is strong, wherein g2(k)=s(k). Therefore, shoot suppression is performed solely based on the symmetry factor s(k). When r(k)=0, the high pass filter output α(k) is considered very weak and the suppression factor g2(k) takes a value of 1, which means that no suppression is applied.
The pre-compensation of the high frequency component in a video frame can also be implemented in a pre-compensation parallel structure 900 as shown in
First, the system 900 extracts the high frequency component in the horizontal direction (using exactor 902) and in the vertical direction (using exactor 906). The gain of each component (i.e., horizontal and vertical high frequency components) is then adjusted by the corresponding shoot suppressor in the either horizontal direction (using suppressor 904) or the vertical direction (using suppressor 908). Specifically, for the horizontal direction, the suppression factor g2h(k) output from the suppressor 904 is multiplied by gain gh, and the product (gh·g2h(k)) is further multiplied by the compensation component dh(k) output from the extractor 902 to generate the product (gh·dh(k)·g2h(k)).
For the vertical direction, the suppression factor g2v(k) output from the suppressor 908 is multiplied by gain gv, and the product (gv·g2v(k)) is further multiplied by the compensation component dv(k) output from the extractor 906 to generate the product (gv·dv(k)·g2v(k)). The products (gh·dh(k)·g2h(k)) and (gv·dv(k)·g2v, (k)) are added and further adjusted by the gain adjustment parameter g1(k) from the noise detector 910 to obtain a compensation component [g1(k)·(gh·dh(k)·g2h(k))+(gv·dv(k)·g2v(k))]. The obtained compensation component is then added to the original video frame x(i,j) to obtain a pre-compensated video frame x′(i,j) as:
x′(i,j)=[g1(k)·(gv·dv(k)·g2v(k))+(gv·dv(k)·g2v(k))]+x(i,j).
The pre-compensated video frame x′(i,j) can be fed into a traditional video scaler or any other video scaler to obtain the scaled video, as shown in
The present invention has been described in considerable detail with reference to certain preferred versions thereof; however, other versions are possible. Therefore, the spirit and scope of the appended claims should not be limited to the description of the preferred versions contained herein.