CN101729238A - Adaptive code stream synchronizing device and method and set-top box - Google Patents

Adaptive code stream synchronizing device and method and set-top box Download PDF

Info

Publication number
CN101729238A
CN101729238A CN200810217152A CN200810217152A CN101729238A CN 101729238 A CN101729238 A CN 101729238A CN 200810217152 A CN200810217152 A CN 200810217152A CN 200810217152 A CN200810217152 A CN 200810217152A CN 101729238 A CN101729238 A CN 101729238A
Authority
CN
China
Prior art keywords
code stream
pcr
pts
mode
pattern
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN200810217152A
Other languages
Chinese (zh)
Inventor
李长华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Coship Electronics Co Ltd
Original Assignee
Shenzhen Coship Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Coship Electronics Co Ltd filed Critical Shenzhen Coship Electronics Co Ltd
Priority to CN200810217152A priority Critical patent/CN101729238A/en
Publication of CN101729238A publication Critical patent/CN101729238A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention discloses an adaptive code stream synchronizing device and method and a set-top box. The device comprises a demultiplexer, a code stream monitoring module and a synchronous mode conversion module. The demultiplexer is used for processing the code stream. The code stream monitoring module is used for detecting whether the code stream processed by the demultiplexer is abnormal. The synchronous mode conversion module is used for selecting different synchronization strategies for different code streams according to the detection result of the code stream monitoring module and carrying out synchronous mode conversion. The invention can improve the synchronization compatibility of decoding software towards the code streams, so that high quality broadcasting effect can be still obtained when abnormal code streams occur.

Description

