Abstract:
A personal computer having a timing decoder and a graphics overlay card is programmed to interpret a script written in accordance with a predetermined grammar or format. A pair of tape decks, one for playback and one for record, are connected to the graphics overlay card. The script is stored in the computer and read or interpreted by the computer, which generates control signals to operate the graphics overlay card. The tape decks are run without pausing and the editing operation takes only as long as a normal copy. There is no operator intervention.

Description:
COPYRIGHT AUTHORIZATION 
     A portion of this patent document contains unpublished material which is subject to copyright. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all rights to copy or reproduce the copyrighted material in any form. 
     BACKGROUND OF THE INVENTION 
     This invention relates to video signal processing and, in particular, to a method for editing a video signal in real time by means of a computer following a script. 
     In conventional practice, several steps are necessary in order to produce inexpensive but high-quality subtitles for foreign films on video tape. First, a copy of the film is transferred to professional video tape, producing a master or source tape of the film, typically including time codes stored between frames or on a separate track. Next, a &#34;window burn&#34; is made, i.e. the master is copied onto consumer-grade tape such as VHS tape, to which is added an on-screen display of the time codes. The dialog of the film is translated and combined with the timing information from the VHS tape to produce a script in the second language. In the script, each piece of text includes two times, &#34;on&#34; and &#34;off&#34;, based upon the displayed time codes. 
     The completed script and the master are sent to a video studio. A video studio typically has at least the following equipment: two professional video tape decks (one player and one recorder), signal conditioning equipment (e.g. a time-base corrector), a character generator (such as a &#34;Chryon&#34;), an edit controller, and a switching circuit for controlling the flow of video signals among the other equipment. 
     One additional piece of equipment is also necessary, the destination tape, i.e. the tape for receiving the edited video signal. In order to move the source and destination tapes in synchronism, the destination tape must include time codes. Since a blank tape has no time codes, the blank tape must be &#34;pre-blacked,&#34; i.e. black frames, and the corresponding time codes, are recorded the entire length of the tape. Pre-blacked tapes are significantly more expensive than blank tapes. 
     To produce a subtitled version of a film, the person editing the tape first copies a section from the source tape onto the destination tape. The decks are paused at the first &#34;on&#34; time and the editor manually types text into a character generator or similar device. The text is overlaid on the original video and the decks are re-started and permitted to run until the &#34;off&#34; time is reached, when the decks are paused again. The editor either types in new text or clears the character generator and passes the next segment through unmodified. For each hour of film, there can be anywhere from two hundred to nine hundred passages of text and hundreds or even thousands of edit operations. Each hour film can take between four and twenty hours to subtitle, depending on the complexity of the film and the experience of the editor. 
     After the subtitled version is finished, it is difficult to modify. If one word is misspelled, an &#34;insert edit&#34; can be performed, duplicating the original editing operations and replacing the appropriate portion of video. Larger changes are proportionally more difficult. A blanket change in the color of the text, or alterations in the font size or font style require the entire editing process to be redone from scratch, requiring another four to twenty hours of work. 
     There are variations of the procedure outlined above. For example, the translation can be produced without timing information, relying on the editor to provide the subtitles at the appropriate times. One technique for doing this stores the text in multiple pages of a character generator. A normal copy is begun and the editor scrutinizes the film. At appropriate moments, the editor presses a key or foot pedal, signaling the character generator to swap in the next page of dialog. Although this is less expensive than line-by-line editing, the timing is often of poor quality. As before, a modification requires either an insert edit or a complete re-cut and a blanket change requires a complete re-cut. 
     With all of these techniques, the large number of edits needed for the subtitled version creates problems for older editing equipment. A pause in the copying process may introduce an error in the synchronization signals and may allow equipment settings to drift. Although many techniques exist to prevent this (as disclosed in U.S. Pat. Nos. 4,329,719, 4,394,694, and 4,507,691, for example), a brief loss of synchronization, video &#34;glitches&#34;, and abrupt changes in color, brightness or video quality can occur. 
     While the techniques described permit one to add subtitles, the complexities of editing make it extremely difficult to edit single frames of a film, e.g. to add moving graphic or animation to a scene. Each frame may take minutes or hours to compose and coordinating the added graphic with the existing footage is both difficult and error prone. 
     In view of the foregoing, it is therefore an object of the invention to provide apparatus for editing video recordings in real time with precise control of timing. 
     Another object of the invention is to provide inexpensive apparatus for editing single frames of video. 
     A further object of the invention is to provide an editing system in which a computer controls video processing equipment in accordance with a script. 
     Another object of the invention is to provide a system for adding subtitles to films more quickly, less expensively, and with higher quality than has been available in the prior art. 
     A further object of the invention is to provide an editing system which can use blank destination tape. 
     SUMMARY OF THE INVENTION 
     The foregoing objects are achieved by the invention in which a personal computer having a video time decoder and a graphics overlay card is programmed to interpret a script written in accordance with a predetermined grammar or format. A pair of tape decks, one for playback and one for record, are connected to the graphics card. The script is stored in the computer and read or interpreted by the computer, which generates control signals to operate the graphics card. 
     A timed script is produced as in the prior art, except that the script must follow a strict format, making the script machine readable. The script is a text document which can be produced and modified by any commercially available word processor. Because the script follows a prescribed format, the script is also a high level program which can be read and understood by a computer. 
     Within the computer, a time decoder reads the time codes produced by the playback deck from the tape. The graphics card includes its own memory which can be divided into two or more image buffers under software control. In a preferred embodiment of the invention two image buffers are used. One image buffer is selected and the image in the selected buffer is combined with or overlaid on the incoming video signal. The modified signal is then sent to the record deck. Initially, a completely transparent image is stored in one of the image buffers and that buffer is selected for the beginning of the editing process. 
     The software reads the script for the first subtitle or overlay. Associated &#34;on&#34; and &#34;off&#34; times are also read from the script and are stored in a buffer in the main memory of the computer for comparison with the time codes in the script. The text of the first subtitle is stored in the second (unselected) image buffer and the software waits until the time code from the time decoder matches the stored &#34;on&#34; time. When the &#34;on&#34; time arrives, the second image buffer is selected, combining the subtitle with the incoming video to produce a modified video which is passed to the recording deck. The first (unselected) image buffer is cleared and the second subtitle, or a blank screen, is stored in preparation for the next &#34;on&#34; and &#34;off&#34; instructions. The process continues until the editing is completed. 
     The editing takes place in real time; that is, the playback deck plays without pausing and the recording deck records without pausing. There is no back-and-forth editing, no required pre-roll, and no pre-blacking. The editing is done at maximum speed, requiring minimum studio time. Swapping image buffers does not alter the synchronization information, nor does it alter the signal quality, color values, or brightness levels. There is also significantly less stress on the tapes and less wear on both the tapes and the recorders. Consumer grade tape decks can be used instead of professional decks. Since no advanced start-and-stop operation is required, a consumer grade tape deck is a perfectly adequate signal source, as long as the deck can produce a time code signal (e.g. from on one of the two stereo tracks on a hi-fi stereo deck). Low-quality &#34;check tapes&#34; can be produced outside of a studio at nominal cost and used for style tests, proof-of-concept, client approval, pre-release promotion, or dozens of other uses. Unlike conventional techniques, major changes can be made with a simple (one line) change to the script. Letter color and size can be changed, a new font design can be selected, and text positions can be adjusted. A complete re-cut is done at the speed and cost of a simple copy. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     A more complete understanding of the invention can be obtained by considering the following detailed description in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a block diagram of a conventional editing system; 
     FIG. 2 is a block diagram of an editing system constructed in accordance with the invention; 
     FIG. 3 is a block diagram showing the hardware and software components of a computer used in an editing system constructed in accordance with the invention; 
     FIG. 4 is a flowchart of the main loop in the software; and 
     FIG. 5 is a sample script including a list of edit events written in a format readable by the software. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     FIG. 1 is a block diagram of an editing system of the prior art. A master tape is placed in playback deck 11 and the destination or dubbed tape is placed in recording deck 12. The video output from deck 11 is connected to an input of patch panel 13. Patch panel 13 is found in a typical video studio and is simply a panel with a large number of connectors to facilitate wiring together different pieces of equipment. Panel 13 can be omitted. The output from panel 13 is connected to switcher 14, where the video signal is merged with the output from character generator 15. The output from switcher 14 is connected through panel 13 to the video input of recording deck 12. Controller 19 is connected to the control ports of decks 11 and 12 for simultaneous operation of the two decks. 
     In order to record one section of unaltered video followed by one section of subtitled video, the editor causes controller 19 to pause the tapes while the output from character generator 15 is cleared. The tapes are run a predetermined length of time, as set by the time codes in the script, and the tapes are paused again while the subtitle text is entered into character generator 15. The tapes are run until the end of the period determined by the time code and then paused again. The process is tedious and prone to errors. 
     FIG. 2 illustrates an editing system constructed in accordance with the invention. Decks 11 and 12 are connected through panel 13 to graphics card in computer 21. Deck 11 is also connected to a time decoder in computer 21. A controller is unnecessary since the editing takes place in real time, i.e. the decks are not paused during editing. 
     Computer 21 receives two inputs from patch panel 13, a video signal on line 22 and an SMPTE (Society of Motion Picture and Television Engineers) time code on line 23. The SMPTE time code is usually recorded in both the video and audio portions of a video tape. Professional tape decks include three or more sound tracks, including stereo left, stereo right, and an auxiliary track. Time codes stored in the auxiliary sound track are known as longitudinal time codes and time codes stored between frames in the video signal are known as VITC (Vertical Interval Time Code). The longitudinal time codes are more easily retrieved than VITC but are not available if the tape is paused. Most editing equipment relies on VITC since it is available even when a tape is paused. If VITC codes are used, only the video signal is sent to computer 21 and audio line 23 can be omitted. Although not shown in FIG. 2, the soundtrack from the tape is played on deck 11 and recorded by deck 12. 
     FIG. 3 illustrates the hardware and software portions of computer 21 used in the editing process. In one embodiment of the invention, computer 21 is a &#34;386-based&#34; personal computer, i.e. a computer having an Intel 80386 microprocessor. In addition to the typical configuration of such computers, computer 21 includes cards 31 and 33. Card 31 decodes the longitudinal time code and formats it for the computer. Card 33 is a graphics card. 
     There are computer cards commercially available for performing both time code input and graphics overlay on NTSC (National Television Standards Committee) video. In a preferred embodiment of the invention, a MusicQuest &#34;MQX-16S&#34; sound card was used for card 31 and a TrueVision &#34;Targa+ 64&#34; NTSC video card was used for card 33. These cards are readily available and C-language option libraries are also available for operating both cards. Both cards are capable of a large number of functions which are not used in the invention. The MQX-16S is primarily a MIDI-control card and the time code reader is usually considered a minor feature. The Targa+ 64 is capable of operating in dozens of other modes, e.g. performing real-time color re-mapping through the use of hardware look-up tables. 
     Card 33 includes first image buffer 41, second image buffer 42, and buffer selector 43. Image buffers 41 and 42 store one screen&#39;s worth of data which can be overlaid on the video signal on input line 45 to selector 43. Video output line 47 can be connected to a recorder and/or to a video display. Either image buffer can be selected, i.e. placed &#34;on-line.&#34; The on-line buffer is referred to as the &#34;front page&#34; and the off-line buffer is referred to as the &#34;back page.&#34; Either image buffer can be the front page or the back page. Since changing the contents of the front page will produce distortions in a displayed image, all changes are made to the back page. 
     A page is cleared, i.e. made transparent, by storing a particular value in all memory locations, e.g. 00 (zero). This function is performed by the &#34;clear --  page&#34; subroutine. A transparent page permits the input signal to pass through selector 43 unmodified. Other values indicate an opaque pixel. 
     The text for the subtitles is stored at an assigned location (buffer) in the main memory of the computer and is transferred one character at a time to the back page by the &#34;rendering&#34; module. Each character is stored in the back page as an array of pixels, i.e. a graphic. Pages are swapped between frames under the control of the &#34;swap --  page&#34; subroutine. 
     It is assumed that the software begins execution before the decks are started, or during a pre-roll before recording begins. At initialization, the front page is cleared. The first &#34;on&#34;, &#34;off&#34; and &#34;next off&#34; times are stored in three buffers in main memory. The times are initially all set to zero and the rendering buffer (the back page) is set to &#34;transparent&#34; by the initializing routine. Once the tape begins rolling, a time code is read from the tape. This time code has a value greater than zero, typically about fifty-seven minutes. Most professional tapes begin the regular program at the one hour mark, reserving the time before one hour for color bars, slate, and other studio requirements. 
     As the tape plays in deck 11, computer 21 monitors the time code signals and responds in real-time. The video signal from line 45 is constantly combined with the contents of either image buffer 41 or image buffer 42. Depending on the data in the front page, the video signal can pass through unaltered, be completely overwritten, or, as in the case of subtitles, be partially overwritten. Simultaneously, the main program loop reads the script, monitors the time code and renders new images onto the back page. FIG. 4 is a flow chart of the main program loop. 
     The main program loop is best understood by also considering the script shown in FIG. 5. FIG. 5 is a sample script listing a series of edit events as a series of lines in which the first line of each event is a timing code preceded by an &#34;@&#34; symbol. All lines beginning with an &#34;@&#34; are time codes, listing the &#34;on&#34; time first, a comma, and the &#34;off&#34; time. The time codes are listed as hour:minute:second:frame, a notation common in video. In the first edit event, the second and third lines (a title) come on at one hour even and go off at one hour and five seconds. Lines not beginning with an &#34;@&#34; or other key symbol are considered text. All lines end with a carriage return symbol. 
     In the prescribed format, there are one or more lines of rendering instructions following the time codes. In the edit events shown in FIG. 5, the rendering instructions are simply one or more lines of text, which appear on the screen verbatim. The particular format is a matter of choice, what matters is that there is a prescribed consistency which enables the computer to interpret the script. 
     The main program loop reads the first line of the script, &#34;@1:00:00:00,1:00:05:00&#34;. This line is a time code beginning with &#34;@&#34;, so program control passes to the right side of the flowchart in FIG. 4. The back page is cleared (set to transparent) and, since the &#34;off&#34; time has already arrived, the pages are immediately swapped (this has no visible effect on the output video). Rendering is now done on a new back page. Since the back page was initialized to &#34;transparent&#34;, no action is taken and the back page remains clear. Since the &#34;on&#34; time (set to zero during initialization) has already arrived, the pages are immediately swapped, again with no effect. The &#34;next off&#34; time, also set to zero during initialization, is stored in the &#34;off&#34; variable. Control has passed to the bottom box on the flowchart, initialization has finished and the first line can now be processed. The right side of the main loop takes less than a second on a moderately powerful personal computer (such as a 386-based machine). 
     In the bottom box on the flowchart (read &#34;on&#34; and next &#34;off&#34; time for graphic), the input time codes are finally processed. The string, &#34;@1:00:00:00,1:00:05:00&#34; is parsed and the value for &#34;one hour even&#34; is stored in the &#34;on&#34; time variable. The value for &#34;one hour, five seconds&#34; is stored in the &#34;next off&#34; variable. All time values are actually stored as seconds in floating-point format. This allows the system to convert easily between different frame formats, such as 30-frame drop, 30-frame non-drop, 25-frame and 24-frame, all of which are used in the entertainment and broadcast industries. 
     Control returns to the top of the flowchart and the next line is read from the script, &#34;THE HONEYMOONERS&#34;. Since this line is not a time code (no &#34;@&#34;), it is prepared for rendering by being placed into a temporary buffer (not image buffers 41 or 42). Reading the text in a short loop and storing the text in a temporary buffer make the rendering job more efficient. Control returns to the top of the loop and the line &#34;AT HOME&#34; is read. Again, this line is not a time code, so it is added to the temporary buffer. Finally, when control returns to the top, another time code line is read, &#34;@1:00:15:13,1:00:14:22&#34;. 
     Since this line contains an &#34;@&#34; symbol, control passes to the right side of the flowchart. The back page is cleared and the &#34;off&#34; time (last set to zero) has passed, so the pages are immediately swapped. Finally, the rendering module comes into effect. It must render the two lines &#34;THE HONEYMOONERS&#34; and &#34;AT HOME&#34; onto the back page. This will leave the majority of the page transparent, but will place rendered images of the letters onto the bottom portion of the page. The design of the graphics card is such that the page is loaded from the bottom up. 
     Once the rendering is completed, the system enters a tight loop, waiting for the &#34;on&#34; time to arrive (one hour even). The waiting subroutine will actually return part way through the video field immediately preceding that time and control passes to the &#34;swap --  pages&#34; subroutine. This subroutine includes the subroutine &#34;VWait&#34; which causes the computer to wait for a vertical retrace before swapping image buffers, ensuring that there is a clean transition without signal jumps. &#34;VWait&#34; is a subroutine from a library supplied with the graphics card. 
     The next video field, which is the first to display the overlay text, has the time code of one hour exactly. The &#34;next off&#34; variable, which holds the value &#34;one hour, five seconds&#34; is moved to the &#34;off&#34; variable and the system now has five seconds of free time. During this time, the system reads and processes the data for the next edit event. The cycle continues indefinitely, until an end-of-file is reached in the script. At that point, the program ends, leaving a clear image buffer on-line. Alternatively, one can pad the script with blank lines at very distant time values and any shutdown glitches will occur long past the end of the tape. 
     A feature of the invention is the machine-readable script. The script can be edited with commonly available word processors, enabling one to check spelling and grammar. Since an edited script is not retyped, one avoids transcription errors and reduces labor costs. Special analysis tools can also be used. For example, in the particular application of subtitling, since the script must specify the exact wording and timing, analysis tools can model the script against predicted audience reading speeds and recommend changes if necessary. The result is subtitling which is far more enjoyable and easier to read than conventionally produced subtitles. 
     For professional writers, a standard &#34;word&#34; is six characters long, including spaces and punctuation. Using this definition, &#34;words-per-minute&#34; is equal to &#34;characters-per-second&#34; times ten. Reading times for a text are estimated by simply counting characters and dividing by a constant. Based upon empirical data, a reading speed of sixteen characters per second plus a &#34;lag time&#34; (the time to realize that the text has changed) of one half second have been found suitable. If the available reading time, the difference between the &#34;on&#34; time and the &#34;off&#34; time, is less than the estimated reading time (number of characters divided by sixteen) plus the lag time, an error is indicated, e.g. the particular text is marked for review by adding a flag character to the edit event. The text is also checked for format errors and inverted time codes (the &#34;off&#34; time coming before the &#34;on&#34; time). 
     The main program loop is specifically optimized for the production of subtitles on a double-buffered system. Significant computer time is spent in processing the script and in rendering images onto the back page. The tasks in the main loop are arranged to take advantage of the time available, e.g. the time it takes to read a subtitle, to provide the maximum amount of time for performing each task. This is why the tasks in the right hand side of the loop seem to begin in the middle, i.e. the &#34;on&#34; and &#34;off&#34; times for the next event are processed at the end of the loop, not at the beginning. Since the loop is arranged this way, default data (zero time codes) are supplied by the initializing routine for the first pass through the loop. 
     The only constraints on subtitle timing are the minimum time that the title must remain on-screen to be read by a human viewer and the presence of two image buffers rather than three. Reading time for a subtitle is at least a few tenths of a second and more typically a few seconds, a great deal of time for a computer. During this time, the computer must perform as much processing as possible. Thus, as soon as a new page has been displayed, the next script lines are read and stored in a temporary buffer. 
     With two image buffers rather than three, the back page must be transparent when the pages are swapped and rendering must wait until the transparent page is swapped in and the former front page is cleared and ready for data. Since a blank page is inserted between each display of text, image buffer 42 only needs to be cleared once and rendering will always be performed in image buffer 41. In theory, the &#34;clear back page&#34; subroutine can be executed as part of the system initialization and not as part of the main loop, thereby saving time in the main loop. The &#34;clear back page&#34; subroutine in the main loop becomes useful when advanced features, such as superimposition or immediately switching to new images, are used, or when more than two image buffers are used. If a system were to be used only for simple subtitling, the &#34;clear back page&#34; function could be moved out of the main loop. 
     As described so far, the system is capable of performing fairly simple subtitling. Although this example does not use them, additional functions are available on the graphics card, such as fade-on, fade-off, scrolling, and panning. These functions are accessed through a code letter following the &#34;@&#34; symbol. For example, &#34;@&#34; tells the card to scroll the text/image. The parsing routine checks for a letter or a number following the key symbol and modifies the operation of the card accordingly. 
     Thus, a system constructed in accordance with the invention has a number of hardware and software options which can be used in a large number of combinations, depending on the particular task or customer need. Implementing a particular combination of options is within the capability of those of skill in the art, who would be aware, for example, that some of these options may affect (lengthen) the rendering process, such as font type, size, style, outline, drop shadow, color and height of the line. More powerful, time sensitive options include the ability to load small or full-screen graphic elements from disk or memory and to control them in the same way that text is controlled, e.g. fading images. 
     Some other capabilities of the graphics card are &#34;chroma keying,&#34; &#34;color keying,&#34; and &#34;alpha channel.&#34; Chroma keying (blue screen) is used less of late, color keying being preferred. In color keying, the card is programmed to render a certain color as transparent. Alpha channel refers to the high order bit(s) for a character. As indicated in the Appendix, the card is operated in the 16-bit mode. Of these bits, the highest order bit is used to indicate transparency. The other bits are treated in three groups of five for specifying a red, green, and blue intensities for this pixel. In 32-bit mode, the highest eight bits are the alpha channel and indicate degrees of transparency. 
     While described in terms of a subtitling station, the apparatus and software described can be used for many other applications provided that video length is not altered, only overlay or replacement edits are performed, the new edit can be specified in a computer-readable form, the new edit can be loaded or rendered into an image buffer, and the loading or rendering operation can be performed in the time available. 
     With additional image buffers, and more complex software, a system constructed in accordance with the invention can produce a small animation element over existing video, such as an animated character in a live-action scene. This requires that the rendering system draw the animated character in no more than 83 milliseconds. 
     The system can be used, as part of a complete animation system, to add a &#34;layer&#34; of animation (a software analog to the acetate cell in a conventional animation stand). A complex show is laid down one layer at a time, with each layering pass lasting several minutes. This is in contrast to conventional animation which produces a finished image by putting all layers together at once, for a segment that is a fraction of a second long. 
     The Appendix is a C-language source code listing for a subtitling system capable of interpreting the script shown in FIG. 5. The Appendix refers to but does not include the libraries that come with or are available for the time decoder card and the graphics card. The Appendix refers to but does not include the binary tables for converting a character into an array of pixels. These tables are not human readable and the generation of such tables is well known in itself. ##SPC1##