Genlock frequency generator
TECHNICAL FIELD OF THE INVENTION 
     The present invention relates to multi-media presentation systems, particularly where video images from two different sources are merged into a single presentation on a single video display monitor. 
     BACKGROUND OF THE INVENTION 
     In modern multi-media presentation systems, it is often desirable to merge images from two distinct video sources in a manner such that they overlay one another on the same display screen. Numerous special-effects generators have been designed to accomplish such merging, and provide capabilities such as: split-screen viewing, fades, wipes, and numerous &#34;transparent window&#34; types of effects where a &#34;hole&#34; in one image is created through which a second image may be viewed. Generally, before it is possible to merge two video images in this manner, it is necessary either to provide a display memory where two asynchronous video signals may be merged or to synchronize one video image to another. 
     If video image merging is to be accomplished without the use of video memory, then the latter technique of synchronization or &#34;locking&#34; of a dependent, or controllable, video source to an independent, or reference, video source is required. This technique is commonly referred to as &#34;genlock&#34;, or generator locking, whereby the video signal generator of a dependent source is synchronized or &#34;locked&#34; to an independent video source by decoding and analyzing the timing of the independent source. 
     Generally, a video signal comprises three components: a signal or signals representing intensity and color, a signal for providing horizontal synchronization, and a signal for providing vertical synchronization. Often, all of the signals are combined into a single composite signal which is referred to as a composite video signal. Many standards have been proposed for the interchange of video information. Some such standards are the NTSC (National Television Standards Committee) specification for broadcast television, which is the present standard for television signal encoding in the United States; the European PAL (Phase Alternate Line) television standard; and the EIA (Electronic Industries Association) RS-170 specification for monochrome composite video. In addition, many specifications for computer generated video have emerged as de facto standards in the personal computer industry Several examples of these are found in the MDA (Monochrome Display Adapter), CGA (Color Graphics Array), and VGA (Video Graphics Array) video display adapters for the PC, PC/XT, and PC/AT personal computers by IBM corporation. 
     In a computer environment, the object of genlock usually is to synchronize a computer display to a video source, such as a videodisc or VCR, for the purpose of using the video source as background information over which the computer generated data (text and/or graphics) are overlaid. 
     Genlock is usually implemented through the use of phase-locked loop techniques, widely known in the present art, to synthesize a clock by phase-locking the horizontal sync pulse of a dependent video source (usually a computer display controller) to the horizontal sync pulse of an independent video source. The independent video source could be live video, pre-recorded video, or another computer display. 
     FIG. 1 is a diagram of a simple genlock system 100 for horizontal synchronization (HSYNC) comprising a phase-locked loop 11 comparator 112, loop filter 114 and voltage controlled oscillator (VCO) 114), and an external graphics controller 150 to lock one horizontal sync pulse 130 to another 120 while simultaneously generating a higher frequency clock signal 140 which is a multiple of the dependent horizontal sync frequency. Typically, this higher frequency clock signal 140 would be used as a master clock to the external graphics controller 150. The VCO 116 would operate at a multiple of the Dependent HSYNC frequency 130 based on an internal divide ratio in the external graphics controller 150. In this manner the horizontal scan rate of the graphics controller 150 is matched to that of the incoming independent video signal 120, whatever its source, and is synchronized such that the horizontal scans of each video source start at the same time. Evidently, stability of the phase locked loop would affect the stability of the dependent video image relative to the independent video image. That is, if there is any significant jitter in the phase-locked loop, there would be a corresponding visible jitter in the dependent video&#39;s image when overlaid on the independent video. 
     Among the shortcomings associated with present genlock systems is that there must be an incoming (independent) video signal for the dependent source to lock onto. If such an incoming signal is not present, then a typical genlock system would drift to some frequency which may not be compatible with the dependent graphics controller or with the display system. In fact, in some cases it is possible to do damage to a display monitor if such a situation should occur. It would therefore be highly desirable to provide an automatic mechanism whereby the absence of a video source or the absence of a coherent input signal will cause the genlock apparatus to generate some pre-specified default frequencies, and such is disclosed herein. 
     Another difficulty in genlock systems is the synchronization of the vertical components of the video signals. With the horizontal components synchronized, the images will be stable with respect to one another, but the vertical position of the dependent video source would likely be shifted with respect to the independent video image. 
     Vertical synchronization (VSYNC) is usually accomplished by generating an interrupt (signal) to the source of the dependent video (typically a computer system with a graphic controller) at the time of the independent source&#39;s vertical synchronization signal so that the it may reset the dependent source&#39;s vertical position at that time. It is desirable to provide a mechanism of establishing vertical synchronization without excessive external processor intervention, and such is disclosed herein. 
     The most straightforward method of accomplishing frame synchronization is to run the output of a VSYNC comparator into a hardware-based reset of a graphic controller&#39;s vertical line counter, such as a Texas Instrument 34010. Since not all controllers have this capability, the present invention overcomes this limitation by interrupting the host system, which is applicable to a broader range of designs. 
     Further, it is often advantageous to cause a graphics controller to generate an image (dependent video) which does not cover the entire independent video image. This is difficult using most present genlock systems, and requires a great deal of programming of the graphics controller registers and a non-trivial amount of external logic to accomplish the required masking. Even after this is done, the computer generated data (text and/or graphics) must typically be written to a position other than top left (the most convenient place for a display to start). It is desirable to provide a mechanism to shift the top-left of the dependent source&#39;s starting position with respect to that of the independent source, and to control the overall size of the dependent video image within the independent video image, and such is disclosed herein. 
     DISCLOSURE OF THE INVENTION 
     It is therefore an object of the present invention to provide a technique for synchronizing a dependent or controlled video source to an independent or reference video source, the process of which is referred to as &#34;genlock&#34; herein, such that the absence of coherent input signals will cause the dependent video synchronization signals to move to some pre-specified default frequencies. 
     It is a further object of the present invention to provide frame synchronization for graphic controllers lacking a vertical line counter. 
     It is a further object of the present invention to accomplish genlock while altering the vertical and horizontal position of the dependent video image relative to the independent video image by altering the phase relationships between the independent and dependent synchronization signals. 
     It is a further object of the present invention to accomplish genlock while providing control over the position and size of the dependent video image relative to the independent video image. 
     According to the invention, genlock is &#34;built&#34; around a phase-locked loop such that a primary control loop locks a dependent HSYNC (horizontal synchronization signal) from a graphics controller (e.g.) to an independent HSYNC from an independent source by varying the frequency of a master clock to the graphics controller based on the phase difference between the two (dependent and independent) HSYNC signals. The master clock frequency to the graphics controller is derived from the phase-locked loop&#39;s voltage-controlled oscillator (VCO). The control sense is such that if the dependent HSYNC lags the independent HSYNC, then the master clock frequency will be increased. 
     Further according to the invention, there is a sync detect function monitoring the two HSYNC signals for coherence. If either or both HSYNC signals fall outside of pre-specified timing limits, then the sync detect function will generate a signal (SYNC LOSS) indicating that appropriate inputs are not present. This signal is used to disconnect the inputs of the phase-locked loop from the two HSYNC input signals, replacing the independent HSYNC signal with the output of the VCO through a programmable divider, and replacing the dependent HSYNC signal with a fixed reference frequency through a programmable digital divider. By switching the inputs to the phase locked loop in this manner, the output frequency of the VCO (and therefore all of the graphics controller&#39;s video timing parameters) is set to a default value when no valid input signals are present. 
     Further according to the invention, a VSYNC (vertical synchronization signal) comparator independently monitors the relationship between the independent VSYNC and the dependent VSYNC. 
     If any dependent HSYNC pulses occur between similar edges of the two VSYNC signals, then the system is considered to be out of vertical synchronization, and a vertical reset signal will be generated. This VSYNC comparator forms the basis of an external control loop for locking the dependent video signal into vertical synchronization with the independent video signal. 
     Further according to the invention, two digital delay lines are provided, one preferably in series with the independent HSYNC signal and one preferably in series with the independent VSYNC signal. These delay lines are independently programmable for delay time. (The delay lines could possibly be located on the dependent HSYNC and VSYNC lines, and some benefit may be derived thereby, but by placing the delays on the independent horizontal and vertical syn lines the dependent video field is kept within the independent video field.) The effect of these delay lines is to delay the horizontal and vertical synchronization points as perceived by the phase-locked loop and the VSYNC comparator, thus causing the dependent HSYNC and dependent VSYNC to become locked in a non-coincident phase relationship with the independent signals. By doing this, it is possible to cause the (dependent) graphics controller to place the top left of its generated video image at a point other than the top left of the independent video image. The greater the vertical delay value, the farther down the dependent image is moved. In like manner, the greater the horizontal delay value, the farther to the right the dependent image is moved. 
     Further according to the invention, two counters are provided: a programmable vertical line counter (VERT. COUNT) and a programmable horizontal position counter (HORIZ. COUNT). The vertical line counter is started coincident with the dependent VSYNC signal and counts dependent HSYNCs until some pre-specified terminal count condition is reached. The horizontal position counter is started coincident with the dependent HSYNC signal and counts at a rate related to the frequency of the phase-locked loop&#39;s VCO until some pre-specified terminal count condition is reached. A field switch signal is generated based upon the state of these two counters. For each horizontal scan line where the vertical counter is &#34;active&#34;, that is, for each scan line after the dependent VSYNC but before the vertical counter&#39;s scan line count is exhausted, the field switch signal will be set to an &#34;active&#34; state during the time while the horizontal counter is counting. The effect of this is to create a rectangular region within the independent image indicated by the field switch signal. This field switch signal may then be used to switch a video multiplexer between the independent and dependent video signals, creating an overlay effect. As described herein, the &#34;active&#34; state of the field switch signal would ordinarily be used to control the dependent video source&#39;s overlay within the independent video image. 
     Further according to the invention, a transparency signal is used to override a portion of the field switch signal&#39;s active state, forcing it to an &#34;inactive&#34; state. This signal may be used by external timing or chroma key circuits to further define &#34;inactive&#34; areas in the dependent video image through which the independent video or other synchronous video source may be viewed. This feature may be used to overlay closely cropped graphics or text into the independent video background. 
     Other objects, features and advantages of the invention will become apparent in light of the following description thereof. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a simplified block diagram of a prior art phase-locked loop based genlock system by which a dependent horizontal synchronization signal may be locked to an independent horizontal synchronization signal. 
     FIG. 2 is a block diagram of the genlock frequency generator of the present invention. 
     FIG. 3a is a diagrammatic view of a video monitor showing the display relationship between an independent video image and a dependent video image which has been synchronized and shifted relative thereto by the genlock frequency generator of FIG. 2. 
     FIG. 3b is a timing diagram showing the relationship between dependent and independent synchronization signals corresponding to the display example of FIG. 3a. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 1 is a simplified block diagram of a genlock apparatus of the prior art, and has been discussed. 
     FIG. 2 is a block diagram of a genlock frequency generator 200 of the present invention comprising a &#34;primary&#34; horizontal synchronization control loop, a &#34;secondary&#34; vertical synchronization control circuit, and a field switch control circuit. 
     The horizontal synchronization control loop is based on a phase-locked, frequency synthesis loop comprising digital dividers 202, 208 and 230; digital delay 204; synchronization detector 206; multiplexers 212 and 214; phase comparator 218; loop filter 220; lock detector 234; and VCO 226. (The presence of a digital divider in the frequency feedback path of the phase-locked loop has the effect of &#34;synthesizing&#34; frequencies other than those at the phase comparator input by causing the VCO to oscillate at higher frequency than would otherwise be required to maintain lock. Hence the terminology &#34;frequency synthesis&#34;.) Because of the widespread use and understanding of phase-locked loops in the present art, the details of its capture mechanism and design criteria will not be discussed herein. 
     An independent HSYNC signal 240 and a dependent HSYNC signal 245 are the &#34;normal&#34; (non-default) inputs to the phase-locked frequency synthesis loop, and the generated output is a synthesized (or dependent) clock signal 270. The phase-locked frequency synthesis loop locks the dependent HSYNC signal 245 into a fixed-phase relationship with the independent HSYNC signal 240 via an externally controllable video source (not shown, compare graphics controller 150 of FIG. 1), the timing of which is controlled by the synthesized clock 270. The phase difference between the two HSYNC signals is controlled by a programmable digital delay 204 in the path of the independent HSYNC signal. 
     The HSYNC signals are provided to the phase comparator 218 through a pair of multiplexers 212 and 214. These multiplexers are both controlled by the output of a synchronization detector 206, and are connected such that if &#34;valid&#34; synchronization signals are present, then the inputs to phase comparator 218 are taken from dependent HSYNC signal 245 and the output of HSYNC delay 204. If valid synchronization signals are not present, then the inputs to phase comparator 218 are taken from the outputs of the VCO divider 202 and the reference divider 208. Divider 202 is connected at its input to the a reference clock signal 250. The divider 208 is connected at its input to the VCO output. The two dividers 202 and 208 are programmable and determine the frequency at which VCO 226 will oscillate when valid synchronization signals are not present. This &#34;default&#34; frequency is given by: 
     
         VCO frequency=(reference frequency)*(divider 202 ratio)/(divider 208 ratio) 
    
     For example, if divider 202 is set to divide by 3 and divider 208 is set to divide by 4, then if the reference clock 250 frequency is 50 Mhz, the VCO frequency will default to: 
     
         50 MHz * 3 / 4 =37.5 MHz 
    
     This default condition will occur if either or both HSYNC signals fall outside of preset timing parameters as determined by synchronization detector 206. 
     Sync detector 206 monitors the presence and rate of both incoming HSYNC signals 240 and 245. If either HSYNC source is missing, then it is desirable to switch the frequency source to some default value before the missing HSYNC signal causes the VCO to wander to one extreme or another. The criterion for determining that an HSYNC signal is missing is that a counter 206a times out between two successive occurrences of a particular HSYNC signal. This counter is loaded with a selected maximum value and is started counting down upon the recognition of a leading edge of either HSYNC signal (240 or 245) at a rate determined by synthesized clock 270. The counter counts down until successive leading edges are seen on both HSYNC signals. If the count reaches zero, then an output signal (SYNC LOSS) is generated indicating that valid synchronization signals are not present. 
     In a similar manner, the independent HSYNC signal 240 may be monitored for noisy or unexpectedly fast operation. To this end, another counter 206b in the sync detector 206 is loaded (programmed) with a selected minimum count value when the leading edge of the independent HSYNC signal 240 is detected. The counter decrements at a rate determined by synthesized clock 270 until it receives the next positive edge of the independent HSYNC signal 240. If the count has not reached zero by this time, then an output signal is generated indicating that valid synchronization signals are not present. 
     In any case where the sync detector 206 issues a default signal (sync loss) to the multiplexers 212 and 214, the divided VCO output and reference clock are provided in the loop in place of the independent and dependent HSYNC signals. 
     A lock detector 234 monitors the phase-lock condition during frequency transitions, e.g., when synchronizing to a newly applied independent video source (Independent HSYNC) or when moving to the default condition due to loss of synchronization. An error signal (output) of the phase comparator is provided via a filter 234a to a voltage comparator 234b. The voltage comparator is designed with a hysteresis feedback loop (positive feedback around the comparator) to allow small deviations in the output before generating a lock failure indication (LOCK FAIL). The lock failure indication may be monitored (by an external system, not shown) to indicate transition to a new frequency so that external display activity may be paused while the genlock system is settling. Return of the lock failure indication to its normal non-failure state indicates that the genlock process is complete and display activities may resume. Monitoring the output of sync detector 206 (SYNC LOSS) will indicate whether the new stable state is due to a valid video input or to loss of synchronization and implementation of the default mode of operation. 
     The secondary, vertical synchronization circuit includes a programmable digital delay circuit 210 and a VSYNC comparator 216. The VSYNC comparator forms the basis of an externally-closed phase-locked loop. Independent VSYNC signal 255 (from an external video source, not shown) is connected to the input of the digital delay circuit 210, the output of which is connected to one input of the VSYNC comparator 216. Dependent VSYNC signal 26 is connected directly to the other input of VSYNC comparator 216. The two inputs are monitored by VSYNC comparator 216, and if a leading edge of dependent HSYNC signal 245 is detected in between the leading edges of the output of digital delay 210 and dependent VSYNC signal 260, then an output signal 280 (Vertical Reset) is generated indicating that the genlock system is out of vertical synchronization. Typically, this signal would be used as an interrupt signal to an external processor system (not shown) controlling the dependent video source, which would then reset the vertical line controls therein, effectively placing the genlock system into vertical synchronization. It should be noted that the VSYNC comparator 216 will only generate the vertical reset signal 280 if the genlock system is out of vertical synchronization. This signal will not be generated after vertical synchronization has been established. 
     Because the output of the digital delay circuit 210, rather than the independent VSYNC signal 255 itself, is monitored by the VSYNC comparator 216, a fixed vertical offset is created for the dependent video source relative to the independent video source, as determined by the delay value programmed into the digital delay circuit 210. In like manner, the delay circuit 204 in the independent HSYNC line creates a fixed horizontal offset of the dependent video source. 
     It should be noted that the delay circuits 204 and 210 could be placed in the dependent HSYNC and VSYNC lines. Further, the reference clock could be associated with the independent HSYNC rather than with the dependent HSYNC, and the divided VCO output could be associated with the dependent rather than independent HSYNC. 
     The genlock system&#39;s field switch control includes a horizontal position counter 222, a vertical line counter 224, field switch logic 228 and a digital delay line 232, and produces a field switch control output 275. Such a signal (Field Switch Control) is required when switching between a background field (usually provided by the independent video source) and the overlaid video (usually provided by the dependent video source). The conditions for field switching are provided by the independent HSYNC signal 240, the independent VSYNC signal 255, the outputs of the horizontal position counter 222 and vertical line counter 224, and the state of a transparency input 265. The effect of the field switch control signal 275 is to create a rectangular area (320, see FIG. 3a) within the independent video image (310, see FIG. 3a) which is defined on the left edge by the dependent HSYNC signal 245, on the right edge by the count value in the horizontal position counter 222, on the top by the dependent VSYNC signal 260, and on the bottom by the value in vertical line counter 224. The vertical line counter 224 is loaded with its count value and is set active upon detection of the leading edge of the dependent VSYNC signal 260, and counts down at a rate of one count per dependent HSYNC leading edge (245) until it reaches zero, at which point it is set inactive. On each horizontal scan line where the vertical line counter 224 is active, horizontal position counter 222 is loaded with its count value and is set active when the leading edge of the dependent HSYNC signal 245 is detected. Horizontal position counter 222 then counts down at a rate determined by the synthesized clock 270 (effectively a dependent pixel clock), until it reaches zero, at which time it is set inactive. 
     At any point where both counters (222 and 224) are active at the same time, the field switch 228 changes its output state, providing a signal (390, FIG. 3b) which may be overridden by the transparency input 265 (see 380 FIG. 3b). The transparency input 265 is effective as an override of the field switch output. This may be used by external circuitry to provide close cropping of dependent text and/or graphics or additional blanking. 
     Because of the use of the delay lines 204 and 210 on the independent HSYNC 240 and independent VSYNC 255 lines, the overlaid (dependent) image is guaranteed to reside entirely within the independent image. 
     A field switch delay 232 is provided to accommodate those situations where the active graphics field for the dependent source does is complete prior to resetting of the horizontal counter 222. It can also be used when additional time is required to move data through a color lookup table prior to mixing with the background (independent) field. 
     FIG. 3a shows an example of a resultant display on a video monitor 300, where a rectangular dependent video field 320 is offset and overlaid on an independent video background field 310, and where the transparency control is employed to create a transparent region 330 within the overlaid dependent field 320 within which the independent video background field is presented. A reference line 340 is drawn through the display at a point where corresponding signals are shown in FIG. 3b. 
     FIG. 3b shows five significant sample signals corresponding to those that would occur for the horizontal scan line indicated on FIG. 3a by reference line 340. Making simultaneous reference to FIGS. 3a and 3b, Independent HSYNC signal 350 (240 with respect to FIG. 2) defines the left edge of the independent background field 310. Dependent HSYNC signal 360 (245 with respect to FIG. 2) occurs after a period equal to the HSYNC delay has expired (204 with respect to FIG. 2). Horizontal position count 370 (222 with respect to FIG. 2) starts with the horizontal counter 222, and stops when its count value reaches zero. The period where this counter is &#34;active&#34; defines the left and right edges of the overlaid dependent graphics field 320. Transparency control 380 (265 with respect to FIG. 2) has an active period during the active period of the horizontal position counter and defines the left and right edge of a transparent region 330 within the overlaid dependent graphics field 320 through which the independent background image 310 may be seen. In this case, the transparency control signal 380 is modulated to permit a closely cropped portion (shown as the letter &#34;A&#34;) of the dependent video image to overlay the independent video image within the window. The &#34;net&#34; field switch control output (275, FIG. 2) is shown at 390. 
     Appendix 
     Appended hereto as part of the present disclosure is a document entitled &#34;GENLOCK FREQUENCY GENERATOR&#34;, dated Jun. 27, 1990. ##SPC1##