JP2004023686A - Mpeg2 decoder - Google Patents

Mpeg2 decoder Download PDF

Info

Publication number
JP2004023686A
JP2004023686A JP2002179417A JP2002179417A JP2004023686A JP 2004023686 A JP2004023686 A JP 2004023686A JP 2002179417 A JP2002179417 A JP 2002179417A JP 2002179417 A JP2002179417 A JP 2002179417A JP 2004023686 A JP2004023686 A JP 2004023686A
Authority
JP
Japan
Prior art keywords
pts
image
data
sound
audio
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.)
Granted
Application number
JP2002179417A
Other languages
Japanese (ja)
Other versions
JP4175038B2 (en
Inventor
Atsushi Sekine
関根 淳
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2002179417A priority Critical patent/JP4175038B2/en
Publication of JP2004023686A publication Critical patent/JP2004023686A/en
Application granted granted Critical
Publication of JP4175038B2 publication Critical patent/JP4175038B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To synchronously output image data and sound data in the intended timing with an encoder even when there are fluctuations in a PTS and an internal STC. <P>SOLUTION: A system decoder separating part 300 separates an encoded stream and PTS information from an input stream. A sound decoding part 301 decodes encoded sound data and an image decoding part 302 decodes encoded image data. A sound delay memory 303 delays the sound decoded data output, and an image delay memory 305 delays the image decoded data output. A PTS comparing part 304 compares phase differences of image/sound PTS. A voice PTS predicting part 306 predicts the PTS of the next frame from the imparted sound PTS, and an image PTS predicting part 307 predicts the PTS of the next frame from the imparted image PTS. A sound phase deviation detecting part 308 compares the sound PTS predictive value with the sound PTS, and an image phase deviation detecting part 309 compares the image PTS predictive value with the image PTS. An image/sound phase deviation detecting part 310 compares the phase deviation quantities of the image and the sound. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
この発明は符号化データを復号し、該データに含まれるPTS(Presentation Time Stamp)情報に基づいてこの復号データを出力する装置に関する。
【0002】
【従来の技術】
国際符号化標準MPEG2に代表される画像、音声の圧縮技術はその高画質性と高い圧縮効率から放送分野への採用が普及しつつある。以下MPEG2の復号の概要を説明する。
MPEG2では画像と音声が別々に符号化される。このため、復号時に両者の同期をとるためにパック単位で付与されるPES(Packetized Elementary Stream)、パケット単位で付与されるPTSという出力指定時刻情報とデコーダ内部で基準時間として持つSTC(System Time Clock)との位相関係を使用する。
(時刻基準参照値PCR(Program Clock Reference)も必要であるが本特許では使用しないので記述しない。)
【0003】
図6はMPEG2による符号化データ(ビットストリーム)のデータ構造例を示す図である。
符号化データの1単位であるパックは、パックに関する情報を格納するパックヘッダ101、画像の符号化データを格納する画像PES(Packetized ElementaryStream)パケット102、音声の符号化データを格納する音声PESパケット103からなる。PESパケットは画像符号化データ(エレメンタリーストリーム)及び音声符号化データ(エレメンタリーストリーム)を可変長でパケット化したものである。画像PESパケット102及び音声PESパケット103はそれぞれPESヘッダ104,105を持ち、これらの中にPTS106,107が格納される。1つのPESパケットは、同じPID(Packet IDentification:13ビットのストリーム識別情報で当該パケットの個別ストリームの属性を表す)番号を持つ複数のTS(Transport Stream)パケット108からなる。TSパケットは188バイトの固定長パケットで、4バイトのTSヘッダ109とペイロード110からなる。
【0004】
PTSは、MPEGシステム復号器内部のSTCがPTSに一致した場合に、当該PESパケットを表示または出力(以下単に出力と称す)するため情報である。PTSの精度は90kHzのクロックで計測した値を33ビットで表す。PTSは符号化器が符号化の際に復号器のために付与する。例えば、STCがT0であり、復号器がPESパケットを受け取った瞬間からt1秒後に復号した画像データを出力し、復号器がPESパケットを受け取った瞬間からt2秒後に復号した音声データを出力させたい場合、画像PTSを「T0+t1」,音声PTSを「T0+t2」とする。実際には符号化器、復号器の内部の符号化、及び復号処理時間を考慮した前記t1、前記t2を符号化器が付与する。
【0005】
図7にPTSを用いた画像・音声の同期システムの基本概念図を示す。
デコーダのシステムデコーダ分離部200では入力ストリームから音声・画像の各符号化ストリームを分離すると同時に、それぞれのPTSを分離する。その後それぞれのストリーム復号時、音声復号部201、画像復号部202において異なる復号遅延が発生する。
PTS比較部204では、それぞれのPTSの差分を算出し、画像・音声どちらの位相に出力を合わせるか判断する。上記判断結果に応じて片方の出力を遅延させて両者を同期させる。この遅延は遅延メモリ203,205において別々に発生した遅延の差分を含めて制御される。
【0006】
音声データ出力・画像データ出力の速度は互いに異なる一定の速度でデータ出力される。
【0007】
【発明が解決しようとする課題】
以上のようにMPEG2復号器において復号した画像・音声データを符号化器が意図したタイミングで出力させるためには、符号化器が付与するPTSと復号器側で再生されるSTCに誤差が無いことが必要である。また放送分野ではMPEG2システムを使用する場合、音声と画像の同期は数msの精度で合っていることが要求される。
しかしながら符号化器の状態や符号化器と復号器との間の伝送路の状態によって映像・音声ストリームに付加されたPTSと復号器内部STCの位相に揺らぎが発生する場合は、そのPTSを用いた出力制御を行うと画像データまたは音声データの出力タイミングが正しいタイミングとならず、画像データ・音声データ位相がずれるために要求精度を満足しない場合が発生する。
【0008】
その場合MPEG2規格構成では符号化器にしたがって動くことを前提としているため各ストリーム単位にPTSが付加され、各復号器はそのPTSにしたがって動作することで画像と音声の位相を一致させることができる。この場合、画像と音声のデータ出力位相を監視してフィードバックするような機構を持っていない。そのため、画像・音声のデータ出力位相がどれだけ揺らいだか検出することができずお互い独立して復号・再生することとなる。
【0009】
この発明は上記のような問題点を解消するためになされたもので、PESパケットに格納されるPTSと内部STCに揺らぎが発生する場合でも、画像・音声データの出力位相ずれを検出し、符号化器が意図したタイミングで画像データ、音声データを同期出力することを実現するMPEG2デコーダを提供することを目的とする。
【0010】
【課題を解決するための手段】
この発明に係るMPEG2デコーダは、出力指定時刻情報(以降PTS情報という)を含み、MPEG2方式で符号化されたデータ(以下、符号化データという)を復号し、前記PTS情報に基づいて復号データを出力するMPEG2デコーダにおいて、
前記PTS情報から次のPTS情報を予測する手段と、前記符号化データを復号する手段と、復号された画像データおよび音声データを出力する手段と、前記復号された画像データの出力タイミングと前記復号された音声データの出力タイミングの位相ずれを検出する手段を備えたものである。
【0011】
また、この発明に係るMPEG2デコーダは、復号したデータの出力タイミングを調整する手段を設け、常に前記位相ずれの値に基づき復号したデータの出力タイミングを調整するものである。
【0012】
また、この発明に係るMPEG2デコーダは、復号したデータの出力タイミングを調整する調整手段と、閾値を保存する手段を設け、前記調整手段は、位相ずれの値が前記閾値を超える場合のみ復号したデータの出力タイミングを調整するようにしたものである。
【0013】
また、この発明に係るMPEG2デコーダは、閾値を外部から入力する手段を設けたものである。
【0014】
また、この発明に係るMPEG2デコーダは、復号したデータの出力タイミングを調整する手段と、位相ずれ検出の監視周期を保存する手段を設け、
前記監視周期で前記位相ずれの値に基づき復号したデータの出力タイミングを調整するようにしたものである。
【0015】
また、この発明に係るMPEG2デコーダは、監視周期を外部から入力する手段を設けたものである。
【0016】
【発明の実施の形態】
実施の形態1.
図1はこの発明の実施の形態1におけるMPEG2デコーダの概略構成図である。
図1において、
300は入力ストリームより符号化ストリーム・PTS・その他必要な情報を分離するシステムテ゛コータ゛分離部である。
301は符号化音声データを復号する音声復号部である。
302は符号化画像データを復号する画像復号部である。
303は音声復号データ出力を遅延させる音声遅延メモリである。
304は画像・音声PTSの位相差を比較するPTS比較部である。
305は画像復号データ出力を遅延させる画像遅延メモリである。
306は与えられた音声PTSより次フレームのPTSを予測する音声PTS予測部である。
307は与えられた画像PTSより次フレームのPTSを予測する画像PTS予測部である。
308は音声PTS予測値と音声PTSを比較する音声位相ずれ検出部である。
309は画像PTS予測値と画像PTSを比較する画像位相ずれ検出部である。
310は画像と音声の位相ずれ量を比較する画像・音声位相ずれ検出部である。311は音声出力を行なうためにリングバッファ構成されたアト゛レス音声出力制御メモリである。
312は画像出力を行なうためにリングバッファ構成されたアト゛レス画像出力制御メモリである。
313は音声復号データを書込むためのデータ書込部である。
314は画像復号データを書込むためのデータ書込部である。
315は音声出力制御メモリに書込まれた音声復号データを実データ出力速度で読み出すためのデータ読出部である。
316は画像出力制御メモリに書込まれた画像復号データを実データ出力速度で読み出すためのデータ読出部である。
【0017】
図1のMPEG2デコーダにおいて、システムテ゛コータ゛分離部300では入力ストリームから音声・画像の各符号化ストリームを分離すると同時に、それぞれのPTSを分離する。その後それぞれのストリーム復号時、音声復号部301、画像復号部302において異なる復号遅延が発生する。
PTS比較部304では、それぞれのPTS差分を算出し、画像・音声どちらの位相に出力位相を合わせるか判断する。上記判断結果に応じて出力を遅延させて両者を同期させる。
この遅延は遅延メモリ303,305において別々に発生した遅延の差分を含めて制御される。
【0018】
このとき前述したように入力された復号データはある一定速度で出力されることよりデータ1bitの出力にかかる時間は画像・音声それぞれ固定となる。
【0019】
図2はこの実施の形態におけるPTS予測の概略図である。図3はこの実施の形態におけるPTS予測動作のフローチャートである。カウントタイミンク゛信号・予測PTS取得タイミンク゛信号は別ユニットにて処理される。下記に動作概要を説明する。
【0020】
まず、PTS予測開始しているかチェックを行ない(ステップS1)、PTS予測開始していない場合、次にPTSを受信したかチェックする。(ステップS2)受信できている場合はシステムテ゛コータ゛分離部400より分離したPTSnはPTS予測部408に設定される。(ステップS3)
【0021】
次に、符号化データを取得完了しているかチェックを行ない(ステップS4)、受信できている場合はシステムテ゛コータ゛分離部400より分離した符号化データnは復号部401に転送される(ステップS5)。
その後復号完了しているかチェックを行ない(ステップS6)、復号完了しているなら復号データnを出力制御メモリにテ゛ータ書込部403が転送する(ステップS7)。転送完了後データ読出部405に読出指示を行なう(ステップS8)。
その後読出し指示を受けたテ゛ータ読出部405によってリンク゛ハ゛ッファである出力制御メモリ404に書込まれた復号テ゛ータはアト゛レスを指定され各復号データ再生時の速度で読出される。
また設定されたPTSnは復号データ読出のたび(ステップS21)に読出速度単位時間ずつPTS加算部にて加算される。(ステップS20)
【0022】
また、ステップs1においてPTS予測開始している場合、次PES上のPTSn+1の情報が受信できたかチェックを行ない(ステップS9)、取得したPTSn+1を位相ずれ検出部409に設定する。(ステップS10)
同様に符号化データn+1を取得完了しているかチェックを行ない(ステップS11)、符号化データを受信できている場合はシステムテ゛コータ゛分離部400より分離した符号化データn+1を復号部401に転送する(ステップS12)。その後、復号完了しているかチェックを行ない(ステップS13)、復号完了しているなら復号データn+1を出力制御メモリ404に転送する(ステップS14)。
【0023】
出力制御メモリ404に書込まれた復号テ゛ータn+1の書込開始アト゛レスを指定アト゛レス読出開始検出部406に設定する(ステップS15)。指定アドレス読出開始検出部406は読出アト゛レスが復号テ゛ータn+1の書込開始アト゛レスと一致したか監視する。読出アト゛レスが一致したときに指定アドレス読出開始検出部406からPTS予測部408に対して予測PTS取得タイミンク゛信号を通知する。予測PTS取得タイミンク゛信号を通知されたPTS予測部408はPTS加算部で算出されたPTS予測値を取得して位相ずれ検出部409に通知する。(ステップS16)
【0024】
PTS予測値を通知された位相ずれ検出部409は設定されたPTSn+1とPTS予測値を比較して位相ずれ時間を検出し、現在の出力テ゛ータ位相ずれ時間を検出する(ステップS17)。また、その次の予測動作のためにPTSn+1をPTS予測部408に設定する。(ステップS18)
【0025】
上記方法で図1の音声PTS予測部306は音声復号データ出力を行ないながら次の音声PTS予測を開始する。音声位相ずれ検出部308は音声PTS予測部より渡された音声PTS予測値とシステムテ゛コータ゛分離部300より渡された音声PTSを比較し音声復号開始からの位相ずれ時間を検出する。同様にして画像PTS予測部307は画像位相ずれ検出部309にて予測した画像PTS予測値とシステムテ゛コータ゛分離部300より渡された画像PTSを比較し音声復号開始からの位相ずれ時間を検出する。双方の位相ずれ時間情報は音声・画像位相ずれ検出部310に通知され、音声・画像双方の位相ずれ時間を比較することによって画像・音声出力が現在どれだけずれているか検出することが可能となる。
【0026】
実施の形態2.
この実施の形態2では実施の形態1の音声・画像位相ずれ検出部310から映像・音声遅延メモリ303・305に位相ずれ補正値を通知する機能と、画像・音声位相ずれ検出部310にて検出された位相差より画像・音声に対する補正値を計算する機能を追加することによって音声・画像遅延を自動調整して音声・画像テ゛ータの位相が一致するよう動作するMPEG2テ゛コータ゛装置について説明を行なう。なおシステム構成については実施の形態1と同一であるため省略する。
【0027】
MPEG2テ゛コータ゛のテ゛ータ経路は実施の形態1と同一であるため省略する。
【0028】
画像・音声テ゛ータの位相ずれ検出までの動作は実施の形態1と同一であるため省略する。
【0029】
画像・音声位相ずれ検出部310にて画像・音声データの位相ずれを検出すると共に、検出された画像・音声テ゛ータの位相ずれより画像・音声の補正値を算出する。算出した補正値はそれぞれ画像・音声遅延メモリ303・305に補正値として設定されることによって常に画像・音声の位相ずれが無くなるよう動作することによって画像・音声テ゛ータの位相差発生を防止することができる。
【0030】
実施の形態3.
この実施の形態3では実施の形態1の画像・音声位相ずれ検出部310から画像・音声遅延メモリ303・305に位相ずれ補正値を通知する機能と、画像・音声の位相ずれ時間の許容値範囲をユーザが外部から入力する機能と、この許容範囲を保存する機能と、画像・音声位相ずれ検出部310にて算出された補正値にしたがって遅延量を調整する機能を拡張することによってユーザの許容範囲内で音声・画像テ゛ータの位相が一致するよう動作するMPEG2テ゛コータ゛装置について説明を行なう。
図4は、この発明の実施の形態3におけるMPEG2デコーダの概略構成図である。図4において、図1と同符号は同一または相当部分を示す。317は画像・音声の位相ずれ時間の許容範囲を外部から入力する入力部、318は許容範囲保存部である。
【0031】
MPEG2テ゛コータ゛のテ゛ータ経路は実施の形態1と同一であるため説明を省略する。
【0032】
画像・音声テ゛ータの位相ずれ検出までの動作は実施の形態1と同一であるため説明を省略する。
【0033】
位相ずれの許容範囲は予めユーザによって入力部317から入力され、許容範囲保存部318に保存しておく。画像・音声位相ずれ検出部310にて検出された画像・音声テ゛ータの位相ずれが上記許容範囲を超えていないかチェックする。位相ずれが上記許容範囲を超えていれば、画像・音声の補正値を算出する。算出した補正値をそれぞれ画像・音声遅延メモリ303・305に設定することによって上記許容範囲に応じて画像・音声位相を制御することが可能になり上記許容範囲を超える画像・音声テ゛ータの位相差発生を防止することができる。
【0034】
また、ユーザが外部から入力できるので、システムの状況に応じて許容値を変えることができ、柔軟な対応が可能である。
【0035】
なお、上記の例では、許容値を入力部317より入力するようにしているが、これに限る必要はなく、例えば、サーバなどの他システムからダウンロードするようにしてもよい。
【0036】
実施の形態4.
この実施の形態4では実施の形態1の画像・音声位相ずれ検出部310から画像・音声遅延メモリ303・305に位相ずれ補正値を通知する機能と、ユーザが外部より画像・音声の位相ずれ検出の監視周期を入力する機能と、当該監視周期を保存する機能と、画像・音声位相ずれ検出部310にて算出された補正値にしたがって遅延量を調整する機能を拡張することによって、ある一定監視周期で音声・画像テ゛ータの位相が一致するよう動作するMPEG2テ゛コータ゛装置について説明を行なう。
図5は、この発明の実施の形態4におけるMPEG2デコーダの概略構成図である。図5において、図1と同符号は同一または相当部分を示す。317は画像・音声の位相ずれ時間の許容範囲を外部から入力する入力部、319は監視周期保存部である。なお、ここでは、画像・音声位相ずれ検出部310は、タイマーを保有していることを前提とする。
【0037】
MPEG2テ゛コータ゛のテ゛ータ経路は実施の形態1と同一であるため説明を省略する。
【0038】
画像・音声テ゛ータの位相ずれ検出までの動作は実施の形態1と同一であるため説明を省略する。
【0039】
位相ずれ検出の監視周期は予めユーザによって入力部317から入力され、監視周期保存部319に保存しておく。また、画像・音声位相ずれ検出部310に設けられたタイマー(図示せず)は、画像・音声位相ずれ検出部310が起動されたときに初期設定され、直後にカウントアップを開始する。そして、タイマーの値が監視周期と一致したときに発生する信号によって初期設定され、直後にカウントアップを再開する。
【0040】
画像・音声位相ずれ検出部310は、監視周期保存部319に保存されている監視周期時間経過したかチェックを行ない、監視周期時間経過していれば画像・音声位相ずれ検出部310にて検出された画像・音声テ゛ータの位相ずれより、画像・音声の補正値を算出する。それぞれ画像・音声遅延メモリ303・305に補正値を設定することによってユーザ監視周期の要求に応じて画像・音声位相差発生を防止することができる。
【0041】
また、ユーザが外部から入力できるので、システムの状況に応じて監視周期を変えることができ、柔軟な対応が可能である。
【0042】
なお、上記の例では、監視周期を入力部317より入力するようにしているが、これに限る必要はなく、例えば、サーバなどの他システムからダウンロードするようにしてもよい。
【図面の簡単な説明】
【図1】本発明におけるMPEG2デコーダの構成を示すブロック図である。
【図2】PTS予測方法・補正方法を説明するブロック図である。
【図3】PTS予測方法を説明するフローチャートである。
【図4】この発明の実施の形態3におけるMPEG2デコーダの概略構成図である。
【図5】この発明の実施の形態4におけるMPEG2デコーダの概略構成図である。
【図6】MPEG2におけるビットストリームの相互関係図である。
【図7】従来のMPEG2デコーダの構成を示すブロック図である。
【符号の説明】
101 パックヘッダ
102 画像PESパケット
103 音声PESパケット
104 画像PESヘッダ
105 音声PESヘッダ
106 画像PTS
107 音声PTS
108 TSパケット
109 TSヘッダ、110 TSペイロード
200 システムデコーダ分離部
201 音声復号部
202 画像復号部
203 音声遅延メモリ
204 PTS比較部
205 画像遅延メモリ
300 システムデコーダ分離部
301 音声復号部
302 画像復号部
303 音声遅延メモリ
304 PTS比較部
305 画像遅延メモリ
306 音声PTS予測部
307 画像PTS予測部
308 音声位相ずれ検出部
309 画像位相ずれ検出部
310 画像・音声位相ずれ検出部
311 音声出力制御メモリ
312 画像出力制御メモリ
313 データ書込部(音声)
314 データ書込部(画像)
315 データ読出部(音声)
316 データ読出部(画像)
317 入力部
318 許容値保存部
319 監視周期保存部
400 システムデコーダ分離部
401 復号部
402 遅延メモリ
403 テ゛ータ書込部
404 出力制御メモリ
405 データ読出部
406 指定復号データ読出し開始検出部
407 PTS加算部
408 PTS予測部
409 位相ずれ検出部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a device that decodes encoded data and outputs the decoded data based on PTS (Presentation Time Stamp) information included in the data.
[0002]
[Prior art]
The image and audio compression technology represented by the international encoding standard MPEG2 has been widely adopted in the broadcasting field because of its high image quality and high compression efficiency. An outline of MPEG2 decoding will be described below.
In MPEG2, images and sounds are separately encoded. For this reason, PES (Packetized Elementary Stream) assigned in pack units to synchronize the two at the time of decoding, PTS assigned in packet units, and output designation time information called PTS, and STC (System Time Clock) which has as a reference time inside the decoder ) Is used.
(A time reference value PCR (Program Clock Reference) is also required, but is not described in this patent because it is not used in this patent.)
[0003]
FIG. 6 is a diagram showing an example of a data structure of encoded data (bit stream) according to MPEG2.
A pack, which is one unit of encoded data, includes a pack header 101 for storing information about the pack, an image PES (Packetized Elementary Stream) packet 102 for storing encoded image data, and an audio PES packet 103 for storing encoded audio data. Consists of The PES packet is obtained by packetizing image encoded data (elementary stream) and audio encoded data (elementary stream) with variable length. The image PES packet 102 and the audio PES packet 103 have PES headers 104 and 105, respectively, in which PTSs 106 and 107 are stored. One PES packet is composed of a plurality of TS (Transport Stream) packets 108 having the same PID (Packet Identification: 13-bit stream identification information indicating the attribute of an individual stream of the packet). The TS packet is a fixed-length packet of 188 bytes and includes a 4-byte TS header 109 and a payload 110.
[0004]
The PTS is information for displaying or outputting the PES packet (hereinafter simply referred to as output) when the STC in the MPEG system decoder matches the PTS. The accuracy of the PTS is represented by a 33-bit value measured with a clock of 90 kHz. The PTS is provided for the decoder when the encoder performs encoding. For example, when STC is T0, the decoder outputs decoded image data t1 seconds after the moment when the PES packet is received, and wants to output the decoded audio data t2 seconds after the moment the decoder receives the PES packet. In this case, the image PTS is “T0 + t1” and the audio PTS is “T0 + t2”. Actually, the encoder assigns t1 and t2 in consideration of the encoding and decoding processing times inside the encoder and the decoder.
[0005]
FIG. 7 shows a basic conceptual diagram of a video / audio synchronization system using PTS.
The system decoder separation unit 200 of the decoder separates each coded stream of audio and video from the input stream and separates each PTS. Thereafter, when decoding the respective streams, different decoding delays occur in the audio decoding unit 201 and the image decoding unit 202.
The PTS comparison unit 204 calculates the difference between the respective PTSs, and determines which phase of the image or audio the output should be adjusted to. One of the outputs is delayed according to the result of the determination to synchronize them. This delay is controlled including the difference between the delays separately generated in the delay memories 203 and 205.
[0006]
The audio data output / image data output speeds are output at different constant speeds.
[0007]
[Problems to be solved by the invention]
In order to output the image / audio data decoded by the MPEG2 decoder at the timing intended by the encoder as described above, there is no error between the PTS provided by the encoder and the STC reproduced on the decoder side. is necessary. Also, in the broadcasting field, when using the MPEG2 system, it is required that the synchronization between audio and images be synchronized with accuracy of several ms.
However, when the phase of the PTS added to the video / audio stream and the phase of the decoder internal STC fluctuate due to the state of the encoder or the state of the transmission path between the encoder and the decoder, the PTS is used. When the output control is performed, the output timing of the image data or the audio data does not become the correct timing, and the required accuracy may not be satisfied because the phases of the image data and the audio data are shifted.
[0008]
In that case, the MPEG2 standard configuration presupposes that it operates according to the encoder, so a PTS is added to each stream unit, and each decoder operates according to the PTS so that the image and the audio can be in phase. . In this case, there is no mechanism for monitoring the data output phase of the image and the sound and feeding it back. For this reason, it is not possible to detect how much the data output phase of the image / sound has fluctuated, and decoding and reproduction are performed independently of each other.
[0009]
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and detects the output phase shift of the image / audio data even if the PTS stored in the PES packet and the internal STC fluctuate. It is an object of the present invention to provide an MPEG2 decoder which realizes synchronous output of image data and audio data at a timing intended by a converter.
[0010]
[Means for Solving the Problems]
An MPEG2 decoder according to the present invention decodes data (hereinafter, referred to as “encoded data”) that includes output designated time information (hereinafter, referred to as PTS information) and is encoded according to the MPEG2 system, and decodes the decoded data based on the PTS information. In the output MPEG2 decoder,
Means for predicting next PTS information from the PTS information, means for decoding the encoded data, means for outputting decoded image data and audio data, output timing of the decoded image data, and decoding Means for detecting a phase shift in the output timing of the output audio data.
[0011]
Further, the MPEG2 decoder according to the present invention is provided with means for adjusting the output timing of the decoded data, and always adjusts the output timing of the decoded data based on the value of the phase shift.
[0012]
Also, the MPEG2 decoder according to the present invention is provided with an adjusting means for adjusting the output timing of the decoded data and a means for storing a threshold value, wherein the adjusting means determines whether or not the phase shift value exceeds the threshold value. The output timing is adjusted.
[0013]
Further, the MPEG2 decoder according to the present invention is provided with means for externally inputting a threshold value.
[0014]
The MPEG2 decoder according to the present invention further comprises means for adjusting the output timing of the decoded data, and means for storing a monitoring cycle for detecting a phase shift,
In the monitoring cycle, the output timing of the decoded data is adjusted based on the value of the phase shift.
[0015]
Further, the MPEG2 decoder according to the present invention is provided with means for externally inputting a monitoring cycle.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Embodiment 1 FIG.
FIG. 1 is a schematic configuration diagram of an MPEG2 decoder according to Embodiment 1 of the present invention.
In FIG.
Reference numeral 300 denotes a system text / separator separating unit for separating an encoded stream, PTS, and other necessary information from an input stream.
Reference numeral 301 denotes an audio decoding unit that decodes encoded audio data.
Reference numeral 302 denotes an image decoding unit that decodes encoded image data.
Reference numeral 303 denotes an audio delay memory for delaying audio decoded data output.
A PTS comparison unit 304 compares the phase difference between the image and audio PTS.
An image delay memory 305 delays the output of the decoded image data.
An audio PTS prediction unit 306 predicts the PTS of the next frame from the supplied audio PTS.
An image PTS prediction unit 307 predicts the PTS of the next frame from the given image PTS.
An audio phase shift detecting unit 308 compares the audio PTS prediction value with the audio PTS.
An image phase shift detecting unit 309 compares the predicted image PTS value and the image PTS.
Reference numeral 310 denotes an image / sound phase shift detector that compares the amount of phase shift between the image and the sound. Reference numeral 311 denotes an address audio output control memory configured with a ring buffer for outputting audio.
Reference numeral 312 denotes an address image output control memory configured with a ring buffer for outputting an image.
313 is a data writing unit for writing the decoded audio data.
314 is a data writing unit for writing the decoded image data.
A data reading unit 315 reads out the decoded audio data written in the audio output control memory at the actual data output speed.
A data reading unit 316 reads out the decoded image data written in the image output control memory at the actual data output speed.
[0017]
In the MPEG2 decoder of FIG. 1, the system coder separator 300 separates each coded stream of audio / video from the input stream and separates each PTS. Thereafter, when decoding the respective streams, different decoding delays occur in the audio decoding unit 301 and the image decoding unit 302.
The PTS comparison unit 304 calculates each PTS difference, and determines which phase of the image or audio is to be matched with the output phase. The output is delayed according to the above determination result to synchronize the two.
This delay is controlled including the difference between the delays generated separately in the delay memories 303 and 305.
[0018]
At this time, as described above, the input decoded data is output at a certain constant speed, so that the time required for outputting one bit of data is fixed for each of the image and the sound.
[0019]
FIG. 2 is a schematic diagram of PTS prediction in this embodiment. FIG. 3 is a flowchart of the PTS prediction operation in this embodiment. The count timing signal and the predicted PTS acquisition timing signal are processed by another unit. The outline of the operation will be described below.
[0020]
First, it is checked whether the PTS prediction has been started (step S1). If the PTS prediction has not been started, it is checked whether the PTS has been received next. (Step S2) When the PTSn has been successfully received, the PTSn separated from the system text / coater separation unit 400 is set in the PTS prediction unit 408. (Step S3)
[0021]
Next, it is checked whether the acquisition of the encoded data has been completed (step S4). If the encoded data n can be received, the encoded data n separated by the system text / separator separating unit 400 is transferred to the decoding unit 401 (step S5). .
Thereafter, it is checked whether the decoding is completed (step S6). If the decoding is completed, the data writing unit 403 transfers the decoded data n to the output control memory (step S7). After the transfer is completed, a read instruction is issued to the data read unit 405 (step S8).
Thereafter, the decoded data written to the output control memory 404, which is a link buffer, by the data reading unit 405 which has received the read instruction is designated with an address, and is read at the speed at which each decoded data is reproduced.
The set PTSn is added by the PTS adder every reading speed unit time every time the decoded data is read (step S21). (Step S20)
[0022]
If the PTS prediction has been started in step s1, it is checked whether the information of PTSn + 1 on the next PES has been received (step S9), and the acquired PTSn + 1 is set in the phase shift detection unit 409. (Step S10)
Similarly, it is checked whether the acquisition of the encoded data n + 1 has been completed (step S11). If the encoded data has been received, the encoded data n + 1 separated by the system text / separator separation unit 400 is transferred to the decoding unit 401 (step S11). Step S12). Thereafter, it is checked whether the decoding has been completed (step S13). If the decoding has been completed, the decoded data n + 1 is transferred to the output control memory 404 (step S14).
[0023]
The write start address of the decryption data n + 1 written in the output control memory 404 is set in the designated address read start detecting unit 406 (step S15). The designated address read start detecting unit 406 monitors whether the read address matches the write start address of the decryption data n + 1. When the read addresses match, the designated address read start detection unit 406 notifies the PTS prediction unit 408 of a predicted PTS acquisition timing signal. The PTS predicting unit 408 notified of the predicted PTS acquisition timing signal acquires the PTS predicted value calculated by the PTS adding unit and notifies the phase shift detecting unit 409 of the PTS predicted value. (Step S16)
[0024]
The phase shift detector 409, which has been notified of the PTS predicted value, compares the set PTSn + 1 with the PTS predicted value to detect the phase shift time, and detects the current output data phase shift time (step S17). Also, PTSn + 1 is set in the PTS prediction unit 408 for the next prediction operation. (Step S18)
[0025]
With the above method, the audio PTS prediction unit 306 of FIG. 1 starts the next audio PTS prediction while outputting audio decoded data. The audio phase shift detector 308 compares the audio PTS prediction value passed from the audio PTS predictor with the audio PTS passed from the system coder separator 300 to detect the phase shift time from the start of audio decoding. Similarly, the image PTS prediction unit 307 compares the predicted value of the image PTS predicted by the image phase deviation detection unit 309 with the image PTS passed from the system text / separation unit 300, and detects the phase deviation time from the start of audio decoding. The phase shift time information of both is notified to the audio / image phase shift detecting unit 310, and it is possible to detect how much the image / audio output is currently shifted by comparing the phase shift times of both the audio and the image. .
[0026]
Embodiment 2 FIG.
In the second embodiment, the function of notifying the phase shift correction value from the audio / image phase shift detection unit 310 of the first embodiment to the video / audio delay memories 303 and 305 and the function of detecting the phase shift detection unit 310 A description will be given of an MPEG2 data coater that operates so that the phase of audio / video data is matched by automatically adjusting the delay of audio / video by adding a function of calculating a correction value for video / audio from the phase difference obtained. The system configuration is the same as that of the first embodiment, and a description thereof will be omitted.
[0027]
The data path of the MPEG2 data coater is the same as that of the first embodiment, and will not be described.
[0028]
The operation up to the detection of the phase shift of the image / sound data is the same as that of the first embodiment, so that the description is omitted.
[0029]
The image / sound phase shift detecting unit 310 detects the phase shift of the image / sound data, and calculates a correction value of the image / sound from the detected phase shift of the image / sound data. The calculated correction values are set as correction values in the image / audio delay memories 303 and 305, respectively, so that the operation is always performed so that the phase shift of the image / audio is eliminated, thereby preventing the occurrence of the phase difference of the image / audio data. it can.
[0030]
Embodiment 3 FIG.
In the third embodiment, the function of notifying the image / sound delay memories 303 and 305 of the phase shift correction value from the image / sound phase shift detection unit 310 of the first embodiment, and the allowable range of the image / sound phase shift time Of the user, the function of storing the allowable range, and the function of adjusting the delay amount according to the correction value calculated by the image / sound phase shift detecting unit 310 by extending the function of the user. A description will be given of an MPEG2 data recorder device that operates so that the phases of audio and video data match within the range.
FIG. 4 is a schematic configuration diagram of an MPEG2 decoder according to Embodiment 3 of the present invention. 4, the same reference numerals as those in FIG. 1 denote the same or corresponding parts. Reference numeral 317 denotes an input unit for externally inputting a permissible range of the image / sound phase shift time, and 318 denotes a permissible range storage unit.
[0031]
Since the data path of the MPEG2 data coater is the same as that of the first embodiment, the description is omitted.
[0032]
The operation up to the detection of the phase shift of the image / sound data is the same as that of the first embodiment, and the description is omitted.
[0033]
The allowable range of the phase shift is input in advance from the input unit 317 by the user, and is stored in the allowable range storage unit 318. It is checked whether the phase shift of the image / sound data detected by the image / sound phase shift detection unit 310 does not exceed the allowable range. If the phase shift exceeds the allowable range, a correction value for the image / audio is calculated. By setting the calculated correction values in the image / audio delay memories 303 and 305, it is possible to control the image / audio phase in accordance with the allowable range, and to generate a phase difference of the image / audio data exceeding the allowable range. Can be prevented.
[0034]
Further, since the user can input from the outside, the allowable value can be changed according to the state of the system, and a flexible response is possible.
[0035]
In the above example, the allowable value is input from the input unit 317. However, the present invention is not limited to this. For example, the allowable value may be downloaded from another system such as a server.
[0036]
Embodiment 4 FIG.
In the fourth embodiment, the function of notifying the image / sound delay memories 303 and 305 of the phase shift correction value from the image / sound phase shift detection unit 310 of the first embodiment, and the function of detecting the phase shift of the image / sound from outside by the user. The function of inputting the monitoring cycle of the above, the function of storing the monitoring cycle, and the function of adjusting the delay amount according to the correction value calculated by the image / sound phase shift detecting unit 310 are extended to provide a certain monitoring. A description will be given of an MPEG2 data recorder device which operates so that the phases of audio / video data coincide with each other in a cycle.
FIG. 5 is a schematic configuration diagram of an MPEG2 decoder according to Embodiment 4 of the present invention. 5, the same reference numerals as those in FIG. 1 denote the same or corresponding parts. Reference numeral 317 denotes an input unit for externally inputting a permissible range of the image / sound phase shift time, and 319 denotes a monitoring cycle storage unit. Here, it is assumed that the image / sound phase shift detection unit 310 has a timer.
[0037]
Since the data path of the MPEG2 data coater is the same as that of the first embodiment, the description is omitted.
[0038]
The operation up to the detection of the phase shift of the image / sound data is the same as that of the first embodiment, and the description is omitted.
[0039]
The monitoring cycle of the phase shift detection is input by the user from the input unit 317 in advance, and is stored in the monitoring cycle storage unit 319. Further, a timer (not shown) provided in the image / sound phase shift detecting unit 310 is initialized when the image / sound phase shift detecting unit 310 is activated, and starts counting up immediately thereafter. Then, the timer is initialized by a signal generated when the value of the timer coincides with the monitoring period, and the counting up is restarted immediately thereafter.
[0040]
The image / sound phase shift detection unit 310 checks whether the monitoring cycle time stored in the monitoring cycle storage unit 319 has elapsed, and if the monitoring cycle time has elapsed, the image / sound phase shift detection unit 310 detects it. The correction value of the image / audio is calculated from the phase shift of the image / audio data. By setting correction values in the image / audio delay memories 303 and 305, it is possible to prevent the occurrence of an image / audio phase difference in response to a user monitoring cycle request.
[0041]
Also, since the user can input from the outside, the monitoring cycle can be changed according to the state of the system, and a flexible response is possible.
[0042]
In the above example, the monitoring period is input from the input unit 317. However, the present invention is not limited to this. For example, the monitoring period may be downloaded from another system such as a server.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an MPEG2 decoder according to the present invention.
FIG. 2 is a block diagram illustrating a PTS prediction method / correction method.
FIG. 3 is a flowchart illustrating a PTS prediction method.
FIG. 4 is a schematic configuration diagram of an MPEG2 decoder according to a third embodiment of the present invention.
FIG. 5 is a schematic configuration diagram of an MPEG2 decoder according to Embodiment 4 of the present invention.
FIG. 6 is a diagram showing the relationship between bit streams in MPEG2.
FIG. 7 is a block diagram showing a configuration of a conventional MPEG2 decoder.
[Explanation of symbols]
101 Pack header 102 Image PES packet 103 Audio PES packet 104 Image PES header 105 Audio PES header 106 Image PTS
107 Voice PTS
108 TS packet 109 TS header, 110 TS payload 200 System decoder separation unit 201 Audio decoding unit 202 Image decoding unit 203 Audio delay memory 204 PTS comparison unit 205 Image delay memory 300 System decoder separation unit 301 Audio decoding unit 302 Image decoding unit 303 Audio Delay memory 304 PTS comparison unit 305 Image delay memory 306 Audio PTS prediction unit 307 Image PTS prediction unit 308 Audio phase shift detection unit 309 Image phase shift detection unit 310 Image / audio phase shift detection unit 311 Audio output control memory 312 Image output control memory 313 Data writing unit (voice)
314 Data writing unit (image)
315 Data readout unit (voice)
316 Data readout unit (image)
317 Input unit 318 Allowable value storage unit 319 Monitoring cycle storage unit 400 System decoder separation unit 401 Decoding unit 402 Delay memory 403 Data writing unit 404 Output control memory 405 Data reading unit 406 Designated decoding data reading start detection unit 407 PTS addition unit 408 PTS prediction unit 409 Phase shift detection unit