A kind of adaptive code stream synchronizing device, method and set-top box
Technical field
The present invention relates to the digital television receiver technology, especially relate to a kind of adaptive code stream synchronizing device, method and set-top box.
Background technology
Along with the universal use of digital television receiver DVB (Digital Video Broadcasting, set-top box), digital television receiver makes things convenient for the user to select to watch the TV programme of liking for the TV programme that the user provides magnanimity.
DVB audio-visual synchronization and time recover: the synchronous core concept of DVB is that head end encoder and terminal decoder are kept same clock work frequency 27M HZ, and under this identical frequency, pass through the time of the act that some key parameters define decoders, to reach the purpose of audio-visual synchronization.
Be exactly specifically, single common system clock is arranged in the encoder, and this clock is carried out the sampling of three kinds of time values, they are respectively encoder clock counter value sampling: PCR (Program Clock Reference, program clock reference); The decode time sampling of encoder regulation: DTS (decoding time-stamp, decoded time stamp); The demonstration time sampling of encoder regulation: PTS (presentation time-stamp shows timestamp).Wherein, PCR is the counter value of 42bits, comprise two parts PCR-Base (33bits is by the 90kHz pulse-triggered of 27MHz pulse behind 300 frequency divisions) and PCR-Ext (9bits is directly triggered by the 27MHz pulse), wherein, the effect of PCR-Base is when decoder switches program, provide initial value, to allow this PCR value reach identical start time most possibly with PTS, DTS to decoder PCR counter.The effect of PCR-ext is by the system clock of the phase-locked loop circuit correction decoder of decoder end, makes it reach the 27MHz consistent with encoder.DTS and PTS are that the counter value of 33bits is used for comparing to determine decoding and the time that shows in the STC value (System TimeClock, system sequence clock) of decoder and PCR correction.
The synchronous working flow process of decoder end mainly comprises: when the PCR of new program arrives decoder, need basic point update time, STC just is set.Usually first PCR that solves from demodulation multiplexer directly is encased in stc counter, thereafter PLL (Phase Locked Loop, phase-locked loop or phase-locked loop) close loop maneuver.When the PCR of a new program arrives decoder, this value is considered to the reference frequency of phase-locked loop, be used for comparing with the currency of STC, the difference e that produces is through being transfused to low pass filter and through amplifying after the pulse-width modulation, export control signal f, be used for controlling the instantaneous frequency of voltage controlled oscillator (VCO, voltagecontrolled oscillator), the frequency of VCO output is in 27MHz left and right sides oscillatory signal, as the system clock of decoder.The 27MHz clock is input in the counter after putting in order through waveform, produces current STC value, and the 90kHz of its 33bits partly is used for comparing the synchronizing signal that produces decoding and show with PTS/DTS.
In the prior art, the disclosed a kind of decode system of the Chinese patent that for example a kind of publication number is CN 1436001A is realized the method for video and audio sync, and this patent is the video in a kind of software decode system that proposes on the synchronization criterion of DVB and the method for audio sync.This technical scheme highlights is that the decoding of software realizes, and the whole mechanism by the software systems maintain synchronization, and purpose is in order to solve the ineffective activity of hardware decoding process, to reduce cost, and has upgradability.It is that software systems are safeguarded local clock STC that the technology of this technical scheme realizes, and according to the time parameter of front end: PCR, PTS, DTS judge synchronously according to following flow process.
If time-delay>local reference clock LCR that Presentation Time Stamp PTS+ is fixing, then this frame signal belongs to leading state, needs to keep a period of time, judges whether this frame signal should be play next time again.
If time-delay<local reference clock LCR that Presentation Time Stamp PTS+ is fixing, then this frame signal belongs to backward state, should abandon this frame signal and remove to continue to accept new signal frame, till pinning.
If the last frame signal of receiving also belongs to backward state, then last frame is play.
Safeguard a threshold values under the superincumbent principle of this technical scheme, when the signal frame that receives occurs nonsynchronous the time, the value of then amplifying threshold values is to maximum, if the signal frame of receiving be synchronous regime then dwindle threshold values gradually, till narrowing down to minimum.
But, above-mentioned prior art focus on the synchronous replacement hardware of software systems synchronously, the scope of application is limited to the discussion to normal stream, and does not do elaboration for code stream synchronous fault-tolerance and compatibility.Under following abnormal conditions, this technical scheme does not propose the concrete approach that solves:
A) head end encoder does not have the sampled value PCR of tranmitting data register
B) the clock sampling value PCR of head end encoder transmission has more PCR mistake, PCR precision mistake or the discontinuous mistake of PCR at interval.
C) there is more mistake in PTS.
In the actual conditions, top unusual code stream is often to occur, and only uses conventional methods, and it is awkward often to seem when running into these unusual code streams, and the relatively poor or clear-cut just broadcast of result of broadcast is not come out.
Summary of the invention
The purpose of this invention is to provide a kind of adaptive code stream synchronizing device, method and set-top box, can improve the synchronous compatibility of decoding software, when unusual code stream make occurring, still can obtain high quality broadcasting effect code stream.
For solving technical problem of the present invention, the present invention discloses a kind of adaptive code stream synchronizing device, comprising: demodulation multiplexer, code stream monitoring modular, synchronous mode modular converter;
Described demodulation multiplexer is used for that code stream is carried out demultiplexing and handles;
Described code stream monitoring modular, whether the code stream that is used to detect after described demodulation multiplexer is handled is unusual;
Described synchronous mode modular converter is used for the testing result according to the code stream monitoring modular, and different code stream abnormal conditions are selected different synchronous modes, the horizontal synchronization mode of going forward side by side conversion.
Preferably, described code stream monitoring modular also is used to collect quantity, PCR mistake number and the PTS mistake number of PCR, when these data of collecting are higher than the threshold value of their correspondences, determines that code stream is unusual.
Preferably, described synchronous mode modular converter also is used for carrying out the synchronous mode conversion according to the priority of PCR synchronous mode>PTS synchronous mode>free running pattern.
For solving technical problem of the present invention, the present invention also discloses a kind of adaptive code stream synchronization method, comprising:
Step 1, the playing programs that the user please look for novelty is created the monitoring task;
Step 2, the monitoring task brings into operation, and whether the code stream monitoring modular receives the code stream that demodulation multiplexer sends by transport layer and detects current code stream unusual;
Step 3, synchronous mode modular converter are selected different synchronous modes according to the testing result of code stream monitoring modular to different code stream abnormal conditions, the horizontal synchronization mode of going forward side by side conversion.
Preferably, described step 2 and step 3 specifically comprise:
Step 21, the monitoring task brings into operation, and code stream that code stream monitoring modular reception transport layer is sent and detection are worked as preamble and whether have been set up success;
Step 31, if do not set up success when preamble, then when the current code stream of preamble pattern incompatibility, the synchronous mode modular converter receives the code stream of transport layer, and different code stream abnormal conditions are selected different synchronization policies, and by the progressive row mode conversion of mode prioritization;
Step 32 is created as merit if work as preamble, the then current establishment stage that is in synchronously, and the code stream monitoring modular is collected current synchronization parameter, and the code stream monitoring modular is collected PCR quantity, the PCR mistake number of transport layer, collects the PTS mistake number of player;
Step 33, according to the synchrodata of collecting, the code stream monitoring modular judges that PCR is whether normal and whether PTS is normal, if abnormal state then select next synchronous mode and do mode switch according to present mode.
Preferably, the synchrodata that described basis is collected, the code stream monitoring modular judges whether normal PCR and PTS whether normal state specifically comprises: described code stream monitoring modular is judged when quantity, PCR mistake number and the PTS mistake number of described PCR are higher than the threshold value of their correspondences, determines that PCR is undesired undesired with PTS.
Preferably, if the abnormal state of described step 33 then select next synchronous mode and do mode switch specifically to comprise according to present mode:
Current is the PCR pattern, and PCR is undesired, and PTS is undesired, and the synchronous mode modular converter is transformed into free running pattern; Or,
Current is the PCR pattern, and PCR is undesired, and PTS is normal, and the synchronous mode modular converter is transformed into the PTS pattern; Or,
Current is the PCR pattern, and PCR is normal, and the synchronous mode modular converter keeps present mode; Or
Current is the PTS pattern, and PCR is normal, and PTS is undesired, and the synchronous mode modular converter is transformed into the PCR pattern; Or,
Current is the PTS pattern, and PCR is undesired, and PTS is undesired, and the synchronous mode modular converter is transformed into free runing pattern; Or,
Current is the PTS pattern, and PTS is normal, and the synchronous mode modular converter keeps present mode constant; Or,
Current is free running pattern, and PCR is normal, and the synchronous mode modular converter is transformed into the PCR pattern; Or current is free running pattern, and PCR is undesired, and PTS is normal, and the synchronous mode modular converter is transformed into the PTS pattern; Or,
Current is free running pattern, and PCR is undesired, and PTS is undesired, and the synchronous mode modular converter keeps present mode constant.
Preferably, the synchronization policy different in the described step 31 to different code stream selection, and specifically comprise by the progressive row mode conversion of mode prioritization: described synchronous mode modular converter carries out the synchronous mode conversion according to the priority of PCR synchronous mode>PTS synchronous mode>free running pattern.
Preferably, whether described detection has been set up successful step and has specifically been comprised when preamble:
The method of synchronization of an acquiescence is set when starting decoder, define a time interval then, the code stream monitoring modular is resumed work and is checked under the synchronous mode of acquiescence whether current decoding and broadcast set up synchronously after starting the time interval of decoder.
Preferably, after described synchronous mode modular converter is finished synchronous mode conversion, upgrade monitoring task run time interval frequency and the monitoring task run time ask when not setting up synchronously every, and commentaries on classics step 2.
For solving technical problem of the present invention, the present invention also discloses a kind of adaptive code stream synchronous motor top box, comprises above-mentioned adaptive code stream synchronizing device.
Compared with prior art, the present invention has following beneficial effect:
Technical scheme of the present invention can improve the synchronous compatibility of decoding software to code stream.By a whole set of monitoring, judge, change the mechanism, select optimal synchronous mode according to the synchronization parameter quality situation of code stream, reach result of broadcast preferably with this.Because what adopt is the mechanism of monitoring in real time, so for the dynamic change of code stream synchronization parameter quality, or the situation of instantaneous state saltus step also has fine adaptability, so can well improve the robustness and the fault-tolerance of product.
Description of drawings
Fig. 1 is a kind of adaptive code stream synchronizing device schematic diagram of a preferred embodiment of the present invention;
Fig. 2 is a kind of adaptive code stream synchronization method schematic flow sheet of a preferred embodiment of the present invention.
Embodiment
The present invention is applicable to the technical field that code stream is synchronous, and following for convenience of description is that the basis is elaborated with the DVB code stream.
For example, a preferred embodiment of the present invention based on major technique be the standard definition of DVB audio video synchronization, the method for a kind of compatible different code streams situation provided by the invention, these code streams may be certain following situations:
1) complete conformance with standard DVB synchronization criterion, all normal standard code stream of PCR, PTS, DTS.
2) do not have PCR PID descriptor in the code stream, or the PCR descriptor is arranged but the unusual code stream that does not have PCRTS to wrap.Common ground is that transport layer can't be obtained any PCR counter value.
3) the PCR counter value in the code stream exists more PCR mistake, PCR precision mistake or the discontinuous mistake of PCR at interval.
4) there is more mistake in the PTS sampled value in the code stream.
For the top various abnormal conditions of stating, the present invention can adopt diverse ways respectively, to reach result of broadcast the best under this kind situation.But, if the present invention just needs two security mechanisms during the multiple situation above existing in network:
(1) the abnormality detection mechanism of code stream;
(2) method of synchronization of code stream is changed the mechanism.
By the process of such detection, selection, conversion, reach the synchronization policy different, to reach the purpose of compatible network, code stream to different code stream selection.After adopting such method, though in the Operation Network some time exist unusual or upgrading after exist certain code stream situation to change, the present invention also can accomplish good adaptation.
The present invention realizes that core comprises two modules: code stream monitoring modular and synchronous mode modular converter.The startup of these two modules all is opportunity when the request playing programs, starts synchronously with decoder and transport layer.
As shown in Figure 1, a kind of adaptive code stream synchronizing device schematic diagram for a preferred embodiment of the present invention, for example can be the adaptive code stream synchronizing device of DVB, be that a kind of adaptive code stream synchronous motor top box comprises this adaptive code stream synchronizing device, this adaptive code stream synchronizing device mainly comprises demodulation multiplexer, code stream monitoring modular, decoder, player, the synchronous mode modular converter.Described demodulation multiplexer for example can be the DEMUX demodulation multiplexer, links to each other with code stream monitoring modular, decoder and synchronous mode modular converter by transport layer, is used for that code stream is carried out demultiplexing and handles.Described code stream monitoring modular also links to each other with player and synchronous mode modular converter, and whether the code stream that is used to detect after described demodulation multiplexer is handled is unusual.Described decoder also links to each other with player and synchronous mode modular converter, and player also links to each other with the synchronous mode modular converter.Described synchronous mode modular converter is used for the testing result according to the code stream monitoring modular, and different code stream abnormal conditions are selected different synchronous modes, the horizontal synchronization mode of going forward side by side conversion.
Respectively the realization of code stream monitoring modular and these two modules of synchronous mode modular converter is done below and elaborated.
(1) code stream monitoring modular
For example, implementation can adopt a software timer, and the monitoring frequency user can oneself set, and the present invention at this tentative normal_monitor_time of being (characterize the synchronous back of setting up and monitor the task run time interval) once.That is to say that after the program normal play, every the normal_monitor_time time second code stream situation is collected, the key message of collection comprises the quantity of PCR (PCRn), PCR mistake number (PCR_ERRORn), PTS mistake number (PTS_ERRORn).The acquisition of these information needs decoding chip to provide support, and these abnormal conditions are to inform by the interruption of decoding chip in the time of mostly.
Below whether the synchronization parameter of code stream is made definition unusually.Be exactly specifically in monitoring time, to threshold value of synchronization parameter definition, when the wrong number of collecting was higher than this threshold value, code stream monitoring modular of the present invention thought that code stream is unusual, otherwise code stream is normal in this respect.These threshold values should be adjustable to the user, can increase the flexibility of software like this.The type of error of stating on this present invention gives defines thresholding successively and is: PCRn_threshold, PCR_ERRORn_threshold, PTS_ERRORn_threshold.Be quantity, PCR mistake number and the PTS mistake number that described code stream monitoring modular also is used to collect PCR, when these data of collecting are higher than the threshold value of their correspondences, determine that code stream is unusual.Whether unusual definition pseudo-code can be expressed as for PCR and PTS so: the Bool PCR_normal=(﹠amp of PCRn>PCRn_threshold); ﹠amp; (PCR_ERRORn<PCR_ERRORn_threshold);
Bool?PTS_normal=PTS_ERRORn<PTS_ERRORn_threshold;
PCR_normal and Bool PTS_normal are exactly the foundation whether the present invention needs to do mode switch.If all normally then do not need to do any conversion,, then also need, make whether needing the decision changed again according to current pattern situation if unusual generation is arranged.
Further, because when the present invention begins to decode, code stream monitoring modular of the present invention just starts synchronously, and at this time Monitoring Data all also is in the state of initial value, therefore need after a while, when code stream monitoring modular of the present invention moves once more, just know the current abnormal conditions of code stream.So, the present invention can also be provided with the method for synchronization of an acquiescence when starting decoder, define a less time interval (Sync_lock_time then, Sync_lock_time<normal_monitor_time) allow the code stream monitoring modular after starting decoder Sync_lock_time (the monitoring task run time interval when not setting up synchronously), horse back is resumed work and is checked under the synchronous mode of acquiescence, whether current decoding and broadcast set up synchronously, whether the present invention is referred to as locked, makes things convenient for the present invention to represent with sync_locked in order to state.If behind Sync_lock_time, sync_locked is flase, be that synchronization mechanism is not normally set up, its reason may be that the synchronization parameter quality when preamble pattern and code stream of the present invention does not match, then the present invention need select another pattern, and enters the next Sync_lock_time cycle.If sync_locked had been ture after code stream monitoring modular of the present invention detected Sync_lock_time, promptly synchronization mechanism is normally set up, and then enters normal normal_monitor_time monitoring periods.In the following description, flase represents undesired, and ture represents normally.
(2) synchronous mode modular converter
The defined three kinds of synchronous modes of the present invention are respectively:
1) PCR synchronous mode: the PCR PID that the DVB terminal is set according to the user from TS stream under this pattern extracts the PCR counter value, and this counter value compared with local clock counter value STC, comparative result produces the PWM control word, through the PLL circuit local clock frequency is revised, correction result just can guarantee that decoder and encoder work under same clock frequency again.When receiving first PCR, directly the PCR value is passed to STC, so just guaranteed that the numeration starting point of front end and DVB terminal is identical.When decoding, DTS and STC are compared, determine decode time; During broadcast, PTS and STC are compared, determine reproduction time.This pattern is applicable to that code stream relatively meets the DVB standard situation of definition synchronously, and his key factor is PCR_normal=true.
2) PTS synchronous mode: under this pattern, the front end clock sampling value PCR that DVB terminal disregards encoder sends is fixed on a frequency with local clock, does not do any correction work, and this frequency is 27M HZ generally speaking.For guaranteeing the synchronous of video and audio frequency, when decoder was received first PTS, the present invention directly gave this PTS assignment the base field of STC.This pts value can be selected the PTS of first audio, also can select the pts value of first video.What the present invention supposed to select is the pts value of audio, when then the present invention gives STC with the PTS assignment, audio just and the local clock numeration mate fully, at this moment needing Synchronization Control is exactly video, reaches the synchronous of Voice ﹠ Video with this scheme.Certainly, it should be noted that in addition here needs regular pts value is composed to STC, to keep wherein one road PTS and STC consistent of audio frequency or video.This mode is mainly used in the situation of PCR_normal=flase and PTS_normal=true.
3) free running pattern: the feature of this pattern is, neglects the effect of PCR and PTS fully, promptly do not use the PCR counter value that extracts from TS, decoding and also do not use the value comparison of DTS and PTS and STC when playing.When ES flows to into decoder, decode at once, send player plays after decoding is finished.This locality fixed-frequency is not all the time done any correction under this pattern, and the decoding of Voice ﹠ Video and play and do not rely on any outside limits only is decided by a deadline in stage.This pattern only is suitable for the very unusual situation of code stream, i.e. PCR_normal=flase and PTS_normal=false.
After the realization of these three kinds of patterns had been arranged, the present invention need be to the priority of a conversion of this three kinds of mode-definitions, and this priority can be:
PCR synchronous mode>PTS synchronous mode>free running pattern.
Under this priority mode, the mode of an acquiescence of definition, generally speaking, the present invention selects the PCR synchronous mode.Certainly, this default mode can dispose, to be used for various debugging purposes.
As shown in Figure 2, be a kind of adaptive code stream synchronization method schematic flow sheet of a preferred embodiment of the present invention, for example can be the adaptive code stream synchronization method of DVB, this adaptive code stream synchronization method mainly comprises as follows.
Step 201, the playing programs that the user please look for novelty is created the monitoring task, for example monitors the timer task.
The TS code stream is input to demodulation multiplexer, DEMUX demodulation multiplexer for example, and the processing by demodulation multiplexer obtains concrete pid stream, by transport layer, is transferred to decoder.
Step 202, the monitoring task brings into operation, and whether the code stream monitoring modular receives the code stream that demodulation multiplexer sends by transport layer and detects current code stream unusual.
Step 202 is specifically as follows: the monitoring task brings into operation, whether the code stream monitoring modular is worked as preamble by the code stream detection that receives transport layer and is set up, be whether decision condition Sync_locked=ture sets up (annotate: the Sync_locked state upgrades Event triggered in the time of need setting up synchronously, typical as interruption).
After the execution of step 202, the synchronous mode modular converter can be selected different synchronous modes according to the testing result of code stream monitoring modular to different code stream abnormal conditions, the horizontal synchronization mode of going forward side by side conversion.Specific as follows described.
Step 203, Sync_locked=ture judges failure, then when the current code stream of preamble pattern incompatibility, the synchronous mode modular converter receives the code stream of transport layer, different code stream (for example DVB code stream) abnormal conditions are selected different synchronization policies, and, transformation result is fed back to decoder and player by the progressive row mode conversion of mode prioritization.After the synchronous mode modular converter is finished the synchronous mode conversion, upgrading the monitoring task run time interval frequency monitoring task run time interval (Sync_lock_time) back when not setting up synchronously moves, and skipping to step 206, the timer task is aroused again forwards step 202 to.
Wherein, the described conversion by the progressive row mode of mode prioritization is specially: described synchronous mode modular converter carries out the synchronous mode conversion according to the priority of PCR synchronous mode>PTS synchronous mode>free running pattern.
Step 204, Sync_locked=ture success, the then current establishment stage that is in synchronously.The code stream monitoring modular is collected current synchronization parameter, and the code stream monitoring modular is collected PCR quantity, the PCR mistake number of transport layer, collects the PTS mistake number of player.
Step 205, according to the synchrodata of collecting, the code stream monitoring modular is judged the state of PCR_normal and PTS_normal, and if abnormal state then select next suitable synchronous mode and do mode switch according to present mode.
Current is the PCR pattern, PCR_normal=false (being that PCR is undesired), and PTS_normal=false (being that PTS is undesired), the synchronous mode modular converter is transformed into free running pattern.
Current is the PCR pattern, PCR_normal=false (being that PCR is undesired), and PTS_normal=true (being that PTS is normal), the synchronous mode modular converter is transformed into the PTS pattern.
Current is the PCR pattern, PCR_normal=ture (being that PCR is normal), and the synchronous mode modular converter keeps present mode.
Current is the PTS pattern, PCR_normal=ture (being that PCR is normal), and PTS_normal=false (being that PTS is undesired), the synchronous mode modular converter is transformed into the PCR pattern.
Current is the PTS pattern, PCR_normal=false (being that PCR is undesired), and PTS_normal=false (being that PTS is undesired), the synchronous mode modular converter is transformed into free running pattern.
Current is the PTS pattern, and PTS_normal=true (being that PTS is normal), synchronous mode modular converter keep present mode constant.
Current is free running pattern, PCR_normal=true (being that PCR is normal), and the synchronous mode modular converter is transformed into the PCR pattern.
Current is free running pattern, PCR_normal=false (being that PCR is undesired), and PTS_normal=true (being that PTS is normal), the synchronous mode modular converter is transformed into the PTS pattern.
Current is free running pattern, PCR_normal=false (being that PCR is undesired), and PTS_normal=false (being that PTS is undesired), synchronous mode modular converter keep present mode constant.
After the synchronous mode modular converter was finished mode switch, upgrading the timer frequency was normal_monitor_time.
Step 206 is waited for the timer operation blanking time of setting, and the timer task is aroused again, forwards step 202 to.
In the above-described embodiments, the definition of some parameters can be as described below.
Variable name The meaning that characterizes
??PCRn The quantity of PCR
??PCR_ERRORn The PCR number of errors
??PTS_ERRORn The PTS number of errors
??Sync_locked Characterize synchronously and whether successfully set up
??PCR_normal Whether characterize PCR normal
??PTS_normal Whether characterize PTS normal
??Sync_lock_time Characterize the monitoring task run time interval when not setting up synchronously
Variable name The meaning that characterizes
??normal_monitor_time Characterize and set up synchronously the back monitoring task run time interval
??PCRn_threshold PCR quantity minimum threshold in stipulated time
??PCR_ERRORn_threshold The PCR mistake is counted minimum threshold in stipulated time
??PTS_ERRORn_threshold The PTS mistake is counted minimum threshold in stipulated time
By above-mentioned description as can be known, technical scheme of the present invention can improve the synchronous compatibility of decoding software (for example DVB decoding software) to code stream.By a whole set of monitoring, judge, change the mechanism, select optimal synchronous mode according to the synchronization parameter quality situation of code stream, reach result of broadcast preferably with this.Because what adopt is the mechanism of monitoring in real time, so for the dynamic change of code stream synchronization parameter quality, or the situation of instantaneous state saltus step also has fine adaptability, so can well improve the robustness and the fault-tolerance of product.

