Certain embodiments of the invention may be found in method and system for efficiently increasing the temporal depth of a 3D comb filter. Exemplary aspects of the invention may comprise detecting motion in at least one of a plurality of video frames, storing the results of the detecting to a buffer and comb filtering at least one future frame using the results stored in the buffer. Detecting the difference may include computing the difference between at least two of the plurality of frames on a pixel by pixel basis and comparing the difference to a threshold. The width and height of the buffer may be the same as the width and height of a video frame and a result may be stored in a location in the buffer corresponding to the location in the video frame where motion may have been detected. The buffer may hold the data representing motion from a plurality of frames. The processing may further include extracting chroma and luma information from a composite video signal by using a frame comb filter.
In a PAL composite video signal, adjacent video lines and adjacent frames may have a 90-degree phase shift, requiring a two line or two frame delay in order to obtain video lines or frames with a 180-degree phase shift.
The comb filter 200 may comprise suitable logic, circuitry and/or code for reception of a video signal 205 from the video source 204 and for separation of the chroma and luma components from the video signal 205. The YC to RGB converter 207 may comprise suitable logic, circuitry and/or code for conversion of the chroma and luma components from the comb filter 200 into red, green and blue components. The red, green and blue components may subsequently be used to drive the display 208.
Referring to the comb filter 200, shown is a frame buffer 201, a motion estimator 202, a quantized motion frame buffer 203, and a processor 206. The frame buffer 201 may comprise suitable logic, circuitry and/or code for conversion of the video signal 205 from the video source 204 into a form suitable for storage in a memory. For example, the frame buffer may sample the video signal 205 via an analog to digital converter. The analog to digital converter may sample at, for example, 4*Fsc, where Fsc may be the chroma subcarrier frequency 3.58 MHz. The frame buffer may use the synchronization portion 108 (
The frame buffer 201 may comprise enough memory to store several frames of the video signal 205. The frame buffer 201 may use the synchronization portion 108 of the video signal to determine where in memory to store the frame currently being sampled. For example, a first frame of video may be sampled and stored in an area of the frame buffer corresponding to a top frame, a second frame of video may be sampled and stored in an area of the frame buffer corresponding to a current frame, and a third frame of video may be sampled and stored in an area of the frame buffer corresponding to a bottom frame. In this regard, the bottom frame may contain the video information that may have been most recently sampled and the top frame may contain the video information that may have been sampled furthest in the past. The data in the frame buffer 201 may be used by the motion estimator 202 and the processor 206.
The motion estimator 202 may comprise suitable logic, circuitry, and/or code for detection of motion within the several frames of video stored in the frame buffer 201 and for storage of a motion estimate in the quantized motion frame buffer 203. In this regard, the motion estimator 202 may detect regions of motion in the video information by comparing the top frame and bottom frame in the frame buffer 202. The motion estimator 202 may then store data, representative of the detection process, to the quantized motion frame buffer (QMFB) 203. For example, if the motion estimator 202 detects motion in a particular region between the top and bottom frame in the frame buffer 201, the motion estimator 202 may store the motion estimates from the detecting step in a region of the QMFB 203, which may be used to determine whether motion occurred in that particular region. Information stored in the QMFB 203 may be used for comb filtering future frames.
The processor 206 may comprise suitable logic, circuitry and/or code for determining which of a plurality of methods to use in separating the chroma and luma components from the video input signal. For example, the processor may determine that there may not be any motion in a particular area of the video signal and may, for example, use a horizontal or a vertical combing procedure described below to separate the chroma and luma components. When motion is not detected, the processor may use, for example, a temporal combing procedure described below instead.
The subcarrier phase 301 of the incoming composite video signal may be 3.58 MHz, and the incoming analog video signal may be digitized at 27 MHz, for example. Since 3.58 MHz and 27 MHz are not multiples of each other, there may not be an exact pixel sample every 3.58 MHz of digitized video signal that may be aligned and in-phase. For example, it may be difficult to compare the peak of a sine wave on the current line 307 with the peak of a sine wave on the next line 309, since a pixel sample may not be obtained at the 27 MHz frequency. The composite video signal, therefore, may be run through a filter that interpolates pixel samples 303 at four times the frequency of the sub-carrier. For example, if the subcarrier frequency is at 3.58 MHz, the pixel samples 303 may be interpolated at 14.32 MHz.
Pixels A, B and C may be true pixels. However, all the remaining pixels to the left and to the right of the true sample pixels A, B and C, such as pixels BL, Br, AL, AL2, AL3, AL4, Ar; Ar2, Ar3, Ar4, CL, and Cr, may be interpolated pixels. In a given line, each pixel may be shifted by a quarter subcarrier cycle from the adjacent pixel. In addition, each line may be 180 degree phase-shifted from its adjacent line. For example, true pixel A and interpolated pixel AL4, to the left of true pixel A in the current line 307, may be in phase with each other, whereas true pixel A and interpolated pixel AL may be quarter cycle phase-shifted from each other. Similarly, interpolated pixel Ar may be a quarter cycle phase-shifted to the right of pixel A, and interpolated pixel Ar4 may be in phase with true pixel A. Since the current line 307 may be 180 degrees phase-shifted from either the previous line 305 or the next line 309, true pixel A may also be phase-shifted 180 degrees from either true pixel B in the previous line 305 or true pixel C in the next line 309.
In an embodiment of the present invention, the amount of frequency content movement may be approximated between pixels within a given pixel line, between pixel lines within the same video frame, and between similar pixel lines in different frames, and the corresponding combing method may be applied with a minimum bandwidth loss. For example, if vertical combing is applied with regard to true pixel A, then true pixel A may be subtracted from true pixel B resulting in two times the luma, or true pixel A may be subtracted from true pixel C to obtain two times the luma, or true pixel A may be subtracted from the average of true pixels B and C to obtain two times the luma. The same process may be performed between true pixel A and interpolated pixel AL2, since they may be out of phase. The phase difference between true pixels A and B may be 180 degrees, which may be the same as between true pixel A and interpolated pixel AL2. In order to determine whether vertical combing may be applied without a significant bandwidth loss, pixels in the current line 307 and the previous line 305 may be compared. For example, interpolated pixel AL in the current line 307 may be compared with interpolated pixel Br in the previous line 305, where interpolated pixel AL may be in phase with interpolated pixel Br since there may be a 360-degree phase difference between them. Similarly, interpolated pixel Ar may be compared with interpolated pixel BL, where interpolated pixel Ar may be in phase with interpolated pixel BL since there may be a 360 degree phase difference between them as well.
If these two comparisons indicate a big difference, this may be indicative of significant vertical frequency content going from true pixel B to true pixel A. If the difference between the interpolated pixels in the two comparisons is small, then this may indicate that there may not be a lot of vertical frequency content. Accordingly, vertical combing may be applied between the current line 307 and the previous line 305 without a significant bandwidth loss. Similarly, comparisons between the interpolated pixels AL and Cr, and Ar and CL may be indicative of whether vertical combing may be applied between the current line 307 and the next line 309, without a significant bandwidth loss. Depending on the composite video signal, there may be no frequency content between true pixel B and true pixel A, which indicates that the current line and the previous line may be identical lines. A large frequency content between true pixel A and true pixel C may indicate that a vertical transition has happened immediately after the current line. Conversely, there may be a lot of frequency content between true pixel B and true pixel A, and no frequency content between true pixel A and true pixel C. This may be characterized by the fact that the current line and the next line are very similar, but the current line and the previous line are different. In this case, vertical combing may be performed between the current line and the next line.
A final comparison may be performed between true pixels A, B and C, in order to determine whether vertical combing may be applied with a minimum bandwidth loss. If true pixels A, B and C are, for example, all in phase with each other, this may be indicative that there may not be a chroma component and that true pixels A, B and C contain only luma components. For example, if true pixels A, B and C contain only luma components, the video signal may comprise a white character or a black background. In this case, since there may be no frequency content between the current line 307, the previous line 305 and the next line 309, and vertical combing may be applied without a significant loss in bandwidth.
With regard to horizontal combing, or notch filtering, true pixel A may be compared with interpolated pixels AL4 and Ar4 in the current line 307, which may be in phase with true pixel A. This may provide an indication of the horizontal frequency content in the current line 307. If true pixel A is very different from either of interpolated pixels AL4 or Ar4, it may indicate that there may be significant frequency content in the current line 307. If, on the other hand, the pixels are very similar, it may indicate that there may be less frequency content and horizontal combing may be applied. In an embodiment of the present invention, a wide band pass filter may be utilized in order to horizontally filter a composite signal and eliminate the luma component that may not be near the chroma subcarrier frequency, for example, a 3.58 MHz subcarrier frequency.
In another aspect of the invention, bidirectional combing may be implemented by taking into consideration temporal signal comparisons between non-adjacent in-phase frames for purposes of applying temporal combing with a minimum temporal bandwidth loss. Referring again to
In another aspect of the invention, bidirectional combing may be implemented by taking into consideration coarse chroma comparisons between the true pixel GA in the previous frame 311 and the true pixel NA in the next frame 312. The difference between the coarse chroma values for true pixels GA and NA may be indicative of the signal bandwidth between the previous frame 310 and the next frame 312 and whether the composite signal may be combed temporally and to what extent. The bandwidth measure between the true pixels GA and NA and the associated temporal combing quality may then be compared with the quality of 2D combing for the composite signal and whether horizontal and/or vertical combing may be applied within the current frame 304, and to what extent.
If either comparison of coarse chroma or coarse luma difference between true pixels GA and NA indicates a large difference, then it may be indicative of a significant temporal frequency content between the previous frame 311 the next frame 312, and temporal combing, therefore, may not be desirable since it may involve temporal bandwidth losses.
In yet another aspect of the invention, 3D combing may also be implemented taking into consideration temporal signal comparison between adjacent frames for purposes of applying temporal combing with a minimum temporal bandwidth loss. Accordingly, pixels in the same line/previous frame 311 may be considered. For example, true pixel GA may be an actual pixel similar to true pixel A, but it may be phase-shifted 180 degrees from pixel A in the previous frame. True pixel GA may be the same pixel as true pixel A in the previous frame 311, interpolated pixel GAL may be one quarter of a 3.58 MHz subcarrier frequency off to the left in the previous frame 311, and interpolated pixel GAR may be one-quarter of a subcarrier cycle off to the right on the same line in the previous frame 311. Since pixels Ar and GAL may be phase-shifted at 360 degrees and may be in phase with each other, they may be compared for temporal frequency content.
Similarly, pixels AL and GAR may also be compared for temporal frequency content. If these two comparisons indicate that the pixels are similar, then this may indicate that pixel A may be very similar to pixel GA and that there may be no temporal frequency content movement from the previous frame. In this case, temporal combing may be performed since there will be no significant temporal bandwidth loss. If, on the other hand, the two comparisons show a large difference, then it may be indicative of a significant temporal frequency content between the current and the previous frame, and temporal combing, therefore, may not be desirable since it may involve temporal bandwidth loss. A comparison between pixel A and pixel GA may be useful in instance where there may be a pixel that bears no color, for example, a black and/or a white pixel. Such pixels may be characterized only by a luma component and, therefore, have no phase difference between each other. In this case, temporal combing may be applied without any resulting temporal bandwidth loss.
In yet another aspect of the invention, 3D combing may also be implemented by taking into consideration previous motion estimates stored in the QMBF 203 (
A 3D bidirectional comb filter in accordance with an embodiment of the present invention may be implemented by first horizontally combing a composite video signal. The horizontal combing may be accomplished by running the composite video signal through a very wide band pass filter, for example, so that it may pre-filter the very low frequency luma component within the composite video signal. In this way, if there is very coarse (VC), slow moving luma changes, such VC luma may be eliminated and not be considered in subsequent vertical and/or temporal combing processes. If a subcarrier frequency of 3.58 MHz is utilized, chroma components may be centered around 3.58 MHz, or approximately between 2 and 5 MHz. In other words, any frequency content below 2 MHz may be considered a luma component and may be filtered out by the band pass filter. By performing the corresponding comparisons between pixels in the current frame 304, the previous frame 310 and/or the next frame 312, as outlined above, it may be determined whether vertical combing and/or temporal combing may be utilized without significant bandwidth loss. For example, horizontal and vertical combing, or 2D combing, may be the only useful combing methods in one embodiment of the present invention. In another embodiment of the present invention, horizontal, vertical and temporal combing, or 3D combing, may be applied without significant bandwidth loss. The temporal combing may be determined utilizing bidirectional combing between the previous frame 310 and the next frame 312. Temporal combing may also be determined by utilizing combing between the current frame 304 and the previous frame 311. A final combing decision as to a specific composite signal may include a blend of 2D and 3D combing. In this case, a certain percentage of a pixel may be only vertically or horizontally combed, and the remaining pixel may be combed vertically and temporally without utilizing any threshold values.
In one aspect of the invention, a different blending decision factor may be determined. A notch filter may be utilized for horizontal combing. In order to obtain a better combing decision, a notch filter may be compared to a vertical comb filter by calculating a ratio of the quality of the vertical comb using the previous line, to the quality of the horizontal comb. A different ratio may be related to the quality of the vertical comb using the next line, to the quality of the horizontal comb.
A notch_next ratio may be determined in a similar way, where notch_next may indicate whether to blend vertically and/or horizontally between a current line and a next line. A final notch ratio may be determined as a function of the notch_prev and notch_next ratios in order to obtain a blending decision factor related to blending vertically versus blending horizontally. For example, a final notch value for each pixel may be determined by the following equation:
notch=notch_next.*k_blend+notch_prev.*(1−k_blend);
Conceptually, if the k_blend combing decision tends towards combing with the top line, the top line may be given more weight in judging the relative goodness of notching. If the k_blend combing decision tends towards combing with the bottom line, the bottom line may be given more weight in judging the relative goodness of notching.
In cases of significantly more luma than chroma at a given point in a composite signal, a notch filter may be gradually disabled. This may be because the notch filter tends to put most of the signal that may be left, after an initial high pass filter, into chroma. If the combed signal is mostly luma, it may be inefficient to allow it to be put into chroma.
Similarly, a dis_notch_next may be determined as a ratio between next_line min and same_pix_max, for example, where next_line_min may be associated with a bandwidth difference between in-phase pixels in a current and next lines. Dis_notch_next and dis_notch_prev, therefore, may be determined by the ratio of the previous or next line luma and chroma compare to the previous or next line luma only compare.
If the amplitude of the band passed video signal is very small relative to the difference to the closest matching adjacent line, then the disable notch parameter may not be an accurate measure. In this case, the disable notch may not be used. A disable vertical notch, dis_vert_notch, parameter may be utilized.
Conceptually, if dis_vert_notch is 0, then it has no effect. Dis_notch may be allowed to mask or not mask notch. If dis_vert_notch is 1, then dis_notch has no effect and dis_notch may be disabled. In this case notch may never be masked, and the decision to notch or vertically comb may be utilized without modification. A weighted disable notch ratio dis_notch may be calculated as:
dis_notch=max(dis_notch, dis—vert_notch)
The calculated notch signal may be cubed and disable notch may be squared. This may cause the roll off due to notch to be accelerated. Then disable notch may be used to calculate a final value for notching. Notch may also be low pass filtered and may be generated according to the following equation:
notch=dis_notcĥ2*notcĥ3
Referring again to
An estimate may be obtained of the quality of the 2D comb. This may be calculated based on the difference between the current pixel and the pixel that the 2D combing logic decided to comb with. First the vertical difference may be calculated according to the ratio of k_blend. Next this may be blended with the horizontal quality according to the ratio of notch. The qualities of the vertical blends, previous and next, may be weighted together to give an overall vertical quality measure. This vertical quality measure may then be weighted together with the horizontal quality, giving an overall quality measure of the 2D comb.
In another aspect of the invention, bidirectional combing may be applied and estimates of low frequency luma may be calculated for a previous frame and a next frame, for example. The two resulting rough values of luma may then be compared on a pixel-by-pixel basis. The same 3D mesh mask as illustrated on
In yet another aspect of the invention, the blended mask 405 may be applied in cases where the two rough luma values may not be very different. A blended mask may indicate, for example, that a certain percentage of the 3D combing, for example 30%, may be “trusted” and the remaining percent, for example the remaining 70%, may be combed via 2D combing. The blended mask may re-adjust the ratio between 3D combing and 2D combing for a given pixel depending on how close the two rough luma values are to being very different and how close they are to being very similar.
To determine the blending of 3D combing versus 2D combing the quality of the 2D comb decision may be compared with the quality of 3D combing. The ratio of these two numbers determines the blend between 2D and 3D combing. Conceptually, mesh may tend towards the smaller of quality_2d (error term of 2D comb) and prev_field_max_filt_3d (error term of 3D comb). The larger prev_field_max_filt_3d may be (or the worse the quality of the 3D comb), the more mesh may tend to 2D comb. The larger quality_2d (or the worse the quality of the 2D comb), the more mesh may tend to 3D comb.
A final blend of 3D combing and 2D combing may be based on the product of the mesh and the mesh mask. The following equation may be utilized:
mesh=mesh*mesh_mask
The data stored in the QMFB may be considered a motion estimate of the motion detected in, for example, the current frame in the frame buffer. This data may then be applied to subsequent frames and may aid in the separation of chroma and luma information from those frames. In this regard, the more motion estimates that may be available, the more accurately future motion may be detected by the comb. This may result in more accurate chroma/luma separation.
At step, 601, the difference between a pixel at index X and Y of the Top frame and index X and Y of the bottom frame may be computed. If the difference is greater than a quantization threshold, then at step 602 the motion estimator 202 may write a one (1) at location (X,Y) in the quantization frame buffer 203 (
At step 604, indices X and Y may be incremented in such a manner that all the pixels in the top frame and bottom frame may be compared. At step 605, it may be determined whether there are more pixels to process. If there are more pixels to process, the next step is step 601. If there are no more pixels to be processed, the process may end.
At step 701, the motion between the top and bottom frames may be detected using the motion estimator 202. For example, the motion estimator 202, via the process described above, may compare the difference between the two frames to a threshold to derive motion estimates for the current frame. The motion estimates may then be stored to the QMFB 203.
Steps 702 and 703 may occur simultaneously. At step 702, a new frame may be received by the frame buffer 201, while at step 703, the motion estimates in the QMFB 203 may be shifted by one frame. At step 704, the current frame may be combed using the top, current, bottom frames as well as the motion estimates stored in the QMFB 203 delayed by one (1) frame. These steps may be illustrated in Table 1. Referring to Table 1, shown are the frames of data applied to the combing process as a function of time. At time t1, frame F2 may be combed by using frames F1, F2, and F3, which may correspond to the top, current and bottom frames respectively, and the motion estimates corresponding to frame F1. At time t2, frame F3 may be combed by using frames F2, F3, and F4, which may correspond to the top, current and bottom frames respectively, and the motion estimates from frame F2. The result of this may be that motion estimates for previous frames may be utilized to separate chroma and luma information in the combing process at step 704. The availability of the motion estimate for the old frames may aid the comb in separating the chroma and luma information.
In operation, the comb filter 200 (
The interpolated pixels generated by the processor 206 for the current frame may be one half cycle phase-shifted from the interpolated pixels in the previous frame and or in the next frame. The interpolated pixels generated by the processor 206 for the previous frame may be in-phase with the interpolated pixels in the next frame. The processor 206 may generate the plurality of interpolated pixels for the current line, so that each of the plurality of interpolated pixels in the current line may be one quarter cycle phase-shifted from a corresponding adjacent pixel in the current line. The processor 206 may be adapted to comb horizontally, if the determined direction of least bandwidth may be among in-phase interpolated pixels in the current line. The processor 206 may comb vertically, if the determined direction of least bandwidth is, for example, among corresponding in-phase interpolated pixels in the current line and at least one of the previous line and the next line.
The processor 206 may comb vertically, if the determined direction of least bandwidth is, for example, among corresponding one-half cycle phase-shifted true pixels in the current line and at least one of the previous line and the next line for a luma-only video signal. If the determined direction of least bandwidth is among corresponding in-phase interpolated pixels in the previous frame and in the next frame, the processor 206 may comb temporally. If the determined direction of least bandwidth is among corresponding in-phase true pixels in the previous frame and in the next frame, the processor 605 may comb temporally. The processor 206 may comb in a horizontal direction and a vertical direction for the current video frame, and may blend the combing in the horizontal direction and the vertical direction and combing in a temporal direction for the current video frame. In this regard, previous motion estimates stored in the QMBF 203 (
Accordingly, the present invention may be realized in hardware, software, or a combination of hardware and software. The present invention may be realized in a centralized fashion in at least one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software may be a general-purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
The present invention may also be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which when loaded in a computer system is able to carry out these methods. Computer program in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or notation; b) reproduction in a different material form.
While the present invention has been described with reference to certain embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the present invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the present invention without departing from its scope. Therefore, it is intended that the present invention not be limited to the particular embodiment disclosed, but that the present invention will include all embodiments failing within the scope of the appended claims.