JPH10257437A - Mpeg encoder/decoder - Google Patents

Mpeg encoder/decoder

Info

Publication number
JPH10257437A
JPH10257437A JP9058135A JP5813597A JPH10257437A JP H10257437 A JPH10257437 A JP H10257437A JP 9058135 A JP9058135 A JP 9058135A JP 5813597 A JP5813597 A JP 5813597A JP H10257437 A JPH10257437 A JP H10257437A
Authority
JP
Japan
Prior art keywords
audio
frame
video
stream
mpeg
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9058135A
Other languages
Japanese (ja)
Inventor
Yasunori Okada
恭典 岡田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP9058135A priority Critical patent/JPH10257437A/en
Publication of JPH10257437A publication Critical patent/JPH10257437A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an MPEG encoder/decoder for preventing noises from being generated at the time of reproduction start even without performing any complicated processing on the side of the decoder when starting reproduction from the head of GOP in the middle of the stream such as jump reproduction. SOLUTION: An audio frame detection part 105 retrieves an audio stream provided by MPEG encoding and detects the respective heads of plural audio frames consisting of that audio stream. Based on the detected result, an audio packeting part 106 packets the audio stream so as not to store the plural audio frames dividely in mutually different packets.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、MPEG符号化/
復号化装置に関し、より特定的には、ジャンプ再生を行
う際に発生する雑音を防止する機能を備えたMPEG符
号化/復号化装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an MPEG encoding / decoding system.
More specifically, the present invention relates to an MPEG encoding / decoding device having a function of preventing noise generated when performing jump reproduction.

【0002】[0002]

【従来の技術】近年、大量の映像・音声情報を蓄積し、
提供するビデオサーバーの研究が進められている。ビデ
オサーバでは、映像・音声情報は、ディジタル化して符
号化され、その情報量が大幅に圧縮された圧縮データ
(ストリーム)としてディスク等に格納されている。そ
の符号化方式としては一般に、動画像符号化の国際標準
方式であるMPEG(Moving Pictures
Experts Group)が採用されている。こ
うしたビデオサーバなどに設けられ、MPEGで映像・
音声情報の符号化/復号化を行う装置が、MPEG符号
化/復号化装置である。
2. Description of the Related Art In recent years, a large amount of video and audio information has been accumulated,
Research on the video server provided is underway. In a video server, video / audio information is digitized and encoded, and the amount of information is stored on a disk or the like as compressed data (stream) in which the information amount is largely compressed. Generally, the encoding method is MPEG (Moving Pictures), which is an international standard method for moving picture encoding.
Experts Group) is employed. It is provided in such a video server, etc.
A device that encodes / decodes audio information is an MPEG encoding / decoding device.

【0003】図7は、MPEGで用いられるストリーム
の構造を示す図である。図7(1)はプログラムストリ
ーム、(2)はビデオエレメンタリストリーム、(3)
はオーディオエレメンタリストリームを示している。な
お、プログラムストリームは、ビデオエレメンタリスト
リームをペイロードに格納したPESパケットとオーデ
ィオエレメンタリストリームをペイロードに格納したP
ESパケットとを多重化することにより得られる。
FIG. 7 is a diagram showing the structure of a stream used in MPEG. 7A shows a program stream, FIG. 7B shows a video elementary stream, and FIG.
Indicates an audio elementary stream. The program stream is composed of a PES packet storing a video elementary stream in a payload and a PES packet storing an audio elementary stream in a payload.
It is obtained by multiplexing with an ES packet.

【0004】以下には、図7(1)〜(3)のストリー
ムがそれぞれどのようにして構成されるかについて説明
する。ディジタル化され、MPEGで符号化して得られ
たビデオデータの集合で複数のビデオフレームが構成さ
れ、各ビデオフレームには、それぞれの先頭にピクチャ
ヘッダが付与される。付与されるピクチャヘッダには、
そのビデオフレームの属性(I/P/Bフレーム)など
が記述されている。
The following describes how the streams shown in FIGS. 7 (1) to 7 (3) are constructed. A plurality of video frames are composed of a set of video data obtained by digitization and encoding by MPEG, and a picture header is added to the head of each video frame. In the picture header to be given,
The attribute (I / P / B frame) of the video frame is described.

【0005】ここで、Iフレームは、フレーム内符号化
されたフレームであり、そのフレーム単独で復号化でき
る。Pフレームは、過去のIまたはPフレームを参照し
て符号化されたフレームであり、Bフレームは、過去と
未来の2枚のフレームを参照して符号化されたフレーム
である。PおよびBフレームでは、予測フレームとの差
分が符号化されているため、Iフレームに比べてデータ
量が削減されているが、そのフレーム単独では復号化で
きない。
[0005] Here, the I frame is an intra-coded frame, and can be decoded by itself. The P frame is a frame encoded with reference to a past I or P frame, and the B frame is a frame encoded with reference to two past and future frames. In the P and B frames, since the difference from the predicted frame is encoded, the data amount is reduced as compared with the I frame, but the frame cannot be decoded alone.

【0006】複数のビデオフレームで1つのGOP(G
roup of Pictures)が構成され、GO
Pの先頭にはGOPヘッダが付与される。GOPは、ラ
ンダムアクセスできるビデオデータの集合の最小単位で
あって、15フレームを1GOPとするのが一般的であ
る。さらに、複数のGOPで1つのシーケンスが構成さ
れ、シーケンスの先頭にはシーケンスヘッダが付与され
る。そして、複数のシーケンスでビデオエレメンタリス
トリームが構成される。
A plurality of video frames constitute one GOP (GOP).
group of Pictures) is composed and GO
A GOP header is added to the head of P. A GOP is the minimum unit of a set of video data that can be randomly accessed, and generally 15 frames are defined as one GOP. Further, one sequence is composed of a plurality of GOPs, and a sequence header is added to the beginning of the sequence. Then, a video elementary stream is composed of a plurality of sequences.

【0007】一方、ディジタル化され、MPEGで符号
化して得られたオーディオデータの集合で複数のオーデ
ィオフレームが構成され、各オーディオフレームにはそ
れぞれの先頭にヘッダが付与される。オーディオフレー
ムは、それ単独で復号化できるオーディオデータの集合
の最小単位である。
On the other hand, a plurality of audio frames are constituted by a set of audio data obtained by digitizing and encoding by MPEG, and a header is added to the head of each audio frame. An audio frame is the smallest unit of a set of audio data that can be decoded by itself.

【0008】上記のようにして構成されたビデオエレメ
ンタリストリームおよびオーディオエレメンタリストリ
ームは、それぞれ複数のPESパケットのペイロード部
分に分割して格納することにより、パケット化される。
PESパケットのペイロード部分の長さ(ペイロード
長)は予め一律に決められているため、ビデオエレメン
タリストリームおよびオーディオエレメンタリストリー
ムは、それぞれこのペイロード長に応じて分割されるこ
とになる。従って、一つのビデオフレーム/オーディオ
フレームが複数のPESパケットに分割して格納される
ことがある。なお、1つのPESパケットにビデオおよ
びオーディオの両方のデータが格納されることはない。
[0008] The video elementary stream and the audio elementary stream configured as described above are packetized by dividing into a plurality of PES packets and storing them.
Since the length (payload length) of the payload portion of the PES packet is determined uniformly in advance, the video elementary stream and the audio elementary stream are each divided according to the payload length. Therefore, one video frame / audio frame may be divided into a plurality of PES packets and stored. Note that neither video nor audio data is stored in one PES packet.

【0009】ビデオフレームまたはオーディオフレーム
の先頭部分を含むPESパケットには、それぞれのヘッ
ダ部分(PESヘッダ)に、そのフレームを表示すべき
時刻を示すタイムスタンプ(Presentation
Time Stamp;以下、PTS)が含まれてい
る。さらに、複数のPESパケットでパックが構成さ
れ、その先頭にはパックヘッダが付与される。そして、
複数のパックでプログラムストリームが構成される。
In a PES packet including a head portion of a video frame or an audio frame, a time stamp (Presentation) indicating a time at which the frame is to be displayed is provided in each header portion (PES header).
Time Stamp (hereinafter, PTS) is included. Further, a pack is composed of a plurality of PES packets, and a pack header is added to the head of the pack. And
A program stream is composed of a plurality of packs.

