1. Field of the Invention
The invention generally relates to image processing and, more particularly, to display order of video object planes (VOPs) of images.
2. Description of the Related Art
Moving Picture Experts Group (MPEG) standards are in widespread use in the art of video and digital imaging. MPEG is the international committee that developed international standards (such as MPEG-1, MPEG-2 and MPEG-4) that made interactive video on CD-Rom and digital TV possible. In an MPEG image system, an image frame is constructed using video object planes or VOPs. In general, a frame is formed by a large amount of pixels generally including 8 bits, 16 bits, or 32 bits. For a frame with a size of 640×480 pixels where each pixel has 8 bits, there are a total 640×480×8 bits in the frame. If the image should be displayed with a rate of 60 frames per second, then there are 640×480×8×60 bits (about 147 Mbits) of data to be displayed in one second.
VOPs include three types, namely, intra coded or I-VOPs, predictive coded or P-VOPs, and bidirectional predictive coded or B-VOPs. For I-VOP, encoding and compression are performed using a single VOP. For P-VOP, encoding and compression of a VOP are performed in reference to the corresponding I-VOP. For B-VOP, encoding and compression of a VOP are performed in reference to the corresponding I-VOP and P-VOP. In the encoding order, the P-VOP must be encoded and compressed before encoding the B-VOP such that the B-VOP can utilize the information of the P-VOP. The order of encoding VOPs is consequently different from the order of display.
The orders of encoding and display may not be as sophisticated as desired in meeting systems and scalability requirements in the art. Shortcomings are inherent in the art if encoding and display orders are improperly managed and constructed, which often negatively affect system and imaging performance. Insufficient memory or losses of VOPs in transmission further exacerbate these problems in the art.
There is thus a general need in the art for an efficient and optimal method and system of MPEG image processing overcoming at least the aforementioned shortcomings in the art. A further need exists in the art for a method and system of managing and arranging the order incoming VOPs in optimally displaying the decoding VOPs in an MPEG image system. In particular, a method and system for determining display order of VOPs in the decoder end of an MPEG image system overcoming at least the shortcomings in the art over loss of VOPs in transmission and insufficient memory.
The invention advantageously provides a method for determining display order of VOPs in the decoder end of an MPEG image system and a device of executing the same, where the incoming VOPs are reordered so that the VOPs can be accordingly displayed. The invention advantageously overcomes at least the aforementioned shortcomings in the art, and more particularly, the problems of insufficient memory or loss of VOPs in transmission.
A preferred embodiment of the invention provides a method for determining the display order of VOPs in the decoder end of an MPEG image system. The decoding end has a decoder for decoding incoming VOPs. A control logic unit has a memory for storing decoded VOPs for display. A first queue has a plurality of cells, and a second queue has one cell. The plurality of cells of the first queue is arranged with a first order to be read by a pointer for display. The method according to this particular embodiment of the invention primarily comprises the steps of arranging a first queue of a plurality of cells with a first order, providing a second queue of a single cell storing an order number, decoding the incoming video object planes (VOPs), determining whether the incoming VOPs are intra coded (I-VOPs), determining whether the incoming VOPs are predictive coded (P-VOPs), determining whether the incoming VOPs are bidirectional predictive coded (B-VOPs), and registering one of the plurality of cells of the first queue with a VOP incoming order for the incoming VOPs that are I-VOPs or B-VOPs.
The method according to the invention can further comprise the step of determining whether the single cell of the second queue is null. The method according to the invention can also include the step of registering one of the plurality of cells of the first queue next to one of the registered cells with the stored order number for the incoming VOPs that are P-VOPs if the single cell of the second queue is not null. The method according to the invention can further include the step of registering one of the plurality of cells of the first queue next to one of the registered cells with the stored order number for the incoming VOPs that are not I-VOPs and B-VOPs if the single cell of the second queue is not null. Moreover, the method according to the invention can include the step of registering the single cell of the second queue with the incoming VOP order for the incoming VOPs that are P-VOPs. The method of according to further embodiments of the invention can include the step of reading the decoded incoming VOPs according to the first order, or the step of indicating whether any of the plurality of cells in the first queue is registered, or the step of indicating whether the single cell of the second queue is registered.
Another preferred embodiment of the invention advantageously provides an image processing device for determining a display order of incoming video object planes (VOPs) in an image processing system entering into a decoder according to an encoding order. The image processing device according to this particular embodiment primarily comprises control logic forming a VOP display order in response to the incoming VOPs and according to the encoding order, a VOP detector determining whether the incoming VOPs are intra coded (I-VOPs), predictive coded (P-VOPs), or bidirectional predictive coded (B-VOPs), and a counter counting a number of the incoming VOPs in response to the encoding order. Another embodiment of the image processing device according to the invention can further include a first queue of a plurality of cells numbered with a first order, and a second queue of a single cell storing an order number. The image processing device according to other embodiments of the invention can also include a reader reading the incoming VOPs according to the first order, or at least one register registering one of the plurality of cells of the first queue with a VOP incoming order for the incoming VOPs that are I-VOPs and B-VOPs, or a flag indicating whether any of the plurality of cells in the first queue and the single cell of the second queue is registered, or an auxiliary VOP management unit providing parameters for dropping any of the incoming VOPs or for indicating memory sufficiency for storing the incoming VOPs. Furthermore, one or more of the plurality of cells of the first queue next to one of the registered cells in the at least one register can be registered with the stored order number for the incoming VOPs that are P-VOPs if the single cell of the second queue is not null. Moreover, one or more of the plurality of cells of the first queue next to one of the registered cells in the at least one register can be registered with the stored order number for the incoming VOPs that are not I-VOPs and B-VOPs if the single cell of the second queue is not null. Further according to the invention, the single cell of the second queue can be registered with the incoming VOP order for the incoming VOPs that are P-VOPs.
Yet another preferred embodiment of the invention advantageously provides an image processing system for determining a display order of incoming video object planes (VOPs). The image processing system according to this particular embodiment primarily comprises a decoder decoding and decompressing incoming video object planes (VOPs) entering the decoder according to an encoding order, control logic forming a VOP display order in response to the incoming VOPs and according to the encoding order, a VOP detector determining whether the incoming VOPs are intra coded (I-VOPs), predictive coded (P-VOPs), or bidirectional predictive coded (B-VOPs), and a counter counting a number of the incoming VOPs in response to the encoding order. Another embodiment of the image processing system according to the invention can further include a first queue of a plurality of cells numbered with a first order, and a second queue of a single cell storing an order number. Yet another embodiment of the image processing system according to the invention can also include a memory storing the incoming decoded VOPs, such as random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM) or flash memory. The image processing system according to other embodiments of the invention can also include a reader reading the incoming VOPs according to the first order, or at least one register registering one of the plurality of cells of the first queue with a VOP incoming order for the incoming VOPs that are I-VOPs and B-VOPs, or a flag indicating whether any of the plurality of cells in the first queue and the single cell of the second queue is registered, or an auxiliary VOP management unit providing parameters for dropping any of the incoming VOPs or for indicating memory sufficiency for storing the incoming VOPs. Furthermore, one or more of the plurality of cells of the first queue next to one of the registered cells in the at least one register can be registered with the stored order number for the incoming VOPs that are P-VOPs if the single cell of the second queue is not null. Moreover, one or more of the plurality of cells of the first queue next to one of the registered cells in the at least one register can be registered with the stored order number for the incoming VOPs that are not I-VOPs and B-VOPs if the single cell of the second queue is not null. Further according to the invention, the single cell of the second queue can be registered with the incoming VOP order for the incoming VOPs that are P-VOPs.
Other features and advantages of the present invention will become apparent by way of the following detailed description of the preferred but non-limiting embodiments. The description is made with reference to the accompanied drawings (not necessarily drawn to scale) in which:
The methodology introduced here is to write a series of VOPs into DRAM in the decoding order and read it back in the display order.
At the encoding end, a first VOP (Video Object Plane) is “Intra”-encoded and compressed to get an I-VOP. Then the I-VOP is decompressed to get a decompressed I-VOP, which is utilized as an reference VOP in encoding the next P-VOP. However, this decompressed I-VOP has little difference from the original non-encoded and non-compressed VOP since the first compressed process has lost some bits due to the similarity in the compressing processes. Thereby, when it is decompressed, these lost bits cannot be reconstructed and thus to some extent, a distortion is induced. However, from the viewpoint of visual sense, this distortion will not effect the view and be detected by the eyes of the viewer. Then the encoding end takes the third VOP and then predicatively encodes and compresses the third VOP with reference to the former decompressed I-VOP as to obtain a P-VOP. Then, the P-VOP is decompressed to get a decompressed P-VOP (a first P-VOP). Likewise, this decompressed P-VOP has little distortion from the original uncompressed third VOP. The distortion in the decompressed P-VOP is larger than that of the decompressed I-VOP for reason of the multiple effects of the distortions from the decompressed I-VOP and P-VOP. Then, the encoding end takes the second VOP for encoding and compression with reference to the decompressed I-VOP and P-VOP so as to form a bidirectional-VOP (a first B-VOP). These VOPs are transferred from the encoding end to the decoding end sequentially. Namely, the transferring order is the first VOP (I-VOP), the third VOP (P-VOP) and the second VOP (B-VOP). It should be noted that the transferring order is not the actual image display order. This is because the B-VOP needs the message of a later VOP so that the encoding end must encode and compress the third VOP in advance, causing the transferring order is not identical to the actual image display order.
Then the encoding end encodes and compressed the fifth VOP for get a second P-VOP with reference to the first P-VOP (similarly, it is decompressed). Then the decoding end takes the fourth VOP to encode and compress the VOP with reference to the first and second P-VOPs (similarly, they are decompressed).
Namely, in encoding and compressing a P-VOP, the former I-VOP (in the initial end of the sequence) or a former P-VOP is used as a reference. In encoding and compressing the B-VOP, the former I-VOP and P-VOP or the former two P-VOPs are utilized as references. As a consequence, if the incoming VOPs are numbered in time with the order of VOP1, VOP2, VOP3, VOP4, VOP5, VOP6, VOP7, etc, then the encoding order (i.e. , image frame transferring order) are sequentially VOP1 (an I-VOP), VOP3 (a P-VOP), VOP2 (a B-VOP), VOP5 (a P-VOP), VOP4 (a B-VOP), VOP7 (a P-VOP), VOP6 (a B-VOP), etc. The process is repeated until an admitted distortion threshold is over. Then the sequence is re-initialized, i.e., an incoming VOP is encoded and compressed as an I-VOP and the same process is repeated so as to get a sequence of I-VOP, P-VOP, B-VOP, P-VOP, B-VOP, P-VOP, B-VOP, etc.
MPEG allow multiple B-VOPs to be formed between an I-VOP and a P-VOP or between two P-VOPs. In that, each B-VOP is encoded and compressed with the former I-VOP (or P-VOP) and a latter P-VOP. In the above example of the VOP order, the encoding order (image frame transferring order) is sequentially VOP1 (an I-VOP), VOP4 (a P-VOP), VOP2 (a B-VOP), VOP3 (a B-VOP), VOP7 (a, P-VOP), VOP5 (a B-VOP), VOP6 (a B-VOP), etc. It is seen that the P-VOP must be encoded in advance for being used in encoding the two B-VOPs.
It is apparent that more B-VOPs can be formed between two P-VOPs, but the more the B-VOPs, the larger the distortion of the encoded VOP. However, the way of encoding VOPs into I-VOPs, P-VOPs, and B-VOPs are helpful in the reduction of transmission bits. In general, the total bits of a P-VOP are only one tenth of an I-VOP and a B-VOP is several tenth of the P-VOP. Thereby, the compression by I-VOP, P-VOP, and B-VOP may greatly reduce the transmission bit number. However, for high-resolution images, if the images are not greatly compressed, it is almost impossible to display the images in real time since the bits to be transferred are too large to be transmitted and processed effectively.
It is seen from the above description that the VOP transmission order is not the same as the image frame display order. Thereby, as these VOPs are to be displayed, they must be reordered to the original image frame display order.
In the decoding end; the incoming encoded and compressed VOPs are firstly decoded according to the receiving order (namely, the transmission order). Then, they are stored to a memory (for example, a DRAM) for displaying.
In general, a decompressed VOP possibly occupies a memory space of 5 Mbytes (this data is closely related to the solution of the image), while in most of the currently used display system, the display frame rate per second is about 30 (frames/sec). Therefore, it is apparent that the DRAM is insufficient to store sufficient VOPs for display. As a consequence, it is necessary to effectively program the DRAM and determine a method to define the relations of the VOPs in the DRAM and VOPs to be displayed. As described above, the VOPs encoding order (transfer order) is not the same as that the display order, but the decoding end, the decoder decodes the VOPs according to the receiving sequence, i.e., based on the transfer order.
The way of using one B-VOP for each one P-VOP as illustrated above is employed as an example for describing the method of the invention. In this case, the transferring order is sequentially VOP1 (an I-VOP), VOP3 (a P-VOP), VOP2 (a B-VOP), VOP5 (a P-VOP), VOP4 (a B-VOP), VOP7 (a P-VOP), VOP6 (a B-VOP), etc., but the display order is sequentially VOP1, VOP2, VOP3, VOP4, VOP5, VOP6, VOP7 . . . as illustrated in the following Table 1.
The control logic unit 300 further comprises a memory. In this embodiment, a DRAM 321 is used as an example of the memory, while other memory suitable for this object can be used in the invention. The DRAM has a finite capacity of storing some VOPs, for example, eight VOPs. Since the capacity of the DRAM is finite, the VOPs stored are also finite.
A VOP type detector 200 serves to detect the type of an incoming VOP, which is indicated in the header of the VOP bit stream. The VOP type detector outputs a dec_wr_VOP_type, which indicates the type of the incoming VOP.
A counter 210 serves to count the number of the incoming VOP so as to be used as a reference number in processing the incoming VOPs.
An auxiliary VOP management unit 220 serves to provide some parameters which are helpful in decision making of the display order. The auxiliary VOP management unit gets three parameters from the incoming data stream. The first one is a drop_frame_decision parameter 221 which decides whether it is necessary to determine that a decoded VOP must be dropped out in response to a condition that the memory space is insufficient to store a complete frame. Generally, the auxiliary VOP management unit makes this decision immediately after one VOP is being written into the DRAM. Thereby, only at the end of deciding a VOP, the drop_frame_decision is active, otherwise it is inactive. If the DRAM is full of data (which can be known from the drop_frame_strobe described in the following), then drop_frame_decision parameter 221 gives a message that the incoming decoded VOP must be dropped since no memory space is available for storing this VOP. However, if the DRAM has sufficient space to store the incoming VOP, the drop_frame_decision 221 is inactive. The second parameter given by the auxiliary VOP management unit is a drop_frame_strobe parameter 222. The drop_frame_strobe parameter indicates the condition of the memory of the control logic unit. For example, if the memory is full, then the drop_frame_strobe is set as 1 which indicates that no VOP can be written into the VOP. On the other hand if the memory has a sufficient space for storing another VOP, then the drop_frame_strobe is set as 0 and thereby, the incoming VOP does not need to be dropped. Therefore, the drop_frame_decision decides whether a VOP needs to be dropped by the value of the drop_frame_strobe and takes an action to drop or write the incoming decoded VOP accordingly. The third parameters given by the auxiliary VOP management unit is a read_VOP_end parameter 223 which indicates that no VOP will be sent to the drop_frame_decision and thus the last one VOP stored in the DRAM must be displaced once more for avoiding the no image frame to be displayed in the display screen. Thereby, the read_VOP_end has a function which is opposite to the drop_frame_decision.
The logic of the invention is that if an incoming decoded VOP is an I-VOP or a B-VOP, then the VOP is stored in the DRAM, and a designated cell in the read_VOP_queue will store the encoding order of incoming VOP and the flag of the cell shows it's active by setting the flag to be 1. If the incoming VOP is a P-VOP, then the VOP is stored in the DRAM, and the cell of the P_queue will store the order of the P-VOP until the next P-VOP is stored in the DRAM or no P-VOP enters into the decoding end when the decoding end predicts that one P-VOP should enter into the decoding end according to the transfer sequence logic known in the decoding end. As the next P-VOP is stored in the DRAM or no P-VOP enters into the decoding end, the indication in the cell of the P-VOP is transferred into the read_VOP_queue to be as a number of the display order. Thereby, the display order can be got by logic.
For the example illustrated in the second line of the table in
For the case illustrated in the third line of the table, it is illustrated that the incoming VOP is a P-VOP, but the system decides not to display this VOP due to the space in the memory being insufficient to store the incoming VOP. Thereby, it is shown that in the output side, the P_queue and flag thereof remains unchanged since the incoming P-VOP will not be displayed.
For the case illustrated in fourth line of the table; it is illustrated that the incoming VOP is a P-VOP and the system decides not to store it. Then, in the output end, it is shown that the P_queue and the flag thereof remain unchanged, but the read_VOP_queue and the flag thereof are changed since the data in the P_queue is written to the read_VOP_queue.
Although the invention has been described with reference to the preferred embodiments, it will be understood that the invention is not limited to the details described thereof. Substitutions and modifications have been suggested in the foregoing description, and others will occur to those of ordinary skill in the art. In particular, the process steps of the method according to the invention will include methods having substantially the same process steps as the method of the invention to achieve substantially the same result. Therefore, all such substitutions and modifications are intended to be within the scope of the invention as defined in the appended claims and their equivalents.