Claims (11)

1. an adaptive code stream synchronizing device is characterized in that, this device comprises: demodulation multiplexer, code stream monitoring modular, synchronous mode modular converter;
Described demodulation multiplexer is used for that code stream is carried out demultiplexing and handles;
Described code stream monitoring modular, whether the code stream that is used to detect after described demodulation multiplexer is handled is unusual;
Described synchronous mode modular converter is used for the testing result according to the code stream monitoring modular, and different code stream abnormal conditions are selected different synchronous modes, the horizontal synchronization mode of going forward side by side conversion.
2. adaptive code stream synchronizing device as claimed in claim 1, it is characterized in that, described code stream monitoring modular also is used to collect quantity, PCR mistake number and the PTS mistake number of PCR, when these data of collecting are higher than the threshold value of their correspondences, determines that code stream is unusual.
3. adaptive code stream synchronizing device as claimed in claim 1 is characterized in that, described synchronous mode modular converter also is used for carrying out the synchronous mode conversion according to the priority of PCR synchronous mode>PTS synchronous mode>free running pattern.
4. an adaptive code stream synchronization method is characterized in that, comprising:
Step 1, the playing programs that the user please look for novelty is created the monitoring task;
Step 2, the monitoring task brings into operation, and whether the code stream monitoring modular receives the code stream that demodulation multiplexer sends by transport layer and detects current code stream unusual;
Step 3, synchronous mode modular converter are selected different synchronous modes according to the testing result of code stream monitoring modular to different code stream abnormal conditions, the horizontal synchronization mode of going forward side by side conversion.
5. adaptive code stream synchronization method as claimed in claim 4 is characterized in that, described step 2 specifically comprises:
Step 21, the monitoring task brings into operation, and code stream that code stream monitoring modular reception transport layer is sent and detection are worked as preamble and whether have been set up success;
Described step 3 specifically comprises:
Step 31, if do not set up success when preamble, then when the current code stream of preamble pattern incompatibility, the synchronous mode modular converter receives the code stream of transport layer, and different code stream abnormal conditions are selected different synchronization policies, and by the progressive row mode conversion of mode prioritization;
Step 32 is created as merit if work as preamble, the then current establishment stage that is in synchronously, and the code stream monitoring modular is collected current synchronization parameter, and the code stream monitoring modular is collected PCR quantity, the PCR mistake number of transport layer, collects the PTS mistake number of player;
Step 33, according to the synchrodata of collecting, the code stream monitoring modular judges that PCR is whether normal and whether PTS is normal, if abnormal state then select next synchronous mode and do mode switch according to present mode.
6. adaptive code stream synchronization method as claimed in claim 5, it is characterized in that, the synchrodata that described basis is collected, the code stream monitoring modular judges whether normal PCR and PTS whether normal state specifically comprises: described code stream monitoring modular is judged when quantity, PCR mistake number and the PTS mistake number of described PCR are higher than the threshold value of their correspondences, determines that PCR is undesired undesired with PTS.
7. as claim 5 or 6 described adaptive code stream synchronization methods, it is characterized in that, if the abnormal state of described step 33 then select next synchronous mode and do mode switch specifically to comprise according to present mode:
If current is the PCR pattern, PCR is undesired, and PTS is undesired, then is transformed into free running pattern; Or,
If current is the PCR pattern, PCR is undesired, and PTS is normal, then is transformed into the PTS pattern; Or,
If current is the PCR pattern, PCR is normal, then keeps present mode; Or
If current is the PTS pattern, PCR is normal, and PTS is undesired, then is transformed into the PCR pattern; Or,
If current is the PTS pattern, PCR is undesired, and PTS is undesired, then is transformed into free running pattern; Or,
If current is the PTS pattern, PTS is normal, then keeps present mode constant; Or,
If current is free running pattern, PCR is normal, then is transformed into the PCR pattern; Or,
If current is free running pattern, PCR is undesired, and PTS is normal, then is transformed into the PTS pattern; Or,
If current is free running pattern, PCR is undesired, and PTS is undesired, then keeps present mode constant.
8. adaptive code stream synchronization method as claimed in claim 5, it is characterized in that, the synchronization policy different in the described step 31 to different code stream selection, and specifically comprise by the progressive row mode conversion of mode prioritization: described synchronous mode modular converter carries out the synchronous mode conversion according to the priority of PCR synchronous mode>PTS synchronous mode>free running pattern.
9. adaptive code stream synchronization method as claimed in claim 5 is characterized in that, whether described detection has set up successful step when preamble specifically comprises:
The method of synchronization of an acquiescence is set when starting decoder, define a time interval then, the code stream monitoring modular is resumed work and is checked under the synchronous mode of acquiescence whether current decoding and broadcast set up synchronously after starting the time interval of decoder.
10. adaptive code stream synchronization method as claimed in claim 5, it is characterized in that, after described synchronous mode modular converter is finished synchronous mode conversion, upgrade monitoring task run time interval frequency monitoring task run time interval when not setting up synchronously, and commentaries on classics step 2.
11. set-top box that comprises each described adaptive code stream synchronizing device of claim 1 to 3.
CN200810217152A 2008-10-31 2008-10-31 Adaptive code stream synchronizing device and method and set-top box Pending CN101729238A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810217152A CN101729238A (en) 2008-10-31 2008-10-31 Adaptive code stream synchronizing device and method and set-top box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810217152A CN101729238A (en) 2008-10-31 2008-10-31 Adaptive code stream synchronizing device and method and set-top box