Claims (6)

出力指定時刻情報(以降PTS情報という)を含み、MPEG2方式で符号化されたデータ(以下、符号化データという)を復号し、前記PTS情報に基づいて復号データを出力するMPEG2デコーダにおいて、
前記PTS情報から次のPTS情報を予測する手段と、前記符号化データを復号する手段と、復号された画像データおよび音声データを出力する手段と、前記復号された画像データの出力タイミングと前記復号された音声データの出力タイミングの位相ずれを検出する手段を備えたことを特徴とするMPEG2デコーダ。
An MPEG2 decoder that decodes data (hereinafter referred to as coded data) that includes output designated time information (hereinafter referred to as PTS information) and is encoded according to the MPEG2 system, and outputs decoded data based on the PTS information,
Means for predicting next PTS information from the PTS information, means for decoding the encoded data, means for outputting decoded image data and audio data, output timing of the decoded image data, and decoding An MPEG2 decoder comprising means for detecting a phase shift in output timing of the output audio data.
復号したデータの出力タイミングを調整する手段を設け、常に前記位相ずれの値に基づき復号したデータの出力タイミングを調整することを特徴とする請求項1に記載のMPEG2デコーダ。2. The MPEG2 decoder according to claim 1, further comprising means for adjusting the output timing of the decoded data, and always adjusting the output timing of the decoded data based on the value of the phase shift. 復号したデータの出力タイミングを調整する調整手段と、閾値を保存する手段を設け、前記調整手段は、位相ずれの値が前記閾値を超える場合のみ復号したデータの出力タイミングを調整することを特徴とする請求項1に記載のMPEG2デコーダ。Adjustment means for adjusting the output timing of the decoded data, and means for storing a threshold value are provided, and the adjustment means adjusts the output timing of the decoded data only when the value of the phase shift exceeds the threshold value. The MPEG2 decoder according to claim 1, wherein 閾値を外部から入力する手段を設けたことを特徴とする請求項3に記載のMPEG2デコーダ。4. The MPEG2 decoder according to claim 3, further comprising means for externally inputting a threshold value. 復号したデータの出力タイミングを調整する手段と、位相ずれ検出の監視周期を保存する手段を設け、
前記監視周期で前記位相ずれの値に基づき復号したデータの出力タイミングを調整することを特徴とする請求項1に記載のMPEG2デコーダ。
Means for adjusting the output timing of the decoded data, and means for storing the monitoring cycle of the phase shift detection,
2. The MPEG2 decoder according to claim 1, wherein an output timing of decoded data is adjusted based on the value of the phase shift in the monitoring cycle.
監視周期を外部から入力する手段を設けたことを特徴とする請求項5に記載のMPEG2デコーダ。6. The MPEG2 decoder according to claim 5, further comprising means for externally inputting a monitoring cycle.
JP2002179417A 2002-06-20 2002-06-20 MPEG2 decoder Expired - Fee Related JP4175038B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002179417A JP4175038B2 (en) 2002-06-20 2002-06-20 MPEG2 decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002179417A JP4175038B2 (en) 2002-06-20 2002-06-20 MPEG2 decoder