【0010】ところで、ビデオサーバにおけるアプリケ
ーションの一つに、クライアントの要求に応じて映像や
音声データを随時供給するビデオ・オン・デマンド(V
OD)がある。VODでは、高速再生やスロー再生、ジ
ャンプ再生などの特殊再生機能を実現することが求めら
れる。これらのうち、ジャンプ再生は、ユーザが任意に
指定した位置から再生を開始する機能であるが、MPE
Gを用いたビデオサーバーでは、GOPがランダムアク
セスの単位となるため、指定された再生開始位置を含む
GOPの先頭からプログラムストリームの再生が開始さ
れなければならない。
[0010] By the way, video-on-demand (V), which supplies video and audio data as needed to one of the applications in the video server in response to a request from the client.
OD). In VOD, it is required to realize special playback functions such as high-speed playback, slow playback, and jump playback. Among these, the jump playback is a function of starting playback from a position arbitrarily designated by the user.
In a video server using G, since the GOP is a unit of random access, the reproduction of the program stream must be started from the beginning of the GOP including the specified reproduction start position.

【0011】しかし、すでに述べたように、プログラム
ストリームは複数のPESパケットで構成されており、
デコーダへの入力もパケット単位で行われる。そして、
各PESパケットには、予め決められたペイロード長に
応じて分割されたビデオエレメンタリストリーム/オー
ディオエレメンタリストリームが格納されている。その
ため、再生開始時、最初に復号化されるビデオパケット
のペイロードの先頭位置に、直前のビデオパケットにそ
の一部が格納されているビデオフレームの残りの部分
(以下、ビデオフレームの断片)が含まれていて、その
断片が再生された結果、映像の乱れが生じることがあ
る。
However, as described above, the program stream is composed of a plurality of PES packets.
Input to the decoder is also performed in packet units. And
Each PES packet stores a video elementary stream / audio elementary stream divided according to a predetermined payload length. Therefore, at the start of playback, the beginning of the payload of the video packet to be decoded first includes the remaining portion of the video frame (hereinafter, a fragment of the video frame) of which a part is stored in the immediately preceding video packet. And the fragments are played back, which may result in video distortion.

【0012】同様に、再生開始時、最初に復号化される
オーディオパケットのペイロードの先頭位置に、直前の
オーディオパケットにその一部が格納されているオーデ
ィオフレームの残りの部分(オーディオフレームの断
片)が含まれていて、その断片が再生された結果、雑音
が発生することがある。
Similarly, at the start of reproduction, at the head position of the payload of the audio packet to be decoded first, the rest of the audio frame (a fragment of the audio frame), a part of which is stored in the immediately preceding audio packet. May be included, and noise may be generated as a result of reproducing the fragment.

【0013】この種の雑音の発生を防止するものとして
は、特開平6−86224号公報に開示された情報記録
再生装置が知られている(なお、この装置は、静止画を
再生する際に発生する雑音を防止するものであるが、静
止画を再生する際に発生する雑音を防止することと、ジ
ャンプ再生時の雑音を防ぐこととは同等である)。この
装置では、再生装置側で、オーディオフレームの先頭部
分に付加されている音声同期信号を検出するようにして
いる。そして、音声同期信号が検出されるまでは、伝送
されてきたオーディオパケットをデコーダに入力せず、
音声同期信号が検出された次のパケットからデコーダに
入力する動作を開始するようにしている。これにより、
再生開始時、オーディオフレームの断片がデコーダに入
力されることがなくなるため、雑音の発生が防止され
る。
As a device for preventing the generation of this kind of noise, an information recording / reproducing apparatus disclosed in Japanese Patent Laid-Open No. 6-86224 is known. Although the noise generated is prevented, the noise generated when a still image is reproduced is equivalent to the noise generated during jump reproduction.) In this device, the playback device detects an audio synchronization signal added to the beginning of an audio frame. Until the audio synchronization signal is detected, the transmitted audio packet is not input to the decoder,
The operation of inputting to the decoder from the packet following the detection of the audio synchronization signal is started. This allows
At the start of the reproduction, no fragment of the audio frame is input to the decoder, so that generation of noise is prevented.

【0014】図8は、ジャンプ再生時の、再生開始位置
付近のプログラムストリームの一例を示す図である。図
8において、…、VN、V0、V1、…は、それぞれビ
デオパケットであり、V0には、GOPの先頭部分のビ
デオデータが格納されている。…、AM、A0、A1、
…は、それぞれオーディオパケットである。
FIG. 8 is a diagram showing an example of a program stream near the reproduction start position during jump reproduction. In FIG. 8,..., VN, V0, V1,... Are video packets, respectively, and V0 stores the video data at the head of the GOP. …, AM, A0, A1,
Are audio packets.

【0015】図8のストリームを、図中に示す再生開始
位置にジャンプして再生を開始する場合、V0以降のパ
ケットが順次的にデコーダに入力されることになる。再
生開始時、最初に入力されるビデオパケット(V0)に
ビデオフレームの断片が含まれていて映像の乱れが生じ
ること、また、最初に入力されるオーディオパケット
(A0)にオーディオフレームの断片が含まれていて雑
音が発生することはすでに説明した。
When the stream shown in FIG. 8 is jumped to the playback start position shown in the figure to start playback, packets after V0 are sequentially input to the decoder. At the start of playback, the first input video packet (V0) contains a video frame fragment, which causes video disturbance, and the first input audio packet (A0) contains an audio frame fragment. It has already been explained that noise is generated due to noise.

【0016】加えて、最初に入力されるオーディオパケ
ット(A0)が、必ずしも再生開始位置以降のビデオパ
ケットに対応しているとは限らず、例えばVMやVNに
対応している可能性がある。この場合、再生開始時、再
生開始位置以前の音声が再生されてしまう不都合が起こ
る。
In addition, the audio packet (A0) input first does not always correspond to the video packet after the reproduction start position, and may correspond to, for example, VM or VN. In this case, at the time of starting the reproduction, there is a disadvantage that the sound before the reproduction start position is reproduced.

