Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4604341B2 - Synchronous word search method and synchronous word search circuit - Google Patents
[go: Go Back, main page]

JP4604341B2 - Synchronous word search method and synchronous word search circuit - Google Patents

Synchronous word search method and synchronous word search circuit Download PDF

Info

Publication number
JP4604341B2
JP4604341B2 JP2000368288A JP2000368288A JP4604341B2 JP 4604341 B2 JP4604341 B2 JP 4604341B2 JP 2000368288 A JP2000368288 A JP 2000368288A JP 2000368288 A JP2000368288 A JP 2000368288A JP 4604341 B2 JP4604341 B2 JP 4604341B2
Authority
JP
Japan
Prior art keywords
word
synchronization word
error
data stream
data
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.)
Expired - Fee Related
Application number
JP2000368288A
Other languages
Japanese (ja)
Other versions
JP2002171250A (en
Inventor
篤史 一木
章 中川
映史 森松
隆 伊藤
潔 酒井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2000368288A priority Critical patent/JP4604341B2/en
Publication of JP2002171250A publication Critical patent/JP2002171250A/en
Application granted granted Critical
Publication of JP4604341B2 publication Critical patent/JP4604341B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Time-Division Multiplex Systems (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、動画像を符号化して得られるデータストリーム等の同期ワードの探索に効果のあるものであり、ユニークな同期ワードと可変長符号化データからなるデータストリームの復号時の同期ワードの探索方法に関する。
【0002】
動画像符号化技術としてはITU-T(International Telecommunication Union- Telecommunication Standardization Sector) で標準化されたH.261/H.263 、ISO(International Organization for Standardization) で標準化されたMPEG(Moving Picture Experts Group)-1/2/4等がある。
【0003】
これらの動画像伝送において、データストリームから確実に同期ワードを探索して、復号したデータの欠落することのない動画像を表示することが要求されている。
【0004】
【従来の技術】
図9は従来技術を説明する図を示す。
【0005】
図中の100は、入力したデータストリームを一時的に記憶しておくバッファメモリであり、200は記憶したバッファメモリ100からデータストリームを取り出し、その中の同期ワードを探索する同期ワード探索部であり、300は同期ワードが探索され、その位置が確定したとき、データストリーム中のヘッダ部を取り出し、ヘッダの解析を行うヘッダパース部である。
【0006】
また、400はヘッダパース部300でヘッダの正常性が確認されたのち、引き続き入力する可変長符号化データを復調する符号化データ復号部であり、500は符号化データ復号部400で復号された復号データのエラーを検出するエラー検出部である。
【0007】
図の構成において、入力したデータストリームはバッファメモリ100に一時的に記憶された後、同期ワード探索部200に読み込まれ同期ワードを探索する。同期ワードが探索されれば、その同期ワード位置からヘッダを抽出し、そのヘッダの正常性を解析する。ヘッダが正常な場合は次いで入力される可変長符号化データの復号処理を行い、復号データの中のエラーをエラー検出部500にて検出する。
【0008】
ここで、復号処理の途中でエラーを検出したときは復号処理を停止させることは可能であるが、復号処理を停止させると、エラー発生以降の可変長符号化データの復号ができなくなるので、この方法を採用した場合は、エラーが発生する都度、例えば、復号された動画像を監視している操作者がかかる同期ワードの探索回路の再起動を行うことが必要となり、復号処理の効率が悪くなる。
【0009】
そこで、データストリームを復号している途中でエラーを検出したときは、その時点から同期ワードの探索を行い、同期ワードの探索ができたところから、復号処理を再開することが行われている。
【0010】
ここで、データストリーム中のエラーの検出方法としては、
▲1▼ 存在しない可変長符号を復号したとき。
【0011】
▲2▼ 復号結果の矛盾を検出したとき。
【0012】
をエラー発生と判定している。
【0013】
▲2▼は復号したデータの値が予め決められている値の範囲を超えた場合等であり、通常は▲1▼、▲2▼を組み合わせてエラーの検出を行っている。
【0014】
【発明が解決しようとする課題】
上述の従来の技術において、可変長符号化データを復号しているときのエラーの検出ポイントは可変長符号化データを復号している途中の場合がある。このエラー混入を検出できずに復号処理を続け、ユニークな同期ワードの読込み中にエラーを検出する場合もある。このとき、エラー検出したポイントから同期ワードの探索を始めると、エラーを検出した位置にある同期ワードの検出ができなくなり、次の同期ワードまでの間の可変長符号化データの復号ができなくなる。
【0015】
図10は従来技術の動作を説明する図であり、上述の動作を説明するものである。
【0016】
(A)は入力するデータストリームの例を示し、同期ワードの後に可変長符号化データ(図中可変長符号列と示す)が続き、同期ワードと可変長符号化データとが交互に入力する。
【0017】
(B)はデータストリームの復号中にエラーを検出したときの動作を示す。
【0018】
▲1▼ 可変長符号化データを復号している状態で▲1▼点の×印の位置にエラーが発生したが、エラーを検出できずに復号動作を継続している。
【0019】
▲2▼ 同期ワードの途中の▲2▼の点でこのエラー発生を検出する。
【0020】
▲3▼ エラーを検出したので、この時点から次の同期ワードの探索動作に入る。
【0021】
▲4▼ 次の▲4▼の点で同期ワードを検出し、復号動作を再開する。この場合は網かけした▲3▼の部分の可変長符号化データは復号できない。
【0022】
このようなエラー検出時の復号されない可変長符号化データの発生を防ぐには、ユニークな同期ワードを検出するハードウェアと、可変長符号化データを復号するハードウェアの2つのハードウェアを準備し、これらの2つのハードウェアを独立して、並列で動作させることにより可能であるが、2つのハードウェアが必要となるのでハードウェアのコストが大きくなる。また、ソフトウェアでユニークな同期ワードを検出と、可変長符号化データを復号する処理を並列で行うこともできるが、かかる構成では並列処理を行うためのメモリ等の資源を大量に使用するので復号回路がコストアップとなる。
【0023】
本発明は、ユニークな同期ワードと符号化データからなるデータストリームの復号処理において、エラーを検出したとき、所定のビット数の読戻しを行ったあと、同期ワードの探索を行うことにより、復号されない符号化データの発生を防止することのできる同期ワード探索方法を実現することを目的とする。
【0024】
【課題を解決するための手段】
図1は本発明の第1の原理を説明する図である。図はユニークな同期ワードと符号化データからなるデータストリームの復号時の同期ワードの探索方法を示し、ステップ1は、データストリームをバッファメモリへ読み込み、ステップ2は、バッファメモリへ読み込んだデータストリーム中の同期ワードを探索し、ステップ3は、データストリーム中の同期ワードを探索し、同期ワードに引き続く符号化データの復号を行い、ステップ4は、符号化データの復号データ中のエラー検出を行う。次いで、ステップ5は、符号化データの復号データ中にエラーを検出したとき、バッファメモリ中のデータを所定のビット数の読み戻しを行い、ステップ2に戻って同期ワードの探索を行い、ステップ6は同期ワードの探索ができたあとの符号化データから復号を行い復号データを出力する。
【0025】
かかる処理により、同期ワードの探索中に符号化データのエラーを検出しても、所定のビット数、読戻しを行った上で同期ワードの探索を行うので、同期ワードの探索もれがなくなり、符号化データの復号もれを防止できる。
【0026】
図2は第1の発明の動作を説明する図である。入力するデータストリームは図10で説明したものと同じ構成をもつものとする。
【0027】
▲1▼ 符号化データを復号している状態で▲1▼点にエラーが発生したがエラーを検出できずに復号動作を継続している。
【0028】
▲2▼ 同期ワードの途中の▲2▼の点でエラーを検出する。
【0029】
▲3▼ エラーを検出したので、所定のビット数の読戻しを行う。
【0030】
▲4▼ 次の同期ワードの探索に入り、エラーが発生した符号化データの次の同期ワードで同期ワードを探索する。
【0031】
▲5▼ 以降、正常な復号処理に入る。網かけで示す符号化データは、従来技術においては、復号不能であるが、本発明では復号可能となる。(請求項1)
また、読み戻しを行うときの所定のビット数を符号化データの最大符号長以上の値とすることで、同期ワードの見逃しを防ぐことができる。さらに、読み戻しを行うときの所定のビット数を同期ワードの符号長を超えない値とする。これは、読み戻しを行う時の所定のビット数が同期ワードの符号長を超えていると、エラー検出時に次の同期ワードの探索を行うとき前回探索した同期ワードを検出してしまい、それによりループ動作に陥ってしまう。そこで、同期ワードの符号長を超えない値とすることによりループ動作に陥ることを防ぐことができる。そして、読み戻しの位置を同期ワードの位置より後にすることにより、確実に次の同期ワードの探索を行い、可変長符号化データの復号もれを少なくすることが可能となる。
【0032】
図3は本発明の第2の原理を説明する図である。図はユニークな同期ワードと符号化データからなるデータストリームの復号時の同期ワード探索回路を示し、図中の100はデータストリームを読み込むバッファメモリであり、200はバッファメモリ100へ読み込んだデータストリーム中の同期ワードを探索する同期ワード探索部であり、300は同期ワード探索部200で探索した同期ワードの解析を行うヘッダパース部であり、400はヘッダパース部300で同期ワードの正常性が確認されたとき、該同期ワードに引き続く符号化データの復号を行う符号化データ復号部である。
【0033】
また、500は符号化データの復号データ中のエラーを検出するエラー検出部であり、600はエラー検出部500で符号化データの復号エラーを検出したとき、所定のビット数の読み戻しを行うための読込み位置を制御する読戻し位置制御手段である。
【0034】
かかる構成により、バッファメモリ100中の同期ワードの探索中に、エラー検出部500で符号化データの復号エラーを検出したとき、読み戻し位置制御手段600で、所定のビット数、読戻しを行った上で同期ワードの探索を行うので、同期ワードの探索もれがなくなり、符号化データの復号もれを防止できる。(請求項2)
さらに、読戻し位置制御手段600に、同期ワード探索部200が探索した同期ワードの位置を記載するレジスタ620を設け、読込み位置制御部610が読込み位置の制御を行うとき、読戻したビット位置とレジスタ620に記憶したビット位置により制御を行う。
【0035】
かかる構成により、確実に同期ワードの探索を行うことが可能となる。
【0036】
【発明の実施の形態】
図4は本発明の実施の形態で使用するデータストリームを説明する図示し、図5〜図7は本発明の第1の実施の形態の動作フローチャート(1)〜(3)を示す。
【0037】
本発明の実施の形態ではMPEG−4のデータストリームを使用しており、図4でその構成を説明する。MPEG−4のデータストリームはビデオ・オブジョクト・シーケンス(Video Object Sequence以下VOSと示す)、ビデオ・オブジョクト・レイヤ(Video Object Layer 以下VOLと示す)、ビデオ・オブジョクト・プレーン(Video Object Plane 以下VOPと示す)、ビデオ・パケット(Video Packet 以下VPと示す)からなる階層構造をとっている。VPデータは、動画1フレームの画像を複数のマクロブロックに分割し、その各マクロブロックのデータを符号化したものである。
【0038】
また、各階層の先頭には図に示すようにヘッダが付けられており、VOSにはVOSヘッダが、VOLにはVOLヘッダが、VOPにはVOPヘッダが、VPにはVPヘッダが付けられている。
【0039】
さらに、各ヘッダの先頭には、ユニークな同期ワードとして、スタートコードが付けられており、VOSにはVOSスタートコードが、VOLにはVOLスタートコードが、VOPにはVOPスタートコードが、VPにはVPスタートコードが付けられている。
【0040】
以下本発明の実施の形態の動作を図5〜図7にしたがって説明する。
【0041】
S11は、入力したデータストリームを格納したバッファメモリ100のデータを順次、取り出して、例えば、32ビットで構成されるVOS同期ワードの探索を行う。S12で同期ワードを検出したとき、VOSスタートコードか否かを判定し、S13でスタートコードが探索できた場合は、VOSスタートコードのビット位置をレジスタ(図8で説明する)620に格納する。S14は、探索したVOSヘッダの解析を行い、S15でエラー検出か否かを判定し、エラー検出の場合はエラー終了する。S16は、S12でVOSスタートコードでなければ、VOSエンドコードか否かを判定し、エンドコードの場合でない場合はエラー終了し、エンドコードの場合は正常終了となる。
【0042】
S21は、S15で探索したVOSヘッダにエラーがなければ、VOL同期ワードの探索を行う。S22でVOL同期ワードを検出した後、VOLスタートコードか否かを判定し、VOLスタートコードが検出できなかった場合は▲1▼でS11のVOS同期ワードの探索に戻り、VOLスタートコードが探索できた場合は、S23でVOLスタートコードのビット位置をレジスタ620に格納する。S24は、探索したVOLヘッダの解析を行い、S25でエラー検出か否かを判定し、エラー検出の場合は、S26で次のVOL同期ワードを検出してS22に戻る。S25でエラーが検出できない場合は、▲2▼の次のS31の処理に進む。
【0043】
S31は、S25で探索したVOLヘッダにエラーがなければ、VOP同期ワードの探索を行う。VOP同期ワードを検出した後、S32でVOPスタートコードか否かを判定し、VOPスタートコードが検出できなかった場合は▲3▼でS21のVOL同期ワードの探索に戻り、VOPスタートコードが探索できた場合は、S33でVOPスタートコードのビット位置をレジスタ620に格納する。S34は、探索したVOPヘッダの解析を行い、S35でエラー検出か否かを判定し、エラー検出の場合は、S36で次のVOP同期ワードを検出してS32に戻る。S35でエラーが検出できない場合は、次のS41の処理に進む。
【0044】
S41は、S35で探索したVOPヘッダにエラーがなければ、VP同期ワードの探索を行う。VP同期ワードを検出した後、S42でVPスタートコードか否かを判定し、VPスタートコードが検出できなかった場合は▲4▼でS31のVOP同期ワードの探索に戻り、VPスタートコードが探索できた場合は、S43でVPスタートコードのビット位置をレジスタ620に格納する。S44は、探索したVPヘッダの解析を行い、S45でエラー検出か否かを判定し、エラー検出の場合は、S46で次のVP同期ワードを検出してS42に戻る。S45のヘッダパースでエラーが検出できない場合は、▲5▼のS51に進む。
【0045】
S51は、S45でエラーを検出できない場合、VPデータの復号を行ったのち、S52でVPデータの復号データ中にエラーがあるか否か、または復号結果に矛盾があるか否かを検出する。この復号結果の矛盾は、現在復号したマクロブロックの番号が、1フレーム中の最大マクロブロック数より大きい場合や、1つのビデオ・パケットの中に含まれるマクロブロックの数が、ヘッダから読み込んだ値と実際復号したマクロブロックの数と不一致の場合等である。S52でエラー、または復号結果の矛盾が検出した場合は▲6▼のS41に戻り次のVPスタートコードの探索を行う。S52でエラー、または復号結果の矛盾を検出できない場合は、S53でスタートコードのビット数と同じ32ビットの読戻しを行い、S54で読戻しを行ったビット位置がレジスタ620に格納されている位置より前か否かを判定し、ビット位置がレジスタ620に格納されている位置より前の場合には、S55でVP同期ワードの探索を開始する位置をレジスタ620に記憶された位置「+1」したビット位置とする。
【0046】
かかる処理により、VPデータの復号結果にエラーを検出した場合でも、指定のビット数の読戻しを行った上で、同期ワードの探索を行うので、エラーが発生した可変長符号化データの次に来る同期ワードから確実に同期ワードの検出を行うことが可能となる。
【0047】
図7のS53では、同期ワードのビット数である32ビット読戻しを行っている。この32ビットの読戻しにより、エラーを発生した可変長符号化データの発生した時点で入力している同期ワードの検出が可能となる。さらに、前回の同期ワードより後の同期ワードから探索を開始することにより、同じ同期ワードを検出することによるループの発生を防止することができる。
【0048】
図8は本発明の第2の実施の形態を説明する図である。図中のバッファメモリ100、同期ワード探索部200、ヘッダパース部300、符号化データ復号部400、エラー検出部500は図1の原理図で説明したと同じ構成をもつものである。
【0049】
図8の第2の実施の形態においては、原理図で説明した読戻し位置制御手段600に、エラー検出部500で復号データ中にエラーを検出したときの読込み位置を制御する読込み位置制御部610と、読戻しを行うときの読戻しビット数を設定する読戻しビット数設定部(図中読戻ビット数設定部と示す)611、同期ワードを検出したときのビット位置を記憶しておくレジスタ620と、データストリームのビット位置をカウントするカウンタ630から構成している。図の構成において、入力したデータストリームはバッファメモリ100に格納され、順次、同期ワード探索部200に、読み込まれたビット位置をカウンタ630でカウントしながら入力され、同期ワードの探索を行う。同期ワードが探索されたとき、そのビット位置をレジスタ620に記憶しておく。
【0050】
ついで、探索された同期ワードをヘッダパース部300で解析し、ヘッダが正常であれば、可変長符号化データ復号部400で、同期ワードに引続く可変長符号化データを復号し、エラー検出部500でエラーの検出を行い、エラーが検出できなければ、次の同期ワードの探索を行い、同期ワードが探索できれば、次の可変長符号化データの復号処理を繰り返し実行する。
【0051】
エラーが検出された場合は、読戻しビット数設定部611に設定されたビット数、データストリームの読戻しを行ったのち、同期ワード探索部200で次の同期ワードの探索を開始する。
【0052】
このとき、符号化データの最大符号長以上の値を読戻しビット数として読戻しビット数設定部611に設定しておくことにより、同期ワードの見逃しを防ぐことができる。また、同期ワードが32ビットの場合、読戻しビット数設定部611に32ビットを設定しておき、32ビットの読戻しを行った後、同期ワードの探索を行うことにより、エラーが発生した可変長符号化データの次の同期ワードを確実に探索することができる。さらに、読戻しを行ったときの、戻ったビット位置が、レジスタ620に記憶したビット位置と比較し、レジスタ620のビット位置より前にある場合には、レジスタ620の値「+1」したビット位置から、同期ワードの探索を行うことにより、無限ループに陥ることを防止することができる。
【0053】
(付記1) ユニークな同期ワードと符号化データからなるデータストリーム中の同期ワードの探索方法であって、
データストリームをバッファメモリへ読み込むステップと、
バッファメモリへ読み込んだデータストリーム中の同期ワードを探索するステップと、
データストリーム中の同期ワードを探索し、同期ワードに引き続く符号化データの復号を行うステップと、
符号化データの復号データ中のエラーを検出するステップと、
復号データ中のエラーを検出したとき、バッファメモリ中のデータを所定のビット数読み戻し、同期ワードを探索するステップへ戻るステップからなることを特徴とする同期ワード探索方法。
【0054】
(付記2) 付記1記載の同期ワード探索方法において、
読み戻しを行うときの所定のビット数を符号化データの最大符号以上の値とすることを特徴とする同期ワード探索方法。
(付記3) 付記1記載の同期ワード探索方法において、
読み戻しを行うときの所定のビット数を前回の同期ワードの符号長を超えない値とすることを特徴とする同期ワード探索方法。
【0055】
(付記4) 付記1記載の同期ワード探索方法において、
読み戻しの位置を前回の同期ワードの探索位置より後にすることを特徴とする同期ワード探索方法。
【0056】
(付記5) ユニークな同期ワードと符号化データからなるデータストリーム中の同期ワードの探索回路であって、
データストリームを読み込むバッファメモリと、
前記バッファメモリへ読み込んだデータストリーム中の同期ワードを探索する同期ワード探索部と、
前記同期ワード探索部で探索した同期ワードの解析を行うヘッダパース部と、
前記ヘッダパース部で同期ワードの正常性が確認されたとき、該同期ワードに引き続く符号化データの復号を行う符号化データ復号部と、
符号化データ中のエラーを検出するエラー検出部と、
前記エラー検出部でエラーを検出したとき、所定のビット数読戻しを行う読込み位置を制御する読戻し位置制御手段より構成することを特徴とする同期ワード探索回路。
【0057】
(付記6) 付記5記載の同期ワード探索回路において、
前記同期ワード探索部が探索した同期ワードの位置を記憶するレジスタを備え、
前記読込み位置制御手段が読込み位置の制御を行うとき、読戻したビット位置とレジスタに記憶したビット位置により制御を行うことを特徴とする同期ワード探索回路。
【0058】
【発明の効果】
本発明によれば、ユニークな同期ワードと可変長符号化データからなるデータストリームの復号処理において、エラーを検出したとき、所定のビット数の読戻しを行ったあと、同期ワードの探索を行うことにより、復号されない可変長符号化データの発生を防止することのできる同期ワード探索方法を実現することができる。
【図面の簡単な説明】
【図1】 本発明の第1の原理を説明する図
【図2】 第1の発明の動作を説明する図
【図3】 本発明の第2の原理を説明する図
【図4】 本発明の実施の形態で使用するデータストリームを説明する図
【図5】 本発明の第1の実施の形態の動作フローチャート(1)
【図6】 本発明の第1の実施の形態の動作フローチャート(2)
【図7】 本発明の第1の実施の形態の動作フローチャート(3)
【図8】 本発明の第2の実施の形態を説明する図
【図9】 従来技術を説明する図
【図10】 従来技術の動作を説明する図
【符号の説明】
100 バッファメモリ
200 同期ワード探索部
300 ヘッダパース部
400 符号化データ復号部
500 エラー検出部
600 読戻し位置制御手段
610 読込み位置制御部
611 読戻しビット数設定部
620 レジスタ
630 カウンタ
[0001]
BACKGROUND OF THE INVENTION
INDUSTRIAL APPLICABILITY The present invention is effective for searching for a synchronization word such as a data stream obtained by encoding a moving image, and searching for a synchronization word when decoding a data stream composed of a unique synchronization word and variable-length encoded data. Regarding the method.
[0002]
H.261 / H.263 standardized by ITU-T (International Telecommunication Union-Telecommunication Standardization Sector) and MPEG (Moving Picture Experts Group) standardized by ISO (International Organization for Standardization) There is 1/2/4 mag.
[0003]
In these moving image transmissions, it is required to search a synchronization word reliably from a data stream and display a moving image in which decoded data is not lost.
[0004]
[Prior art]
FIG. 9 is a diagram for explaining the prior art.
[0005]
In the figure, reference numeral 100 denotes a buffer memory that temporarily stores an input data stream, and reference numeral 200 denotes a synchronization word search unit that takes out the data stream from the stored buffer memory 100 and searches for a synchronization word therein. , 300 is a header parsing unit that extracts a header part from the data stream and analyzes the header when a synchronization word is searched and its position is fixed.
[0006]
Reference numeral 400 denotes an encoded data decoding unit that demodulates the variable-length encoded data that is input after the header parsing unit 300 confirms the normality of the header, and 500 is decoded by the encoded data decoding unit 400. It is an error detection unit that detects an error in the decoded data.
[0007]
In the configuration shown in the figure, the input data stream is temporarily stored in the buffer memory 100 and then read into the synchronization word search unit 200 to search for a synchronization word. When a sync word is searched, a header is extracted from the sync word position, and the normality of the header is analyzed. When the header is normal, the input variable-length encoded data is decoded, and the error detection unit 500 detects an error in the decoded data.
[0008]
Here, when an error is detected during the decoding process, it is possible to stop the decoding process. However, if the decoding process is stopped, it becomes impossible to decode the variable-length encoded data after the error occurs. When the method is adopted, each time an error occurs, for example, an operator who monitors the decoded moving image needs to restart the synchronization word search circuit, and the efficiency of the decoding process is poor. Become.
[0009]
Therefore, when an error is detected in the middle of decoding the data stream, the synchronization word is searched from that point, and the decoding process is resumed from the point where the synchronization word has been searched.
[0010]
Here, as a method of detecting errors in the data stream,
(1) When a variable length code that does not exist is decoded.
[0011]
(2) When an inconsistency in the decoding result is detected.
[0012]
Is determined to have occurred.
[0013]
(2) is the case where the value of the decoded data exceeds a predetermined value range, etc., and error detection is usually performed by combining (1) and (2).
[0014]
[Problems to be solved by the invention]
In the above-described conventional technique, an error detection point when decoding variable length encoded data may be in the middle of decoding variable length encoded data. In some cases, this error mixture cannot be detected and the decoding process is continued, and an error is detected during reading of a unique synchronization word. At this time, if the search for the synchronization word is started from the point where the error is detected, the synchronization word at the position where the error is detected cannot be detected, and the variable-length encoded data up to the next synchronization word cannot be decoded.
[0015]
FIG. 10 is a diagram for explaining the operation of the prior art and explains the above-described operation.
[0016]
(A) shows an example of an input data stream. Variable length encoded data (shown as a variable length code string in the figure) follows a synchronization word, and the synchronization word and variable length encoded data are alternately input.
[0017]
(B) shows the operation when an error is detected during decoding of the data stream.
[0018]
(1) While variable length encoded data is being decoded, an error has occurred at the position of the x mark at point (1), but the error cannot be detected and the decoding operation is continued.
[0019]
(2) This error occurrence is detected at point (2) in the middle of the synchronization word.
[0020]
(3) Since an error is detected, a search operation for the next synchronization word is started from this point.
[0021]
(4) A synchronization word is detected at the next point (4) and the decoding operation is restarted. In this case, the variable length encoded data in the shaded portion (3) cannot be decoded.
[0022]
In order to prevent the occurrence of undecoded variable-length encoded data when an error is detected, two hardware units are prepared: hardware that detects a unique synchronization word and hardware that decodes variable-length encoded data. It is possible to operate these two pieces of hardware independently and in parallel. However, since two pieces of hardware are required, the cost of hardware increases. In addition, the software can detect a unique synchronization word and decode the variable-length encoded data in parallel. However, such a configuration uses a large amount of resources such as memory to perform parallel processing. The circuit is costly.
[0023]
In the present invention, when an error is detected in the decoding process of a data stream composed of a unique synchronization word and encoded data, it is not decoded by performing a search for the synchronization word after reading back a predetermined number of bits. An object of the present invention is to realize a synchronous word search method capable of preventing the generation of encoded data.
[0024]
[Means for Solving the Problems]
FIG. 1 is a diagram for explaining the first principle of the present invention. The figure shows a method of searching for a synchronization word when decoding a data stream consisting of a unique synchronization word and encoded data. Step 1 reads the data stream into the buffer memory, and Step 2 includes the data stream read into the buffer memory. Step 3 searches for a synchronization word in the data stream, decodes the encoded data following the synchronization word, and Step 4 performs error detection in the decoded data of the encoded data. Next, when an error is detected in the decoded data of the encoded data, step 5 reads back the data in the buffer memory by a predetermined number of bits, and returns to step 2 to search for a synchronization word. Performs decoding from the encoded data after the search for the synchronization word is performed and outputs the decoded data.
[0025]
With this process, even if an error in the encoded data is detected during the search for the sync word, the search for the sync word is performed after performing the read-back after a predetermined number of bits, so the search for the sync word can be prevented. Decoding leakage of encoded data can be prevented.
[0026]
FIG. 2 is a diagram for explaining the operation of the first invention. It is assumed that the input data stream has the same configuration as that described with reference to FIG.
[0027]
(1) While the encoded data is being decoded, an error has occurred at point (1), but the error cannot be detected and the decoding operation is continued.
[0028]
(2) An error is detected at point (2) in the middle of the synchronization word.
[0029]
(3) Since an error has been detected, a predetermined number of bits are read back.
[0030]
{Circle around (4)} Search for the next sync word, and search for the sync word with the next sync word of the encoded data in which an error has occurred.
[0031]
(5) Thereafter, normal decryption processing is started. Encoded data indicated by shading cannot be decoded in the prior art, but can be decoded in the present invention. (Claim 1)
Also, by setting the predetermined number of bits at the time of reading back to a value greater than or equal to the maximum code length of the encoded data, it is possible to prevent the synchronization word from being overlooked. Further, the predetermined number of bits when reading back is set to a value that does not exceed the code length of the synchronization word. This is because if the predetermined number of bits when reading back exceeds the code length of the sync word, the sync word searched last time will be detected when searching for the next sync word at the time of error detection. It will fall into the loop action. Therefore, it is possible to prevent a loop operation from occurring by setting a value that does not exceed the code length of the synchronization word. By setting the read-back position after the position of the synchronization word, it is possible to reliably search for the next synchronization word and reduce the decoding leak of the variable-length encoded data.
[0032]
FIG. 3 is a diagram for explaining the second principle of the present invention. The figure shows a synchronization word search circuit at the time of decoding a data stream consisting of a unique synchronization word and encoded data. Reference numeral 100 in the figure is a buffer memory for reading the data stream, and reference numeral 200 is in the data stream read into the buffer memory 100. , 300 is a header parsing unit that analyzes the synchronization word searched by the synchronization word searching unit 200, and 400 is a header parsing unit 300 that confirms the normality of the synchronization word. The encoded data decoding unit decodes the encoded data subsequent to the synchronization word.
[0033]
Reference numeral 500 denotes an error detection unit that detects an error in the decoded data of the encoded data. Reference numeral 600 denotes a read-back of a predetermined number of bits when the error detection unit 500 detects a decoding error of the encoded data. Read back position control means for controlling the read position.
[0034]
With this configuration, when the error detection unit 500 detects a decoding error in the encoded data during the search for the synchronization word in the buffer memory 100, the read-back position control unit 600 performs read-back by a predetermined number of bits. Since the search for the synchronization word is performed above, the search for the synchronization word is eliminated and the decoding of the encoded data can be prevented. (Claim 2)
Further, the read back position control means 600 is provided with a register 620 that describes the position of the sync word searched by the sync word search unit 200, and when the read position control unit 610 controls the read position, Control is performed according to the bit position stored in the register 620.
[0035]
With this configuration, it is possible to reliably search for a synchronization word.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 4 is a diagram for explaining a data stream used in the embodiment of the present invention, and FIGS. 5 to 7 show operation flowcharts (1) to (3) of the first embodiment of the present invention.
[0037]
In the embodiment of the present invention, an MPEG-4 data stream is used, and its configuration will be described with reference to FIG. The MPEG-4 data stream is indicated as a video object sequence (hereinafter referred to as VOS), a video object layer (hereinafter referred to as VOL), and a video object plane (hereinafter referred to as VOP). ), And a hierarchical structure composed of video packets (hereinafter referred to as VP). The VP data is obtained by dividing an image of one moving image into a plurality of macro blocks and encoding the data of each macro block.
[0038]
Also, as shown in the figure, a header is attached to the head of each layer, and a VOS has a VOS header, a VOL has a VOL header, a VOP has a VOP header, and a VP has a VP header. Yes.
[0039]
Furthermore, a start code is added to the head of each header as a unique synchronization word. The VOS has a VOS start code, the VOL has a VOL start code, the VOP has a VOP start code, and the VP has a VOP start code. A VP start code is attached.
[0040]
The operation of the embodiment of the present invention will be described below with reference to FIGS.
[0041]
In step S11, data in the buffer memory 100 storing the input data stream is sequentially extracted, and a search for a VOS synchronization word composed of, for example, 32 bits is performed. When a synchronization word is detected in S12, it is determined whether or not it is a VOS start code. If a start code can be searched in S13, the bit position of the VOS start code is stored in a register 620 (described in FIG. 8). In step S14, the searched VOS header is analyzed. In step S15, it is determined whether or not an error is detected. If an error is detected, the process ends in error. In S16, if it is not a VOS start code in S12, it is determined whether or not it is a VOS end code. If it is not an end code, the process ends in error, and if it is an end code, it ends normally.
[0042]
If there is no error in the VOS header searched in S15, S21 searches for a VOL synchronization word. After detecting the VOL sync word in S22, it is determined whether or not it is a VOL start code. If the VOL start code cannot be detected, return to the search for the VOS sync word in S11 and search for the VOL start code. If so, the bit position of the VOL start code is stored in the register 620 in S23. In S24, the searched VOL header is analyzed. In S25, it is determined whether or not an error is detected. If an error is detected, the next VOL synchronization word is detected in S26 and the process returns to S22. If no error can be detected in S25, the process proceeds to S31 next to (2).
[0043]
In S31, if there is no error in the VOL header searched in S25, the VOP synchronization word is searched. After detecting the VOP sync word, it is determined whether or not it is a VOP start code in S32. If the VOP start code cannot be detected, the process returns to S21 for searching for the VOL sync word in (3), and the VOP start code can be searched. If so, the bit position of the VOP start code is stored in the register 620 in S33. In S34, the searched VOP header is analyzed. In S35, it is determined whether or not an error is detected. If an error is detected, the next VOP synchronization word is detected in S36 and the process returns to S32. If no error can be detected in S35, the process proceeds to the next S41.
[0044]
In S41, if there is no error in the VOP header searched in S35, the VP synchronization word is searched. After detecting the VP sync word, it is determined whether or not it is a VP start code in S42. If the VP start code cannot be detected, the process returns to the search for the VOP sync word in S31 and the VP start code can be searched. If so, the bit position of the VP start code is stored in the register 620 in S43. In S44, the searched VP header is analyzed. In S45, it is determined whether or not an error is detected. If an error is detected, the next VP synchronization word is detected in S46 and the process returns to S42. If no error can be detected by the header parsing of S45, the process proceeds to S51 of (5).
[0045]
In S51, when an error cannot be detected in S45, after decoding the VP data, in S52, it is detected whether there is an error in the decoded data of the VP data or whether there is a contradiction in the decoding result. The contradiction in the decoding result is that the number of macroblocks currently decoded is larger than the maximum number of macroblocks in one frame or the number of macroblocks included in one video packet is a value read from the header. And the number of macroblocks actually decoded does not match. If an error or an inconsistency in the decoding result is detected in S52, the process returns to S41 in (6) to search for the next VP start code. If no error or inconsistency of the decoding result cannot be detected in S52, the 32-bit read-back that is the same as the number of bits of the start code is performed in S53, and the bit position in which the read-back is performed in S54 is stored in the register 620. If the bit position is earlier than the position stored in the register 620, the position where the search for the VP sync word is started is added to the position "+1" stored in the register 620 in S55. Bit position.
[0046]
With this processing, even when an error is detected in the decoding result of the VP data, the synchronization word is searched after reading back the specified number of bits. It becomes possible to reliably detect the sync word from the incoming sync word.
[0047]
In S53 of FIG. 7, 32-bit read-back that is the number of bits of the synchronization word is performed. This 32-bit read-back makes it possible to detect the synchronization word that is being input when the variable-length encoded data in which an error has occurred. Furthermore, by starting the search from the synchronization word after the previous synchronization word, it is possible to prevent the occurrence of a loop due to detection of the same synchronization word.
[0048]
FIG. 8 is a diagram for explaining a second embodiment of the present invention. The buffer memory 100, the synchronization word search unit 200, the header parsing unit 300, the encoded data decoding unit 400, and the error detection unit 500 in the figure have the same configuration as described in the principle diagram of FIG.
[0049]
In the second embodiment shown in FIG. 8, the read back position control means 600 described in the principle diagram is added to a read position control unit 610 that controls the read position when the error detection unit 500 detects an error in the decoded data. A read-back bit number setting unit (shown as a read-back bit number setting unit in the figure) 611 for setting the number of read-back bits when performing read-back, and a register for storing a bit position when a synchronization word is detected 620 and a counter 630 that counts the bit positions of the data stream. In the configuration shown in the figure, the input data stream is stored in the buffer memory 100 and sequentially input to the synchronization word search unit 200 while the read bit positions are counted by the counter 630 to search for synchronization words. When the synchronization word is searched, the bit position is stored in the register 620.
[0050]
Next, the searched synchronization word is analyzed by the header parsing unit 300. If the header is normal, the variable length encoded data decoding unit 400 decodes the variable length encoded data following the synchronization word, and the error detection unit An error is detected at 500. If no error is detected, the next sync word is searched. If the sync word can be searched, the decoding process for the next variable-length encoded data is repeatedly executed.
[0051]
If an error is detected, the number of bits set in the read back bit number setting unit 611 and the data stream are read back, and then the sync word search unit 200 starts searching for the next sync word.
[0052]
At this time, by setting a value greater than or equal to the maximum code length of the encoded data in the read-back bit number setting unit 611 as the read-back bit number, it is possible to prevent the synchronization word from being overlooked. In addition, when the synchronization word is 32 bits, a variable in which an error has occurred can be obtained by setting 32 bits in the read-back bit number setting unit 611, performing a 32-bit read-back, and then searching for the synchronization word. It is possible to reliably search for the next synchronization word of the long encoded data. Further, when the read back is performed, the returned bit position is compared with the bit position stored in the register 620. If the bit position is before the bit position of the register 620, the bit position obtained by adding “+1” to the value of the register 620. Therefore, it is possible to prevent falling into an infinite loop by searching for a synchronization word.
[0053]
(Supplementary Note 1) A method for searching for a synchronization word in a data stream composed of a unique synchronization word and encoded data,
Reading the data stream into the buffer memory;
Searching for synchronization words in the data stream read into the buffer memory;
Searching for a sync word in the data stream and decoding the encoded data following the sync word;
Detecting an error in the decoded data of the encoded data;
A synchronization word search method comprising: a step of reading back a predetermined number of bits of data in a buffer memory and returning to a step of searching for a synchronization word when an error in the decoded data is detected.
[0054]
(Supplementary note 2) In the synchronous word search method according to supplementary note 1,
A method for searching for a synchronous word, characterized in that a predetermined number of bits when reading back is set to a value equal to or greater than a maximum code of encoded data.
(Supplementary note 3) In the synchronous word search method according to supplementary note 1,
A synchronization word search method characterized in that a predetermined number of bits for reading back is set to a value not exceeding the code length of the previous synchronization word.
[0055]
(Supplementary note 4) In the synchronous word search method according to supplementary note 1,
A method for searching for a synchronization word, characterized in that the read-back position is made after the previous synchronization word search position.
[0056]
(Supplementary Note 5) A search circuit for a synchronization word in a data stream composed of a unique synchronization word and encoded data,
A buffer memory to read the data stream;
A synchronization word search unit for searching for a synchronization word in the data stream read into the buffer memory;
A header parsing unit for analyzing a synchronization word searched by the synchronization word search unit;
When the normality of the synchronization word is confirmed in the header parsing unit, an encoded data decoding unit that decodes encoded data subsequent to the synchronization word;
An error detection unit for detecting an error in the encoded data;
A synchronous word search circuit comprising: a read back position control means for controlling a read position for reading back a predetermined number of bits when an error is detected by the error detector.
[0057]
(Supplementary note 6) In the synchronous word search circuit according to supplementary note 5,
A register for storing the position of the synchronization word searched by the synchronization word search unit;
A synchronous word search circuit, wherein when the reading position control means controls the reading position, control is performed based on the read back bit position and the bit position stored in the register.
[0058]
【The invention's effect】
According to the present invention, when an error is detected in the decoding process of a data stream composed of a unique synchronization word and variable-length encoded data, the synchronization word is searched after a predetermined number of bits are read back. Thus, it is possible to realize a synchronous word search method that can prevent the occurrence of variable-length encoded data that is not decoded.
[Brief description of the drawings]
FIG. 1 illustrates the first principle of the present invention. FIG. 2 illustrates the operation of the first invention. FIG. 3 illustrates the second principle of the present invention. FIG. 5 is a diagram for explaining a data stream used in the embodiment of the present invention. FIG. 5 is an operation flowchart (1) of the first embodiment of the present invention.
FIG. 6 is an operation flowchart (2) of the first embodiment of the present invention.
FIG. 7 is an operation flowchart (3) according to the first embodiment of this invention;
FIG. 8 is a diagram for explaining a second embodiment of the present invention. FIG. 9 is a diagram for explaining the prior art. FIG. 10 is a diagram for explaining the operation of the prior art.
DESCRIPTION OF SYMBOLS 100 Buffer memory 200 Synchronous word search part 300 Header parsing part 400 Encoded data decoding part 500 Error detection part 600 Read back position control means 610 Read position control part 611 Read back bit number setting part 620 Register 630 Counter

Claims (2)

ユニークな同期ワードと符号化データからなるデータストリーム中の同期ワードの探索方法であって、
前記データストリームをバッファメモリへ読み込むステップと、
前記バッファメモリへ読み込んだ前記データストリーム中の前記同期ワードを探索するステップと、
前記同期ワードと前記同期ワードに引き続く前記符号化データの復号を行うステップと、
前記復号データ中のエラーを検出するステップと、
前記同期ワードの読み込み中に前記エラーを検出したとき、前記バッファメモリ中のデータストリームを所定のビット数読み戻し、前記同期ワードを探索するステップへ戻るステップからなることを特徴とする同期ワード探索方法。
A method of searching for a synchronization word in a data stream consisting of a unique synchronization word and encoded data,
Reading the data stream into a buffer memory;
A step of searching for said synchronization word in the data stream read into the buffer memory,
And performing decoding of the coded data subsequent to the synchronization word and the synchronization word,
Detecting an error in the decoded data;
Upon detecting the error in loading of the synchronous word, the data stream in the buffer memory read back a predetermined number of bits, sync word search method characterized by comprising the step of returning to the step of searching for the synchronization word .
ユニークな同期ワードと符号化データからなるデータストリーム中の同期ワードの探索回路であって、
前記データストリームを読み込むバッファメモリと、
前記バッファメモリへ読み込んだ前記データストリーム中の前記同期ワードを探索する同期ワード探索部と、
前記同期ワード探索部で探索した前記同期ワードの解析を行うヘッダパース部と、
前記ヘッダパース部で前記同期ワードの正常性が確認されたとき、前記同期ワードと前記同期ワードに引き続く符号化データの復号を行う符号化データ復号部と、
前記復号データ中のエラーを検出するエラー検出部と、
前記同期ワードの読み込み中に前記エラー検出部でエラーを検出したとき、前記バッファメモリ中のデータストリームを所定のビット数読戻しを行う読込み位置を制御する読戻し位置制御手段より構成することを特徴とする同期ワード探索回路。
A search circuit for a sync word in a data stream consisting of a unique sync word and encoded data,
A buffer memory for reading the data stream;
A synchronization word search unit for searching for the sync word in the data stream read into the buffer memory,
A header parsing unit for analyzing the sync word which is searched by the synchronization word search unit,
When normality of the synchronization word in the header parsing unit is confirmed, the encoded data decoding unit for decoding subsequent coded data in the sync word and the sync word,
An error detection unit for detecting an error in the decoded data;
When an error is detected by the error detection unit during reading of the synchronization word, the data stream in the buffer memory is constituted by a read back position control means for controlling a read position for reading back a predetermined number of bits. Synchronous word search circuit.
JP2000368288A 2000-12-04 2000-12-04 Synchronous word search method and synchronous word search circuit Expired - Fee Related JP4604341B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000368288A JP4604341B2 (en) 2000-12-04 2000-12-04 Synchronous word search method and synchronous word search circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000368288A JP4604341B2 (en) 2000-12-04 2000-12-04 Synchronous word search method and synchronous word search circuit

Publications (2)

Publication Number Publication Date
JP2002171250A JP2002171250A (en) 2002-06-14
JP4604341B2 true JP4604341B2 (en) 2011-01-05

Family

ID=18838568

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000368288A Expired - Fee Related JP4604341B2 (en) 2000-12-04 2000-12-04 Synchronous word search method and synchronous word search circuit

Country Status (1)

Country Link
JP (1) JP4604341B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4727440B2 (en) * 2006-02-13 2011-07-20 株式会社リコー Image processing apparatus and image processing method
JP4750730B2 (en) 2006-02-28 2011-08-17 パナソニック株式会社 Data analysis apparatus and data analysis method
JP2008148004A (en) * 2006-12-11 2008-06-26 Pioneer Electronic Corp Video decoder, digital broadcast receiver, video-decoding method, video-decoding program, and recording medium with video-decoding program stored

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10145789A (en) * 1996-11-15 1998-05-29 Oki Electric Ind Co Ltd Animation encoding and decoding method
JP3307879B2 (en) * 1998-07-17 2002-07-24 三菱電機株式会社 Data decoding device and data decoding method

Also Published As

Publication number Publication date
JP2002171250A (en) 2002-06-14

Similar Documents

Publication Publication Date Title
US5680322A (en) Method and apparatus for dynamic image data transmission
JP4703114B2 (en) Method and system for preventing start code emulation and filling data
JP3657960B2 (en) Encoding method and apparatus
US20100008420A1 (en) Method and decoder for realizing random access in compressed code stream using multi-reference images
KR19980071136A (en) Error recovery encoding
JP3907860B2 (en) Moving picture decoding apparatus and moving picture decoding method
BR9715336B1 (en) encoding methods and decoders.
CN1208311A (en) Synchronous picture circuit and method thereof
US6597740B2 (en) Variable-length encoding and decoding apparatus
KR100987777B1 (en) Decoding method and decoding apparatus for preventing of error propagation and parallel processing
CN109660805A (en) Audio-visual synchronization optimization method, storage medium, equipment and system in decoding broadcasting
KR20050074812A (en) Decoding method for detecting transmission error position and recovering correctly decoded data and appratus therefor
JP4604341B2 (en) Synchronous word search method and synchronous word search circuit
US7940807B2 (en) Methods, decoder circuits and computer program products for processing MPEG audio frames
US6226768B1 (en) Coded frame synchronizing method and circuit
KR100327412B1 (en) Video encoding and decoding method for error correction
JP2002027483A (en) Image encoding device, image decoding device, and storage medium
JPH1023431A (en) Moving image decoding device
JPH10178419A (en) Error correction method and device
JP2002016917A (en) Method for decoding time information of moving image
JP3307879B2 (en) Data decoding device and data decoding method
US6961381B2 (en) Picture decoding device
JP2898212B2 (en) Image decoding circuit
JP3693636B2 (en) Video encoding device and video decoding device
JP2011044771A (en) Apparatus and method for decoding moving image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071120

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100609

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100615

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100806

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: 20100907

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: 20100920

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20131015

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees