Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
The embodiment of the invention is after having obtained an audio-video document, according to the residual memory space of the audio frequency buffer area comparative result with default audio storage threshold value, perhaps select whether to resolve the current code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value.
It is a kind of that the embodiment of the invention provides: efficient audio-video document analytic method and equipment.
Described method comprises: obtain audio-video document;
Resolve audio code stream and the video code flow of described audio-video document according to following step:
When the current code stream of audio-video document is audio code stream, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value, and select whether to resolve described audio code stream according to result relatively;
When the current code stream of audio-video document is video code flow, compares the residual memory space in video cache district and the size of the video storage threshold value of presetting, and select whether to resolve described video code flow according to result relatively.
Described device comprises: the file acquisition unit is used for obtaining audio-video document;
The audio-video document resolution unit is used for resolving according to following step audio code stream and the video code flow of described audio-video document:
When the current code stream of audio-video document is audio code stream, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value, and select whether to resolve described audio code stream according to result relatively;
When the current code stream of audio-video document is video code flow, compares the residual memory space in video cache district and the size of the video storage threshold value of presetting, and select whether to resolve described video code flow according to result relatively.
The embodiment of the invention is after having obtained an audio-video document, according to the residual memory space of the audio frequency buffer area comparative result with default audio storage threshold value, perhaps select whether to resolve the current code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value.Owing to before resolving audio code stream and video code flow, need not to search for this audio code stream and video code flow, therefore greatly reduced the searching times of file, thus audio code stream and video code flow that can this audio-video document of fast resolving.
For technical solutions according to the invention are described, describe below by specific embodiment.
Embodiment one:
Fig. 1 shows the process flow diagram of the efficient audio-video document analytic method that first embodiment of the invention provides, in the present embodiment, a default audio storage threshold value and a video storage threshold value, after obtaining audio-video document, according to the residual memory space of audio frequency buffer area and the comparative result of the audio storage threshold value of presetting, perhaps select whether to resolve the current code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value, details are as follows:
In step S11, obtain audio-video document.
In the present embodiment, obtain the audio-video document that needs parsing, in the audio-video document that obtains, the Store form of audio code stream and video code flow may interlock and deposit, and as shown in Figure 2, also may be to have deposited continuously a plurality of audio code streams to deposit video code flow afterwards again, as shown in Figure 3, certainly, also may be to have deposited continuously a plurality of video code flows to deposit again audio code stream afterwards, be not construed as limiting herein.
In step S12, resolve audio code stream and the video code flow of this audio-video document according to following step: when the current code stream of audio-video document is audio code stream, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value, and select whether to resolve this audio code stream according to result relatively; When the current code stream of audio-video document is video code flow, compares the residual memory space in video cache district and the size of the video storage threshold value of presetting, and select whether to resolve this video code flow according to result relatively.
In the present embodiment, a default audio storage threshold value and a video storage threshold value, default audio storage threshold value is greater than 0 and less than or equal to the storage space of audio frequency buffer area, and default video storage threshold value is greater than 0 and less than or equal to the storage space in video cache district.
The audio-video document that obtains is resolved, at first judge that according to the code stream tagged word the current code stream of audio-video document pointed is audio code stream or video code flow, if audio code stream, the then residual memory space of comparing audio buffer area and default audio storage threshold size, and select whether to resolve this audio code stream according to the residual memory space of audio frequency buffer area and the comparative result of default audio storage threshold value; If video code flow, the then relatively residual memory space in video cache district and default video storage threshold size, and select whether to resolve this video code flow according to the residual memory space in video cache district and the comparative result of default video storage threshold value.After resolving audio code stream and video code flow, deposit the audio code stream of resolving in the audio frequency buffer area, deposit the video code flow of resolving in the video cache district.In embodiments of the present invention, according to the residual memory space of audio frequency buffer area and the comparative result of the audio storage threshold value of presetting, perhaps select whether to resolve current audio code stream and the current video code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value, owing to before the audio code stream of resolving audio-video document or video code flow, need not to search for this audio code stream or need not to search for this video code flow, therefore reduced the number of times of search file, thus audio code stream and video code flow that can this audio-video document of fast resolving.
Further, at the residual memory space of audio frequency buffer area more than or equal to default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, deposits order according to audio code stream and video code flow in the priority of audio-video document and resolves successively this audio code stream and video code flow.Take the audio-video document of analysis diagram 3 successively as example, when resolving this audio-video document, at first judge that according to the tagged word of code stream first code stream of the audio-video document that Fig. 3 is represented is audio code stream or video code flow, after first code stream of judging the represented audio-video document of Fig. 3 is audio code stream 1, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value again, if the residual memory space of audio frequency buffer area is less than default audio storage threshold value, then resolve this audio code stream 1, after audio code stream 1 is resolved end, deposit this audio code stream 1 in the audio frequency buffer area; Continuation judges that according to the code stream tagged word the 2nd code stream of audio-video document is audio code stream or video code flow, after residual memory space that the 2nd code stream judging audio-video document is audio code stream 2 and audio frequency buffer area is less than default audio storage threshold value, resolve the audio code stream 2 behind this audio code stream 1, and the audio code stream after will resolving 2 deposits the audio frequency buffer area in; The step of parsing audio code stream 3 is similar to parsing audio code stream 1 and audio code stream 2; After resolving audio code stream 3, the 4th code stream judging audio-video document is audio code stream or video code flow, after the 4th code stream judging audio-video document is video code flow 1, compare the residual memory space in video cache district and the size of the video storage threshold value of presetting, at the residual memory space in video cache district during less than default video storage threshold value, resolve this video code flow 1, and the video code flow after will resolving 1 deposits the video cache district in; According to top analytic method, order is resolved other code streams of audio-video document, and the audio code stream after will resolving deposits the audio frequency buffer area in, deposits the video code flow after the parsing in the video cache district.In the present embodiment, sequentially resolve at the deposit position of audio-video document according to audio code stream and video code flow, therefore can effective less audio code stream or the searching times of video code flow, thus can go out this audio-video document by fast resolving.And, leave the audio code stream after resolving in default audio frequency buffer area, and the video code flow after will resolving leaves default video cache district in, so as follow-up play after resolving audio code stream or play parsing after video code flow more smooth.
Further, at the residual memory space in video cache district less than default video storage threshold value, and the residual memory space of audio frequency buffer area is during more than or equal to default audio storage threshold value, active searching and order are resolved the audio code stream of audio-video document, and suspend the video code flow of resolving audio-video document.In the present embodiment, when current code stream is video code flow, compare the residual memory space in video cache district and the size of the video storage threshold value of presetting, at the residual memory space in video cache district during less than default video storage threshold value, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value, at the residual memory space of audio frequency buffer area during more than or equal to default audio storage threshold value, active searching and order are resolved the audio code stream of audio-video document, and suspend the video code flow of resolving audio-video document.Because the shared internal memory of video code flow is usually greater than an internal memory that audio stream is shared, if the video cache district that therefore sets is large not, then this video cache district probably at the audio frequency buffer area less than taking with regard to resolved video code flow out before, to resolve audio-video document shown in Figure 4 as example, suppose that video cache district size is 125KB, default video storage threshold value is 26KB, the size of video code flow 1 is 100KB, before first code stream of resolving audio-video document, namely resolve before the video code flow 1, compare the residual memory space in video cache district and default video storage threshold size, because the residual memory space 125KB in video cache district is greater than video storage threshold value 26KB, therefore resolve video code flow 1, and deposit the video code flow 1 of resolving in the video cache district, at this moment, the residual memory space in video cache district is 25KB, because less than the video storage threshold value, therefore suspending, the residual memory space in video cache district resolves video code flow 1 video code flow 2 afterwards; At the residual memory space of judging the audio frequency buffer area during more than or equal to default audio storage threshold value, the audio code stream that the active searching audio-video document is not resolved, resolve video code flow 2 first audio code stream afterwards, namely directly resolve audio code stream 1, the audio code stream 1 after will resolving again deposits the audio frequency buffer area in.Because the next code stream of audio code stream 1 is video code flow 3, therefore after having resolved audio code stream 1, compare the residual memory space in video cache district and the size of video storage threshold value, judgement is directly to resolve video code flow 3 or continue to suspend this video code flow 3 of parsing.Certainly, if before resolving audio code stream 1, the residual memory space of audio frequency buffer area is not then resolved this audio code stream 1 less than the audio storage threshold value.
Further, at the residual memory space of audio frequency buffer area less than default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, active searching and order are resolved the video code flow of audio-video document, and suspend the audio code stream of resolving audio-video document.To resolve audio-video document shown in Figure 3 as example, suppose that the audio frequency buffer size of setting is 18KB, default audio storage threshold value is 7KB, the size of front 2 audio code streams all is 6KB in this audio-video document, before resolving audio code stream 1, the residual memory space of comparing audio buffer area and the audio storage threshold size of presetting, because the residual memory space 18KB of audio frequency buffer area is greater than default audio storage threshold value 7KB, therefore obtain and resolve audio code stream 1, deposit the audio code stream 1 after resolving in the audio frequency buffer area, at this moment, the residual memory space of audio frequency buffer area becomes 12KB from 18KB.Continue the residual memory space of comparing audio buffer area and default audio frequency buffer memory threshold size, because the residual memory space 12KB of audio frequency buffer area is still greater than default audio storage threshold value 7KB, so audio code stream 2 behind the continuation parsing audio code stream 1, and the audio code stream after will resolving 2 deposits the audio frequency buffer area in, at this moment, the residual memory space of audio frequency buffer area becomes 6KB from 12KB, less than default audio storage threshold value 7KB, therefore after having resolved audio code stream 2, suspend and resolve audio code stream 3; Compare the residual memory space in video cache district and the size of the video storage threshold value of presetting, at the residual memory space in video cache district during more than or equal to default video storage threshold value, active searching is also resolved audio code stream 3 video code flow 1 afterwards, after having resolved this video code flow 1, the residual memory space of comparing audio buffer area and the audio storage threshold size of presetting, judge that whether the residual memory space of audio frequency buffer area is still less than default audio storage threshold value, if the residual memory space of audio frequency buffer area is not less than default audio storage threshold value, be after the part audio code stream of audio frequency buffer area storage has been read out, then return and resolve audio code stream 3, and after the residual memory space of having resolved audio code stream 3 and video cache district is still more than or equal to default video storage threshold value, skip the video code flow 1 of having resolved, directly resolve video code flow 2; If the residual memory space of audio frequency buffer area is still less than default audio storage threshold value, and the residual memory space in video cache district is during still more than or equal to default video storage threshold value, then resolves the video code flow 2 after the video code flow 1.
Further, less than default audio storage threshold value, and the residual memory space in video cache district suspends audio code stream and the video code flow of resolving audio-video document during less than default video storage threshold value at the residual memory space of audio frequency buffer area.
In first embodiment of the invention, after having obtained an audio-video document, according to the residual memory space of the audio frequency buffer area comparative result with default audio storage threshold value, perhaps select whether to resolve the current code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value.Owing to before resolving audio code stream and video code flow, need not to search for this audio code stream and video code flow, therefore greatly reduced the searching times of file, thus audio code stream and video code flow that can this audio-video document of fast resolving.Further, at the residual memory space in video cache district less than default video storage threshold value, and the residual memory space of audio frequency buffer area is during more than or equal to default audio storage threshold value, active searching and order are resolved the audio code stream of audio-video document, and suspend the video code flow of resolving audio-video document.At the residual memory space of audio frequency buffer area less than default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, active searching and order are resolved the video code flow of audio-video document, and suspend the audio code stream of resolving audio-video document.Thereby in the situation that internal memory is limited, also can guarantee the smooth parsing of audio-video document.
Embodiment two:
Fig. 5 shows the structural representation of the efficient audio-video document analyzing device that second embodiment of the invention provides, and for convenience of explanation, only shows the part relevant with the embodiment of the invention.
This efficient audio-video document analyzing device can be used for the various information processing terminals by wired or wireless network connection server, mobile phone for example, pocket computing machine (Pocket Personal Computer, PPC), palm PC, computing machine, notebook computer, personal digital assistant (Personal Digital Assistant, PDA) etc., it can be the software unit that runs in these terminals, the unit that hardware cell or software and hardware combine, also can be used as independently, suspension member is integrated in these terminals or runs in the application system of these terminals, wherein:
File acquisition unit 51 is used for obtaining audio-video document.
Audio-video document resolution unit 52 is used for resolving according to following step audio code stream and the video code flow of this audio-video document:
When the current code stream of audio-video document is audio code stream, the size of the residual memory space of comparing audio buffer area and default audio storage threshold value, and select whether to resolve this audio code stream according to result relatively;
When the current code stream of audio-video document is video code flow, compares the residual memory space in video cache district and the size of the video storage threshold value of presetting, and select whether to resolve this video code flow according to result relatively.
In the present embodiment, a default audio storage threshold value and a video storage threshold value, and according to the residual memory space of audio frequency buffer area and the comparative result of the audio storage threshold value of presetting, perhaps resolve the audio-video document that obtains according to the residual memory space in video cache district with the comparative result of the video storage threshold value of presetting.
Further, this audio-video document resolution unit 52 comprises: audio-video code stream order parsing module 521, audio code stream be parsing module 522 and video code flow active parsing module 523 initiatively.
Audio-video code stream order parsing module 521, be used for residual memory space at the audio frequency buffer area more than or equal to default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, deposits order according to audio code stream and video code flow in the priority of audio-video document and resolves successively this audio code stream and video code flow.
In the present embodiment, when the residual memory space of audio frequency buffer area is enough large, and the residual memory space in video cache district is when enough large, and order is resolved audio code stream and the video code flow of audio-video document.
Audio code stream is parsing module 522 initiatively, be used for residual memory space in the video cache district less than default video storage threshold value, and the residual memory space of audio frequency buffer area is during more than or equal to default audio storage threshold value, active searching and order are resolved the audio code stream of audio-video document, and suspend the video code flow of resolving audio-video document.
In the present embodiment, little when the residual memory space in video cache district, and the residual memory space of audio frequency buffer area suspends the video code flow of resolving audio-video document when enough large, and active searching and order are resolved the audio code stream of audio-video document.
Video code flow is parsing module 523 initiatively, be used for residual memory space at the audio frequency buffer area less than default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, active searching and order are resolved the video code flow of audio-video document, and suspend the audio code stream of resolving audio-video document.
In the present embodiment, little when the residual memory space of audio frequency buffer area, and the residual memory space in video cache district suspends the audio code stream of resolving audio-video document when enough large, and active searching and order are resolved the video code flow of audio-video document.
Further, when the residual memory space in the residual memory space of audio frequency buffer area and video cache district is all large not, suspend audio code stream and the video code flow of resolving audio-video document.
In second embodiment of the invention, audio-video document resolution unit 52 is according to the residual memory space of the audio frequency buffer area comparative result with default audio storage threshold value, the audio-video document that perhaps obtains according to the comparative result resolution file acquiring unit 51 of the residual memory space in video cache district and default video storage threshold value.Owing to before resolving audio code stream and video code flow, need not to search for this audio code stream and video code flow, therefore greatly reduced the searching times of file, thus audio code stream and video code flow that can this audio-video document of fast resolving.
The present invention is after having obtained an audio-video document, according to the residual memory space of the audio frequency buffer area comparative result with default audio storage threshold value, perhaps select whether to resolve the current code stream of audio-video document according to the residual memory space in video cache district and the comparative result of default video storage threshold value.Owing to before resolving audio code stream and video code flow, need not to search for this audio code stream and video code flow, therefore greatly reduced the searching times of file, thus audio code stream and video code flow that can this audio-video document of fast resolving.Further, at the residual memory space in video cache district less than default video storage threshold value, and the residual memory space of audio frequency buffer area is during more than or equal to default audio storage threshold value, active searching and order are resolved the audio code stream of audio-video document, and suspend the video code flow of resolving audio-video document.At the residual memory space of audio frequency buffer area less than default audio storage threshold value, and the residual memory space in video cache district is during more than or equal to default video storage threshold value, active searching and order are resolved the video code flow of audio-video document, and suspend the audio code stream of resolving audio-video document.Thereby in the situation that internal memory is limited, also can guarantee the smooth parsing of audio-video document.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.