【0017】上記公報に示された装置では、この不都合
を防ぐために、再生開始時、最初のオーディオパケット
が、最初のビデオパケットよりも少なくとも時間ΔT
(=T2−T1;T1はビデオパケットの伝送時刻、T
2は表示時刻)だけ経過した後に送られてくることに着
目して、最初のビデオパケットが送られてきてから、時
間ΔTだけ経過した時点で、オーディオパケットをデコ
ーダに入力する動作を開始するようにしている。これに
より、再生開始時、再生開始位置以前の音声が再生され
ることがなくなる。
In the apparatus disclosed in the above publication, in order to prevent this inconvenience, at the time of starting reproduction, the first audio packet is at least ΔT longer than the first video packet.
(= T2-T1; T1 is the transmission time of the video packet, T
(2 is the display time), the operation of inputting the audio packet to the decoder is started at the time when the time ΔT elapses after the first video packet is transmitted after the first video packet is transmitted. I have to. As a result, at the start of the reproduction, the sound before the reproduction start position is not reproduced.

【0018】[0018]

【発明が解決しようとする課題】しかし、上記公報に示
された装置では、再生装置(復号化装置)側で音声同期
信号を検出し、かつ検出結果に基づいてデコーダへのオ
ーディオパケットの入力動作を制御しているため、再生
装置側の構成が複雑である。従って、同様の機能を、ク
ライアント毎に復号化装置を設けるようなMPEG符号
化・復号化装置において実現した場合、クライアントの
数が多くなるのに従って、MPEG符号化・復号化装置
全体が大規模かつ高価になる。
However, in the apparatus disclosed in the above publication, a reproducing apparatus (decoding apparatus) detects an audio synchronizing signal, and an operation of inputting an audio packet to a decoder based on the detection result. , The configuration of the reproducing apparatus is complicated. Therefore, when the same function is realized in an MPEG encoding / decoding device in which a decoding device is provided for each client, as the number of clients increases, the entire MPEG encoding / decoding device becomes larger and larger. It will be expensive.

【0019】また、上記公報に示された装置では、送ら
れてきたビデオパケットがいったんバッファリングされ
る一方、送られてきたオーディオパケットはバッファリ
ングされずにリアルタイムに再生されることが前提とな
っている。しかし、MPEG復号化装置では通常、オー
ディオパケットもいったんバッファリングして再生され
るため、最初のビデオパケットが送られてきてから時間
ΔTだけ経過した時点でオーディオパケットをデコーダ
に入力する動作を開始しても、再生開始位置以前の音声
が再生されないとは限らない。
In the apparatus disclosed in the above publication, it is assumed that the transmitted video packets are temporarily buffered, while the transmitted audio packets are not buffered and are reproduced in real time. ing. However, since the MPEG decoding apparatus normally buffers and reproduces the audio packet once, the operation of inputting the audio packet to the decoder is started when a time ΔT has elapsed since the first video packet was sent. However, the sound before the reproduction start position is not necessarily reproduced.

【0020】それゆえに、本発明の目的は、ジャンプ再
生など、ストリーム途中のGOPの先頭から再生を開始
する際、復号化装置側で複雑な処理を行わなくても、再
生開始時に発生する雑音を防ぐことができるようなMP
EG符号化装置を提供することである。
Therefore, an object of the present invention is to reduce noise generated at the start of reproduction, such as jump reproduction, when starting reproduction from the beginning of a GOP in the middle of a stream without performing complicated processing on the decoding device side. MP that can be prevented
An EG encoding device is provided.

【0021】また、本発明の他の目的は、ジャンプ再生
など、ストリーム途中のGOPの先頭から再生を開始す
る際、再生開始位置以前の音声が再生されることを防ぐ
ことができるようなMPEG復号化装置を提供すること
である。
Another object of the present invention is to provide an MPEG decoding system which can prevent reproduction of sound before a reproduction start position when reproduction is started from the beginning of a GOP in the middle of a stream, such as jump reproduction. It is to provide a chemical conversion device.

【0022】[0022]

【課題を解決するための手段および発明の効果】第1の
発明のMPEG符号化装置は、オーディオデータをMP
EG方式で符号化するMPEG符号化手段と、MPEG
符号化手段が符号化して得られたオーディオストリーム
を検索して、当該ストリームを構成している複数のオー
ディオフレームのそれぞれの先頭を検出するオーディオ
フレーム検出手段と、オーディオフレーム検出手段の検
出結果に関連して、オーディオストリームをパケット化
するパケット化手段とを備え、パケット化手段は、複数
のオーディオフレームが、いずれも互いに異なるパケッ
トに分割して格納されることのないように、パケット化
することを特徴としている。
Means for Solving the Problems and Effects of the Invention The MPEG encoding apparatus according to the first invention converts audio data into MP data.
MPEG encoding means for encoding in the EG system, MPEG
An audio frame detecting unit that searches for an audio stream obtained by the encoding unit and detects the head of each of a plurality of audio frames forming the stream; And packetizing means for packetizing the audio stream, wherein the packetizing means performs packetization such that none of the plurality of audio frames is divided into different packets and stored. Features.

【0023】上記のように、第1の発明では、MPEG
方式で符号化して得られたオーディオストリームを検索
して、そのストリームを構成している複数のオーディオ
フレームの、それぞれの先頭を検出する。そして、その
検出結果に基づいて、オーディオストリームを、複数の
オーディオフレームがいずれも互いに異なるパケットに
分割して格納されることのないように、パケット化す
る。
As described above, in the first invention, MPEG
An audio stream obtained by encoding according to the method is searched, and the head of each of a plurality of audio frames constituting the stream is detected. Then, based on the detection result, the audio stream is packetized so that any of the plurality of audio frames is not divided into different packets and stored.

【0024】ジャンプ再生など、ストリーム途中のGO
Pの先頭から再生を開始する場合、最初に復号化される
オーディオパケットのペイロード部分の先頭に、直前の
オーディオパケットにその一部が格納されているオーデ
ィオフレームの残りの部分(以下、オーディオフレーム
の断片)が格納されていて、その断片が再生された結
果、雑音が発生することがある。そこで、オーディオス
トリームをパケット化する際、各オーディオフレームが
いずれも互いに異なるパケットに分割して格納されるこ
とのないようにパケット化する。これにより、最初に復
号化されるオーディオパケットにオーディオフレームの
断片が格納されていることがなくなり、その結果、復号
化装置側で複雑な処理を行わなくても、再生開始時に雑
音が発生することがなくなる。
GO in the middle of a stream such as jump playback
When playback is started from the beginning of P, at the beginning of the payload portion of the audio packet to be decoded first, the remaining portion of the audio frame whose part is stored in the immediately preceding audio packet (hereinafter, the audio frame) Fragment) is stored, and as a result of reproducing the fragment, noise may be generated. Therefore, when packetizing an audio stream, each audio frame is packetized so as not to be divided into different packets and stored. As a result, a fragment of an audio frame is not stored in an audio packet to be decoded first. As a result, noise is generated at the start of reproduction without performing complicated processing on the decoding device side. Disappears.

【0025】第2の発明のMPEG復号化装置は、ビデ
オストリームおよびオーディオストリームを一時格納す
るためのバッファと、バッファに格納されたビデオスト
リームおよびオーディオストリームを復号化するMPE
G復号化手段と、MPEG復号化手段の動作を制御する
制御手段とを備え、制御手段は、再生開始時、オーディ
オストリームを構成している複数のオーディオフレーム
のうち現在復号化されつつあるオーディオフレームの表
示時刻と、ビデオストリームを構成している複数のビデ
オフレームのうち最初に表示されるべきビデオフレーム
のそれとを比較して、比較の結果、当該オーディオフレ
ームの表示時刻が当該ビデオフレームのそれより早い場
合には、MPEG復号化手段に指示して、当該オーディ
オフレームを復号化して得られたオーディオデータの出
力を行わせないことを特徴としている。
An MPEG decoding apparatus according to a second aspect of the present invention provides a buffer for temporarily storing a video stream and an audio stream, and an MPE for decoding the video stream and the audio stream stored in the buffer.
G decoding means, and control means for controlling the operation of the MPEG decoding means, wherein at the start of playback, the audio frame currently being decoded among a plurality of audio frames constituting the audio stream, The display time of the audio frame is compared with that of the video frame to be displayed first among the plurality of video frames constituting the video stream, and as a result of the comparison, the display time of the audio frame is more than that of the video frame. If it is early, it is characterized in that it instructs the MPEG decoding means to not output audio data obtained by decoding the audio frame.

【0026】上記のように、第2の発明では、再生開始
時、バッファから読み出されて復号化されつつあるオー
ディオフレームの表示時刻と、バッファに格納されてい
る最初に表示されるべきビデオフレームのそれとを比較
する。そして、比較の結果、復号化されつつあるオーデ
ィオフレームの表示時刻が、最初に表示されるべきビデ
オフレームのそれより早い場合には、そのオーディオフ
レームを復号化して得られたオーディオデータの出力を
行わない。
As described above, according to the second invention, at the start of reproduction, the display time of the audio frame being read from the buffer and being decoded and the video frame stored in the buffer to be displayed first are displayed. Compare with that of If the comparison result shows that the display time of the audio frame being decoded is earlier than that of the video frame to be displayed first, the audio data obtained by decoding the audio frame is output. Absent.

【0027】ジャンプ再生など、ストリーム途中のGO
Pの先頭から再生を開始する場合、最初に復号化される
オーディオフレームが再生開始位置以前のビデオフレー
ムに対応していて、その結果、再生開始位置以前の音声
が再生されることがある。そこで、再生開始時、現在復
号化されつつあるオーディオフレームの表示時刻と、バ
ッファに格納されている最初に表示されるべきビデオフ
レームの表示時刻とを比較する。比較の結果、復号化さ
れつつあるオーディオフレームの表示時刻が、最初に表
示されるべきビデオフレームのそれより早い場合には、
そのオーディオフレームを復号して得られたオーディオ
データの出力を行わないようにする。これにより、再生
開始時、再生開始位置以前の音声が再生されることがな
くなる。
GO in the middle of a stream such as jump playback
When the reproduction is started from the beginning of P, the audio frame to be decoded first corresponds to the video frame before the reproduction start position, and as a result, the sound before the reproduction start position may be reproduced. Therefore, at the start of playback, the display time of the audio frame currently being decoded is compared with the display time of the first video frame stored in the buffer to be displayed. If the result of the comparison shows that the display time of the audio frame being decoded is earlier than that of the video frame to be displayed first,
The audio data obtained by decoding the audio frame is not output. As a result, at the start of the reproduction, the sound before the reproduction start position is not reproduced.

【0028】[0028]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

(第1の実施形態)以下、本発明の第1の実施形態につ
いて、図面を参照しながら説明する。図1は、本発明の
第1の実施形態に係るMPEG符号化・復号化装置の構
成を示すブロック図である。図1のMPEG符号化・復
号化装置は、符号化装置10と復号化装置11とからな
り、符号化装置10は、MPEGエンコーダ101、G
OP検出部102、ビデオフレーム検出部103、ビデ
オパケット化部104、オーディオフレーム検出部10
5、オーディオパケット化部106、多重化部107を
備えている。復号化装置11は、MPEGデコーダ11
1、バッファ部112を備えている。バッファ部112
は、チャネルバッファ112aおよびヘッダバッファ1
12bを含む。
(First Embodiment) Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the MPEG encoding / decoding device according to the first embodiment of the present invention. The MPEG encoding / decoding device in FIG. 1 includes an encoding device 10 and a decoding device 11, and the encoding device 10 includes an MPEG encoder 101 and a G encoder.
OP detector 102, video frame detector 103, video packetizer 104, audio frame detector 10
5, an audio packetizing unit 106 and a multiplexing unit 107 are provided. The decoding device 11 includes an MPEG decoder 11
1. A buffer unit 112 is provided. Buffer unit 112
Are the channel buffer 112a and the header buffer 1
12b.

【0029】MPEGエンコーダ101は、ビデオデー
タおよびオーディオデータをMPEGで符号化する。G
OP検出部102は、MPEGエンコーダ101が符号
化して得られたビデオストリームを検索して、GOPの
先頭を検出する。ビデオフレーム検出部103は、MP
EGエンコーダ101が符号化して得られたビデオスト
リームを検索して、ビデオフレームの先頭を検出する。
ビデオパケット化部104は、MPEGエンコーダ10
1が符号化して得られたビデオストリームをパケット化
する。
The MPEG encoder 101 encodes video data and audio data using MPEG. G
The OP detection unit 102 searches for a video stream obtained by encoding by the MPEG encoder 101, and detects the beginning of a GOP. The video frame detection unit 103
The EG encoder 101 searches for a video stream obtained by encoding, and detects the beginning of a video frame.
The video packetizer 104 includes the MPEG encoder 10
1 packetizes the video stream obtained by encoding.

【0030】オーディオフレーム検出部105は、MP
EGエンコーダ101が符号化して得られたオーディオ
ストリームを検索して、オーディオフレームの先頭を検
出する。オーディオパケット化部106は、MPEGエ
ンコーダ101が符号化して得られたオーディオストリ
ームをパケット化する。多重化部107は、ビデオパケ
ット化部104がパケット化して得られたPESパケッ
ト(ビデオパケット)と、オーディオパケット化部10
6がパケット化して得られたPESパケット(オーディ
オパケット)とを多重化する。
The audio frame detection unit 105 outputs the MP
The EG encoder 101 searches the audio stream obtained by encoding, and detects the head of the audio frame. The audio packetizing unit 106 packetizes the audio stream obtained by encoding by the MPEG encoder 101. The multiplexing unit 107 includes a PES packet (video packet) obtained by packetizing the video packetizing unit 104 and the audio packetizing unit 10.
6 multiplexes PES packets (audio packets) obtained by packetization.

【0031】MPEGデコーダ111は、多重化部10
7が多重化して得られたプログラムストリームを、バッ
ファ部112に一時記憶させた後、復号化する。バッフ
ァ部112では、チャネルバッファ112aが、ビデオ
ストリームおよびオーディオストリームをパケット単位
で記憶し、ヘッダバッファ112bは、パックヘッダお
よびPESヘッダを記憶する。
The MPEG decoder 111 includes a multiplexing unit 10
7 temporarily stores the program stream obtained by multiplexing in the buffer unit 112 and then decodes the program stream. In the buffer unit 112, the channel buffer 112a stores a video stream and an audio stream in packet units, and the header buffer 112b stores a pack header and a PES header.

【0032】以下には、図1のMPEG符号化・復号化
装置の動作について説明する。図1の装置は、例えば符
号化装置10がビデオサーバ側に設けられ、復号化装置
11はクライアント側に設けられる。また、符号化装置
10の出力(図7(1)に示すようなプログラムストリ
ーム)は、図示しないディスクなどにいったん記憶され
た後、クライアント側の要求に応じてそのディスクから
読み出され、復号化装置11側に送られるものとする。
The operation of the MPEG encoding / decoding apparatus shown in FIG. 1 will be described below. In the apparatus of FIG. 1, for example, an encoding device 10 is provided on a video server side, and a decoding device 11 is provided on a client side. Also, the output of the encoding device 10 (a program stream as shown in FIG. 7A) is temporarily stored on a disk or the like (not shown), read out from the disk in response to a request from the client side, and decoded. It is sent to the device 11 side.

【0033】符号化装置10では、最初、ビデオデータ
およびオーディオデータが、MPEGエンコーダ101
に入力される。MPEGエンコーダ101は、入力され
たビデオデータおよびオーディオデータをそれぞれMP
EGで符号化して、図7(2)および(3)に示すよう
なビデオエレメンタリストリームおよびオーディオエレ
メンタリストリームを出力する。GOP検出部102
は、出力されたビデオエレメンタリストリームから、G
OPの先頭位置を示すgroup_start_cod
e(0x000001B8)を検出する。そして、検出
したgroup_start_codeのバイト位置
を、ビデオフレーム検出部103およびビデオパケット
化部104に通知する。
In the encoding device 10, first, video data and audio data are transmitted to the MPEG encoder 101.
Is input to The MPEG encoder 101 converts the input video data and audio data into MP
The video elementary stream and the audio elementary stream as shown in FIGS. 7 (2) and (3) are output by encoding with EG. GOP detector 102
Is G from the output video elementary stream.
Group_start_cod indicating the start position of the OP
e (0x000001B8) is detected. Then, it notifies the video frame detecting unit 103 and the video packetizing unit 104 of the detected byte position of the group_start_code.

【0034】なお、GOP検出部102は、group
_start_codeを検出する代わりに、シーケン
スヘッダの先頭位置を示すsequence_head
er_code(0x000001B3)およびgro
up_start_codeのいずれかを検出するもの
であってもよい。この場合、シーケンスヘッダおよびG
OPヘッダのうち、どちらか先に検出された方のバイト
位置が、ビデオフレーム検出部103およびビデオパケ
ット化部104に通知されることになる。
Note that the GOP detection unit 102
_Start_code, instead of detecting sequence_head indicating the start position of the sequence header
er_code (0x000001B3) and gro
Any of the up_start_code may be detected. In this case, the sequence header and G
Whichever byte position of the OP header is detected first is notified to the video frame detecting unit 103 and the video packetizing unit 104.

【0035】次に、ビデオフレーム検出部103は、G
OP検出部102により通知されたバイト位置、すなわ
ちGOPの先頭から、ピクチャヘッダのpicture
_start_code(0x00000100)の検
索を開始する。検索を開始して最初に検出したpict
ure_start_codeのバイト位置をもとに、
Iフレームの先頭のバイト位置がわかる。また、2番目
に検出したpicture_start_codeのバ
イト位置をもとに、そのIフレームの直後のBまたはP
フレーム(以下、non−Iフレーム)の先頭のバイト
位置がわかる。そこで、ビデオフレーム検出部103
は、これらIフレームの先頭およびその直後のnon−
Iフレームの先頭のバイト位置を、ビデオパケット化部
104に通知する。
Next, the video frame detecting unit 103
From the byte position notified by the OP detection unit 102, that is, from the top of the GOP, the picture header
A search for _start_code (0x0000100) is started. The first pict found after starting the search
Based on the byte position of ure_start_code,
The position of the first byte of the I frame is known. Also, based on the byte position of the second detected picture_start_code, B or P immediately after the I frame is used.
The first byte position of a frame (hereinafter, a non-I frame) is known. Therefore, the video frame detection unit 103
Is the non-
The first byte position of the I frame is notified to the video packetizer 104.

【0036】ビデオパケット化部104は、GOP検出
部102により通知されたGOPの先頭のバイト位置
と、ビデオフレーム検出部103から通知されたIフレ
ームおよびその直後のnon−Iフレームの先頭のバイ
ト位置とを参照して、ビデオエレメンタリストリームを
パケット化する。なお、パケット化して得られるPES
パケットのペイロード長は、ビデオパケット、オーディ
オパケットとも予め決められた長さであるとする。
The video packetizer 104 calculates the first byte position of the GOP notified by the GOP detector 102 and the first byte position of the I frame notified by the video frame detector 103 and the immediately following non-I frame. And packetizes the video elementary stream. The PES obtained by packetization
It is assumed that the payload length of the packet is a predetermined length for both the video packet and the audio packet.

