JP3648460B2 - Compressed image playback method - Google Patents

Compressed image playback method Download PDF

Info

Publication number
JP3648460B2
JP3648460B2 JP2001109120A JP2001109120A JP3648460B2 JP 3648460 B2 JP3648460 B2 JP 3648460B2 JP 2001109120 A JP2001109120 A JP 2001109120A JP 2001109120 A JP2001109120 A JP 2001109120A JP 3648460 B2 JP3648460 B2 JP 3648460B2
Authority
JP
Japan
Prior art keywords
stream
compressed image
data
mpeg stream
frame
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
JP2001109120A
Other languages
Japanese (ja)
Other versions
JP2002305721A (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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2001109120A priority Critical patent/JP3648460B2/en
Publication of JP2002305721A publication Critical patent/JP2002305721A/en
Application granted granted Critical
Publication of JP3648460B2 publication Critical patent/JP3648460B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、圧縮画像再生方法に関し、特に、圧縮画像のMPEGストリームを記録媒体から読み出し、読み出されたMPEGストリームを復号して画像情報を再現する圧縮画像再生方法に関する。
【0002】
【従来の技術】
ビデオデータは、データレートが非常に高いため、データを加工することなく磁気ディスク、光ディスク、光磁気ディスク等のディスク媒体又は半導体メモリに記録するのは困難である。そのため、ビデオデータやオーディオデータを高能率に符号化することにより、視覚的、聴覚的に劣化することなくデータレートをディスク媒体に記録可能なレートまで下げる方法が用いられている。
【0003】
高能率符号化方式の例として、MPEG(Moving Picture Experts Group)方式がある。
MPEGの特徴は、静止画圧縮では不要であった「動き補償(MC:Motion Compensation)」を行うこと、及び動画像圧縮の前提条件としてフレームのランダム・アクセスができること、早送りによる再生や巻戻し再生(逆方向)ができることがあげられている。
【0004】
また、MPEGでは、上述のように、早送り、巻き戻し、途中からの再生が基本となっているため、ある単位の動画像をまとめてGOP(Group of Pictures )を形成し、その単位での独立再生ができるようにしている。上記GOP内の画面の予測構造として、動画のフレームを意味する1枚1枚の画像(ピクチャ)、I、B、Pピクチャを用いる。
【0005】
上記ピクチャは、符号化される方式に従って以下のタイプに分類される。
(1)Iピクチャ(Intra-coded picture:INTRA符号化画像)
符号化されるときその画像1枚の中だけで閉じた情報のみを使う。換言すれば、復号化するときIピクチャ自身の情報のみで画像が再構成できる。実際には、他の画像との差分をとらずそのままDCT(Discrete Cosine Transform)して符号化する。この符号化方式は、一般に効率が悪いが、これを随所に入れてIピクチャだけを復号すればランダム・アクセスや高速再生が可能となる。さらに、Iピクチャを復号してメモリに蓄え、逆方向に読み出すことを繰り返せば逆転再生をも可能となる。
(2)Pピクチャ(Predictive-coded picture:前方予測符号化画像)
Pピクチャは、予測画像(差分をとる基準となる画像)として、入力で時間的に前に位置し既に復号化されたIピクチャまたはPピクチャを使う。すなわち、過去から現在の一方向に予測されるフレームである。実際には動き補償された予測画像との差を符号化するか差分をとらずに符号化する(INTRA符号化)か効率のよい方をマクロブロック単位で選択できる。
(3)Bピクチャ(Bidirectionally predictive-coded picture:両方向予測符号化画像)
Bピクチャは、予測画像として時間的に前に位置し既に復号化されIピクチャまたはPピクチャ、時間的に後ろに位置するすでに復号化されたIピクチャまたはPピクチャ、及びその両方から作られた補間画像の3種類を使う。
【0006】
上記3種類の動き補償後の差分の符号化とINTRA符号化の中で一番効率のよいものをマクロブロック単位に選択できる。
そして、GOPにおいて、Bピクチャを符号化または復号化するには、その予測画像となる時間的には後方にあるIピクチャまたはPピクチャが先に符号化されていなくてはならないため、GOPを構成するにはIピクチャ、Pピクチャ、Bピクチャは所定の順序が必要であるが、Iピクチャの間隔、及びPピクチャの間隔は自由でGOPの内部でも変わってもよい。
【0007】
ところで、MPEGビデオやMPEGオーディオの符号化されたストリーム(ビット列)、さらに他の符号化ストリームも含めて実際のアプリケーションに適用する場合には、同期を含めて統合し1本化するとともに、そのストリームを蓄積メディアやネットワーク等が持つ、固有の物理フォーマットやプロトコルに適合したデータ形式にする必要がある。
【0008】
MPEG2システムには、MPEG1と同様に1つのプログラムを構成するプログラム・ストリーム(MPEG2−PS,PS:Program Stream)と、複数のプログラムを構成できるトランスポート・ストリーム(MPEG2−TS,TS:Transport Stream)とがある。
【0009】
MPEGストリームは、1ビットのフラグも多数あるがヘッダなどの各単位ごとにバイト整列されたバイト・ストリームである。MPEGシステム全体に共通した構造として固定長でないデータ部分には、長さを示す情報が先行して置かれ、不要な場合はその部分をスキップしたり、次のデータ群の先頭を確認して信頼性の高い分離処理ができるデータ構造となっている。
【0010】
MPEG2符号化方式に準拠し、圧縮された映像、音声信号を受信する装置は、復号化側において映像、音声データのオーバーフロー、アンダーフローの防止するために、符号化側での映像、音声サンプリング周波数と、復号化側での映像、音声サンプリング周波数またはSTC(System Time Clock)を一致させる必要がある。
【0011】
そのため、復号化装置ではMPEG2システム規格(ISO/IEC規格13818−1)で規定されたPCR(Program Clock Reference:プログラム時刻基準参照値)またはSCR(System Clock Reference:システム時刻基準参照値)を用いることにより、符号化側の映像、音声サンプリング周波数と復号化側の映像、音声サンプリング周波数を一致させていた。
【0012】
図13は、MPEG方式により動画像を圧縮する例を示す図である。
図13において、複数の平行四辺形は、動画を構成するフレームを表している。図13(a)の動画像をMPEGで圧縮する過程を図13(b)、図13(c)に示す。
MPEGでは、数枚のフレームをまとめてGOPと呼ぶ。図13(b)において、GOP10中のビデオフレームはIフレーム、Pフレーム、Bフレームに分類される。Iフレームはフレーム内符号化されたことを示し、PフレームはIフレームから前方向の予測符号化、又はPフレームから前方向の予測符号化されたことを示す。BフレームはIフレームとPフレームの間もしくはPフレーム間にあり、IフレームやPフレームの両方向から予測符号化される。例として、Pフレーム11、Bフレーム12における予測の方向を矢印で示す。MPEGでは、図13(b)のフレーム順序を図13(c)のように入れ換えて、ビデオ符号化データを作成する。
【0013】
PフレームやBフレームはIフレームもしくはIフレームから予測符号化されたビデオフレームから予測符号化するため、GOP内の全てのビデオフレームを復号するには、まずIフレームから復号する必要がある。すなわち、ランダムアクセスなどで、録画した動画像の途中から再生する場合には、Iフレームから復号する必要がある。
【0014】
このようなMPEG方式を採用したマルチメディア機器において、通常の再生の他、早送り等のいわゆるトリック再生ができることが好ましい。一般的に早送りでは、MPEGストリーム中に含まれるいくつかのフレームのみを読み出し、復号再生を行うことが多い。
【0015】
特に、Iフレームのみを抽出し、復号再生を行う手法がよく見られる。この際、Iフレームの開始位置と終了位置を特定する必要があるが、MPEGで圧縮されたビデオストリームはフレーム毎の符号量が一定ではなく、開始位置、終了位置ともにわからないため、高速再生で表示するフレームデータのみを次々に読み込むことは困難である。
【0016】
この目的を達成するため、特開平7−123357号公報記載の圧縮画像再生方法では、画像情報をフレーム単位に、フレーム内符号化、あるいはフレーム間符号化された圧縮画像のMPEGストリームを記録媒体から読み出し、読み出されたMPEGストリームを復号し画像情報を再現する圧縮画像再生装置において、前記記録媒体から読み出された前記MPEGストリームから第1のフレーム内符号化画像データのヘッダを検出した後、継続する前記MPEGストリームから前記第1のフレーム内符号化画像データの直後に続くフレーム間符号化データのヘッダの検出をもって、前記第1のフレーム内符号化データの読み出し完了と判断し、前記記録媒体の新たな記録位置からの新たな第2,第3のフレーム内符号化画像データの読み出しを繰り返し、また、予め先行して読み出されたMPEGストリーム内のフレーム内符号化画像データの出現間隔を計測し、前後のフレーム内符号化画像データの前記記録媒体上の記録位置を予測することでフレーム内符号化画像を選択再生している。
【0017】
【発明が解決しようとする課題】
しかしながら、このような従来の圧縮画像再生方法では、以下のような問題点があった。まず、フレーム内符号化画像データの開始位置を特定するため、前記記録媒体から読み出されたデータから検出するのでは、検出するまで無駄に記録媒体へアクセスすることになり、また、最悪1GOP分のデータをチェックしなければならないため、現実的でない。次に、フレーム内符号化データの間隔を予測するには、読み出されるストリームのビットレートに応じて予測値を変える必要があるため、装置の構成が複雑になってしまう。
【0018】
フレーム内符号化データの終了位置を特定するために、次のフレームの開始位置を検出するには、フレーム内符号化データ分チェックをする必要がある。一般的に、フレーム内符号化データは他のフレームよりもデータ量が多いため、検出するためのチェック範囲は広いものとなってしまう。さらに、ストリームを加工し、続けてフレーム内符号化データのみを転送すると、送出するデータのビットレートが高くなるために、復号を行う装置のデコーダが間に合わず、バッファがあふれてしまうおそれがある。
本発明は、このような課題に鑑みてなされたものであって、装置の構成が単純で、フレームの終了の検知や送出速度の制御が容易な圧縮画像再生方法を提供することを目的とする。
【0019】
【課題を解決するための手段】
本発明の圧縮画像再生方法は、画像情報をフレーム単位に、フレーム内符号化、あるいはフレーム間符号化し、前記フレームを複数まとめてフレーム群とされた圧縮画像のMPEGストリームを記録媒体から読み出し、読み出されたMPEGストリームを復号して画像情報を再現する圧縮画像再生方法において、前記記録媒体上のMPEGストリーム中の、フレーム群データのヘッダの位置を格納したインデックスを用意し、前記記録媒体から前記MPEGストリームを読み出す際、前記インデックスの示すフレーム群データのヘッダの位置からのデータを読み出し、継続する前記MPEGストリームからフレーム間符号化データのヘッダの検出するまでの、データを読み出し、復号を行う装置へ転送することを特徴としている。
【0020】
これにより、MPEGストリームから、GOPの開始位置から読み出し、ストリーム途中から次のフレーム間符号化データのヘッダを検出するまでのデータを復号する装置へ転送することによって、ヘッダ検出処理を軽減することができる。
また、前記フレーム群データのヘッダは、シーケンスヘッダコード(SHC)であり、前記フレーム間符号化データのヘッダは、ピクチャスタートコード(PSC)であってもよい。
また、好ましくは、前記復号を行う装置では、最初のフレーム内符号化データのみを復号するものであってもよい。
【0021】
本発明の圧縮画像再生方法は、フレーム間符号化データのヘッダ検出後のMPEGストリームの末尾にフレーム内符号化データの終了を表すコードを付加することで、抽出されたストリームの末尾を加工することで、復号を行う装置に対し、ピクチャの終了であることを示すことができる。
【0022】
本発明の圧縮画像再生方法は、前記記録媒体から読み出された前記MPEGストリームの末尾に制御コードを付加することで、抽出されたストリームを復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出することができる。
【0023】
本発明の圧縮画像再生方法は、前記制御コードは、制御用パケットであることで、制御コードをパケットとして出力することで、ストリームが固定長のパケットに分割されたMPEG2トランスポートストリームのような形式においても、抽出されたストリームを復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出することができる。
【0024】
【発明の実施の形態】
以下、添付図面を参照しながら本発明の好適な圧縮画像再生方法の実施の形態について詳細に説明する。
まず、本発明の基本的な考え方について説明する。
本発明では、記録媒体上でのストリーム中のシーケンスヘッダコード(以下、SHCという)の位置を格納したインデックスを用意し、インデックスの示す位置からのデータを読みこむ。
【0025】
次に、フレーム内符号化データの終了位置を検出する必要があるが、フレーム内符号化データの直後のフレーム間符号化データの開始位置(ピクチャ開始コード:以下、PSCという)を検出するのでは、検出範囲が広くなってしまって処理負荷が高い。そこで本発明では、読みこんだデータの途中から、フレーム間符号化データのPSCを検出する手法をとる。これにより、検索範囲を狭くすることができるため、処理負荷を低減することができる。検出された範囲には、複数のピクチャが含まれる場合もあるが、復号を行う装置によって最初のフレーム内符号化データのみを復号表示することで対処できる。なお、インデックスにSHCだけでなく、PSCも登録しておくことでも対処することができるが、インデックスの容量が大きくなるため好ましくない。
【0026】
また、本発明では、抽出されたストリームの末尾の加工を行う。抽出されたストリームは、復号を行う装置では、デコード中のピクチャの終了を次のピクチャの開始や、GOPの終了を表すシーケンス終了コード(以下、SECという)の入力をもって判断する。したがって、1つのフレーム内符号化データを送出しただけでは、復号を行う装置は、デコードの終了を認識できず、画面に表示することができない。本発明では、抽出されたストリームの末尾にピクチャの終了を表すコードを付加することによって、復号装置にフレーム内符号化データの終了であることを示す。末尾に付加するコードは、ピクチャの終了を表す任意のコードであり、例えばSEC等が挙げられる。さらに本発明では、抽出されたストリームの末尾に制御コードを付加することによって、抽出されたストリーム間の間隔を制御し、復号を行う装置のバッファをあふれさせることなく、フレーム内符号化データ尾を連続的に送出する。
【0027】
第1の実施の形態
本実施の形態は、MPEGストリームから、GOPの開始位置から読み出し、ストリーム途中から次のフレーム間符号化データのヘッダを検出するまでのデータを復号する装置へ転送する圧縮画像再生方法を提供するものである。
【0028】
図1は、上記基本的な考え方に基づく本発明の第1の実施の形態の圧縮画像再生方法の構成を示すブロック図である。本実施の形態は、ディスクを用いた動画像再生方法を実現する装置に適用した例である。
図1において、MPEGストリーム等の圧縮画像を記録するディスク1(記録媒体)と、MPEGストリームの記録時にディスク1中のストリームのシーケンスヘッダ(SHC)の位置を示すSHCインデックス2と、ディスク1からMPEGストリームを読み出すディスク読出手段3と、ディスク1からディスク読出手段3で読み出されたMPEGストリームを一時格納するメモリ4と、MPEGストリームからピクチャスタートコード(PSC)の検出を行う検出手段5と、デコード手段7に対してTSパケットを送出する送出手段6と、画像ストリームをデコードし映像情報として出力するデコード手段7と、ディスク読出手段3、ヘッダ検出手段5及び送出手段6を各々管理制御する再生制御手段8とを備えて構成されている。
【0029】
以下、上述のように構成された圧縮画像再生方法の動作を説明する。
図2は、上記ディスク1に記録されているMPEGストリームを示す図であり、図2(a)は従来のヘッダ位置(B1)の検出方法を示し、図2(b)は本実施の形態のヘッダ位置(B2)の検出方法を示す。
フレーム内符号化画像のみを切り出すときには、図2(a)のMPEGストリーム31のように、フレーム内符号化画像の先頭(A1)からフレーム間符号化画像のヘッダ位置(B1)を検索することが必要であり、非常に負荷がかかる。
【0030】
そこで本実施の形態では、図2(b)のMPEGストリーム32のように、フレーム内符号化画像データのヘッダ検出位置から適当にずらした位置(A2)から、フレームデータのヘッダ位置(B2)の検出を行うようにする。フレーム内符号化画像に比べ、フレーム間符号化画像のデータ量は少ないことから、ヘッダ検出にかかる負荷が減少する。
【0031】
図1において、まず、ディスク読出手段3は制御手段8からの指示を受け、SHCインデックス2で示された、GOPの始まり位置からメモリ4への記録されているMPEGストリームの読み出しを開始する。検出手段5では、メモリ4に読み出されたMPEGストリームの途中からPSCの検出を行う。
【0032】
図3は、MPEGストリーム中からPSCの検出を行う処理を示すフローチャートである。図中、Sはフローのステップを示す。
検出手段5は図3のフローチャートに従い、まず、ステップS11で検出開始位置をαとし、ステップS12でストリーム又はシーケンスの終わりであるかを判別し、ストリーム又はシーケンスの終わりでなければステップS13でPSCが検出されたか否かを判別する。PSCが検出されなければ、ステップS14で検出開始位置αを+1インクリメントして上記ステップS12に戻ってPSCが検出されるまで検出処理を繰り返す。
【0033】
ストリーム又はシーケンスの終わりか、あるいはPSCが検出されたときにはステップS15で検出された位置をその結果として制御手段8へ送って本フローを終了する。
制御手段8は、検出手段5によりMPEGストリームからPSCが検出されると、図4に示すMPEGストリーム開始位置(A3)からPSC検出位置(B3)までのMPEGストリームを送出するよう送出手段6に指示する。
【0034】
図4は、送出手段6から、デコード手段7に送出されるMPEGストリームを示す図である。図中のA3からB3の区間がデコード手段7に転送される。
図1に戻って、送出手段6により送出されたMPEGストリームは、デコード手段7により復号され、映像情報として出力される。MPEGストリームの送出指示が終了すると同時に制御手段8はディスク読出手段3に新たな位置からのMPEGストリームの読み出しを指示し、以降同様な動作が繰り返される。
【0035】
以上のように、第1の実施の形態の圧縮画像再生方法は、MPEGストリームの記録時にディスク1中のストリームのSHCの位置を示すSHCインデックス2を用意し、ディスク1からMPEGストリームを読み出す際、SHCインデックス2の示すSHCの位置からのデータを読み出し、その後、継続するMPEGストリームからフレーム間符号化データのヘッダの検出するまでの、データを読み出し復号するようにしたので、ディスク読出手段3によって読み出されたストリームから、フレーム内符号化画像を含むMPEGストリームを容易に得ることができる。
【0036】
また、フレーム内符号化画像に比べ、フレーム間符号化画像はデータの量が少ないことから、MPEGストリームの先頭から順にPSCの検出を行うことに比べ、図3のPSC検出フローチャートでの処理が少なくなるため、PSCの検出時間の短縮を実現することができる。
なお、本実施の形態では、フレーム群のヘッダとしてシーケンスヘッダ(SHC)をインデックスとして用いたが、GSC(Group Start Code:GOP開始同期コード)や、PSC(Picture Start Code)を使用してもよい。
【0037】
第2の実施の形態
本実施の形態は、抽出されたMPEGストリームの末尾を加工することで、復号を行う装置に対し、ピクチャの終了であることを示すことができる圧縮画像再生方法を提供するものである。
【0038】
図5は、本発明の第2の実施の形態の圧縮画像再生方法の構成を示すブロック図である。本実施の形態の説明にあたり、図1と同一構成部分には同一符号を付して重複部分の説明を省略する。
図5において、図1の構成に、切り出したMPEGストリームの末尾を書き換えてコードを付加する末尾加工手段9が追加されて構成されている。
以下、上述のように構成された圧縮画像再生方法の動作を説明する。
【0039】
早送りなどのトリック再生時にMPEGストリームを切り出してデコード処理を行う時、MPEGストリームからストリームを切り出す等のMPEGストリームに対しての加工を行うために、デコード手段7がフレームの終了を検知できない。そこで本実施の形態では、切り出したストリームの末尾を、ストリームの終了であることを知らせるコードを付加することによってデコード手段に対し、フレームの終了を告知する。
【0040】
図6は、本実施の形態によって得られる末尾を加工したMPEGストリームを示す図である。
図6において、41は本圧縮画像再生方法において得られるMPEGストリーム、42はMPEGストリーム41を末尾加工手段9でMPEGストリームの末尾を書き換えることで得られるMPEGストリームである。
【0041】
第1の実施の形態で述べたPSC検出方法によってPSC検出の後、PSC検出後に得られるMPEGストリームについて図5の末尾加工手段手段9で前記MPEGストリームの末尾をシーケンスエンドコード(SEC)等の制御コードに書き換えることで加工し、再生制御手段8は、加工したストリームを送出するよう送出手段6に指示する。
【0042】
デコード手段7は、送出されるMPEGストリームから制御コードを検知すると、デコード処理を切り替える。これにより、強制的にフレームの終わりをデコード手段7に告知するので、デコード手段7がフレームの終わりを検知し損ねることがなくなり、フレームの終わりの検知の失敗による誤動作を防ぐことが実現できる。
【0043】
以上のように、第2の実施の形態の圧縮画像再生方法では、切り出したMPEGストリームの末尾を書き換えてコードを付加する末尾加工手段9を備え、MPEGストリームの末尾にフレーム内符号化データの終了を表すコードを付加することで、復号を行う装置に対し、確実にピクチャの終了であることを示すことができる。
なお、実施例においては書き換えるコードの例としてSECを挙げたが、フレームの終了を示すコードであれば任意である。
【0044】
第3の実施の形態
本実施の形態は、抽出されたストリームの復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出することができる圧縮画像再生方法を提供するものである。
【0045】
図7は、本発明の第3の実施の形態の圧縮画像再生方法の構成を示すブロック図である。本実施の形態の説明にあたり、図1と同一構成部分には同一符号を付して重複部分の説明を省略する。
図7において、図1の構成に、切り出したMPEGストリームの末尾に制御コードを付加する制御コード付加手段10が追加されて構成されている。
以下、上述のように構成された圧縮画像再生方法の動作を説明する。
【0046】
早送りなどのトリック再生時にストリームを切り出してデコード処理を行う時、切り出したフレーム内符号化画像を含むMPEGストリームをデコード手段に送出するが、連続して送出を行うと、通常のストリームの状態よりフレーム内符号化画像が多くなる。そのため、ビットレートがデコード手段が想定しているものより大きくなることによるビットバッファあふれ等によるデータ喪失が生じる。そこで本実施の形態では、切り出したストリームの末尾に制御コードを付加することで送出手段の制御を行い、ストリームの送出速度を調整する。
【0047】
図8は、本実施の形態によって得られる末尾に制御コードを付加したMPEGストリームを示す図である。
図8において、51は本圧縮画像再生方法において得られるMPEGストリーム、52はMPEGストリーム51に制御コード付加手段10でMPEGストリームの末尾に制御コードを付加することで得られるMPEGストリームである。
【0048】
図9は、制御コードによる送出処理の例を示すフローチャートであり、制御コード付加手段10によってMPEGストリームに付加された前記制御コードによって、送出手段6が制御される例を示す。
第1の実施の形態で述べたPSC検出方法によってPSC検出の後、PSC検出後に得られるMPEGストリームについて図7の制御コード付加手段10で前記MPEGストリームの末尾に制御コードを付加することで加工し、再生制御手段8は、加工したストリームを送出するよう送出手段6に指示する。
【0049】
まず、ステップS21で送出手段6は再生制御手段8から送出開始命令により、MPEGストリームの送出を開始し、ステップS22で制御コードを検出したか否かを判別する。制御コードが検出されなければ、ステップS23で制御コードを検知するまでは通常処理としてデコーダ手段7にMPEGストリームを送出する。
【0050】
送出されるMPEGストリームから制御コードを検知すると、ステップS24で送出処理を切り替え送出を中断し、ステップS25で一定期間ウェイトし、一定期間経過後に後に続くデータを送出する。
これにより、送出するMPEGストリームの送出速度を制御することができるので、デコード処理時のバッファあふれ等によるデータ喪失を防ぐことができ、また、再生制御手段8は送出手段6の処理終了を待つことなく、別の処理を行うことができる。
【0051】
第4の実施の形態
本実施の形態は、制御コードをパケットとして出力することで、ストリームが固定長のパケットに分割されたMPEG2トランスポートストリームのような形式においても、抽出されたストリームの復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出できる圧縮画像再生方法を提供するものである。
【0052】
図10は、本発明の第4の実施の形態の圧縮画像再生方法の構成を示すブロック図である。本実施の形態の説明にあたり、図1と同一構成部分には同一符号を付して重複部分の説明を省略する。
図10において、図1の構成に、切り出したMPEG2トランスポートストリームの末尾に、MPEGトランスポートストリームパケットと同じ長さの制御パケットを付加する制御パケット付加手段11が追加されて構成されている。
以下、上述のように構成された圧縮画像再生方法の動作を説明する。
【0053】
ストリームが固定長パケットに分割されたMPEG2トランスポートストリームのような場合において、抽出されたストリームの末尾に付加する制御コードも固定長のパケットであることが望ましい。そこで本実施の形態では、切り出したストリームの末尾に制御パケットを付加することで送出手段の制御を行い、ストリームの送出速度を調整する。
【0054】
図11は、本実施の形態によって得られる末尾に制御パケットを付加したMPEGストリームを示す図である。
図11において、61は本圧縮画像再生方法において得られるMPEGストリーム、62はMPEGストリーム61に前記制御パケット付加手段11でMPEGストリームの末尾に制御パケットを付加することで得られるMPEGストリームである。
【0055】
図12は、制御パケットによる送出処理の例を示すフローチャートであり、制御コード付加手段11によってMPEGストリームに付加された前記制御コードによって、送出手段6が制御される例を示す。
第1の実施の形態で述べたPSC検出方法によってPSC検出の後、PSC検出後に得られるMPEGストリームについて図10の制御パケット付加手段11で前記MPEGストリームの末尾に制御パケットを付加することで加工し、制御手段8は、加工したストリームを送出するよう送出手段6に指示する。
【0056】
まず、ステップS31で送出手段6は再生制御手段8から送出開始命令により、MPEGストリームの送出を開始し、ステップS32で制御パケットを検出したか否かを判別する。制御パケットが検出されなければ、ステップS33で制御コードを検知するまでは通常処理としてデコーダ手段7にMPEGストリームを送出する。
送出されるMPEGストリームから制御パケットを検知すると、ステップS34で送出処理6を切り替え、制御パケットを抜き取り、ステップS35でNullパケットを送出する。
【0057】
ステップS36では、再生制御手段8からNullパケット送出停止指示があるか否かを判別し、Nullパケット送出停止指示がなければステップS35に戻って再生制御手段8からNullパケット送出停止指示を受けるまでNullパケット送出を続ける。再生制御手段8からNullパケット送出停止指示を受けると、ステップS32に戻って送出手段6は通常処理に戻る。
これにより、送出するMPEGストリームの送出速度を制御することができるので、デコード処理時のバッファあふれ等によるデータ喪失を防ぐことができる。
【0058】
また、制御コードがTSパケットの形式をしているので、パケットの同期ずれ等による誤動作を防ぐことができる。
なお、本実施の形態では、付加する制御パケットの例として送出手段のNullパケット送出切り替えを挙げたが、デコード処理の切り替え等、他の利用も考えられる。
【0059】
なお、上記各実施の形態では、MPEG2システムにおいて映像、音声信号を入出力する圧縮画像再生方法に適用しているが、MPEGシステムに限るものでなく、他の圧縮画像再生装置に適用できる。また、ディスクから転送するデータストリームは、どのような形式のものでもよい。
【0060】
また、本実施の形態ではMPEGシステムを、例えばコンピュータ本体により行うことができる、MPEGアルゴリズムに基づく動画像符号化装置にはすべて適用でき、例えばこの手法を実現するために必要な環境としてはワークステーションやパーソナルコンピュータ以外にMPEGデコーダなどを外付けにした専用マシンでもよい。
【0061】
また、記録装置の種類や記録方法等は限定されず、全ての装置に適用可能である。例えば、記録装置として、HDDのほかDVD(Digital Video Disc)やCD−R/RW、MD(Mini Disc)に記録するものでもよい。特に、データ転送速度やランダム・アクセス性能が高く、高速アクセスが可能なHDDを記録媒体に用いれば、長時間記録した番組の中から所望の番組を瞬時に検索し、直ぐに利用することが可能になる。また、光磁気ディスク等HDD以外の記録装置を用いてもよく、同様の効果を得ることができる。
さらに、上記圧縮画像再生方法を構成する回路や部材の数、種類などは前述した実施の形態に限られないことは言うまでもなく、ソフトウェアにより実現するようにしてもよい。
【0062】
【発明の効果】
以上、詳述したように、本発明によれば、装置の構成が単純で、フレームの終了の検知や送出速度の制御が容易な圧縮画像再生方法を実現することができる。具体的には、以下のような効果を得ることができる。
請求項1乃至3記載の発明では、MPEGストリームから、GOPの開始位置から読み出し、ストリーム途中から次のフレーム間符号化データのヘッダを検出するまでのデータを復号する装置へ転送することによって、ヘッダ検出処理を軽減することができる。
【0063】
請求項4記載の発明では、抽出されたストリームの末尾を加工することで、復号を行う装置に対し、ピクチャの終りであることを確実に示すことができる。
請求項5記載の発明では、抽出されたストリームの復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出することができる。
【0064】
請求項6記載の発明では、制御コードをパケットとして出力することで、ストリームが固定長のパケットに分割されたMPEG2トランスポートストリームのような形式においても、抽出されたストリームの復号を行う装置へ転送する際に、制御コードを挿入した場合に、その後に抽出されたストリームの転送を遅らせることが可能となるため、復号を行う装置内のバッファをあふれさせることなくストリームを送出することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態の圧縮画像再生方法の構成を示すブロック図である。
【図2】本実施の形態の圧縮画像再生方法のディスクに記録されているMPEGストリームを示す図である。
【図3】本実施の形態の圧縮画像再生方法のMPEGストリーム中からPSCの検出を行う処理を示すフローチャートである。
【図4】本実施の形態の圧縮画像再生方法の送出手段からデコード手段に送出されるMPEGストリームを示す図である。
【図5】本発明の第2の実施の形態の圧縮画像再生方法の構成を示すブロック図である。
【図6】本実施の形態によって得られる末尾を加工したMPEGストリームを示す図である。
【図7】本発明の第3の実施の形態の圧縮画像再生方法の構成を示すブロック図である。
【図8】本実施の形態の圧縮画像再生方法の末尾に制御コードを付加したMPEGストリームを示す図である。
【図9】本実施の形態の圧縮画像再生方法の制御コードによる送出処理の例を示すフローチャートである。
【図10】本発明の第4の実施の形態の圧縮画像再生方法の構成を示すブロック図である。
【図11】本実施の形態の圧縮画像再生方法の末尾に制御パケットを付加したMPEGストリームを示す図である。
【図12】本実施の形態の圧縮画像再生方法の制御パケットによる送出処理の例を示すフローチャートである。
【図13】本実施の形態の圧縮画像再生方法のMPEG方式により動画像を圧縮する例を示す図である。
【符号の説明】
1 ディスク(記録媒体)
2 SHCインデックス
3 ディスク読出手段
4 メモリ
5 検出手段
6 送出手段
7 デコード手段
8 制御手段
9 末尾加工手段
10 制御コード付加手段
11 制御パケット付加手段
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a compressed image reproduction method, and more particularly to a compressed image reproduction method for reading an MPEG stream of a compressed image from a recording medium and decoding the read MPEG stream to reproduce image information.
[0002]
[Prior art]
Since video data has a very high data rate, it is difficult to record it on a disk medium such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory without processing the data. Therefore, a method is used in which video data and audio data are encoded with high efficiency to reduce the data rate to a rate that can be recorded on a disk medium without visual or auditory degradation.
[0003]
As an example of the high-efficiency encoding method, there is an MPEG (Moving Picture Experts Group) method.
The characteristics of MPEG are “Motion Compensation (MC)” that was not necessary for still image compression, random access of frames as a precondition for moving image compression, playback by fast forward and rewind playback. (Reverse direction) can be done.
[0004]
In MPEG, as described above, fast-forwarding, rewinding, and playback from the middle are basic, so that a GOP (Group of Pictures) is formed by grouping moving images of a certain unit, and independent for each unit. Playback is possible. As the prediction structure of the screen in the GOP, one picture (picture), I, B, and P picture each representing a moving picture frame is used.
[0005]
The pictures are classified into the following types according to the encoding method.
(1) I picture (Intra-coded picture)
When encoding, only the information that is closed in one image is used. In other words, when decoding, an image can be reconstructed using only the information of the I picture itself. Actually, encoding is performed by DCT (Discrete Cosine Transform) as it is without taking a difference from other images. This encoding method is generally inefficient, but random access and high-speed reproduction are possible if only this I picture is decoded with this in place. Further, reverse decoding can be performed by repeatedly decoding the I picture, storing it in the memory, and reading it in the reverse direction.
(2) P picture (Predictive-coded picture)
As the P picture, an I picture or P picture that has been positioned in time before input and has been decoded is used as a predicted picture (a picture that becomes a reference for obtaining a difference). That is, the frame is predicted from the past to the current one direction. Actually, it is possible to select the more efficient one of encoding the difference from the motion compensated predicted image or encoding without taking the difference (INTRA encoding) for each macroblock.
(3) B picture (Bidirectionally predictive-coded picture)
A B picture is an interpolation made from a previously predicted I picture or P picture that is temporally positioned as a predicted picture, an already decoded I picture or a P picture, and a previously decoded I picture or P picture. Use three types of images.
[0006]
Among the three types of motion-compensated difference encoding and INTRA encoding, the most efficient one can be selected for each macroblock.
In order to encode or decode a B picture in the GOP, the I picture or P picture that is behind in time that becomes the predicted image must be encoded first, so the GOP is configured. However, the I picture, the P picture, and the B picture need a predetermined order. However, the interval between the I pictures and the interval between the P pictures can be freely changed within the GOP.
[0007]
By the way, when an MPEG video or MPEG audio encoded stream (bit string) and other encoded streams are applied to an actual application, they are integrated and integrated into one stream including synchronization. Must be in a data format that conforms to a specific physical format or protocol possessed by storage media or networks.
[0008]
The MPEG2 system includes a program stream (MPEG2-PS, PS: Program Stream) that constitutes one program, and a transport stream (MPEG2-TS, TS: Transport Stream) that can constitute a plurality of programs, as in MPEG1. There is.
[0009]
The MPEG stream is a byte stream that is byte-aligned for each unit such as a header although there are many 1-bit flags. As a structure common to the entire MPEG system, the data portion that is not fixed length is preceded by information indicating the length. If unnecessary, that portion is skipped or the head of the next data group is confirmed and trusted. It has a data structure that enables highly-separated separation processing.
[0010]
An apparatus for receiving compressed video and audio signals in conformity with the MPEG2 encoding system is designed to receive video and audio sampling frequencies on the encoding side in order to prevent overflow and underflow of video and audio data on the decoding side. And the video, audio sampling frequency or STC (System Time Clock) on the decoding side must be matched.
[0011]
Therefore, the decoding apparatus uses PCR (Program Clock Reference) or SCR (System Clock Reference) defined by the MPEG2 system standard (ISO / IEC standard 13818-1). Thus, the video and audio sampling frequencies on the encoding side are matched with the video and audio sampling frequencies on the decoding side.
[0012]
FIG. 13 is a diagram illustrating an example in which a moving image is compressed by the MPEG method.
In FIG. 13, a plurality of parallelograms represent frames constituting a moving image. The process of compressing the moving picture of FIG. 13A by MPEG is shown in FIGS. 13B and 13C.
In MPEG, several frames are collectively called GOP. In FIG. 13B, video frames in the GOP 10 are classified into I frames, P frames, and B frames. The I frame indicates that intra-frame encoding has been performed, and the P frame indicates that forward encoding has been performed forward from the I frame, or forward prediction encoding has occurred from the P frame. The B frame is between the I frame and the P frame or between the P frames, and is predictively encoded from both directions of the I frame and the P frame. As an example, the prediction directions in the P frame 11 and the B frame 12 are indicated by arrows. In MPEG, the frame order shown in FIG. 13B is changed as shown in FIG. 13C to generate video encoded data.
[0013]
Since P frames and B frames are predictively encoded from I frames or video frames that are predictively encoded from I frames, in order to decode all video frames in a GOP, it is necessary to first decode from I frames. That is, when playing back a recorded moving image in the middle of random access or the like, it is necessary to decode from the I frame.
[0014]
In such a multimedia device adopting the MPEG system, it is preferable that so-called trick reproduction such as fast-forwarding can be performed in addition to normal reproduction. In general, in fast-forwarding, only a few frames included in an MPEG stream are often read and decoded and reproduced.
[0015]
In particular, a technique of extracting only I frames and performing decoding reproduction is often seen. At this time, it is necessary to specify the start position and the end position of the I frame. However, since the code amount of each frame of the MPEG compressed video stream is not constant and the start position and the end position are not known, it is displayed at high speed playback. It is difficult to read only frame data to be read one after another.
[0016]
In order to achieve this object, in the compressed image reproduction method described in Japanese Patent Laid-Open No. 7-123357, an MPEG stream of a compressed image obtained by intra-frame coding or inter-frame coding of image information in units of frames is recorded from a recording medium. In a compressed image reproducing apparatus that reads and decodes the read MPEG stream and reproduces image information, after detecting the header of the first intra-frame encoded image data from the MPEG stream read from the recording medium, It is determined that the reading of the first intra-frame encoded data is completed by detecting the header of the inter-frame encoded data immediately following the first intra-frame encoded image data from the MPEG stream, and the recording medium Of new second and third intra-frame encoded image data from the new recording position Is repeated, and the appearance interval of the intra-frame encoded image data in the MPEG stream read out in advance is measured to predict the recording position of the preceding and subsequent intra-frame encoded image data on the recording medium. Thus, the intra-frame encoded image is selectively reproduced.
[0017]
[Problems to be solved by the invention]
However, such a conventional compressed image reproduction method has the following problems. First, in order to identify the start position of intra-frame encoded image data, detection from the data read from the recording medium results in unnecessary access to the recording medium until detection, and the worst 1 GOP worth of data. Because it is necessary to check the data, it is not realistic. Next, in order to predict the interval between the intra-frame encoded data, it is necessary to change the prediction value according to the bit rate of the stream to be read, so that the configuration of the apparatus becomes complicated.
[0018]
In order to identify the end position of the intra-frame encoded data, it is necessary to check the intra-frame encoded data in order to detect the start position of the next frame. In general, since intra-frame encoded data has a larger data amount than other frames, the check range for detection is wide. Furthermore, if the stream is processed and only the intra-frame encoded data is transferred subsequently, the bit rate of the data to be transmitted increases, so that the decoder of the decoding device cannot keep up and the buffer may overflow.
The present invention has been made in view of such problems, and an object of the present invention is to provide a compressed image reproduction method in which the configuration of the apparatus is simple and the end of a frame is detected and the transmission speed is easily controlled. .
[0019]
[Means for Solving the Problems]
The compressed image reproduction method of the present invention reads image data from a recording medium and reads an MPEG stream of a compressed image in which a plurality of the frames are grouped into a frame group by intra-frame encoding or inter-frame encoding of image information in units of frames. In a compressed image reproduction method for reproducing image information by decoding an output MPEG stream, an index storing a header position of frame group data in the MPEG stream on the recording medium is prepared, and A device that reads and decodes data from the position of the header of the frame group data indicated by the index until the header of the inter-frame encoded data is detected from the continuous MPEG stream when reading the MPEG stream It is characterized by transferring to.
[0020]
Accordingly, header detection processing can be reduced by reading from the start position of the GOP from the MPEG stream and transferring the data from the middle of the stream until the header of the next inter-frame encoded data is detected. it can.
The header of the frame group data may be a sequence header code (SHC), and the header of the inter-frame encoded data may be a picture start code (PSC).
Preferably, the decoding device may decode only the first intra-frame encoded data.
[0021]
The compressed image reproduction method of the present invention processes the end of the extracted stream by adding a code indicating the end of the intra-frame encoded data to the end of the MPEG stream after detecting the header of the inter-frame encoded data. Thus, the end of the picture can be shown to the decoding apparatus.
[0022]
The compressed image reproduction method of the present invention adds a control code to the end of the MPEG stream read from the recording medium, and inserts the control code when transferring the extracted stream to a decoding device. In this case, since it is possible to delay the transfer of the extracted stream thereafter, it is possible to send the stream without overflowing the buffer in the decoding apparatus.
[0023]
In the compressed image reproduction method of the present invention, the control code is a control packet, and the control code is output as a packet so that the stream is divided into fixed-length packets. In this case, when a control code is inserted when transferring the extracted stream to the decoding device, it is possible to delay the transfer of the extracted stream thereafter. Stream can be sent without overflowing.
[0024]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, preferred embodiments of a compressed image reproduction method of the present invention will be described in detail with reference to the accompanying drawings.
First, the basic concept of the present invention will be described.
In the present invention, an index storing the position of a sequence header code (hereinafter referred to as SHC) in a stream on a recording medium is prepared, and data from the position indicated by the index is read.
[0025]
Next, it is necessary to detect the end position of the intra-frame encoded data. However, if the start position of the inter-frame encoded data immediately after the intra-frame encoded data (picture start code: hereinafter referred to as PSC) is detected. The detection range becomes wide and the processing load is high. Therefore, in the present invention, a method for detecting the PSC of the inter-frame encoded data from the middle of the read data is adopted. Thereby, since the search range can be narrowed, the processing load can be reduced. Although the detected range may include a plurality of pictures, it can be dealt with by decoding and displaying only the first intra-frame encoded data by a decoding apparatus. Note that it is possible to cope by registering not only SHC but also PSC in the index, but this is not preferable because the capacity of the index increases.
[0026]
In the present invention, the end of the extracted stream is processed. In an apparatus for decoding, the extracted stream is determined by the input of a start of the next picture or a sequence end code (hereinafter referred to as SEC) indicating the end of the GOP in the end of the picture being decoded. Therefore, a device that performs decoding cannot recognize the end of decoding only by sending out one intra-frame encoded data, and cannot display it on the screen. In the present invention, a code indicating the end of the picture is added to the end of the extracted stream to indicate to the decoding device that the end of the intra-frame encoded data. The code added to the end is an arbitrary code indicating the end of the picture, and examples thereof include SEC. Further, in the present invention, by adding a control code to the end of the extracted stream, the interval between the extracted streams is controlled, and the intra-frame encoded data tail is added without overflowing the buffer of the decoding apparatus. Send continuously.
[0027]
First embodiment
The present embodiment provides a compressed image reproduction method for reading from an MPEG stream from the start position of a GOP and transferring the data from the middle of the stream until the header of the next inter-frame encoded data is detected to the decoding apparatus. It is.
[0028]
FIG. 1 is a block diagram showing a configuration of a compressed image reproduction method according to the first embodiment of the present invention based on the above basic concept. The present embodiment is an example applied to an apparatus for realizing a moving image reproduction method using a disc.
In FIG. 1, a disc 1 (recording medium) for recording a compressed image such as an MPEG stream, an SHC index 2 indicating the position of a sequence header (SHC) of the stream in the disc 1 when the MPEG stream is recorded, and an MPEG from the disc 1 Disc reading means 3 for reading a stream, a memory 4 for temporarily storing an MPEG stream read from the disc 1 by the disc reading means 3, a detecting means 5 for detecting a picture start code (PSC) from the MPEG stream, and a decoding Sending means 6 for sending TS packets to means 7, decoding means 7 for decoding an image stream and outputting it as video information, playback control for managing and controlling disc reading means 3, header detecting means 5 and sending means 6, respectively. And means 8.
[0029]
Hereinafter, the operation of the compressed image reproduction method configured as described above will be described.
FIG. 2 is a diagram showing an MPEG stream recorded on the disc 1, FIG. 2 (a) shows a conventional method for detecting the header position (B1), and FIG. 2 (b) shows the present embodiment. The detection method of a header position (B2) is shown.
When only the intra-frame encoded image is cut out, the header position (B1) of the inter-frame encoded image can be searched from the head (A1) of the intra-frame encoded image as in the MPEG stream 31 of FIG. Necessary and very expensive.
[0030]
Therefore, in the present embodiment, the frame data header position (B2) is shifted from the position (A2) appropriately shifted from the header detection position of the intra-frame encoded image data as in the MPEG stream 32 of FIG. Try to detect. Since the amount of data of the inter-frame encoded image is smaller than that of the intra-frame encoded image, the load on header detection is reduced.
[0031]
In FIG. 1, the disk reading means 3 first receives an instruction from the control means 8 and starts reading the MPEG stream recorded in the memory 4 from the start position of the GOP indicated by the SHC index 2. The detecting means 5 detects PSC from the middle of the MPEG stream read out to the memory 4.
[0032]
FIG. 3 is a flowchart showing processing for detecting PSC from an MPEG stream. In the figure, S indicates a flow step.
According to the flowchart of FIG. 3, the detection means 5 first sets the detection start position to α in step S11, determines in step S12 whether the stream or sequence ends, and if not the stream or sequence ends, the PSC is detected in step S13. It is determined whether or not it has been detected. If no PSC is detected, the detection start position α is incremented by +1 in step S14, and the process returns to step S12 to repeat the detection process until a PSC is detected.
[0033]
When the end of the stream or sequence is detected or the PSC is detected, the position detected in step S15 is sent to the control means 8 as a result, and this flow is ended.
When the detection means 5 detects the PSC from the MPEG stream, the control means 8 instructs the sending means 6 to send the MPEG stream from the MPEG stream start position (A3) to the PSC detection position (B3) shown in FIG. To do.
[0034]
FIG. 4 is a diagram showing an MPEG stream sent from the sending means 6 to the decoding means 7. The section from A3 to B3 in the figure is transferred to the decoding means 7.
Returning to FIG. 1, the MPEG stream sent out by the sending means 6 is decoded by the decoding means 7 and outputted as video information. Simultaneously with the completion of the MPEG stream transmission instruction, the control means 8 instructs the disk reading means 3 to read the MPEG stream from a new position, and thereafter the same operation is repeated.
[0035]
As described above, in the compressed image reproduction method of the first embodiment, when the MPEG stream is recorded, the SHC index 2 indicating the SHC position of the stream in the disk 1 is prepared and the MPEG stream is read from the disk 1. Since the data from the SHC position indicated by the SHC index 2 is read and thereafter the data is read and decoded from the continuing MPEG stream until the header of the inter-frame encoded data is detected. An MPEG stream including an intra-frame encoded image can be easily obtained from the output stream.
[0036]
Also, since the amount of data in the inter-frame encoded image is smaller than that in the intra-frame encoded image, the processing in the PSC detection flowchart of FIG. 3 is less than in the case where the PSC detection is performed sequentially from the beginning of the MPEG stream. Therefore, the PSC detection time can be shortened.
In this embodiment, a sequence header (SHC) is used as an index as a frame group header. However, GSC (Group Start Code) or PSC (Picture Start Code) may be used. .
[0037]
Second embodiment
The present embodiment provides a compressed image reproduction method that can indicate the end of a picture to an apparatus that performs decoding by processing the end of the extracted MPEG stream.
[0038]
FIG. 5 is a block diagram showing a configuration of a compressed image reproduction method according to the second embodiment of the present invention. In the description of the present embodiment, the same components as those in FIG.
In FIG. 5, tail processing means 9 for rewriting the tail of the cut out MPEG stream and adding a code is added to the structure of FIG.
Hereinafter, the operation of the compressed image reproduction method configured as described above will be described.
[0039]
When the MPEG stream is cut out and decoded during trick play such as fast-forwarding, the decoding means 7 cannot detect the end of the frame because the MPEG stream is processed such as cutting out the stream from the MPEG stream. Therefore, in this embodiment, the end of the frame is notified to the decoding means by adding a code notifying the end of the stream to the end of the extracted stream.
[0040]
FIG. 6 is a diagram showing an MPEG stream obtained by processing the end obtained by the present embodiment.
In FIG. 6, reference numeral 41 denotes an MPEG stream obtained by the present compressed image reproduction method, and reference numeral 42 denotes an MPEG stream obtained by rewriting the end of the MPEG stream 41 by the tail processing means 9.
[0041]
After the PSC detection by the PSC detection method described in the first embodiment, the end of the MPEG stream is controlled by the end processing means 9 in FIG. 5 for the MPEG stream obtained after the PSC detection, such as a sequence end code (SEC). The reproduction control means 8 instructs the sending means 6 to send out the processed stream.
[0042]
When the decoding means 7 detects the control code from the transmitted MPEG stream, it switches the decoding process. As a result, the end of the frame is forcibly notified to the decoding means 7, so that the decoding means 7 does not fail to detect the end of the frame, and it is possible to prevent malfunction due to failure in detecting the end of the frame.
[0043]
As described above, the compressed image reproduction method according to the second embodiment includes the tail processing means 9 that rewrites the end of the extracted MPEG stream and adds a code, and ends the intra-frame encoded data at the end of the MPEG stream. By adding a code representing, it is possible to reliably indicate the end of the picture to the decoding apparatus.
In the embodiment, SEC is given as an example of the code to be rewritten, but any code may be used as long as it indicates the end of the frame.
[0044]
Third embodiment
In this embodiment, when a control code is inserted when transferring to an apparatus that decodes the extracted stream, the transfer of the extracted stream can be delayed, so that the apparatus that performs decoding is used. It is an object of the present invention to provide a compressed image reproduction method capable of sending a stream without overflowing the internal buffer.
[0045]
FIG. 7 is a block diagram showing a configuration of a compressed image reproduction method according to the third embodiment of the present invention. In the description of the present embodiment, the same components as those in FIG.
In FIG. 7, control code adding means 10 for adding a control code to the end of the extracted MPEG stream is added to the configuration of FIG.
Hereinafter, the operation of the compressed image reproduction method configured as described above will be described.
[0046]
When a stream is extracted and decoded during trick play such as fast-forwarding, an MPEG stream including the extracted intra-frame encoded image is sent to the decoding means. The number of inner encoded images increases. For this reason, data loss due to overflow of the bit buffer or the like due to the bit rate becoming larger than that assumed by the decoding means occurs. Therefore, in the present embodiment, the sending means is controlled by adding a control code to the end of the cut out stream to adjust the sending speed of the stream.
[0047]
FIG. 8 is a diagram showing an MPEG stream obtained by adding a control code to the end obtained by the present embodiment.
In FIG. 8, 51 is an MPEG stream obtained by this compressed image reproduction method, and 52 is an MPEG stream obtained by adding a control code to the end of the MPEG stream by the control code adding means 10 to the MPEG stream 51.
[0048]
FIG. 9 is a flowchart showing an example of transmission processing using a control code, and shows an example in which the transmission means 6 is controlled by the control code added to the MPEG stream by the control code addition means 10.
After the PSC detection by the PSC detection method described in the first embodiment, the MPEG stream obtained after the PSC detection is processed by adding a control code to the end of the MPEG stream by the control code adding means 10 in FIG. The reproduction control means 8 instructs the sending means 6 to send the processed stream.
[0049]
First, in step S21, the sending means 6 starts sending an MPEG stream by a sending start command from the reproduction control means 8, and determines whether or not a control code is detected in step S22. If no control code is detected, the MPEG stream is sent to the decoder means 7 as normal processing until the control code is detected in step S23.
[0050]
When a control code is detected from the MPEG stream to be sent, the sending process is switched in step S24, the sending is interrupted, a waiting period is set in step S25, and the subsequent data is sent after the elapse of the given period.
As a result, the transmission speed of the MPEG stream to be transmitted can be controlled, so that data loss due to buffer overflow or the like during the decoding process can be prevented, and the reproduction control means 8 waits for the processing of the sending means 6 to end. And another process can be performed.
[0051]
Fourth embodiment
In this embodiment, the control code is output as a packet so that the stream is transferred to a device that decodes the extracted stream even in a format such as an MPEG2 transport stream in which the stream is divided into fixed-length packets. In addition, when a control code is inserted, it is possible to delay the transfer of the extracted stream thereafter, and thus a compressed image reproduction method capable of sending a stream without overflowing the buffer in the decoding apparatus is provided. Is.
[0052]
FIG. 10 is a block diagram showing a configuration of a compressed image reproduction method according to the fourth embodiment of the present invention. In the description of the present embodiment, the same components as those in FIG.
In FIG. 10, control packet adding means 11 for adding a control packet having the same length as the MPEG transport stream packet is added to the end of the extracted MPEG2 transport stream in the configuration of FIG.
Hereinafter, the operation of the compressed image reproduction method configured as described above will be described.
[0053]
In the case of an MPEG2 transport stream in which the stream is divided into fixed-length packets, it is desirable that the control code added to the end of the extracted stream is also a fixed-length packet. Therefore, in this embodiment, the sending means is controlled by adding a control packet to the end of the cut out stream to adjust the sending speed of the stream.
[0054]
FIG. 11 is a diagram showing an MPEG stream obtained by adding a control packet to the end obtained by the present embodiment.
In FIG. 11, 61 is an MPEG stream obtained by this compressed image reproduction method, and 62 is an MPEG stream obtained by adding a control packet to the end of the MPEG stream by the control packet adding means 11 to the MPEG stream 61.
[0055]
FIG. 12 is a flowchart showing an example of transmission processing using a control packet, and shows an example in which the transmission means 6 is controlled by the control code added to the MPEG stream by the control code addition means 11.
After the PSC detection by the PSC detection method described in the first embodiment, the MPEG stream obtained after the PSC detection is processed by adding a control packet to the end of the MPEG stream by the control packet adding means 11 in FIG. The control means 8 instructs the sending means 6 to send the processed stream.
[0056]
First, in step S31, the sending means 6 starts sending an MPEG stream in response to a sending start command from the reproduction control means 8, and determines whether or not a control packet has been detected in step S32. If no control packet is detected, the MPEG stream is sent to the decoder means 7 as normal processing until a control code is detected in step S33.
When a control packet is detected from the transmitted MPEG stream, the transmission process 6 is switched in step S34, the control packet is extracted, and a null packet is transmitted in step S35.
[0057]
In step S36, it is determined whether or not there is a Null packet transmission stop instruction from the reproduction control means 8, and if there is no Null packet transmission stop instruction, the process returns to step S35 until a Null packet transmission stop instruction is received from the reproduction control means 8. Continue sending packets. When a Null packet transmission stop instruction is received from the reproduction control means 8, the process returns to step S32 and the transmission means 6 returns to the normal processing.
As a result, the transmission speed of the MPEG stream to be transmitted can be controlled, so that data loss due to buffer overflow or the like during decoding processing can be prevented.
[0058]
Further, since the control code is in the form of a TS packet, it is possible to prevent a malfunction due to a packet synchronization error or the like.
In the present embodiment, Null packet transmission switching of the transmission means is given as an example of the control packet to be added, but other uses such as switching of decoding processing are also conceivable.
[0059]
In each of the above-described embodiments, the present invention is applied to the compressed image reproduction method for inputting and outputting video and audio signals in the MPEG2 system. However, the present invention is not limited to the MPEG system and can be applied to other compressed image reproduction apparatuses. Further, the data stream transferred from the disk may be in any format.
[0060]
Further, in this embodiment, the MPEG system can be applied to all moving image encoding apparatuses based on the MPEG algorithm, which can be performed by, for example, a computer main body. For example, a workstation required as an environment necessary to realize this technique In addition to a personal computer, a dedicated machine with an external MPEG decoder may be used.
[0061]
Further, the type of recording apparatus, the recording method, and the like are not limited and can be applied to all apparatuses. For example, as a recording device, a recording device such as a DVD (Digital Video Disc), a CD-R / RW, or an MD (Mini Disc) in addition to the HDD may be used. In particular, if an HDD with high data transfer speed and random access performance and high-speed access is used as a recording medium, a desired program can be instantly retrieved from programs recorded for a long time and used immediately. Become. A recording device other than the HDD such as a magneto-optical disk may be used, and the same effect can be obtained.
Furthermore, it goes without saying that the number and types of circuits and members constituting the compressed image reproduction method are not limited to the above-described embodiments, and may be realized by software.
[0062]
【The invention's effect】
As described above in detail, according to the present invention, it is possible to realize a compressed image reproduction method that has a simple device configuration and that can easily detect the end of a frame and control the sending speed. Specifically, the following effects can be obtained.
According to the first to third aspects of the present invention, the header is read from the MPEG stream from the start position of the GOP and transferred to a device for decoding data from the middle of the stream until the header of the next interframe encoded data is detected. Detection processing can be reduced.
[0063]
In the invention according to claim 4, by processing the end of the extracted stream, it is possible to reliably indicate to the decoding apparatus that the end of the picture is reached.
According to the fifth aspect of the present invention, when the control code is inserted when transferring to the device that decodes the extracted stream, it is possible to delay the transfer of the extracted stream thereafter. The stream can be sent without overflowing the buffer in the device to be performed.
[0064]
According to the sixth aspect of the present invention, by outputting the control code as a packet, the stream is transferred to a device that decodes the extracted stream even in a format such as an MPEG2 transport stream in which the stream is divided into fixed-length packets. In this case, when the control code is inserted, it is possible to delay the transfer of the stream extracted thereafter, so that the stream can be transmitted without overflowing the buffer in the decoding apparatus.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a compressed image reproduction method according to a first embodiment of the present invention.
FIG. 2 is a diagram showing an MPEG stream recorded on a disc of the compressed image reproduction method of the present embodiment.
FIG. 3 is a flowchart showing processing for detecting PSC from an MPEG stream in the compressed image reproduction method according to the present embodiment;
FIG. 4 is a diagram showing an MPEG stream sent from the sending means to the decoding means in the compressed image reproduction method of the present embodiment.
FIG. 5 is a block diagram showing a configuration of a compressed image reproduction method according to a second embodiment of the present invention.
FIG. 6 is a diagram showing an MPEG stream obtained by processing the end obtained by the present embodiment.
FIG. 7 is a block diagram showing a configuration of a compressed image reproduction method according to a third embodiment of the present invention.
FIG. 8 is a diagram showing an MPEG stream in which a control code is added to the end of the compressed image reproduction method of the present embodiment.
FIG. 9 is a flowchart illustrating an example of transmission processing using a control code in the compressed image reproduction method according to the present embodiment;
FIG. 10 is a block diagram showing a configuration of a compressed image reproduction method according to a fourth embodiment of the present invention.
FIG. 11 is a diagram illustrating an MPEG stream in which a control packet is added to the end of the compressed image reproduction method according to the present embodiment.
FIG. 12 is a flowchart illustrating an example of transmission processing using a control packet in the compressed image reproduction method according to the present embodiment;
FIG. 13 is a diagram illustrating an example in which a moving image is compressed by the MPEG method of the compressed image reproduction method of the present embodiment.
[Explanation of symbols]
1 disc (recording medium)
2 SHC index
3 Disc reading means
4 memory
5 Detection means
6 Sending means
7 Decoding means
8 Control means
9 Finishing means
10 Control code adding means
11 Control packet addition means

Claims (6)

画像情報をフレーム単位に、フレーム内符号化、あるいはフレーム間符号化し、前記フレームを複数まとめてフレーム群とされた圧縮画像のMPEGストリームを記録媒体から読み出し、読み出されたMPEGストリームを復号して画像情報を再現する圧縮画像再生方法において、
前記記録媒体上のMPEGストリーム中の、フレーム群データのヘッダの位置を格納したインデックスを用意し、
前記記録媒体から前記MPEGストリームを読み出す際、前記インデックスの示すフレーム群データのヘッダの位置から所定量ずらした位置からのデータを読み出し、
継続する前記MPEGストリームからフレーム間符号化データのヘッダの検出するまでの、データを読み出し、復号を行う装置へ転送することを特徴とする圧縮画像再生方法。
Image information is encoded in units of frames, intra-frame encoded, or inter-frame encoded, and a plurality of frames are grouped into a frame group to read a compressed image MPEG stream from a recording medium, and the read MPEG stream is decoded. In a compressed image reproduction method for reproducing image information,
Prepare an index storing the position of the header of the frame group data in the MPEG stream on the recording medium,
When reading the MPEG stream from the recording medium, read data from a position shifted by a predetermined amount from the header position of the frame group data indicated by the index,
A compressed image reproduction method, comprising: reading data from the continuing MPEG stream until detecting a header of interframe encoded data and transferring the data to a decoding device.
前記フレーム群データのヘッダは、シーケンスヘッダコード(SHC)であり、前記フレーム間符号化データのヘッダは、ピクチャスタートコード(PSC)であることを特徴とする請求項1記載の圧縮画像再生方法。The compressed image reproduction method according to claim 1, wherein the header of the frame group data is a sequence header code (SHC), and the header of the inter-frame encoded data is a picture start code (PSC). 前記復号を行う装置では、最初のフレーム内符号化データのみを復号することを特徴とする請求項1記載の圧縮画像再生方法。2. The compressed image reproduction method according to claim 1, wherein the decoding apparatus decodes only the first intra-frame encoded data. 前記フレーム間符号化データのヘッダ検出後のMPEGストリームの末尾にフレーム内符号化データの終了を表すコードを付加することを特徴とする請求項1記載の圧縮画像再生方法。2. The compressed image reproduction method according to claim 1, wherein a code indicating the end of the intra-frame encoded data is added to the end of the MPEG stream after the header of the inter-frame encoded data is detected. 前記記録媒体から読み出された前記MPEGストリームの末尾に制御コードを付加することを特徴とする請求項1又は2に記載の圧縮画像再生方法。3. The compressed image reproduction method according to claim 1, wherein a control code is added to the end of the MPEG stream read from the recording medium. 前記制御コードは、制御用パケットであることを特徴とする請求項5記載の圧縮画像再生方法。6. The compressed image reproduction method according to claim 5, wherein the control code is a control packet.
JP2001109120A 2001-04-06 2001-04-06 Compressed image playback method Expired - Fee Related JP3648460B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001109120A JP3648460B2 (en) 2001-04-06 2001-04-06 Compressed image playback method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001109120A JP3648460B2 (en) 2001-04-06 2001-04-06 Compressed image playback method

Publications (2)

Publication Number Publication Date
JP2002305721A JP2002305721A (en) 2002-10-18
JP3648460B2 true JP3648460B2 (en) 2005-05-18

Family

ID=18961125

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001109120A Expired - Fee Related JP3648460B2 (en) 2001-04-06 2001-04-06 Compressed image playback method

Country Status (1)

Country Link
JP (1) JP3648460B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4693427B2 (en) * 2005-01-27 2011-06-01 京セラ株式会社 Digital broadcast receiver

Also Published As

Publication number Publication date
JP2002305721A (en) 2002-10-18

Similar Documents

Publication Publication Date Title
JP4418090B2 (en) Image processing method
US5802240A (en) Video editing apparatus
WO1999056280A1 (en) Recorder/reproducer
KR20060088303A (en) Apparatus and method recording/playing moving picture in digital broadcasting receiver
JP4337248B2 (en) Image information transmission apparatus, transmission system, and transmission method
JP2008065951A (en) Information processor, method, and program
WO2004030355A1 (en) Methods and apparatus for processing progressive i-slice refreshed mpeg data streams to enable trick play mode features on a display device
JP3253530B2 (en) Video recording device
JP3258673B2 (en) Moving image recording device and moving image reproducing device
JP3648460B2 (en) Compressed image playback method
JP3156507B2 (en) Image decoding device
JP3652994B2 (en) Data input / output device
JP4736918B2 (en) Digital playback device or playback program
JP4377079B2 (en) Signal processing method and signal processing apparatus
JP3657855B2 (en) Image decoding apparatus and image decoding method
JP3964563B2 (en) Video server device
JP3704356B2 (en) Decoded video signal decoding apparatus and storage decoding apparatus using the same
JPH10285545A (en) Video signal compression encoding and recording device, compression-encoded video signal reproducing device, video signal recording/reproducing device and methods for the devices
JP4284830B2 (en) Moving picture editing / decoding apparatus and method
JP2001211420A (en) Edit method and edit device for compression coded stream in recording disk medium
JP3695424B2 (en) Playback device
JP4217504B2 (en) Image reproduction method and method
JP2002281458A (en) Device and method for decoding and reproducing image information
JP2004140723A (en) Method and device for reproducing digital video information
JP3568503B2 (en) MPEG video decoder

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041029

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050107

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050214

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090218

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110218

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees