SYSTEM AND METHOD OF SELECTING AMONG MULTIPLE DATA STREAMS

Abstract: A system and method of selecting and switching among multiple sequential data streams operate without interruption in output. Elements of the data streams are stored in a buffer to cover seek times when switching among data streams, or to cover interleave gaps in embodiments employing interleave techniques. Alternative embodiments employ alternative techniques for loading the buffer.

Description: Description SYSTEM AND METHOD OF SELECTING AMONG MULTIPLE DATA STREAMS Background of the Invention 1. Field of the Invention This invention relates to the processing and outputting of multiple data streams from computer data storage peripherals and, more particu- larly, to a system and method of selecting among multiple data streams in peripherals having greater access times for non-sequential data reads than for sequential data reads. 2. Description of the Related Art In the field of computer data storage peripherals, "access time" is defined as the time it takes for a peripheral to access the storage medium and retrieve an element of data. For many peripherals, including compact disc read-only memory (CD-ROM) drives, the access time of a non-se¬ quential read is greater than that of a sequential read. The difference in access time may occur for a variety of reasons; in a CD-ROM system it is primarily due to the additional time required for the lens to physically move across the surface of the medium in a non-sequential read. This additional time is called "seek time". During the seek time, no data may be read from the storage medium. For example, a typical CD-ROM drive can read a contiguous stream of data (in other words, a series of sequential reads), at a rate of approxi¬ mately 150 kilobytes per second. To perform a non-sequential read, how¬ ever, the drive's lens must stop and seek the location of the new data, which takes approximately 0.5 to 1.0 seconds. In many typical CD-ROM applications, a series of sequential reads is performed, followed by a seek performed in response to end-user inter¬ action. For example, the CD-ROM may contain data representing motion video (with associated sound channels), and at a certain point the user may have an opportunity to select from a number of "streams" of video. In response to the user's selection, the application may have to perform a seek to retrieve the selected stream. Conventionally, no data is trans¬ ferred during this seek, and the video display pauses until the seek is completed. For many applications, such as video games, this interruption in out- put is undesirable, as it interferes with the effective use or enjoyment of the application. Summary of the Invention In accordance with the present invention, there is provided a sys¬ tem and method of selecting and switching among multiple data streams instantaneously and without interruption in the output to the end user. This is accomplished either by reading data stream elements from a buffer to cover a seek, or by using interleave techniques to avoid seek operations altogether. For purposes of illustration, the invention is herein described in terms of video data streams stored on CD-ROMs. Each data stream has a number of contiguous elements, representing individual frames of video data. However, the invention is not limited to any particular type of data or any particular storage medium. It is most useful when practiced on media having longer access times for non-sequential reads than for se- quential reads. One technique for eliminating interruptions according to the pre¬ sent invention involves loading a buffer with a number of elements from one or more data streams prior to performing a seek. When a seek is performed, the application reads elements from the buffer to cover the seek. Once the seek is complete, normal sequential operation resumes. Thus, the user does not see any interruption in the video output. Several variations on this principle are possible. In a preferred em¬ bodiment, the buffer is loaded while sequential reads are taking place. The application reads the data stream faster than it displays it, and uses the extra time to accumulate data in the buffer. In other embodiments, the buffer is pre-loaded before sequential reads begin. Another technique uses interleaving to avoid seek operations alto¬ gether. In this technique, the data storage medium is designed so that images from the alternate data streams are interleaved. The system reads the interleaved elements sequentially, buffering them if required, and out¬ puts only those elements belonging to the selected data stream. These al¬ ternatives and others are described more fully below. In all of these embodiments, the user may select data streams at any time. In some embodiments, the display immediately switches to the se¬ lected data stream; in others, the data stream being displayed at the time the selection is made continues until the buffer contains enough data to cover a seek or an interleave gap. In all embodiments, the output seen by the user continues uninterrupted. Brief Description of the Drawings Figure 1 is a block diagram of apparatus for practicing the present invention. Figure 2 is a flowchart showing a method of selecting among multi¬ ple data streams according to the present invention, in which excess data is accumulated over time to cover seeks. Figures 3a and 3b are timing diagrams illustrating an example of the method shown in Figure 2. Figure 4 is a flowchart showing a method of selecting among multi¬ ple data streams according to the present invention, using redundant low- resolution versions of the data to cover seeks. Figures 5a and 5b are timing diagrams illustrating an example of the method shown in Figure 4. Figure 6 is a flowchart showing a method of selecting among multi¬ ple data streams according to the present invention, in which the buffer is loaded with data from the first data stream in advance of any data output, to cover seeks. Figures 7a and 7b are timing diagrams illustrating an example of the method shown in Figure 6. Figure 8 is a flowchart showing a variation of the method shown in Figure 6, in which the buffer is loaded with data from two data streams, to cover seeks. Figures 9a and 9b are timing diagrams illustrating an example of the method shown in Figure 8. Figure 10 is a flowchart showing a variation of the method shown in Figure 6, in which the buffer is loaded with data from the second data stream to cover seeks. Figures 11a and l ib are timing diagrams illustrating an example of the method shown in Figure 10. Figure 12 is a flowchart showing a method of selecting among multi¬ ple data streams according to the present invention, in which data is stored in an interleaved fashion, and elements from all data streams are read in each time frame. Figures 13a and 13b are timing diagrams illustrating an example of the method shown in Figure 11. Figure 14 is a flowchart showing a method of selecting among multi¬ ple data streams according to the present invention, in which excess data is accumulated over time to cover interleave gaps. Figures 15a and 15b are timing diagrams illustrating an example of the method shown in Figure 14. Description of the Preferred Embodiment Referring now to Figure 1, there is shown a functional block diagram of apparatus for practicing the present invention. In the preferred embodiment, one or more central processing units (CPU) 101 perform the steps of the method, although any type of processor or multiple processors may be used. CPU 101 controls the operation of a data storage device containing the various data streams which are to be read and processed. An example of such a data storage device is CD-ROM drive 102 shown in Figure 1. In response to control signals from CPU 101, data from CD-ROM drive 102 is sent to random-access memory (RAM) 103 via direct memory access (DMA) transfers. CPU 101 controls the operation of a buffer which is contained in RAM 103 and which temporarily stores data stream elements in accordance with the method described below. Video display 104 receives data from RAM 103 via DMA transfers and outputs the data to the user. In the preferred embodiment the data contains both video and audio components, and the video display includes audio output capability. Alternative structures may be used to practice the current invention. For example, if the data represents audio only, an audio output device may be substituted for video display 104. Similarly, alternative data storage devices may be employed in place of CD-ROM drive 102. Other variations are also possible. For purposes of illustration, Figures 2 through 15b show implemen¬ tations involving two data streams, designated A and B. Elements from stream A are output first, and then the user is given an opportunity to ei- ther remain on stream A or select stream B. All of these techniques may be extended to multiple data streams. Figures 2 through l ib show im¬ plementations which use seek operations, and Figures 12 through 15b show implementations which use interleave techniques to avoid seek op¬ erations. Referring now to Figure 2, there is shown a flowchart of a preferred embodiment of the present invention. In this embodiment, the data stream is read from the storage device faster than it is output. A buffer is used to temporarily store elements of the data stream between the time they are read and the time they are output. Since the read rate is faster than the output rate, excess data accumulates in the buffer over time. Once the buffer has accumulated enough data to cover a seek, selection among data streams becomes possible. The point in time at which selec¬ tion is possible is called the selection junction. If the user specifies his or her selection before the selection junction is reached, the system contin¬ ues outputting elements from the first data stream until the junction is reached. Once the junction is reached, if a seek is required to access the selected data stream, elements are drawn from the buffer while the seek takes place. Thus, the output to the user is uninterrupted. In step 201, the process begins. Two paths extend from step 201, one leading to steps 206 through 209 and one leading to step 210. In this and other flowcharts, this designation indicates that the two paths occur simultaneously. In other words, steps 206 through 209 are performed at the same time as step 210 is performed. The two paths may be per¬ formed by a single processor or by two different processors. In steps 206 through 209, the system reads successive elements from the storage device and places each element in the buffer as it is read. Some elements belong to stream A and some elements belong to stream B. Typically, each element has a tag to indicate which stream it belongs to, and the data is arranged on the storage medium so that a set of stream B elements is located immediately after a set of stream A elements. Alter¬ natively, other techniques may be used to identify the stream to which each element belongs. If, while the system is reading elements, the buffer becomes full, this is detected in step 208 and the reading process pauses in step 209, allowing the output to catch up until the buffer is no longer full. After each element is read, the system checks in step 207 to see if the selection junction has been reached. If so, the system immediately proceeds to step 211. If the selection junction has not been reached, the system checks to see if the buffer is full in step 208, pauses in step 209 if necessary, and loops back to step 206. Simultaneously with steps 206 through 209, step 210 is performed. in which the output device starts to output stream A elements from the buffer. This is done at a rate which is slower than the read rate, so that the system is able to accumulate excess data in the buffer before the se¬ lection junction is reached at step 207. Thus, by the time the system reaches step 211, the buffer contains enough elements from stream B to cover a seek. In step 211, the system accepts input from the user specifying the desired stream. The user may supply this input at any time, but in this embodiment, the system does not respond to the selection until the selec- tion junction is reached. In step 212, the system checks the input to see which stream was selected. If stream A is selected, the process continues with steps 213 through 217 running simultaneously with step 218. In step 213, stream B elements are discarded from the buffer, since they are not needed. This may be done before, after, or during steps 214 through 217. In steps 214 through 217, the system reads successive stream A elements and places them in the buffer, until it has finished reading stream A. As before, if the buffer becomes full, the reading process pauses in step 217 to let the out¬ put catch up. While steps 213 through 217 are being performed, the sys- tern outputs successive stream A elements from the buffer in step 218, until stream A is finished. Once stream A is finished, the process ends in step 226. If, in step 212, stream B is selected, the process continues with steps 219 through 224 running simultaneously with step 225. In step 219, stream A elements are discarded from the buffer, since they are not needed. This may be done before, after, or during steps 220 through 224. In step 220, the system performs a seek to access stream B. Once the seek is complete, in steps 221 through 224, the system reads successive stream B elements and places them in the buffer, until it has finished reading stream B. As before, if the buffer becomes full, the reading pro¬ cess pauses in step 224 to let the output catch up. While steps 219 through 224 are being performed, the system outputs successive stream B elements from the buffer in step 225, until stream B is finished. Once stream B is finished, the process ends in step 226. Referring also to Figures 3a and 3b, there are shown timing dia¬ grams illustrating an example of the method of Figure 2. Figure 3a shows the user electing to remain on stream A, and Figure 3b shows the user selecting stream B. Each timing diagram contains five horizontal rows of information. In the top row, a time stream of eight frames, time 1 to time 8, is shown. In the next row, the diagram shows elements being read from the storage device. Each element of the data streams is labeled with a letter and a number, the letter specifying which data stream the element belongs to, and the number specifying the proper time for the element to be output. The third row of each diagram shows elements being output. The fourth row shows the contents of the buffer at each point in time. The last row shows elements being discarded from the buffer. In time frames 1 to 3, the system reads elements Al through A5, placing each element in the buffer. This corresponds to steps 206 through 209. At the same time, elements Al through A3 are output (corresponding to step 210). Then the system reads elements B5 and B6 in frames 3 to 4, since these are positioned on the storage medium im¬ mediately after elements Al to A5 (continuing steps 206 through 209). Meanwhile, frames A3 through A4 are being output (step 210). At the end of frame 4, the selection junction has been reached, and the system is prepared to accept selection input (step 211). At this point, the buffer contains elements A5 and B5, and B6 has been read and is ready to be placed in the buffer. Thus, there is sufficient data in the buffer to cover a seek, should the user select stream B. If the user elects to remain on stream A, the example continues as in Figure 3a. Elements B5 and B6 are discarded from the buffer (step 213) at the beginning of frames 5 and 6 respectively (although this can be done at any time). In frames 5 through 6, the system reads elements A6 through A8 (steps 214 to 217). At the same time, in frames 5 through 8, it outputs elements A5 through A8 from the buffer (step 218). Stream A finishes with element A8 (step 226). If the user selects stream B, the example continues as in Figure 3b. Element A5 is discarded from the buffer (step 219) at the beginning of frame 5 (although this can be done at any time). In frames 5 and 6, the system performs a seek to access stream B (step 220). Since the buffer contains elements B5 and B6, the system is able to cover the seek by out- putting these elements (step 225). Once the seek is completed, in frame 6, the system begins to read stream B elements. The system reads ele- ments B7 and B8 in frames 6 and 7 and places them in the buffer (steps 221 to 224). At the same time, it outputs elements B6 through B8 from the buffer (continuing step 225). Stream B finishes with element B8 (step 226) . The technique of Figures 2, 3a, and 3b may be extended to multiple data streams, multiple selection junctions, or both. The user may make his or her selection at any time, but the system will continue on its cur¬ rent data stream until the next selection junction is reached. Referring now to Figure 4, there is shown a flowchart of another preferred embodiment of the present invention. In this method, the sys¬ tem responds to the user's selection immediately after the selection is made. As in the method of Figure 2, the data stream is read from the storage device faster than it is output, so that excess data accumulates in the buffer. In this technique, however, two versions of each data stream are stored on the storage device: a high-resolution version and a low-reso¬ lution version. Each high-res element of one stream is paired with a low- res element of the other stream. If the user selects a stream requiring a seek before sufficient data has accumulated in the buffer to cover the seek, the system outputs the low-res version of the selected stream, expanded as desired using conventional expansion techniques, until the buffer is full enough for a seek. Once the buffer is ready, the system performs the seek and uses the buffer's contents to cover the seek. This technique allows the system to respond to the user's selection before the buffer is ready for a seek, although the quality of the output during the interim period from the time the selection is made until the completion of the seek may be inferior because it is an expanded low-res version of the data stream. This technique also facilitates outputting low-res versions of the non-selected data stream, e.g., in a smaller, secondary video window, while the high -res version of the selected data stream is being output in the primary video window. In step 401, the process begins. In steps 402 through 407, the sys¬ tem reads successive high-res stream A elements paired with low-res stream B elements, and places each pair in the buffer as it is read. After each pair is read, the system checks in step 403 to see if the user has se¬ lected stream B. If so, the system immediately proceeds to steps 412 through 414. If the user has not selected stream B, the system checks in step 404 to see if stream A is finished; if so the system ends the process in step 405. If stream A is not finished, the system checks to see if the buffer is full in step 406, pauses in step 407 if necessary, and loops back to step 402. Simultaneously with steps 402 through 407, steps 408 through 411 are performed, in which the output device outputs successive high-res versions of stream A elements and, optionally in the secondary display, low-res versions of stream B elements. This is done at a rate which is slower than the read rate, so that the system is able to accumulate excess data in the buffer over time. After each element is output, the system checks in step 409 to see if the user has selected stream B; if so, the sys¬ tem immediately proceeds to steps 412 through 414. If the user has not selected stream B, the system checks in step 410 to see if stream A is finished; if so, the system ends the process in step 411. If stream A is not finished, the system loops back to step 408 to output the next element. If at any time the user selects stream B, the system starts to perform steps 412 and 413 simultaneously with step 414. In step 412, the system reads successive high-res stream A elements and low-res stream B ele¬ ments and places them in the buffer. It continues to do this until the buffer is full enough to cover a seek. When the buffer is full enough, the system proceeds to step 413, where it performs a seek to access high-res stream B elements. While steps 412 and 413 are being performed, the output device in step 414 outputs successive low-res stream B elements which have been expanded from the buffer. Optionally, the device also displays the corresponding high-res stream A elements, reduced if de- sired by conventional reduction techniques, in the secondary display. Thus, the system immediately responds to the user's selection of stream B After the seek is complete, the system proceeds with steps 415 to 418, performed simultaneously with step 419. In steps 415 through 418, the system reads successive high-res stream B elements and low-res stream A elements, placing each pair in the buffer, until it has finished reading stream B. As before, if the buffer becomes full, the reading pro¬ cess pauses in step 418 to let the output catch up. While steps 415 through 418 are being performed, the system outputs successive high-res stream B elements and, optionally, low-res stream A elements in the sec¬ ondary display, from the buffer in step 419, until stream B is finished. Once stream B is finished, the process ends in step 420. Referring also to Figures 5a and 5b, there are shown timing dia¬ grams illustrating an example of the method of Figure 4. Figure 5a shows the user electing to remain on stream A, and Figure 5b shows the user selecting stream B. The timing diagrams show information in a similar manner as Figures 3a and 3b. In Figures 5a and 5b, however, A and B in¬ dicate high-res versions of the data streams, and a and b indicate low-res versions. B' indicates an expanded low-res version, and a' indicates a re¬ duced high-res version. A high-res version from one data stream is always paired with a corresponding low-res version from the other data stream. The secondary video window may or may not be displayed. In Figure 5a, the user elects to remain on stream A. In time frames 1 to 3, the system reads element pairs Abl through Ab5, placing each pair in the buffer. This corresponds to steps 402 through 406. In frame 3, the buffer becomes full, so the reading process pauses to let the output catch up (step 407). At the end of frame 4, the output has caught up, so the sys- tern continues reading element pairs Ab6 through Ab7 in frames 5 and 6. In frame 6, the data stream ends, so the system stops reading elements (step 405). While all this is taking place, in frames 1 through 7, the out¬ put device reads successive element pairs from the buffer, outputting high-res stream A elements and, optionally, low-res stream B elements (steps 408 through 410). When the output device reaches element pair Ab7, it has finished the data stream, and stops outputting (step 411). In Figure 5b, as before, by the end of time frame 1 the system has read element pairs Abl through Ab2 (steps 402 through 406). At the same time, in frame 1, the output device outputs element pair Abl (step 408). Also during frame 1, the user selects stream B. At this point in time, the buffer is not full enough for a seek, so the system continues to read element pairs from the same data stream, namely Ab3 through Ab5, during frames 2 to 3 (step 412). Once the system has read element pair Ab5, in frame 3, the buffer is full enough for a seek, so the system per- forms a seek in frames 3 to 4 (step 413). Meanwhile, during frames 2 through 5, the output device outputs expanded stream B elements paired with reduced stream A elements, indicated as elements a'B'2 through a'B'5 (step 414). Thus, the user starts to see stream B elements immedi¬ ately after he or she has selected stream B. Once the seek is completed, in frames 5 and 6, the system reads el¬ ement pairs aB6 through aB7 (steps 415 through 417). Concurrently, in frames 6 through 7, the output device outputs from the buffer high-res stream B elements and, optionally, low-res stream A elements (step 419). The data stream finishes with element pair aB7, and the process ends (step 420). The technique of Figures 4, 5a, and 5b may be extended to multiple data streams, multiple selection junctions, or both. The user may make his or her selection at any time, and this selection will be reflected im- mediately, using expanded or reduced output if necessary. The user may also switch back and forth between data streams at any time, including during time frames when an expanded element is being output. Referring now to Figure 6, there is shown a flowchart of another preferred embodiment of the present invention. In this method, the read rate need not necessarily be faster than the output rate. Rather than ac¬ cumulating the buffer over time, the buffer is pre-loaded before output begins. This may be done at the beginning of the session, or during a nat¬ ural break in the video display. This technique allows the output device to use the full consecutive-read bandwidth of the storage device. In step 601, the process begins. In step 602, the system reads a number of elements from stream A and places them in the buffer. Then, steps 603 and 604 are performed simultaneously. In step 603, another stream A element is read and placed in the buffer. Meanwhile, in step 604, the output device outputs a stream A element that was previously placed in the buffer. These two operations may be done at the same rate, so that the system is always "ahead" of the display device by a constant number of frames (equal to the number of frames that were pre-loaded in step 602). After steps 603 and 604 are performed, the system checks in step 605 to see if the user has selected stream B. If the user has not selected stream B, and if there are any more stream A elements (step 606), the process loops back to steps 603 and 604. If there are no more stream A elements, the process ends (step 611). If the user selects stream B, the system immediately performs a seek in step 607. The system covers the seek by outputting successive stream A elements from the buffer in step 608 while the seek is in progress. Once the seek is completed, the system proceeds to step 609, where it discards stream A elements from the buffer, as they are no longer needed. Step 609 may be performed before, during, or after step 610. In step 610, the system reads and outputs successive stream B elements until stream B is finished; during this step, the system no longer needs to store elements in the buffer. If desired, however, the system may con¬ tinue to use the buffer in anticipation of future selection among data streams. Once stream B is finished, the process ends in step 611. Referring also to Figures 7a and 7b, there are shown timing dia¬ grams illustrating an example of the method of Figure 6. For illustrative purposes, the read rate is shown to be the same as the output rate. Figure 7a shows the user electing to remain on stream A, and Figure 7b shows the user selecting stream B. The timing diagrams show information in a similar manner as Figures 3a and 3b. In Figure 7a, the user elects to remain on stream A. Prior to time frame 1, the system reads elements Al through A3 and loads them into the buffer (step 602). Then, in each time frame from 1 through 5, the system reads a stream A element and places it in the buffer (step 603), while the output device outputs a previously stored element (step 604). At the end of frame 5, the system has read the last element in the stream, so it stops reading elements. The output device continues outputting ele¬ ments A6 through A8 in frames 6 through 8. When stream A is finished, the process ends (step 611). In Figure 7b, the user selects stream B. As before, prior to time frame 1, the system reads elements Al through A3 and loads them into the buffer (step 602). Then, in each time frame from 1 through 4, the system reads a stream A element and places it in the buffer (step 603), while the output device outputs a previously stored element (step 604). At the end of frame 4, the user selects stream B (step 605). The system im¬ mediately, in frame 5, performs a seek to access stream B (step 607), while the output device outputs successive stream A elements from the buffer in frames 5 and 6 (step 608). In frame 6, the seek is completed, and the system reads and outputs elements B7 and B8 (step 610), discard¬ ing element A7 since it is not needed (step 609). Stream B ends at ele¬ ment B8, and the process stops after that element has been displayed in frame 8 (step 611). As seen in the above description, the user's selection is not immedi¬ ately reflected in the output, since the system continues to display stream A elements until after the seek is complete. The technique of Figures 6, 7a, and 7b may be extended to multiple data streams or multiple selection junctions, or both. One way to imple¬ ment multiple junctions would be to pre-load enough elements in step 602 to cover several seeks. Referring now to Figure 8, there is shown a flowchart of another preferred embodiment of the present invention. As in the method of Fig- ure 6, the buffer is pre-loaded before output begins, and the read rate need not necessarily be faster than the output rate. Thus, again, the out¬ put device may use the full consecutive-read bandwidth of the storage de¬ vice. This method differs from that of Figure 6 in that elements from stream B are placed in the buffer in advance of the selection junction. This allows the user's selection to be reflected instantaneously after it is made, but only if the selection is made at a predetermined selection junc¬ tion. In step 801 the process begins. In step 802, the system reads a number of elements from stream A and places them in the buffer. Then, steps 806 and 807 are performed simultaneously. In step 806, the system reads the next element and places it in the buffer. This element may be a stream A element or a stream B element. Typically, each element has a tag to indicate which stream it belongs to, and the data is arranged on the storage medium so that a set of stream B elements is located immediately after a set of stream A elements. Alternatively, other techniques may be used to identify the stream to which each element belongs. Meanwhile, in step 807, the output device outputs a stream A element that was previ- ously placed in the buffer. These two operations may be done at the same rate, so that the system is always "ahead" of the display device by a con¬ stant number of frames (equal to the number of frames that were pre¬ loaded in step 802). Steps 806 and 807 repeat until the system reaches the selection Junction. In step 809, the system accepts input from the user specifying the desired stream. The user may supply this input at any time, but in this embodiment, the system does not respond to the selection until the selec¬ tion junction is reached. In step 810, the system checks the input to see which stream was selected. If stream A is selected, the process continues with steps 811 through 812. In step 811 the system discards the stream B elements that were placed in the buffer, as they are not needed. This may be done be¬ fore, after, or during step 812. In step 812, the system reads and outputs successive stream A elements until stream A is finished. The system no longer needs to store elements in the buffer, but it may do so if desired in anticipation of future selection among data streams. Once stream A is fin¬ ished, the process ends in step 817. If, in step 810, stream B is selected, the system performs steps 813 and 814, simultaneously with step 815. In step 813 it discards the stream A elements that were placed in the buffer, as they are not needed. This may be done before, after, or during step 814. In step 814, the system performs a seek to access stream B. Meanwhile, in step 815, the system outputs the stream B elements from the buffer to cover the seek. Once the seek is completed, the system proceeds to step 816, where it reads and outputs successive stream B elements until stream B is finished. Again, the system no longer needs the buffer, but it may use it if desired in anticipation of future selection. Once stream B is finished, the process ends in step 817. Referring also to Figures 9a and 9b, there are shown timing dia¬ grams illustrating an example of the method of Figure 8. For illustrative purposes, the read rate is shown to be the same as the output rate. Figure 9a shows the user electing to remain on stream A, and Figure 9b shows the user selecting stream B. The timing diagrams show information in a similar manner as Figures 3a and 3b. In both Figures 9a and 9b, prior to time frame 1, the system reads elements Al through A3 and loads them into the buffer (step 802). Then, in each of time frames 1 and 2, the system reads a stream A element and places it in the buffer (step 806), while the output device outputs a previ¬ ously stored element (step 807). In frames 3 and 4, the system reads ele¬ ments B5 and B6, respectively (step 806), since these are the next two el¬ ements stored on the storage device, while the output device outputs frames A3 and A4 from the buffer (step 807). At the end of frame 4, the system reaches the selection junction, and is prepared to accept selection input (step 809). At this point, the buffer contains elements A5 and B5, and B6 has been read and is ready to be placed in the buffer. Thus, there is sufficient data in the buffer to cover a seek, should the user select stream B. If the user elects to remain on stream A, the example continues as in Figure 9a. The output device outputs element A5 in frame 5 (step 812). Elements B5 and B6 are discarded from the buffer (step 811) at the be¬ ginning of frame 6 (although this can be done at any time). The system reads and outputs elements A6 through A8 in successive frames (step 812), until stream A is finished. If the user selects stream B at the selection junction, the example continues as in Figure 9b. The system discards element A5 from the buffer (step 813) in frame 5 (although this can be done at any time). The system immediately performs a seek, in frame 5, to access stream B (step 814). Meanwhile, the output device outputs elements B5 and B6 from the buffer in frames 5 and 6 to cover the seek (step 815). Once the seek is complete, the system reads and outputs elements B7 and B8 in successive frames (step 816). until stream B is finished. The technique of Figures 8, 9a, and 9b may be extended to multiple data streams, multiple selection junctions, or both. The user may make his or her selection at any time, but the system will continue on its cur¬ rent data stream until the next selection junction is reached. Alterna- tively, the methods of Figures 6 and 8 may be combined so that the system loads stream B elements in the buffer in anticipation of a selection junc¬ tion as in Figure 8, but if the user selects stream B before the required stream B element have been loaded, the system uses the Figure 6 method. Referring now to Figure 10, there is shown a flowchart of another preferred embodiment of the present invention. As in the previous two methods, the buffer is pre-loaded before output begins, and the read rate need not necessarily be faster than the output rate. In this method, how¬ ever, the system pre-loads elements from stream B needed to cover the seek. Once the buffer is pre-loaded, it is not accessed until the selection junction is reached; elements of stream A are read and output without ac¬ cessing the buffer. If the user selects stream B, the system outputs the pre-loaded elements to cover the seek. In step 1001 the process begins. In step 1002, the system reads enough stream B elements to cover a seek (or more than one seek, if de- sired), and places them in the buffer. Then, in steps 1003 and 1004, the system reads and outputs successive stream A elements, without using the buffer, until the selection junction is reached. Once the selection junction is reached, the system, in step 1005, accepts input from the user specifying the desired stream. The user may supply this input at any time, but in this embodiment, the system does not respond to the selection until the selection junction is reached. In step 1006, the system checks the input to see which stream was selected. If the user elects to remain on stream A, the process continues with steps 1007 through 1008. In step 1007, the system discards the stream B elements that were placed in the buffer, as they are not needed. This may be done before, after, or during step 1008. In step 1008, the system reads and outputs successive stream A elements until stream A is finished. Again, the buffer is not needed, but it may be used if desired in anticipa¬ tion of future selection. Once stream A is finished, the process ends in step 1012. If, in step 1006, stream B is selected, the system performs step 1009 simultaneously with step 1010. In step 1009, the system performs a seek to access stream B. Meanwhile, in step 1010, the output device outputs the pre-loaded stream B elements from the buffer to cover the seek. Once the seek is completed, the system proceeds to step 1011, where it reads and outputs successive stream B elements until stream B is finished. Again, the system no longer needs the buffer, but it may use it if desired in anticipation of future selection. Once stream B is finished, the process ends in step 1012. Referring also to Figures 11a and lib, there are shown timing dia¬ grams illustrating an example of the method of Figure 10. For illustrative purposes, the read rate is shown to be the same as the output rate. Figure 11a shows the user electing to remain on stream A, and Figure l ib shows the user selecting stream B. The timing diagrams show information in a similar manner as Figures 3a and 3b. In both Figures 11a and l ib, prior to time frame 1, the system reads elements B5 through B6 and loads them into the buffer (step 1002). Then, the system reads and outputs elements Al through A4 (step 1003), without accessing the buffer. At the end of time frame 4, when the selec¬ tion junction is reached, the system has displayed element A4 and has just read element A5 and is ready to display it. The buffer still contains ele¬ ments B5 and B6, sufficient to cover a seek should the user select stream B If the user elects to remain on stream A, the example continues as in Figure 11a. The output device outputs element A5 in frame 5, and con¬ tinues to read and output successive elements A6 through A8 (step 1008), until stream A is finished. At some point, the system discards elements B5 and B6 from the buffer, as they are not needed (step 1007). If the user selects stream B at the selection junction, the example continues as in Figure l ib. The system immediately performs a seek in frame 5 (step 1009), outputting elements B5 and B6 to cover the seek (step 1010). Once the seek is completed, the system reads and outputs frames B7 and B8 in succession (step 1011), until stream B is finished. The technique of Figures 10, 11a, and l ib may be extended to mul¬ tiple data streams, multiple selection junctions, or both. The user may make his or her selection at any time, but the system will continue on its current data stream until the next selection junction is reached. Alterna- tively, the methods of Figures 6 and 10 may be combined so that the sys¬ tem pre-loads stream B elements for a specific selection junction as in Figure 10, but if the user selects stream B before the junction is reached, the system uses the Figure 6 method. Referring now to Figure 12, there is shown a flowchart of another preferred embodiment of the present invention. This method does not use seek operations. Instead, data is arranged on the storage device in an interleaved fashion, so that elements from all data streams for a given time frame are positioned consecutively. In each time frame, the system reads all of the elements from all of the data streams for that frame, and outputs only the element from the selected data stream. Thus, in the case of two interleaved data streams, elements from each data stream are alternately placed on the storage device, and the system reads an element from stream A and one from stream B in each frame, outputting only the se¬ lected one. This technique allows the user to select either stream at any time, and the system responds immediately. However, this technique limits the bandwidth available for output, as explained below. In step 1201, the process begins. In step 1202, the system reads the first element of all of the data streams. Then the system proceeds to step 1203, simultaneously with steps 1204 and 1205. In step 1203, the system reads the next element of all of the data streams. While it does this, in step 1204 it determines which data stream is currently selected and in step 1205 the output device outputs the element for the selected data stream which was most recently read. As long as there is more data to be read from the storage device, this loop continues. Once the system is finished with the data, the process ends in step 1207. Referring also to Figures 13a and 13b, there are shown timing dia¬ grams illustrating an example of the method of Figure 12. Figure 13a shows the user electing to remain on stream A, and Figure 13b shows the user selecting stream B. In Figure 13a, the user elects to remain on stream A. Prior to frame 1, the system reads elements Al and Bl (step 1202). Then, in each frame from 1 to 5, the system outputs the A element for that frame (step 1205) and simultaneously reads the A and B elements for the next frame (step 1203). In Figure 13b, the user selects stream B. Prior to frame 1, the sys¬ tem reads elements Al and Bl (step 1202). In frames 1 and 2, as before, the system outputs the respective A elements (step 1205) and reads both A and B elements (step 1203). During frame 2, the user selects stream B. In frame 3, the system responds to this selection by outputting element B3 instead of A3 (step 1205). It still reads both A4 and B4. For the re¬ maining frames, system outputs successive B elements while reading A and B elements for the next frame. In the technique of Figures 12, 13a, and 13b, a maximum of N data streams are available for selection at any given time, where N is the inter¬ leave factor of the data storage device. Furthermore, the output device is only able to use 1/N of the consecutive-read bandwidth of the storage de¬ vice (e.g., for the scheme shown in Figures 13a and 13b, only half of the consecutive-read bandwidth is available). The user may select among the data streams at any time, and multiple selections are possible. The system responds to the user's selection immediately after it is made. Referring now to Figure 14, there is shown a method which permits more than 1/N of the consecutive-read bandwidth of the storage device to be used. In this method, as in the method of Figure 2, the data stream is read from the storage device faster than it is output, and a buffer is used so that excess data can accumulate over time. In this method, however, the excess is used to cover interleave gaps (i.e., the periods of time when the system is reading non-selected data stream elements) rather than seek operations. This permits interleaving to be used without limiting the out¬ put bandwidth to 1/N of the consecutive-read bandwidth. However, in this method, the system does not respond to the user's selection until the buffer contains enough elements to cover interleave gaps. In step 1401, the process begins. In steps 1406 through 1409, the system reads successive elements from the storage device and places each element in the buffer as it is read. Some elements belong to stream A and some elements belong to stream B. Typically, each element has a tag to indicate which stream it belongs to, and the data is arranged on the stor¬ age medium so that a set of stream B elements is located immediately af¬ ter a set of stream A elements. Alternatively, other techniques may be used to identify the stream to which each element belongs. If, while the system is reading elements, the buffer becomes full, this is detected in step 1407 and the reading process pauses in step 1408, allowing the out¬ put to catch up until the buffer is no longer full. After each element is read, the system checks in step 1409 to see if the selection junction has been reached. If so, the system immediately proceeds to steps 1411 and 1415. If the selection junction has not been reached, the system loops back to step 1406. Simultaneously with steps 1406 through 1409, step 1410 is per¬ formed, in which the output device starts to output stream A elements from the buffer. This is done at a rate which is slower than the read rate, so that the system is able to accumulate excess data in the buffer before the selection junction is reached at step 1409. Thus, by the time the sys¬ tem reaches steps 1411 and 1415, the buffer contains enough elements from stream B to cover gaps caused by interleave. During execution of steps 1411 though 1418, the user may select ei¬ ther data stream at any time, and may even switch repeatedly between the streams. In steps 1411 through 1414, the system reads successive inter¬ leaved elements from the data storage device. The elements alternate be¬ tween stream A and stream B. If the buffer is full, this is detected in step 1413 and the reading process pauses in step 1414 to let the output catch up. Simultaneously with steps 1411 through 1414, the system performs steps 1415 through 1418. In step 1415, the system determines which data stream has been selected. In step 1416, the output device outputs the next element from that data stream from the buffer. This is done at a rate which is slower than the read rate. The non-selected element for the current frame is discarded in step 1417. This loop continues until the data stream is finished. Then the process ends in step 1419. Referring also to Figures 15a and 15b, there are shown timing dia- grams illustrating an example of the method of Figure 14. Figure 15a shows the user electing to remain on stream A, and Figure 15b shows the user selecting stream B. then returning to stream A. The timing diagrams show information in a similar manner as Figures 3a and 3b. In time frames 1 to 3, the system reads elements Al through A5, placing each element in the buffer. This corresponds to steps 1406 through 1409. At the same time, elements Al through A3 are output (corresponding to step 1410). Then the system reads elements B5 and B6 in frames 3 to 4, since these are positioned on the storage medium immediately after elements Al to A5 (continuing steps 1406 through 1409). Meanwhile, frames A3 through A4 are being output (step 1410). At the end of frame 4, the selection junction has been reached. At this point, the buffer contains elements A5 and B5, and B6 has been read and is ready to be placed in the buffer. Thus, there is sufficient data in the buffer to cover gaps caused by interleaving streams A and B. If the user elects to remain on stream A, the example continues as in Figure 15a. During frames 5 and 6, elements A6, B7, and A7, which are stored on the storage device in an interleaved fashion, are read succes¬ sively (steps 1411 through 1414). Meanwhile, elements A5 and A6 are output (step 1416), and B5 and B6 are discarded since B is the non-se¬ lected data stream (step 1417). At any time during these two frames, se¬ lection of stream B is possible, but here the user elects to remain on stream A. At the end of frame 6, there is no longer sufficient data in the buffer to cover interleave gaps, so selection is no longer possible. Element B7 is discarded, and the process begins again. Frame 7 is analogous to frame 1. Figure 15b shows the user selecting stream B during frame 5. As in Figure 15a, elements A6, B7, and A7 are read during frames 5 and 6, ele- ment A5 is output in frame 5, and element B5 is discarded. Once the user selects frame B, however, the output device begins outputting stream B el¬ ements instead of stream A elements. Thus, in frame 6, element B6 is output (step 1416) and A6 is discarded (step 1417), and in frame 7, ele¬ ment B7 is output and A7 is discarded. During frame 7, the buffer no longer contains enough data to cover interleave gaps, so the system is forced to return to stream A in frame 8, to begin the process again. Again, frame 7 is analogous to frame 1. The technique of Figures 14, 15a, and 15b may be extended to mul¬ tiple data streams, multiple selection junctions, or both. The user may make his or her selection at any time, but the system will continue on its current data stream until the next selection junction is reached. Selec¬ tions made during the period in which there is sufficient data in the buffer to cover interleave gaps (frames 5 through 6 in the example) will be re¬ flected immediately, and the user may switch repeatedly among data paths during this period. From the above description, it will be apparent that the invention disclosed herein provides a novel and advantageous method of selecting among multiple data streams. The foregoing discussion discloses and de¬ scribes merely exemplary methods and embodiments of the present in- vention. As will be understood by those familiar with the art, the invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. For example, different methods of ac¬ cumulating data in the buffer may be used in place of those described in the above description and corresponding diagrams. Also, any of the meth- ods described above can be extended to multiple data streams and multi¬ ple selection junctions. Accordingly, the disclosure of the present inven¬ tion is intended to be illustrative, but not limiting, of the scope of the in¬ vention, which is set forth in the following claims.