【0037】ここで、ビデオパケット化部104がビデ
オエレメンタリストリームをパケット化する動作を、図
2を用いて説明する。すなわち、図2は、図1のビデオ
パケット化部104がビデオエレメンタリストリームを
パケット化する動作を説明するための図である。図2に
示すように、ビデオエレメンタリストリームのうち、シ
ーケンスヘッダの先頭のデータからIフレームの末端の
データまでが、複数のPESパケットのペイロード部分
に分割して格納される。
Here, the operation of the video packetizer 104 packetizing the video elementary stream will be described with reference to FIG. That is, FIG. 2 is a diagram for explaining an operation in which the video packetizing unit 104 in FIG. 1 packetizes a video elementary stream. As shown in FIG. 2, in the video elementary stream, the data from the head of the sequence header to the data at the end of the I frame is divided into a plurality of PES packets and stored.

【0038】Iフレームの末端のデータが格納されたP
ESパケットにおいて、格納されたデータ長がペイロー
ド長に満たない場合、データが格納されていない残りの
ペイロード部分(図中(a)で示される部分)に対し
て、パディング処理を行う。この処理を行うことより、
Iフレームの末端のデータが格納されたPESパケット
に、次のフレームの先頭のデータ(non−Iフレーム
のデータ)が格納されることがなくなる。
P at which the data at the end of the I frame is stored
In the case where the stored data length is less than the payload length in the ES packet, padding processing is performed on the remaining payload portion where data is not stored (portion indicated by (a) in the figure). By performing this process,
The head data (non-I frame data) of the next frame is not stored in the PES packet storing the data at the end of the I frame.

【0039】なお、上記のパディング処理としては、残
りのペイロード部分の長さに等しいパディングパケット
を生成して挿入する。
In the padding process, a padding packet equal to the length of the remaining payload portion is generated and inserted.

【0040】次に、上記のIフレームから次のIフレー
ムまでの一連のnon−Iフレーム(図中ではBフレー
ム、Pフレーム、…、Pフレーム)のデータが、複数の
PESパケットのペイロード部分に分割して格納され
る。その際、上記のIフレームとは異なり、各non−
Iフレームの末端のデータが格納されたPESパケット
において、格納されたデータ長がペイロード長に満たな
くても、パディング処理を行わない。
Next, data of a series of non-I frames (B frame, P frame,..., P frame in the figure) from the above I frame to the next I frame is added to the payload portion of a plurality of PES packets. Stored separately. At this time, unlike the above I frame, each non-frame
In a PES packet in which data at the end of an I frame is stored, padding is not performed even if the stored data length is less than the payload length.

【0041】ただし、最後尾のnon−Iフレームの末
端のデータ、すなわちGOPの末端のデータが格納され
たPESパケットにおいて、格納されたデータ長がペイ
ロード長に満たない場合には、データが格納されていな
い残りの部分(図中(b)で示される部分)に対して、
パディング処理を行う。この処理を行うことより、GO
Pの末端のデータが格納されたPESパケットに、次の
GOPの先頭のデータ(Iフレームのデータ)が格納さ
れることがなくなる。
However, in the data at the end of the last non-I frame, that is, in the PES packet storing the data at the end of the GOP, if the stored data length is less than the payload length, the data is stored. For the remaining parts not shown (parts shown in (b) in the figure),
Perform padding processing. By performing this processing, GO
The head data (I frame data) of the next GOP is not stored in the PES packet storing the data at the end of P.

【0042】上記のように、Iフレームの末端のデータ
が格納されたPESパケットに、次のフレーム(non
−Iフレーム)の先頭のデータが格納されないようにし
たことにより、高速再生時など、Iフレームのみを選択
的に再生したい場合に、non−Iフレームの先頭のデ
ータ(ビデオフレームの断片)がデコードされることが
なくなり、その結果、高速再生中に映像の乱れが生じな
いようにできる。
As described above, the PES packet storing the data at the end of the I frame contains the next frame (non
The first data of the non-I frame (fragment of the video frame) is decoded when only the I frame is to be selectively reproduced, such as during high-speed reproduction, by not storing the first data of the I-frame. As a result, it is possible to prevent video disturbance during high-speed reproduction.

【0043】また、GOPの末端のデータが格納された
PESパケットに、次のGOPの先頭のデータ(Iフレ
ームのデータ)が格納されないようにしたことにより、
ジャンプ再生時など、ストリーム途中の任意のGOPか
ら再生を開始した場合に、その直前のGOPの末端のデ
ータ(ビデオフレームの断片)がデコードされることが
なくなり、その結果、再生開始時に映像が乱れないよう
にできる。
Also, by preventing the head data (I frame data) of the next GOP from being stored in the PES packet storing the data at the end of the GOP,
When playback is started from an arbitrary GOP in the middle of a stream such as during jump playback, data at the end of the immediately preceding GOP (fragment of a video frame) is not decoded, and as a result, video is disturbed at the start of playback. You can not.

【0044】一方、オーディオフレーム検出部105
は、オーディオエレメンタリストリームを検索して、ヘ
ッダに含まれる同期ビット(0xFFF)を検出する。
そして、検出した同期ビットのバイト位置を、オーディ
オパケット化部106に通知する。オーディオパケット
化部106は、通知されたバイト位置を参照して、オー
ディオエレメンタリストリームをパケット化する。
On the other hand, the audio frame detecting section 105
Searches the audio elementary stream to detect a synchronization bit (0xFFF) included in the header.
Then, it notifies the audio packetizer 106 of the detected byte position of the synchronization bit. The audio packetizer 106 packetizes the audio elementary stream with reference to the notified byte position.

【0045】ここで、オーディオパケット化部106が
オーディオエレメンタリストリームをパケット化する動
作を、図3を用いて説明する。すなわち、図3は、図1
のオーディオパケット化部106がオーディオエレメン
タリストリームをパケット化する動作を説明するための
図である。オーディオパケット化部106は、図3に示
すように、最初、1番目のPESパケットのペイロード
部分に、1枚目のオーディオフレームのデータを格納す
る。そして、データが格納されていない残りのペイロー
ド長と、2枚目のオーディオフレームのデータ長とを比
較する。
The operation of the audio packetizing section 106 for packetizing an audio elementary stream will be described with reference to FIG. That is, FIG.
FIG. 6 is a diagram for explaining an operation of the audio packetizing unit 106 packetizing an audio elementary stream. As shown in FIG. 3, the audio packetizer 106 first stores the data of the first audio frame in the payload of the first PES packet. Then, the remaining payload length in which no data is stored is compared with the data length of the second audio frame.

【0046】比較の結果、残りのペイロード長が2枚目
のオーディオフレームのデータ長よりも長いため、その
オーディオフレームを1番目のPESパケットの残りの
ペイロード部分に格納する。そして、データが格納され
ていない残りのペイロード長と、3枚目のオーディオフ
レームのデータ長とを比較する。
As a result of the comparison, since the remaining payload length is longer than the data length of the second audio frame, the audio frame is stored in the remaining payload portion of the first PES packet. Then, the remaining payload length in which no data is stored is compared with the data length of the third audio frame.

【0047】比較の結果、残りのペイロード長が3枚目
のオーディオフレームのデータ長よりも短いため、その
オーディオフレームを1番目のPESパケットの残りの
ペイロード部分に格納することをせず、2番目のPES
パケットのペイロード部分に格納する。そして、1番目
のPESパケットの残りのペイロード部分(図中(c)
で示される部分)に対しては、すでに説明したものと同
様のパディング処理を行う。
As a result of the comparison, since the remaining payload length is shorter than the data length of the third audio frame, the audio frame is not stored in the remaining payload portion of the first PES packet and the second audio frame is not stored. PES
Store it in the payload part of the packet. Then, the remaining payload portion of the first PES packet ((c) in the figure)
), The same padding processing as described above is performed.

【0048】以降、同様にして、オーディオフレームを
PESパケットに格納する毎に、そのパケットの残りの
ペイロード長と次のオーディオフレームのデータ長とを
比較する。そして、比較の結果、残りのペイロード長が
次のオーディオフレームのデータ長よりも短くて、残り
のペイロード部分に次のフレームの全てのデータを格納
しきれないような場合には、そのパケットの残りのペイ
ロード部分に対してパディング処理を行う動作を繰り返
す。これにより、1つのオーディオフレームのデータが
複数のPESパケットに分割して格納されることがなく
なる。
Thereafter, similarly, each time an audio frame is stored in a PES packet, the remaining payload length of the packet is compared with the data length of the next audio frame. If the result of the comparison indicates that the remaining payload length is shorter than the data length of the next audio frame and that all the data of the next frame cannot be stored in the remaining payload portion, the remaining The operation of performing the padding process on the payload portion of is repeated. As a result, the data of one audio frame is not divided and stored in a plurality of PES packets.