Publications (1)

Publication Number Publication Date
CN101729238A true CN101729238A (en) 2010-06-09

Family

ID=42449525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810217152A Pending CN101729238A (en) 2008-10-31 2008-10-31 Adaptive code stream synchronizing device and method and set-top box

Country Status (1)

Country Link
CN (1) CN101729238A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1287745A (en) * 1998-11-04 2001-03-14 夏普公司 Digital broadcast receiving system
CN1602066A (en) * 2003-09-25 2005-03-30 株式会社东芝 Information recording medium, information recording method, information reproducing method, information recording apparatus and information reproducing apparatus
CN1941905A (en) * 1996-09-02 2007-04-04 株式会社东芝 Encoding/decoding apparatus and encoding-multiplexing/decoding-demultiplexing apparatus
CN101207764A (en) * 2006-12-18 2008-06-25 株式会社日立制作所 Recording device, recording method and reproducing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1941905A (en) * 1996-09-02 2007-04-04 株式会社东芝 Encoding/decoding apparatus and encoding-multiplexing/decoding-demultiplexing apparatus
CN1287745A (en) * 1998-11-04 2001-03-14 夏普公司 Digital broadcast receiving system
CN1602066A (en) * 2003-09-25 2005-03-30 株式会社东芝 Information recording medium, information recording method, information reproducing method, information recording apparatus and information reproducing apparatus
CN101207764A (en) * 2006-12-18 2008-06-25 株式会社日立制作所 Recording device, recording method and reproducing device

