Abstract:
A method and apparatus for storing a sequence of compressed frames of digital motion video information in a circular buffer is disclosed. In a preferred embodiment, compressed digital motion video information is written from a storage device to the circular buffer. A host pointer is set equal to the location corresponding to the end of the last frame of motion video information written to the circular buffer, and the positions of a microcode pointer and the host pointer are compared. Based on these positions, determinations are made regarding (i) whether a compressed frame of digital motion video information is present in the circular buffer and ready for decompression and (ii) whether a portion of the circular buffer can be re-written with compressed digital motion video data based on the positions of the microcode and host pointers.

Description:
This is a continuation of application Ser. No. 07/901,600 filed on Jun. 19, 1992 now abandoned. 
    
    
     FIELD OF THE INVENTION 
     This invention relates to video signal processing generally and particularly to systems for processing compressed and decompressed digital video signals representative of full color video signals. 
     BACKGROUND OF THE INVENTION 
     The personal computer has recently undergone a transformation from a text and numeric processing system to a tool for managing and communicating more complex types of digital information such as audio, still images and motion video. The addition of these &#34;multimedia&#34; data types places new requirements on computer systems and their operating environments. More particularly, multimedia data consumes massive amounts of storage space, and playback of full-motion digital video requires real-time decompression and high input/output bandwidth. 
     It is an object of the present invention to provide a system for efficiently buffering sequences of compressed multimedia data. 
     It is a further object of the present invention to provide a system for queuing sequences of uncompressed multimedia data. 
     It is a still further object of the present invention to provide a software system which is portable across various hardware environments and operating systems for supporting multimedia application software on a host computer. 
     Further objects and advantages of the invention will become apparent from the description of the invention which follows. 
     SUMMARY OF THE INVENTION 
     A method and apparatus for storing a sequence of compressed frames of digital motion video information in a circular buffer. In a preferred embodiment, compressed digital motion video information is written from a storage device to the circular buffer. A host pointer is set equal to the location corresponding to the end of the last frame of motion video information written to the circular buffer, and the positions of a microcode pointer and the host pointer are compared. Based on these positions, determinations are made regarding (i) whether a compressed frame of digital motion video information is present in the circular buffer and ready for decompression and (ii) whether a portion of the circular buffer can be re-written with compressed digital motion video data. 
     In a method and apparatus for processing a sequence of digital motion video frames provided from a decompression system and stored in a queue for display, the queue is formed from a plurality of storage locations. In a preferred embodiment, a next storage location containing a current frame is selected for receiving a next frame generated by the decompression system. Determinations are made regarding whether the current frame (i) has been copied to a display, (ii) is needed as a reference frame, and (iii) may be needed to refresh the display. Based on these determinations, the next frame is copied into the next storage location. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1A is a flow diagram illustrating the operation of a system for displaying a digital video signal according to a preferred embodiment of the present invention. 
     FIG. 1B is a flow diagram illustrating the operation of a system for capturing a digital video signal according to a preferred embodiment of the present invention. 
     FIG. 2 shows an exemplary circular data buffer according to a preferred embodiment of the present invention. 
     FIG. 3 shows an exemplary queue for storing decompressed frames of digital video data for display according to a preferred embodiment of the present invention. 
     FIG. 4 is a flow diagram illustrating the operation of a queue manager according to a preferred embodiment of the present invention. 
     FIG. 5 shows the structure of an overall system which is portable across various hardware environments and operating systems for supporting multimedia application software on a host computer. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to FIG. 1A, there is shown a flow diagram illustrating the operation of a system for displaying a digital video signal according to a preferred embodiment of the present invention. The display system controls the decompressing of video frames and the displaying of the decompressed frames on a computer screen or monitor. Compressed video data is provided to the display system by storage device 110. Circular buffer 120 is provided for storing compressed video data provided from storage device 110. Decompressed frames 132, 134, 136 derived from data in circular buffer 120 are stored in queue 130. A queue manager 400 controls the copying and transfer of information stored in decompressed frames 132, 134, 136 from queue 130 to display 140. 
     Referring now to FIG. 1B, there is shown a flow diagram illustrating the operation of a system for capturing a digital video signal according to a preferred embodiment of the present invention. The capture system controls the compressing of digital video frames provided from video source 180 and the storage of compressed frames on storage device 150. Decompressed frames 176, 172, 174 provided from video source 180 are stored in queue 170. Circular buffer 160 is provided for storing compressed digital video data derived from uncompressed frames 170, 172, 174. Compressed digital video data from circular buffer 160 is provided to storage buffer 150. The capture system also functions to monitor the digital video frames provided from video source 180 on display 195. Monitor buffer 190 is provided for storing uncompressed frames provided by source 180 prior to the showing of such frames on display 195. 
     FIG. 2 shows an exemplary circular data buffer 200 according to a preferred embodiment of the present invention. Circular data buffer 200 may operate in a display mode to store compressed digital video data received from a storage device. In its display mode, circular data buffer 200 functions substantially in accordance with circular buffer 120 of FIG. 1A. Alternatively, circular data buffer 200 may operate in a capture mode to store compressed digital video data provided from a capture system. In its capture mode, circular data buffer 200 functions substantially in accordance with circular buffer 160 of FIG. 1B. Circular data buffer 200 is a shared data structure which may by accessed both through a host processor and through a digital video processor such as the Intel model 82750PB processor. Storage location 210 is provided for storing a first pointer and storage location 220 is provided for storing a second pointer. In the preferred embodiment, the first pointer is used to identify the address of data processed by a host processing system (host pointer), and the second pointer is used to identify the address of data processed by microcode operating on a digital video processor (microcode pointer). In alternate embodiments, the first and second pointers may represent the addresses of data processed by multiple hosts, multiple audio processors, multiple video processors, or combinations thereof. 
     In the display mode, the host computer writes blocks of compressed video data from storage device 110 to circular data buffer 200. Each block of compressed video data transferred from the storage device 110 to circular data buffer 200 will typically not correspond to a whole number of compressed frames of video data. In addition, the frames of compressed video data provided from storage device 110 will typically not be of uniform size. Thus, in the exemplary data buffer of FIG. 2, block 230 of compressed digital video data is comprised of full compressed frames 231, 232, 233, 234 and partial compressed frame 235. 
     The host pointer stored in location 210 points to the end of the last full compressed frame which has been written to buffer 200 by the host computer. The microcode pointer stored in location 220 points to the compressed video data currently being decompressed by microcode operating on the digital video processor. The microcode determines whether a compressed frame is present and ready for decompression in buffer 200 by comparing the position of the microcode pointer to that of the host pointer. More particularly, the microcode will determine that a compressed frame is ready for decompression if the host pointer is ahead of the microcode pointer. The host computer determines whether the compressed data in buffer 200 has been operated on by the microcode before writing over that data by monitoring the position of the microcode pointer. The host will determine that an area or portion of buffer 200 can be re-written if the host pointer is behind the microcode pointer. 
     In the capture mode, the host computer writes blocks of compressed video data from circular data buffer 200 to storage device 150. Each block of compressed video data transferred from the circular data buffer 200 to storage device 150 will typically not correspond to a whole number of compressed frames of video data. In addition, the frames of compressed video data provided to the storage device 150 will typically not be of uniform size. 
     When operating in the capture mode, the host pointer stored in location 210 points to the end of the last block of compressed digital video data written to storage device 150. The microcode pointer stored in location 220 points to the end of the last full compressed frame which has been written to buffer 200 by the microcode operating on the digital video processor. The microcode determines whether space exists in buffer 200 to write additional compressed digital video data into the buffer by comparing the position of the microcode pointer to that of the host pointer. More particularly, the microcode will determine that a compressed frame may be written to buffer 200 if the host pointer is ahead of the microcode pointer. The host computer determines whether compressed data in buffer 200 is ready to be written to storage device 150 by monitoring the position of the microcode pointer. The host will determine that an area or portion of buffer 200 can be written to the storage device if the host pointer is behind the microcode pointer. 
     In both the display and capture modes, means 240 is located at the bottom of buffer 200 and is provided for directing the microcode pointer back to the top of buffer 200. Means 240 is preferably implemented by storing a software GOTO statement at the bottom of buffer 200. In an alternative preferred embodiment, a hardware assist may be provided to direct the microcode pointer to the top of buffer 200 once the bottom of the buffer has been reached. 
     Referring now to FIG. 1A, in a further aspect of the present invention, a system 400 is provided for managing a queue 130 of decompressed digital video frames 132, 134, 136 for display. Frames 132, 134, 136 may represent either still images or interframe difference images. A still image can be copied directly from queue 130 to display 140; an interframe difference image must be applied to at least one other frame (a reference frame) in queue 130 with the result being copied to display 140. 
     Referring now to FIG. 3, there is shown an exemplary queue 300 for storing decompressed frames of digital video data for display according to a preferred embodiment of the present invention. Queue 300 functions substantially in accordance with queue 130 of FIG. 1A. Queue 300 is comprised of storage locations 310, 320 and 330. In the example of FIG. 3, the queue management system writes a sequence of decompressed frames to queue 300 in circular fashion by writing the first frame in the sequence to storage location 310, the second frame to storage location 320 and the third frame to storage location 330. The fourth frame is then written over the first frame in storage location 310, the fifth frame is written over the second frame in storage location 320, and so on. 
     Referring now to FIG. 4, there is shown a flow diagram illustrating the operation of a queue manager 400 according to a preferred embodiment of the present invention. The queue manager is provided with means 410 for selecting the next storage location in queue 300 which will be available to receive the next uncompressed frame generated by the decompression system. Means 420 determines whether the frame currently stored in the next storage location has been copied to the display, means 430 determines whether the frame currently stored in the next storage location is needed as a reference frame, and means 440 determines whether the frame currently stored in the next storage location may be needed to refresh the display. If the frame in the next storage location (i) has been copied to the display, (ii) is not needed as a reference frame, and (iii) will not be needed to refresh the display, then means 450 writes the next uncompressed frame generated by the decompression system into the next selected storage location. If one or more of the above three conditions is not satisfied, the queue management system waits until all three conditions are satisfied before writing into the next storage location. In a preferred embodiment, all frames in the queue which were needed to make the image currently being displayed are deemed to be needed to refresh the display. 
     FIG. 5 shows the structure of an overall system 500 which is portable across various hardware environments and host operating systems for supporting multimedia application software 505 on a host computer. Digital Video Media Control Interface (&#34;Digital Video MCI&#34;) 515 provides a set of commands which allow application 505 to communicate with system 500 through the host operating system. Digital Video MCI 515 allows application 505 to manipulate digital video files by issuing commands such as &#34;open device&#34;, &#34;play file&#34;, &#34;record&#34;, &#34;pause&#34;, &#34;stop&#34; and &#34;close&#34; to the host operating system, and can be thought of as an extension to the host operating system that supports multimedia applications. MCI Application Program Interface (&#34;MCI API&#34;) 510 is provided for passing commands from application 505 to Digital Video MCI 515. 
     Digital Video MCI 515 communicates with Audio Video Library (&#34;AVL&#34;) 525 through AVL Application Program Interface 520. AVL implements several digital data types used for manipulating motion video and audio. These data types are generalized into &#34;streams&#34; which are collected together into &#34;groups.&#34; A stream group is simply a collection of one or more streams that need to be controlled synchronously. Control functions such as play, pause, stop, and frame advance, operate on groups. AVL implements these control functions as well as read and write data functions for capture and display data buffers. AVL also provides control over the attributes of these data types. For example, functions for adjusting the volume of an audio stream or for adjusting the tint on a video stream are provided. This layer is largely platform-independent and therefore easily portable across hardware environments and operating systems. AVL also includes a set of C functions that are used internally for VRAM memory management, bitmap formatting, and for generating and managing command lists. 
     AVL 525 communicates with Microcode Driver (&#34;MCD&#34;) 532 and Motion Video Driver (&#34;MVD&#34;) 534 through an Audio Video Driver Application Program Interface 530. MCD 532 is provided for loading and running microcode functions, allocating and accessing device memory and defining bitmaps, display and capture functions. MCD 532 loads functions on Microcode Function Command List 552 by passing commands to Microcode Function Command List 552 through Microcode Data Interface 550. 
     MVD 534 provides a high level interface to microcode operating system 554 and allows for play and capture of audio and video with dynamic play control. MVD 534 also defines buffers 120, 160 (for storing compressed audio and video data) and streams (such as queues 130, 170) for storing uncompressed audio and video data) through Motion Video Set Queue 556 and Motion Audio Set Queue 558. Set Queues 556, 558 represent host/microcode shared memory data structures. A master command list processing task executes microcode functions requested by the host via Set Queues 556, 558. This architecture allows the host to dynamically program a digital video processor (such as an Intel model 82750PB processor) by placing commands on a set queue. MVD 534 passes commands to Set Queues 556, 558 via Microcode Data Interface 550. Microcode operating system 554 accesses microcode algorithms 565 (i.e., MPEG or JPEG) via algorithm interface 560. 
     Hardware Driver 541 is comprised of Hardware Driver Interface 541a , Hardware Interface Library 541b and Multi-media Board Interface 541c. Hardware driver interface 541a is a device-independent hardware interface that initializes a multi-media board, allocates and copies memory, loads microcode functions and formats display and capture systems. Hardware driver interface 541a communicates with MCD 532 and MVD 534 through Hardware Driver Interface Application Program Interface 540. Hardware Interface Library 541b is a device-dependent hardware library with individual modules for various hardware components on the multi-media board. Hardware Interface Library includes module 542 for allocating and copying memory on a DRAM or VRAM, module 543 for pixel processing, module 544 for audio processing, module 545 for video display, module 546 for video capture and module 547 for screen group switching. Modules 543, 544, 545, 546 and 547 are written to interface with specific chips on a multi-media board. 
     The present invention may be embodied in other specific forms without departing from the spirit or essential attributes of the invention. Accordingly, reference should be made to the appended claims, rather than the foregoing specification, as indicating the scope of the invention.