【0049】次に、多重化部107が、ビデオパケット
化部104がパケット化して得られたPESパケット
(ビデオパケット)と、オーディオパケット化部106
がパケット化して得られたPESパケット(オーディオ
パケット)とを多重化し、多重化して得られたプログラ
ムストリームの先頭にパックヘッダを付加して出力す
る。出力されたプログラムストリームは、図示しないデ
ィスク等にいったん蓄積される。
Next, the multiplexing unit 107 divides the PES packet (video packet) obtained by packetizing the video packetizing unit 104 into an audio packetizing unit 106.
Multiplexes a PES packet (audio packet) obtained by packetization, adds a pack header to the head of the multiplexed program stream, and outputs the result. The output program stream is temporarily stored on a disk or the like (not shown).

【0050】次に、復号化装置11の、ジャンプ再生時
の動作について説明する。上記のようにしてディスク等
に蓄積されたプログラムストリームは、クライアントの
指示に応じて、ストリーム途中のGOP先頭から以降が
読み出され、復号化装置11へ送られる。復号化装置1
1では、MPEGデコーダ111が、送られてきたプロ
グラムストリームからパックヘッダおよびPESヘッダ
を抽出してヘッダバッファ112bに格納させる。ま
た、ビデオエレメンタリストリームおよびオーディオエ
レメンタリストリームを抽出してチャネルバッファ11
2aに格納させる。
Next, the operation of the decoding device 11 during jump reproduction will be described. The program stream stored in the disk or the like as described above is read from the beginning of the GOP in the middle of the stream according to the instruction of the client, and sent to the decoding device 11. Decryption device 1
In step 1, the MPEG decoder 111 extracts a pack header and a PES header from the sent program stream, and stores them in the header buffer 112b. In addition, a video elementary stream and an audio elementary stream are extracted and
2a.

【0051】チャネルバッファ112aに格納されたデ
ータ量が予め設定されたしきい値を超えると、MPEG
デコーダ111は、チャネルバッファ112aからビデ
オストリームおよびオーディオストリームをパケット単
位で読み出して復号化する動作を開始する。復号化して
得られたビデオデータおよびオーディオデータは、図示
しないD/A変換部でそれぞれアナログのビデオ信号、
アナログのオーディオ信号に変換される。そして、図示
しない画面上で映像の表示が開始され、図示しないスピ
ーカから音声の出力が開始される。
When the amount of data stored in the channel buffer 112a exceeds a preset threshold, the MPEG
The decoder 111 starts an operation of reading and decoding the video stream and the audio stream from the channel buffer 112a in packet units. The video data and audio data obtained by decoding are respectively converted into analog video signals by a D / A conversion unit (not shown),
It is converted to an analog audio signal. Then, display of an image is started on a screen (not shown), and output of sound from a speaker (not shown) is started.

【0052】その際、符号化装置10側において、GO
Pの末端のデータが格納されたPESパケットに次のG
OPの先頭のデータが格納されないようにビデオストリ
ームがパケット化されているため、最初に復号化される
ビデオパケットに再生開始位置以前のビデオフレームの
断片が含まれていることがなく、従って、再生開始時、
映像の乱れが発生しない。
At this time, on the encoding device 10 side, GO
The next G is added to the PES packet storing the data at the end of P.
Since the video stream is packetized so that the data at the beginning of the OP is not stored, the video packet to be decoded first does not include a fragment of the video frame before the reproduction start position. At the start,
No image distortion occurs.

【0053】また、符号化装置10側において、1つの
オーディオフレームのデータが複数のPESパケットに
分割して格納されることがないよう、オーディオストリ
ームがパケット化されているため、最初に復号化される
オーディオパケットに再生開始位置以前のオーディオフ
レームの断片が含まれていることがなく、従って、再生
開始時、雑音が発生しない。
The audio stream is packetized so that the data of one audio frame is not divided into a plurality of PES packets and stored on the encoding device 10 side. The audio packet does not include a fragment of an audio frame before the reproduction start position, and therefore, no noise is generated at the start of reproduction.

【0054】以上のように、本実施形態によれば、ジャ
ンプ再生など、ストリーム途中のGOPの先頭から再生
を開始する際、復号化装置11側で複雑な処理を行わな
くても、再生開始時に映像の乱れや雑音が発生しないよ
うにできる。
As described above, according to the present embodiment, when starting playback from the beginning of a GOP in the middle of a stream, such as jump playback, the decoding device 11 does not need to perform complicated processing, so that playback can be started at the beginning of playback. It is possible to prevent image distortion and noise from occurring.

【0055】(第2の実施形態)以下、本発明の第2の
実施形態について、図面を参照しながら説明する。図4
は、本発明の第2の実施形態に係るMPEG符号化・復
号化装置の構成を示すブロック図である。図4の符号化
・復号化装置は、符号化装置10と、復号化装置11a
とからなる。図4の符号化装置10は、図1の符号化装
置10と同様の構成を有している。図4の復号化装置1
1aは、図1の復号化装置11において、出力制御部1
13をさらに備えている。出力制御部113は、MPE
Gデコーダ111の出力動作を制御する。
(Second Embodiment) Hereinafter, a second embodiment of the present invention will be described with reference to the drawings. FIG.
FIG. 3 is a block diagram showing a configuration of an MPEG encoding / decoding device according to a second embodiment of the present invention. 4 includes an encoding device 10 and a decoding device 11a.
Consists of The encoding device 10 of FIG. 4 has a configuration similar to that of the encoding device 10 of FIG. Decoding device 1 of FIG.
1a is an output control unit 1 in the decoding device 11 of FIG.
13 is further provided. The output control unit 113
The output operation of the G decoder 111 is controlled.

【0056】以下には、図4のMPEG符号化・復号化
装置の動作について説明する。ただし、符号化装置10
の動作は、図1のものと同様であるので、説明を省略す
る。図5は、図4のMPEGデコーダ111が、ヘッダ
をヘッダバッファ112bに、ビデオエレメンタリスト
リームおよびオーディオエレメンタリストリームをチャ
ネルバッファ112aに、それぞれ格納させる動作を説
明するための図である。ジャンプ再生時、復号化装置1
1aでは、最初、MPEGデコーダ111が、伝送され
てくるプログラムストリームからヘッダを抽出してヘッ
ダバッファ112bに格納させ、またビデオエレメンタ
リストリームおよびオーディオエレメンタリストリーム
を抽出してチャネルバッファ112aに格納させる動作
を行う。以下には、その動作について、図5を用いて説
明する。
The operation of the MPEG encoding / decoding apparatus shown in FIG. 4 will be described below. However, the encoding device 10
Is similar to that of FIG. 1, and the description is omitted. FIG. 5 is a diagram for explaining an operation in which the MPEG decoder 111 in FIG. 4 stores a header in the header buffer 112b and a video elementary stream and an audio elementary stream in the channel buffer 112a. At the time of jump reproduction, the decoding device 1
In 1a, first, the MPEG decoder 111 extracts a header from a transmitted program stream and stores it in the header buffer 112b, and extracts a video elementary stream and an audio elementary stream and stores them in the channel buffer 112a. I do. The operation will be described below with reference to FIG.

【0057】クライアントがストリーム途中のあるGO
Pから再生を開始するよう指示すると、図7(1)に示
すようなプログラムストリームが図示しないディスクか
ら読み出されて復号化装置11aへ入力される。復号化
装置11aでは、MPEGデコーダ111が、入力され
たストリームからパックヘッダ(図示せず)を抽出して
チャネルバッファ112aに格納させる。
The client has a GO in the middle of the stream
When the reproduction is instructed from P, a program stream as shown in FIG. 7A is read from a disc (not shown) and input to the decoding device 11a. In the decoding device 11a, the MPEG decoder 111 extracts a pack header (not shown) from the input stream and stores it in the channel buffer 112a.

