This invention relates to data buffering, and more particularly, to methods and apparatuses for adjusting buffering of data read from an optical storage medium by comparing actual position information with expected position information.
The basic storage data set stored in a digital versatile disc (DVD) is a block. One block contains sixteen sectors, and each sector is designated by corresponding position information, i.e. sector ID. In general, the sector ID of a next sector is greater than that of a current sector by one. For example, the block N has sixteen sectors wherein sector IDs are from 123400, 123401, . . . , to 12340f. In Blu-Ray discs (BD), the basic storage data set is a cluster. One cluster contains sixteen units, and each unit is designated by corresponding position information, i.e. an address unit number (aun). In general, the aun of a next unit is greater than that of a current unit by two. For example, the cluster N has sixteen units wherein address unit numbers are from 12340, 12342, . . . , to 12345e.
When an optical disc, such as a DVD or a BD, is inserted into an optical disc drive, the optical disc drive starts reading data stored on the optical disc and then transfers a read data to a host. In general, the data read from the optical disc is firstly stored in a memory of the optical disc drive, known as a buffer memory, for undergoing decoding or transmitting. If the data is shifted or slipped during the reading operation and the optical disc drive continues data buffering, the data read from the optical disc will be stored in erroneous positions, resulting in decoding and transmitting failure.
Taking the data access of a BD for example, when the blank area of a BD is being read, the address unit number of each unit is unable to be identified. Therefore, the actual address unit number of the unit read after the blank area has been accessed may not match an expected value, and therefore the data of the unit read from the optical disc will be stored in an erroneous position of the buffer memory. When this happens, if the related art optical disc drive continues buffering following data read from the BD, the data buffered in erroneous positions will cause decoding errors. As a result, since the buffered data of a cluster cannot be decoded correctly, the related art optical disc drive deems that the data on the BD are not correctly read, and then re-buffers data of the same cluster on the BD.
However, if the related art optical disc drive stops buffering data read from the BD and then re-buffers data of the same cluster when the mismatch between the actual address unit number and an expected address unit number of the unit read from the BD is acknowledged, the defect management becomes complicated due to the interrupt of data buffering. In other words, re-buffering the data still has the possibility to buffer the re-buffered data into incorrect positions of the buffer memory.
Data accessing of DVDs has the same disadvantages as mentioned above. Therefore, how to buffer data read from an optical disc into correct positions of a buffer memory plays an important role in data decoding and data transmitting.
It is therefore one of the objectives of the claimed invention to provide a method and apparatus for adjusting buffering of data read from an optical storage medium by comparing actual position information with expected position information, to solve the above problems.
According to an embodiment of the claimed invention, a method for buffering data read from an optical storage medium is disclosed. The method comprises: reading a second data segment from the optical storage medium; and setting a second expected position information corresponding to the second data segment for aligning the second expected position information to a second actual position information of the second data segment, and buffering the second data segment read from the optical storage medium into a storage device according to the second expected position information.
According to an embodiment of the claimed invention, a data buffering apparatus for buffering data read from an optical storage medium is disclosed. The data buffering apparatus comprises: a storage device; a buffer controller for reading a second data segment from the optical storage medium; and a decision logic, coupled to the buffer controller, for setting a second expected position information corresponding to the second data segment for aligning the second expected position information to a second actual position information of the second data segment and controls the buffer controller to buffer the second data segment read from the optical storage medium into a storage device according to the second expected position information.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please note that certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, consumer electronic equipment manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an opened-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . ”. Also, the term “couple” or “couples” is intended to mean either an indirect or direct electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
Please refer to
As shown in
Please refer to
Step 200: Buffer a first data segment read from an optical storage medium 120, such as a DVD or a BD, into the storage device 112.
Step 202: Compare a first actual position information of the first data segment read from the optical storage medium 120 with a first expected position information of the first data segment to be stored in the storage device 112.
Step 204: Does the first expected position information match the first actual position information? If yes, go to step 206; otherwise, go to step 208.
Step 206: Buffer a data segment following the first data segment into the storage device 112 with no amendment to the expected storage position of the data segment.
Step 208: Set a second expected position information corresponding to a second data segment for aligning the second expected position information to a second actual position information of the second data segment according to the first actual position information.
Step 210: buffer the second data segment read from the optical storage medium 120 into the storage device 112 according to the second expected position information.
Please note that the second data segment is read from the optical storage medium 120 after the first data segment is read from the optical storage medium 120. In addition, the optical disc drive has a counter mechanism for counting the data segments read from the optical storage medium 120 to determine the expected position information to which the optical disc drive refers when buffering the data segments. For example, the buffer controller 113 in
In this embodiment, the buffer controller 113 buffers the first data segment into the storage device 112 (step 200), and then the comparing unit 114 compares the first actual position information and the first expected position information to generate a comparison result (step 202). If the decision logic 115 acknowledges that the first expected position information matches the first actual position information when referring to the comparison result (step 204), the decision logic 115 allows the buffer controller 113 to buffer the data segment following the first data segment into the storage device 112 with no amendment made to the storage position. For example, the following data segment read from the optical storage medium 120 is stored next to the first data segment (actual position). However, if the decision logic 115 acknowledges that the first actual position information does not match the first expected position information when referring to the comparison result (step 204), the decision logic 115 controls the buffer controller 113 to set a second expected position information corresponding to a second data segment for aligning the second expected position information to a second actual position information of the second data segment according to the first actual position information and then buffer the second data segment read from the optical storage medium 120 into the storage device 112 according to the second expected position information. As a result, the expected position information and the actual position information of the buffered data are aligned.
For clarity, a plurality of examples are given as follows to illustrate the operation of adjusting the buffering of data read from an optical disc (e.g. a BD or a DVD). Please refer to
In this embodiment, the decision logic 115 refers to the actual address unit number 123436 to determine the following unit with the actual address unit number 123440 to be buffered into memory location M. Then, after receiving the desired unit of the target address unit number 123440, the buffer controller 113 issues commands to the storage device 112 for storing the desired unit of the target address unit number 123440 into the memory location M of the storage device 112 as the leading unit stored therein.
In addition, the decision logic 115 sets 123440 as the expected address unit number for a target unit, and stops the buffer controller 113 from buffering following units read from the BD into the storage device 112 until the target unit of the actual address unit number 123440 (i.e. the aforementioned second data segment) is received. Therefore, when the target unit of the actual address unit number 123440 is received, the target unit is stored in a memory area of memory location M that corresponds to the expected address unit number 123440. In other words, the buffer controller 113 stores the unit of the actual address unit number 123440 into a correct position of the storage device 112. As a result, the mismatch between the actual address unit number and the expected address unit number is cancelled by adjusting the expected address unit number of the storage position of the initial unit of a cluster N in the storage device 112.
As mentioned above, the data buffering is stopped as the mismatch between the actual address unit number and the expected address unit number is detected. However, the buffer controller 113, depending on design requirements, could keep buffering following units read from the BD into erroneous positions before the target unit having the actual address unit number 123440 is received. Since the comparing unit 114 keeps monitoring the occurrence of the mismatch between the actual address unit number and the expected address unit number, it is clear that the target unit having the actual address unit number 123440 will be stored in the memory area of memory location M that corresponds to the expected address unit number 123440.
In the above example, aligning of the actual address unit number and the expected address unit number is performed upon the initial unit of a cluster N. However, the present invention is not limited to this aligning scheme. Please refer to
Please refer to
In addition, the decision logic 115 sets 123460 as the expected address unit number for a target unit, and stops the buffer controller 113 from buffering following units read from the BD into the storage device 112 until the target unit of the actual address unit number 123460 (i.e. the aforementioned second data segment) is received. Therefore, when the target unit is received, the target unit is stored in a memory area of memory location M+1 that corresponds to the expected address unit number 123460. As a result, the mismatch between the actual address unit number and the expected address unit number is cancelled by adjusting the storage position of the initial unit of a cluster N+1 in the storage device 112.
As mentioned above, the data buffering is stopped as the mismatch between the actual address unit number and the expected address unit number is detected. However, the buffer controller 113, depending on design requirements, is allowed to keep buffering following units read from the BD into erroneous positions before the target unit having the actual address unit number 123460 is received. Since the comparing unit 114 keeps monitoring the occurrence of the mismatch between the actual address unit number and the expected address unit number to hold the target expected address unit number 123460 set to the target unit, it is clear that the target unit having the actual address unit number 123460 will be always stored in the memory area of memory location M+1 that corresponds to the expected address unit number 123460. The objective of aligning the actual address unit number and the expected address unit number is still achieved by adjusting the storage position of an initial unit of a cluster N+1.
Please refer to
Please refer to
In addition, the decision logic 115 sets 123480 as the expected address unit number for a target unit, and stops the buffer controller 113 from buffering following units read from the BD into the storage device 112 until the target unit of the actual address unit number 123480 (i.e. the aforementioned second data segment) is received. Therefore, when the target unit is received, the target unit is stored in a memory area of memory location M+2 that corresponds to the expected address unit number 123480. As a result, the mismatch between the actual address unit number and the expected address unit number is cancelled by adjusting the storage position of the initial unit of a cluster N+2 in the storage device 112.
As mentioned above, data buffering is stopped as the mismatch between the actual address unit number and the expected address unit number is detected. However, the buffer controller 113, depending on design requirements, is allowed to keep buffering following units read from the BD before the desired unit having the actual address unit number 123480 is received. Since the comparing unit 114 keeps monitoring the occurrence of the mismatch between the actual address unit number and the expected address unit number, it is clear that the target unit having the actual address unit number 123480 will always be stored in the memory area of memory location M+2 that corresponds to the expected address unit number 123480. The objective of aligning the actual address unit number and the expected address unit number is still achieved by adjusting the storage position of an initial unit of a cluster N+2.
Please refer to
The above examples illustrate the operation of adjusting the buffering of data read from a BD. However, the adjusting scheme for data buffering is not limited to a BD. For example, referring to the above embodiments illustrated in
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.