DATA PROCESSING METHODS AND SYSTEMS
Data processing methods and systems for accessing a target sample in a media data stream. The media data stream has a plurality of samples and corresponding sample information recorded in at least one entry, wherein the sample information for a predetermined number of the entries is calculated and the calculated result is stored in at least one cache entry. Target sample information corresponding to the target sample is provided. One of the cache entries is located by comparing the target sample information with the calculated result of respective cache entries. After locating the cache entry, the target sample from the entries is located corresponding to the located cache entry.
Latest MEDIATEK INC. Patents:
- Adaptive Minimum Voltage Aging Margin Prediction Method and Adaptive Minimum Voltage Aging Margin Prediction System Capable of Providing Satisfactory Prediction Accuracy
- Method for Link Transition in Universal Serial Bus and System Thereof
- WIRELESS LOCAL AREA NETWORK SYSTEM USING FREQUENCY HOPPING FOR CO-CHANNEL INTERFERENCE AVOIDANCE
- METHOD OF PERFORMING CODE REVIEW AND RELATED SYSTEM
- Method for Handling Calls with Sessions Initiation Protocol
This is a continuation-in-part application of copending application Ser. No. 11/230,402 filed Sep. 20, 2005, entitled Data Processing Methods and Systems.
BACKGROUNDThe present disclosure relates generally to data processing, and more particularly to methods and systems for processing and accessing metadata in a media file.
Media files, such as MPEG-4 files, comprise media data and metadata of the media data. The metadata provides data sample information to media applications for processing media data in the media file. Generally, media files are defined to be organized with several structural elements. For example, MPEG-4 files are composed of structural elements called boxes. Each box may comprise media data, metadata or other sub-boxes. For example, a sample table box (STBL) records time and file information of media data. According to the time and file information in the STBL box, applications can obtain the time, type, data size, and position in the media file and further perform the playback or random-seek functions toward the media file, accordingly. The STBL box also includes several sub-boxes comprising a decoding time to sample box (STTS) as shown in
The STTS box contains at least one entry for recording the time duration of samples of media data.
Traditionally, a linear search through these boxes is performed to help locating a specific sample with a target decoding time. A linear search means that the time duration of respective samples from the very first media sample is accumulated until the accumulated time duration equals or exceeds the target decoding time. For example, to locate a specific sample with a specific decoding time 2000, a linear search is performed by accumulating the time duration of the first thirty samples. Since the total time duration of the first thirty samples is 1964 (6*66+14*67+10*63=1964) and the total time duration of the first thirty-one samples is 2027 (6*66+14*67+11*63=2027) which exceeds the specific decoding time 2000, sample #30 is then located. The linear search calculation is time-consuming if there are large number of entries in these boxes.
In addition, the media samples in the media data are grouped into chunks. The STSC box records the mapping relationship between samples and chunks. Based on the mapping relationship recorded in the STSC box, one can identify in which chunk a target sample resides, and further obtain other related data using the chunk information.
Data processing methods and systems are provided.
In an embodiment of a data processing method for accessing a target sample in a media data stream, target sample information corresponding to the target sample is provided. The media data stream has a plurality of samples and corresponding sample information recorded in at least one entry, wherein the sample information for a predetermined number of the entries is calculated and the calculated result is stored in at least one cache entry. One of the cache entries is located by comparing the target sample information with the calculated result of respective cache entries. After locating the cache entries, the target sample from the entries is located according to the located cache entry.
An embodiment of a data processing system comprises a media data stream, at least one cache entry, and a processing unit. The media data stream comprises a plurality of samples and corresponding sample information recorded in at least one entry. The sample information for a predetermined number of the entries is calculated and the calculated result is stored in the cache entry. The processing unit receives target sample information corresponding to a target sample, locates one of the cache entries by comparing the target sample information with the calculated result of respective cache entries, and after locating the cache entries, locates the target sample from the entries according to the located cache entry.
Data processing methods may take the form of program code embodied in a tangible media. When the program code is loaded into and executed by a machine, the machine becomes an apparatus for practicing the disclosed method.
DESCRIPTION OF THE DRAWINGSThe invention will become more fully understood by referring to the following detailed description with reference to the accompanying drawings, wherein:
FIGS. 5A˜5D shows an example of incremental processing;
Data processing methods and systems are provided, in which pre-calculated cache entry, shared cache pool and incremental processing are employed. In some embodiments, the data processing methods and systems are used to decode MPEG-4 files, which is well-defined in ISO standard and is however not limited in the present invention. An overview of the MPEG-4 files is provided in a standard specification of ISO 14496-12, which is incorporated herein by reference in its entirety for all purposes. In addition, in some embodiments, the data processing methods and systems are used to decode MP3 data. The data processing methods and systems can be implemented to decode other types of audio data without metadata, such as AAC, AMR/AWB).
Pre-Calculated Cache Entry:
First, the data processing methods and systems used to decode MPEG-4 files are described.
To locate the sample data with the specific decoding time T, the cache entry CEN is checked, such that the duration recorded in CEN is greater than T and the duration recorded in CEN-1 is smaller than T. In some embodiments, the cache entry can be located by a binary search. If CEN-1 records the time duration from E1 to EX, and CEN records the time duration from E1 to Ey. it is trivial that the sample data which we are looking for must resides in the STTS entries Ex to Ey. Then a linear search is applied in the STTS entries Ex to Ey to locate the wanted sample data.
To obtain the decoding time of a specific sample data SK, the similar method applies. The cache entry CEN is checked, such that the accumulated sample count recorded in CEN is greater than K and the accumulated sample count recorded in CEN-1 is smaller than K. In some embodiments, the cache entry can be located by a binary search. If CEN-1 records the sample count from E1 to Ex, and CEN records the sample count from E1 to Ey, it is trivial that the sample data which we are looking for must resides in the STTS entries Ex to Ey. Then a linear search is applied in the STTS entries Ex to Ey to locate the wanted sample data and it's decoding time.
With the use of the pre-calculated cache, the frequencies of accessing media files can be greatly reduced since the pre-calculated data can be stored in memory. It is also understood that the use of pre-calculated cache entry can be also applied to STSS and STSC. In STSC, the cache entry records the total number of samples in the chunks covered by the current and prior cache entries.
In addition, the data processing methods and systems used to decode MP3 files are described.
In MP3 file format, the frame duration is fixed; that is, given a decoding time T, we can easily find the corresponding frame F. To locate the frame F with the specific decoding time T, one of the cache entries is first located. For example, as shown in
Shared Cache Pool:
In some embodiments, the number of corresponding cache entries to each box might be either fixed or dynamically decided according to each box size.
In some embodiments, the total size of cache memory might be limited and the allocation of the cache entries for each box can be determined using a shared cache pool model. In the shared cache pool, the number of cache entries for a box is determined according to the number of entries in the boxes requiring cache entries in the order of initialization. For example, to allocate a certain amount of cache entries to the STTS box, the STSS box and the STSC box, the system will firstly allocate a first ratio of the cache entries to the STSS box. The first ratio could be the number of STSS entries divided by the total entry count of the 3 tables. In some embodiments, the number of cache entries allocated to the STSS box can be further limited to a pre-defined maximum number. Then, the system will allocate a second ratio of the cache entries to the STSC box. The second ratio could be the number of STSC entries divided by the total entry count of the 3 tables. In some embodiments, the number of cache entries allocated to the STSC box can also be further limited to a pre-defined maximum number. Finally, the system will allocate the rest of the cache entries to the STTS box. It should be noted that the order of cache allocation is not limited in the present invention. Any order of cache allocation should be covered in the present invention.
Incremental Processing:
First, the data processing methods and systems used to decode MPEG-4 files are described.
As mentioned above, with the pre-calculated cache entries, lots of time spent on redundant computation can be reduced. However, if the boxes (STTS, STSS and STSC) are very large, the calculation of cache entries will need a certain amount of time. For example, if complete cache entries for the STTS box must be prepared before a playback, the accumulated total time duration of a group of STTS entries for respective cache entries must be calculated. To reduce the response time caused by calculation of cache entries before playback, the calculation of cache entries is performed with the concept of incremental processing. In incremental processing, a part of the cache entries is calculated before the playback of media data, and the rest of the cache entries are calculated progressively during playback. If the data sought by users is not found in the currently ready cache entries, the calculation of cache entries is performed forward until the data is covered by the cache entries.
FIGS. 5A˜5D shows an example of incremental processing. In this example, the memory space 511 of the memory 510 is allocated to the STSS box for its corresponding cache entries, the memory space 512 of the memory 510 is allocated to the STSC box for its corresponding cache entries, and the memory space 513 of the memory 510 is allocated to the STTS box for its corresponding cache entries. As shown in
Data processing methods, or certain aspects or portions thereof, may take the form of program code (i.e., executable instructions) embodied in tangible media, such as products, floppy diskettes, CD-ROMS, hard drives, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine thereby becomes an apparatus for practicing the methods. The methods may also be embodied in the form of program code transmitted over some transmission medium, such as electrical wiring or cabling, through fiber optics, or via any other form of transmission, wherein, when the program code is received and loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the disclosed methods. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique apparatus that operates analogously to application specific logic circuits.
In addition, the data processing methods and systems used to decode MP3 files are described.
As mentioned above, with the pre-calculated cache entries, lots of time spent on computation to locate a specific decoding time can be reduced. However, if the audio file is very large, the calculation of cache entries requires a certain amount of time. To reduce the response time caused by calculation of cache entries before playback, the calculation of cache entries is performed with the concept of incremental processing.
In incremental processing, a certain portion of the cache entries are calculated before the playback, and the rest of the cache entries are calculated progressively during playback. If the data sought by users is not found in the currently ready cache entries, the calculation of cache entries is performed forward until the data is covered by the cache entries.
For example, when an audio file is to be decoded, the first few entries of the cache table are established before the playback. During the playback, other entries are established. The establishment of cache table can be in the lead from the playback operation. If a user wants to rush the playback operation forward, the established cache table can be used to facilitate locating of the specific forward target.
The established cache table can be overwritten when another audio file is to be decoded. In addition, the established cache table can be copied to another storage position when another audio file is to be decoded. For the later example, the copied cache table can be stored for further use. When the same audio file is played next time, the stored cache table can be utilized, and the establishment of the cache table needs not to be repeated.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. Those skilled in this technology can still make various alterations and modifications without departing from the scope and spirit of this invention. Therefore, the scope of the present invention shall be defined and protected by the following claims and their equivalents.
Claims
1. A data processing method for accessing a target sample in a media data stream, the media data stream having a plurality of samples and corresponding sample information recorded in at least one entry, the method comprising:
- providing target sample information corresponding to the target sample, wherein the sample information for a predetermined number of entries is calculated and the calculated result is stored in at least one cache entry;
- locating one of the cache entries by comparing the target sample information with the calculated result of respective cache entries; and
- after locating the cache entry, locating the target sample from the entries corresponding to the located cache entry.
2. The method of claim 1 further comprising determining the number of the cache entries according to the number of the entries.
3. The method of claim 1 further comprising calculating the sample information for the respective predetermined number of the entries during playback.
4. The method of claim 1 wherein at least one table is provided, wherein the table is a time to sample box (STTS) listing the entries and the corresponding sample information, the sample information comprises a decoding time of samples in the corresponding entry.
5. The method of claim 4 wherein the target sample information comprises a specific decoding time.
6. The method of claim 5 wherein the specific decoding time is between the accumulated time duration recorded in the cache entries prior to the located cache entry, and the accumulated time duration recorded in the located cache entry.
7. The method of claim 1 wherein at least one table is provided, wherein the table comprises a sample to chunk box (STSC), comprising chunks of the media data stream, and the sample information comprises the number of samples in respective chunks.
8. The method of claim 7 wherein the target sample number is between the accumulated number of samples recorded in the cache entries prior to the located cache entry and the accumulated number of samples recorded in the located cache entry.
9. The method of claim 1 wherein the media data stream is of a MPEG-4 file.
10. The method of claim 1, wherein the media data stream is comprised in an audio file with no metadata.
11. The method of claim 10, wherein the media data stream is comprised in an MP3, AAC, or AMR/AWB file.
12. The method of claim 10, further dividing the media data stream into segments, and determining the number of the cache entries according to the number of the segments.
13. The method of claim 10, wherein the sample information comprises offset information of an end point of the corresponding segment.
14. The method of claim 13, further comprising calculating the offset for the entries during playback.
15. The method of claim 10, wherein the target sample information comprises a specific decoding time.
16. The method of claim 10, wherein the target sample is located by locating one of the cache entries by a binary search, and further locating the target sample within the located segment by a linear search.
17. The method of claim 10, further copying the established cache entries.
18. The method of claim 10, further rewriting the cache entries when another audio file is to be processed.
19. A machine-readable storage medium comprising a computer program, which, when executed, causes a device to perform a data processing method for accessing a target sample in a media data stream, the media data stream having a plurality of samples and corresponding sample information recorded in at least one entry, the method comprising:
- providing target sample information corresponding to the target sample, wherein the sample information for a predetermined number of entries is calculated and the calculated result is stored in at least one cache entry;
- locating one of the cache entries by comparing the target sample information with the calculated result of respective cache entries; and
- after locating the cache entry, locating the target sample from the entries corresponding to the located cache entry.
20. The storage medium of claim 19 wherein the method further comprising determining the number of the cache entries according to the number of the entries.
21. The storage medium of claim 19 wherein the method further comprising calculating the sample information for the respective predetermined number of the entries during playback.
22. The storage medium of claim 19 wherein at least one table is provided, wherein the table is a time to sample box (STTS) listing the entries and the corresponding sample information, the sample information comprises a decoding time of samples in the corresponding entry.
23. The storage medium of claim 22 wherein the target sample information comprises a specific decoding time.
24. The storage medium of claim 23 wherein the specific decoding time is between the accumulated time duration recorded in the cache entries prior to the located cache entry, and the accumulated time duration recorded in the located cache entry.
25. The storage medium of claim 19 wherein at least one table is provided, wherein the table comprises a sample to chunk box (STSC), comprising chunks of the media data stream, and the sample information comprises the number of samples in respective chunks.
26. The storage medium of claim 25 wherein the target sample number is between the accumulated number of samples recorded in the cache entries prior to the located cache entry and the accumulated number of samples recorded in the located cache entry.
27. The storage medium of claim 19 wherein the media data stream is of a MPEG-4 file.
28. The storage medium of claim 19, wherein the media data stream is comprised in an audio file with no metadata.
29. The storage medium of claim 28, wherein the media data stream is comprised in an MP3, AAC, or AMR/AWB file.
30. The storage medium of claim 28, wherein the method further divides the media data stream into segments, and determines the number of the cache entries according to the number of the segments.
31. The storage medium of claim 28, wherein the sample information comprises offset information of an end point of the corresponding segment.
32. The storage medium of claim 31, wherein the method further comprises calculating the offset for the entries during playback.
33. The storage medium of claim 28, wherein the target sample information comprises a specific decoding time.
34. The storage medium of claim 28, wherein the method further locates the target sample by locating one of the cache entries by a binary search, and further locates the target sample within the located segment by a linear search.
35. The storage medium of claim 28, wherein the method further copies the established cache entries.
36. The storage medium of claim 28, wherein the method further rewrites the cache entries when another audio file is to be processed.
37. A data processing system, comprising:
- a media data stream comprising a plurality of samples and corresponding sample information recorded in at least one entry;
- at least one cache entry storing a calculated result of the sample information for a predetermined number of the entries; and
- a processing unit receiving target sample information corresponding to a target sample, locating one of the cache entries by comparing the target sample information with the calculated result of respective cache entries, and after locating the cache entry, locating the target sample from the entries corresponding to the located cache entry.
38. The system of claim 37 wherein the processing unit further determines the number of the cache entries according to the number of the entries.
39. The system of claim 37 wherein the processing unit further calculates the sample information for the respective predetermined number of the entries during playback.
40. The system of claim 37 wherein at least one table is provided, wherein the table is a time to sample box (STTS) listing the entries and the corresponding sample information, the sample information comprises a decoding time of samples in the corresponding entry.
41. The system of claim 40 wherein the target sample information comprises a specific decoding time.
42. The system of claim 41 wherein the specific decoding time is between the accumulated time duration recorded in the cache entries prior to the located cache entry, and the accumulated time duration recorded in the located cache entry.
43. The system of claim 37 wherein at least one table is provided, wherein the table comprises a sample to chunk box (STSC), comprising chunks of the media data stream, and the sample information comprises the number of samples in respective chunks.
44. The system of claim 43 wherein the target sample number is between the accumulated number of samples recorded in the cache entries prior to the located cache entry and the accumulated number of samples recorded in the located cache entry.
45. The system of claim 37 wherein the media data stream is of a MPEG-4 file.
46. The system of claim 37 wherein the data processing system is a MPEG-4 file decoder.
47. The system of claim 37, wherein the media data stream is comprised in an audio file with no metadata.
48. The system of claim 47, wherein the media data stream is comprised in an MP3, AAC, or AMR/AWB file.
49. The system of claim 47, wherein the processing unit further divides the media data stream into segments, and determines the number of the cache entries according to the number of the segments.
50. The system of claim 47, wherein the sample information comprises offset information of an end point of the corresponding segment.
51. The system of claim 50, wherein the processing unit further calculates the offset for the entries during playback.
52. The system of claim 47, wherein the target sample information comprises a specific decoding time.
53. The system of claim 47, wherein the processing unit further locates the target sample by locating one of the cache entries by a binary search, and further locates the target sample within the located segment by a linear search.
54. The system of claim 47, wherein the processing unit further copies the established cache entries for further use.
55. The system of claim 47, wherein the processing unit further rewrites the cache entries when another audio file is to be processed.
Type: Application
Filed: Aug 18, 2006
Publication Date: Mar 22, 2007
Applicant: MEDIATEK INC. (Hsin-Chu)
Inventors: Chan-Hung Su (Kaohsiung City), Yu-Cheng Hsieh (Hsinchu City), Jf Yeh (Miaoli Hsien)
Application Number: 11/465,469
International Classification: G06F 12/00 (20060101);