【0058】次に、MPEGデコーダ111は、ストリ
ームを構成しているPESパケット(パケット(1)、
パケット(2)、…)からPESヘッダ(ヘッダ
(1)、ヘッダ(2)、…)を抽出して、ヘッダバッフ
ァ112bに格納させる。また、ビデオデータ/オーデ
ィオデータ(データ(1)、データ(2)、…)を抽出
して、チャネルバッファ112aに格納させる。
Next, the MPEG decoder 111 converts the PES packets (packet (1),
The PES headers (header (1), header (2),...) Are extracted from the packets (2,...) And stored in the header buffer 112b. Also, video data / audio data (data (1), data (2),...) Are extracted and stored in the channel buffer 112a.

【0059】その際、MPEGデコーダ111は、各P
ESヘッダの最終バイトに続けて、ライトポインタの値
を書き込む。書き込まれるライトポインタの値(ライト
ポインタ(1)、ライトポインタ(2)、…)は、対応
するビデオデータ/オーディオデータ(データ(1)、
データ(2)、…)の先頭バイトが書き込まれる(チャ
ネルバッファ112aの)アドレスを示している。
At this time, the MPEG decoder 111
The value of the write pointer is written following the last byte of the ES header. The values of the written write pointer (write pointer (1), write pointer (2),...) Correspond to the corresponding video data / audio data (data (1),
The address (of the channel buffer 112a) at which the first byte of the data (2),... Is written.

【0060】次に、MPEGデコーダ111は、ヘッダ
バッファ112bからPESヘッダを順次的に読み出し
て内容を解析する。解析の結果、PESヘッダ内にPT
Sが存在する場合(前述のように、ビデオフレーム/オ
ーディオフレームの先頭データを含むPESパケットに
は、PESヘッダ内にPTSが含まれている)、PTS
の値(PTS(1)、PTS(2)、…)とライトポイ
ンタの値(ライトポインタ(1)、ライトポインタ
(2)、…)とを組にして、図6に示すようなPTSテ
ーブルに蓄積していく。
Next, the MPEG decoder 111 sequentially reads the PES header from the header buffer 112b and analyzes the contents. As a result of the analysis, PT
If the STS exists (as described above, the PTS packet including the head data of the video frame / audio frame includes the PTS in the PES header), the PTS
(PTS (1), PTS (2),...) And the values of the write pointers (Write Pointer (1), Write Pointer (2),...) Are combined into a PTS table as shown in FIG. Accumulate.

【0061】図6は、図4のMPEGデコーダ111が
作成したPTSテーブルの一例を示す図である。MPE
Gデコーダ111は、図6に示すようなPTSテーブル
を、ビデオフレーム用およびオーディオフレーム用にそ
れぞれ1つ作成する。これらのテーブルを参照すること
によって、各ビデオフレーム/オーディオフレームの格
納位置と表示時刻との関係がわかる。
FIG. 6 is a diagram showing an example of the PTS table created by the MPEG decoder 111 of FIG. MPE
The G decoder 111 creates one PTS table as shown in FIG. 6 for each of a video frame and an audio frame. By referring to these tables, the relationship between the storage position of each video frame / audio frame and the display time can be understood.

【0062】チャネルバッファ112aに蓄積されたデ
ータ量が予め設定されたしきい値を超えると、MPEG
デコーダ111は、チャネルバッファ112aからビデ
オストリームおよびオーディオストリームを読み出して
復号化する動作を開始する。ただし、再生開始時、復号
化して得られたビデオデータの出力は行うが、復号化し
て得られたオーディオデータは出力せず、代わりに無効
データを出力する(ミュート処理する)よう設定されて
いる。
When the amount of data stored in the channel buffer 112a exceeds a preset threshold value, the MPEG
The decoder 111 starts the operation of reading and decoding the video stream and the audio stream from the channel buffer 112a. However, at the start of playback, the video data obtained by decoding is output, but the audio data obtained by decoding is not output, but invalid data is output (mute processing) instead. .

【0063】一方、出力制御部113は、MPEGデコ
ーダ111の復号化動作を監視している。そして、MP
EGデコーダ111がチャネルバッファ112aからオ
ーディオデータを読み出して復号化しつつある場合、出
力制御部113は、そのオーディオデータのライトポイ
ンタの値をMPEGデコーダ111から取得するととも
に、その値に対応するPTSの値を、MPEGデコーダ
111が管理しているオーディオフレーム用PTSテー
ブルから取得する。この取得したPTSの値が、いまM
PEGデコーダ111が復号化しようとしているオーデ
ィオフレームの表示時刻である。
On the other hand, the output control unit 113 monitors the decoding operation of the MPEG decoder 111. And MP
When the EG decoder 111 is reading and decoding audio data from the channel buffer 112a, the output control unit 113 obtains the value of the write pointer of the audio data from the MPEG decoder 111 and sets the value of the PTS corresponding to the value. From the audio frame PTS table managed by the MPEG decoder 111. The value of the obtained PTS is now M
This is the display time of the audio frame that the PEG decoder 111 is trying to decode.

【0064】次いで、出力制御部113は、MPEGデ
コーダ111が管理しているビデオオフレーム用PTS
テーブルを参照して、取得したPTSの値(現在復号化
されつつあるオーディオフレームの表示時刻)と、ビデ
オフレーム用PTSテーブルに格納されているPTSの
うち最も値が小さいもの(最初に復号化されるビデオフ
レームの表示時刻)とを比較する。
Next, the output control unit 113 controls the video frame PTS managed by the MPEG decoder 111.
Referring to the table, the acquired PTS value (the display time of the audio frame currently being decoded) and the PTS stored in the video frame PTS table with the smallest value (first decoded PTS) Video frame display time).

【0065】比較の結果、取得したPTSの値の方が、
ビデオフレーム用PTSテーブルに格納されているPT
Sのうち最も値が小さいものより小さい場合、現在復号
化されつつあるオーディオフレームが再生開始位置以前
のものであることがわかる。一方、取得したPTSの値
の方が大きい場合には、現在復号化されつつあるオーデ
ィオフレームが再生開始位置以降のものであることがわ
かる。
As a result of the comparison, the obtained PTS value is
PT stored in the video frame PTS table
If the value of S is smaller than the smallest value, it is understood that the audio frame currently being decoded is before the reproduction start position. On the other hand, when the value of the acquired PTS is larger, it is understood that the audio frame currently being decoded is after the reproduction start position.

【0066】そこで、出力制御部113は、取得したP
TSの値の方が、ビデオフレーム用PTSテーブルに格
納されているPTSのうち最も値が小さいものより大き
くなった瞬間、MPEGデコーダ111に指示して、無
効データの出力を中止させるとともに、復号化して得ら
れたオーディオデータの出力を開始させる。
Therefore, the output control unit 113 sets the acquired P
At the moment when the value of TS becomes larger than the smallest value of the PTS stored in the PTS table for video frame, it instructs the MPEG decoder 111 to stop outputting invalid data and decode the data. The output of the audio data obtained is started.

【0067】復号化して得られたビデオデータおよびオ
ーディオデータは、図示しないD/A変換部でそれぞれ
アナログのビデオ信号、アナログのオーディオ信号に変
換される。そして、図示しない画面上で映像の表示が開
始され、図示しないスピーカから音声の出力が開始され
る。その際、出力制御部113が、上記のように出力制
御を行ったことにより、再生開始時、再生開始位置以前
の音声が再生されることがない。
The video data and audio data obtained by decoding are converted into an analog video signal and an analog audio signal by a D / A converter (not shown). Then, display of an image is started on a screen (not shown), and output of sound from a speaker (not shown) is started. At this time, since the output control unit 113 performs the output control as described above, the sound before the reproduction start position is not reproduced at the time of the reproduction start.

【0068】以上のように、本実施形態によれば、ジャ
ンプ再生など、ストリーム途中のGOPの先頭から再生
を開始する際、第1の実施形態同様、復号化装置11a
側で複雑な処理を行わなくても、再生開始時に映像の乱
れや雑音が発生しないようにできるのに加え、さらに、
再生開始時、再生開始位置以前の音声が再生されないよ
うにできる。
As described above, according to the present embodiment, when playback is started from the beginning of a GOP in the middle of a stream, such as jump playback, the decoding device 11a, as in the first embodiment.
In addition to being able to prevent video distortion and noise at the start of playback without performing complicated processing on the side,
At the start of playback, audio before the playback start position can be prevented from being played back.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の第1の実施形態に係るMPEG符号化
・復号化装置の構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of an MPEG encoding / decoding device according to a first embodiment of the present invention.

【図2】図1のビデオパケット化部104がビデオエレ
メンタリストリームをパケット化する動作を説明するた
めの図である。
FIG. 2 is a diagram for explaining an operation in which the video packetizer 104 of FIG. 1 packetizes a video elementary stream.

【図3】図1のオーディオパケット化部106がオーデ
ィオエレメンタリストリームをパケット化する動作を説
明するための図である。
FIG. 3 is a diagram for explaining an operation in which the audio packetizing unit 106 in FIG. 1 packetizes an audio elementary stream.

【図4】本発明の第2の実施形態に係るMPEG符号化
・復号化装置の構成を示すブロック図である。
FIG. 4 is a block diagram illustrating a configuration of an MPEG encoding / decoding device according to a second embodiment of the present invention.

【図5】図4のMPEGデコーダ111が、ヘッダをヘ
ッダバッファ112bに、ビデオエレメンタリストリー
ムおよびオーディオエレメンタリストリームをチャネル
バッファ112aに、それぞれ格納させる動作を説明す
るための図である。
FIG. 5 is a diagram for explaining an operation in which the MPEG decoder of FIG. 4 stores a header in a header buffer 112b and a video elementary stream and an audio elementary stream in a channel buffer 112a, respectively.

【図6】図4のMPEGデコーダ111が作成するPT
Sテーブルの一例を示す図である。
FIG. 6 shows a PT created by the MPEG decoder 111 of FIG.
It is a figure showing an example of an S table.

【図7】MPEGで用いられるストリームの構造を示す
図である。
FIG. 7 is a diagram showing the structure of a stream used in MPEG.

【図8】ジャンプ再生時の、再生開始位置付近のプログ
ラムストリームの一例を示す図である。
FIG. 8 is a diagram illustrating an example of a program stream near a reproduction start position during jump reproduction.

【符号の説明】[Explanation of symbols]

10…符号化装置 11、11a…復号化装置 101…MPEGエンコーダ 102…GOP検出部 103…ビデオフレーム検出部 104…ビデオパケット化部 105…オーディオフレーム検出部 106…オーディオパケット化部 107…多重化部 111…MPEGデコーダ 112…バッファ部 112a…チャネルバッファ 112b…ヘッダバッファ 113…出力制御部 DESCRIPTION OF SYMBOLS 10 ... Encoding device 11, 11a ... Decoding device 101 ... MPEG encoder 102 ... GOP detection part 103 ... Video frame detection part 104 ... Video packet formation part 105 ... Audio frame detection part 106 ... Audio packet formation part 107 ... Multiplexing part 111: MPEG decoder 112: Buffer unit 112a: Channel buffer 112b: Header buffer 113: Output control unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 オーディオデータをMPEG方式で符号
化するMPEG符号化手段と、 前記MPEG符号化手段が符号化して得られたオーディ
オストリームを検索して、当該ストリームを構成してい
る複数のオーディオフレームのそれぞれの先頭を検出す
るオーディオフレーム検出手段と、 前記オーディオフレーム検出手段の検出結果に関連し
て、前記オーディオストリームをパケット化するパケッ
ト化手段とを備え、 前記パケット化手段は、前記複数のオーディオフレーム
が、いずれも互いに異なるパケットに分割して格納され
ることのないように、パケット化することを特徴とす
る、MPEG符号化装置。
An MPEG encoding means for encoding audio data in an MPEG system, an audio stream obtained by encoding by the MPEG encoding means is searched, and a plurality of audio frames constituting the stream are searched. Audio frame detection means for detecting the head of each of the plurality of audio streams, and packetization means for packetizing the audio stream in association with the detection result of the audio frame detection means, wherein the packetization means comprises: An MPEG encoding apparatus, characterized in that a frame is packetized so that none of the frames is divided into different packets and stored.
【請求項2】 ビデオストリームおよびオーディオスト
リームを一時格納するためのバッファと、 前記バッファに格納されたビデオストリームおよびオー
ディオストリームを復号化するMPEG復号化手段と、 前記MPEG復号化手段の動作を制御する制御手段とを
備え、 前記制御手段は、再生開始時、前記オーディオストリー
ムを構成している複数のオーディオフレームのうち現在
復号化されつつあるオーディオフレームの表示時刻と、
前記ビデオストリームを構成している複数のビデオフレ
ームのうち最初に表示されるべきビデオフレームのそれ
とを比較して、比較の結果、当該オーディオフレームの
表示時刻が当該ビデオフレームのそれより早い場合に
は、前記MPEG復号化手段に指示して、当該オーディ
オフレームを復号化して得られたオーディオデータの出
力を行わせないことを特徴とする、MPEG復号化装
置。
2. A buffer for temporarily storing a video stream and an audio stream; an MPEG decoding unit for decoding the video stream and the audio stream stored in the buffer; and an operation of the MPEG decoding unit. Control means, the control means, at the start of playback, of the plurality of audio frames constituting the audio stream, the display time of the audio frame that is currently being decoded,
If the display time of the audio frame is earlier than that of the video frame as a result of the comparison, the display time of the audio frame is compared with that of the video frame to be displayed first among the plurality of video frames constituting the video stream. An MPEG decoding apparatus, characterized in that the MPEG decoding means is not instructed to output audio data obtained by decoding the audio frame.
JP9058135A 1997-03-12 1997-03-12 Mpeg encoder/decoder Pending JPH10257437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9058135A JPH10257437A (en) 1997-03-12 1997-03-12 Mpeg encoder/decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9058135A JPH10257437A (en) 1997-03-12 1997-03-12 Mpeg encoder/decoder

Publications (1)

Publication Number Publication Date
JPH10257437A true JPH10257437A (en) 1998-09-25

Family

ID=13075552

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9058135A Pending JPH10257437A (en) 1997-03-12 1997-03-12 Mpeg encoder/decoder

Country Status (1)

Country Link
JP (1) JPH10257437A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001035652A1 (en) * 1999-11-05 2001-05-17 Fujitsu Limited Recording/reproducing/ editing system for video/voice stream data
JP2006030577A (en) * 2004-07-15 2006-02-02 Yamaha Corp Method and device for coded transmission of music
JP2007128569A (en) * 2005-11-01 2007-05-24 Toshiba Corp Recording/reproducing device and recording method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001035652A1 (en) * 1999-11-05 2001-05-17 Fujitsu Limited Recording/reproducing/ editing system for video/voice stream data
JP2006030577A (en) * 2004-07-15 2006-02-02 Yamaha Corp Method and device for coded transmission of music
JP2007128569A (en) * 2005-11-01 2007-05-24 Toshiba Corp Recording/reproducing device and recording method
US7821882B2 (en) 2005-11-01 2010-10-26 Kabushiki Kaisha Toshiba Recording and reproducing apparatus and recording method

Similar Documents

Publication Publication Date Title
JP3330797B2 (en) Moving image data storage method and moving image data decoding method
KR100958325B1 (en) Method and apparatus for trick mode playback of an mpeg video presentation recorded on a storage medium
JP3351757B2 (en) Digital recording and playback device
US8457478B2 (en) Method and apparatus for receiving, storing, and presenting multimedia programming without indexing prior to storage
JP4226873B2 (en) Digital broadcast program recording method and digital broadcast receiver
EP1978521B1 (en) System for random access to content
EP1230795A1 (en) Eliminating picture format artifacts in mpeg trick modes
JP2005039308A6 (en) Digital broadcast program recording method, reproduction method, and digital broadcast receiver
KR20070049504A (en) Apparatus of playing digital contents and method for saving and playing contents in a reverse direction
JP2001285860A (en) Transfer rate controller, decoding device, medium and information assembly
JP3861362B2 (en) Digital signal reproduction method and apparatus
US20030219041A1 (en) Method for recording location information of broadcasting signals, and a broadcasting signal receiving device and transmitting device capable of recording location information of broadcasting signals
JP2002077820A (en) Accumulating/reproducing device and digital broadcast transmitting device
US20020065969A1 (en) Interrupt prioritization in a digital disk apparatus
JPH10257437A (en) Mpeg encoder/decoder
JP2002354419A (en) Recording reproducing equipment and method therefor, recording medium and program thereof
JP2004282703A (en) Data processor
JP2008236180A (en) Recording device, video reproducing apparatus, and special reproduction method therefor
JP2002513983A (en) Playback bit stream processing
JP4145103B2 (en) Movie data playback method and playback apparatus
JPH10210419A (en) Video server, terminal equipment and data transmission method
JP4763589B2 (en) Playback device and playback method thereof
JP3986147B2 (en) Acoustic signal processing apparatus and audio high-speed playback method
KR20070043016A (en) Improving the accessibility of graphics during and after trick play
JP2002033712A (en) Packet processor and packet output method therefor