Similar Documents

Publication Publication Date Title
CN101156447B (en) Synchronized audio/video decoding for network devices
JP4852094B2 (en) REPRODUCTION DEVICE, MOBILE PHONE, AND REPRODUCTION METHOD
CN102215429B (en) Recording method for mobile TV
CN102685507B (en) Audio and video synchronization method and system for decoding moving picture experts group-2 (MPEG-2) transport streams
EP1414248B1 (en) Audio/Video decoder
CN107197394A (en) A kind of method of video playback sound intermediate frequency switching
JP3703381B2 (en) CATV emergency broadcast receiver
US7970060B2 (en) Contents generator and method
US7848930B2 (en) Control mechanism for audio rate adjustment
CN101729238A (en) Adaptive code stream synchronizing device and method and set-top box
EP1028535B1 (en) Broadcasting receiver
CN102523487A (en) Breakpoint connection play method for digital televisions
JPH0690439A (en) Data decoder
JP3549454B2 (en) CATV broadcast receiver
CN104205860A (en) Device and method for digital data distribution, device and method for digital data reproduction, synchronized reproduction system, program, and recording medium
JP4366912B2 (en) Decoding device and decoding method
US20040261124A1 (en) Digital television broadcasting receiver
JP4947447B2 (en) Real-time data transmission system
US20120207182A1 (en) Encoding System and Encoding Apparatus
US20110096845A1 (en) Method and system for providing decoupled streams for clock recovery and decoding
KR100355439B1 (en) Method and Apparatus for discriminating a inputted video clock automatically in HDTV video encoder
JPH05205344A (en) Video recording system
JPH09312634A (en) System clock recovery circuit for digital broadcast receiver
US8046623B2 (en) Timing recovery apparatus and method thereof
WO2006129937A1 (en) Method and apparatus for setting rtc time of digital broadcast receiver using time information contained in transport stream

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1144861

Country of ref document: HK

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20100609

REG Reference to a national code

Ref country code: HK

Ref legal event code: WD

Ref document number: 1144861

Country of ref document: HK