JP2006254298A - Device and method for moving picture reproduction - Google Patents
Device and method for moving picture reproduction Download PDFInfo
- Publication number
- JP2006254298A JP2006254298A JP2005070884A JP2005070884A JP2006254298A JP 2006254298 A JP2006254298 A JP 2006254298A JP 2005070884 A JP2005070884 A JP 2005070884A JP 2005070884 A JP2005070884 A JP 2005070884A JP 2006254298 A JP2006254298 A JP 2006254298A
- Authority
- JP
- Japan
- Prior art keywords
- time
- stc
- difference value
- pts
- reproduction
- 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
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
Description
本発明は、デジタルBS放送、デジタルCS放送や地上波デジタル放送で送られるMPEG2−TSのストリームを再生する際に、ビデオとオーディオとを同期再生させるのに用いて好適な動画再生装置及び動画再生方法に関するもので、特に、MPEG2−TSのストリームやPCRの連続性が途切れたような場合のビデオ再生における対処に係わる。 INDUSTRIAL APPLICABILITY The present invention provides a moving picture playback apparatus and moving picture playback suitable for playing back video and audio synchronously when playing back an MPEG2-TS stream sent by digital BS broadcasting, digital CS broadcasting, or terrestrial digital broadcasting. The present invention relates to a method, and particularly relates to a countermeasure in video reproduction when the MPEG2-TS stream or PCR continuity is interrupted.
日本のデジタル放送は、ARIB(Association of Radio Industrial and Businesses)の規格に基づいて行われている。このARIBの規格は、ヨーロッパのDVB(Digital Video Broadcasting)方式の規格を基に作成されたもので、MPEG(Moving Picture Coding Experts Group)2−TS(Transport Stream)のシステムで、映像及び音声を放送するものである。 Japanese digital broadcasting is based on ARIB (Association of Radio Industrial and Businesses) standards. This ARIB standard was created on the basis of the European DVB (Digital Video Broadcasting) standard, and broadcasts video and audio on a MPEG (Moving Picture Coding Experts Group) 2-TS (Transport Stream) system. To do.
MPEG2−TSでは、188バイトの固定長のTSパケットが複数個集まって、TSストリームが構成される。この188バイトのTSパケットの長さは、ATM(Asynchronous Transfer Mode)セル長との整合性を考慮して決定されている。 In MPEG2-TS, a plurality of 188-byte fixed-length TS packets are collected to form a TS stream. The length of the 188-byte TS packet is determined in consideration of consistency with the ATM (Asynchronous Transfer Mode) cell length.
TSパケットは、4バイトの固定長のパケットヘッダと、可変長のアダプテーションフィールド及びペイロードで構成される。パケットヘッダには、PID(パケット識別子)や各種のフラグが定義されている。このPIDにより、TSパケットの種類が識別される。 The TS packet includes a 4-byte fixed-length packet header, a variable-length adaptation field, and a payload. In the packet header, PID (packet identifier) and various flags are defined. The type of TS packet is identified by this PID.
ビデオやオーディオなどの個別ストリームが収められたPES(Packetized Elementary Stream)パケットは、同じPID番号を持つ複数のTSパケットに分割されて伝送される。ビデオの符号化には、例えばMPEG2方式や1セグメント放送規格におけるMPEG4−AVC/H.264方式が用いられる。オーディオの符号化は、例えば、AAC(MPEG2 Advanced Audio Coding)方式が用いられている。 A PES (Packetized Elementary Stream) packet containing individual streams such as video and audio is divided into a plurality of TS packets having the same PID number and transmitted. For encoding video, for example, MPEG4-AVC / H. The H.264 system is used. For example, AAC (MPEG2 Advanced Audio Coding) is used for audio encoding.
また、字幕などのデータが納められたPESパケットも、ビデオやオーディオのパケットと同様に、複数のTSパケットに分割されて伝送される。 Also, the PES packet in which data such as captions is stored is divided into a plurality of TS packets and transmitted, like the video and audio packets.
このようなMPEG2−TSでは、STC(System Time Clock)の時間を合わすために、所定時間毎に、PCR(Program Clock Reference)が送られる。 In such MPEG2-TS, a PCR (Program Clock Reference) is sent every predetermined time in order to set the time of STC (System Time Clock).
すなわち、TSパケットには、アダプテーションフィールドが含まれているものがある。アダプテーションフィールドは、個別ストリームに関する付加情報を伝送するためのもので、ここには、オプショナルフィールドに、6バイトのPCRが配される。 That is, some TS packets include an adaptation field. The adaptation field is used to transmit additional information related to the individual stream. Here, a 6-byte PCR is arranged in the optional field.
受信機側では、システムクロックであるSTC(System Time Clock)は、STCカウンタでカウントされる。このSTCカウンタの時刻は、PCRの時刻に基づいて校正される。 On the receiver side, an STC (System Time Clock) that is a system clock is counted by an STC counter. The time of this STC counter is calibrated based on the PCR time.
MPEG2−TSでは、AV(オーディオ・ビデオ)同期をとるために、アクセスユニット毎(例えば、ビデオの場合にはピクチャ毎、オーディオの場合にはオーディオフレーム毎)にタイムスタンプが付加される。これらのアクセスユニットがPES化され、このPESパケットのヘッダに、再生時刻を指定するPTS(Presentation Time Stamp)が付加される。 In MPEG2-TS, in order to achieve AV (audio / video) synchronization, a time stamp is added to each access unit (for example, for each picture in the case of video and for each audio frame in the case of audio). These access units are converted to PES, and a PTS (Presentation Time Stamp) for specifying a reproduction time is added to the header of the PES packet.
このPTSの時刻は、STCの値で記述される。受信機側では、STCの値は、送信側からのPCRと同期して進められる。このSTCのカウント値とPTSの値とが比較され、STCのカウント値とPTSの値とが一致したら、表示処理やデコード処理が開始される。これにより、STCとの同期再生が行われる。 The time of this PTS is described by the value of STC. On the receiver side, the STC value is advanced in synchronization with the PCR from the transmitting side. The STC count value and the PTS value are compared, and if the STC count value and the PTS value match, display processing and decoding processing are started. Thereby, synchronous reproduction with STC is performed.
このように、MPEG2−TSでは、PCRに同期して進められるSTCのカウント値と、ビデオ及びオーディオのPESパケットに付加されて送られてくるPTSの値とを比較し、ビデオ、オーディオそれぞれがSTCのカウント値とPTSの値が一致するタイミングで表示処理やデコード処理を開始することにより、AV同期再生を実現している。 As described above, in MPEG2-TS, the STC count value advanced in synchronization with the PCR is compared with the PTS value added and transmitted to the video and audio PES packets. AV synchronized playback is realized by starting display processing and decoding processing at the timing when the count value of PTS matches the value of PTS.
送信側より、符号化・多重化したTSを送信し、受信側でこれを復号再生処理する際、TSが連続して伝送される場合には問題はないが、不連続が起こった場合や、PCRが不連続な場合は、TSパケットの不連続の検出、またはPCRの不連続検出を行い、前記検出のあったときはSTCの値を校正し、それ以降は校正後のSTCを用いて処理を行うことで対応していた。 There is no problem when the TS is continuously transmitted when the encoded side and the multiplexed TS are transmitted from the transmission side, and this is decoded and reproduced on the reception side. When PCR is discontinuous, TS packet discontinuity detection or PCR discontinuity detection is performed. When the detection is detected, the STC value is calibrated, and thereafter, processing is performed using the calibrated STC. It corresponded by doing.
しかし、校正したSTCを用いて直ちに表示やデコードを開始する、すなわち直ぐにデコーダのSTCとして使用すると、バッファに一時蓄積したデータの中に、校正する前のSTCを用いるべきデータと、校正後のSTCを用いるべきデータとが混在する場合には、校正する前のSTCを用いるべきデータのPTSとSTCが大きく異なるようになる。PTSとSTCが大きく異なると時間が過ぎてもPTSの値とSTCカウンタの値とが一致しないことになり、バッファがオーバーフローを起こし、再生が停止する。 However, if display or decoding is started immediately using the calibrated STC, that is, if it is immediately used as the STC of the decoder, among the data temporarily stored in the buffer, the data that should use the STC before calibration, and the STC after calibration When data that should be used are mixed, the PTS and STC of the data that should use the STC before calibration are greatly different. If the PTS and STC differ greatly, the PTS value does not match the STC counter value even if time passes, and the buffer overflows and playback stops.
これら課題に対し、特許文献1では、PESパケットを蓄えるバッファの容量を監視し、オーバーフローが検出されたら、AV非同期で再生を行うようにしている。ここでAV非同期再生とは、オーディオデータはオーディオの1フレーム周期で、出力処理やデコード開始処理を行い、ビデオデータはあらかじめ決めた固定周期で、出力処理やデコード開始処理を行う方法である。すなわち、バッファのオーバーフローが検出されたら、PTSとSTCを比較し、一致したタイミングで出力処理やデコード開始処理を行うことを止め、ビデオやオーディオの各々の周期でデコード処理、出力処理を行っている。その結果、AV同期はとれなくなるものの、バッファのオーバーフローはなくなり再生不能になるという事態は回避できる。
In order to deal with these problems,
また、AV非同期モードへの遷移条件として、STCとPTSを比較し、差の絶対値が所定の閾値以上になった場合に、AV非同期モードで再生を行うようにする手法(特許文献2)もある。
上記従来技術に示した、不連続が起こった場合やPCRが不連続な場合のAV非同期モード再生は、オーディオデータの場合、フレーム周期で連続して出力されるために、STCとPTSとを、一致させなくても違和感はない。また、ビデオデータの場合も、既存のデジタル放送(BSデジタル放送や地上波デジタル放送)のようにビデオ画像の表示間隔が固定である場合は、AV非同期モード再生時の固定周期をビデオ画像の表示間隔と合わせて、デコード処理や表示処理を行っていけばよい。 Since the AV asynchronous mode reproduction when discontinuity occurs or when PCR is discontinuous as shown in the above prior art is output continuously in a frame period in the case of audio data, STC and PTS are There is no sense of incompatibility even if they are not matched. Also, in the case of video data, when the video image display interval is fixed as in the existing digital broadcasting (BS digital broadcasting or terrestrial digital broadcasting), the video image is displayed at a fixed period during AV asynchronous mode playback. Decoding processing and display processing may be performed in accordance with the interval.
しかしながら、現在放送が予定されている1セグデジタル放送のように、モバイル環境下での利用を目的としているようなビデオデータの場合、転送ビットレートを抑えるため、表示間隔は送信側で動的に変化させることがある。このように動的に表示間隔が変化する場合、上記AV非同期再生モードのように、あらかじめ決めた固定の周期で出力処理、デコード処理を行うと、オーディオデータと大きく同期ずれが発生する結果となり、リップシンクがとれないため再生品位を激しく劣化させる。 However, in the case of video data intended for use in a mobile environment, such as 1-segment digital broadcasting that is currently scheduled to be broadcast, the display interval is dynamically changed on the transmission side in order to suppress the transfer bit rate. May change. When the display interval changes dynamically as described above, if the output process and the decode process are performed at a predetermined fixed period as in the AV asynchronous playback mode, a result of a large synchronization shift with the audio data occurs. Since the lip sync cannot be taken, the playback quality is severely degraded.
本発明は、かかる問題点に鑑みてなされたものであり、MPEG2−TSストリームにおけるTSパケットが不連続、またはPCRが不連続であった場合に、ビデオデータの表示間隔が動的に変化するような状況でも、同期ずれをなくし、送信側の意図に沿った再生を実現する動画再生装置及び動画再生方法を提供することを目的とする。 The present invention has been made in view of such a problem, and when the TS packet in the MPEG2-TS stream is discontinuous or the PCR is discontinuous, the video data display interval dynamically changes. An object of the present invention is to provide a moving image reproducing apparatus and a moving image reproducing method that eliminates synchronization loss and realizes reproduction in accordance with the intention on the transmission side even in a difficult situation.
本発明の動画再生装置は、ビデオデータ、及びオーディオデータと、時間情報とが多重化された伝送データを入力とし、前記時間情報にはシステム基準時刻と再生時刻とを含み、前記再生時刻と前記システム基準時刻とを比較し、前記システム基準時刻が前記再生時刻と一致したら再生する動画再生装置において、前記システム基準時刻と前記再生時刻の差分値を計算し、前記差分値がある閾値以下かどうかを判断し、前記差分値が0になれば再生指示を出力する比較器と、前回出力したフレームの再生時刻と次回出力するフレームの再生時刻の差分から、フレームの表示時間を計算し、表示時間が経過すると再生指示を出力する表示間隔計算器とを備え、前記差分値がある閾値以下の場合には、前記比較器の再生指示により再生を行い、前記差分値がある閾値以上である場合には、前記表示間隔計算器の表示指示をもとに再生を行うことを特徴とするものである。 The moving image reproducing apparatus of the present invention receives transmission data obtained by multiplexing video data, audio data, and time information, and the time information includes a system reference time and a reproduction time, and the reproduction time and the In a video playback device that compares the system reference time with the system reference time and plays back when the system reference time matches the playback time, the difference value between the system reference time and the playback time is calculated, and whether or not the difference value is below a certain threshold value The frame display time is calculated from the comparator that outputs the playback instruction when the difference value becomes 0, and the difference between the playback time of the previously output frame and the playback time of the next output frame, and the display time A display interval calculator that outputs a reproduction instruction when the time elapses, and when the difference value is equal to or smaller than a threshold value, reproduction is performed according to the reproduction instruction of the comparator, If the threshold value or more in the difference value is characterized in that for reproducing based on the display instruction of the display interval calculator.
本発明の動画再生方法は、システム基準時刻と再生時刻の差分値を計算し、前記差分値がある閾値以下かどうかを判断し、前記差分値が0になれば再生指示を出力する比較ステップと、前回出力したフレームの再生時刻と次回出力するフレームの再生時刻の差分から、フレームの表示時間を計算し、表示時間が経過すると再生指示を出力する表示間隔計算ステップとを含み、前記差分値がある閾値以下の場合には、前記比較ステップの再生指示により再生を行い、前記差分値がある閾値以上である場合には、前記表示間隔計算ステップの表示指示をもとに再生を行うことを特徴とするものである。 The moving image reproduction method of the present invention includes a comparison step of calculating a difference value between a system reference time and a reproduction time, determining whether the difference value is equal to or less than a certain threshold value, and outputting a reproduction instruction when the difference value becomes zero; A display interval calculation step of calculating a display time of the frame from a difference between a playback time of the frame output last time and a playback time of the frame to be output next time, and outputting a playback instruction when the display time elapses. If the difference value is equal to or greater than a certain threshold value, reproduction is performed based on the display instruction of the display interval calculation step. It is what.
本発明の動画再生装置及び動画再生方法によると、STCの不連続が発生した場合で、かつビデオデータの表示間隔が動的に変化する場合でも、正確に表示間隔を守りながら表示を継続することができる。 According to the moving image reproducing apparatus and the moving image reproducing method of the present invention, even when STC discontinuity occurs and the display interval of video data changes dynamically, the display is continued while accurately maintaining the display interval. Can do.
本発明の動画再生装置は、伝送データにおけるプログラム基準時刻とシステム基準時刻との差分を計算し、差分値がある閾値以下の場合には、前記システム基準時刻の校正を行い、ある閾値より大きい場合には前記システム基準時刻の校正を行わないことを特徴とするSTC校正制御部と、システム基準時刻、またはシステム基準時刻と前記差分値との加算値と、前記再生時刻とを比較し、前記加算値が前記再生時刻に近似する場合は、前記システム基準時刻の校正指示を出力する同期制御部とを備えたことを特徴とするものである。 The moving picture reproducing apparatus of the present invention calculates the difference between the program reference time and the system reference time in the transmission data, and calibrates the system reference time when the difference value is equal to or smaller than a certain threshold, The system reference time is not calibrated, and the STC calibration control unit compares the reproduction time with the system reference time or an addition value between the system reference time and the difference value, and the addition And a synchronization control unit that outputs a calibration instruction for the system reference time when the value approximates the reproduction time.
本発明の動画再生方法は、伝送データにおけるプログラム基準時刻とシステム基準時刻との差分を計算し、差分値がある閾値以下の場合には、前記システム基準時刻の校正を行い、ある閾値より大きい場合には前記システム基準時刻の校正を行わないSTC校正制御ステップと、システム基準時刻、またはシステム基準時刻と前記差分値との加算値と、再生時刻とを比較し、前記加算値が前記再生時刻に近似する場合は、前記システム基準時刻の校正指示を出力する同期制御ステップとを含むことを特徴とするものである。 The moving image reproduction method of the present invention calculates the difference between the program reference time and the system reference time in the transmission data, and calibrates the system reference time when the difference value is equal to or smaller than a certain threshold value. The STC calibration control step that does not calibrate the system reference time, the system reference time, or the addition value of the system reference time and the difference value, and the reproduction time are compared, and the addition value becomes the reproduction time. The approximation includes a synchronization control step of outputting a calibration instruction for the system reference time.
本発明の動画再生装置及び動画再生方法によると、STCの不連続が発生した場合、STC校正を制御することにより、本来参照すべきSTCカウント値となり、STC同期制御を行うことができる。 According to the moving image reproducing apparatus and the moving image reproducing method of the present invention, when STC discontinuity occurs, by controlling STC calibration, the STC count value to be originally referred to can be obtained, and STC synchronization control can be performed.
本発明の動画再生装置は、伝送データにおけるフレームの再生時刻を取得し、フレーム間の再生時刻の差分値を算出し、前記差分値がある閾値より大きい場合、前記差分値を保持する再生時刻オフセット算出部と、前記再生時刻とシステム基準時刻の差分値がある閾値以下かどうか判断し、差分値が0になれば再生指示を出力し、かつ、前記差分値がある閾値以上である場合、前記システム基準時刻から前記フレーム間の時刻情報の差分値を差し引いて前記再生時刻を比較し、差分値が0になれば再生指示を出力する同期制御部とを備えたことを特徴とするものである。 The moving image playback apparatus of the present invention acquires a playback time of a frame in transmission data, calculates a playback time difference value between frames, and holds the difference value when the difference value is greater than a threshold value. When the difference between the calculation time and the reproduction time and the system reference time is equal to or less than a threshold value, the reproduction instruction is output when the difference value becomes zero, and the difference value is equal to or greater than the threshold value, A synchronization control unit that subtracts a difference value of time information between frames from a system reference time and compares the reproduction times, and outputs a reproduction instruction when the difference value becomes zero. .
本発明の動画再生方法は、伝送データにおけるフレームの再生時刻を取得し、フレーム間の再生時刻の差分値を算出し、前記差分値がある閾値より大きい場合、前記差分値を保持する再生時刻オフセット算出ステップと、前記再生時刻とシステム基準時刻の差分値がある閾値以下かどうか判断し、差分値が0になれば再生指示を出力し、かつ、前記差分値がある閾値以上である場合、前記システム基準時刻から前記フレーム間の時刻情報の差分値を差し引いて前記再生時刻を比較し、差分値が0になれば再生指示を出力する同期制御ステップとを含むことを特徴とするものである。 The moving image reproduction method of the present invention acquires a reproduction time of a frame in transmission data, calculates a difference value of reproduction times between frames, and retains the difference value when the difference value is larger than a certain threshold value. Calculating step, determining whether a difference value between the reproduction time and the system reference time is equal to or less than a threshold value, outputting a reproduction instruction when the difference value becomes 0, and if the difference value is equal to or greater than a certain threshold value, A synchronization control step of subtracting a difference value of time information between the frames from a system reference time to compare the reproduction times, and outputting a reproduction instruction when the difference value becomes zero.
本発明の動画再生装置及び動画再生方法によると、STCの不連続が発生した場合、STCカウント値にPTSオフセット分減算して参照することにより、本来参照すべきSTCカウント値となり、再生状態において画像の乱れが生じないシームレスな再生を行うことができる。 According to the moving image reproducing apparatus and moving image reproducing method of the present invention, when STC discontinuity occurs, the STC count value is subtracted from the STC count value and referenced to obtain the STC count value that should be referred to. Can be seamlessly reproduced without any disturbance.
本発明によれば、画像の表示間隔を算出し、表示間隔をもとに出力制御指示を行うことにより、STCの不連続が発生した場合で、かつビデオデータの表示間隔が動的に変化する場合でも、正確に表示間隔を守りながら表示を継続することが可能になり、再生品位が向上する。 According to the present invention, the display interval of video data is dynamically changed when STC discontinuity occurs by calculating an image display interval and instructing output control based on the display interval. Even in this case, the display can be continued while accurately keeping the display interval, and the reproduction quality is improved.
また、STCカウント値の校正を行い、同期制御を行うことにより、再生状態において画像の乱れが生じないシームレスな再生を行うことができる。 Further, by performing calibration of the STC count value and performing synchronization control, seamless reproduction can be performed with no image disturbance in the reproduction state.
以下、本発明の実施の形態について、図面を参照して詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
(実施の形態1)
本発明の実施の形態1について、図1ないし図6を用いて説明する。
(Embodiment 1)
図1は実施の形態1による動画再生装置の構成を示す図である。 FIG. 1 is a diagram showing a configuration of a moving image playback apparatus according to the first embodiment.
図1において、入力端子100に、MPEG2−TSのストリームが供給される。入力端子100からMPEG2−TSのストリームは、デマルチプレクサ101に供給され、デマルチプレクサ101により、所望のビデオPESパケットとオーディオPESパケットとが分離される。
In FIG. 1, an MPEG2-TS stream is supplied to an
デマルチプレクサ101により分離されたビデオPESパケットは、ビデオバッファ103に供給される。また、デマルチプレクサ101により分離されたオーディオPESパケットは、オーディオバッファ110に供給される。
The video PES packet separated by the
さらに、デマルチプレクサ101により、所定タイミング毎のTSパケットのアダプテーションフィールドにあるPCRの値が抽出される。
Further, the
ここで、図2を用いて、MPEG2−TSストリームのデータ構造を説明する。図2において、200はMPEG2−TSストリームである。MPEG2−TSストリーム200は、188バイト固定長の複数のTSパケット203から構成される。MPEG2−TSパケット203はヘッダ204とペイロード205とからなる。
Here, the data structure of the MPEG2-TS stream will be described with reference to FIG. In FIG. 2,
ヘッダ204はMPEG2−TSパケット203の先頭を示すシンクワード206と、MPEG2−TSパケット203内のデータ識別子であるPID207と、ペイロード205が有効かどうかを示すアダプテーションフィールドコントロール208と、アダプテーションフィールド209と、その他の制御フラグ等(図示せず)から構成される。
The
PCRはMPEG2−TSパケット203のアダプテーションフィールド209に付加され、PMT(プログラムマップテーブル)内から取得したPCR用のPID番号がPID207に付加されている。
The PCR is added to the
MPEG2−TSストリームには、所定時間毎に、PCRが付加される。デマルチプレクサ101は、PID207を取得し、PCRが付加されていることを示すPID番号と一致した場合、アダプテーションフィールド209からPCRを抽出する。抽出されたPCRは、STCカウンタ102に供給される。
PCR is added to the MPEG2-TS stream every predetermined time. The
なお、入力端子100に供給されるMPEG2−TSは、例えば、地上波デジタル放送或いはBSデジタル放送、CSデジタル放送の受信信号を復調して形成される。また、MPEG2−TSのストリームを直接磁気テープやHDD(Hard Disk Drive)に記録再生する記録再生装置が知られている。入力端子100には、このような記録再生装置から再生されたTSストリームが供給される場合もある。
The MPEG2-TS supplied to the
STCカウンタ102は、同期基準カウンタとして動作する。例えば、42ビットのカウンタである。このSTCカウンタ102は、所定時間毎に送られてくるPCRの値を初期値として、例えば27MHzのステップでカウントされる。このSTCカウンタ102の出力は、ビデオ同期制御部109及びオーディオ同期制御部116に供給される。
The
デマルチプレクサ101で分離されたビデオPESパケットは、ビデオバッファ103に一旦蓄積される。このビデオバッファ103に蓄積されたビデオPESパケットは、フレームバッファ105に1フレーム分の空き容量ができたら、すなわち、デコード画像がビデオ出力制御部106から出力されたら、ビデオデコーダ104に供給される。
The video PES packet separated by the
ビデオデコーダ104では、ビデオPESパケット内のPESヘッダから再生時間情報であるPTSと、PESパケットデータからビデオ符号化データを抽出する。
The
ここで、図3を用いて、PESパケットのデータ構造を説明する。PESパケット300は、PESパケットの先頭を示すパケットスタートコードプリフィックス303と、PESパケットデータ307に含まれるストリームを識別するためのストリームID304と、PESパケットの長さを示すPESパケット長305と、PESヘッダ306と、ストリームデータが格納されるPESパケットデータ307とから構成される。
Here, the data structure of the PES packet will be described with reference to FIG. The
さらに、PESヘッダ306には、オプションフィールド308とその他の制御フラグ等(図示せず)から構成される。このオプションフィールド308内には、PESパケットデータ307に含まれるストリームの再生時刻情報であるPTS309が格納されている。
Further, the
ビデオデコーダ104は、PESパケットデータ307内のビデオデータと、PESヘッダ306のオプションフィールド308内のPTS309を抽出する。抽出されたPESパケットデータは、例えば、MPEG4−AVC/H.264方式やMPEG4方式の画像復号化処理が行われ、画像データとしてフレームバッファ105に格納される。抽出されたPTSはビデオPTS情報蓄積部108に格納される。
The
ビデオPTS情報蓄積部108は、ビデオデコーダ104から取得したPTSとフレームバッファ105に格納されている画像データとを対応させながら蓄積を行っている。蓄積されたPTSは画像データが出力されると削除される。さらに、次回出力を行う画像データのPTSをビデオ同期制御部109へ出力する。
The video PTS
ビデオ同期制御部109はSTCとPTSを比較し、画像出力条件を満たした場合、ビデオ出力制御部106に対し出力制御指示を行う。出力制御指示を受けたビデオ出力制御部106は、フレームバッファ105から画像データを取得し、モニタ107へ出力する。
The video
なお、画像出力条件については、後に詳細に説明する。 The image output conditions will be described in detail later.
一方、デマルチプレクサ101で分離されたオーディオPESパケットは、オーディオバッファ110に一旦蓄積される。このオーディオバッファ110に蓄積されたオーディオPESパケットは、PCMバッファ112に1フレーム分の空き容量ができたら、すなわち、デコードPCMデータがオーディオ出力制御113から出力されたら、オーディオデコーダ111に供給される。
On the other hand, the audio PES packet separated by the
オーディオデコーダ111では、まず、オーディオPESパケット内のPESヘッダから再生時間情報であるPTSと、PESパケットデータからオーディオ符号化データを取得する。抽出されたPESパケットデータは、例えば、AAC方式などの復号化処理が行われ、PCMデータとしてPCMバッファ112に格納される。抽出されたPTSはオーディオPTS情報蓄積部115に格納される。
In the
オーディオPTS情報蓄積部115は、オーディオデコーダ111から取得したPTSとPCMバッファ112に格納されているPCMデータとを対応させながら蓄積を行っている。蓄積されたPTSはPCMデータが出力されると削除される。さらに、次回出力を行うPCMデータのPTSをオーディオ同期制御部116へ出力する。
The audio PTS
オーディオ同期制御部116はSTCとPTSを比較し、出力条件を満たした場合、オーディオ出力制御部113に対し出力制御を行う。出力指示を受けたオーディオ出力制御部113は、PCMバッファ112からPCMデータを取得し、スピーカ114へ出力する。
The audio
なお、ここで抽出されているPTSはビデオとオーディオでは異なるものである。 Note that the PTS extracted here is different for video and audio.
次に、本実施の形態1におけるビデオ部のSTC同期制御について、図4、図5、図6を参照して詳細に説明する。 Next, STC synchronization control of the video unit in the first embodiment will be described in detail with reference to FIGS. 4, 5, and 6.
図5は、図1におけるビデオ同期制御部109の構成を示すものである。なお、オーディオ同期制御部116の構成(図示せず)とは異なる。
FIG. 5 shows the configuration of the video
図5において、ビデオ同期制御部109は、STCとPTSの比較処理と比較結果より出力制御指示を出力するSTC/PTS比較器502と、前回表示したフレームのPTSを保持する遅延器503と、次回表示フレームのPTSと前回表示したフレームのPTSを比較し表示間隔を計算し、計算結果を出力する表示間隔計算器504と、表示間隔計算器504からの計算結果を初期値とし、PTSと同じクロック周期でデクリメントを行い、カウント値が0になったタイミングで表示制御指示を行うカウンタ506と、STCとPTSの比較結果からの判断によって、STC/PTS比較器502からの表示制御指示とカウンタ506からの表示制御指示を選択するセレクタ505とから構成されている。
In FIG. 5, the video
STC/PTS比較器502における、STCとPTSの比較処理では、PTSとSTCの差分値の絶対値、すなわち、
|PTS−STC|
を計算し、差分値がある閾値(Threshold)よりも小さい、すなわち、
|PTS−STC|<Threshold
かどうかを判断する。
In the STC / PTS comparison process in the STC /
| PTS-STC |
And the difference value is smaller than a certain threshold (Threshold), that is,
| PTS-STC | <Threshold
Determine whether or not.
上記不等号が正しい場合は、セレクタ505をSTC/PTS比較器502の出力制御指示が選択されるように切り替え制御を行う。さらに、再度STCのカウント値を取得しPTSの比較を、差分値が0になるまで繰り返す。差分値が0になったタイミングで出力制御指示を出力する。
When the above inequality sign is correct, the
上記不等号が誤りである場合、すなわち閾値より大きい場合は、セレクタ505をカウンタ506からの出力制御指示が選択されるように切り替え制御を行う。
When the inequality sign is incorrect, that is, larger than the threshold value, the
次に、ビデオ同期制御部109の動作を、通常動作時とSTCに不連続が発生する場合とに分けて説明する。
Next, the operation of the video
入力端子500からは次回表示するフレームのPTSが入力され、入力端子501からは現在のSTCのカウント値が入力される。ただし、STCのカウント値は入力されるときに、PTSと同じ単位、例えば90kHz単位に変換されているものとする。
The PTS of the frame to be displayed next time is input from the
通常動作時の場合、すなわち、MPEG2−TSストリームが連続、またはPCRが連続の場合は、図4(a)に示すように、STCは連続で変化し、PTSも同様STCに追従して変化する。 In normal operation, that is, when the MPEG2-TS stream is continuous or the PCR is continuous, as shown in FIG. 4A, the STC changes continuously, and the PTS also changes following the STC. .
まず、STC/PTS比較器502はSTCのカウント値とPTSの差分値|PTS−STC|を計算する。差分値が、あるThresholdよりも小さい|PTS−STC|<Threshold場合、STCとPTSが一致するまで、すなわち差分値が0になるまでSTCのカウント値の取得とPTSとの比較を繰り返し、差分値が0になったタイミングで、表示制御指示をセレクタ505へ出力する。このとき、セレクタ505は、|PTS−STC|<Thresholdが成立したため、STC/PTS比較器502の出力制御指示を選択する。すなわちB側を選択している。
First, the STC /
これによりSTC同期制御のビデオ出力制御が可能となる。 Thereby, video output control of STC synchronous control becomes possible.
MPEG2−TSストリームが不連続、またはPCRが不連続の場合、STCはPCRが更新された時点で、図4(b)に示すように、途中で不連続な状態が発生する。しかし、PTSは少し遅れてSTCに追従するため、PTSとSTCとが大きく離れている区間、AB区間(図4(b)ではPTSはSTCに対して遅れている)が発生する。このAB区間では、STC/PTS比較器502で計算する差分値|PTS−STC|がThresholdよりも大きい、すなわち、
|PTS−STC|>Threshold
であり、制御不能と判断し、セレクタ505をカウンタ506の出力制御指示に切り替える。すなわちA側を選択する。
When the MPEG2-TS stream is discontinuous or the PCR is discontinuous, the STC has a discontinuous state on the way as shown in FIG. 4B when the PCR is updated. However, since the PTS follows the STC with a slight delay, a section where the PTS and the STC are largely separated, an AB section (PTS is delayed with respect to the STC in FIG. 4B) occurs. In this AB section, the difference value | PTS−STC | calculated by the STC /
| PTS-STC | > Threshold
It is determined that control is impossible, and the
一方、表示間隔計算器504は、前回出力したフレームのPTSと次回出力するPTSの差分値、
|PTS(n)−PTS(n−1)|
すなわち前回出力したフレームの表示時間を計算し、結果をカウンタ506へ出力する。カウンタ506はこの表示時間を初期値として、PTSと同じ単位のクロック周期でデクリメントを行い、0になったタイミング、すなわち、前回出力中の画像の表示期間が完了した時点で、次のフレームの出力指示を行う。これにより、STCとPTSが同期していない場合でも、適切な表示間隔でフレームを出力することが可能となる。
On the other hand, the
| PTS (n) -PTS (n-1) |
That is, the display time of the previously output frame is calculated, and the result is output to the
AB区間が終わった次のフレーム、図4(b)のPTS(b+1)では、PTSはSTCに追従し始めたので、差分値|PTS−STC|はThresholdより小さくなる。結果、セレクタ505をB側であるSTC/PTS比較器502に切替え、再びSTC/PTS比較器502からの出力制御指示が行われるようになる。すなわち、STCと同期したで画像出力が行われるようになる。
In the next frame after the AB period, PTS (b + 1) in FIG. 4B, the PTS starts to follow the STC, so the difference value | PTS−STC | becomes smaller than the threshold. As a result, the
ビデオ部のSTC同期制御の処理シーケンスを、図6のフローチャートを参照して説明する。 A processing sequence of STC synchronization control of the video unit will be described with reference to a flowchart of FIG.
まず、ステップ601で次回出力するフレームのPTSをビデオPTS情報蓄積部108から取得する。ステップ602で現在のSTCのカウント値を取得する。ステップ603で取得したPTSとSTCの差分値を計算する。ステップ604でその差分値がある閾値(Threshold)より大きいかどうかを判断する。
First, in
差分値がThresholdより小さい場合、ステップ605へ進み、セレクタ505がPTS/STC比較器502の出力を選択するように設定する。ステップ606で再度現在のSTCのカウント値を取得し、ステップ607でPTSとSTCの差分値を計算する。差分値が0より大きければ、ステップ606へ戻り、差分値が0になれば、PTSとSTCが一致したため、ビデオ出力制御部106へ出力制御指示を行う(ステップ608)。
If the difference value is smaller than Threshold, the process proceeds to step 605 and the
ステップ604で差分値がThresholdより大きい場合、ステップ609へ進み、保存しておいた前回出力を行ったフレームのPTSと次回表示を行うフレームのPTSとの差分、PTS(n)−PTS(n−1)を計算し、表示間隔を算出する。ステップ610では、算出された表示間隔を初期値としてカウンタにセットする。ステップ611では、カウンタはカウント値の1デクリメントを行う。ステップ612でカウンタが0かどうかを判断し、0でない場合はステップ611へ戻る。カウンタが0になった場合、ステップ613で表示指示を行う。 If the difference value is larger than Threshold in step 604, the process proceeds to step 609, where the difference between the saved PTS of the previously output frame and the PTS of the frame to be displayed next time, PTS (n) −PTS (n− 1) is calculated and the display interval is calculated. In step 610, the calculated display interval is set in the counter as an initial value. In step 611, the counter decrements the count value by one. In step 612, it is determined whether or not the counter is 0. If not, the process returns to step 611. When the counter reaches 0, a display instruction is given at step 613.
最後に、表示指示が完了した時点で、ステップ614で表示指示を行った現在のフレームのPTSを、次回の表示間隔算出のために保存する。保存完了後、再度ステップ601へ戻り、次のフレームの表示を行うための処理を行う。 Finally, when the display instruction is completed, the PTS of the current frame for which the display instruction has been issued in step 614 is stored for the next display interval calculation. After the storage is completed, the process returns to step 601 again to perform processing for displaying the next frame.
以上を繰り返すことにより、表示を継続する。 The display is continued by repeating the above.
このように構成された動画再生装置及び動画再生方法によれば、MPEG2−TSストリームが不連続、またはPCRが不連続による、STCの不連続が発生した場合で、かつビデオデータの表示間隔が動的に変化する場合でも、正確に表示間隔を守りながら表示を継続することが可能になり、再生品位が向上する。 According to the moving image playback device and the moving image playback method configured as described above, when the MPEG2-TS stream is discontinuous or when the STC discontinuity occurs due to the discontinuous PCR, the video data display interval is changed. Display can be continued while accurately keeping the display interval even when the display changes, and the reproduction quality is improved.
(実施の形態2)
本発明の実施の形態2について、図7ないし図10を用いて説明する。
(Embodiment 2)
A second embodiment of the present invention will be described with reference to FIGS.
図7は実施の形態2による動画再生装置の構成を示す図である。図7は、図1に示した実施の形態1の動画再生装置の構成において、PCR−STC校正制御部717と、STC校正指示出力を行うビデオ同期制御部709を備えたものである。なお、図1と同一部分には同一符号を付してその説明を省略する。
FIG. 7 is a diagram showing a configuration of a moving image playback apparatus according to the second embodiment. FIG. 7 includes a PCR-STC
同期基準カウンタとして動作するSTCカウンタ102は、所定時間毎に送られてくるPCRの値により、STCのカウント値が校正される。送られてくるPCRが不連続であった場合に、ビデオ同期制御部709で参照するSTCが不連続な状態となり、STC同期制御が不可能となる。
The STC counter 102 operating as a synchronization reference counter calibrates the STC count value based on the PCR value sent every predetermined time. If the sent PCR is discontinuous, the STC referred to by the video
そのため、STC校正のタイミングを制御するPCR−STC校正制御部717、ビデオ同期制御部709を備えることにより、PCRが不連続であった場合でもSTC同期制御を行うことができる。
Therefore, by providing the PCR-STC
次に、PCR−STC校正制御部717、ビデオ同期制御部709について、説明する。
Next, the PCR-STC
PCR−STC校正制御部717は、デマルチプレクサ101から出力されたPCRと現在のSTCとの差分値の絶対値、すなわち、
|PCR−STC|
を計算し保持する。
The PCR-STC
| PCR-STC |
Calculate and hold
また、ビデオ同期制御部709からPCR−STC校正制御部717に対し、STCのカウント値校正指示制御が行われると、STCのカウント値が校正される。
Further, when STC count value calibration instruction control is performed from the video
ビデオ同期制御部709は、STCとPTSとの差分値|STC−PTS|と、PCR−STC差分情報にSTCを加算した値STC+|PCR−STC|とPTSとの差分値|STC+|PCR−STC|−PTS|を比較し、画像出力条件を満たした場合、ビデオ出力制御部106に対し出力指示制御を行う。
The video
PCR−STC校正制御部717の動作を説明する。デマルチプレクサ101により抽出されたPCRと現在のSTCのカウント値との差分値の絶対値、すなわち、
|PCR−STC|
を計算し、差分値が、ある閾値(Threshold)以下、すなわち、
|PCR−STC|≦Threshold
かどうかを判断する。
The operation of the PCR-STC
| PCR-STC |
And the difference value is below a certain threshold (Threshold), that is,
| PCR-STC | ≦ Threshold
Determine whether or not.
上記不等号が正しい場合は、STCのカウント値をPCRの値に校正する。 If the above inequality sign is correct, the STC count value is calibrated to the PCR value.
上記不等号が誤りである場合、すなわち閾値より大きい場合は、STCの校正を行わない。 When the inequality sign is incorrect, that is, when it is larger than the threshold, the STC is not calibrated.
ビデオ同期制御部709の動作を説明する。
The operation of the video
STCとPTSとの差分を計算し、PTS−STC差分値|PTS−STC|を抽出し、前記差分値と、STCにPCR−STC差分値|PCR−STC|を加算した値とPTSとの差分値|STC+|PCR−STC|−PTS|とを比較し、前者が後者以下、すなわち、
|PTS−STC|≦|STC+|PCR−STC|−PTS|
の場合、STCとPTSが一致するまで、すなわち0になるまで待ち、ビデオ出力制御部106に対し出力制御指示を行う。
The difference between STC and PTS is calculated, PTS-STC difference value | PTS-STC | is extracted, and the difference between the difference value and the value obtained by adding PCR-STC difference value | PCR-STC | to STC and PTS Compare the value | STC + | PCR-STC | -PTS |
| PTS-STC | ≦ | STC + | PCR-STC | -PTS |
In this case, the control waits until the STC and the PTS match, that is, 0, and instructs the video
一方、
|PTS−STC|>|STC+|PCR−STC|−PTS|
が成立する場合は、PCR−STC校正制御部717に対し、STC+|PCR−STC|の値をSTCのカウント値に設定する校正指示制御を行う。STCの校正後、STCとPTSが一致するまで待ち、ビデオ出力制御部106に対し出力指示を行う。
on the other hand,
| PTS-STC |> | STC + | PCR-STC | -PTS |
Is established, the calibration instruction control for setting the value of STC + | PCR-STC | to the count value of STC is performed on the PCR-STC
次に、図7におけるPCR−STC校正制御部717、及びビデオ同期制御部709の処理シーケンスを、図8、図9、図10を参照し説明する。
Next, processing sequences of the PCR-STC
図8は、PCR−STC校正制御部717におけるSTC校正制御のフローチャートである。
FIG. 8 is a flowchart of STC calibration control in the PCR-STC
図8において、まず、ステップ801で現在のSTCのカウント値を取得する。 In FIG. 8, first, in step 801, the current STC count value is acquired.
デマルチプレクサ701から供給されたPCRとステップ801で取得したSTCを減算することで、ステップ802で、PCR−STC差分値の絶対値|PCR−STC|を設定する。 By subtracting the PCR supplied from the demultiplexer 701 and the STC acquired in step 801, the absolute value | PCR-STC | of the PCR-STC difference value is set in step 802.
ステップ803で、設定したPCR−STC差分値の絶対値|PCR−STC|が、ある所定の閾値以上か否かを判断する。所定の閾値未満である場合は、ステップ804でSTCをPCRの値に校正し、ステップ805でPCR−STC差分値|PCR−STC|をクリアし、終了する。ステップ803で所定の閾値以上である場合は、PCRの値をSTCに校正せずに、ステップ805でPCR−STC差分値|PCR−STC|をクリアし、終了する。 In step 803, it is determined whether the absolute value | PCR-STC | of the set PCR-STC difference value is equal to or greater than a predetermined threshold value. If it is less than the predetermined threshold value, the STC is calibrated to the PCR value in step 804, the PCR-STC difference value | PCR-STC | is cleared in step 805, and the process ends. If it is greater than or equal to the predetermined threshold value in step 803, the PCR-STC difference value | PCR-STC | is cleared in step 805 without calibrating the PCR value to STC, and the process ends.
図9は、PCR−STC校正制御部717におけるSTC校正指示制御のフローチャートである。
FIG. 9 is a flowchart of STC calibration instruction control in the PCR-STC
図9において、まず、ステップ901で現在のSTCのカウント値を取得する。次にステップ902で、PCR−STC差分値の絶対値|PCR−STC|をSTCのカウント値に加算し、ステップ903でSTCのカウント値の校正を行う。
In FIG. 9, first, in
図10は、ビデオ同期制御部709での処理を示すフローチャートである。
FIG. 10 is a flowchart showing processing in the video
図10において、まずステップ1001で、次に表示するフレームのPTSを取得する。ステップ1002でより現在のSTCのカウンタ値を取得する。ステップ1003でPCR−STC校正制御部717で取得したPCR−STC差分値の絶対値|PCR−STC|を参照する。また、ステップ1002で取得したSTCのカウント値にPCR−STC差分値の絶対値|PCR−STC|を加算する。ここでいうPCR−STC差分値の絶対値|PCR−STC|は、PCR−STC校正制御部717で抽出した値である。
In FIG. 10, first, in step 1001, a PTS of a frame to be displayed next is acquired. In step 1002, the current STC counter value is acquired. In step 1003, the absolute value | PCR-STC | of the PCR-STC difference value acquired by the PCR-STC
ステップ1004では、PTS―STC差分値の絶対値|PTS−STC|と、STCにPCR−STC差分値の絶対値|PCR−STC|を加算した値からPTSを減算した値とを比較する。 In step 1004, the absolute value | PTS-STC | of the PTS-STC difference value is compared with the value obtained by subtracting the PTS from the value obtained by adding the absolute value | PCR-STC | of the PCR-STC difference value to the STC.
ステップ1004で比較した結果が、
|PTS−STC|≦STC+|PCR−STC|−PTS
の場合、ステップ1005で再度、現在のSTCを取得し、ステップ1006で差分値が0になるまで待ち、0になれば一致した為、ステップ1007でビデオ出力制御部106へ出力指示を行う。
The result of the comparison in step 1004 is
| PTS-STC | ≦ STC + | PCR-STC | -PTS
In this case, the current STC is acquired again in step 1005, and the process waits until the difference value becomes 0 in step 1006. If the difference value becomes 0, since it matches, an output instruction is given to the video
ステップ1004で比較した結果が、
|PTS−STC|>STC+|PCR−STC|−PTS
の場合、ステップ1008でPCR−STC校正制御部717に対しSTC校正指示を行う。STC校正後、ステップ1005以降のステップを行う。
The result of the comparison in step 1004 is
| PTS-STC |> STC + | PCR-STC | -PTS
In this case, an STC calibration instruction is issued to the PCR-STC
以上を繰り返すことにより、表示を継続する。 The display is continued by repeating the above.
このように構成された動画再生装置及び動画再生方法によれば、MPEG2−TSストリームが不連続、またはPCRが不連続によるSTC不連続が発生した場合でも、STC校正を制御することにより、本来参照すべきSTCカウント値となり、STC同期制御を行うことができる。 According to the moving image playback apparatus and the moving image playback method configured as described above, even when the MPEG2-TS stream is discontinuous or the STC discontinuity due to the PCR is discontinuous, the STC calibration is controlled, so that the original reference is made. STC count value to be obtained, and STC synchronization control can be performed.
(実施の形態3)
本発明の実施の形態3について、図11ないし図13を用いて説明する。
(Embodiment 3)
A third embodiment of the present invention will be described with reference to FIGS.
図11は実施の形態3による動画再生装置の構成を示す図である。図11は、図1に示した実施の形態1の動画再生装置の構成において、PTSオフセット算出部1117を備えたものである。なお、図1と同一部分には同一符号を付してその説明を省略する。
FIG. 11 is a diagram showing a configuration of a moving image playback apparatus according to the third embodiment. FIG. 11 includes a PTS offset
PTSオフセット算出部1117は、デマルチプレクサ101からビデオバッファ103に送られるビデオデータのPTSをウオッチしていき、変化点を検出し、PTSオフセットを算出する。
The PTS offset
図12は、ビデオデータが再生される時刻を示すPTSの値の相互の関係を、横軸を経過時間、縦軸をPTSとして示したものである。PTSオフセット算出部1117は、PTS309(図3)の値をウオッチしていき、現フレームにおけるPTSと前フレームのPTSの差分値の絶対値、すなわち、
|PTS(r)−PTS(r−1)| (rを現フレーム番号とする)
を計算し、差分値がある閾値(Threshold1)よりも大きい、すなわち、
|PTS(r)−PTS(r−1)|>Threshold1
である場合、変化点とする。
ここで、PTSの保持手段としては、遅延器を用いて実現する。図12では、A点を変化点とする。変化点Aの現フレームのPTSと前フレームのPTSの差分値の絶対値、すなわち、
|PTS(r)−PTS(r−1)|
をPTSオフセットとする。
FIG. 12 shows the relationship between the PTS values indicating the time when video data is reproduced, with the horizontal axis indicating elapsed time and the vertical axis indicating PTS. The PTS offset
| PTS (r) −PTS (r−1) | (where r is the current frame number)
And the difference value is greater than a certain threshold (Threshold1), ie
| PTS (r) -PTS (r-1) |> Threshold1
If this is the case, the change point.
Here, the holding means of the PTS is realized using a delay device. In FIG. 12, point A is the change point. The absolute value of the difference between the PTS of the current frame and the PTS of the previous frame at the change point A, that is,
| PTS (r) -PTS (r-1) |
Is a PTS offset.
ビデオ同期制御部109は、STCとPTSの差分値の絶対値、すなわち、
|PTS−STC|
を計算し、差分値がある閾値(Threshold2)よりも小さい、すなわち、
|PTS−STC|<Threshold2
かどうかを判断する。ここで、閾値Threshold1と閾値Threshold2は、同じとする。
The video
| PTS-STC |
And the difference value is less than a certain threshold (Threshold2), ie
| PTS-STC | <Threshold2
Determine whether or not. Here, the threshold Threshold1 and the threshold Threshold2 are the same.
上記不等号が正しい場合は、STCのカウント値を取得しPTSの比較を、差分値が0になるまで繰り返す。差分値が0になったタイミングで表示制御指示を出力する。 If the inequality sign is correct, the STC count value is acquired and the PTS comparison is repeated until the difference value becomes zero. A display control instruction is output at the timing when the difference value becomes zero.
上記不等号が誤りである場合、すなわち閾値より大きい場合は、STCのカウント値とPTSオフセット算出部1117からPTSオフセットを取得し、STCカウント値をPTSオフセットの差分値の絶対値、すなわち、
|STCのカウント値−PTSオフセット|
を算出し、この値とPTSの比較を0になるまで繰り返す。差分値が0になったタイミングで表示制御指示を出力する。
When the inequality sign is incorrect, that is, larger than the threshold, the PTS offset is obtained from the STC count value and the PTS offset
| STC count value−PTS offset |
And the comparison between this value and PTS is repeated until it becomes zero. A display control instruction is output at the timing when the difference value becomes zero.
ビデオ部のSTC同期制御の処理シーケンスを図13のフローチャートを参照して説明する。 A processing sequence of STC synchronization control of the video unit will be described with reference to a flowchart of FIG.
まず、ステップ1301で、デマルチプレクサ101からビデオバッファ103に送られるPTSをウオッチしていき、変化点を検出し、現フレームにおけるPTSと前フレームのPTSの差分値の絶対値、PTSオフセット|PTS(r)−PTS(r−1)|を算出する。ステップ1302で現在のSTCのカウント値を取得する。ステップ1303で取得したPTSとSTCの差分値を計算する。ステップ1304でその差分値がある閾値(Threshold)より大きいかどうかを判断する。
First, in step 1301, the PTS sent from the
差分値がThresholdより小さい場合、ステップ1305へ進み、現在のSTCのカウント値を取得し、ステップ1306でPTSとSTCの差分値を計算する。差分値が0より大きければ、ステップ1305へ戻り、差分値が0になれば、PTSとSTCが一致したため、ビデオ出力制御部106へ出力制御指示を行う(ステップ1307)。 If the difference value is smaller than Threshold, the process proceeds to step 1305 to obtain the current STC count value, and in step 1306, the difference value between the PTS and the STC is calculated. If the difference value is greater than 0, the process returns to step 1305. If the difference value becomes 0, the PTS and STC match, and an output control instruction is issued to the video output control unit 106 (step 1307).
ステップ1304で差分値がThresholdより大きい場合、ステップ1308へ進み、PTSオフセット算出部の算出したPTSオフセットを取得し、STCカウント値をPTSオフセットの差分値とPTSの差分値を計算する(ステップ1309)。ステップ1310で、差分値が0より大きければ、ステップ1309へ戻り、差分値が0になれば、PTSとSTCが一致したため、ビデオ出力制御部106へ出力制御指示を行う(ステップ1307)。 If the difference value is larger than Threshold in step 1304, the process proceeds to step 1308, where the PTS offset calculated by the PTS offset calculation unit is acquired, and the STC count value is calculated as the difference value between the PTS offset and the PTS (step 1309). . If the difference value is larger than 0 in step 1310, the process returns to step 1309. If the difference value becomes 0, the PTS and STC match, and an output control instruction is issued to the video output control unit 106 (step 1307).
このように構成された動画再生装置及び動画再生方法によれば、MPEG2−TSストリームが不連続、またはPCRが不連続によるSTCの不連続が発生した場合で、STCカウント値にPTSオフセット分減算して参照することにより、本来参照すべきSTCカウント値となり、再生状態において画像の乱れが生じないシームレスな再生を行うことができる。 According to the moving image reproducing apparatus and moving image reproducing method configured as described above, when the MPEG2-TS stream is discontinuous or the STC discontinuity occurs due to the PCR discontinuity, the PTS offset is subtracted from the STC count value. Thus, the STC count value that should be originally referred to is obtained, and seamless reproduction can be performed without image distortion in the reproduction state.
本発明にかかる動画再生装置及び動画再生方法は、デジタルBS放送、デジタルCS放送や地上波デジタル放送で送られるMPEG2−TSのストリームを再生する際に有用である。 The moving image reproducing apparatus and the moving image reproducing method according to the present invention are useful when reproducing an MPEG2-TS stream transmitted by digital BS broadcasting, digital CS broadcasting, or terrestrial digital broadcasting.
100,500,501 入力端子
101 デマルチプレクサ
102 STC
103 ビデオバッファ
104 ビデオデコーダ
105 フレームバッファ
106 ビデオ出力制御部
107 モニタ
108 ビデオPTS情報蓄積部
109,709 ビデオ同期制御部
110 オーディオバッファ
111 オーディオデコーダ
112 PCMバッファ
113 オーディオ出力制御部
114 スピーカ
115 オーディオPTS情報蓄積部
116 オーディオ同期制御部
502 STC/PTS比較器
503 遅延器
504 表示間隔計算器
505 セレクタ
506 カウンタ
717 PCR−STC校正制御部
1117 PTSオフセット算出部
100, 500, 501
103
Claims (6)
前記システム基準時刻と前記再生時刻の差分値を計算し、前記差分値がある閾値以下かどうかを判断し、前記差分値が0になれば再生指示を出力する比較器と、
前回出力したフレームの再生時刻と次回出力するフレームの再生時刻の差分から、フレームの表示時間を計算し、表示時間が経過すると再生指示を出力する表示間隔計算器とを備え、
前記差分値がある閾値以下の場合には、前記比較器の再生指示により再生を行い、前記差分値がある閾値以上である場合には、前記表示間隔計算器の表示指示をもとに再生を行うことを特徴とする動画再生装置。 Input transmission data in which video data and audio data and time information are multiplexed, the time information includes a system reference time and a reproduction time, and compares the reproduction time with the system reference time, In the video playback device that plays back when the system reference time matches the playback time,
A comparator that calculates a difference value between the system reference time and the reproduction time, determines whether the difference value is equal to or less than a threshold value, and outputs a reproduction instruction when the difference value becomes 0;
A display interval calculator that calculates the display time of the frame from the difference between the playback time of the frame that was output last time and the playback time of the frame that is output next time, and that outputs a playback instruction when the display time has elapsed,
If the difference value is less than or equal to a threshold value, playback is performed according to the playback instruction of the comparator. If the difference value is greater than or equal to a threshold value, playback is performed based on the display instruction of the display interval calculator. A moving image reproducing apparatus for performing the operation.
システム基準時刻、またはシステム基準時刻と前記差分値との加算値と、前記再生時刻とを比較し、前記加算値が前記再生時刻に近似する場合は、前記システム基準時刻の校正指示を出力する同期制御部とを備えたことを特徴とする動画再生装置。 The difference between the program reference time and the system reference time in the transmission data is calculated, and when the difference value is less than or equal to a threshold value, the system reference time is calibrated, and when the difference value is greater than a certain threshold value, the system reference time is calibrated. An STC calibration control unit characterized by not performing
The system reference time or an addition value between the system reference time and the difference value is compared with the reproduction time, and if the addition value approximates the reproduction time, a synchronization instruction for outputting a calibration instruction for the system reference time is output. A moving image reproducing apparatus comprising: a control unit.
前記再生時刻とシステム基準時刻の差分値がある閾値以下かどうか判断し、差分値が0になれば再生指示を出力し、かつ、前記差分値がある閾値以上である場合、前記システム基準時刻から前記フレーム間の時刻情報の差分値を差し引いて前記再生時刻を比較し、差分値が0になれば再生指示を出力する同期制御部とを備えたことを特徴とする動画再生装置。 Obtaining a reproduction time of a frame in transmission data, calculating a difference value of the reproduction time between frames, and when the difference value is larger than a certain threshold, a reproduction time offset calculating unit that holds the difference value;
It is determined whether or not the difference value between the reproduction time and the system reference time is equal to or less than a certain threshold value. If the difference value becomes 0, a reproduction instruction is output, and if the difference value is equal to or greater than a certain threshold value, A moving picture reproducing apparatus comprising: a synchronization control unit that subtracts a difference value of time information between frames and compares the reproduction times, and outputs a reproduction instruction when the difference value becomes zero.
前回出力したフレームの再生時刻と次回出力するフレームの再生時刻の差分から、フレームの表示時間を計算し、表示時間が経過すると再生指示を出力する表示間隔計算ステップとを含み、
前記差分値がある閾値以下の場合には、前記比較ステップの再生指示により再生を行い、前記差分値がある閾値以上である場合には、前記表示間隔計算ステップの表示指示をもとに再生を行うことを特徴とする動画再生方法。 A comparison step of calculating a difference value between the system reference time and the reproduction time, determining whether the difference value is a certain threshold value or less, and outputting a reproduction instruction when the difference value becomes 0;
A display interval calculation step of calculating the display time of the frame from the difference between the playback time of the frame output last time and the playback time of the frame to be output next time, and outputting a playback instruction when the display time has elapsed,
If the difference value is less than or equal to a threshold value, playback is performed according to the playback instruction of the comparison step. If the difference value is greater than or equal to a threshold value, playback is performed based on the display instruction of the display interval calculation step. A method for reproducing a moving image characterized by comprising:
システム基準時刻、またはシステム基準時刻と前記差分値との加算値と、再生時刻とを比較し、前記加算値が前記再生時刻に近似する場合は、前記システム基準時刻の校正指示を出力する同期制御ステップとを含むことを特徴とする動画再生方法。 The difference between the program reference time and the system reference time in the transmission data is calculated, and when the difference value is less than or equal to a threshold value, the system reference time is calibrated, and when the difference value is greater than a certain threshold value, the system reference time is calibrated. STC calibration control step not performing
Synchronous control that compares a system reference time or an addition value between the system reference time and the difference value with a reproduction time, and outputs a calibration instruction for the system reference time when the addition value approximates the reproduction time A method for reproducing a moving image.
前記再生時刻とシステム基準時刻の差分値がある閾値以下かどうか判断し、差分値が0になれば再生指示を出力し、かつ、前記差分値がある閾値以上である場合、前記システム基準時刻から前記フレーム間の時刻情報の差分値を差し引いて前記再生時刻を比較し、差分値が0になれば再生指示を出力する同期制御ステップとを含むことを特徴とする動画再生方法。 Obtaining a reproduction time of a frame in transmission data, calculating a difference value of the reproduction time between frames, and when the difference value is larger than a certain threshold value, a reproduction time offset calculating step of holding the difference value;
It is determined whether or not the difference value between the reproduction time and the system reference time is equal to or less than a certain threshold value. If the difference value becomes 0, a reproduction instruction is output, and if the difference value is equal to or greater than a certain threshold value, And a synchronization control step of subtracting a difference value of time information between the frames to compare the reproduction times and outputting a reproduction instruction when the difference value becomes zero.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005070884A JP2006254298A (en) | 2005-03-14 | 2005-03-14 | Device and method for moving picture reproduction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005070884A JP2006254298A (en) | 2005-03-14 | 2005-03-14 | Device and method for moving picture reproduction |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006254298A true JP2006254298A (en) | 2006-09-21 |
Family
ID=37094272
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005070884A Pending JP2006254298A (en) | 2005-03-14 | 2005-03-14 | Device and method for moving picture reproduction |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006254298A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008187248A (en) * | 2007-01-26 | 2008-08-14 | Toshiba Corp | Stream reproducing device |
WO2009040955A1 (en) * | 2007-09-28 | 2009-04-02 | Fujitsu Limited | Error judging device and error judging method |
JP2009076979A (en) * | 2007-09-18 | 2009-04-09 | Toshiba Corp | Moving image processor |
JP2010041306A (en) * | 2008-08-04 | 2010-02-18 | Fujitsu Microelectronics Ltd | Synchronous output device and synchronization establishment method |
JP2015233216A (en) * | 2014-06-10 | 2015-12-24 | 三菱電機株式会社 | Data decoder and data decoding method |
CN114339453A (en) * | 2022-01-06 | 2022-04-12 | 北京金山云网络技术有限公司 | Timestamp calibration method and apparatus, electronic device, and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002204404A (en) * | 2000-10-30 | 2002-07-19 | Sony Corp | Synchronizing device and method, digital broadcast receiver |
JP2002290910A (en) * | 2001-03-23 | 2002-10-04 | Toshiba Corp | Multimedia information recording and reproducing device |
JP2003101962A (en) * | 2001-09-26 | 2003-04-04 | Sony Corp | Synchronous reproducing device and method |
JP2004023686A (en) * | 2002-06-20 | 2004-01-22 | Mitsubishi Electric Corp | Mpeg2 decoder |
JP2006211509A (en) * | 2005-01-31 | 2006-08-10 | Nec Corp | Encoding apparatus, stc correction method used therein, encoding system, transmission system, and audio transmission/reception system |
-
2005
- 2005-03-14 JP JP2005070884A patent/JP2006254298A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002204404A (en) * | 2000-10-30 | 2002-07-19 | Sony Corp | Synchronizing device and method, digital broadcast receiver |
JP2002290910A (en) * | 2001-03-23 | 2002-10-04 | Toshiba Corp | Multimedia information recording and reproducing device |
JP2003101962A (en) * | 2001-09-26 | 2003-04-04 | Sony Corp | Synchronous reproducing device and method |
JP2004023686A (en) * | 2002-06-20 | 2004-01-22 | Mitsubishi Electric Corp | Mpeg2 decoder |
JP2006211509A (en) * | 2005-01-31 | 2006-08-10 | Nec Corp | Encoding apparatus, stc correction method used therein, encoding system, transmission system, and audio transmission/reception system |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008187248A (en) * | 2007-01-26 | 2008-08-14 | Toshiba Corp | Stream reproducing device |
JP4682159B2 (en) * | 2007-01-26 | 2011-05-11 | 富士通東芝モバイルコミュニケーションズ株式会社 | Stream playback device |
JP2009076979A (en) * | 2007-09-18 | 2009-04-09 | Toshiba Corp | Moving image processor |
WO2009040955A1 (en) * | 2007-09-28 | 2009-04-02 | Fujitsu Limited | Error judging device and error judging method |
US8290284B2 (en) | 2007-09-28 | 2012-10-16 | Fujitsu Limited | Error determination device and error determination method |
JP5212374B2 (en) * | 2007-09-28 | 2013-06-19 | 富士通株式会社 | Error determination apparatus and error determination method |
JP2010041306A (en) * | 2008-08-04 | 2010-02-18 | Fujitsu Microelectronics Ltd | Synchronous output device and synchronization establishment method |
JP2015233216A (en) * | 2014-06-10 | 2015-12-24 | 三菱電機株式会社 | Data decoder and data decoding method |
CN114339453A (en) * | 2022-01-06 | 2022-04-12 | 北京金山云网络技术有限公司 | Timestamp calibration method and apparatus, electronic device, and storage medium |
CN114339453B (en) * | 2022-01-06 | 2023-11-03 | 北京金山云网络技术有限公司 | Time stamp calibration method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20090116814A1 (en) | Reproducer, portable telephone, and reproducing method | |
US7486874B2 (en) | Image reproduction apparatus | |
US7656947B2 (en) | Synchronization device and synchronization method in digital broadcast receiver | |
JP4352976B2 (en) | Receiving apparatus and receiving method | |
JP2008011404A (en) | Content processing apparatus and method | |
JP2008153908A (en) | Recording apparatus, recording method, reproducing apparatus, and reproducing method | |
US20040264577A1 (en) | Apparatus and method for controlling the synchronization of a video transport stream | |
EP2172012A1 (en) | Broadcast program recording apparatus and control method for the same | |
JP5271544B2 (en) | Digital broadcast receiving apparatus and digital broadcast receiving method | |
JP2006254298A (en) | Device and method for moving picture reproduction | |
US20090046994A1 (en) | Digital television broadcast recording and reproduction apparatus and reproduction method thereof | |
US8447159B2 (en) | Stream recording apparatus | |
US8238446B2 (en) | Method and apparatus for reproducing digital broadcasting | |
US20040233996A1 (en) | Reproducing apparatus and method, and recording medium | |
JP4866135B2 (en) | Image processing apparatus and image processing method | |
JP2003101962A (en) | Synchronous reproducing device and method | |
JP4689231B2 (en) | Transport stream switching device | |
US20130003867A1 (en) | Video display device | |
WO2004086396A1 (en) | Reproducing apparatus and method, and recording medium | |
JP4589355B2 (en) | Stream playback device | |
JPH1093841A (en) | Video synchronizing signal correction device | |
JP2001231035A (en) | Decoding synchronous controller, decoder, and decode synchronization control method | |
JP5244764B2 (en) | Digital broadcast receiving apparatus and program | |
JP2001268518A (en) | Data recording and reproducing device | |
JP5016335B2 (en) | Playback apparatus and playback method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080107 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101126 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110111 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110303 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110719 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20111115 |