A kind of efficient audio-video document analyzing method and device
Technical field
The invention belongs to audio frequency and video field, particularly relate to a kind of efficient audio-video document analyzing method and device.
Background technology
Along with the fast development of the Internet, Internet video is play and is got growing concern for, and the particularly video in mobile device is play online, focus of attention especially.And needed to resolve this audio-video document before playing audio-video document.
In existing audio-video document analytic method, it is followed by have searched for and resolved the video code flow that this audio code stream is corresponding having resolved an audio code stream;Or followed by search for and resolve, resolved a video code flow, the audio code stream that this video code flow is corresponding.When corresponding audio code stream and video code flow be not in adjacent position, the method needs to search for back and forth to resolve the most corresponding audio code stream or video code flow, therefore causes the speed resolving audio-video document slower.
Summary of the invention
Embodiments provide a kind of efficient audio-video document analytic method, it is intended to solve the slow problem that existing audio-video document analytic method exists when resolving audio-video document.
The embodiment of the present invention is achieved in that a kind of efficient audio-video document analytic method, and described method comprises the steps:
Obtain audio-video document;
Audio code stream according to the following step described audio-video document of parsing and video code flow:
When the current code stream of audio-video document is audio code stream, the residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve described audio code stream according to result of the comparison;
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 default video storage threshold value, and choose whether to resolve described video code flow according to result of the comparison.
The another object of the embodiment of the present invention is to provide a kind of efficient audio-video document analyzing device, and described equipment includes:
File obtaining unit, is used for obtaining audio-video document;
Audio-video document resolution unit, for resolving 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 residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve described audio code stream according to result of the comparison;
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 default video storage threshold value, and choose whether to resolve described video code flow according to result of the comparison.
The embodiment of the present invention is after obtaining an audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the current code stream of parsing audio-video document is chosen whether according to the residual memory space in video cache district and the comparative result of the video storage threshold value preset.Due to before resolving audio code stream and video code flow without searching for this audio code stream and video code flow, therefore greatly reduce the searching times of file such that it is able to the audio code stream of this audio-video document of fast resolving and video code flow.
Accompanying drawing explanation
Fig. 1 is the flow chart of the efficient audio-video document analytic method that the present invention provides;
Fig. 2 is the first audio code stream of providing of the present invention and the video code flow scattergram at audio-video document;
Fig. 3 is the second audio code stream of providing of the present invention and the video code flow scattergram at audio-video document;
Fig. 4 is the 4th kind of audio code stream providing of the present invention and the video code flow scattergram at audio-video document;
Fig. 5 is the structural representation of the efficient audio-video document analyzing device that the present invention provides.
Detailed description of the invention
In order to make the 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 present invention is after obtaining an audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the current code stream of parsing audio-video document is chosen whether according to the residual memory space in video cache district and the comparative result of the video storage threshold value preset.
Embodiments provide one: efficient audio-video document analyzing method and device.
Described method includes: obtain audio-video document;
Audio code stream according to the following step described audio-video document of parsing and video code flow:
When the current code stream of audio-video document is audio code stream, the residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve described audio code stream according to result of the comparison;
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 default video storage threshold value, and choose whether to resolve described video code flow according to result of the comparison.
Described device includes: file obtaining unit, is used for obtaining audio-video document;
Audio-video document resolution unit, for resolving 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 residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve described audio code stream according to result of the comparison;
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 default video storage threshold value, and choose whether to resolve described video code flow according to result of the comparison.
The embodiment of the present invention is after obtaining an audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the current code stream of parsing audio-video document is chosen whether according to the residual memory space in video cache district and the comparative result of the video storage threshold value preset.Due to before resolving audio code stream and video code flow without searching for this audio code stream and video code flow, therefore greatly reduce the searching times of file such that it is able to the audio code stream of this audio-video document of fast resolving and video code flow.
In order to technical solutions according to the invention are described, illustrate below by specific embodiment.
Embodiment one:
Fig. 1 shows the flow chart of the efficient audio-video document analytic method that first embodiment of the invention provides, in the present embodiment, preset an audio storage threshold value and a video storage threshold value, after obtaining audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the residual memory space according to video cache district chooses whether to resolve the current code stream of audio-video document with the comparative result of default video storage threshold value, and details are as follows:
In step s 11, audio-video document is obtained.
In the present embodiment, obtain the audio-video document needing to resolve, in the audio-video document obtained, the Store form of audio code stream and video code flow is probably staggered depositing, as shown in Figure 2, it is also possible to deposit video code flow after housing multiple audio code stream continuously again, as shown in Figure 3, it is of course also possible to be house multiple video code flow continuously after deposit audio code stream again, be not construed as limiting herein.
In step s 12, audio code stream and the video code flow of this audio-video document is resolved: when the current code stream of audio-video document is audio code stream according to following step, the residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve this audio code stream according to result of the comparison;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 default video storage threshold value, and choose whether to resolve this video code flow according to result of the comparison.
In the present embodiment, a default audio storage threshold value and a video store threshold value, and default audio storage threshold value is more than 0 and is less than or equal to the memory space in audio buffer district, and default video storage threshold value is more than 0 and is less than or equal to the memory space in video cache district.
The audio-video document obtained is resolved, first judge that the current code stream that audio-video document pointer points to is audio code stream or video code flow according to code stream tagged word, if audio code stream, the then residual memory space of comparing audio buffer area and the audio storage threshold size preset, and choose whether to resolve this audio code stream with the comparative result of the audio storage threshold value preset according to the residual memory space in audio buffer district;If video code flow, the then residual memory space comparing video cache district and the video storage threshold size preset, and choose whether to resolve this video code flow with the comparative result of the video storage threshold value preset according to the residual memory space in video cache district.After resolving audio code stream and video code flow, the audio code stream of parsing is stored in audio buffer district, the video code flow of parsing is stored in video cache district.In embodiments of the present invention, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the residual memory space according to video cache district chooses whether to resolve present video code stream and the current video code stream of audio-video document with the comparative result of default video storage threshold value, due to before resolving the audio code stream of audio-video document or video code flow without searching for this audio code stream or without searching for this video code flow, therefore the number of times of search file is decreased, it is thus possible to the audio code stream of this audio-video document of fast resolving and video code flow.
Further, residual memory space in audio buffer district is more than or equal to the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to the video storage threshold value preset time, deposit order according to audio code stream and video code flow in the priority of audio-video document and resolve this audio code stream and video code flow successively.As a example by the audio-video document of analysis diagram 3 successively, when resolving this audio-video document, first judge that first code stream of the audio-video document represented by Fig. 3 is audio code stream or video code flow according to the tagged word of code stream, after first code stream judging the audio-video document represented by Fig. 3 is audio code stream 1, the residual memory space of comparing audio buffer area and the size of default audio storage threshold value again, if the residual memory space in audio buffer district is more than the audio storage threshold value preset, then resolve this audio code stream 1, after audio code stream 1 parsing terminates, this audio code stream 1 is stored in audio buffer district;Continue to judge that the 2nd code stream of audio-video document is audio code stream or video code flow according to code stream tagged word, after the residual memory space that the 2nd code stream judging audio-video document is audio code stream 2 and audio buffer district is more than the audio storage threshold value preset, resolve the audio code stream 2 after this audio code stream 1, and the audio code stream 2 after resolving is stored in audio buffer district;Resolve step and parsing audio code stream 1 and audio code stream 2 similar of audio code stream 3;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, the relatively residual memory space in video cache district and the video preset stores the size of threshold value, when residual memory space in video cache district is more than the video storage threshold value preset, resolve this video code flow 1, and the video code flow 1 after resolving is stored in video cache district;According to analytic method above, order resolves other code streams of audio-video document, and the audio code stream after resolving is stored in audio buffer district, and the video code flow after resolving is stored in video cache district.In the present embodiment, resolve in the deposit position order of audio-video document according to audio code stream and video code flow, therefore, it is possible to effective less audio code stream or the searching times of video code flow such that it is able to fast resolving goes out this audio-video document.Further, the audio code stream after resolving leaves default audio buffer district in, and the video code flow after resolving leaves default video cache district in, in order to follow-up play resolve after audio code stream or to play the video code flow after resolving the most smooth.
Further, residual memory space in video cache district is less than the video storage threshold value preset, and the residual memory space in audio buffer district more than or equal to preset audio storage threshold value time, actively search order resolve the audio code stream of audio-video document, and suspend the video code flow resolving audio-video document.In the present embodiment, when current code stream is video code flow, the relatively residual memory space in video cache district and the video preset stores the size of threshold value, when residual memory space in video cache district is less than the video storage threshold value preset, the residual memory space of comparing audio buffer area and the size of default audio storage threshold value, when residual memory space in audio buffer district is more than or equal to the audio storage threshold value preset, actively search order resolve the audio code stream of audio-video document, and suspend the video code flow resolving audio-video document.nullInternal memory shared by a video code flow is typically larger than the internal memory shared by an audio stream,If the video cache district therefore set is the biggest,Then this video cache district is likely to take less than the most resolved video code flow out before in audio buffer district,As a example by the audio-video document shown in analysis diagram 4,Assume that video cache district size is 125KB,The video storage threshold value preset is 26KB,The size of video code flow 1 is 100KB,Before resolving first code stream of audio-video document,Before i.e. resolving video code flow 1,The relatively residual memory space in video cache district and the video storage threshold size preset,Owing to the residual memory space 125KB in video cache district stores threshold value 26KB more than video,Therefore video code flow 1 is resolved,And the video code flow 1 of parsing is stored in video cache district,Now,The residual memory space in video cache district is 25KB,Owing to the residual memory space in video cache district stores threshold value less than video,Therefore the video code flow 2 resolved after video code flow 1 is suspended;When the residual memory space judging audio buffer district is more than or equal to the audio storage threshold value preset, actively search for the audio code stream that audio-video document does not resolves, resolve first audio code stream after video code flow 2, the most directly resolve audio code stream 1, then will resolve after audio code stream 1 be stored in audio buffer district.Owing to the next code stream of audio code stream 1 is video code flow 3, therefore after having resolved audio code stream 1, the relatively residual memory space in video cache district and video stores the size of threshold value, it is judged that be directly to resolve video code flow 3 to be also to continue with suspending resolving this video code flow 3.Certainly, if before resolving audio code stream 1, the residual memory space in audio buffer district less than audio storage threshold value, does not the most resolve this audio code stream 1.
Further, residual memory space in audio buffer district is less than the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to preset video storage threshold value time, actively search order resolve the video code flow of audio-video document, and suspend the audio code stream resolving audio-video document.As a example by the audio-video document shown in analysis diagram 3, assume that the audio buffer district size that sets is as 18KB, the audio storage threshold value preset is 7KB, in this audio-video document, the size of front 2 audio code streams is all 6KB, before resolving audio code stream 1, the residual memory space of comparing audio buffer area and the audio storage threshold size preset, owing to the residual memory space 18KB in audio buffer district is more than audio storage threshold value 7KB preset, therefore obtain and resolve audio code stream 1, audio code stream 1 after resolving is stored in audio buffer district, now, the residual memory space in audio buffer district becomes 12KB from 18KB.Continue the residual memory space of comparing audio buffer area and the audio buffer threshold size preset, owing to the residual memory space 12KB in audio buffer district is still greater than default audio storage threshold value 7KB, therefore the audio code stream 2 after resolving audio code stream 1 is continued, and the audio code stream 2 after resolving is stored in audio buffer district, now, the residual memory space in audio buffer district becomes 6KB from 12KB, less than audio storage threshold value 7KB preset, therefore, after having resolved audio code stream 2, suspend and resolve audio code stream 3;nullThe relatively residual memory space in video cache district and the video preset stores the size of threshold value,When residual memory space in video cache district is more than or equal to the video storage threshold value preset,Actively search for and resolve the video code flow 1 after audio code stream 3,After having resolved this video code flow 1,The residual memory space of comparing audio buffer area and the audio storage threshold size preset,Judge that whether the residual memory space in audio buffer district is still less than default audio storage threshold value,If the residual memory space in audio buffer district is not less than the audio storage threshold value preset,After i.e. the part audio code stream of audio buffer district storage is read out,Then return and resolve audio code stream 3,And resolved the residual memory space in audio code stream 3 and video cache district still greater than or equal to the video storage threshold value preset after,Skip the video code flow 1 resolved,Directly resolve video code flow 2;If the residual memory space in audio buffer district is still less than default audio storage threshold value, and the residual memory space in video cache district still greater than or during equal to the video storage threshold value preset, then resolve the video code flow 2 after video code flow 1.
Further, the residual memory space in audio buffer district is less than the audio storage threshold value preset, and when the residual memory space in video cache district stores threshold value less than the video preset, suspends audio code stream and the video code flow resolving audio-video document.
In the first embodiment of the invention, after obtaining an audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the current code stream of parsing audio-video document is chosen whether according to the residual memory space in video cache district and the comparative result of the video storage threshold value preset.Due to before resolving audio code stream and video code flow without searching for this audio code stream and video code flow, therefore greatly reduce the searching times of file such that it is able to the audio code stream of this audio-video document of fast resolving and video code flow.Further, residual memory space in video cache district is less than the video storage threshold value preset, and the residual memory space in audio buffer district more than or equal to preset audio storage threshold value time, actively search order resolve the audio code stream of audio-video document, and suspend the video code flow resolving audio-video document.Residual memory space in audio buffer district is less than the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to preset video storage threshold value time, actively search order resolve the video code flow of audio-video document, and suspend the audio code stream resolving audio-video document.Thus in the case of limited memory, it is also possible to ensure 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 description, illustrate only the part relevant to the embodiment of the present invention.
This efficient audio-video document analyzing device may be used for by the wired or various information processing terminals of wireless network Connection Service device, such as mobile phone, pocket computer (PocketPersonalComputer, PPC), palm PC, computer, notebook computer, personal digital assistant (PersonalDigitalAssistant, PDA) etc., the software unit in these terminals can be operate in, the unit that hardware cell or software and hardware combine, can also be integrated in these terminals as independent suspension member or run in the application system of these terminals, wherein:
File obtaining unit 51, is used for obtaining audio-video document.
Audio-video document resolution unit 52, for resolving 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 residual memory space of comparing audio buffer area and the size of default audio storage threshold value, and choose whether to resolve this audio code stream according to result of the comparison;
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 default video storage threshold value, and choose whether to resolve this video code flow according to result of the comparison.
In the present embodiment, preset an audio storage threshold value and a video storage threshold value, and according to the comparative result of the residual memory space in audio buffer district with the audio storage threshold value preset, or resolve, with the comparative result of the video storage threshold value preset, the audio-video document obtained according to the residual memory space in video cache district.
Further, this audio-video document resolution unit 52 includes: audio-video code stream order parsing module 521, audio code stream actively parsing module 522 and video code flow actively parsing module 523.
Audio-video code stream order parsing module 521, for the residual memory space in audio buffer district more than or equal to the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to the video storage threshold value preset time, deposit order according to audio code stream and video code flow in the priority of audio-video document and resolve this audio code stream and video code flow successively.
In the present embodiment, when the residual memory space in audio buffer district is sufficiently large, and when the residual memory space in video cache district is sufficiently large, order resolves audio code stream and the video code flow of audio-video document.
Audio code stream actively parsing module 522, for the residual memory space in video cache district less than the video storage threshold value preset, and the residual memory space in audio buffer district more than or equal to preset audio storage threshold value time, actively search order resolve the audio code stream of audio-video document, and suspend the video code flow resolving audio-video document.
In the present embodiment, when the residual memory space in video cache district is little, and when the residual memory space in audio buffer district is sufficiently large, suspending the video code flow resolving audio-video document, actively search order resolve the audio code stream of audio-video document.
Video code flow actively parsing module 523, for the residual memory space in audio buffer district less than the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to preset video storage threshold value time, actively search order resolve the video code flow of audio-video document, and suspend the audio code stream resolving audio-video document.
In the present embodiment, when the residual memory space in audio buffer district is little, and when the residual memory space in video cache district is sufficiently large, suspending the audio code stream resolving audio-video document, actively search order resolve the video code flow of audio-video document.
Further, when the residual memory space in audio buffer district and the residual memory space in video cache district are the biggest, suspend audio code stream and the video code flow resolving audio-video document.
In second embodiment of the invention, audio-video document resolution unit 52 is according to the comparative result of the residual memory space in audio buffer district with the audio storage threshold value preset, or the audio-video document obtained with the comparative result resolution file acquiring unit 51 of the video storage threshold value preset according to the residual memory space in video cache district.Due to before resolving audio code stream and video code flow without searching for this audio code stream and video code flow, therefore greatly reduce the searching times of file such that it is able to the audio code stream of this audio-video document of fast resolving and video code flow.
The present invention is after obtaining an audio-video document, residual memory space according to audio buffer district and the comparative result of default audio storage threshold value, or the current code stream of parsing audio-video document is chosen whether according to the residual memory space in video cache district and the comparative result of the video storage threshold value preset.Due to before resolving audio code stream and video code flow without searching for this audio code stream and video code flow, therefore greatly reduce the searching times of file such that it is able to the audio code stream of this audio-video document of fast resolving and video code flow.Further, residual memory space in video cache district is less than the video storage threshold value preset, and the residual memory space in audio buffer district more than or equal to preset audio storage threshold value time, actively search order resolve the audio code stream of audio-video document, and suspend the video code flow resolving audio-video document.Residual memory space in audio buffer district is less than the audio storage threshold value preset, and the residual memory space in video cache district more than or equal to preset video storage threshold value time, actively search order resolve the video code flow of audio-video document, and suspend the audio code stream resolving audio-video document.Thus in the case of limited memory, it is also possible to ensure the smooth parsing of audio-video document.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all any amendment, equivalent and improvement etc. made within the spirit and principles in the present invention, should be included within the scope of the present invention.