Claims: What is claimed is: 1. A method of selecting and switching among a plurality of data streams, each data stream comprising a series of elements, comprising the steps of: (a) storing a first subset of the elements; (b) selecting one of the data streams; and (c) in response to seeking being necessary to access the selected data stream, sequentially outputting the stored first subset of elements while seeking access to the selected data stream. 2. The method of claim 1, wherein the first subset is sufficiently large to cover a period of time at least equal to the time needed to seek access to the selected data stream. 3. The method of claim 1, further comprising the steps of: (d) after performing step (c), reading successive elements of the selected data stream; (e) sequentially outputting the successive elements of the selected data stream; and (f) discarding stored elements not belonging to the selected data stream. 4. The method of claim 1, wherein step (a) comprises the steps of: (a. l) sequentially reading a first subset and a second subset of ele¬ ments from the data streams at a specified read rate, and storing each element of the first subset and the second subset; and (a.2) concurrently with step (a. l), sequentially outputting the stored elements of the first subset at a specified output rate, the out¬ put rate being slower than the read rate, to complete step (a. l) before step (a.2), and to retain the stored second subset after step (a.2) is completed. 5. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, comprising the steps of: (a) sequentially reading a first subset of elements of the first data stream, at a specified read rate, and storing each element of the first subset; (b) sequentially reading a second subset of elements, the second subset containing elements from both the first data stream and the alternate data stream, at the specified read rate, and stor¬ ing each element of the second subset; (c) concurrently with steps (a) and (b), sequentially outputting the stored elements of the first subset at a specified output rate, the output rate being slower than the read rate, to complete steps (a) and (b) before step (c), and to retain the second sub¬ set after step (c) is completed; (d) selecting one of the data streams; and (e) responsive to the first data stream being selected, sequentially reading successive elements of the first data stream while se¬ quentially outputting stored elements of the second subset be¬ longing to the first data stream, otherwise, responsive to the alternate data stream being selected, seeking access to the al¬ ternate data stream while sequentially outputting stored ele¬ ments of the second subset belonging to the alternate data stream. 6. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, and each element having a low resolution version and a high resolution version, comprising the steps of: (a) sequentially reading the high resolution versions of successive el¬ ements of the first data stream and the low resolution versions of successive elements of the alternate data stream, at a speci¬ fied read rate, and storing each version of each element; (b) concurrently with step (a), sequentially outputting the stored high resolution versions of successive elements of the first data stream at a specified output rate, the output rate being slower than the read rate; (c) selecting one of the data streams; and (d) responsive to the alternate data stream being selected, perform¬ ing the following steps: (d. l) responsive to there being an insufficient number of ele- ments in the buffer to cover a period of time equal to the time needed to seek access, performing the following steps: (d. l.a) sequentially reading the high resolution versions of successive elements of the first data stream and the low resolution versions of successive elements of the alternate data stream, at the specified read rate and storing each version of each element; (d. l.b) concurrently with step (d. l.a), sequentially ex¬ panding and outputting the stored low resolution versions of successive elements of the alternate data stream at a specified output rate, the output rate being slower than the read rate; and (d. l.c) repeating steps (d. l.a) and (d. l.b) until the num¬ ber of stored elements is sufficient to cover the time needed to seek access; (d.2) seeking access to the high resolution versions of the ele- ments of the alternate data stream, while sequentially expanding and outputting the stored low resolution ver¬ sions of successive elements of the alternate data stream; (d.3) after seeking access, sequentially reading the high reso- lution versions of successive elements of the alternate data stream and the low resolution versions of successive elements of the first data stream, at the specified read rate, and storing each version of each element; and (d.4) concurrently with step (d.3), sequentially outputting the stored high resolution versions of successive elements of the alternate data stream at the specified output rate. 7. The method of claim 6, further comprising the steps of: (b') concurrently with step (b), sequentially outputting the stored low resolution versions of successive elements of the alternate data stream at the specified output rate; (d. l.b') concurrently with step (d. l.b), sequentially reducing and outputting the stored high resolution versions of successive el¬ ements of the first data stream at the specified output rate; (d.2') concurrently with step (d.2), sequentially reducing and out- putting the stored high resolution versions of successive ele¬ ments of the first data stream; and (d.4') concurrently with step (d.4), sequentially outputting the stored low resolution versions of successive elements of the first data stream at the specified output rate. 8. The method of claim 1, wherein step (a) comprises the steps of: (a.l) reading a first subset of elements and storing each element of the first subset; (a.2) after completion of step (a.l), sequentially reading successive elements and storing each element; and (a.3) concurrently with step (a.2), sequentially outputting the stored elements. 9. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, comprising the steps of: (a) reading a first subset of elements from the first data stream and storing each element of the first subset; (b) performing the following steps repeatedly: (b.1) outputting a previously stored element; (b.2) reading an element from the first data stream; and (b.3) storing the read element; (c) selecting one of the data streams; (d) responsive to selecting the alternate data stream, performing the following steps: (d.l) seeking access to the alternate data stream; and (d.2) concurrently with step (d. l), sequentially outputting the stored elements from the buffer until step (d.l) is com- pleted; and (d.3) after step (d.l) has been completed, sequentially reading and outputting successive elements from the alternate data stream. 10. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, comprising the steps of: (a) reading a first subset of elements from the first data stream and storing each element of the first subset; (b) performing the following steps repeatedly: (b. l) outputting a previously stored element; (b.2) reading an element from the first data stream; and (b.3) storing the read element; (c) performing the following steps repeatedly: (c l) outputting a previously stored element belonging to the first data stream; (c.2) reading an element from the alternate data stream; and (c.3) storing the read element; (d) selecting one of the data streams; (e) responsive to selecting the alternate data stream, performing the following steps: (e.l) seeking access to the alternate data stream; and (e.2) concurrently with step (e. l), sequentially outputting previously stored elements belonging to the alternate data stream until step (e. l) is completed; and (f) sequentially reading and outputting successive elements from the selected data stream. 11. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, comprising the steps of: (a) reading a first subset of elements from the alternate data stream and storing each element of the first subset; (b) sequentially reading and outputting successive elements from the first data stream; (c) selecting one of the data streams; (d) responsive to selecting the alternate data stream, performing the following steps: (d. l) seeking access to the alternate data stream; and (d.2) concurrently with step (d. l), sequentially outputting previously stored elements belonging to the alternate data stream from the buffer until step (d. l) is com- pleted; and (e) sequentially reading and outputting successive elements from the selected data stream. 12. A method of selecting and switching among a plurality of data streams, each data stream comprising a series of elements, comprising the steps of: (a) reading an element from each data stream; (b) selecting one of the data streams; and (c) outputting a previously read element corresponding to the se¬ lected data stream. 13. The method of claim 12, wherein the steps are performed re¬ peatedly. 14. The method of claim 12, wherein the data streams are stored in an interleaved fashion. 15. The method of claim 12, wherein steps (a) and (b) are per¬ formed concurrently with step (c). 16. A method of selecting and switching between a first data stream and at least one alternate data stream, each data stream comprising a se¬ ries of elements, comprising the steps of: (a) sequentially reading a first subset of elements of the first data stream, at a specified read rate, and storing each element of the first subset; (b) sequentially reading a second subset of elements, the second subset containing elements from both the first data stream and the alternate data stream, at the specified read rate, and stor¬ ing each element of the second subset; (c) concurrently with steps (a) and (b), sequentially outputting the stored elements of the first subset at a specified output rate, the output rate being slower than the read rate, to complete steps (a) and (b) before step (c), and to retain the second sub¬ set after step (c) is completed; (d) selecting one of the data streams; (e) reading an element from each data stream; and (f) outputting the element corresponding to the selected data stream. 17. The method of claim 16, wherein steps (d), (e), and (f) are per¬ formed repeatedly. 18. The method of claim 16, wherein portions of the data streams are stored in an interleaved fashion. 19. The method of claim 16, wherein steps (d) and (e) are per¬ formed concurrently with step (f). 20. A system for selecting and switching among a plurality of data streams, each data stream comprising a series of elements, comprising: (a) means for selecting one of the data streams; (b) a storage device for storing the data streams and for seeking ac- cess to the selected data stream; (c) a buffer connected to receive and store data stream elements from the storage device; and (d) an output device connected to read and output data stream ele¬ ments from the buffer while the storage device seeks access to the selected data stream. 21. A system for selecting and switching among a plurality of data streams, each data stream comprising a series of elements, comprising: (a) a storage device for storing the data streams in interleaved for¬ mat; (b) means for selecting one of the data streams; and (c) an output device connected to read and output data stream ele¬ ments belonging to the selected data stream from the storage device. 22. A system for selecting and switching among a plurality of data streams, each data stream comprising a series of elements, comprising: (a) a storage device for storing the data streams, wherein a portion of the data streams is stored in interleaved format; (b) a buffer connected to receive and store data stream elements from the storage device; (c) means for selecting one of the data streams; and (d) an output device connected to read and output data stream ele¬ ments belonging to the selected data stream from the storage device.

Inventors: KELLNER CHARLIE, KUSMIAK EUGENE, SOOHOO KENNETH, KELLNER, CHARLIE, KUSMIAK, EUGENE, SOOHOO, KENNETH
Applicants: DIGITAL PICTURES INC, DIGITAL PICTURES, INC.
Application year: 1993
Main classification: G06F3
IPC codes: A63F13, G06F3, G11B20, G11B27, H04N5