Publications (2)

Publication Number Publication Date
JP2004023686A true JP2004023686A (en) 2004-01-22
JP4175038B2 JP4175038B2 (en) 2008-11-05

Family

ID=31176817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002179417A Expired - Fee Related JP4175038B2 (en) 2002-06-20 2002-06-20 MPEG2 decoder

Country Status (1)

Country Link
JP (1) JP4175038B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1504908A2 (en) 2003-08-08 2005-02-09 Seiko Epson Corporation Liquid container
JP2006254298A (en) * 2005-03-14 2006-09-21 Matsushita Electric Ind Co Ltd Device and method for moving picture reproduction
JP2008506282A (en) * 2004-06-18 2008-02-28 ドルビー・ラボラトリーズ・ライセンシング・コーポレーション Maintaining synchronization between streaming audio and streaming video used for Internet protocols
JP2016099687A (en) * 2014-11-19 2016-05-30 株式会社ジャパンディスプレイ Display device, driving method thereof, and pointing device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1504908A2 (en) 2003-08-08 2005-02-09 Seiko Epson Corporation Liquid container
JP2008506282A (en) * 2004-06-18 2008-02-28 ドルビー・ラボラトリーズ・ライセンシング・コーポレーション Maintaining synchronization between streaming audio and streaming video used for Internet protocols
JP2006254298A (en) * 2005-03-14 2006-09-21 Matsushita Electric Ind Co Ltd Device and method for moving picture reproduction
JP2016099687A (en) * 2014-11-19 2016-05-30 株式会社ジャパンディスプレイ Display device, driving method thereof, and pointing device

Also Published As

Publication number Publication date
JP4175038B2 (en) 2008-11-05

Similar Documents

Publication Publication Date Title
US5537148A (en) Video and audio data demultiplexer having controlled synchronizing signal
US5802239A (en) Apparatus for reproducing data not successively located on a recording medium
US5703877A (en) Acquisition and error recovery of audio data carried in a packetized data stream
US9066061B2 (en) Video information reproduction method and system, and video information content
US5396497A (en) Synchronization of audio/video information
JP3130464B2 (en) Data decryption device
EP0618728B1 (en) Synchronization of audio/video information
JPH06333341A (en) Device for separating multiplexed data and method thereof
US6021168A (en) Clock recovery circuit and method for MPEG-2 system decoder
US20080008100A1 (en) Transport Stream Processing Device and Transport Stream Processing Method
JP3100308B2 (en) Image and audio information playback system
JP4175038B2 (en) MPEG2 decoder
JPH08214296A (en) Decoder and mpeg system decoder
JPH114446A (en) Method and system for decoding information signal
JP2007259313A (en) Stream reproduction method and reproduction apparatus
JP3920125B2 (en) Decoding device and decoding method
US7039849B2 (en) Data decoder and method of decoding data
JP4690965B2 (en) Data recording / reproducing device
JP2001111610A (en) Receiver for information data transmission system
JP3958531B2 (en) Synchronous control device
JPH0964860A (en) Clock recovery device
JP2002281498A (en) Reception reproducing device
JP2838985B2 (en) Audio video code decoding apparatus and audio video code decoding method
JP2001156760A (en) Communication system, control method and recording medium
JP2008199516A (en) Data processing apparatus

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20040707

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070802

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070807

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071004

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080729

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080811

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110829

Year of fee payment: 3

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110829

Year of fee payment: 3

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120829

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120829

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130829

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees