JP2003298544A - Program stream multiplexing method and apparatus - Google Patents

Program stream multiplexing method and apparatus

Info

Publication number
JP2003298544A
JP2003298544A JP2002102270A JP2002102270A JP2003298544A JP 2003298544 A JP2003298544 A JP 2003298544A JP 2002102270 A JP2002102270 A JP 2002102270A JP 2002102270 A JP2002102270 A JP 2002102270A JP 2003298544 A JP2003298544 A JP 2003298544A
Authority
JP
Japan
Prior art keywords
multiplexing
audio
video
order
scr
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.)
Withdrawn
Application number
JP2002102270A
Other languages
Japanese (ja)
Inventor
Masanori Kimura
雅宣 木村
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.)
Renesas Micro Systems Co Ltd
Original Assignee
Renesas Micro Systems 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 Renesas Micro Systems Co Ltd filed Critical Renesas Micro Systems Co Ltd
Priority to JP2002102270A priority Critical patent/JP2003298544A/en
Publication of JP2003298544A publication Critical patent/JP2003298544A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Television Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Time-Division Multiplex Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To multiplex a plurality of elementary streams ES independently of the capacity of a main buffer (MB) of the Program System Target Decoder (P-STD). <P>SOLUTION: The program stream multiplexing apparatus is provided with a pack selection circuit 71 for managing the state of the memory occupied amount of a VMB 204 for storing a video ESVS of the P-STD and AMB 207, 209 for storing audio ESAS1, AS2, discriminating multiplex precedence and multiplexing discrimination to multiplex the video ESVS and audio ESA1, AS2 in the order of the VMB 204 and the AMB 207, 209 which get free so as to control the multiplexing. The apparatus manages the state of the MB and multiplexes the ES in the order the MB getting free when multiplexing a plurality of ES to attain multiplexing without causing underflow to the MB even when the ES with the same MB capacity is multiplexed. <P>COPYRIGHT: (C)2004,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明はプログラムストリー
ム多重化方法及び装置に関し、特に圧縮符号化されたビ
デオ及び音声データである複数のプログラムストリーム
を多重化するためのプログラムストリーム多重化方法及
び装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program stream multiplexing method and apparatus, and more particularly, to a program stream multiplexing method and apparatus for multiplexing a plurality of program streams which are compression-encoded video and audio data.

【0002】[0002]

【従来の技術】近年、限られた伝送帯域で高品質の画像
(ビデオ)音声(オーディオ)信号や各種データ信号等
を伝送する場合、例えばMPEG2(Moving P
icture Expert Group Phase
2)等による情報圧縮符号化技術及び多重化技術を用い
てビデオオーディオ信号の符号化及び多重化を行い、1
本のビットストリームとして伝送する画像音声信号伝送
システムが普及しつつある。
2. Description of the Related Art In recent years, when transmitting high-quality image (video) audio (audio) signals and various data signals in a limited transmission band, for example, MPEG2 (Moving P).
image Expert Group Phase
2) Encode and multiplex video and audio signals using the information compression encoding technology and multiplexing technology according to 1)
A video / audio signal transmission system for transmitting as a bit stream of a book is becoming widespread.

【0003】ここで、MPEGはISOとCCITTの
専門家グループISO/IEC,JTC1/SC2/W
G8(Moving Picture Expert
Group)が1993年に勧告ISO/IEC−11
172−2として、まず記録媒体への記録を対象とする
MPEG1規格(現在最新版はISO/IEC−111
72−3)が制定され、以後ISO/IEC−1381
8−2でMPEG2等が制定されている。以下、説明の
便宜上、これら規格を総括してMPEG規格と呼ぶ。
Here, MPEG is an expert group ISO / IEC of ISO and CCITT, JTC1 / SC2 / W.
G8 (Moving Picture Expert)
Group) recommended in 1993 ISO / IEC-11
172-2, first, the MPEG1 standard (currently the latest version is ISO / IEC-111) for recording on a recording medium.
72-3) was established, and thereafter ISO / IEC-1381
MPEG-2 etc. are established in 8-2. Hereinafter, for convenience of description, these standards are collectively referred to as the MPEG standard.

【0004】このような、画像音声信号伝送システムに
おける送信装置では、MPEG規格による圧縮符号化技
術により、ビデオオーディオ信号や各種データ信号等
(以下説明の便宜上、ビデオオーディオ信号と呼ぶ)を
符号化し符号化データを生成するとともに、多重化技術
により、これらの符号化データを多重化してビットスト
リームを形成する。ここでは、このビットストリームを
プログラムストリーム(以下PS)と呼ぶ。また、ビデ
オオーディオ信号の各々に対応する符号化データの各々
をエレメンタリストリーム(ES)と呼ぶ。すなわち、
ビデオ信号対応のビデオES及びオーディオ信号対応の
オーディオESを多重化して1つのPSを形成する。
In such a transmitting device in the video / audio signal transmission system, a video audio signal, various data signals and the like (hereinafter referred to as a video audio signal for the sake of convenience of description) are coded and coded by a compression coding technique according to the MPEG standard. The encoded data is generated and the encoded data is multiplexed by a multiplexing technique to form a bit stream. Here, this bit stream is called a program stream (hereinafter, PS). In addition, each piece of encoded data corresponding to each of the video and audio signals is called an elementary stream (ES). That is,
A video ES corresponding to a video signal and an audio ES corresponding to an audio signal are multiplexed to form one PS.

【0005】従来、1つのビデオESと1つのオーディ
オESを多重化して1つのPSを生成するのが一般的で
あったが、今後2つ以上のビデオESと2つ以上のオー
ディオESを多重化することが考えられ、既に1つのビ
デオESと2つのオーディオESを多重化する市場要求
もある。また、MPEG2規格において、32のオーデ
ィオESと16のビデオESを多重化できることも規定
されている。
Conventionally, it was general to generate one PS by multiplexing one video ES and one audio ES, but in the future, two or more video ESs and two or more audio ESs will be multiplexed. However, there is already a market demand for multiplexing one video ES and two audio ESs. The MPEG2 standard also defines that 32 audio ESs and 16 video ESs can be multiplexed.

【0006】従来のプログラムストリーム多重化方法で
は、オーディオESのプログラムシステムターゲットデ
コーダ(以下、P−STD)のメインバッファ容量とビ
デオESのP−STDメインバッファ容量との差が大き
かったため、容量の小さなオーディオESから優先して
多重化を行っていた。
In the conventional program stream multiplexing method, the capacity is small because the difference between the main buffer capacity of the audio ES program system target decoder (hereinafter, P-STD) and the P-STD main buffer capacity of the video ES is large. The audio ES was prioritized for multiplexing.

【0007】1つのビデオESと1つのオーディオES
を多重化する従来の第1のプログラムストリーム多重化
装置をブロックで示す図18を参照すると、この従来の
第1のプログラムストリーム多重化装置は、入力したデ
ィジタルビデオ信号VDをMPEG規格で圧縮符号化し
ビデオESVSを出力するビデオエンコーダ1と、ビデ
オESVSを一時保持するビデオバッファ4と、ディジ
タルオーディオ信号AD1を入力しMPEG規格の圧縮
符号化プロトコルに従って圧縮符号化を行いオーディオ
ESAS1を出力するオーディオエンコーダ2と、オー
ディオESAS1を一時保持するオーディオバッファ5
と、ビデオバッファ(VB)4とオーディオバッファ
(AB)5に保持しているビデオESVS及びオーディ
オESAS1を多重化してプログラムストリームPSと
して出力する多重器107とを備える。
One video ES and one audio ES
Referring to FIG. 18 which shows a block diagram of a first conventional program stream multiplexing device for multiplexing, the first conventional program stream multiplexing device compresses and encodes an input digital video signal VD in accordance with the MPEG standard. A video encoder 1 that outputs a video ESVS, a video buffer 4 that temporarily holds a video ESVS, an audio encoder 2 that inputs a digital audio signal AD1 and performs compression encoding according to a compression encoding protocol of the MPEG standard and outputs an audio ESAS1. , Audio buffer 5 for temporarily holding audio ESAS1
And a multiplexer 107 that multiplexes the video ESVS and the audio ESAS1 held in the video buffer (VB) 4 and the audio buffer (AB) 5 and outputs them as a program stream PS.

【0008】多重器107は、ビデオバッファ(VB)
4内のビデオESの占有量を確認し保持するVB占有量
確認回路73と、後述するプログラムシステムターゲッ
トデコーダ(以下、P−STD)のビデオメインバッフ
ァ(以下、VMB)204のシミュレーションを行うV
MBシミュレーション回路74と、オーディオバッファ
5内のオーディオESAS1の占有量を確認保持するA
B占有量確認回路75と、後述するP−STDのオーデ
ィオメインバッファ(以下AMB)207のシミュレー
ションを行うAMBシミュレーション回路76と、後述
のパック選択回路171からのデータに基づきMBシミ
ュレーション用のシステムクロックリファレンス(以
下、SCR)を生成するSCR生成回路79と、多重化
対象のパック(PSの基本単位)であるビデオESVS
及びオーディオESAS1を後述の多重化順位付け及び
多重化判断を行い多重化の制御を行うパック選択回路1
71と、選択したパックの多重化を行う多重化回路17
2とを備える。
The multiplexer 107 is a video buffer (VB).
VB occupancy confirmation circuit 73 for confirming and retaining the occupancy of the video ES in 4 and V for simulating a video main buffer (hereinafter, VMB) 204 of a program system target decoder (hereinafter, P-STD) described later.
MB simulation circuit 74 and A for confirming and holding the occupied amount of audio ESAS1 in audio buffer 5
A B occupancy confirmation circuit 75, an AMB simulation circuit 76 for simulating an audio main buffer (hereinafter referred to as AMB) 207 of P-STD described later, and a system clock reference for MB simulation based on data from a pack selection circuit 171 described later. SCR generation circuit 79 for generating (hereinafter, SCR) and a video ESVS that is a pack (basic unit of PS) to be multiplexed.
And a pack selection circuit 1 for controlling the multiplexing of the audio ESAS 1 by performing the multiplexing ranking and the multiplexing judgment described later.
71 and a multiplexing circuit 17 for multiplexing the selected pack
2 and.

【0009】従来の第1のPS多重化装置が出力したP
Sに対する仮想的な復号器であるP−STDの構成をブ
ロックで示す図19を参照すると、この図に示す従来の
第1のP−STDは、入力したPSをビデオESVS,
オーディオESAS1,SCR,PTS及びDTSに分
解するデマルチプレクス部301と、SCRの供給を受
けシステムタイムクロック(STC)を生成するシステ
ムクロック生成部202と、ビデオESを保持するVM
B204と、オーディオESAS1を保持するAMB2
07と、STCとPTS又はDTSとの比較を行い比較
結果に応じてVMB204又はAMB207/209に
対しPTS又はDTSに対応するESをビデオデコーダ
205又はオーディオデコーダ208/210に出力す
るよう指示するとともに後述のセレクタ206,212
の制御信号を出力するタイムスタンプ比較部203と、
入力したビデオESを復号してビデオ信号Vを出力する
ビデオデコーダ205と、入力したオーディオESAS
1を復号してオーディオ信号A1を出力するオーディオ
デコーダ208と、タイムスタンプ比較部203からの
制御信号の供給に応答してビデオ信号Vを再配列バッフ
ァ211に供給するよう切り替えるセレクタ206,2
12と、ビデオ信号のピクチャの配列順を変更するため
再配列を行う再配列バッファ211とを備える。
P output from the conventional first PS multiplexer
Referring to FIG. 19 which shows a block diagram of a configuration of a P-STD, which is a virtual decoder for S, the first conventional P-STD shown in this figure converts the input PS into a video ESVS,
A demultiplexing unit 301 that decomposes audio ESAS1, SCR, PTS, and DTS, a system clock generating unit 202 that receives the SCR and generates a system time clock (STC), and a VM that holds a video ES.
B204 and AMB2 holding audio ESAS1
07, STC and PTS or DTS are compared, and in accordance with the comparison result, the VMB 204 or AMB 207/209 is instructed to output the ES corresponding to the PTS or DTS to the video decoder 205 or the audio decoder 208/210, and will be described later. Selectors 206 and 212
A time stamp comparison unit 203 which outputs a control signal of
A video decoder 205 for decoding the input video ES and outputting a video signal V, and an input audio ESAS
An audio decoder 208 that decodes 1 and outputs an audio signal A1, and selectors 206 and 2 that switch to supply the video signal V to the rearrangement buffer 211 in response to the supply of the control signal from the time stamp comparison unit 203.
12 and a rearrangement buffer 211 that rearranges to change the arrangement order of the pictures of the video signal.

【0010】次に、図18、図19及び各部の処理をフ
ローチャートで示す図20〜図22を参照して、従来の
第1のプログラムストリーム多重化装置の動作について
説明すると、上述したように、従来は、オーディオES
から優先して多重化を行うので、まず、オーディオES
の多重化判断及び多重化について説明する。
Next, the operation of the first conventional program stream multiplexing apparatus will be described with reference to FIGS. 18 and 19 and FIGS. Conventionally, audio ES
First, the audio ES will be multiplexed.
The determination of multiplexing and multiplexing will be described.

【0011】図20を参照すると、多重化判断ステップ
L1で、パック選択回路171は、多重化するためのデ
ータ量のES(以下、多重化対象ES)がオーディオバ
ッファ5に存在するか判断するためAB占有量確認回路
75に対し容量確認要求を出力し容量確認を行う。すな
わち、オーディオバッファ占有量≧オーディオESの多
重化量であるかを確認する。
Referring to FIG. 20, in the multiplexing determination step L1, the pack selection circuit 171 determines whether or not an ES having a data amount for multiplexing (hereinafter, ES to be multiplexed) exists in the audio buffer 5. A capacity confirmation request is output to the AB occupation amount confirmation circuit 75 to confirm the capacity. That is, it is confirmed whether the audio buffer occupancy ≧ the audio ES multiplexing amount.

【0012】ステップL1で、多重化対象ESがオーデ
ィオバッファ5に存在しない場合、オーディオESの多
重化判断を終了し、分岐M以降のビデオESの多重化判
断に進む。
At step L1, if the ES to be multiplexed does not exist in the audio buffer 5, the determination of the multiplexing of the audio ES is ended, and the determination of the multiplexing of the video ES after the branch M is made.

【0013】ステップL1で、多重化対象ESがオーデ
ィオバッファ5に存在する場合、ステップL2〜L6に
進み、AMB207がオーディオESを入力してもオー
バフローもアンダフローも起こさないかを判断する。
When the ES to be multiplexed is present in the audio buffer 5 in step L1, the process proceeds to steps L2 to L6, and it is determined whether the AMB 207 receives the audio ES and neither overflow nor underflow occurs.

【0014】まず、MB空き容量確認ステップL2で、
パック選択回路171は、AMBシミュレーション回路
76に対して空き容量確認要求を出力し、この空き容量
確認要求に対する応答である空き容量を入力しこの値を
空き容量1とする。空き容量2算出ステップL3で、空
き容量1から多重化順位1ESの多重化ES量を減算
し、空き容量2を算出する。
First, in the MB free space confirmation step L2,
The pack selection circuit 171 outputs a free space confirmation request to the AMB simulation circuit 76, inputs a free space as a response to this free space confirmation request, and sets this value as the free space 1. In the free space 2 calculation step L3, the free space 2 is calculated by subtracting the multiplexing ES amount of the multiplexing order 1ES from the free space 1.

【0015】削除AU量呼出ステップL4で、パック選
択回路171は、多重化を行うときに付加するSCRを
AMBシミュレーション回路76に出力する。AMBシ
ミュレーション回路76は、入力したSCRでAMB2
07から削除されるAU量を呼び出しパック選択回路1
71に出力する。
In the deletion AU amount calling step L4, the pack selection circuit 171 outputs the SCR added when multiplexing is performed to the AMB simulation circuit 76. The AMB simulation circuit 76 uses the input SCR for AMB2
Call the AU amount deleted from 07, and pack selection circuit 1
To 71.

【0016】空き容量3算出ステップL5で、空き容量
2にAU量を加算する。この値を空き容量3とする。空
き容量3はオーディオESを多重化したときのAMB2
07の空き容量を示す。
At step L5 of calculating the free space 3, the AU amount is added to the free space 2. This value is used as the free space 3. Free space 3 is AMB2 when audio ES is multiplexed
The free space of 07 is shown.

【0017】MB容量判断ステップL6で、パック選択
回路171は空き容量3がAMB207の容量内かを判
断する。
In the MB capacity judgment step L6, the pack selection circuit 171 judges whether the free capacity 3 is within the capacity of the AMB 207.

【0018】ステップL6で、空き容量3がAMB20
7の容量外である場合、オーディオESの多重化判断を
終了し、分岐Mに進み、ビデオESの多重化判断を行
う。
At step L6, the free space 3 becomes AMB20.
If it is out of the capacity of 7, the audio ES multiplexing determination is ended, and the process proceeds to the branch M to make a video ES multiplexing determination.

【0019】ステップL6で、空き容量3がAMB20
7の容量内にある場合、オーディオESを多重化しても
AMB207はオーバフローもアンダフローも発生しな
いとして、ステップL7〜L11で、オーディオESの
多重化を行う。
At step L6, the free space 3 becomes AMB20.
If it is within the capacity of 7, the audio ES is multiplexed in steps L7 to L11, assuming that the AMB 207 does not overflow or underflow even if the audio ES is multiplexed.

【0020】まず、出力ES量指示ステップL7で、パ
ック選択回路171は、オーディオバッファ5に多重化
回路172に対して出力するES量を指示する。オーデ
ィオバッファ5はその指示を受けて、指示された量のE
Sを多重化回路172に出力する。
First, in the output ES amount instruction step L7, the pack selection circuit 171 instructs the audio buffer 5 to output the ES amount to the multiplexing circuit 172. In response to the instruction, the audio buffer 5 receives the designated amount of E
The S is output to the multiplexing circuit 172.

【0021】SCRとESパラメータ出力ステップL8
で、パック選択回路171はPSに付加するSCRを多
重化回路172に出力する。また多重化を行うESにA
Uの先頭が含まれている場合、PTS、AU量も多重化
回路172に出力する。
SCR and ES parameter output step L8
Then, the pack selection circuit 171 outputs the SCR added to PS to the multiplexing circuit 172. In addition, the ES for multiplexing
When the head of U is included, the PTS and AU amount are also output to the multiplexing circuit 172.

【0022】シミュレーション用SCR生成ステップL
9で、パック選択回路171は、PSに付加するSCR
をSCR生成回路79に出力する。
Simulation SCR generation step L
At 9, the pack selection circuit 171 adds the SCR to the PS.
Is output to the SCR generation circuit 79.

【0023】ステップL10で、パック選択回路171
は、多重化対象のES量をAMBシミュレーション回路
76に出力する。また多重化を行うESにAUの先頭が
含まれている場合、PTS、AU量もAMBシミュレー
ション回路76に出力する。
At step L10, the pack selection circuit 171
Outputs the ES amount to be multiplexed to the AMB simulation circuit 76. If the ES to be multiplexed includes the head of AU, the PTS and AU amount are also output to the AMB simulation circuit 76.

【0024】SCR加算値の加算ステップL11で、パ
ック選択回路171は、SCRにSCR加算値を加算し
保持する。
In the addition step L11 of the SCR added value, the pack selection circuit 171 adds and holds the SCR added value to the SCR.

【0025】多重化回路172は、入力されたES、S
CR、PTS、AU量から多重化を行い、PSを出力す
る。
The multiplexing circuit 172 receives the input ES, S
Multiplexing is performed from CR, PTS, and AU amounts, and PS is output.

【0026】AMBシミュレーション回路76は、AM
B207の空き容量から入力ES量を減算する。AMB
シミュレーション回路76は入力AU量およびPTSを
関連付けて保持する。VMBシミュレーション回路74
はSCR生成回路79とVMBシミュレーション回路7
4に保持しているDTSを比較し、シミュレーション用
のSCRSCよりDTSの方が小さいとき、VMB20
4の空き容量にDTSに関連するAU量を加算し、DT
Sの方が大きいとき、そのDTSおよびそのDTSに関
連するAU量を削除する。
The AMB simulation circuit 76 uses the AM
The input ES amount is subtracted from the free capacity of B207. AMB
The simulation circuit 76 holds the input AU amount and the PTS in association with each other. VMB simulation circuit 74
Is the SCR generation circuit 79 and the VMB simulation circuit 7
When the DTS held in 4 is compared and the DTS is smaller than the simulation SCRSC, the VMB20
Add the AU amount related to DTS to the free space of 4
When S is larger, delete the DTS and the AU amount associated with the DTS.

【0027】AMBシミュレーション回路76は、SC
RとAMBシミュレーション回路76に保持しているP
TSを比較し、PTSの方が小さいとき、AMB207
の空き容量にPTSに関連するAU量を加算し、PTS
の方が大きいとき、そのPTSおよびそのPTSに関連
するAU量を削除する。
The AMB simulation circuit 76 is an SC
R and P held in the AMB simulation circuit 76
When TS is compared and PTS is smaller, AMB207
Add the AU amount related to PTS to the free space of
, The PTS and the AU amount associated with that PTS are deleted.

【0028】以降、上記に示したSCR生成回路79の
SCRの設定値変更に伴う、VMBシミュレーション回
路74及びAMBシミュレーション回路76、それぞれ
に保持している値の変更、削除の動作を、各MBシミュ
レーション回路は変更されたSCRの値に合わせ保持値
の変更を行うと記述する。
Thereafter, the operation of changing and deleting the values held in the VMB simulation circuit 74 and the AMB simulation circuit 76, respectively, in association with the change of the SCR set value of the SCR generation circuit 79 described above is performed for each MB simulation. The circuit is described as changing the hold value according to the changed SCR value.

【0029】次に、図21を参照して、分岐Mの処理で
あるビデオESの多重化判断及び多重化について、上述
のオーディオESの多重化判断及び多重化との相違点を
重点的に説明すると、まず、多重化判断ステップM1
で、パック選択回路171は、多重化対象ビデオES
が、ビデオバッファ4に存在するか判断するため、VB
占有量確認回路73に対し容量確認要求を出力し容量確
認を行う。すなわち、ビデオバッファ占有量≧ビデオE
Sの多重化量であるかを確認する。
Next, with reference to FIG. 21, with respect to the multiplexing judgment and multiplexing of the video ES, which is the processing of the branch M, the difference from the above-described audio ES multiplexing judgment and multiplexing will be mainly described. Then, first, the multiplexing determination step M1
Then, the pack selection circuit 171 determines that the video ES to be multiplexed is
, VB to determine whether it exists in the video buffer 4,
A capacity confirmation request is output to the occupancy confirmation circuit 73 to confirm the capacity. That is, video buffer occupancy ≧ video E
It is confirmed whether or not it is the multiplexing amount of S.

【0030】ステップM1で、多重化対象ビデオESが
ビデオバッファ4に存在しない場合、ビデオESの多重
化判断を終了し、分岐N以降のSCR調整処理に進む。
If the video ES to be multiplexed does not exist in the video buffer 4 in step M1, the determination of the multiplexing of the video ES is finished, and the process proceeds to the SCR adjustment processing after the branch N.

【0031】ステップM1で、ビデオバッファ4に多重
化対象ビデオESが存在する場合、MB空き容量確認ス
テップM2、空き容量算出ステップM3、削除AU量呼
出ステップM4、空き容量算出ステップM5、MB容量
判断ステップM6の各処理を行い、VMB204がビデ
オESを入力してもオーバフローもアンダフローも起こ
さないか判断する。これらステップM2〜M6の処理
は、オーディオESをビデオESに、オーディオバッフ
ァ5をビデオバッファ4に、AMB207をVMB20
4に、AMBシミュレーション回路76をVMBシミュ
レーション回路74に、空き容量1,2,3を空き容量
7,8,9にそれぞれ読み替えることによりオーディオ
ESの多重化判断及び多重化のステップL2〜L6の処
理と同一であるので詳細説明を省略する。
If the video buffer 4 contains the video ES to be multiplexed in step M1, MB free space confirmation step M2, free space calculation step M3, deleted AU amount recall step M4, free space calculation step M5, MB capacity determination The processing of step M6 is performed to determine whether overflow or underflow occurs even if the VMB 204 inputs the video ES. The processing of these steps M2 to M6 is performed by converting the audio ES into the video ES, the audio buffer 5 into the video buffer 4, and the AMB 207 into the VMB 20.
4, the AMB simulation circuit 76 is read as the VMB simulation circuit 74, and the free capacities 1, 2, 3 are read as free capacities 7, 8, 9 respectively, and the processing of the audio ES multiplexing determination and the multiplexing steps L2 to L6 is performed. Since it is the same as, the detailed description will be omitted.

【0032】ステップM6で、空き容量9がVMB20
4の容量外である場合、ビデオESの多重化判断を終了
し、分岐NのSCR調整処理に進む。
At step M6, the free capacity 9 becomes VMB20.
If it is out of the capacity of 4, the multiplexing judgment of the video ES is ended, and the process proceeds to the SCR adjustment processing of the branch N.

【0033】ステップM6で、空き容量9がVMB20
4の容量内ある場合、ビデオESを多重化してもVMB
204はオーバフローもアンダフローも発生しないとし
て、出力ES量指示ステップM7、SCRとESパラメ
ータ出力ステップM8、シミュレーション用SCR生成
ステップM9、多重化対象ES量・パラメータ出力ステ
ップM10、SCR加算値の加算ステップM11の各処
理を行い、ビデオESの多重化を行う。これらステップ
M7〜M11も、上記読替以外はオーディオESの多重
化判断及び多重化のステップL7〜L11の処理と同一
であるので詳細説明を省略する。
At step M6, the free capacity 9 becomes VMB20.
If it is within the capacity of 4, even if video ES is multiplexed, VMB
Assuming that neither an overflow nor an underflow occurs in 204, an output ES amount instruction step M7, an SCR and ES parameter output step M8, a simulation SCR generation step M9, a multiplexing target ES amount / parameter output step M10, and an SCR addition value addition step Each process of M11 is performed to multiplex the video ES. These steps M7 to M11 are also the same as the processing of the audio ES multiplexing determination and multiplexing steps L7 to L11 except for the above-mentioned replacement, and therefore detailed description thereof will be omitted.

【0034】多重化回路172は、入力されたES、S
CR、PTS、DTS、AU量、ピクチャタイプにから
多重化を行い、PSを出力する。
The multiplexing circuit 172 receives the input ES, S
Multiplexing is performed based on CR, PTS, DTS, AU amount, and picture type, and PS is output.

【0035】VMBシミュレーション回路74は、VM
B204の空き容量から入力ES量を減算し、DTS,
AU量を関連付けて保持する。各MBシミュレーション
回路は、変更されたSCRの値に合わせ、保持値の変更
を行う。
The VMB simulation circuit 74 uses the VM
The input ES amount is subtracted from the free capacity of B204, and DTS,
The AU amount is associated and held. Each MB simulation circuit changes the held value according to the changed SCR value.

【0036】次に、図22を参照して分岐Nの処理であ
るSCR調整処理について説明すると、パック選択回路
171は、オーディオES及びビデオESが多重化でき
なかったとき、SCRの調整を行う。
Next, the SCR adjustment processing, which is the processing of the branch N, will be described with reference to FIG. 22. The pack selection circuit 171 adjusts the SCR when the audio ES and the video ES cannot be multiplexed.

【0037】まず、多重化判断ステップN1で、パック
選択回路171は、多重化対象ES量がオーディオバッ
ファ5に存在するか判断するため、AB占有量確認回路
75の容量確認を行い、存在しない場合、SCR調整処
理及び多重化処理を終了する。
First, in the multiplexing determination step N1, the pack selection circuit 171 confirms the capacity of the AB occupancy confirmation circuit 75 to determine whether the multiplexing target ES amount exists in the audio buffer 5, and if it does not exist. , SCR adjustment processing and multiplexing processing ends.

【0038】ステップN1で、多重化対象ES量がオー
ディオバッファ5に存在する場合、多重化判断ステップ
N2で、多重化対象ES量がビデオバッファ4に存在す
るか判断するため、VB占有量確認回路73の容量確認
を行い、存在しない場合、SCR調整処理及び多重化処
理を終了する。
When the amount of ES to be multiplexed is present in the audio buffer 5 in step N1, the VB occupation amount confirmation circuit is used to determine whether or not the amount of ES to be multiplexed is present in the video buffer 4 in the multiplexing determination step N2. The capacity of 73 is confirmed, and if it does not exist, the SCR adjustment processing and the multiplexing processing are terminated.

【0039】ステップN2で、多重化対象ES量が多重
化対象ES量がビデオバッファ4に存在する場合、PT
S最小値呼出ステップN3、DTS最小値呼出ステップ
N4、SCR調整値出力ステップN5、SCR変更ステ
ップN6の各処理を行いSCRの調整を行う。
In step N2, if the multiplexing target ES amount is present in the video buffer 4, the PT
The SCR adjustment is performed by performing each processing of the S minimum value calling step N3, the DTS minimum value calling step N4, the SCR adjustment value output step N5, and the SCR changing step N6.

【0040】まず、PTS最小値呼出ステップN3で、
パック選択回路171は、AMBシミュレーション回路
76に最小値確認を出力し、AMBシミュレーション回
路76は保持しているPTSの最小値をパック選択回路
171に出力する。この値を仮SCR3とする。
First, in the PTS minimum value calling step N3,
The pack selection circuit 171 outputs the minimum value confirmation to the AMB simulation circuit 76, and the AMB simulation circuit 76 outputs the held minimum value of PTS to the pack selection circuit 171. This value is set as the temporary SCR3.

【0041】DTS最小値呼出ステップN4で、パック
選択回路171は、VMBシミュレーション回路74に
最小値確認を出力し、VMBシミュレーション回路74
は保持しているDTSの最小値をパック選択回路171
に出力する。この値を仮SCR4とする。
At the DTS minimum value calling step N4, the pack selection circuit 171 outputs the minimum value confirmation to the VMB simulation circuit 74, and the VMB simulation circuit 74.
Is the minimum value of the DTS held by the pack selection circuit 171.
Output to. This value is set as the temporary SCR4.

【0042】SCR調整値出力ステップN5で、パック
選択回路171は、仮SCR3と仮SCR4を比較し、
小さい方の値をSCR生成回路79に出力する。
At the SCR adjustment value output step N5, the pack selection circuit 171 compares the temporary SCR3 and the temporary SCR4,
The smaller value is output to the SCR generation circuit 79.

【0043】SCR変更ステップN6で、パック選択回
路171は、仮SCR3と仮SCR4を比較し、小さい
方の値を次に出力するSCRとして設定・保持する。
At the SCR change step N6, the pack selection circuit 171 compares the temporary SCR3 and the temporary SCR4 and sets / holds the smaller value as the SCR to be output next.

【0044】次に、1つのビデオESと2つのオーディ
オESを多重化する従来の第2のプログラムストリーム
多重化装置を図18と共通の構成要素には共通の参照文
字/数字を付して同様にブロックで示す図23を参照す
ると、この従来の第2のプログラムストリーム多重化装
置の前述の従来の第1のプログラムストリーム多重化装
置との相違点は、増加した多重化対象の第2のオーディ
オESに対応して、第1のプログラムストリーム多重化
装置の構成要素に第2のディジタルオーディオ信号AD
2を入力しMPEG規格の圧縮符号化プロトコルに従っ
て圧縮符号化を行いオーディオESAS2を出力するオ
ーディオエンコーダ3と、オーディオESASを一時保
持するオーディオバッファ6と、多重器107の代わり
に、ビデオバッファ(VB)4とオーディオバッファ
(AB)5,6に保持しているビデオESVS及びオー
ディオESAS1,ESAS2を多重化してプログラム
ストリームPSとして出力する多重器107とを備え
る。
Next, a second conventional program stream multiplexer for multiplexing one video ES and two audio ESs is the same as in FIG. 18 with common reference characters / numerals attached to the same components. Referring to FIG. 23, which is shown in a block form, the difference between this second conventional program stream multiplexer and the above-mentioned first conventional program stream multiplexer is that the second audio to be multiplexed is increased. Corresponding to ES, the second digital audio signal AD is added to the component of the first program stream multiplexer.
An audio encoder 3 that inputs 2 and performs compression encoding according to the compression encoding protocol of the MPEG standard to output an audio ESAS 2, an audio buffer 6 that temporarily holds the audio ESAS, and a video buffer (VB) instead of the multiplexer 107. 4 and a multiplexer 107 which multiplexes the video ESVS and the audio ESAS1 and ESAS2 held in the audio buffers (AB) 5 and 6 and outputs them as a program stream PS.

【0045】多重器107Aは、多重器107の構成要
素に加えて、オーディオバッファ6内のオーディオES
AS2の占有量を確認保持するAB占有量確認回路77
と、AMB209のシミュレーションを行うAMBシミ
ュレーション回路78と、パック選択回路171の代わ
りに多重化対象のビデオESVS及びオーディオESA
S1,ESAS2を多重化順位付け及び多重化判断を行
い多重化の制御を行うパック選択回路171Aと、多重
化回路172の代わりにオーディオESAS2を含む選
択したパックの多重化を行う多重化回路72とを備える
ことである。
The multiplexer 107A includes the audio ES in the audio buffer 6 in addition to the components of the multiplexer 107.
AB occupation amount confirmation circuit 77 for confirming and retaining the occupation amount of AS2
And an AMB simulation circuit 78 for simulating the AMB 209, and a video ESVS and audio ESA to be multiplexed instead of the pack selection circuit 171.
A pack selection circuit 171A that performs S1 and ESAS2 multiplexing ordering and determination, and controls multiplexing, and a multiplexing circuit 72 that multiplexes a selected pack including the audio ESAS2 instead of the multiplexing circuit 172. Is to prepare.

【0046】従来の第2のPS多重化装置に対応するP
−STDの構成をブロックで示す図24を参照すると、
この図に示す従来の第2のP−STDの従来の第1のP
−STDとの相違点は、デマルチプレクス部301の代
わりに入力したPSをビデオESVS,オーディオES
AS1,ESAS2,システムクロック(SCR),P
TS及びDTSに分解するデマルチプレクス部201
と、オーディオESAS2を保持するAMB209と、
オーディオESASを復号してオーディオ信号A2を出
力するオーディオデコーダ210とを備えることであ
る。
P corresponding to the conventional second PS multiplexer
Referring to FIG. 24, which shows the block diagram of the STD configuration,
The conventional first P of the conventional second P-STD shown in FIG.
-The difference from STD is that the PS input instead of the demultiplexing unit 301 is converted into a video ESVS and an audio ES.
AS1, ESAS2, system clock (SCR), P
Demultiplexing unit 201 for decomposing into TS and DTS
And AMB209 holding audio ESAS2,
And an audio decoder 210 for decoding the audio ESAS and outputting the audio signal A2.

【0047】次に、図23、図24及び各部の処理をフ
ローチャートで示す図25〜図28を参照して、従来の
第2のプログラムストリーム多重化装置の動作について
第1のプログラムストリーム多重化装置の動作との相違
点を重点的に説明すると、上述したように、多重化は、
P−STDメインバッファ容量の小さい順に行ってお
り、オーディオESが2つの場合は、いずれかを優先し
て多重化を行うことになる。この例では、説明の便宜
上、オーディオESAS1、オーディオESAS2、ビ
デオESVSの順で多重化を行うものとする。
Next, with reference to FIGS. 23 and 24 and FIGS. 25 to 28 which are flowcharts showing the processes of the respective units, the operation of the second conventional program stream multiplexer will be described with reference to the operation of the first program stream multiplexer. The difference from the operation of
P-STD main buffers are processed in ascending order of capacity, and when there are two audio ESs, one of them is given priority for multiplexing. In this example, for convenience of explanation, it is assumed that the audio ESAS1, the audio ESAS2, and the video ESVS are multiplexed in this order.

【0048】図25を参照すると、この図に示すオーデ
ィオESAS1の多重化判断及び多重化は、多重化判断
ステップL1Aで、多重化対象ESがオーディオバッフ
ァ5に存在しない場合、オーディオESAS1の多重化
判断を終了し、分岐P以降のオーディオESAS2の多
重化判断に進むことを除き、前述の従来の第1のプログ
ラムストリーム多重化装置のオーディオESAS1の多
重化判断及び多重化と同一であるので、説明を省略す
る。
Referring to FIG. 25, in the multiplexing judgment and multiplexing of the audio ESAS1 shown in this figure, in the multiplexing judgment step L1A, if the ES to be multiplexed does not exist in the audio buffer 5, it is judged whether the audio ESAS1 is multiplexed. Except that the procedure is the same as that of the audio ESAS1 of the conventional first program stream multiplexer described above, except that the processing is terminated and the audio ESAS2 after the branch P is determined. Omit it.

【0049】次に、図26を参照すると、この図に示す
オーディオESAS2の多重化判断及び多重化は、多重
化判断ステップP1で、多重化対象ESがオーディオバ
ッファ6に存在しない場合、オーディオESAS2の多
重化判断を終了し、分岐M以降のビデオESVSの多重
化判断に進むこと、ステップL2〜L11をステップP
2〜P11に、空き容量1,2,3を空き容量4,5,
6にそれぞれ読み替える以外は、上述のオーディオES
AS1の多重化判断及び多重化と同一であるので、説明
を省略する。
Next, referring to FIG. 26, the multiplexing determination and multiplexing of the audio ESAS2 shown in FIG. End the multiplexing determination, and proceed to the multiplexing determination of the video ESVS after the branch M, step L2 to L11 to step P
2 to P11, free space 1, 2, 3 free space 4, 5,
Audio ES described above, except for each
Since this is the same as the AS1 multiplexing determination and multiplexing, the description thereof is omitted.

【0050】次に、図27を参照すると、この図に示す
ビデオESVSの多重化判断及び多重化は、多重化判断
ステップM1Aで、多重化対象ESがビデオバッファ4
に存在しない場合、ビデオESVSの多重化判断を終了
し、分岐Q以降のSCR調整処理に進むこと以外は、前
述の従来の第1のプログラムストリーム多重化装置のビ
デオESVSの多重化判断及び多重化と同一であるの
で、説明を省略する。
Next, referring to FIG. 27, in the multiplexing determination and multiplexing of the video ESVS shown in this figure, the multiplexing target ES is the video buffer 4 in the multiplexing determination step M1A.
If it does not exist, the video ESVS multiplexing determination and the multiplexing of the video ESVS of the above-described first conventional program stream multiplexer are performed, except that the video ESVS multiplexing determination is ended and the SCR adjustment processing after the branch Q is performed. Since it is the same as, the description will be omitted.

【0051】次に、図28を参照すると、この図に示す
従来の第2のプログラムストリーム多重化装置のSCR
調整処理は、前述の従来の第1のプログラムストリーム
多重化装置のSCR調整処理の多重化判断ステップN
1,N2に、オーディオESAS2の多重化判断ステッ
プQ1と、仮SCR5であるABMシミュレーション回
路78のPTS最小値呼出ステップQ2が追加され、こ
れに伴い、SCR調整値出力ステップN5の代わりに、
仮SCR3,仮SCR4に加え仮SCR5との比較結果
の最小値をSCR生成回路79に出力するSCR調整値
出力ステップQ3と、SCR変更ステップN6の代わり
に、パック選択回路171Aは、仮SCR3,仮SCR
4及び仮SCR5を比較結果の最小値を次に出力するS
CRとして設定・保持するSCR変更ステップQ4とを
有している。従って、このSCR調整処理は、上記相違
点以外は従来の第1のプログラムストリーム多重化装置
のSCR調整処理と同一であるので、説明を省略する。
Next, referring to FIG. 28, the SCR of the second conventional program stream multiplexer shown in FIG.
The adjustment processing is the multiplexing determination step N of the SCR adjustment processing of the above-described first conventional program stream multiplexer.
1, N2, a multiplexing determination step Q1 of the audio ESAS2 and a PTS minimum value calling step Q2 of the ABM simulation circuit 78 which is a temporary SCR5 are added, and accordingly, instead of the SCR adjustment value output step N5,
Instead of the SCR adjustment value output step Q3 of outputting the minimum value of the comparison result of the temporary SCR3 and the temporary SCR4 to the SCR generation circuit 79 and the SCR change step N6, the pack selection circuit 171A is SCR
4 and provisional SCR5 are output next to the minimum value of the comparison result S
SCR change step Q4 of setting / holding as CR. Therefore, this SCR adjustment processing is the same as the SCR adjustment processing of the conventional first program stream multiplexing apparatus except for the above-mentioned differences, and therefore description thereof will be omitted.

【0052】次に、具体的な数値例を用いて従来の第2
のプログラムストリーム多重化装置の動作について多重
化前及び多重化後の多重器7の状態を説明図で示す図9
を参照して説明すると、まず、この例の多重化条件を下
記に示す。
Next, the second conventional method will be described by using a specific numerical example.
9 is an explanatory diagram showing the states of the multiplexer 7 before and after the operation of the program stream multiplexer of FIG.
First, the multiplexing conditions of this example are shown below.

【0053】 VMB204の容量=229376バイト。[0053] The capacity of the VMB 204 = 229376 bytes.

【0054】AMB207の容量=4096バイト AMB209の容量=4096バイト ビデオESの多重化量=2015バイト オーディオESAS1の多重化量=2015バイト オーディオESAS2の多重化量=2015バイト 図25を参照すると、まず、ステップL1Aで、オーデ
ィオバッファ5の占有量がオーディオESAS1の多重
化ES量より多いかを判断し、多重化ES量は2350
バイトであり、多重化ES量は上記条件より2015バ
イトであるので、占有量の方が多い。
AMB207 capacity = 4096 bytes AMB209 capacity = 4096 bytes Video ES multiplexing amount = 2015 bytes Audio ESAS1 multiplexing amount = 2015 bytes Audio ESAS2 multiplexing amount = 2015 bytes Referring to FIG. In step L1A, it is determined whether the occupied amount of the audio buffer 5 is larger than the multiplexed ES amount of the audio ESAS1, and the multiplexed ES amount is 2350.
Since it is a byte and the multiplexed ES amount is 2015 bytes compared to the above condition, the occupied amount is larger.

【0055】次に、ステップL2〜L6で、オーディオ
ESAS1の多重化を行っても、AMB207がオーバ
フローもアンダフローも生じないか判断する。
Next, in steps L2 to L6, it is determined whether the AMB 207 causes neither overflow nor underflow even when the audio ESAS1 is multiplexed.

【0056】まず、ステップL2で、AMB207の空
き容量(空き容量1)2040バイトを呼出し、ステッ
プL3で2040バイトから、オーディオESAS1の
多重化ES量=2015バイトを減算し、空き容量2の
25バイトを求める。ステップL4で、保持SCR=6
0559をAMBシミュレーション回路76に通知す
る。AMBシミュレーション回路76は、通知SCRで
削除されるAU量、PTSがあるかの判断のためSCR
とPTSを比較する。通知SCR=60559より小さ
いPTSは存在しないので、AU量=0バイトをパック
選択回路171Aに通知する。
First, in step L2, the free capacity (free capacity 1) of the AMB 207, which is 2040 bytes, is called. Ask for. In step L4, hold SCR = 6
0559 is notified to the AMB simulation circuit 76. The AMB simulation circuit 76 determines whether the AU amount and PTS to be deleted by the notification SCR are SCR.
And PTS. Since there is no PTS smaller than the notification SCR = 60559, the pack selection circuit 171A is notified of AU amount = 0 bytes.

【0057】ステップL5で、通知されたAU量を空き
容量2(25バイト)に加算し、オーディオESAS1
を多重化したときのAMB207の空き容量を示す空き
容量3の25バイトを求める。
At step L5, the notified AU amount is added to the free space 2 (25 bytes), and the audio ESAS1 is added.
25 bytes of the free space 3 indicating the free space of the AMB 207 at the time of multiplexing are obtained.

【0058】ステップL6で、空き容量3がAMB20
7の容量内、0バイト以上4096バイト以下であるか
判断し、25バイトは、AMB207の容量内にあるの
で、パック選択回路171Aは、オーディオESAS1
の多重化をステップL7〜L11で行う。
At step L6, the free space 3 becomes AMB20.
In the capacity of 7, it is determined whether it is 0 bytes or more and 4096 bytes or less. Since 25 bytes are in the capacity of the AMB 207, the pack selection circuit 171A determines that the audio ESAS1.
Are multiplexed in steps L7 to L11.

【0059】ステップL7で、オーディオバッファ5に
出力するES量=2015バイトを通知し、オーディオ
バッファ5は通知されたES量2015バイトを多重化
回路72に出力する。ステップL8で、多重化時に付加
するSCR=60559、及びオーディオESAS1は
AUの先頭を含むので、多重化時に付加するPTS=6
8040、AU量=2016バイトも多重化回路72に
出力する。ステップL9で、SCR=60559をシミ
ュレーション用のSCR生成回路79に出力する。ステ
ップL10で、オーディオESAS1の多重化ES量=
2015バイトをAMBシミュレーション回路76に出
力する。オーディオESAS1はAUの先頭を含むの
で、付加用のPTS=68040、AU量=2016バ
イトもAMBシミュレーション回路76に出力する。ス
テップL11で、保持SCRにSCR加算値=159を
加算する。多重化回路72は、オーディオESAS1、
PTS、AU量、SCRを入力し、多重化を行い、PS
を出力する。
In step L7, the ES amount output to the audio buffer 5 = 2015 bytes is notified, and the audio buffer 5 outputs the notified ES amount 2015 bytes to the multiplexing circuit 72. At step L8, SCR = 60559 added at the time of multiplexing and audio ESAS1 includes the head of AU, so PTS = 6 added at the time of multiplexing.
8040 and AU amount = 2016 bytes are also output to the multiplexing circuit 72. In step L9, SCR = 60559 is output to the SCR generation circuit 79 for simulation. In step L10, the multiplexed ES amount of the audio ESAS1 =
The 2015 bytes are output to the AMB simulation circuit 76. Since the audio ESAS1 includes the head of the AU, the additional PTS = 68040 and the AU amount = 2016 bytes are also output to the AMB simulation circuit 76. In step L11, the SCR addition value = 159 is added to the held SCR. The multiplexing circuit 72 includes an audio ESAS1,
Input PTS, AU amount, SCR, multiplex, PS
Is output.

【0060】AMBシミュレーション回路76は、オー
ディオESAS1の多重化ES量=2015を入力し、
AMB207の空き容量から多重化ES量を減算し、新
たな空き容量25バイトを求める。AU量=2016バ
イト、PTS=68040を入力し、保持するととも
に、SCR=60559と保持PTSとを比較する。S
CR=60559より小さいPTSが存在しないので、
AU量、PTSの削除は行わない。
The AMB simulation circuit 76 inputs the multiplexed ES amount = 2015 of the audio ESAS1,
The multiplexed ES amount is subtracted from the free capacity of the AMB 207 to obtain a new free capacity of 25 bytes. AU amount = 2016 bytes and PTS = 68040 are input and held, and SCR = 60559 is compared with the held PTS. S
Since there is no PTS smaller than CR = 60559,
The AU amount and PTS are not deleted.

【0061】AMBシミュレーション回路78は、SC
R=60559と保持PTSとを比較し、保持PTS=
60480よりSCR=60559の方が大きいので、
AU量、PTSを削除し、削除したAU量をAMB20
9の空き容量に加算する。加算結果は5152バイトと
なり、AMB209容量=4096バイトを超えるの
で、AMB209でアンダフローが発生する。
The AMB simulation circuit 78 uses the SC
R = 60559 is compared with the retained PTS, and the retained PTS =
Since SCR = 60559 is larger than 60480,
The AU amount and PTS are deleted, and the deleted AU amount is set to AMB20.
Add to the free space of 9. The addition result is 5152 bytes, which exceeds the capacity of AMB209 = 4096 bytes, so that an underflow occurs in AMB209.

【0062】このように、従来の第2のプログラムスト
リーム多重化回路では、1つのビデオESと2つのオー
ディオESの多重化を行うと、P−STDのメインバッ
ファでアンダフローが発生するという問題点がある。
As described above, in the conventional second program stream multiplexing circuit, when one video ES and two audio ES are multiplexed, an underflow occurs in the main buffer of P-STD. There is.

【0063】[0063]

【発明が解決しようとする課題】上述した従来のプログ
ラムストリーム多重化方法及び装置は、複数のESの多
重化が多重化対象のESのサイズと多重化条件及びプロ
グラムストリームターゲットデコーダ(P−STD)の
メインバッファの容量に依存するため、メインバッファ
の容量が多重化対象のエレメンタリストリーム(ES)
のサイズと多重化条件に比較して余裕が小さい場合、例
えば1つのビデオESと2つのオーディオESの多重化
を行うと、P−STDのメインバッファでアンダフロー
が発生する可能性があるというという欠点があった。
In the conventional method and apparatus for program stream multiplexing described above, the multiplexing of a plurality of ESs involves the size of the ES to be multiplexed, the multiplexing condition, and the program stream target decoder (P-STD). The size of the main buffer depends on the capacity of the main buffer of the
If there is a small margin in comparison with the size and the multiplexing condition, for example, if one video ES and two audio ES are multiplexed, underflow may occur in the P-STD main buffer. There was a flaw.

【0064】本発明の目的は、P−STDのメインバッ
ファの容量に依存することなく、複数のESを多重化で
きるプログラムストリーム多重化方法及び装置を提供す
ることにある。
It is an object of the present invention to provide a program stream multiplexing method and apparatus capable of multiplexing a plurality of ESs without depending on the capacity of the main buffer of P-STD.

【0065】[0065]

【課題を解決するための手段】請求項1記載の発明のプ
ログラムストリーム多重化方法は、ディジタルビデオ信
号及び第1,第2のディジタルオーディオ信号の各々を
入力し所定の圧縮符号化プロトコルに従って圧縮符号化
を行いビデオエレメンタリストリーム(以下、ビデオE
S)及び第1及び第2のオーディオエレメンタリストリ
ーム(以下、オーディオES)の各々を生成し、これら
ビデオES及び第1及び第2のオーディオESを多重化
してプログラムストリームを生成するプログラムストリ
ーム多重化方法において、前記プログラムストリームを
作成するために符号化で使用される仮想的な復号器であ
るプログラムシステムターゲットデコーダ(以下、P−
STD)の前記ビデオESを保持するビデオメインバッ
ファ(以下、VMB)及び前記第1,第2のオーディオ
ESを保持する第1,第2のオーディオメインバッファ
(以下、AMB)の各々のメモリ占有量の状態を管理
し、前記VMB及び第1,第2のAMBの空になる順番
で前記ビデオES及び前記第1,第2のオーディオES
を多重化するよう多重化順位付け及び多重化判断を行い
多重化の制御を行うことを特徴とするものである。
According to a first aspect of the present invention, there is provided a program stream multiplexing method, wherein a digital video signal and a first digital audio signal and a second digital audio signal are input to a compression code according to a predetermined compression coding protocol. Video elementary stream (hereinafter referred to as video E
S) and first and second audio elementary streams (hereinafter, audio ES) are generated, and the video ES and the first and second audio ES are multiplexed to generate a program stream. In the method, a program system target decoder (hereinafter, P-), which is a virtual decoder used in encoding to create the program stream.
Memory occupancy of each of a video main buffer (hereinafter, VMB) holding the video ES of STD) and first and second audio main buffers (hereinafter, AMB) holding the first and second audio ESs Of the video ES and the first and second audio ESs in the order in which the VMB and the first and second AMBs become empty.
It is characterized in that the multiplexing is ranked and the multiplexing is judged so as to be multiplexed, and the multiplexing is controlled.

【0066】また、請求項2記載の発明は、請求項1記
載のプログラムストリーム多重化方法において、前記V
MB及び前記第1,第2のAMBのメモリ占有量の状態
を保持するVMBシミュレーション回路及び第1,第2
のAMBシミュレーション回路を有し、前記VMBシミ
ュレーション回路及び第1,第2のAMBシミュレーシ
ョン回路の各々の上記占有量保持内容から、前記P−S
TD内のメインバッファが空になる順番である空き順位
を把握し、前記空き順位を前記ビデオES及び第1及び
第2のオーディオESの多重化順位として多重化順位付
けを行い、その多重化順位で多重化が行えるかの第1の
多重化判断を行い、多重化できる場合多重化を行い、前
記ビデオES及び第1及び第2のオーディオESの全て
が多重化できないときは、前記多重化順位に従い多重化
できない要因である多重化不可能要因を確認し、前記多
重化不可能要因が、該当ESのメインバッファに空きが
ない無空バッファ状態による場合、第2の多重化判断と
して、前記VMBシミュレーション回路及び前記第1,
第2のAMBシミュレーション回路の各々に保持してい
る第1,第2のプレゼンテーションタイムスタンプ(以
下、PTS)又は復号タイムスタンプ(以下、DTS)
の最小値を呼び出し、その値をシステムクロックリファ
レンス(以下、SCR)に設定することにより、空きが
ない前記メインバッファに空きを作成して多重化を行う
ことにより、前記メインバッファのサイズに依存せず、
多重化を行うことを特徴とするものである。
The invention according to claim 2 is the program stream multiplexing method according to claim 1, wherein the V
A VMB simulation circuit that holds the states of the memory occupancy of the MB and the first and second AMBs, and the first and second
The AMB simulation circuit of the above, and from the contents of holding amount of each of the VMB simulation circuit and the first and second AMB simulation circuits, the PS
The empty order, which is the order in which the main buffer in the TD becomes empty, is grasped, and the empty order is used as the multiplexing order of the video ES and the first and second audio ESs, and the multiplexing order is performed. A first multiplexing determination is made as to whether or not multiplexing is possible, multiplexing is performed if multiplexing is possible, and if all of the video ES and the first and second audio ESs cannot be multiplexed, the multiplexing order is determined. According to the non-empty buffer state in which there is no space in the main buffer of the ES concerned, the VMB is determined as the second multiplexing decision, and the VMB is determined as the second multiplexing decision. Simulation circuit and the first,
First and second presentation time stamps (hereinafter, PTS) or decoding time stamps (hereinafter, DTS) held in each of the second AMB simulation circuits
Of the main buffer by creating the empty space in the main buffer that has no free space by setting the minimum value of the system clock reference (hereinafter referred to as SCR). No
It is characterized by performing multiplexing.

【0067】また、請求項3記載の発明は、請求項2記
載のプログラムストリーム多重化方法において、前記多
重化順位付けが、前記VMBシミュレーション回路及び
第1,第2のAMBシミュレーション回路の各々から呼
び出した前記DTS及び前記第1,第2のPTSの各々
の最大値を比較し、前記最大値が小さい方から大きい方
に優先的に多重化するよう順序付けし、前記第1の多重
化判断が、前記VMB及び前記第1,第2のAMBの各
々のシミュレーション用の前記SCRの調整を伴わない
多重化判断であり、前記第2の多重化判断が、前記SC
Rの調整を伴う多重化判断であることを特徴とするもの
である。
According to a third aspect of the present invention, in the program stream multiplexing method according to the second aspect, the multiplexing ranking is called from each of the VMB simulation circuit and the first and second AMB simulation circuits. The maximum values of the DTS and the first and second PTSs are compared with each other, and the maximum value is ordered from the smaller maximum value to the larger one, and the first multiplexing judgment is performed. A multiplexing decision without adjustment of the SCR for the simulation of each of the VMB and the first and second AMB, wherein the second multiplexing decision is the SC
It is characterized in that it is a multiplexing decision involving adjustment of R.

【0068】また、請求項4記載の発明は、請求項2記
載のプログラムストリーム多重化方法において、前記V
MBシミュレーション回路及び前記第1,第2のAMB
シミュレーション回路の各々が、前記P−STDのそれ
ぞれ対応する前記VMB又は前記第1又は第2のAMB
の(以下、MB)の空き容量を保持し、出力ビデオ又は
第1又は第2のオーディオESのデータ量(以下、出力
ES量)の供給に応答して、前記MBの空き容量から前
記出力ES量を減算し使用可能容量を求め、アクセスユ
ニットの数であるAU量及び前記DTS又は前記第1又
は第2のPTSの各々(以下、DTS/PTS)の供給
に応答してこれらAU量及びDTS/PTSを関連付け
て保持し、前記SCR生成回路が出力する第1のSCR
の値と前記DTS/PTSの値とを比較し、前記DTS
/PTS値の方が小さいとき、前記空き容量に前記DT
S/PTSに関連する前記AU量を加算し、前記DTS
/PTSの値の方が大きいとき、保持していた前記DT
S/PTS及び前記DTS/PTSに関連する前記AU
量を削除し、前記パック選択回路からの第2のSCRの
供給に応答して、前記第2のSCRの値と前記DTS/
PTSの値を比較し、前記DTS/PTSの値が前記第
2のSCR値と同一又は小さいとき、前記DTS/PT
Sに関連するAU量を前記パック選択回路に出力すると
ともに、前記MBの空き容量に前記DTS/PTSに関
連するAU量を加算し、前記加算結果の値である加算値
と前記MBの容量とを比較し、前記加算値の方が大きい
とき前記MBのアンダフローを出力し、最大値確認要求
の供給に応答して、前記DTS/PTSの最大値を出力
し、空き容量確認要求の供給に応答して前記MBの空き
容量を出力し、最小値確認要求の供給に応答して、前記
DTS/PTSの最小値を出力することを特徴とするも
のである。
The invention according to claim 4 is the program stream multiplexing method according to claim 2, wherein:
MB simulation circuit and the first and second AMBs
Each of the simulation circuits includes the VMB or the first or second AMB corresponding to the P-STD.
(Hereinafter, MB) free space is held, and in response to the supply of the data amount of the output video or the first or second audio ES (hereinafter, output ES amount), the output ES is changed from the free space of the MB to the output ES. Amount is subtracted to obtain usable capacity, and the AU amount and the DTS in response to the supply of the AU amount which is the number of access units and the DTS or the first or second PTS (hereinafter, DTS / PTS). The first SCR output from the SCR generation circuit, which holds / PTS in association with each other.
Value of the DTS / PTS is compared with the value of the DTS / PTS.
When the / PTS value is smaller, the DT is added to the free space.
Add the AU amount associated with S / PTS to obtain the DTS
When the value of / PTS is larger, the above DT held
S / PTS and the AU associated with the DTS / PTS
A quantity, and in response to supplying the second SCR from the pack selection circuit, the value of the second SCR and the DTS /
The PTS values are compared, and when the DTS / PTS value is equal to or smaller than the second SCR value, the DTS / PT
The AU amount related to S is output to the pack selection circuit, the AU amount related to the DTS / PTS is added to the free space of the MB, and the addition value as the value of the addition result and the capacity of the MB are added. When the added value is larger, the underflow of the MB is output, and in response to the supply of the maximum value confirmation request, the maximum value of the DTS / PTS is output to supply the free space confirmation request. In response, the free space of the MB is output, and in response to the supply of the minimum value confirmation request, the minimum value of the DTS / PTS is output.

【0069】また、請求項5記載の発明のプログラムス
トリーム多重化方法は、ディジタルビデオ信号及び第
1,第2のディジタルオーディオ信号の各々を入力し所
定の圧縮符号化プロトコルに従って圧縮符号化を行いビ
デオエレメンタリストリーム(以下、ビデオES)及び
第1及び第2のオーディオエレメンタリストリーム(以
下、オーディオES)の各々を生成し、これらビデオE
S及び第1及び第2のオーディオESを多重化してプロ
グラムストリームを生成するプログラムストリーム多重
化方法において、前記プログラムストリームを作成する
ために符号化で使用される仮想的な復号器であるプログ
ラムシステムターゲットデコーダ(以下、P−STD)
の前記ビデオESを保持するビデオメインバッファ(以
下、VMB)及び前記第1,第2のオーディオESを保
持する第1,第2のオーディオメインバッファ(以下、
AMB)の各々のメモリ占有量の状態を保持するVMB
シミュレーション回路及び第1,第2のAMBシミュレ
ーション回路の各々が保持している復号タイムスタンプ
(以下、DTS)又は第1,第2のプレゼンテーション
タイムスタンプ(以下、PTS)の各々の最大値を比較
し、前記最大値が1番小さいDTS又は第1,第2のP
TSに対応するビデオES又は第1又は第2のオーディ
オES(以下、ES)を多重化順位1とし、以下、前記
最大値が大きくなる順序で優先的に多重化する多重化順
位付けを行う多重化順位付けステップと、前記多重化順
位1であるES(以下、多重化順位1ES)の前記P−
STDのシミュレーション用のシステムクロックリファ
レンス(以下、SCR)の調整を伴わない多重化判断で
ある第1の多重化判断及び多重化処理と、前記多重化順
位が2のES(以下、多重化順位2ES)の前記第1の
多重化判断及び多重化処理と、前記多重化順位が3のE
S(以下、多重化順位2ES)の前記第1の多重化判断
及び多重化処理と、前記多重化順位1ESの前記SCR
の調整を伴う多重化判断である第2の多重化判断及び多
重化処理と、前記多重化順位2ESの前記第2の多重化
判断及び多重化処理と、前記多重化順位3ESの前記第
2の多重化判断及び多重化処理とを行うことを特徴とす
るものである。
According to a fifth aspect of the program stream multiplexing method of the present invention, each of the digital video signal and the first and second digital audio signals is input and compression encoded according to a predetermined compression encoding protocol. An elementary stream (hereinafter, referred to as a video ES) and first and second audio elementary streams (hereinafter, referred to as an audio ES) are generated, and these video E are generated.
In a program stream multiplexing method for multiplexing S and first and second audio ESs to generate a program stream, a program system target that is a virtual decoder used in encoding to create the program stream Decoder (hereinafter P-STD)
Of the video main buffer (hereinafter, VMB) for holding the video ES and first and second audio main buffers (hereinafter, for holding the first and second audio ES).
VMB that holds the state of each memory occupancy of AMB)
The maximum value of each of the decoding time stamp (hereinafter, DTS) or the first and second presentation time stamp (hereinafter, PTS) held by each of the simulation circuit and the first and second AMB simulation circuits is compared. , The DTS having the smallest maximum value or the first and second Ps
The video ES or the first or second audio ES (hereinafter, ES) corresponding to the TS is set as the multiplexing order 1, and the multiplexing is performed in the order of increasing the maximum value. And the P- of the ES that is the multiplexing rank 1 (hereinafter, the multiplexing rank 1 ES).
A first multiplexing determination and multiplexing process, which is a multiplexing determination without adjustment of a system clock reference (hereinafter, SCR) for STD simulation, and an ES having a multiplexing priority of 2 (hereinafter, a multiplexing priority of 2ES). ), The first multiplexing determination and multiplexing processing, and E with the multiplexing order of 3
S (hereinafter, multiplexing order 2ES), the first multiplexing determination and multiplexing process, and the SCR having the multiplexing order 1ES
Second multiplexing determination and multiplexing processing which is multiplexing determination with adjustment of the second multiplexing determination and multiplexing processing of the multiplexing order 2ES, and the second multiplexing determination and multiplexing processing of the multiplexing order 3ES. It is characterized by performing a multiplexing determination and a multiplexing process.

【0070】また、請求項6記載の発明は、請求項5記
載のプログラムストリーム多重化方法において、前記多
重化順位1ESの前記第1の多重化判断及び多重化処理
が、多重化するためのデータ量のES(以下、多重化対
象ES)が前記多重化順位1ESのバッファに存在する
かを判断するため、前記多重化順位1ESのバッファ占
有量を確認し、前記多重化対象ESが前記多重化順位1
ESのバッファに存在しない場合、この多重化順位1E
Sの第1の多重化判断を終了し、前記多重化順位2ES
の第1の多重化判断に進む多重化順位1ESの多重化判
断ステップと、前記多重化順位1ESの多重化判断ステ
ップで、前記多重化対象ESが前記多重化順位1ESの
バッファに存在する場合、前記多重化順位1ESの前記
メインバッファがそのESを入力してもオーバフローも
アンダフローも起こさず多重化が可能であることを判断
する多重化順位1ESの多重化可能性判断処理と、前記
多重化順位1ESの多重化可能性判断処理で、多重化が
可能である場合、前記多重化順位1ESの多重化を行う
多重化順位1ESの多重化処理とを有することを特徴と
するものである。
The invention according to claim 6 is the program stream multiplexing method according to claim 5, wherein the first multiplexing judgment and multiplexing processing of the multiplexing order 1ES is data for multiplexing. In order to determine whether a certain amount of ESs (hereinafter referred to as a multiplexing target ES) exists in the buffer of the multiplexing order 1ES, the buffer occupancy of the multiplexing order 1ES is confirmed, and the multiplexing target ESs perform the multiplexing. Rank 1
If it does not exist in the ES buffer, this multiplexing order 1E
The first multiplexing determination of S is completed, and the multiplexing order 2ES
When the multiplexing target ES exists in the buffer of the multiplexing order 1ES in the multiplexing determining step of the multiplexing order 1ES and the multiplexing determining step of the multiplexing order 1ES, Multiplexing possibility determination processing of multiplexing order 1ES, which determines whether the main buffer of the multiplexing order 1ES inputs the ES without causing overflow or underflow, and the multiplexing possibility When the multiplexing is possible in the multiplexing possibility determination processing of the rank 1ES, the multiplexing processing of the multiplexing rank 1ES for performing the multiplexing of the multiplexing rank 1ES is included.

【0071】また、請求項7記載の発明は、請求項6記
載のプログラムストリーム多重化方法において、前記多
重化順位1ESの多重化可能性判断処理が、前記多重化
順位1ESのMBシミュレーション回路の空き容量であ
る第1の空き容量を呼び出す第1の空き容量確認ステッ
プと、前記第1の空き容量から前記多重化順位1ESの
多重化対象ES量を減算し、第2の空き容量を算出する
第2の空き容量算出ステップと、多重化を行うときに付
加する前記SCRを前記多重化順位1ESの前記MBシ
ミュレーション回路に出力し、前記多重化順位1ESの
前記MBシミュレーション回路が、前記SCRで前記多
重化順位1ESの前記MBから削除されるアクセスユニ
ットの数であるAU量を呼び出す削除AU量呼出ステッ
プと、前記第2の空き容量に前記AU量を加算し、第3
の空き容量を算出する第3の空き容量算出ステップと、
前記第3の空き容量が、前記多重化順位1ESの前記メ
インバッファの容量内か判断し、前記メインバッファの
容量内である場合は前記多重化順位1ESの多重化処理
に進み、前記メインバッファの容量を超える場合は前記
多重化順位1ESの多重化判断1を終了し、前記多重化
順位2ESの前記第1の多重化判断に進む多重化順位1
ESのMB容量判断ステップとを有し、前記多重化順位
1ESの前記多重化処理が、前記多重化順位1ESのバ
ッファが出力ESデータ量(以下、ES量)の指示に応
答して指示された前記ES量を出力する出力ES量指示
ステップと、前記プログラムストリームPSに付加する
SCRを出力し、前記多重化対象ESが前記AUの先頭
を含む場合、前記多重化順位1ESがオーディオESの
場合は前記PTSと前記AU量を出力し、ビデオESの
場合は前記PTSと前記DTSと前記AU量とピクチャ
タイプを出力するSCRとESパラメータ出力ステップ
と、前記プログラムストリームに付加する前記SCRを
SCR生成回路に出力するシミュレーション用SCR生
成ステップと、前記多重化対象ESの前記ES量を前記
多重化順位1ESの前記MBシミュレーション回路に出
力し、前記多重化対象ESが前記AUの先頭を含む場
合、前記多重化順位1ESがオーディオESの場合は前
記PTSと前記AU量を出力し、ビデオESの場合は前
記DTSと前記AU量とを出力する多重化対象ES量・
パラメータ出力ステップと、前記SCRに予め定めたS
CR加算値を加算し保持するSCR加算値の加算ステッ
プとを有し、前記ESと前記SCRと前記PTSと前記
DTSと前記AU量と前記ピクチャタイプに基づき多重
化を行い、前記プログラムストリームを出力することを
特徴とするものである。
According to a seventh aspect of the present invention, in the program stream multiplexing method according to the sixth aspect, the multiplexing possibility judgment processing of the multiplexing order 1ES is such that the MB simulation circuit of the multiplexing order 1ES is free. A first free space confirmation step of calling a first free space, which is a free space, and a second free space calculated by subtracting the multiplexing target ES amount of the multiplexing order 1ES from the first free space. The free space calculation step of 2 and the SCR added when performing the multiplexing are output to the MB simulation circuit having the multiplexing order of 1ES, and the MB simulation circuit having the multiplexing order of 1ES performs the multiplexing at the SCR. A deletion AU amount calling step for calling an AU amount, which is the number of access units deleted from the MB having a conversion order of 1 ES; The AU amount is added to the can volume, third
A third free space calculation step of calculating the free space of
It is determined whether the third free space is within the capacity of the main buffer with the multiplexing order of 1ES. If it is within the capacity of the main buffer, the process proceeds to the multiplexing process with the multiplexing order of 1ES, If the capacity is exceeded, the multiplexing order 1 of the multiplexing order 1ES is terminated, and the process proceeds to the first multiplexing judgment of the multiplexing order 2ES.
And a step of determining the MB capacity of the ES, wherein the multiplexing process of the multiplexing order 1ES is instructed by the buffer of the multiplexing order 1ES in response to the instruction of the output ES data amount (hereinafter, ES amount). If the output ES amount instruction step of outputting the ES amount and the SCR to be added to the program stream PS are output, and the ES to be multiplexed includes the head of the AU, and if the multiplexing order 1ES is an audio ES, SCR and ES parameter output step of outputting the PTS and the AU amount, and outputting the PTS, the DTS, the AU amount and the picture type in the case of a video ES, and an SCR generating circuit for adding the SCR to the program stream. To the simulation SCR generation step, and the ES amount of the ES to be multiplexed is set to the multiplexing order 1ES. When the multiplexing target ES includes the head of the AU, the PTS and the AU amount are output when the multiplexing target ES includes the head of the AU, and the DTS is output when the multiplexing ES is the video ES. And the ES amount for multiplexing to output the AU amount and
Parameter output step and S preset in the SCR
SCR addition value addition step of adding and holding CR addition value, and performing multiplexing based on the ES, the SCR, the PTS, the DTS, the AU amount, and the picture type, and outputting the program stream. It is characterized by doing.

【0072】請求項8記載の発明のプログラムストリー
ム多重化装置は、ディジタルビデオ信号を入力し所定の
圧縮符号化プロトコルに従って圧縮符号化を行いビデオ
エレメンタリストリーム(以下、ビデオES)を出力す
るビデオエンコーダと、前記ビデオESを保持するビデ
オバッファと、第1及び第2のディジタルオーディオ信
号の各々を入力しそれぞれ前記圧縮符号化プロトコルに
従って圧縮符号化を行い第1及び第2のオーディオエレ
メンタリストリーム(以下、オーディオES)の各々を
出力する第1及び第2のオーディオエンコーダと、前記
第1及び第2のオーディオESの各々を保持する第1及
び第2のオーディオバッファと、前記ビデオバッファ及
び第1,第2のオーディオバッファの各々に保持してい
る前記ビデオES及び第1,第2のオーディオESを多
重化してプログラムストリームとして出力する多重器と
を備えるプログラムストリーム多重化装置において、前
記多重器が、前記ビデオバッファ内の前記ビデオESの
占有量を確認し保持するVB占有量確認回路と、前記プ
ログラムストリームを作成するために符号化で使用され
る仮想的な復号器であるプログラムシステムターゲット
デコーダ(以下、P−STD)のビデオメインバッファ
(以下、VMB)のシミュレーションを行うVMBシミ
ュレーション回路と、前記第1,第2のオーディオバッ
ファの各々内の前記第1,第2のオーディオESの各々
の占有量をそれぞれ確認保持する第1,第2のAB占有
量確認回路と、前記P−STDの前記第1,第2のオー
ディオメインバッファ(以下、AMB)の各々のシミュ
レーションを行う第1,第2のAMBシミュレーション
回路と、前記ビデオES及び第1,第2のオーディオE
Sに対し前記P−STDの前記VMB及び前記第1,第
2のAMBの各々のメモリ占有量の状態を管理し、前記
VMB及び第1,第2のAMBの空になる順番で前記ビ
デオES及び第1,第2のオーディオESを多重化する
よう多重化順位付け及び多重化判断を行い多重化の制御
を行うパック選択回路と、前記パック選択回路からのデ
ータに基づき前記P−STDの前記VMB及び第1,第
2のAMBのシミュレーション用のシステムクロックリ
ファレンス(以下、SCR)を生成するSCR生成回路
と、前記パック選択回路の制御により多重化を行う多重
化回路とを備えて構成されている。
A program stream multiplexer according to an eighth aspect of the present invention is a video encoder for inputting a digital video signal, performing compression encoding according to a predetermined compression encoding protocol, and outputting a video elementary stream (hereinafter referred to as video ES). And a video buffer holding the video ES, and first and second digital audio signals, respectively, are input and compression-encoded according to the compression-encoding protocol, and first and second audio elementary streams (hereinafter , Audio ES) for outputting respective first and second audio encoders, first and second audio buffers for holding each of the first and second audio ES, the video buffer and the first, second The video ES held in each of the second audio buffers And a multiplexer for multiplexing the first and second audio ESs and outputting as a program stream, the multiplexer confirms and holds the occupation amount of the video ES in the video buffer. VB occupancy confirmation circuit and a video main buffer (hereinafter, VMB) of a program system target decoder (hereinafter, P-STD), which is a virtual decoder used in encoding to create the program stream. A VMB simulation circuit for performing simulation, and first and second AB occupation amount confirmation for confirming and retaining the respective occupation amounts of the first and second audio ES in the first and second audio buffers, respectively. Circuit and the first and second audio main buffers of the P-STD (hereinafter referred to as AM The simulate each) 1, and a second AMB simulation circuit, the video ES and the first and second audio E
The state of the memory occupancy of each of the VMB of the P-STD and the first and second AMBs is managed with respect to S, and the video ES is arranged in the empty order of the VMB and the first and second AMBs. And a pack selection circuit for performing multiplexing ordering and multiplexing judgment so as to multiplex the first and second audio ESs and controlling multiplexing, and the P-STD based on the data from the pack selection circuit. An SCR generation circuit that generates a system clock reference (hereinafter, SCR) for simulating the VMB and the first and second AMBs, and a multiplexing circuit that performs multiplexing under the control of the pack selection circuit are configured. There is.

【0073】また、請求項9記載の発明は、請求項8記
載のプログラムストリーム多重化方法において、前記多
重器が、前記パック選択回路と前記SCR生成回路と前
記VMBシミュレーション回路と前記VB占有量確認回
路と前記第1,第2のAB占有量確認回路の各々の機能
をソフトウェアにより置換したマイクロコントローラを
備えて構成されている。
The invention according to claim 9 is the program stream multiplexing method according to claim 8, wherein the multiplexer selects the pack selection circuit, the SCR generation circuit, the VMB simulation circuit, and the VB occupation amount confirmation. The circuit and the functions of the first and second AB occupation amount confirmation circuits are replaced by a software-configured microcontroller.

【0074】また、請求項10記載の発明は、請求項8
記載のプログラムストリーム多重化方法において、前記
P−STDが、入力した前記プログラムストリームを前
記ビデオESと前記第1,第2のオーディオESと前記
SCRと、プレゼンテーションタイムスタンプ(以下、
PTS)及び復号タイムスタンプ(以下、DTS)に分
解するデマルチプレクス部と、前記SCRの供給を受け
システムタイムクロック(STC)を生成するシステム
クロック生成部と、前記ビデオESを保持する前記VM
Bと、前記第1,第2のオーディオESの各々を保持す
る前記AMBと、前記ビデオESを復号してビデオ信号
Vを出力するビデオデコーダと、前記第1,第2のオー
ディオESの各々を復号して第1,第2のオーディオ信
号の各々を出力する第1,第2のオーディオデコーダ
と、前記STCと前記PTS又は前記DTSとの比較を
行い比較結果に応じて前記VMB又は前記第1又は第2
のAMBに対し前記PTS又はDTSに対応するESを
前記ビデオデコーダ又は第1又は第2のオーディオデコ
ーダに出力するよう指示するとともに後述の第1,第2
のセレクタの制御信号を出力するタイムスタンプ比較部
と、前記ビデオ信号のピクチャの配列順を変更するため
再配列を行う再配列バッファと、前記制御信号の供給に
応答して前記ビデオ信号を前記再配列バッファに供給す
るよう切り替える第1,第2のセレクタとを備えて構成
されている。
The invention according to claim 10 is the same as that of claim 8
In the program stream multiplexing method described above, the P-STD converts the input program stream into the video ES, the first and second audio ESs, the SCR, and a presentation time stamp (hereinafter, referred to as a presentation time stamp).
PTS) and a decoding time stamp (hereinafter referred to as DTS), a demultiplexing unit, a system clock generation unit that receives the SCR and generates a system time clock (STC), and the VM that holds the video ES.
B, the AMB that holds each of the first and second audio ES, the video decoder that decodes the video ES and outputs the video signal V, and each of the first and second audio ES. The STC and the PTS or the DTS are compared with the first and second audio decoders that decode and output the first and the second audio signals, respectively, and the VMB or the first audio decoder is selected according to the comparison result. Or second
The AMB of the PTS or DTS to output the ES corresponding to the PTS or DTS to the video decoder or the first or second audio decoder.
, A time stamp comparison unit for outputting a control signal of the selector, a rearrangement buffer for rearranging the video signal in order to change the arrangement order of the pictures of the video signal, and the video signal for re-arranging in response to the supply of the control signal. It is configured to include first and second selectors for switching to supply to the array buffer.

【0075】[0075]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Next, embodiments of the present invention will be described in detail with reference to the drawings.

【0076】本実施の形態のプログラムストリーム多重
化方法及び装置は、動画像及び音声を含む情報の圧縮符
号化技術としてISOとCCITTの専門家グループI
SO/IEC,JTC1/SC2/WG8(Movin
g Picture Expert Group)が勧
告したISO/IEC−11172−3に規定するMP
EG1規格又はISO/IEC−13818で規定する
MPEG2(以下、MPEG規格)のプログラムストリ
ーム(以下、PS)の多重化を対象とする。
The program stream multiplexing method and apparatus according to the present embodiment is an expert group I of ISO and CCITT as a compression encoding technology for information including moving images and audio.
SO / IEC, JTC1 / SC2 / WG8 (Movin
MP specified in ISO / IEC-11172-3 recommended by g Picture Expert Group)
The target is multiplexing of a program stream (hereinafter, PS) of MPEG2 (hereinafter, MPEG standard) defined by EG1 standard or ISO / IEC-13818.

【0077】PSの多重化において、1つのビデオエレ
メンタリストリーム(以下、ES)と2つのオーディオ
ESを多重化するとき、PS作成のために符号化で使用
される仮想的な復号器であるプログラムシステムターゲ
ットデコーダ(以下、P−STD)内のメインバッファ
のメモリ占有量の状態をP−STDビデオメインバッフ
ァ(以下、VMB)シミュレーション回路及び第1,第
2のP−STDオーディオメインバッファ(以下、AM
B)シミュレーション回路で保持し、パック選択回路
は、VMBシミュレーション回路、第1,第2のAMB
シミュレーション回路の各々の上記占有量保持内容か
ら、上記P−STD内のメインバッファが空になる順番
である空き順位を把握し、その空き順位を各ESの多重
化順位とし、その多重化順位で多重化が行えるかの判断
を行い、多重化できる場合多重化を行う。全てのESが
多重化できないときは、上記パック選択回路は、上記多
重化順位に従い多重化できない要因である多重化不可能
要因を確認し、多重化不可能要因が、該当ESのメイン
バッファに空きがない無空バッファ状態による場合、上
記VMBシミュレーション回路及び上記第1,第2のA
MBシミュレーション回路に保持しているプレゼンテー
ションタイムスタンプ(以下、PTS)または復号タイ
ムスタンプ(以下、DTS)の最小値を呼び出し、その
値をシステムクロックリファレンス(以下、SCR)に
設定することにより、空きがない上記メインバッファに
空きを作成して多重化を行うことにより、P−STD内
に存在するメインバッファサイズに依存せず、多重化す
ることを特徴とするものである。
When multiplexing one video elementary stream (hereinafter, ES) and two audio ESs in PS multiplexing, a program which is a virtual decoder used in encoding for PS creation. The state of the memory occupancy of the main buffer in the system target decoder (hereinafter, P-STD) is shown by a P-STD video main buffer (hereinafter, VMB) simulation circuit and the first and second P-STD audio main buffers (hereinafter, AM
B) Hold in the simulation circuit, and the pack selection circuit is the VMB simulation circuit, the first and second AMB.
From the contents of holding the occupancy of each of the simulation circuits, the vacant rank which is the order in which the main buffer in the P-STD becomes empty is grasped, and the vacant rank is set as the multiplexing rank of each ES, It is determined whether or not multiplexing is possible, and if multiplexing is possible, multiplexing is performed. When all ESs cannot be multiplexed, the pack selection circuit confirms a non-multiplexable factor that is a factor that cannot be multiplexed according to the multiplexing order, and the non-multiplexable factor is available in the main buffer of the corresponding ES. When there is no empty buffer state, the VMB simulation circuit and the first and second A
By calling the minimum value of the presentation time stamp (hereinafter referred to as PTS) or the decoding time stamp (hereinafter referred to as DTS) held in the MB simulation circuit and setting the value as the system clock reference (hereinafter referred to as SCR) It is characterized in that a vacant space is created in the main buffer that does not exist and multiplexing is performed, so that multiplexing is performed without depending on the size of the main buffer existing in the P-STD.

【0078】次に、本発明の第1の実施の形態のプログ
ラムストリーム多重化装置をブロックで示す図1を参照
すると、この図に示す本実施の形態のプログラムストリ
ーム多重化装置は、ディジタルビデオ信号VDを入力し
てMPEG規格で規定する圧縮符号化プロトコルに従っ
て圧縮符号化を行いビデオエレメンタリストリーム(E
S)VSを出力するビデオエンコーダ1と、ビデオES
VSを一時保持するビデオバッファ4と、第1及び第2
のディジタルオーディオ信号AD1,AD2の各々を入
力しそれぞれMPEG規格の圧縮符号化プロトコルに従
って圧縮符号化を行いオーディオESAS1,AS2の
各々を出力するオーディオエンコーダ2,3と、オーデ
ィオESAS1,AS2の各々を一時保持するオーディ
オバッファ5,6と、ビデオバッファ4及びオーディオ
バッファ(AB)5,6の各々に保持しているビデオE
SVS及びオーディオESASを多重化してプログラム
ストリームPSとして出力する多重器7とを備える。
Next, referring to FIG. 1 which is a block diagram showing a program stream multiplexer according to a first embodiment of the present invention, the program stream multiplexer according to the present embodiment shown in this figure is a digital video signal. VD is input and compression-encoded according to the compression-encoding protocol defined by the MPEG standard, and the video elementary stream (E
S) Video encoder 1 that outputs VS and video ES
Video buffer 4 for temporarily holding VS, and first and second
Each of the audio encoders 2 and 3 for inputting each of the digital audio signals AD1 and AD2 of FIG. Audio buffers 5 and 6 held, and video E held in each of the video buffer 4 and audio buffers (AB) 5 and 6.
And a multiplexer 7 that multiplexes SVS and audio ESAS and outputs as a program stream PS.

【0079】多重器7は、ビデオバッファ(VB)4内
のビデオESの占有量を確認し保持するVB占有量確認
回路73と、後述するようにプログラムシステムターゲ
ットデコーダ(以下、P−STD)のビデオメインバッ
ファ(VMB)204のシミュレーションを行うVMB
シミュレーション回路74と、オーディオバッファ5,
6の各々内のオーディオESAS1,AS2の各々の占
有量をそれぞれ確認保持するAB占有量確認回路75,
77と、後述するようにP−STDの第1,第2のオー
ディオメインバッファ(AMB)207,209の各々
のシミュレーションを行うAMBシミュレーション回路
76,78と、後述のパック選択回路71からのデータ
に基づきP−STDメインバッファシミュレーション用
のシステムクロックリファレンス(以下、SCR)を生
成するSCR生成回路79と、多重化対象のビデオES
VS及びオーディオESAS1,AS2からのパケット
から成るパック(ストリームの基本単位)を生成するた
めビデオESVS及びオーディオESAS1,AS2に
対しP−STDのVMB204及びAMB207,20
9の各々のメモリ占有量の状態を管理し、VMB204
及びAMB207,209の空になる順番で多重化順位
付け及び多重化判断を行い多重化の選択制御を行うパッ
ク選択回路71と、パック選択回路71により制御され
選択したパックの多重化を行う多重化回路72とを備え
る。
The multiplexer 7 includes a VB occupation amount confirmation circuit 73 for confirming and retaining the occupation amount of the video ES in the video buffer (VB) 4, and a program system target decoder (hereinafter, P-STD) as described later. VMB for simulating video main buffer (VMB) 204
The simulation circuit 74, the audio buffer 5,
AB occupancy confirmation circuit 75 for confirming and retaining the occupancy of each of audio ESAS1 and AS2 in each of 6
77, AMB simulation circuits 76 and 78 for simulating each of the first and second audio main buffers (AMBs) 207 and 209 of the P-STD as described later, and data from the pack selection circuit 71 described later. An SCR generation circuit 79 for generating a system clock reference (hereinafter, SCR) for P-STD main buffer simulation based on the video ES to be multiplexed.
P-STD VMB 204 and AMB 207, 20 for video ESVS and audio ESAS1, AS2 to generate a pack (basic unit of stream) consisting of packets from VS and audio ESAS1, AS2
9 manages the state of each memory occupancy of each
And a pack selection circuit 71 for performing multiplexing ordering and determination of multiplexing in an empty order of the AMBs 207 and 209 to control selection of multiplexing, and multiplexing for multiplexing selected packs controlled by the pack selection circuit 71. And a circuit 72.

【0080】本実施の形態のPS多重化装置が出力した
PSに対する仮想的な復号器であるP−STDの構成を
ブロックで示す図19を参照すると、この図に示す本実
施の形態のP−STDは、入力したPSをビデオESV
S,オーディオESAS1,AS2,SCR,PTS及
びDTSに分解するデマルチプレクス部201と、SC
Rの供給を受けシステムタイムクロック(STC)を生
成するシステムクロック生成部202と、ビデオESを
保持するVMB204と、オーディオESAS1,AS
2の各々をそれぞれ保持するオーディオメインバッファ
(AMB)207,209と、STCとPTS又はDT
Sとの比較を行い比較結果に応じてVMB204又はA
MB207/209に対しPTS又はDTSに対応する
ESをビデオデコーダ205又はオーディオデコーダ2
08/210に出力するよう指示するとともに後述のセ
レクタ206,212の制御信号を出力するタイムスタ
ンプ比較部203と、入力したビデオESを復号してビ
デオ信号Vを出力するビデオデコーダ205と、入力し
たオーディオESA1、A2の各々を復号してオーディ
オ信号A1,A2の各々を出力するオーディオデコーダ
208,210と、タイムスタンプ比較部203からの
制御信号の供給に応答してビデオ信号Vを再配列バッフ
ァ211に供給するよう切り替えるセレクタ206,2
12と、ビデオ信号のピクチャの配列順を変更するため
再配列を行う再配列バッファ211とを備える。
Referring to FIG. 19 showing in block form the configuration of the P-STD which is a virtual decoder for the PS output by the PS multiplexer of this embodiment, the P-STD of this embodiment shown in this figure is referred to. STD, input PS to video ESV
S, audio ESAS1, AS2, SCR, PTS, and demultiplexing unit 201 for decomposing into DTS, and SC
A system clock generation unit 202 that receives a supply of R to generate a system time clock (STC), a VMB 204 that holds a video ES, and audio ESAS1 and AS
Audio main buffers (AMBs) 207 and 209 for holding each of the two, STC and PTS or DT
SMB is compared with VMB204 or A according to the comparison result.
An ES corresponding to PTS or DTS for the MB207 / 209 is provided as a video decoder 205 or an audio decoder 2.
08/210 is instructed to output, and a time stamp comparison unit 203 which outputs control signals of selectors 206 and 212 described later, and a video decoder 205 which decodes the input video ES and outputs a video signal V are input. The audio decoders 208 and 210 for decoding the audio ESA1 and A2 and outputting the audio signals A1 and A2 respectively, and the rearrangement buffer 211 for the video signal V in response to the supply of the control signal from the time stamp comparing unit 203. Selectors 206 and 2 for switching to supply to
12 and a rearrangement buffer 211 that rearranges to change the arrangement order of the pictures of the video signal.

【0081】次に、図1及び図2を参照して本実施の形
態の動作の概要について説明する。
Next, an outline of the operation of this embodiment will be described with reference to FIGS.

【0082】まず、各部の動作説明の前に、MPEG規
格による一般的なPSの生成について説明する。エンコ
ーダは、符号化対象のビデオ及びオーディオ各デジタル
データをMPEG規格に従い符号化する。符号化したデ
ータをESと表現する。次に、ESを、アクセスユニッ
ト(AU)毎、又は任意のサイズ毎にパケット化し、パ
ケタイズドエレメンタリストリーム(PES)パケット
に変換する。オーディオの場合は、1つ又はいくつかの
オーディオフレーム、ビデオの場合は1つの画像に対す
る全ての符号化データをAUと表現する。
First, before describing the operation of each unit, general PS generation according to the MPEG standard will be described. The encoder encodes video and audio digital data to be encoded according to the MPEG standard. The encoded data is expressed as ES. Next, the ES is packetized for each access unit (AU) or for each arbitrary size, and converted into a packetized elementary stream (PES) packet. In the case of audio, one or several audio frames, and in the case of video, all encoded data for one image is expressed as AU.

【0083】PESパケットにはPESヘッダがあり、
そのPESパケットにAUの先頭が存在する場合、AU
の復号時刻として復号タイムスタンプ(DTS)又は、
再生時刻としてプレゼンテーションタイムスタンプ(P
TS)を付加する。PESパケットにパックヘッダを加
えてストリームの基本単位であるパックを構成(パック
化)することによりPS(プログラムストリーム)を作
成する。パックヘッダには復号器のシステムクロックを
校正するためのシステムクロックリファレンス(SC
R)を付加する。ここで、ビデオES及びオーディオE
SをPSに変換することを多重化と表現する。従って、
パックは、パックヘッダと1つ又は2つ以上のESから
のパケットを含む。
The PES packet has a PES header,
If the PES packet has an AU head, the AU
Decoding time stamp (DTS) as the decoding time of
The presentation time stamp (P
TS) is added. A PS (program stream) is created by adding a pack header to a PES packet to form (pack) a basic unit of a stream. The pack header has a system clock reference (SC) for calibrating the system clock of the decoder.
R) is added. Here, video ES and audio E
Converting S to PS is referred to as multiplexing. Therefore,
A pack contains a pack header and packets from one or more ESs.

【0084】多重器は、デコーダでオーディオES及び
ビデオESを含むPSを再生するとき、音と映像が同期
できるようにPSの中にSCRとPTS及びDTSを付
加する。また、多重器は、P−STDという仮想的なプ
ログラムシステムターゲットデコーダを定義し、PSが
P−STD内の全てのメインバッファ(MB)でアンダ
フローやオーバフローを引き起こさず、同期再生するこ
とを保証しなければならない。
The multiplexer adds SCR, PTS and DTS to PS so that the sound and the video can be synchronized when the PS including the audio ES and the video ES is reproduced by the decoder. In addition, the multiplexer defines a virtual program system target decoder called P-STD, and guarantees that PS does not cause underflow or overflow in all main buffers (MB) in P-STD and synchronously reproduces. Must.

【0085】なお、P−STDの各MBサイズについて
は、MPEG1規格においてP−STDオーディオメイ
ンバッファ(以下、AMD)サイズが4096バイト、
P−STDビデオメインバッファ(以下、VMB)サイ
ズが47104バイトとそれぞれ規定されており、ま
た、MPEG2規格において、VMBサイズが2293
76バイトと規定されている。
Regarding each MB size of P-STD, the P-STD audio main buffer (hereinafter, AMD) size is 4096 bytes in the MPEG1 standard.
The P-STD video main buffer (hereinafter referred to as VMB) size is defined as 47104 bytes, and the VMB size is 2293 in the MPEG2 standard.
It is defined as 76 bytes.

【0086】次に、図2を参照して、本実施の形態のP
−STDの動作について説明すると、デマルチプレクス
部201は、入力したPSをビデオESVSと、オーデ
ィオESAS1,AS2と、SCRと、PTSと、DT
Sとに分解し、ビデオESVSをVMB204に、オー
ディオESAS1,AS2の各々をAMB207,20
9の各々に、SCRはシステムクロック生成部202
に、PTS及びDTSをタイムスタンプ比較部203に
それぞれ供給する。システムクロック生成部202は、
供給を受けたSCRに基づきSTCを生成し、各部に供
給する。
Next, referring to FIG. 2, P of the present embodiment will be described.
To describe the operation of the STD, the demultiplexing unit 201 uses the input PS as the video ESVS, the audio ESAS1 and AS2, the SCR, the PTS, and the DT.
Decompose into S and video ESVS into VMB204 and audio ESAS1 and AS2 respectively into AMB207 and 20.
9 for each SCR is a system clock generation unit 202.
Then, the PTS and DTS are respectively supplied to the time stamp comparison unit 203. The system clock generator 202
An STC is generated based on the supplied SCR and is supplied to each unit.

【0087】タイムスタンプ比較部203は、供給を受
けたSTCとPTS又はDTS(以下、「又は」を/、
例えばPTS/DTS等と表記)の比較を行い、PTS
/DTSがSTCと一致又はSTCの方が大きいときV
MB204/AMB207/AMB209に対して、P
TS/DTSに対応するESをビデオデコーダ205/
オーディオデコーダ208/210に出力するよう指示
する。ビデオデコーダ205は、入力したビデオESを
復号してビデオ信号を出力する。オーディオデコーダ2
08,210の各々は、入力したオーディオESAS
1,AS2の各々を復号してオーディオ信号A1,A2
の各々を出力する。
The time stamp comparing section 203 receives the supplied STC and PTS or DTS (hereinafter “or” /,
(For example, PTS / DTS etc.)
V when DTS matches STC or STC is larger
P for MB204 / AMB207 / AMB209
ES corresponding to TS / DTS is converted to video decoder 205 /
Instruct the audio decoder 208/210 to output. The video decoder 205 decodes the input video ES and outputs a video signal. Audio decoder 2
08 and 210 are input audio ESAS
1 and AS2 respectively to decode audio signals A1 and A2
Output each of.

【0088】ここで、ビデオESがBピクチャを含む場
合、P−STDはビデオ信号Vを出力する順番を変更す
る必要がある。すなわち、PSではBピクチャを含むビ
デオESは、IピクチャとPピクチャ(以下、I,Pピ
クチャ)がBピクチャより先に符号化されているため、
復号もI,Pピクチャを先に行うことになる。ただし再
生はBピクチャより後になるためI,Pピクチャに対す
るPTSとDTSは一致しない。従って、I,Pピクチ
ャの場合、タイムスタンプ比較部203は、DTSとS
TCが一致又はSTCの方が大きくなった時点でVMB
204からビデオデコーダ205にビデオESを出力す
るように指示する。一方、タイムスタンプ比較部203
は、復号したI,Pピクチャを再配列バッファ211に
一旦格納するようセレクタ206に指示し、PTSとS
TCが一致した時点で再配列バッファ211に保持した
I,Pピクチャを出力するようセレクタ212に指示す
ることにより、I,Pピクチャを一旦待機させて出力す
る。Bピクチャの場合はSTCとの比較を全てPTSで
行い、再配列バッファ211には保持しないで、直接ビ
デオ信号Vとして出力する。このようにして、ビデオ信
号の出力順序をB,I,Pの各ピクチャが所定の順序で
出力されるよう変更している。
Here, when the video ES includes B pictures, the P-STD needs to change the order of outputting the video signals V. That is, in the video ES including the B picture in the PS, the I picture and the P picture (hereinafter, I and P pictures) are coded before the B picture.
Decoding is also performed first for I and P pictures. However, since the reproduction is performed after the B picture, the PTS and DTS for the I and P pictures do not match. Therefore, in the case of I and P pictures, the time stamp comparison unit 203 determines that the DTS and S
VMC when TC match or STC becomes larger
From 204, the video decoder 205 is instructed to output the video ES. On the other hand, the time stamp comparison unit 203
Instructs the selector 206 to temporarily store the decoded I and P pictures in the rearrangement buffer 211, and the PTS and STS
When the TCs match, the selector 212 is instructed to output the I and P pictures held in the rearrangement buffer 211, so that the I and P pictures are once put on standby and output. In the case of a B picture, all comparison with STC is performed by PTS, and it is not held in the rearrangement buffer 211 and is directly output as the video signal V. In this way, the output order of the video signals is changed so that the B, I, and P pictures are output in a predetermined order.

【0089】本実施の形態の多重器は、上述のP−ST
Dの動作を仮想的に実現し、P−STD内の全てのメイ
ンバッファでアンダフローやオーバフローを引き起こさ
ないよう、多重化を行っている。
The multiplexer of the present embodiment has the above-mentioned P-ST.
The operation of D is virtually realized, and multiplexing is performed so as not to cause underflow or overflow in all main buffers in the P-STD.

【0090】SCRには、多重化を行う毎に一定の値が
加算される。この加算値は次式で表される。
A constant value is added to the SCR every time multiplexing is performed. This added value is expressed by the following equation.

【0091】SCRの加算値(理論値)=パック長/シ
ステムビットレート・・・・(1)ここで、システムビ
ットレートは、ビデオES及びオーディオESの各々の
生成量に基づき決定する。
Added value of SCR (theoretical value) = pack length / system bit rate (1) Here, the system bit rate is determined based on the generation amount of each of the video ES and the audio ES.

【0092】オーディオESの生成量は、オーディオビ
ットレートで決定されその値は一定である。ビデオES
の生成量はビデオビットレートで決定されるが、可変ビ
ットレートの場合この値が一定にならずビデオESの生
成量が変動し、VMBのアンダフロー及びオーバフロー
を引き起こす可能性があるため、次の方法を用いてこれ
を防止する。
The amount of audio ES generated is determined by the audio bit rate, and its value is constant. Video ES
The generation amount of is determined by the video bit rate. However, in the case of a variable bit rate, this value is not constant and the generation amount of the video ES may fluctuate, which may cause VMB underflow and overflow. A method is used to prevent this.

【0093】VMBのアンダフローに関しては、予めビ
デオエンコーダに指示しているビデオビットレートより
高めにした値でシステムビットレートを計算し、SCR
の加算値を上記理論値より小さくすることによりVMB
のアンダフローを防止する。VMBのオーバフローに関
しては、VMBがフル状態になったときは、SCRの値
を進めてVMBからESを出力させ、VMBのオーバフ
ローを防止する。
Regarding the VMB underflow, the system bit rate is calculated with a value higher than the video bit rate instructed to the video encoder in advance, and the SCR is calculated.
VMB by setting the addition value of
Prevent underflow of. Regarding VMB overflow, when the VMB becomes full, the value of SCR is advanced to output ES from VMB to prevent VMB overflow.

【0094】次に、図1及び2を参照して本実施の形態
の各部の動作について説明すると、まず、ビデオエンコ
ーダ1は、ディジタルビデオ信号VDを入力してMPE
G規格で規定する圧縮符号化プロトコルに従って圧縮符
号化を行いビデオエレメンタリストリーム(ES)VS
を出力し、ビデオバッファ4に供給する。ビデオバッフ
ァ4は、入力したビデオESを保持し、パック選択回路
71に指示されたデータ量のビデオESを出力し、多重
化回路72に供給する。オーディオエンコーダ2,3
は、ディジタルオーディオ信号AD1,AD2の各々を
入力しそれぞれMPEG規格の圧縮符号化プロトコルに
従って圧縮符号化を行いオーディオESAS1,AS2
の各々を出力し、オーディオバッファ5,6の各々に供
給する。オーディオバッファ5,6の各々は、入力した
オーディオESAS1,AS2の各々を保持し、多重化
器7のパック選択回路71に指示されたデータ量のオー
ディオESAS1,AS2の各々を出力し、多重化回路
72に供給する。
Next, the operation of each part of this embodiment will be described with reference to FIGS. 1 and 2. First, the video encoder 1 inputs the digital video signal VD and receives MPE.
Video elementary stream (ES) VS is subjected to compression encoding according to the compression encoding protocol defined by the G standard.
Is output and supplied to the video buffer 4. The video buffer 4 holds the input video ES, outputs the video ES of the data amount instructed to the pack selection circuit 71, and supplies the video ES to the multiplexing circuit 72. Audio encoders 2 and 3
Inputs the digital audio signals AD1 and AD2, respectively, and performs compression encoding according to the compression encoding protocol of the MPEG standard, and audio ESAS1 and AS2.
Are output and supplied to the audio buffers 5 and 6, respectively. Each of the audio buffers 5 and 6 holds each of the input audio ESAS1 and AS2, outputs each of the audio ESAS1 and AS2 of the data amount instructed to the pack selection circuit 71 of the multiplexer 7, and outputs the multiplexed circuit. Supply to 72.

【0095】多重化回路72は、詳細は後述するが、入
力されたビデオESVS、オーディオESAS1,AS
2、SCR、PTS、DTS、各ESのAU量、ピクチ
ャタイプに基づき多重化を行い、PSを出力する。
The multiplexing circuit 72, the details of which will be described later, receives the input video ESVS, audio ESAS1, AS.
2, SCR, PTS, DTS, AU amount of each ES, multiplexing is performed based on the picture type, and PS is output.

【0096】多重化器7のVB占有量確認回路73は、
ビデオバッファ4が保持しているビデオESVSのデー
タ量であるVB占有量を確認し保持する。パック選択回
路71から容量確認要求QCVをビデオバッファ4を通
じて供給を受けると、この容量確認要求QCVの供給に
応じて保持しているVB占有量をパック選択回路71に
出力する。また、AB占有量確認回路75,77の各々
は、オーディオバッファ5,6の各々が保持しているオ
ーディオESAS1,AS2の各々のデータ量であるA
S1占有量、AS2占有量の各々を確認し保持する。パ
ック選択回路71から容量確認要求QCAS1,QCA
S2の各々をオーディオバッファ5,6の各々を通じて
供給を受けると、この容量確認要求QCAS1,QCA
S2の各々の供給に応じて保持しているAS1占有量,
AS2占有量の各々をパック選択回路71に出力する。
The VB occupation amount confirmation circuit 73 of the multiplexer 7 is
The VB occupation amount, which is the data amount of the video ESVS held in the video buffer 4, is confirmed and held. When the capacity confirmation request QCV is supplied from the pack selection circuit 71 through the video buffer 4, the VB occupying amount held according to the supply of the capacity confirmation request QCV is output to the pack selection circuit 71. Further, each of the AB occupation amount confirmation circuits 75 and 77 is the data amount of each of the audio ESAS1 and AS2 held by each of the audio buffers 5 and A.
Each of the S1 occupancy and AS2 occupancy is confirmed and held. Capacity confirmation request from the pack selection circuit 71 QCAS1, QCA
When each of S2 is supplied through each of the audio buffers 5 and 6, the capacity confirmation requests QCAS1 and QCA are received.
AS1 occupancy held for each supply of S2,
Each of the AS2 occupation amounts is output to the pack selection circuit 71.

【0097】次に、ビデオESを多重化するときのパッ
ク選択回路71の動作について説明すると、パック選択
回路71は、ビデオバッファ4に対して多重化回路72
への出力ビデオESVOのデータ量を指示するととも
に、この出力ビデオESVOのデータ量をVMBシミュ
レーション回路74に出力し、さらに、PSに付加する
SCRを多重化回路72及びSCR生成回路79に出力
する。出力ビデオESVOの中にAUの先頭が含まれて
いる場合、PSに付加するPTS、DTS、AU量及び
ピクチャタイプを多重化回路72に出力する。同時にそ
のAU量及びDTSをVMBシミュレーション回路74
に出力する。さらに、後述するように保持しているSC
RにSCR加算値を加算する。以下、出力ビデオESV
OのAU量を区別する場合、AUV量と呼ぶ。
Next, the operation of the pack selection circuit 71 when the video ES is multiplexed will be described. The pack selection circuit 71 has the multiplexing circuit 72 for the video buffer 4.
The data amount of the output video ESVO is output to the VMB simulation circuit 74, and the SCR added to the PS is output to the multiplexing circuit 72 and the SCR generation circuit 79. When the output video ESVO includes the head of AU, the PTS, DTS, AU amount, and picture type to be added to PS are output to the multiplexing circuit 72. At the same time, the AU amount and DTS are calculated by the VMB simulation circuit
Output to. Furthermore, the SC held as described later
The SCR addition value is added to R. Below, output video ESV
When distinguishing the AU amount of O, it is called the AUV amount.

【0098】次に、オーディオESAS1,ESAS2
を多重化するときのパック選択回路71の動作について
説明すると、パック選択回路71は、オーディオバッフ
ァ5,6の各々に対して多重化回路72への出力オーデ
ィオESAS1O,ESAS2Oの各々のデータ量を指
示するとともに、この出力オーディオESAS1O,E
SAS2Oの各々のデータ量をAMBシミュレーション
回路76,78の各々に出力し、さらに、PSに付加す
るSCRを多重化回路72及びSCR生成回路79に出
力する。出力オーディオESAS1O,ESAS2Oの
各々の中にアクセスユニット(AU)の先頭が含まれて
いる場合、PSに付加するPTS及びAU量を多重化回
路72に出力する。同時にそのAUの数(以下AU量)
及びPTSをAMBシミュレーション回路76,78の
各々に出力する。さらに、保持しているSCRにSCR
加算値を加算する。以下、オーディオESAS1O,E
SAS2Oの各々のAU量をAU1量,AU2量、PT
SをPTS1,PTS2と呼ぶ。両者を区別しない場合
は、一括してAU量及びPTSと呼ぶ。
Next, audio ESAS1, ESAS2
The operation of the pack selection circuit 71 when multiplexing audio data will be described. The pack selection circuit 71 instructs the audio buffers 5 and 6 to specify the data amount of each of the output audio ESAS1O and ESAS2O to the multiplexing circuit 72. This output audio ESAS1O, E
The data amount of each SAS2O is output to each of the AMB simulation circuits 76 and 78, and the SCR to be added to PS is output to the multiplexing circuit 72 and the SCR generation circuit 79. When the head of the access unit (AU) is included in each of the output audio ESAS1O and ESAS2O, the PTS and AU amount to be added to PS are output to the multiplexing circuit 72. At the same time, the number of AUs (hereinafter AU amount)
And PTS are output to each of the AMB simulation circuits 76 and 78. In addition, the SCR
Add the added value. Below, audio ESAS1O, E
AU1 amount, AU2 amount, PT for each AU amount of SAS2O
S is called PTS1 and PTS2. When the two are not distinguished, they are collectively referred to as the AU amount and PTS.

【0099】多重化回路72は、オーディオESAS1
O,ESAS2O,SCR及びPTSを入力し、多重化
を行い、PSを出力する。
The multiplexing circuit 72 uses the audio ESAS1.
O, ESAS2O, SCR and PTS are input, multiplexed, and PS is output.

【0100】次に、VMBシミュレーション回路74の
動作について説明すると、VMBシミュレーション回路
74は、P−STDのVMB204の空き容量を保持
し、パック選択回路71からの出力ビデオESVOのデ
ータ量の供給に応答して、VMB204の空き容量から
出力ビデオESVOのデータ量を減算し使用可能容量を
求める。また、AUV量及びDTSの供給に応答してこ
れらAUV量及びDTSを関連付けて保持する。さら
に、SCR生成回路79が出力するシミュレーション用
SCRの値(以下、SCR値)と保持しているDTSの
値(以下、DTS値)とを比較し、SCR値よりDTS
値の方が小さいとき、VMB204の空き容量にDTS
に関連するAUV量を加算する。SCR値よりDTS値
の方が大きいとき、保持していたDTS及びそのDTS
に関連するAU量を削除する。また、パック選択回路7
1が出力したSCRの供給に応答して、そのSCR値と
保持しているDTS値を比較し、DTS値がSCR値と
同一又はSCRより小さいとき、そのDTSに関連する
AU量をパック選択回路71に出力するとともに、VM
B204の空き容量にDTSに関連するAU量を加算す
る。また、上記加算結果の値である加算値とVMB20
4の容量とを比較し、加算値の方が大きいときVMB2
04のアンダフローをパック選択回路71に出力する。
さらに、パック選択回路71からの最大値確認要求の供
給に応答して、保持しているDTSの最大値をパック選
択回路71に出力する。パック選択回路71からの空き
容量確認要求の供給に応答してVMB204の空き容量
をパック選択回路71に出力する。さらにまた、パック
選択回路71からの最小値確認要求の供給に応答して、
保持しているDTSの最小値をパック選択回路71に出
力する。
Next, the operation of the VMB simulation circuit 74 will be described. The VMB simulation circuit 74 holds the free capacity of the VMB 204 of P-STD and responds to the supply of the data amount of the output video ESVO from the pack selection circuit 71. Then, the usable capacity is obtained by subtracting the data amount of the output video ESVO from the free capacity of the VMB 204. Further, in response to the supply of the AUV amount and the DTS, the AUV amount and the DTS are held in association with each other. Further, the value of the SCR for simulation (hereinafter, SCR value) output from the SCR generation circuit 79 is compared with the value of the DTS held (hereinafter, DTS value), and the DTS is calculated from the SCR value.
When the value is smaller, the free space in the VMB 204 is set to the DTS.
Add the AUV amount associated with. When the DTS value is larger than the SCR value, the DTS held and its DTS
Delete the AU amount associated with. Also, the pack selection circuit 7
In response to the supply of the SCR output by 1, the SCR value is compared with the held DTS value, and when the DTS value is equal to or smaller than the SCR value, the AU amount associated with the DTS is selected by the pack selection circuit. 71 and VM
The AU amount related to the DTS is added to the free capacity of B204. In addition, the addition value that is the value of the addition result and the VMB 20
4 and the capacity is larger, VMB2
The underflow 04 is output to the pack selection circuit 71.
Further, in response to the supply of the maximum value confirmation request from the pack selection circuit 71, the maximum value of the held DTS is output to the pack selection circuit 71. In response to the supply of the free space confirmation request from the pack selection circuit 71, the free space of the VMB 204 is output to the pack selection circuit 71. Furthermore, in response to the supply of the minimum value confirmation request from the pack selection circuit 71,
The minimum value of the held DTS is output to the pack selection circuit 71.

【0101】次に、AMBシミュレーション回路76,
78を代表してAMBシミュレーション回路76の動作
について説明すると、AMBシミュレーション回路76
は、P−STDのAMB207の空き容量を保持し、パ
ック選択回路71からの出力オーディオESAS1Oの
データ量の供給に応答して、AMB207の空き容量か
ら出力オーディオESAS1Oのデータ量を減算し使用
可能容量を求める。また、AU1量及びPTS1の供給
に応答してこれらAU1量及びPTS1を関連付けて保
持する。さらに、SCR生成回路79が出力するシミュ
レーション用SCR値と保持しているPTS1の値(以
下PTS1値)とを比較し、SCR値よりPTS1値の
方が小さいとき、AMB207の空き容量にPTS1に
関連するAU1量を加算する。SCR値よりPTS1値
の方が大きいとき、保持していたPTS1及びそのPT
S1に関連するAU1量を削除する。また、パック選択
回路71が出力したSCRの供給に応答して、そのSC
R値と保持しているPTS1値を比較し、PTS1値が
SCR値と同一又はSCRより小さいとき、そのPTS
1に関連するAU1量をパック選択回路71に出力する
とともに、AMB207の空き容量にPTS1に関連す
るAU1量を加算する。また、上記加算結果の値である
加算値とAMB207の容量とを比較し、加算値の方が
大きいときAMB207のアンダフローをパック選択回
路71に出力する。さらに、パック選択回路71からの
最大値確認要求の供給に応答して、保持しているPTS
1の最大値をパック選択回路71に出力する。パック選
択回路71からの空き容量確認要求の供給に応答してA
MB207の空き容量をパック選択回路71に出力す
る。さらにまた、パック選択回路71からの最小値確認
要求の供給に応答して、保持しているPTS1の最小値
をパック選択回路71に出力する。
Next, the AMB simulation circuit 76,
The operation of the AMB simulation circuit 76 will be described on behalf of the AMB simulation circuit 76.
Holds the free capacity of the AMB 207 of the P-STD and, in response to the supply of the data amount of the output audio ESAS1O from the pack selection circuit 71, subtracts the data amount of the output audio ESAS1O from the free capacity of the AMB 207 and decreases the usable capacity. Ask for. Further, in response to the supply of the AU1 amount and PTS1, the AU1 amount and PTS1 are held in association with each other. Further, the SCR value for simulation output by the SCR generation circuit 79 is compared with the value of PTS1 held (hereinafter referred to as PTS1 value), and when the PTS1 value is smaller than the SCR value, the free capacity of the AMB 207 is related to PTS1. Add the AU1 amount. When the PTS1 value is larger than the SCR value, the retained PTS1 and its PT
Delete the AU1 quantity associated with S1. In addition, in response to the supply of the SCR output by the pack selection circuit 71, the SC
The R value is compared with the held PTS1 value, and when the PTS1 value is equal to or smaller than the SCR value, the PTS
The AU1 amount related to 1 is output to the pack selection circuit 71, and the AU1 amount related to PTS1 is added to the free capacity of the AMB 207. Further, the added value which is the value of the addition result is compared with the capacity of the AMB 207, and when the added value is larger, the underflow of the AMB 207 is output to the pack selection circuit 71. Further, in response to the supply of the maximum value confirmation request from the pack selection circuit 71, the PTS held therein is held.
The maximum value of 1 is output to the pack selection circuit 71. In response to the supply of the free space confirmation request from the pack selection circuit 71, A
The empty capacity of the MB 207 is output to the pack selection circuit 71. Furthermore, in response to the supply of the minimum value confirmation request from the pack selection circuit 71, the held minimum value of PTS1 is output to the pack selection circuit 71.

【0102】AMBシミュレーション回路78の動作
は、上述のAMBシミュレーション回路76の動作にお
いて、AMB207をAMB209に、出力オーディオ
ESAS1Oを出力オーディオESAS2Oに、AU1
をAU2に、PTS1をPTS2にそれぞれ読み替える
他は同一である。
The operation of the AMB simulation circuit 78 is the same as the operation of the AMB simulation circuit 76 described above, except that AMB207 is output to AMB209, output audio ESAS1O is output audio ESAS2O, and AU1.
Is the same as AU2, and PTS1 is PTS2.

【0103】次に、パック選択回路71の多重化順位の
決定方法について説明すると、パック選択回路71は、
VMBシミュレーション回路74及びAMBシミュレー
ション回路76,78に対して最大値確認要求を出力す
る。VMBシミュレーション回路74は、最大値確認要
求の受領に応じて保持しているDTSの最大値をパック
選択回路71に出力する。AMBシミュレーション回路
76,78の各々は、最大値確認要求の受領に応じて保
持しているPTS1,PTS2の各々の最大値をそれぞ
れパック選択回路71に出力する。パック選択回路71
は、入力したDTSの最大値及びPTS1,PTS2の
各々の最大値の計3つの最大値を比較し、最大値が1番
小さいDTS/PTS1/PTS2に対応するESを多
重化順位1とし、以下、最大値が大きくなる順序で多重
化するという多重化順位付けを行う。ここで、この多重
化順位付けの順位を多重化順位と呼ぶ。
Next, the method of determining the multiplexing order of the pack selection circuit 71 will be described.
The maximum value confirmation request is output to the VMB simulation circuit 74 and the AMB simulation circuits 76 and 78. The VMB simulation circuit 74 outputs the maximum value of the DTS held therein to the pack selection circuit 71 in response to the reception of the maximum value confirmation request. Each of the AMB simulation circuits 76 and 78 outputs the maximum value of each of PTS1 and PTS2 held therein in response to the reception of the maximum value confirmation request to the pack selection circuit 71, respectively. Pack selection circuit 71
Compares the maximum value of the input DTS and the maximum value of each of PTS1 and PTS2 in total, and sets the ES corresponding to DTS / PTS1 / PTS2, which has the smallest maximum value, as the multiplexing order 1. , And multiplex ordering is performed in which the multiplexes are performed in order of increasing maximum value. Here, the order of this multiplexing order is called a multiplexing order.

【0104】多重化判断について説明すると、パック選
択回路71は、各ESに対して大別してP−STDメイ
ンバッファシミュレーション用のSCRの調整の有無に
応じ2種類の多重化判断を行う。第1は、SCRの調整
を伴わない多重化判断で、以下、多重化判断1と呼ぶ。
第2は、SCRCSの調整を伴う多重化判断で、以下、
多重化判断2と呼ぶ。
Explaining the multiplexing judgment, the pack selection circuit 71 roughly divides each ES into two kinds of multiplexing judgments depending on whether or not the SCR for P-STD main buffer simulation is adjusted. The first is a multiplexing decision without SCR adjustment, and is hereinafter referred to as a multiplexing decision 1.
The second is a multiplexing decision involving the adjustment of SCRCS.
This is called multiplexing judgment 2.

【0105】パック選択回路71は、決定した多重化順
位に従い、各ESに対して多重化判断1を行い、いずれ
かのESが多重化できることを確認できた時点で、多重
化を行い多重化処理を終了する。多重化判断1において
全てのESを多重化できなかった場合、決定した多重化
順位に従い、各ESに対して多重化判断2を行い、いず
れかのESが多重化できることを確認できた時点で、多
重化を行い多重化処理を終了する。多重化判断2におい
ても全てのESが多重化できなかった場合、多重化処理
を終了する。
The pack selection circuit 71 makes a multiplexing decision 1 for each ES according to the determined multiplexing order, and when it is confirmed that either ES can be multiplexed, the pack selection circuit 71 performs the multiplexing process. To finish. When all ESs cannot be multiplexed in the multiplexing judgment 1, the multiplexing judgment 2 is performed for each ES according to the determined multiplexing order, and when it is confirmed that any ES can be multiplexed, After multiplexing, the multiplexing process is completed. If all ESs cannot be multiplexed even in the multiplexing determination 2, the multiplexing process ends.

【0106】次に、ビデオESVSに対する多重化判断
1の動作について説明すると、パック選択回路71は、
多重化するためのデータ量を満たしたビデオESVS
(以下、多重化対象ビデオES)がビデオバッファ4に
存在するかを判断するため、VB占有量確認回路73に
対し容量確認要求QCVを出力し容量確認を行う。ビデ
オバッファ4に多重化対象ビデオESが存在することを
確認したとき、VMBシミュレーション回路74に対し
てP−STDのVMB204の空き容量確認を行う。V
MB204の空き容量が、多重化対象ビデオESVSの
データ量より大きいことを確認したとき、ビデオESV
Sの多重化を行い、多重化処理を終了する。
Next, the operation of the multiplexing judgment 1 for the video ESVS will be described. The pack selection circuit 71
Video ESVS with sufficient amount of data for multiplexing
In order to determine whether (hereinafter, the video ES to be multiplexed) exists in the video buffer 4, a capacity confirmation request QCV is output to the VB occupation amount confirmation circuit 73 to perform capacity confirmation. When it is confirmed that the video ES to be multiplexed exists in the video buffer 4, the free space of the VMB 204 of the P-STD is confirmed with respect to the VMB simulation circuit 74. V
When it is confirmed that the free space of the MB 204 is larger than the data amount of the multiplexing target video ESVS, the video ESV
S is multiplexed and the multiplexing process is completed.

【0107】パック選択回路71は、ビデオバッファ4
に多重化対象ビデオESが存在しないことを確認したと
き、及びVMB204の空き容量が多重化対象ビデオE
SVSのデータ量より小さいことを確認したとき、ビデ
オESVSに対する多重化判断1を終了する。
The pack selection circuit 71 includes a video buffer 4
When it is confirmed that there is no target video ES for multiplexing, and the free capacity of the VMB 204 is equal to the target video E for multiplexing.
When it is confirmed that the data amount is smaller than the SVS data amount, the multiplexing determination 1 for the video ESVS is ended.

【0108】このとき、ビデオESの多重化順位より低
順位のESが存在する場合は、そのESに対して多重化
判断1を実行する。ビデオESの多重化順位より低順位
のESが存在しない場合は、多重化順位1のESに対し
て多重化判断2を実行する。
At this time, if an ES having a lower rank than the multiplexing rank of the video ES exists, the multiplexing judgment 1 is executed for the ES. If there is no ES having a lower rank than the multiplexing rank of the video ES, the multiplexing judgment 2 is executed for the ES having the multiplexing rank 1.

【0109】次に、オーディオESAS1に対する多重
化判断1の動作について説明すると、パック選択回路7
1は、多重化するためのデータ量を満たしたオーディオ
ESAS1(以下、多重化対象オーディオESAS1)
がオーディオバッファ5に存在するかを判断するため、
AB占有量確認回路75にに対し容量確認要求QCVを
出力し容量確認を行う。オーディオバッファ5に多重化
対象オーディオESAS1が存在していることを確認し
たとき、AMBシミュレーション回路76に対してP−
STDのAMB207の空き容量確認を行う。AMB2
07の空き容量が多重化対象オーディオESAS1のデ
ータ量より大きいことを確認したとき、オーディオES
AS1の多重化を行い、多重化処理を終了する。
Next, the operation of the multiplexing judgment 1 for the audio ESAS1 will be described. The pack selection circuit 7
1 is an audio ESAS1 satisfying the amount of data for multiplexing (hereinafter, the audio ESAS1 to be multiplexed)
Is present in the audio buffer 5,
A capacity confirmation request QCV is output to the AB occupation amount confirmation circuit 75 to confirm the capacity. When it is confirmed that the audio ESAS1 to be multiplexed exists in the audio buffer 5, P-
The free space of the STD AMB 207 is confirmed. AMB2
When it is confirmed that the free space of 07 is larger than the data amount of the multiplexing target audio ESAS1, the audio ES
The AS1 is multiplexed, and the multiplexing process ends.

【0110】パック選択回路71は、オーディオバッフ
ァ5に多重化対象オーディオESAS1が存在しないこ
とを確認したとき、及びAMB207の空き容量が多重
化対象オーディオESAS1のデータ量より小さいこと
を確認したとき、オーディオESAS1に対する多重化
判断1を終了する。
When the pack selection circuit 71 confirms that the multiplexing target audio ESAS1 does not exist in the audio buffer 5 and confirms that the free capacity of the AMB 207 is smaller than the data amount of the multiplexing target audio ESAS1, the pack selection circuit 71 The multiplexing determination 1 for ESAS1 ends.

【0111】このとき、オーディオESAS1の多重化
順位より低順位のESが存在する場合は、そのESに対
して多重化判断1を実行する。オーディオESAS1の
多重化順位より低順位のESが存在しない場合は、多重
化順位1のESに対して多重化判断2を実行する。
At this time, if there is an ES having a lower rank than the multiplexing rank of the audio ESAS1, the multiplexing judgment 1 is executed for the ES. If there is no ES having a lower rank than the multiplexing rank of the audio ESAS1, the multiplexing judgment 2 is executed for the ES having the multiplexing rank 1.

【0112】オーディオESAS2に対する多重化判断
1の動作は、オーディオESAS1をオーディオESA
S2に、オーディオバッファ5をオーディオバッファ6
に、AB占有量確認回路75をAB占有量確認回路77
に、AMBシミュレーション回路76をAMBシミュレ
ーション回路78に、AMB207をAMB209にそ
れぞれ読み替える他は、上述のオーディオESAS1に
対する多重化判断1の動作と同一である。
The operation of the multiplexing judgment 1 for the audio ESAS2 is performed by changing the audio ESAS1 from the audio ESA1.
In S2, the audio buffer 5 is replaced with the audio buffer 6
The AB occupation amount confirmation circuit 75 is replaced with the AB occupation amount confirmation circuit 77.
Further, the operation is the same as the operation of the multiplexing judgment 1 for the audio ESAS1 described above except that the AMB simulation circuit 76 is replaced with the AMB simulation circuit 78 and the AMB 207 is replaced with the AMB 209.

【0113】次に、各ESに対する多重化判断2の動作
について説明する。なお各ESに対する多重化判断2の
動作は各ESの多重化順位により異なるので、以下の説
明は多重化順位毎に説明する。
Next, the operation of the multiplexing judgment 2 for each ES will be described. Since the operation of the multiplexing determination 2 for each ES differs depending on the multiplexing order of each ES, the following description will be given for each multiplexing order.

【0114】まず、多重化順位1のビデオESに対する
多重化判断2の動作について説明すると、パック選択回
路71は、多重化多重化対象ビデオESがビデオバッフ
ァ4に存在するかを判断するため、VB占有量確認回路
73に対し容量確認要求QCVを出力し容量確認を行
う。ビデオバッファ4に多重化対象ビデオESが存在し
ないことを確認すると、ビデオESに対する多重化判断
2を終了し、多重化順位2のESに対して多重化判断2
を実行する。
First, the operation of the multiplexing determination 2 for the video ES having the multiplexing priority of 1 will be described. The pack selection circuit 71 determines whether the multiplexing multiplexing target video ES exists in the video buffer 4 or not. A capacity confirmation request QCV is output to the occupation amount confirmation circuit 73 to confirm the capacity. When it is confirmed that the video ES to be multiplexed does not exist in the video buffer 4, the multiplexing determination 2 for the video ES is ended, and the multiplexing determination 2 for the ES having the multiplexing priority 2
To execute.

【0115】パック選択回路71は、ビデオバッファ4
に多重化対象ビデオESが存在することを確認すること
により、P−STDのVMB204にビデオESを入力
する空き容量がないということが分かる。このときパッ
ク選択回路71は、VMBシミュレーション回路74に
保持しているDTSの最小値を呼び出し、その値をSC
R生成回路79に出力し、シミュレーション用のSCR
の値を変更する。VMBシミュレーション回路74は、
変更後のSCRの値に合わせ、保持しているDTS、A
UV量、VMB204の空き容量の変更削除を行う。
The pack selection circuit 71 includes a video buffer 4
By confirming that the video ES to be multiplexed exists, it can be seen that there is no free space to input the video ES in the VMB 204 of the P-STD. At this time, the pack selection circuit 71 calls the minimum value of DTS held in the VMB simulation circuit 74, and sets the value to SC.
SCR for output to the R generation circuit 79 for simulation
Change the value of. The VMB simulation circuit 74
DTS and A held according to the changed SCR value
The UV amount and the free space of the VMB 204 are changed and deleted.

【0116】上記動作後、パック選択回路71は、VM
Bシミュレーション回路74に対し空き容量確認要求を
出力しVMB204の空き容量確認を行い、VMB20
4の空き容量が多重化対象ビデオESのデータ量より大
きいことを確認したとき、ビデオESの多重化を行い多
重化処理を終了する。また、VMB204の空き容量が
多重化対象ビデオESの量より小さいことを確認したと
き、上述のパック選択回路71によるSCRの変更、V
MBシミュレーション回路74の保持値の変更削除、A
MBシミュレーション回路76の保持値の変更削除、A
MBシミュレーション回路78の保持値の変更削除、パ
ック選択回路71によるVMB204の空き容量の確認
という動作をビデオESが多重化できるまで繰り返す。
After the above operation, the pack selection circuit 71 causes the VM
A free space confirmation request is output to the B simulation circuit 74, and the free space of the VMB 204 is confirmed.
When it is confirmed that the free space of 4 is larger than the data amount of the video ES to be multiplexed, the video ES is multiplexed and the multiplexing process ends. Further, when it is confirmed that the free capacity of the VMB 204 is smaller than the amount of the video ES to be multiplexed, the pack selection circuit 71 changes the SCR, V
Change and delete the value held in the MB simulation circuit 74, A
Change and delete the value held in the MB simulation circuit 76, A
The operations of changing and deleting the held value of the MB simulation circuit 78 and checking the free capacity of the VMB 204 by the pack selection circuit 71 are repeated until the video ES can be multiplexed.

【0117】次に、多重化順位2のビデオESに対する
多重化判断2の動作について説明すると、パック選択回
路71は、多重化多重化対象ビデオESがビデオバッフ
ァ4に存在するかを判断するため、VB占有量確認回路
73に対し容量確認要求QCVを出力し容量確認を行
う。ビデオバッファ4に多重化対象ビデオESが存在し
ないことを確認したとき、多重化順位3のESに対して
多重化判断2を実行する。また、ビデオバッファ4に多
重化対象ビデオESが存在することを確認したとき、V
MB204にビデオESを入力する空き容量ないという
ことが分かる。このときパック選択回路71は、VMB
シミュレーション回路74に保持しているDTSの最小
値を呼び出し、このDTSの最小値をSCRとして多重
化順位1のESに対応するメインバッファ(MB)シミ
ュレーション回路に出力し、多重化順位1のP−STD
のメインバッファがアンダフローしないかを判断し、ア
ンダフローすることを確認したときは、多重化順位3の
ESに対して多重化判断2を実行する。また、アンダフ
ローしないことを確認したときは、呼び出したDTSの
最小値をSCRに出力する。
Next, the operation of the multiplexing judgment 2 for the video ES having the multiplexing order 2 will be described. The pack selection circuit 71 judges whether the multiplexing ES to be multiplexed exists in the video buffer 4. A capacity confirmation request QCV is output to the VB occupation amount confirmation circuit 73 to confirm the capacity. When it is confirmed that the video ES to be multiplexed does not exist in the video buffer 4, the multiplexing determination 2 is executed for the ES having the multiplexing order 3. When it is confirmed that the video ES to be multiplexed exists in the video buffer 4, V
It can be seen that there is no free space to input the video ES into the MB 204. At this time, the pack selection circuit 71 is
The minimum value of the DTS held in the simulation circuit 74 is called, the minimum value of the DTS is output as the SCR to the main buffer (MB) simulation circuit corresponding to the ES of the multiplexing order 1, and the P- of the multiplexing order 1 is output. STD
It is determined whether or not the main buffer of No. 1 underflows, and when it is confirmed that it underflows, the multiplexing judgment 2 is executed for the ES of the multiplexing order 3. When it is confirmed that the underflow does not occur, the minimum value of the called DTS is output to the SCR.

【0118】VMBシミュレーション回路74は、変更
されたSCRの値に合わせ、保持しているDTS、AU
V量、VMB204の空き容量の変更削除を行う。AM
Bシミュレーション回路76は、変更されたSCRの値
に合わせ、保持しているPTS、AUV量、AMB20
7の空き容量の変更削除を行う。AMBシミュレーショ
ン回路78は、変更されたSCRの値に合わせ、保持し
ているPTS、AUV量、AMB209の空き容量の変
更削除を行う。
The VMB simulation circuit 74 adjusts the value of the changed SCR and holds the DTS and AU.
The amount of V and the free capacity of the VMB 204 are changed and deleted. AM
The B simulation circuit 76 adjusts the PTS, AUV amount, and AMB20 that are held according to the changed SCR value.
Change and delete the free space of 7. The AMB simulation circuit 78 changes and deletes the held PTS, AUV amount, and free space of the AMB 209 according to the changed SCR value.

【0119】上記動作後、パック選択回路71は、VM
Bシミュレーション回路74に対し空き容量確認要求を
出力しVMB204の空き容量確認を行い、VMB20
4の空き容量が多重化対象ビデオESのデータ量より大
きいことを確認したとき、ビデオESの多重化を行い多
重化処理を終了する。VMB204の空き容量が多重化
対象ビデオESのデータ量より小さいことを確認したと
き、上記に示したパック選択回路71によるSCR変更
に伴う多重化順位1のP−STDメインバッファのアン
ダフローの有無の確認及びSCRの変更、VMBシミュ
レーション回路74の保持値の変更削除、AMBシミュ
レーション回路76の保持値の変更削除、AMBシミュ
レーション回路78の保持値の変更削除、パック選択回
路71によるVMB204の空き容量の確認という動作
をビデオESが多重化できるまで繰り返す。
After the above operation, the pack selection circuit 71 causes the VM
A free space confirmation request is output to the B simulation circuit 74, and the free space of the VMB 204 is confirmed.
When it is confirmed that the free space of 4 is larger than the data amount of the video ES to be multiplexed, the video ES is multiplexed and the multiplexing process ends. When it is confirmed that the free capacity of the VMB 204 is smaller than the data amount of the video ES to be multiplexed, it is determined whether or not there is an underflow of the P-STD main buffer of the multiplexing order 1 due to the SCR change by the pack selection circuit 71 described above. Confirmation and change of SCR, change and deletion of held value of VMB simulation circuit 74, change and deletion of held value of AMB simulation circuit 76, change and deletion of held value of AMB simulation circuit 78, check of free capacity of VMB 204 by pack selection circuit 71 This operation is repeated until the video ES can be multiplexed.

【0120】次に、多重化順位3のビデオESに対する
多重化判断2の動作について説明すると、パック選択回
路71は、多重化多重化対象ビデオESがビデオバッフ
ァ4に存在するかを判断するため、VB占有量確認回路
73に対し容量確認要求QCVを出力し容量確認を行
う。ビデオバッファ4に多重化対象ビデオESが存在し
ないことを確認したとき、多重化判断2を終了する。ま
た、多重化対象ビデオESが存在することを確認したと
き、VMB204にビデオESを入力する空き容量がな
いことが分かる。
Next, the operation of the multiplexing judgment 2 for the video ES having the multiplexing order 3 will be described. The pack selection circuit 71 judges whether or not the multiplexing ES to be multiplexed exists in the video buffer 4. A capacity confirmation request QCV is output to the VB occupation amount confirmation circuit 73 to confirm the capacity. When it is confirmed that the video ES to be multiplexed does not exist in the video buffer 4, the multiplexing determination 2 ends. Also, when it is confirmed that the video ES to be multiplexed exists, it can be seen that there is no free space for inputting the video ES in the VMB 204.

【0121】パック選択回路71は、VMBシミュレー
ション回路74に保持しているDTSの最小値を呼び出
し、DTSの最小値をSCRとして多重化順位1及び多
重化順位2のMBシミュレーション回路に出力し、多重
化順位1及び多重化順位2のP−STDのメインバッフ
ァがアンダフローしないか判断する。多重化順位1及び
多重化順位2のメインバッファのいずれか又は両方がア
ンダフローすることを確認したときは、多重化判断2を
終了する。
The pack selection circuit 71 calls the minimum value of the DTS held in the VMB simulation circuit 74, outputs the minimum value of the DTS as an SCR to the MB simulation circuits of the multiplexing order 1 and the multiplexing order 2, and performs the multiplexing. It is determined whether or not the main buffer of the P-STD having the conversion order 1 and the multiplexing order 2 underflows. When it is confirmed that either or both of the main buffers of the multiplexing order 1 and the multiplexing order 2 underflow, the multiplexing judgment 2 is ended.

【0122】多重化順位1及び多重化順位2のP−ST
Dのメインバッファがアンダフローしないことを確認し
たとき、呼び出したDTSの最小値をSCR生成回路7
9に出力し、SCR生成回路79はこのDTSに基づき
SCRを変更する。VMBシミュレーション回路74
は、変更されたSCRの値に合わせ、保持しているDT
S、AUV量、VMB204の空き容量の変更削除を行
う。AMBシミュレーション回路76,78の各々は、
変更されたSCRの値に合わせ、保持しているPTS
1、PTS2、AU1量,AU2量、AMB207、2
09の各々の空き容量の変更削除を行う。
P-ST of multiplexing order 1 and multiplexing order 2
When it is confirmed that the D main buffer does not underflow, the SCR generation circuit 7 outputs the minimum value of the called DTS.
9, and the SCR generation circuit 79 changes the SCR based on this DTS. VMB simulation circuit 74
Is the DT that is held according to the changed SCR value.
The S and AUV amounts and the free space of the VMB 204 are changed and deleted. Each of the AMB simulation circuits 76 and 78 has
The PTS held according to the changed SCR value
1, PTS2, AU1 amount, AU2 amount, AMB207, 2
Change and delete each free space of 09.

【0123】上記動作後、パック選択回路71は、VM
Bシミュレーション回路74に対し空き容量確認要求を
出力しMB204の空き容量確認を行う。VMB204
の空き容量が多重化対象ビデオESのデータ量より大き
いことを確認したとき、ビデオESの多重化を行い多重
化処理を終了する。また、VMB204の空き容量が多
重化対象ビデオESのデータ量より小さいことを確認し
たとき、上述のパック選択回路71によるSCR変更に
伴う多重化順位1及び多重化順位2のP−STDメイン
バッファのアンダフローの有無の確認及びSCRの変
更、VMBシミュレーション回路74の保持値の変更削
除、AMBシミュレーション回路76の保持値の変更削
除、AMBシミュレーション回路78の保持値の変更削
除、パック選択回路71によるVMB204の空き容量
の確認という動作をビデオESが多重化できるまで繰り
返す。
After the above operation, the pack selection circuit 71 causes the VM
A free space confirmation request is output to the B simulation circuit 74 to confirm the free space of the MB 204. VMB204
When it is confirmed that the free space of is larger than the data amount of the video ES to be multiplexed, the video ES is multiplexed and the multiplexing process ends. Further, when it is confirmed that the free capacity of the VMB 204 is smaller than the data amount of the video ES to be multiplexed, the P-STD main buffers of the multiplexing order 1 and the multiplexing order 2 due to the SCR change by the pack selection circuit 71 described above. Confirmation of presence / absence of underflow, change of SCR, change and deletion of held value of VMB simulation circuit 74, change and deletion of held value of AMB simulation circuit 76, change and deletion of held value of AMB simulation circuit 78, VMB 204 by pack selection circuit 71 The operation of checking the free space of is repeated until the video ES can be multiplexed.

【0124】次に、多重化順位1のオーディオESAS
1に対する多重化判断2の動作について説明すると、パ
ック選択回路71は、多重化対象オーディオESAS1
がオーディオバッファ5に存在するかの判断のため、A
B占有量確認回路75に対し容量確認要求QCAS1を
出力し容量確認を行う。オーディオバッファ5に多重化
対象オーディオESAS1が存在しないことを確認する
と、オーディオESAS1に対する多重化判断2を終了
し、多重化順位2のESに対して多重化判断2を実行す
る。オーディオバッファ5に多重化対象オーディオES
AS1が存在することを確認することにより、AMB2
07にオーディオESAS1を入力する空き容量がない
ことが分かる。このときパック選択回路71は、AMB
シミュレーション回路76に保持しているPTS1の最
小値を呼び出し、その値をSCR生成回路79に出力す
る。SCR生成回路79は、PTS1の最小値に基づき
SCRを変更する。VMBシミュレーション回路74
は、変更されたSCRの値に合わせ、保持しているDT
S、AUV量、VMB204の空き容量の変更削除を行
う。AMBシミュレーション回路76は、変更されたS
CRの値に合わせ、保持しているPTS1、AU1量、
AMB207の空き容量の変更削除を行う。AMBシミ
ュレーション回路78は、変更されたSCRの値に合わ
せ、保持しているPTS2、AU2量、AMB209の
空き容量の変更削除を行う。
Next, the audio ESAS having the multiplexing order 1
The operation of the multiplexing determination 2 for 1 will be described. The pack selection circuit 71 determines that the multiplexing target audio ESAS1.
A exists in the audio buffer 5 to determine whether
A capacity confirmation request QCAS1 is output to the B occupation amount confirmation circuit 75 to confirm the capacity. When it is confirmed that the audio ESAS1 to be multiplexed does not exist in the audio buffer 5, the multiplexing judgment 2 for the audio ESAS1 is ended, and the multiplexing judgment 2 is executed for the ES having the multiplexing rank 2. Audio ES to be multiplexed in audio buffer 5
By confirming that AS1 exists, AMB2
It can be seen that there is no free space for inputting the audio ESAS1 in 07. At this time, the pack selection circuit 71
The minimum value of PTS1 held in the simulation circuit 76 is called and the value is output to the SCR generation circuit 79. The SCR generation circuit 79 changes the SCR based on the minimum value of PTS1. VMB simulation circuit 74
Is the DT that is held according to the changed SCR value.
The S and AUV amounts and the free space of the VMB 204 are changed and deleted. The AMB simulation circuit 76 has a modified S
According to the CR value, the amount of PTS1 and AU1 held,
The free capacity of the AMB 207 is changed and deleted. The AMB simulation circuit 78 changes and deletes the held PTS2, AU2 amount, and free space of the AMB 209 according to the changed SCR value.

【0125】上記動作後、パック選択回路71は、AM
Bシミュレーション回路76に対し空き容量確認要求を
出力しAMB207の空き容量確認を行い、AMB20
7の空き容量が多重化対象オーディオESAS1のデー
タ量より大きいことを確認したとき、オーディオESA
S1の多重化を行い多重化処理を終了する。また、AM
B207の空き容量が多重化対象オーディオESAS1
のデータ量より小さいことを確認したとき、上述のパッ
ク選択回路71によるSCRの変更、VMBシミュレー
ション回路74の保持値の変更削除、AMBシミュレー
ション回路76の保持値の変更削除、AMBシミュレー
ション回路78の保持値の変更削除、パック選択回路7
1によるAMB207の空き容量の確認という動作をオ
ーディオESAS1を多重化できるまで繰り返す。
After the above operation, the pack selection circuit 71 turns the AM
A free space confirmation request is output to the B simulation circuit 76 to confirm the free space of the AMB 207, and the AMB 20
When it is confirmed that the free space of 7 is larger than the data amount of the multiplexing target audio ESAS1, the audio ESA
S1 is multiplexed and the multiplexing process is completed. Also AM
Free space of B207 is audio ESAS1 to be multiplexed
When it is confirmed that the data amount is smaller than the data amount, the pack selection circuit 71 changes the SCR, the VMB simulation circuit 74 retains and deletes the retained value, the AMB simulation circuit 76 retains the changed value, and the AMB simulation circuit 78 retains. Value change and deletion, pack selection circuit 7
The operation of checking the free space of the AMB 207 by 1 is repeated until the audio ESAS1 can be multiplexed.

【0126】次に、多重化順位2のオーディオESAS
1に対する多重化判断2の動作について説明すると、パ
ック選択回路71は、多重化多重化対象オーディオES
AS1がオーディオバッファ5に存在するかを判断する
ため、AB占有量確認回路75に対し容量確認要求QC
AS1を出力し容量確認を行う。オーディオバッファ5
に多重化対象オーディオESAS1が存在しないことを
確認したとき、多重化順位3のESに対して多重化判断
2を実行する。また、オーディオバッファ5に多重化対
象オーディオESAS1が存在することを確認したと
き、AMB207にオーディオESAS1を入力する空
き容量ないということが分かる。このときパック選択回
路71は、AMBシミュレーション回路76に保持して
いるPTS1の最小値を呼び出し、このPTS1の最小
値をSCRとして多重化順位1のESに対応するメイン
バッファ(MB)シミュレーション回路に出力し、多重
化順位1のP−STDのメインバッファがアンダフロー
しないかを判断し、アンダフローすることを確認したと
きは、多重化順位3のESに対して多重化判断2を実行
する。また、アンダフローしないことを確認したとき
は、呼び出したPTS1の最小値をSCRに出力する。
Next, an audio ESAS having a multiplexing rank of 2
The operation of the multiplexing determination 2 for 1 will be described. The pack selection circuit 71 uses the multiplexing target audio ES.
To determine whether AS1 exists in the audio buffer 5, a capacity confirmation request QC is issued to the AB occupancy confirmation circuit 75.
AS1 is output to confirm the capacity. Audio buffer 5
When it is confirmed that the multiplexing target audio ESAS1 does not exist, the multiplexing judgment 2 is executed for the ES having the multiplexing order 3. When it is confirmed that the audio ESAS1 to be multiplexed exists in the audio buffer 5, it can be seen that there is no free space to input the audio ESAS1 to the AMB 207. At this time, the pack selection circuit 71 calls the minimum value of PTS1 held in the AMB simulation circuit 76, and outputs this minimum value of PTS1 as an SCR to the main buffer (MB) simulation circuit corresponding to the ES of the multiplexing order 1. Then, it is determined whether or not the main buffer of the P-STD of the multiplexing order 1 underflows, and when it is confirmed that the main buffer underflows, the multiplexing determination 2 is executed for the ES of the multiplexing order 3. When it is confirmed that the underflow does not occur, the minimum value of the called PTS1 is output to the SCR.

【0127】VMBシミュレーション回路74は、変更
されたSCRの値に合わせ、保持しているDTS、AU
V量、VMB204の空き容量の変更削除を行う。AM
Bシミュレーション回路76は、変更されたSCRの値
に合わせ、保持しているPTS1、AU1量、AMB2
07の空き容量の変更削除を行う。AMBシミュレーシ
ョン回路78は、変更されたSCRの値に合わせ、保持
しているPTS2、AU2量、AMB209の空き容量
の変更削除を行う。
The VMB simulation circuit 74 adjusts the value of the changed SCR and holds the DTS and AU held therein.
The amount of V and the free capacity of the VMB 204 are changed and deleted. AM
The B simulation circuit 76 matches the changed SCR value and holds the PTS1, AU1 amount, and AMB2.
The free space of 07 is changed and deleted. The AMB simulation circuit 78 changes and deletes the held PTS2, AU2 amount, and free space of the AMB 209 according to the changed SCR value.

【0128】上記動作後、パック選択回路71は、AM
Bシミュレーション回路76に対し空き容量確認要求を
出力しAMB207の空き容量確認を行い、AMB20
7の空き容量が多重化対象オーディオESAS1のデー
タ量より大きいことを確認したとき、オーディオESA
S1の多重化を行い多重化処理を終了する。AMB20
7の空き容量が多重化対象オーディオESAS1のデー
タ量より小さいことを確認したとき、上記に示したパッ
ク選択回路71によるSCR変更に伴う多重化順位1の
P−STDメインバッファのアンダフローの有無の確認
及びSCRの変更、AMBシミュレーション回路76の
保持値の変更削除、AMBシミュレーション回路76の
保持値の変更削除、AMBシミュレーション回路78の
保持値の変更削除、パック選択回路71によるAMB2
07の空き容量の確認という動作をオーディオESAS
1が多重化できるまで繰り返す。
After the above operation, the pack selection circuit 71 is
A free space confirmation request is output to the B simulation circuit 76 to confirm the free space of the AMB 207, and the AMB 20
When it is confirmed that the free space of 7 is larger than the data amount of the multiplexing target audio ESAS1, the audio ESA
S1 is multiplexed and the multiplexing process is completed. AMB20
When it is confirmed that the free space of 7 is smaller than the data amount of the audio ESAS1 to be multiplexed, it is determined whether or not there is an underflow of the P-STD main buffer of multiplexing order 1 due to the SCR change by the pack selection circuit 71 described above. Confirmation and change of SCR, change and deletion of held value of AMB simulation circuit 76, change and deletion of held value of AMB simulation circuit 76, change and deletion of held value of AMB simulation circuit 78, AMB2 by pack selection circuit 71
The operation of checking the free space of 07 is audio ESAS
Repeat until 1 can be multiplexed.

【0129】次に、多重化順位3のオーディオESAS
1に対する多重化判断2の動作について説明すると、パ
ック選択回路71は、多重化多重化対象オーディオES
AS1がオーディオバッファ5に存在するかを判断する
ため、AB占有量確認回路75に対し容量確認要求QC
AS1を出力し容量確認を行う。オーディオバッファ5
に多重化対象オーディオESAS1が存在しないことを
確認したとき、多重化判断2を終了する。また、多重化
対象オーディオESAS1が存在することを確認したと
き、AMB207にオーディオESAS1を入力する空
き容量がないことが分かる。
Next, an audio ESAS having a multiplexing rank of 3
The operation of the multiplexing determination 2 for 1 will be described. The pack selection circuit 71 uses the multiplexing target audio ES.
To determine whether AS1 exists in the audio buffer 5, a capacity confirmation request QC is issued to the AB occupancy confirmation circuit 75.
AS1 is output to confirm the capacity. Audio buffer 5
When it is confirmed that the multiplexing target audio ESAS1 does not exist, the multiplexing determination 2 is ended. Further, when it is confirmed that the audio ESAS1 to be multiplexed exists, it can be seen that the AMB 207 has no free space for inputting the audio ESAS1.

【0130】パック選択回路71は、AMBシミュレー
ション回路76に保持しているPTS1の最小値を呼び
出し、PTS1の最小値をSCRとして多重化順位1及
び多重化順位2のMBシミュレーション回路に出力し、
多重化順位1及び多重化順位2のP−STDのメインバ
ッファがアンダフローしないか判断する。多重化順位1
及び多重化順位2のメインバッファのいずれか又は両方
がアンダフローすることを確認したときは、多重化判断
2を終了する。
The pack selection circuit 71 calls the minimum value of PTS1 held in the AMB simulation circuit 76, and outputs the minimum value of PTS1 as an SCR to the MB simulation circuits of multiplexing order 1 and multiplexing order 2,
It is determined whether the P-STD main buffers of the multiplexing order 1 and the multiplexing order 2 underflow. Multiplexing order 1
When it is confirmed that either or both of the main buffers of the multiplexing order 2 underflow, the multiplexing determination 2 is ended.

【0131】多重化順位1及び多重化順位2のP−ST
Dのメインバッファがアンダフローしないことを確認し
たとき、呼び出したPTS1の最小値をSCR生成回路
79に出力し、SCR生成回路79はこのPTS1に基
づきSCRを変更する。VMBシミュレーション回路7
4は、変更されたSCRの値に合わせ、保持しているD
TS、AUV量、VMB204の空き容量の変更削除を
行う。AMBシミュレーション回路76,78の各々
は、変更されたSCRの値に合わせ、保持しているPT
S1、PTS2、AU1量,AU2量、AMB207、
209の各々の空き容量の変更削除を行う。
P-ST of multiplexing order 1 and multiplexing order 2
When it is confirmed that the main buffer of D does not underflow, the minimum value of the called PTS1 is output to the SCR generation circuit 79, and the SCR generation circuit 79 changes the SCR based on this PTS1. VMB simulation circuit 7
4 is the D that is held according to the changed SCR value
Change and delete TS, AUV amount, and free space of VMB 204. Each of the AMB simulation circuits 76 and 78 matches the changed SCR value and holds the PT.
S1, PTS2, AU1 amount, AU2 amount, AMB207,
The respective free capacity of 209 is changed and deleted.

【0132】上記動作後、パック選択回路71は、AM
Bシミュレーション回路76に対し空き容量確認要求を
出力しMB204の空き容量確認を行う。AMB207
の空き容量が多重化対象オーディオESAS1のデータ
量より大きいことを確認したとき、オーディオESAS
1の多重化を行い多重化処理を終了する。また、AMB
207の空き容量が多重化対象オーディオESAS1の
データ量より小さいことを確認したとき、上述のパック
選択回路71によるSCR変更に伴う多重化順位1及び
多重化順位2のP−STDメインバッファのアンダフロ
ーの有無の確認及びSCRの変更、AMBシミュレーシ
ョン回路76の保持値の変更削除、AMBシミュレーシ
ョン回路76の保持値の変更削除、AMBシミュレーシ
ョン回路78の保持値の変更削除、パック選択回路71
によるAMB207の空き容量の確認という動作をオー
ディオESAS1が多重化できるまで繰り返す。
After the above operation, the pack selection circuit 71 is
A free space confirmation request is output to the B simulation circuit 76 to confirm the free space of the MB 204. AMB207
When it is confirmed that the free space of is larger than the data amount of the audio ESAS1 to be multiplexed, the audio ESAS
1 is multiplexed and the multiplexing process is completed. Also, AMB
When it is confirmed that the free capacity of 207 is smaller than the data amount of the multiplexing target audio ESAS1, the underflow of the P-STD main buffer of the multiplexing order 1 and the multiplexing order 2 due to the SCR change by the pack selection circuit 71 described above. Presence / absence confirmation and SCR change, AMB simulation circuit 76 holding value change deletion, AMB simulation circuit 76 holding value change deletion, AMB simulation circuit 78 holding value change deletion, pack selection circuit 71
The operation of confirming the free capacity of the AMB 207 is repeated until the audio ESAS 1 can be multiplexed.

【0133】多重化順位1、2及び3のオーディオES
AS2に対する多重化判断2の動作は、オーディオES
AS1をオーディオESAS2に、オーディオバッファ
5をオーディオバッファ6に、AB占有量確認回路75
をAB占有量確認回路77に、AMBシミュレーション
回路76をAMBシミュレーション回路78に、AMB
207をAMB209に、容量確認要求QCAS1を容
量確認要求QCAS2にそれぞれ読み替える他は、上述
の多重化順位1、2及び3のオーディオESAS1に対
する多重化判断2の動作と同一である。
Audio ES with multiplexing order 1, 2 and 3
The operation of the multiplexing decision 2 for the AS2 is the audio ES.
AS1 for audio ESAS2, audio buffer 5 for audio buffer 6, and AB occupied amount confirmation circuit 75
To the AB occupancy confirmation circuit 77, the AMB simulation circuit 76 to the AMB simulation circuit 78, and the AMB
The operation is the same as the operation of the multiplexing determination 2 for the audio ESAS1 having the multiplexing order 1, 2, and 3 described above, except that 207 is replaced with the AMB 209 and the capacity confirmation request QCAS1 is replaced with the capacity confirmation request QCAS2.

【0134】次に、図1、図2及び各部の処理をフロー
チャートで示す図3〜図8を参照して本実施の形態のプ
ログラムストリーム多重化装置の動作である本実施の形
態のプログラムストリーム多重化方法について詳細に説
明する。
Next, referring to FIGS. 1 and 2 and FIGS. 3 to 8 which show the processing of each unit in a flow chart, the operation of the program stream multiplexing apparatus of this embodiment, which is the operation of the program stream multiplexing of this embodiment, will be described. The method of conversion will be described in detail.

【0135】図3を参照すると、多重化順位付けステッ
プA1では、パック選択回路71は、上述したように、
VMBシミュレーション回路74が保持しているDTS
の最大値及びAMBシミュレーション回路76,78の
各々が保持しているPTS1,PTS2の各々の最大値
の計3つの最大値を比較し、最大値が小さいDTS/P
TS1/PTS2の各々に対応するESから優先的に多
重化する多重化順位付けを行う。
Referring to FIG. 3, in the multiplexing ordering step A1, the pack selection circuit 71, as described above,
DTS held by the VMB simulation circuit 74
And the maximum value of each of PTS1 and PTS2 held by each of the AMB simulation circuits 76 and 78, a total of three maximum values are compared, and DTS / P with the smallest maximum value is compared.
Multiplexing prioritization is performed from ES corresponding to each of TS1 / PTS2.

【0136】多重化順位が1のES(以下、多重化順位
1ES)のP−STDシミュレーション用のSCRの調
整を伴わない多重化判断1及び多重化について説明する
と、以降の説明では、多重化順位1ESがビデオESの
場合、バッファはビデオバッファ4、バッファ占有量確
認回路はVB占有量確認回路73、P−STDメインバ
ッファ(以下、MB)シミュレーション回路はVMBシ
ミュレーション回路74、P−STDのメインバッファ
はVMB204となる。また、多重化順位1ESがオー
ディオESAS1,ESAS2の場合、バッファはオー
ディオバッファ5,6、バッファ占有量確認回路はAB
占有量確認回路75,77、MBシミュレーション回路
はAMBシミュレーション回路76,78、P−STD
のメインバッファはAMB207,209となる。
The multiplexing judgment 1 and the multiplexing without the adjustment of the SCR for the P-STD simulation of the ES having the multiplexing order of 1 (hereinafter, the multiplexing order 1ES) will be described. In the following description, the multiplexing order will be described. When 1ES is a video ES, the buffer is the video buffer 4, the buffer occupancy confirmation circuit is the VB occupancy confirmation circuit 73, the P-STD main buffer (hereinafter MB) simulation circuit is the VMB simulation circuit 74, and the P-STD main buffer. Becomes VMB204. When the multiplexing order 1ES is audio ESAS1 and ESAS2, the buffers are audio buffers 5 and 6, and the buffer occupation confirmation circuit is AB.
Occupancy confirmation circuits 75 and 77, MB simulation circuits are AMB simulation circuits 76 and 78, P-STD
The main buffers of AMB are 207 and 209.

【0137】多重化順位1ESの多重化判断ステップA
2で、パック選択回路71は、多重化するためのデータ
量のES(以下、多重化対象ES)が多重化順位1ES
のバッファに存在するかを判断するため、多重化順位1
ESのバッファ占有量確認回路に対し容量確認要求を出
力し容量確認を行う。すなわち、多重化順位1ESのバ
ッファ占有量≧多重化順位1ESの多重化量であるかを
確認する。
Multiplexing judgment step A of multiplexing order 1 ES
2, the pack selection circuit 71 determines that the ES of the data amount for multiplexing (hereinafter, the ES to be multiplexed) has the multiplexing order of 1 ES.
1 to determine whether or not it exists in the buffer
A capacity confirmation request is output to the ES buffer occupancy confirmation circuit to confirm the capacity. That is, it is confirmed whether or not the buffer occupation amount of the multiplexing order 1ES ≧ the multiplexing amount of the multiplexing order 1ES.

【0138】ステップA2で、多重化対象ESが多重化
順位1ESのバッファに存在しないことを確認した場
合、多重化順位1ESの多重化判断1を終了し、分岐B
以降の多重化順位2ESの多重化判断1に進む。
If it is confirmed in step A2 that the target ES to be multiplexed does not exist in the buffer of the multiplexing order 1ES, the multiplexing judgment 1 of the multiplexing order 1ES is terminated, and the branch B is executed.
Then, the process proceeds to the multiplexing determination 1 of the multiplexing order 2ES.

【0139】ステップA2で、多重化対象ESが多重化
順位1ESのバッファに存在することを確認した場合、
ステップA3〜A7の多重化可能性判断処理に進み、多
重化順位1ESのP−STDのメインバッファがそのE
Sを入力してもオーバフローもアンダフローも起こさず
多重化が可能であることを判断する。
In step A2, when it is confirmed that the ES to be multiplexed exists in the buffer of the multiplexing order 1ES,
Proceeding to the multiplexing possibility judgment processing of steps A3 to A7, the main buffer of the P-STD with the multiplexing order of 1ES is the E
Even if S is input, it is judged that neither overflow nor underflow can occur and multiplexing is possible.

【0140】まず、MB空き容量確認ステップA3で、
パック選択回路71は、多重化順位1ESのMBシミュ
レーション回路に対して空き容量確認要求を出力し、こ
の空き容量確認要求に対する応答である空き容量を入力
しこの値を空き容量1とする。空き容量2算出ステップ
A4で、空き容量1から多重化順位1ESの多重化ES
量を減算し、空き容量2を算出する。
First, in the MB free space confirmation step A3,
The pack selection circuit 71 outputs a free space confirmation request to the MB simulation circuit of the multiplexing order 1ES, inputs a free space as a response to this free space confirmation request, and sets this value as the free space 1. In the free space 2 calculation step A4, the multiplexing ES from the free space 1 to the multiplexing order 1 ES
The amount is subtracted, and the free space 2 is calculated.

【0141】削除AU量呼出ステップA5で、パック選
択回路71は、多重化を行うときに付加するSCRを多
重化順位1ESのMBシミュレーション回路に出力す
る。多重化順位1ESのMBシミュレーション回路は、
入力したSCRで多重化順位1ESのP−STDメイン
バッファから削除されるAU量を呼び出しパック選択回
路71に出力する。
At the deletion AU amount calling step A5, the pack selection circuit 71 outputs the SCR added at the time of multiplexing to the MB simulation circuit of the multiplexing order 1ES. The MB simulation circuit with the multiplexing order of 1 ES is
The AU amount deleted from the P-STD main buffer having the multiplexing order of 1ES by the input SCR is output to the call pack selection circuit 71.

【0142】空き容量3算出ステップA6で、パック選
択回路71は、空き容量2にAU量を加算する。この値
を空き容量3とする。空き容量3は多重化順位1ESを
多重化したときのこのESのP−STDメインバッファ
の空き容量を示す。
In the free space 3 calculation step A6, the pack selection circuit 71 adds the AU amount to the free space 2. This value is used as the free space 3. The free capacity 3 indicates the free capacity of the P-STD main buffer of this ES when the multiplexing order 1 ES is multiplexed.

【0143】多重化順位1ESのMB容量判断ステップ
A7で、パック選択回路71は、空き容量3が多重化順
位1ESのP−STDメインバッファ容量(MB容量)
内か判断する。
In the MB capacity determination step A7 of the multiplexing order 1ES, the pack selection circuit 71 determines that the free capacity 3 is the P-STD main buffer capacity (MB capacity) of the multiplexing order 1ES.
Determine if it is inside.

【0144】ステップA7で、空き容量3が多重化順位
1ESのMB容量を超えている場合、多重化順位1ES
の多重化判断1を終了し、分岐B以降の多重化順位2E
Sの多重化判断1に進む。
At step A7, when the free capacity 3 exceeds the MB capacity of the multiplexing order 1ES, the multiplexing order 1ES
End the multiplexing judgment 1 of the
Proceed to S multiplexing determination 1.

【0145】ステップA7で、空き容量3が多重化順位
1ESのMB容量内である場合、多重化順位1ESを多
重化しても多重化順位1ESのMBはオーバフローもア
ンダフローも発生しないとして、ステップA8〜A12
で、多重化順位1ESの多重化を行う。
If the empty capacity 3 is within the MB capacity of the multiplexing order 1ES in step A7, it is assumed that the MB of the multiplexing order 1ES does not overflow or underflow even if the multiplexing order 1ES is multiplexed. ~ A12
Then, the multiplexing of the multiplexing order 1ES is performed.

【0146】出力ES量指示ステップA8で、パック選
択回路71は、多重化順位1ESのバッファに多重化回
路72に対して出力するESデータ量(以下、ES量)
を指示する。多重化順位1ESのバッファはその指示を
受けて、指示されたES量を多重化回路72に出力す
る。
In the output ES amount instruction step A8, the pack selection circuit 71 outputs the ES data amount to the multiplexing circuit 72 in the buffer of the multiplexing order 1ES (hereinafter, ES amount).
Instruct. The buffer of the multiplexing order 1ES receives the instruction and outputs the instructed ES amount to the multiplexing circuit 72.

【0147】SCRとESパラメータ出力ステップA9
で、パック選択回路71は、PSに付加するSCRを多
重化回路72に出力する。また多重化対象ESにAUの
先頭が含まれている場合、多重化順位1ESの種類によ
り次のパラメータを多重化回路72に出力する。多重化
順位1ESがオーディオESAS1又はESAS2(以
下、オーディオESAS1/ESAS2)の場合、PT
S、AU量を多重化回路72に出力する。多重化順位1
ESがビデオESの場合、PTS、DTS、AU量、ピ
クチャタイプを多重化回路72に出力する。
SCR and ES parameter output step A9
Then, the pack selection circuit 71 outputs the SCR added to PS to the multiplexing circuit 72. When the ES to be multiplexed includes the head of AU, the following parameters are output to the multiplexing circuit 72 depending on the type of the multiplexing order 1ES. If the multiplexing order 1ES is audio ESAS1 or ESAS2 (hereinafter, audio ESAS1 / ESAS2), PT
The S and AU amounts are output to the multiplexing circuit 72. Multiplexing order 1
When the ES is a video ES, the PTS, DTS, AU amount, and picture type are output to the multiplexing circuit 72.

【0148】シミュレーション用SCR生成ステップA
10で、パック選択回路71は、PSに付加するSCR
をSCR生成回路79に出力する。
Simulation SCR Generation Step A
At 10, the pack selection circuit 71 adds the SCR to the PS.
Is output to the SCR generation circuit 79.

【0149】多重化対象ES量・パラメータ出力ステッ
プA11で、パック選択回路71は、多重化対象のES
量を多重化順位1ESのMBシミュレーション回路に出
力する。また多重化対象ESにAUの先頭が含まれてい
る場合、多重化順位1ESの種類により次のパラメータ
を多重化順位1ESのMBシミュレーション回路に出力
する。すなわち、多重化順位1ESがオーディオ1ES
/ESAS2の場合、PTS、AU量を出力し、ビデオ
ESの場合、DTS、AU量を出力する。
Amount of ES to be multiplexed / parameter output In step A11, the pack selection circuit 71 determines the ES to be multiplexed.
The quantity is output to the MB simulation circuit with the multiplexing order of 1 ES. When the ES to be multiplexed includes the head of AU, the following parameters are output to the MB simulation circuit having the multiplexing order of 1ES depending on the type of the multiplexing order of 1ES. That is, the multiplexing order 1ES is audio 1ES
In the case of / ESAS2, the PTS and AU amount are output, and in the case of the video ES, the DTS and AU amount are output.

【0150】SCR加算値の加算ステップA12で、パ
ック選択回路71は、SCRにSCR加算値を加算し保
持する。
At step S12 of adding the SCR added value, the pack selection circuit 71 adds and holds the SCR added value to the SCR.

【0151】多重化回路72は、入力されたES、SC
R、PTS、DTS、AU量、ピクチャタイプに基づき
多重化を行い、PSを出力する。
The multiplexing circuit 72 receives the input ES, SC
Multiplexing is performed based on R, PTS, DTS, AU amount, and picture type, and PS is output.

【0152】多重化順位1ESのMBシミュレーション
回路は、多重化順位1ESのP−STDのメインバッフ
ァの空き容量から入力されたES量を減算する。多重化
順位1ESがビデオESのとき、MBシミュレーション
回路は入力したDTSとAU量を関連付けて保持する。
多重化順位1ESがオーディオ1ES/ESAS2のと
き、MBシミュレーション回路は入力したPTSとAU
量を関連付けて保持する。
The MB simulation circuit having the multiplexing order of 1 ES subtracts the input ES amount from the free space of the main buffer of the P-STD having the multiplexing order of 1 ES. When the multiplexing order 1ES is a video ES, the MB simulation circuit holds the input DTS and AU amount in association with each other.
When the multiplexing order 1ES is audio 1ES / ESAS2, the MB simulation circuit receives the input PTS and AU.
Associate and hold quantities.

【0153】上述したように、VMBシミュレーション
回路74は、SCRとVMBシミュレーション回路74
に保持しているDTSを比較し、DTSの方が小さいと
き、VMB204の空き容量にDTSに関連するAU量
を加算し、DTSの方が大きいとき、そのDTS及びそ
のDTSに関連するAU量を削除する。
As described above, the VMB simulation circuit 74 uses the SCR and VMB simulation circuit 74.
When the DTS is smaller, the AU amount related to the DTS is added to the free capacity of the VMB 204, and when the DTS is larger, the DTS and the AU amount related to the DTS are compared. delete.

【0154】AMBシミュレーション回路76/78
は、SCRとAMBシミュレーション回路76,78の
各々に保持しているPTS1/PTS2を比較し、PT
S1/PTS2の方が小さいとき、AMB207/20
9の空き容量に、PTS1/PTS2に関連するAU1
量/AU2量を加算し、PTS1/PTS2の方が大き
いときそのPTS1/PTS2及びPTS1/PTS2
に関連するAU量を削除する。
AMB simulation circuit 76/78
Compares the SCR with PTS1 / PTS2 held in each of the AMB simulation circuits 76 and 78,
AMB207 / 20 when S1 / PTS2 is smaller
9 free space, AU1 associated with PTS1 / PTS2
Amount / AU2 amount is added, and when PTS1 / PTS2 is larger, PTS1 / PTS2 and PTS1 / PTS2
Delete the AU amount associated with.

【0155】以下の説明では、上述のSCR設定値変更
に伴う、VMBシミュレーション回路74及びAMBシ
ミュレーション回路76,78の各々に保持しているパ
ラメータ値の変更、削除の動作を、各MBシミュレーシ
ョン回路は変更後のSCRの値に合わせ保持値の変更を
行うと記述する。
In the following description, the operation of changing and deleting the parameter value held in each of the VMB simulation circuit 74 and the AMB simulation circuits 76 and 78 in accordance with the above-mentioned change of the SCR set value is performed by each MB simulation circuit. It is described that the held value is changed according to the changed SCR value.

【0156】次に、分岐Bの処理である多重化順位2E
Sの多重化判断1及び多重化をフローチャートで示す図
4を参照して多重化順位2ESの多重化判断1及び多重
化について説明すると、まず、多重化順位2ESの多重
化判断ステップB1で、パック選択回路71は、多重化
対象ESが、多重化順位が2のES(多重化順位2E
S)のバッファに存在するか判断するため、多重化順位
2ESのバッファ占有量確認回路に対し容量確認要求を
出力し容量確認を行う。すなわち、多重化順位2ESの
バッファ占有量≧多重化順位1ESの多重化量であるか
を確認する。
Next, the multiplexing order 2E which is the processing of the branch B
The multiplexing judgment 1 and multiplexing of the multiplexing order 2ES will be described with reference to FIG. 4 which is a flowchart showing the multiplexing judgment 1 and multiplexing of S. First, in the multiplexing judgment step B1 of the multiplexing order 2ES, the pack is determined. The selection circuit 71 determines that the ES to be multiplexed is an ES whose multiplexing order is 2 (multiplexing order 2E).
In order to determine whether or not it exists in the buffer of S), a capacity confirmation request is output to the buffer occupancy confirmation circuit of the multiplexing order 2ES to confirm the capacity. That is, it is confirmed whether or not the buffer occupation amount of the multiplexing order 2ES ≧ the multiplexing amount of the multiplexing order 1ES.

【0157】ステップB1で、パック選択回路71は、
多重化対象ES量が多重化順位2ESのバッファに存在
しないことを確認した場合、多重化順位2ESの多重化
判断1を終了し、分岐C以降の多重化順位3ESの多重
化判断1に進む。
At step B1, the pack selection circuit 71
If it is confirmed that the amount of ES to be multiplexed does not exist in the buffer of the multiplexing order 2ES, the multiplexing judgment 1 of the multiplexing order 2ES is ended, and the process proceeds to the multiplexing judgment 1 of the multiplexing order 3ES after the branch C.

【0158】ステップB1で、パック選択回路71は、
多重化対象ES量が多重化順位2ESのバッファに存在
することを確認した場合、ステップB2〜B6に進み、
多重化順位2ESのP−STDのメインバッファ(M
B)がそのESを入力してもオーバフローもアンダフロ
ーも起こさないか判断する。
At step B1, the pack selection circuit 71
When it is confirmed that the amount of ES to be multiplexed exists in the buffer of the multiplexing order 2ES, the process proceeds to steps B2 to B6,
P-STD main buffer (M
Even if B) inputs the ES, it judges whether neither overflow nor underflow will occur.

【0159】まず、MB空き容量確認ステップB2で、
パック選択回路71は、多重化順位2ESのMBシミュ
レーション回路に対して空き容量確認要求を出力し、こ
の空き容量確認要求に対する応答である空き容量を入力
し、この値を空き容量4とする。空き容量5算出ステッ
プB3で、空き容量4から多重化順位2ESの多重化E
S量を減算し、空き容量5を算出する。
First, in the MB free space confirmation step B2,
The pack selection circuit 71 outputs a free space confirmation request to the MB simulation circuit of the multiplexing order 2ES, inputs a free space as a response to this free space confirmation request, and sets this value as the free space 4. In the free space 5 calculation step B3, the multiplexing E from the free space 4 to the multiplexing order 2ES is performed.
The free space 5 is calculated by subtracting the S amount.

【0160】削除AU量呼出ステップB4で、パック選
択回路71は、多重化を行うときに付加するSCRを多
重化順位2ESのMBシミュレーション回路に出力す
る。多重化順位2ESのMBシミュレーション回路は、
入力したSCRで多重化順位2ESのMBから削除され
るAU量を呼び出しパック選択回路71に出力する。
In the deletion AU amount calling step B4, the pack selection circuit 71 outputs the SCR added when the multiplexing is performed to the MB simulation circuit of the multiplexing order 2ES. The MB simulation circuit of multiplexing order 2ES is
The AU amount deleted from the MB of the multiplexing order 2ES by the input SCR is output to the call pack selection circuit 71.

【0161】空き容量6算出ステップB5で、パック選
択回路71は、空き容量5にAU量を加算し空き容量6
を算出する。空き容量6は多重化順位2ESを多重化し
たときのこのESのMBの空き容量を示している。
In the free space 6 calculation step B5, the pack selection circuit 71 adds the AU amount to the free space 5 to calculate the free space 6
To calculate. The free space 6 indicates the free space of the MB of this ES when the multiplexing order 2 ES is multiplexed.

【0162】多重化順位2ESのMB容量判断ステップ
B6で、パック選択回路71は、空き容量6が多重化順
位2ESのMB容量内にあるかを判断する。
In the MB capacity judgment step B6 of the multiplexing order 2ES, the pack selection circuit 71 judges whether the empty capacity 6 is within the MB capacity of the multiplexing order 2ES.

【0163】ステップB6で、空き容量6が多重化順位
2ESのMB容量を超えている場合、多重化順位2ES
の多重化判断1を終了し、分岐C以降の多重化順位3E
Sの多重化判断1に進む。
At step B6, when the free space 6 exceeds the MB capacity of the multiplexing order 2ES, the multiplexing order 2ES
End the multiplexing determination 1 of the
Proceed to S multiplexing determination 1.

【0164】ステップB6で、空き容量6が多重化順位
2ESのMB容量内である場合、多重化順位2ESを多
重化しても多重化順位2ESのMBはオーバフローもア
ンダフローも発生しないとして、ステップB7〜B11
で、多重化順位2ESの多重化を行う。
If the free capacity 6 is within the MB capacity of the multiplexing order 2ES in step B6, it is assumed that neither overflow nor underflow occurs in the MB of the multiplexing order 2ES even if the multiplexing order 2ES is multiplexed. ~ B11
Then, the multiplexing of the multiplexing order 2ES is performed.

【0165】出力ES量指示ステップB7で、パック選
択回路71は、多重化順位2ESのバッファに多重化回
路72に対して出力するES量を指示する。多重化順位
2ESのバッファはその指示を受けて、指示されたES
量を多重化回路72に出力する。
In the output ES amount instructing step B7, the pack selection circuit 71 instructs the buffer of the multiplexing order 2 ES to output the ES amount to the multiplexing circuit 72. The buffer of the multiplexing order 2ES receives the instruction, and receives the instructed ES.
The quantity is output to the multiplexing circuit 72.

【0166】SCRとESパラメータ出力ステップB8
で、パック選択回路71は、PSに付加するSCRを多
重化回路72に出力する。また多重化対象ESにAUの
先頭が含まれている場合、上述した多重化順位1ESの
場合と同様の多重化順位2ESの種類に基づく各パラメ
ータ、すなわち、PTS、DTS、AU量、ピクチャタ
イプを多重化回路72に出力する。
SCR and ES parameter output step B8
Then, the pack selection circuit 71 outputs the SCR added to PS to the multiplexing circuit 72. When the multiplexing target ES includes the head of the AU, the parameters based on the type of the multiplexing order 2ES similar to the case of the multiplexing order 1ES described above, that is, PTS, DTS, AU amount, and picture type are set. Output to the multiplexing circuit 72.

【0167】シミュレーション用SCR生成ステップB
9で、パック選択回路71は、PSに付加するSCRを
SCR生成回路79に出力する。
Simulation SCR Generation Step B
At 9, the pack selection circuit 71 outputs the SCR added to PS to the SCR generation circuit 79.

【0168】多重化対象ES量・パラメータ出力ステッ
プB10で、パック選択回路71は、多重化対象のES
量を多重化順位2ESのMBシミュレーション回路に出
力する。また多重化対象ESにAUの先頭が含まれてい
る場合、上述した多重化順位1ESの場合と同様の多重
化順位2ESの種類に基づく各パラメータ、すなわち、
PTS、DTS、AU量、ピクチャタイプを出力する。
In the step B10 of outputting the amount / parameter of the multiplexing target ES, the pack selection circuit 71 determines the ES of the multiplexing target.
The quantity is output to the MB simulation circuit of multiplexing order 2ES. When the ES to be multiplexed includes the head of AU, each parameter based on the type of multiplexing order 2ES similar to the case of multiplexing order 1ES described above, that is,
The PTS, DTS, AU amount, and picture type are output.

【0169】SCR加算値の加算ステップB11で、パ
ック選択回路71は、SCRにSCR加算値を加算し保
持する。
In step S11 of adding the SCR added value, the pack selection circuit 71 adds and holds the SCR added value to the SCR.

【0170】多重化回路72は、入力ES、SCR、P
TS、DTS、AU量、ピクチャタイプにから多重化を
行い、PSを出力する。
The multiplexing circuit 72 receives inputs ES, SCR, P
Multiplexing is performed based on TS, DTS, AU amount, and picture type, and PS is output.

【0171】多重化順位2ESのMBシミュレーション
回路は、多重化順位2ESのMBの空き容量から入力E
S量を減算する。多重化順位2ESがビデオESのと
き、MBシミュレーション回路は入力AU量とDTSを
関連付けて保持する。多重化順位2ESがオーディオ1
ES/ESAS2のとき、MBシミュレーション回路は
入力したAU量とPTSを関連付けて保持する。各MB
シミュレーション回路は、変更されたSCRの値に合わ
せ、保持値の変更を行う。
The MB simulation circuit of the multiplexing order 2ES inputs the input E from the free space of the MB of the multiplexing order 2ES.
Subtract the S amount. When the multiplexing order 2ES is the video ES, the MB simulation circuit holds the input AU amount and the DTS in association with each other. Multiplexing order 2 ES is audio 1
In the case of ES / ESAS2, the MB simulation circuit holds the input AU amount and PTS in association with each other. Each MB
The simulation circuit changes the held value according to the changed SCR value.

【0172】次に、分岐Cの処理である多重化順位3E
Sの多重化判断1及び多重化をフローチャートで示す図
5を参照して多重化順位3ESの多重化判断1及び多重
化について上述の多重化順位2ESの多重化判断1及び
多重化との相違点を重点的に説明すると、この多重化順
位3ESの多重化判断1及び多重化は、以下の説明を除
き、多重化順位2ESを多重化順位3ESに、ステップ
B1〜B11の各々をステップC1〜C11の各々に、
空き容量4,5,6を空き容量7,8,9にそれぞれ読
み替えることにより、多重化順位2ESの多重化判断1
及び多重化の動作と同一である。
Next, the multiplexing order 3E which is the processing of the branch C
5 is a flow chart showing the multiplexing decision 1 and the multiplexing of S. With reference to FIG. 5, the multiplexing decision 1 and the multiplexing of the multiplexing order 3 ES are different from the multiplexing determination 1 and the multiplexing of the above-mentioned multiplexing order 2 ES. Except for the following description, the multiplexing judgment 1ES and the multiplexing of the multiplexing order 3ES will be explained with emphasis on the multiplexing order 2ES and the steps C1 to C11. To each of
By replacing the free capacities 4, 5, 6 with the free capacities 7, 8, 9 respectively, the multiplexing judgment 1 of the multiplexing order 2ES
And the operation of multiplexing is the same.

【0173】まず、多重化順位3ESの多重化判断ステ
ップC1で、パック選択回路71は、多重化順位3ES
のバッファ占有量確認回路に対し容量確認を行い、多重
化対象ES量が多重化順位3ESのバッファに存在しな
いことを確認した場合、多重化順位3ESの多重化判断
1を終了し、分岐D以降の多重化順位1ESの多重化判
断2に進む。
First, in the multiplexing determination step C1 of the multiplexing order 3ES, the pack selection circuit 71 determines that the multiplexing order 3ES
If the capacity of the buffer occupancy confirmation circuit of No. 3 is confirmed and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer having the multiplexing order of 3ES, the multiplexing judgment 1 of the multiplexing order of 3ES is ended, and the branch D or later is performed. Proceed to the multiplexing determination 2 of the multiplexing order 1ES.

【0174】ステップC1で、パック選択回路71は、
多重化対象ES量が多重化順位3ESのバッファに存在
することを確認した場合、多重化順位2ESの場合と同
様の処理であるステップC2〜C6に進み、多重化順位
3ESのMBがそのESを入力してもオーバフローもア
ンダフローも起こさないか判断する。
At step C1, the pack selection circuit 71
When it is confirmed that the amount of ES to be multiplexed exists in the buffer of the multiplexing order 3ES, the process proceeds to steps C2 to C6 which are the same processing as in the case of the multiplexing order 2ES, and the MB of the multiplexing order 3ES stores the ES. Judge whether overflow or underflow will occur even if input.

【0175】多重化順位3ESのMB容量判断ステップ
C6で、パック選択回路71は、空き容量9が多重化順
位3ESのMB容量内にあるかを判断する。
At the capacity determination step C6 of the multiplexing order 3ES, the pack selection circuit 71 determines whether the empty capacity 9 is within the MB capacity of the multiplexing order 3ES.

【0176】ステップC6で、空き容量9が多重化順位
3ESのMB容量を超えている場合、多重化順位3ES
の多重化判断1を終了し、分岐D以降の多重化順位1E
Sの多重化判断2に進む。
At step C6, when the free capacity 9 exceeds the MB capacity of the multiplexing order 3ES, the multiplexing order 3ES
End the multiplexing determination 1 of the
Proceed to S multiplexing determination 2.

【0177】ステップC6で、空き容量9が多重化順位
3ESのMB容量内である場合、多重化順位3ESを多
重化しても多重化順位3ESのMBはオーバフローもア
ンダフローも発生しないとして、多重化順位2ESの場
合と同様の処理であるステップC7〜C11で、多重化
順位3ESの多重化を行う。
In step C6, if the free capacity 9 is within the MB capacity of the multiplexing order 3ES, it is determined that the MB of the multiplexing order 3ES will not overflow or underflow even if the multiplexing order 3ES is multiplexed. In steps C7 to C11, which are the same processes as in the case of the rank 2ES, the multiplexing of the rank 3ES is performed.

【0178】多重化回路72は、入力ES、SCR、P
TS、DTS、AU量、ピクチャタイプにから多重化を
行い、PSを出力する。
The multiplexing circuit 72 has inputs ES, SCR, P
Multiplexing is performed based on TS, DTS, AU amount, and picture type, and PS is output.

【0179】各MBシミュレーション回路は、変更され
たSCRの値に合わせ、保持値の変更を行う。
Each MB simulation circuit changes the held value according to the changed SCR value.

【0180】次に、分岐Dの処理である多重化順位1E
Sの多重化判断2及び多重化をフローチャートで示す図
6を参照して多重化順位1ESの多重化判断2及び多重
化について上述の多重化順位1ESの多重化判断1及び
多重化との相違点を重点的に説明すると、まず、多重化
順位1ESの多重化判断ステップD1で、パック選択回
路71は、多重化対象ESが多重化順位1ESのバッフ
ァに存在するかを判断するため、多重化順位1ESのバ
ッファ占有量確認回路に対し容量確認要求を出力し容量
確認を行う。すなわち、多重化順位1ESのバッファ占
有量≧多重化順位1ESの多重化量であるかを確認す
る。
Next, the multiplexing order 1E which is the processing of the branch D
6 is a flowchart showing the multiplexing decision 2 and the multiplexing of S. With reference to FIG. 6, the multiplexing decision 2 of the multiplexing order 1 ES and the multiplexing are different from the multiplexing decision 1 of the multiplexing order 1 ES and the multiplexing described above. First, in the multiplexing determination step D1 of the multiplexing order 1ES, the pack selection circuit 71 determines whether the target ES to be multiplexed exists in the buffer of the multiplexing order 1ES. The capacity confirmation request is output to the 1ES buffer occupancy confirmation circuit to confirm the capacity. That is, it is confirmed whether or not the buffer occupation amount of the multiplexing order 1ES ≧ the multiplexing amount of the multiplexing order 1ES.

【0181】ステップD1で、多重化対象ESが多重化
順位1ESのバッファに存在しないことを確認した場
合、多重化順位1ESの多重化判断1を終了し、分岐E
以降の多重化順位2ESの多重化判断1に進む。
If it is confirmed in step D1 that the target ES to be multiplexed does not exist in the buffer having the multiplexing order of 1ES, the multiplexing judgment 1 of the multiplexing order of 1ES is ended and the branch E is executed.
Then, the process proceeds to the multiplexing determination 1 of the multiplexing order 2ES.

【0182】ステップD1で、多重化対象ESが多重化
順位1ESのバッファに存在することを確認した場合、
ステップD2〜D4に進み、SCRを調整して多重化順
位1ESのMBの空き容量を大きくする。
If it is confirmed in step D1 that the multiplexing target ES exists in the buffer of the multiplexing order 1ES,
Proceeding to steps D2 to D4, the SCR is adjusted to increase the free space of the MB of the multiplexing order 1ES.

【0183】まず、MB空き容量確認ステップD2で、
パック選択回路71は、多重化順位1ESのMBシミュ
レーション回路に対して最小値確認要求を出力し、多重
化順位1ESがオーディオ1ES/ESAS2の場合、
対応のMBシミュレーション回路は、最小値確認要求に
対しPTSの最小値をパック選択回路71に応答する。
多重化順位1ESがビデオESの場合、対応のMBシミ
ュレーション回路は、最小値確認要求に対しDTSの最
小値をパック選択回路71に応答する。
First, in the MB free space confirmation step D2,
The pack selection circuit 71 outputs a minimum value confirmation request to the MB simulation circuit of the multiplexing order 1ES, and when the multiplexing order 1ES is audio 1ES / ESAS2,
The corresponding MB simulation circuit responds to the minimum value confirmation request with the minimum value of PTS to the pack selection circuit 71.
When the multiplexing order 1ES is the video ES, the corresponding MB simulation circuit responds to the minimum value confirmation request with the minimum value of DTS to the pack selection circuit 71.

【0184】SCR変更ステップD3で、パック選択回
路71は、保持しているSCRに入力したPTS/DT
Sを設定してSCRを変更すると共に、このPTS/D
TSをSCR生成回路79に出力する。各MBシミュレ
ーション回路は、変更されたSCRの値に合わせ、保持
値の変更を行う。
At the SCR change step D3, the pack selection circuit 71 inputs the PTS / DT input to the held SCR.
While setting S to change SCR, this PTS / D
The TS is output to the SCR generation circuit 79. Each MB simulation circuit changes the held value according to the changed SCR value.

【0185】MB空き容量確認ステップD4で、多重化
順位1ESのMBシミュレーション回路に対して空き容
量確認要求を出力し、この空き容量確認要求に対する応
答である空き容量を入力しこの値を空き容量10とす
る。
At MB free space confirmation step D4, a free space confirmation request is output to the MB simulation circuit having the multiplexing order of 1ES, a free space which is a response to the free space confirmation request is input, and this value is set as the free space 10 And

【0186】空き容量判断ステップD5で、パック選択
回路71は、空き容量10が多重化順位1ESの多重化
ES量より大きいか判断する。
In the free space determination step D5, the pack selection circuit 71 determines whether or not the free space 10 is larger than the multiplexing ES amount of the multiplexing order 1ES.

【0187】ステップD5で、空き容量10より多重化
順位1ESの多重化ES量が大きい場合、ステップD2
〜D5の処理を、空き容量10が多重化順位1ESの多
重化ES量より大きくなるまで繰り返す。
If it is determined in step D5 that the multiplexing ES amount of the multiplexing order 1ES is larger than the free space 10, step D2
The processes from to D5 are repeated until the free space 10 becomes larger than the multiplexing ES amount of the multiplexing order 1ES.

【0188】ステップD5で、空き容量10が多重化順
位1ESの多重化ES量より大きい場合、ステップD6
〜D9に進み、多重化順位1ESの多重化を行う。
At step D5, when the free space 10 is larger than the multiplexing ES amount of the multiplexing order 1ES, step D6
~ D9, the multiplexing of the multiplexing order 1ES is performed.

【0189】出力ES量指示ステップD6で、パック選
択回路71は、多重化順位1ESのバッファに多重化回
路72に対して出力するES量を指示する。多重化順位
1ESのバッファはその指示を受けて、指示された量の
ESを多重化回路72に出力する。
In the output ES amount instructing step D6, the pack selection circuit 71 instructs the buffer of the multiplexing order 1 ES to output the ES amount to the multiplexing circuit 72. In response to the instruction, the buffer having the multiplexing order of 1 ES outputs the instructed amount of ES to the multiplexing circuit 72.

【0190】SCRとESパラメータ出力ステップD7
で、パック選択回路71は、PSに付加するSCRを多
重化回路72に出力する。また多重化対象ESにAUの
先頭が含まれている場合、上述した多重化順位1ESの
多重化判断1の場合と同様の多重化順位1ESの種類に
基づく各パラメータ、すなわち、PTS、DTS、AU
量、ピクチャタイプを多重化回路72に出力する。
SCR and ES parameter output step D7
Then, the pack selection circuit 71 outputs the SCR added to PS to the multiplexing circuit 72. When the ES to be multiplexed includes the head of an AU, each parameter based on the type of the multiplexing order 1ES, that is, PTS, DTS, and AU similar to the case of the multiplexing determination 1 of the multiplexing order 1ES described above.
The amount and picture type are output to the multiplexing circuit 72.

【0191】多重化対象ES量・パラメータ出力ステッ
プD8で、パック選択回路71は多重化対象ES量を多
重化順位1ESのMBシミュレーション回路に出力す
る。また多重化対象ESにAUの先頭が含まれている場
合、多重化順位1ESの種類により次のパラメータを多
重化順位1ESのMBシミュレーション回路に出力す
る。多重化順位1ESがオーディオESAS1/ESA
S2の場合、PTSとAU量を多重化順位1ESのMB
シミュレーション回路に出力する。多重化順位1ESが
ビデオESの場合、DTSとAU量を多重化順位1ES
のMBシミュレーション回路に出力する。
In a step D8 of outputting the amount of ES to be multiplexed, the pack selection circuit 71 outputs the amount of ES to be multiplexed to the MB simulation circuit having the multiplexing order of 1 ES. When the ES to be multiplexed includes the head of AU, the following parameters are output to the MB simulation circuit having the multiplexing order of 1ES depending on the type of the multiplexing order of 1ES. Multiplexing order 1 ES is audio ESAS1 / ESA
In the case of S2, PTS and AU amount are multiplexed in MB of priority 1ES
Output to the simulation circuit. If the multiplexing order 1ES is a video ES, the DTS and AU amount are set to the multiplexing order 1ES.
Output to the MB simulation circuit.

【0192】SCR加算値の加算ステップD9で、パッ
ク選択回路71は、SCRにSCR加算値を加算し保持
する。
At the step S9 of adding the SCR added value, the pack selection circuit 71 adds and holds the SCR added value to the SCR.

【0193】多重化回路72は、入力ES、SCR、P
TS、DTS、AU量、ピクチャタイプから多重化を行
い、PSを出力する。
The multiplexing circuit 72 has inputs ES, SCR, P
Multiplexing is performed from TS, DTS, AU amount, and picture type, and PS is output.

【0194】各MBシミュレーション回路は、変更され
たSCRの値に合わせ、保持値の変更を行う。
Each MB simulation circuit changes the held value according to the changed SCR value.

【0195】次に、分岐Eの処理である多重化順位2E
Sの多重化判断2及び多重化をフローチャートで示す図
7を参照して多重化順位2ESの多重化判断2及び多重
化について上述の多重化順位1ESの多重化判断2及び
多重化との相違点を重点的に説明すると、この多重化順
位2ESの多重化判断2及び多重化は、以下の説明を除
き、多重化順位1ESを多重化順位2ESに、ステップ
D1,D4,D5,D6,D7,D8,D9をステップ
E1,E4,E5,E6,E7,E8,E9に、空き容
量10を空き容量11にそれぞれ読み替えることによ
り、多重化順位1ESの多重化判断2及び多重化の動作
と同一である。
Next, the multiplexing order 2E which is the processing of the branch E
7 is a flowchart showing S multiplexing decision 2 and multiplexing. With reference to FIG. 7, regarding multiplexing decision 2 and multiplexing of multiplexing order 2 ES, the difference from multiplexing decision 2 and multiplexing of multiplexing order 1 ES described above Except for the following description, the multiplexing determination 2 and the multiplexing of the multiplexing order 2ES will be explained by focusing on the multiplexing order 1ES to the multiplexing order 2ES, and steps D1, D4, D5, D6, D7, By replacing D8, D9 with steps E1, E4, E5, E6, E7, E8, E9 and free space 10 with free space 11, respectively, the same operation as the multiplexing judgment 2 and the multiplexing operation of the multiplexing order 1ES can be performed. is there.

【0196】まず、多重化順位2ESの多重化判断ステ
ップE1で、パック選択回路71は、多重化順位2ES
のバッファ占有量確認回路に対し容量確認を行い、多重
化対象ES量が多重化順位2ESのバッファに存在しな
いことを確認した場合、多重化順位2ESの多重化判断
2を終了し、分岐F以降の多重化順位3ESの多重化判
断2に進む。
First, in the multiplexing determination step E1 of the multiplexing order 2ES, the pack selection circuit 71 determines the multiplexing order 2ES.
When the capacity of the buffer occupancy confirmation circuit of No. 2 is confirmed and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer of the multiplexing order 2ES, the multiplexing judgment 2 of the multiplexing order 2ES is finished, and the branch F and subsequent steps are performed. Proceed to the multiplexing judgment 2 of the multiplexing order 3ES.

【0197】ステップE1で、パック選択回路71は、
多重化対象ES量が多重化順位2ESのバッファに存在
することを確認した場合、後述のステップE12〜E1
4で、SCRを調整して多重化順位2ESのMBの空き
容量を大きくしたときに、多重化順位2ESのMBがア
ンダフローしないかを確認する。
At step E1, the pack selection circuit 71
When it is confirmed that the amount of ES to be multiplexed exists in the buffer of the multiplexing order 2ES, steps E12 to E1 described later are performed.
In step 4, it is checked whether the MB of the multiplexing order 2ES does not underflow when the free space of the MB of the multiplexing order 2ES is increased by adjusting the SCR.

【0198】まず、MB最小値確認ステップE12で、
パック選択回路71は、多重化順位2ESのMBシミュ
レーション回路から最小値確認要求に対する応答として
PTS/DTSの最小値を受領する。この値を仮SCR
1と記述する。
First, in the MB minimum value confirmation step E12,
The pack selection circuit 71 receives the minimum value of PTS / DTS as a response to the minimum value confirmation request from the MB simulation circuit of the multiplexing order 2ES. This value is a temporary SCR
Write 1.

【0199】SCR変更ステップE13で、パック選択
回路71は、仮SCR1をSCRとして多重化順位1E
SのMBシミュレーション回路に出力し、MBシミュレ
ーション回路は保持しているDTS/PTSがSCRと
同値及びSCRより小さいとき、上記MBの空き容量に
DTS/PTSに関連するAU量を加算する。多重化順
位1ESのMBシミュレーション回路は、加算結果と多
重化順位1ESのMB容量を比較し、加算結果の方が大
きいとき上記MBのアンダフローをパック選択回路71
に出力する。
At the SCR changing step E13, the pack selection circuit 71 sets the temporary SCR1 as the SCR and the multiplexing order 1E.
When the DTS / PTS held therein is equal to or smaller than SCR, the MB simulation circuit adds the AU amount related to DTS / PTS to the free space of the MB. The MB simulation circuit of the multiplexing order 1ES compares the addition result with the MB capacity of the multiplexing order 1ES, and when the addition result is larger, the MB underflow is selected by the pack selection circuit 71.
Output to.

【0200】アンダフロー発生判断ステップE14で、
パック選択回路71は、多重化順位1ESのMBのアン
ダフローが発生したかを判断し、アンダフローが発生し
た場合、多重化順位2ESの多重化判断2を終了し、分
岐F以降の多重化順位3ESの多重化判断2に進む。
At the underflow occurrence judgment step E14,
The pack selection circuit 71 determines whether or not an MB underflow of the multiplexing order 1ES has occurred. If an underflow has occurred, the pack selection circuit 71 terminates the multiplexing decision 2 of the multiplexing order 2ES, and the multiplexing order of the branch F and thereafter. Proceed to 3ES multiplexing determination 2.

【0201】ステップE14で、多重化順位1ESのM
Bのアンダフローが発生しなかった場合、SCRを調整
しても上記MBがアンダフローしないものとして、ステ
ップE12,E4で、SCRを調整して多重化順位2E
SのMBの空き容量を大きくする。
At step E14, M of multiplexing order 1ES
If the underflow of B does not occur, it is assumed that the MB does not underflow even if the SCR is adjusted, and in steps E12 and E4, the SCR is adjusted and the multiplexing order is 2E.
Increase the free space of S MB.

【0202】ステップE15で、パック選択回路71
は、仮SCR1をパック選択回路71が保持しているS
CRに設定することにより変更すると共に、SCR生成
回路79に出力する。各MBシミュレーション回路は、
変更されたSCRの値に合わせ、保持値の変更を行う。
At step E15, the pack selection circuit 71
Is the S that the pack selection circuit 71 holds the temporary SCR1.
The value is changed by setting it to CR and is output to the SCR generation circuit 79. Each MB simulation circuit
The held value is changed according to the changed SCR value.

【0203】空き容量確認ステップE4で、パック選択
回路71は、多重化順位2ESのMBシミュレーション
回路から空き容量確認要求に対する応答として空き容量
を受領する。この空き容量を空き容量11とする。
At the free space confirmation step E4, the pack selection circuit 71 receives the free space as a response to the free space confirmation request from the MB simulation circuit of the multiplexing order 2ES. This free space is called free space 11.

【0204】空き容量判断ステップE5で、パック選択
回路71は、空き容量11が多重化順位2ESの多重化
ES量より大きいかを判断し、空き容量11より多重化
順位2ESの多重化ES量が大きい場合、ステップE1
2,E13,E14,E15,E4,E5を空き容量1
1が上記多重化ES量より大きくなるまで繰り返す。
At the free space determination step E5, the pack selection circuit 71 determines whether or not the free space 11 is larger than the multiplexing ES amount of the multiplexing order 2ES, and the free space 11 indicates that the multiplexing ES amount of the multiplexing order 2ES is larger than the multiplexing ES amount. If so, step E1
2, E13, E14, E15, E4, E5 free space 1
Repeat until 1 becomes larger than the above-mentioned multiplexed ES amount.

【0205】ステップE5で、空き容量11が上記多重
化ES量より大きい場合、多重化順位1ESの場合と同
様の処理であるステップE6〜E9で、多重化順位2E
Sの多重化を行う。
If the free space 11 is larger than the amount of multiplexing ES in step E5, the processing is the same as in the case of multiplexing order 1ES, and in steps E6 to E9, the multiplexing order 2E is executed.
S is multiplexed.

【0206】多重化回路72は、入力ES、SCR、P
TS、DTS、AU量、ピクチャタイプにから多重化を
行い、PSを出力する。
The multiplexing circuit 72 receives the inputs ES, SCR, P
Multiplexing is performed based on TS, DTS, AU amount, and picture type, and PS is output.

【0207】各MBシミュレーション回路は、変更され
たSCRの値に合わせ、保持値の変更を行う。
Each MB simulation circuit changes the held value in accordance with the changed SCR value.

【0208】次に、分岐Fの処理である多重化順位3E
Sの多重化判断2及び多重化をフローチャートで示す図
8を参照して多重化順位3ESの多重化判断2及び多重
化について上述の多重化順位2ESの多重化判断2及び
多重化との相違点を重点的に説明すると、この多重化順
位3Sの多重化判断2及び多重化は、以下の説明を除
き、多重化順位2ESを多重化順位3ESに、ステップ
E1,E4,E5,E6,E7,E8,E9をステップ
F1,F4,F5,F6,F7,F8,F9に、空き容
量11を空き容量12に、SCR1をSCR2にそれぞ
れ読み替えることにより、多重化順位2ESの多重化判
断2及び多重化の動作と同一である。
Next, the multiplexing order 3E which is the processing of the branch F
8 is a flowchart showing the multiplexing determination 2 and the multiplexing of S. With reference to FIG. 8, the multiplexing determination 2 and the multiplexing of the multiplexing priority 3 ES are different from the multiplexing determination 2 and the multiplexing of the multiplexing priority 2 ES described above. Explaining mainly, the multiplexing judgment 2 and the multiplexing of the multiplexing order 3S are performed by changing the multiplexing order 2ES to the multiplexing order 3ES, except for the following description, in steps E1, E4, E5, E6, E7, By replacing E8 and E9 with steps F1, F4, F5, F6, F7, F8, and F9, free space 11 with free space 12, and SCR1 with SCR2, the multiplexing determination 2 and multiplexing of the multiplexing order 2ES are performed. Is the same as the operation of.

【0209】まず、多重化順位3ESの多重化判断ステ
ップF1で、パック選択回路71は、多重化順位2ES
のバッファ占有量確認回路に対し容量確認を行い、多重
化対象ES量が多重化順位2ESのバッファに存在しな
いことを確認した場合、多重化順位2ESの多重化判断
2を終了し、多重化処理を終了する。
First, in the multiplexing determination step F1 of the multiplexing order 3ES, the pack selection circuit 71 determines the multiplexing order 2ES.
When the capacity of the buffer occupancy confirmation circuit of No. 2 is confirmed and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer of the multiplexing order 2ES, the multiplexing judgment 2 of the multiplexing order 2ES is ended, and the multiplexing process is performed. To finish.

【0210】ステップF1で、多重化対象ES量が多重
化順位3ESのバッファに存在する場合、ステップF1
2〜F16で、SCRを調整して多重化順位3ESのM
Bの空き容量を大きくしたときに、多重化順位1ES及
び多重化順位2ESの各々のMBがアンダフローしない
かを確認する。
In step F1, if the amount of ES to be multiplexed exists in the buffer having the multiplexing order of 3ES, step F1
From 2 to F16, adjust SCR and M of multiplexing order 3ES
When the free capacity of B is increased, it is confirmed whether the MBs of the multiplexing order 1ES and the multiplexing order 2ES do not underflow.

【0211】まず、MB最小値確認ステップF12で、
パック選択回路71は、多重化順位3ESのMBシミュ
レーション回路から最小値確認要求に対する応答として
PTS/DTSの最小値を受領する。この値を仮SCR
2と記述する。
First, in the MB minimum value confirmation step F12,
The pack selection circuit 71 receives the minimum value of PTS / DTS as a response to the minimum value confirmation request from the MB simulation circuit of the multiplexing order 3ES. This value is a temporary SCR
Described as 2.

【0212】SCR変更ステップF13で、パック選択
回路71は、仮SCR2をSCRとして多重化順位1E
SのMBシミュレーション回路に出力し、多重化順位1
ESのMBシミュレーション回路は保持しているDTS
/PTSがSCRと同値及びSCRより小さいとき、上
記MBの空き容量にDTS/PTSに関連するAU量を
加算する。多重化順位1ESのMBシミュレーション回
路は、加算結果と多重化順位1ESのMB容量とを比較
し、加算結果の方が大きいとき上記MBのアンダフロー
をパック選択回路71に出力する。
At the SCR change step F13, the pack selection circuit 71 sets the temporary SCR2 as the SCR and the multiplexing order 1E.
Output to MB simulation circuit of S, multiplexing order 1
DTS held by ES MB simulation circuit
When / PTS is equal to SCR or smaller than SCR, the AU amount related to DTS / PTS is added to the free space of the MB. The MB simulation circuit of the multiplexing order 1ES compares the addition result with the MB capacity of the multiplexing order 1ES, and outputs the MB underflow to the pack selection circuit 71 when the addition result is larger.

【0213】アンダフロー発生判断ステップF14で、
パック選択回路71は、多重化順位1ESのMBのアン
ダフローが発生したかを判断し、アンダフローが発生し
た場合、多重化順位3ESの多重化判断2を終了し、多
重化処理を終了する。
At the underflow occurrence determination step F14,
The pack selection circuit 71 determines whether an MB underflow of the multiplexing order 1ES has occurred, and if an underflow has occurred, the multiplexing determination 2 of the multiplexing order 3ES is completed, and the multiplexing process is completed.

【0214】ステップF14で、多重化順位1ESのM
Bのアンダフローが発生しなかった場合、ステップF1
5に進む。
At step F14, M of multiplexing order 1ES
If the underflow of B does not occur, step F1
Go to 5.

【0215】SCR変更ステップF15で、パック選択
回路71は、仮SCR2をSCRとして多重化順位2E
SのMBシミュレーション回路に出力する。多重化順位
2ESのMBシミュレーション回路はSCRと保持して
いるDTS/PTSが同値及びSCRより小さいとき、
上記MBの空き容量にDTS/PTSに関連するAU量
を加算し、この加算結果と多重化順位2ESのMB容量
とを比較し、加算結果の方が大きいとき上記MBのアン
ダフローをパック選択回路71に出力する。
At the SCR change step F15, the pack selection circuit 71 sets the temporary SCR2 as the SCR and the multiplexing order 2E.
Output to the S MB simulation circuit. In the MB simulation circuit of the multiplexing order 2ES, when the DTS / PTS held by the SCR is the same value or smaller than the SCR,
The AU amount related to DTS / PTS is added to the free space of the MB, and the addition result is compared with the MB capacity of the multiplexing order 2ES. When the addition result is larger, the underflow of the MB is selected by the pack selection circuit. To 71.

【0216】アンダフロー発生判断ステップF16で、
パック選択回路71は、多重化順位2ESのMBのアン
ダフローが発生したかを判断し、アンダフローが発生し
た場合、多重化順位3ESの多重化判断2を終了し、多
重化処理を終了する。
At the underflow occurrence determination step F16,
The pack selection circuit 71 determines whether an MB underflow of the multiplexing order 2ES has occurred, and if an underflow has occurred, the multiplexing determination 2 of the multiplexing order 3ES is ended, and the multiplexing process is ended.

【0217】ステップF16で、多重化順位2ESのM
Bのアンダフローが発生しなかった場合、SCRを調整
しても多重化順位1ES及び多重化順位2ESのMBが
アンダフローしないとして、ステップF17,F4に進
み、SCRを調整して多重化順位3ESのMBの空き容
量を大きくする。
At step F16, M of multiplexing order 2ES
When the underflow of B does not occur, it is assumed that the MBs of the multiplexing order 1ES and the multiplexing order 2ES do not underflow even if the SCR is adjusted, and the process proceeds to steps F17 and F4 to adjust the SCR to adjust the multiplexing order 3ES. Increase the free space of MB.

【0218】ステップF17で、パック選択回路71
は、仮SCR2をパック選択回路71が保持しているS
CRに設定することにより変更すると共に、SCR生成
回路79に出力する。各MBシミュレーション回路は、
変更されたSCRの値に合わせ、保持値の変更を行う。
In step F17, the pack selection circuit 71
Is the S that the pack selection circuit 71 holds the temporary SCR2.
The value is changed by setting it to CR and is output to the SCR generation circuit 79. Each MB simulation circuit
The held value is changed according to the changed SCR value.

【0219】空き容量確認ステップF4で、パック選択
回路71は、多重化順位3ESのMBシミュレーション
回路から空き容量確認要求に対する応答として空き容量
を受領する。この空き容量を空き容量12と記述する。
At the free space confirmation step F4, the pack selection circuit 71 receives the free space as a response to the free space confirmation request from the MB simulation circuit of the multiplexing order 3ES. This free space is referred to as free space 12.

【0220】空き容量判断ステップF5で、パック選択
回路71は、空き容量12が多重化順位3ESの多重化
ES量より大きいかを判断し、空き容量12より多重化
順位3ESの多重化ES量が大きい場合、ステップF1
2,F13,F14,F15,F16,F17,F4,
F5を空き容量12が上記多重化ES量より大きくなる
まで繰り返す。
In the free capacity determination step F5, the pack selection circuit 71 determines whether or not the free capacity 12 is larger than the multiplexing ES amount of the multiplexing order 3ES, and from the free capacity 12, the multiplexing ES amount of the multiplexing order 3ES is determined. If so, step F1
2, F13, F14, F15, F16, F17, F4
F5 is repeated until the free space 12 becomes larger than the multiplexed ES amount.

【0221】ステップF5で、空き容量12が上記多重
化ES量より大きい場合、多重化順位2ESの場合と同
様の処理であるステップF6〜F9で、多重化順位3E
Sの多重化を行う。
If the free space 12 is larger than the amount of multiplexing ES in step F5, the same processing as in the case of multiplexing order 2ES is performed in steps F6 to F9.
S is multiplexed.

【0222】多重化回路72は、入力ES、SCR、P
TS、DTS、AU量、ピクチャタイプにから多重化を
行い、PSを出力する。
The multiplexing circuit 72 uses the inputs ES, SCR, P
Multiplexing is performed based on TS, DTS, AU amount, and picture type, and PS is output.

【0223】各MBシミュレーション回路は、変更され
たSCRの値に合わせ、保持値の変更を行う。
Each MB simulation circuit changes the held value according to the changed SCR value.

【0224】次に、多重化前及び多重化後の多重器7の
状態を説明図で示す図9を参照して、本実施の形態の多
重化装置の多重化判断及び多重化処理について具体的な
数値例を用いて説明すると、上述のように、パック選択
回路71は、VMBシミュレーション回路74が保持し
ているDTSの最大値、AMBシミュレーション回路7
6,78の各々が保持しているPTS1,PTS2の各
々の最大値を比較し、これらDTS/PTS1/PTS
2に対応するESのうちでDTS/PTS1/PTS2
の各々の最大値が小さい方からの順序を多重化判断を行
う順位とする。
Next, referring to FIG. 9 which is an explanatory diagram showing the states of the multiplexer 7 before and after the multiplexing, the multiplexing determination and the multiplexing processing of the multiplexer of the present embodiment will be described in detail. As described above, the pack selection circuit 71 uses the maximum value of the DTS held by the VMB simulation circuit 74 and the AMB simulation circuit 7 as described above.
The maximum values of PTS1 and PTS2 held by 6 and 78 are compared, and DTS / PTS1 / PTS
DTS / PTS1 / PTS2 among ES corresponding to 2
The order in which the maximum value of each is smaller is the order in which the multiplexing determination is performed.

【0225】この例の多重化条件を下記に示す。The multiplexing conditions of this example are shown below.

【0226】VMB204の容量=229376バイ
ト。
Capacity of VMB 204 = 229376 bytes.

【0227】AMB207の容量=4096バイト AMB209の容量=4096バイト ビデオESの多重化量=2015バイト オーディオESAS1の多重化量=2015バイト オーディオESAS2の多重化量=2015バイト SCR加算値=159 この図では、VMBシミュレーション回路74の保持内
容を(A)に、AMBシミュレーション回路76,78
の保持内容を(B),(C)に、VB占有量確認回路7
3の保持内容を(D)に、AB占有量確認回路75,7
7の保持内容を(E),(F)に、SCR生成回路79
の保持内容を(G)に、パック選択回路71の保持内容
を(H)にそれぞれ示す。また、AMBシミュレーショ
ン回路78、AB占有量確認回路77、SCR生成回路
79、パック選択回路71の各々の多重化前及び後の保
持内容を(CA),(CB)、(FA),(FB)、
(GA),(GB)、(HA)、(HB)にそれぞれ示
す。
AMB207 capacity = 4096 bytes AMB209 capacity = 4096 bytes Video ES multiplexing amount = 2015 bytes Audio ESAS1 multiplexing amount = 2015 bytes Audio ESAS2 multiplexing amount = 2015 bytes SCR added value = 159 , The contents held in the VMB simulation circuit 74 to (A), and the AMB simulation circuits 76 and 78.
The contents held in (B) and (C), the VB occupation amount confirmation circuit 7
The content held in 3 is set to (D), and the AB occupation amount confirmation circuits 75 and 7
The contents stored in No. 7 are set to (E) and (F), and the SCR generation circuit 79
(G) shows the contents stored in the pack selection circuit 71 and (H) shows the contents stored in the pack selection circuit 71. Further, the contents of the AMB simulation circuit 78, the AB occupancy confirmation circuit 77, the SCR generation circuit 79, and the pack selection circuit 71 before and after multiplexing are (CA), (CB), (FA), and (FB), respectively. ,
They are shown in (GA), (GB), (HA), and (HB), respectively.

【0228】この図の例では、DTSの最大値は、Pピ
クチャの66066、PTS1の最大値は、6480
0、PTS2の最大値は、60480であり、従ってP
TS2<PTS1<DTSである。
In the example of this figure, the maximum value of DTS is 66066 for P picture, and the maximum value of PTS1 is 6480.
0, the maximum value of PTS2 is 60480, so P
TS2 <PTS1 <DTS.

【0229】従って、多重化順位1ESはオーディオE
SAS2、多重化順位2ESはオーディオESAS1、
多重化順位3ESはビデオESとなる。
Therefore, the multiplexing order 1ES is audio E
SAS2, multiplexing order 2ES is audio ESAS1,
The multiplexing order 3ES becomes a video ES.

【0230】パック選択回路71は、多重化順位1ES
であるオーディオESAS2のバッファ6の占有量がオ
ーディオESAS2の多重化ES量より多いかを判断す
る。バッファ6に存在するES量(占有量)はAMBシ
ミュレーション回路78で確認でき、図9(FA)に示
す2400バイトと分かる。
The pack selection circuit 71 has a multiplexing order of 1 ES.
It is determined whether the occupied amount of the buffer 6 of the audio ESAS2 is larger than the multiplexed ES amount of the audio ESAS2. The ES amount (occupancy amount) existing in the buffer 6 can be confirmed by the AMB simulation circuit 78, and it can be seen that it is 2400 bytes shown in FIG. 9 (FA).

【0231】オーディオESAS2の多重化ES量は、
多重化条件から2015バイトであり、オーディオES
AS2のバッファ6の占有量がオーディオESAS2の
多重化ES量より大きいことが確認できる。
The audio ESAS2 multiplexed ES amount is
It is 2015 bytes from the multiplexing condition, and audio ES
It can be confirmed that the occupied amount of the buffer 6 of the AS2 is larger than the multiplexed ES amount of the audio ESAS2.

【0232】次に、パック選択回路71は、オーディオ
ESAS2の多重化を行っても、AMB209がオーバ
フローもアンダフローも起こさず多重化が可能であるこ
とを判断する。オーディオESAS2の多重化ES量は
2015バイトであり、オーディオESAS2のバッフ
ァ6の占有量2400バイトがオーディオESAS2の
多重化ES量より大きいことを確認できる。
Next, the pack selection circuit 71 determines that the AMB 209 can be multiplexed without causing overflow or underflow even if the audio ESAS2 is multiplexed. The multiplexed ES amount of the audio ESAS2 is 2015 bytes, and it can be confirmed that the occupied amount 2400 bytes of the buffer 6 of the audio ESAS2 is larger than the multiplexed ES amount of the audio ESAS2.

【0233】次に、パック選択回路71は、オーディオ
ESAS2の多重化を行っても、AMB209がオーバ
フローもアンダフローも起こさず多重化が可能であるこ
とを判断する。パック選択回路71は、AMBシミュレ
ーション回路78が保持しているAMB209の空き容
量を呼び出し、図9(CA)に示すように空き容量が4
000バイトであることを確認する。この空き容量を空
き容量1と記述する。
Next, the pack selection circuit 71 determines that the AMB 209 can be multiplexed without causing overflow or underflow even if the audio ESAS2 is multiplexed. The pack selection circuit 71 calls the free capacity of the AMB 209 held by the AMB simulation circuit 78, and the free capacity becomes 4 as shown in FIG. 9 (CA).
Confirm that it is 000 bytes. This free space is referred to as free space 1.

【0234】次に、パック選択回路71は、空き容量1
からオーディオESAS2の多重化ES量=2015バ
イトを減算し、この減算結果の値を空き容量2と記述す
る。空き容量2は1985バイトとなる。
Next, the pack selection circuit 71 determines the free space 1
Is subtracted from the multiplexed ES amount of audio ESAS2 = 2015 bytes, and the value of the subtraction result is described as free space 2. The free space 2 is 1985 bytes.

【0235】パック選択回路71は、図9(HA)に示
す保持しているSCR=60559をAMBシミュレー
ション回路78に出力する。
The pack selection circuit 71 outputs the held SCR = 60559 shown in FIG. 9 (HA) to the AMB simulation circuit 78.

【0236】AMBシミュレーション回路78は、入力
したSCRでAMBシミュレーション回路78から削除
されるAU量、PTSがあるか、通知されたSCRとP
TSを比較する。AMBシミュレーション回路78には
通知されたSCR=60559より小さいPTS=60
480が存在するので(図9(CA))、そのAU量=
1152バイトをパック選択回路71に通知する。
The AMB simulation circuit 78 determines whether or not there is an AU amount and PTS to be deleted from the AMB simulation circuit 78 in the input SCR, or the notified SCR and P
Compare TS. The AMB simulation circuit 78 notifies the PTS = 60 which is smaller than the notified SCR = 60559.
Since 480 exists (FIG. 9 (CA)), its AU amount =
The pack selection circuit 71 is notified of 1152 bytes.

【0237】パック選択回路71は、通知されたAU量
を空き容量2に加算し、その加算結果の値を空き容量3
と記述する。空き容量3は3137バイトとなる。空き
容量3は、オーディオESAS2を多重化したときのA
MB209の空き容量を示している(図9(CB))。
The pack selection circuit 71 adds the notified AU amount to the free space 2, and the value of the addition result is the free space 3
Write. The free space 3 is 3137 bytes. Free space 3 is A when audio ESAS2 is multiplexed.
The free space of the MB 209 is shown (FIG. 9 (CB)).

【0238】パック選択回路71は、空き容量3がAM
B207の容量内、0バイト以上4096バイト以下に
あるか判断する。空き容量3はAMB209の容量内に
あることを確認できたので、パック選択回路71はオー
ディオESAS2の多重化を次のように行う。
In the pack selection circuit 71, the free space 3 is AM.
It is determined whether the capacity of B207 is 0 bytes or more and 4096 bytes or less. Since it has been confirmed that the free capacity 3 is within the capacity of the AMB 209, the pack selection circuit 71 multiplexes the audio ESAS 2 as follows.

【0239】パック選択回路71は、バッファ6に出力
するES量=2015バイトを通知する。バッファ6
は、多重化回路72に通知されたES量2015バイト
及び多重化を行うときに付加するSCR=60559を
出力する。また、オーディオESAS2にAUの先頭が
含まれているので、多重化を行うときに付加するPTS
=62460、AU量=1152バイトも出力する。さ
らにSCR生成回路79にSCR=60559を出力す
る。さらにまた、AMBシミュレーション回路78にオ
ーディオESAS2の多重化ES量=2015バイトを
出力するとともに、オーディオESAS2にAUの先頭
が含まれているので、PTS=62460、AU量=1
152バイトも出力する。
The pack selection circuit 71 notifies the ES amount output to the buffer 6 = 2015 bytes. Buffer 6
Outputs the ES amount 2015 bytes notified to the multiplexing circuit 72 and SCR = 60559 added when multiplexing is performed. In addition, since the audio ESAS2 includes the beginning of the AU, the PTS added when multiplexing is performed.
= 62460, AU amount = 1152 bytes are also output. Further, SCR = 60559 is output to the SCR generation circuit 79. Furthermore, since the multiplexed ES amount of audio ESAS2 = 2015 bytes is output to the AMB simulation circuit 78 and the head of AU is included in audio ESAS2, PTS = 62460, AU amount = 1
It also outputs 152 bytes.

【0240】パック選択回路71は、保持しているSC
RにSCR加算値=159を加算する。加算結果は60
758となる((図9(HB)))。多重化回路72
は、オーディオESAS2、PTS、AU量、SCRを
入力し、多重化を行い、PSを出力する。
The pack selection circuit 71 holds the SC it holds.
SCR addition value = 159 is added to R. The addition result is 60
758 ((FIG. 9 (HB))). Multiplexing circuit 72
Inputs audio ESAS2, PTS, AU amount, and SCR, multiplexes them, and outputs PS.

【0241】AMBシミュレーション回路78は、オー
ディオESAS2の多重化ES量=2015を入力し、
AMB209の空き容量から多重化ES量を減算する。
AMB209の空き容量は1985バイトとなる。AM
Bシミュレーション回路78は、AU量=1152バイ
ト、PTS=62460を入力し、保持する。また、S
CR=60559と保持しているPTSとを比較する。
AMBシミュレーション回路78にはSCR=6055
9より小さいPTS=60480が存在するので、その
AU量=1152バイトとPTS=60480を削除
し、またAMB209の空き容量に削除したAU量=1
152バイトを加算する。AMB209の空き容量は3
137バイトとなる(図9(CB))。
The AMB simulation circuit 78 inputs the multiplexed ES amount = 2015 of the audio ESAS2,
The multiplexed ES amount is subtracted from the free capacity of the AMB 209.
The free capacity of the AMB 209 is 1985 bytes. AM
The B simulation circuit 78 inputs and holds AU amount = 1152 bytes and PTS = 62460. Also, S
CR = 60559 is compared with the held PTS.
The AMB simulation circuit 78 has SCR = 6055.
Since there is PTS = 60480 smaller than 9, the AU amount = 1152 bytes and PTS = 60480 are deleted, and the AU amount deleted in the free space of AMB209 = 1
Add 152 bytes. AMB209 has 3 free space
It becomes 137 bytes (Fig. 9 (CB)).

【0242】AMBシミュレーション回路76は、SC
R=60559と保持しているPTSとを比較する。保
持している全てのPTSはSCR=60559より大き
いので、特に保持値の変更は行わない。VMBシミュレ
ーション回路74は、SCR=60559と保持してい
るPTSとを比較する。保持している全てのPTS及び
DTSはSCR=60559より大きいので、特に保持
値の変更は行わない。
The AMB simulation circuit 76 uses the SC
R = 60559 is compared with the retained PTS. Since all the held PTSs are larger than SCR = 60559, the held value is not changed. The VMB simulation circuit 74 compares SCR = 60559 with the held PTS. Since all the held PTSs and DTSs are larger than SCR = 60559, the held values are not changed.

【0243】このように、本実施の形態のプログラムス
トリーム多重化方法及び装置は、P−STD内のメイン
バッファ(MB)の状態を管理し、複数のESを多重化
するとき、MBが空になる順番で各ESの多重化を行う
ことにより、MB容量が同一のESを多重化しても、M
Bがアンダフローすることがない。
As described above, the program stream multiplexing method and apparatus of the present embodiment manages the state of the main buffer (MB) in the P-STD, and when multiple ESs are multiplexed, the MB becomes empty. By multiplexing each ES in the following order, even if ESs having the same MB capacity are multiplexed, M
B never underflows.

【0244】次に、本発明の第2の実施の形態のプログ
ラムストリーム多重化装置を図1と共通の構成要素には
共通の参照文字/数字を付して同様にブロックで示す図
10を参照すると、この図に示す本実施の形態の前述の
第1の実施の形態との相違点は、1つのビデオESと3
つのオーディオESを多重化するものであり、第1の実
施の形態の構成要素に加えて、第3のディジタルオーデ
ィオ信号AD3を圧縮符号化を行いオーディオESAS
3を出力するオーディオエンコーダ8と、オーディオE
SAS3を一時保持するオーディオバッファ9と、多重
器7の代わりにビデオバッファ4及びオーディオバッフ
ァ5,6,9の各々に保持しているデータを多重化して
プログラムストリームPSとして出力する多重器7Aを
備えることである。
Next, FIG. 10 showing the second embodiment of the program stream multiplexer according to the present invention in the same manner as in FIG. Then, the difference between the present embodiment shown in this figure and the first embodiment described above is that one video ES and three video ES
One audio ES is multiplexed, and in addition to the components of the first embodiment, the third digital audio signal AD3 is compression-coded to perform audio ESAS.
Audio encoder 8 that outputs 3 and audio E
An audio buffer 9 that temporarily holds the SAS 3 and a multiplexer 7A that multiplexes the data held in each of the video buffer 4 and the audio buffers 5, 6 and 9 instead of the multiplexer 7 and outputs the multiplexed data as a program stream PS That is.

【0245】本実施の形態の多重器7Aは、多重器7の
構成要素に加えて、オーディオバッファ9内のオーディ
オESAS3の占有量をそれぞれ確認保持するAB占有
量確認回路81と、後述のP−STDの第3のオーディ
オメインバッファ213のシミュレーションを行うAM
Bシミュレーション回路82と、パック選択回路71の
代わりに選択対象としてオーディオESAS3を追加し
たパック選択回路71Aと、多重化回路72の代わりに
パック選択回路71AによりオーディオESAS3を含
む選択したパックを多重化する多重化回路72Aとを備
えることである。
In addition to the components of the multiplexer 7, the multiplexer 7A of the present embodiment includes an AB occupation amount confirmation circuit 81 for confirming and retaining the occupation amount of the audio ESAS3 in the audio buffer 9, and a P- AM for simulating STD third audio main buffer 213
The B simulation circuit 82, the pack selection circuit 71A in which the audio ESAS3 is added as a selection target in place of the pack selection circuit 71, and the pack selection circuit 71A in place of the multiplexing circuit 72 multiplexes the selected pack including the audio ESAS3. And a multiplexing circuit 72A.

【0246】本実施の形態に対応するP−STDの構成
を図2と共通の構成要素には共通の参照文字/数字を付
して同様にブロックで示す図11を参照すると、この図
に示す本実施の形態の前述の第1の実施の形態との相違
点は、第1の実施の形態の構成要素に加えて、デマルチ
プレクス部201の代わりに入力したPSをビデオES
VS,オーディオESAS1,AS2,AS3,システ
ムクロック(SCR),PTS及びDTSに分解するデ
マルチプレクス部201Aと、オーディオESAS3を
保持するオーディオメインバッファ(AMB)213
と、オーディオESAS3を復号してオーディオ信号A
3を出力するオーディオデコーダ214とを備えること
である。
The structure of the P-STD corresponding to the present embodiment is shown in FIG. 11 in which the same components as those in FIG. 2 are similarly indicated by blocks with common reference characters / numerals. The difference between this embodiment and the first embodiment described above is that in addition to the components of the first embodiment, the PS input instead of the demultiplexing unit 201 is used as a video ES.
A demultiplexing unit 201A that decomposes VS, audio ESAS1, AS2, AS3, system clock (SCR), PTS, and DTS, and an audio main buffer (AMB) 213 that holds audio ESAS3
And an audio signal A by decoding the audio ESAS3.
3 and an audio decoder 214 for outputting 3 are provided.

【0247】次に、本発明の第2の実施の形態のプログ
ラムストリーム多重化装置を図1と共通の構成要素には
共通の参照文字/数字を付して同様にブロックで示す図
11を参照すると、この図に示す本実施の形態の前述の
第1の実施の形態との相違点は、1つのビデオESと3
つのオーディオESを多重化するものであり、第1の実
施の形態の構成要素に加えて、第3のディジタルオーデ
ィオ信号AD3を圧縮符号化を行いオーディオESAS
3を出力するオーディオエンコーダ8と、オーディオE
SAS3を一時保持するオーディオバッファ9と、多重
器7の代わりにビデオバッファ4及びオーディオバッフ
ァ5,6,9の各々に保持しているデータを多重化して
プログラムストリームPSとして出力する多重器7Aを
備えることである。
Next, referring to FIG. 11, which is a block diagram of the program stream multiplexer of the second embodiment of the present invention, the same components as those in FIG. 1 are designated by common reference characters / numerals. Then, the difference between the present embodiment shown in this figure and the first embodiment described above is that one video ES and three video ES
One audio ES is multiplexed, and in addition to the components of the first embodiment, the third digital audio signal AD3 is compression-coded to perform audio ESAS.
Audio encoder 8 that outputs 3 and audio E
An audio buffer 9 that temporarily holds the SAS 3 and a multiplexer 7A that multiplexes the data held in each of the video buffer 4 and the audio buffers 5, 6 and 9 instead of the multiplexer 7 and outputs the multiplexed data as a program stream PS That is.

【0248】本実施の形態の多重器7Aは、多重器7の
構成要素に加えて、オーディオバッファ9内のオーディ
オESAS3の占有量をそれぞれ確認保持するAB占有
量確認回路81と、後述のP−STDの第3のオーディ
オメインバッファ213のシミュレーションを行うAM
Bシミュレーション回路82と、パック選択回路71の
代わりに選択対象としてオーディオESAS3を追加し
たパック選択回路71Aと、多重化回路72の代わりに
パック選択回路71AによりオーディオESAS3を含
む選択したパックを多重化する多重化回路72Aとを備
えることである。
In addition to the components of the multiplexer 7, the multiplexer 7A of this embodiment includes an AB occupation amount confirmation circuit 81 for confirming and retaining the occupation amount of the audio ESAS3 in the audio buffer 9, and a P- AM for simulating STD third audio main buffer 213
The B simulation circuit 82, the pack selection circuit 71A in which the audio ESAS3 is added as a selection target in place of the pack selection circuit 71, and the pack selection circuit 71A in place of the multiplexing circuit 72 multiplexes the selected pack including the audio ESAS3. And a multiplexing circuit 72A.

【0249】本実施の形態に対応するP−STDの構成
を図2と共通の構成要素には共通の参照文字/数字を付
して同様にブロックで示す図12を参照すると、この図
に示す本実施の形態の前述の第1の実施の形態との相違
点は、第1の実施の形態の構成要素に加えて、デマルチ
プレクス部201の代わりに入力したPSをビデオES
VS,オーディオESAS1,AS2,AS3,システ
ムクロック(SCR),PTS及びDTSに分解するデ
マルチプレクス部201Aと、オーディオESAS3を
保持するオーディオメインバッファ(AMB)213
と、オーディオESAS3を復号してオーディオ信号A
3を出力するオーディオデコーダ214とを備えること
である。
The structure of the P-STD corresponding to this embodiment is shown in FIG. 12 in which the same components as those in FIG. 2 are similarly indicated by blocks with common reference characters / numerals. The difference between this embodiment and the first embodiment described above is that in addition to the components of the first embodiment, the PS input instead of the demultiplexing unit 201 is used as a video ES.
A demultiplexing unit 201A that decomposes VS, audio ESAS1, AS2, AS3, system clock (SCR), PTS, and DTS, and an audio main buffer (AMB) 213 that holds audio ESAS3
And an audio signal A by decoding the audio ESAS3.
3 and an audio decoder 214 for outputting 3 are provided.

【0250】次に、図10及び図11を参照して本実施
の形態の動作の概要について第1の実施の形態との相違
点を重点的に説明すると、オーディオエンコーダ8は、
ディジタルオーディオ信号AD3を入力しMPEG規格
の圧縮符号化プロトコルに従って圧縮符号化を行いオー
ディオESAS3を出力し、オーディオバッファ9に供
給する。オーディオバッファ9は、入力したオーディオ
ESAS3を保持し、多重化器7Aのパック選択回路7
1Aに指示されたデータ量のオーディオESAS3を出
力し、多重化回路72Aに供給する。
Next, with reference to FIG. 10 and FIG. 11, an outline of the operation of the present embodiment will be described focusing on the differences from the first embodiment.
The digital audio signal AD3 is input, compression-encoded according to the compression encoding protocol of the MPEG standard, and the audio ESAS3 is output and supplied to the audio buffer 9. The audio buffer 9 holds the input audio ESAS 3 and uses the pack selection circuit 7 of the multiplexer 7A.
The audio ESAS3 having the data amount designated by 1A is output and supplied to the multiplexing circuit 72A.

【0251】AB占有量確認回路81は、オーディオバ
ッファ9が保持しているオーディオESAS3占有量を
確認し保持する。パック選択回路71Aからの容量確認
要求QCAS3の供給に応じて保持しているAS3占有
量を応答する。
The AB occupation amount confirmation circuit 81 confirms and retains the audio ESAS3 occupation amount held by the audio buffer 9. The AS3 occupation amount held in response to the supply of the capacity confirmation request QCAS3 from the pack selection circuit 71A is returned.

【0252】パック選択回路71Aは、DTSの最大値
及びPTS1,PTS2,及びオーディオESAS3の
PTS3の各々の最大値の計4つの最大値を比較し、最
大値が小さいDTS/PTS1/PTS2/PTS4に
対応するESから優先的に多重化する多重化順位4まで
の多重化判断を行い、この多重化順位4までの多重化処
理を行う。
The pack selection circuit 71A compares the maximum value of DTS and the maximum value of each of PTS1, PTS2, and PTS3 of the audio ESAS3, a total of four maximum values, and selects DTS / PTS1 / PTS2 / PTS4 having the smaller maximum value. The corresponding ESs are subjected to a multiplexing determination up to a multiplexing priority of 4 for priority multiplexing, and a multiplexing process up to this multiplexing priority of 4 is performed.

【0253】従って、本実施の形態の第1の実施の形態
の多重化アルゴリズムへの処理の追加は、詳細は後述す
るように、P−STDメインバッファ(MB)シミュレ
ーション用SCRの調整を伴わない多重化順位4ESの
多重化判断(多重化判断1)と多重化処理、及びMBシ
ミュレーション用SCRの調整を伴う多重化順位4ES
の多重化判断(多重化判断21)と多重化処理である。
Therefore, the addition of the processing to the multiplexing algorithm of the first embodiment of this embodiment does not involve adjustment of the SCR for P-STD main buffer (MB) simulation, as will be described later in detail. Multiplexing order 4ES with multiplexing judgment of multiplexing order 4ES (multiplexing judgment 1) and multiplexing processing, and adjustment of SCR for MB simulation
Is a multiplexing determination (multiplexing determination 21) and multiplexing processing.

【0254】次に、図10、図11及び各部の処理をフ
ローチャートで示す図4,図6,図7,及び図12〜図
16を参照して本実施の形態のプログラムストリーム多
重化装置の動作である本実施の形態のプログラムストリ
ーム多重化方法について第1の実施の形態との相違点を
重点的にに説明する。
Next, referring to FIGS. 4, 6 and 7 and 12 to 16 which are flowcharts showing the processes of FIGS. 10 and 11 and the operation of the program stream multiplexer of the present embodiment. The program stream multiplexing method according to the present embodiment will be described focusing on the differences from the first embodiment.

【0255】まず、図12を参照すると、多重化順位付
けステップA1Aでは、パック選択回路71Aは、VM
Bシミュレーション回路74が保持しているDTSの最
大値及びAMBシミュレーション回路76,78,82
の各々が保持しているPTS1,PTS2、PTS3の
各々の最大値の計4つの最大値を比較し、最大値が小さ
いDTS/PTS1/PTS2/PTS4の各々に対応
するESから優先的に多重化する多重化順位付けを行
う。
First, referring to FIG. 12, in the multiplexing ordering step A1A, the pack selection circuit 71A determines that the VM
Maximum value of DTS held by B simulation circuit 74 and AMB simulation circuits 76, 78, 82
Of the PTS1, PTS2, and PTS3 held by each of the four maximum values are compared, and the ES corresponding to each of the DTS / PTS1 / PTS2 / PTS4 having the smaller maximum value is preferentially multiplexed. Multiplex ranking.

【0256】以降の多重化順位1ESの多重化判断1及
び多重化、多重化順位2ESの多重化判断1及び多重化
の処理は、パック選択回路71をパック選択回路71A
に、多重化回路72を多重化回路72Aにそれぞれ読み
替える以外は、図3及び図4にそれぞれ示した第1の実
施の形態の処理と同様であるので説明を省略する。
For the subsequent multiplexing determination 1 and multiplexing of the multiplexing order 1 ES, and multiplexing determination 1 and multiplexing of the multiplexing order 2 ES, the pack selection circuit 71 is operated by the pack selection circuit 71A.
Further, except that the multiplexing circuit 72 is replaced with the multiplexing circuit 72A, the processing is the same as that of the first embodiment shown in FIGS. 3 and 4, and therefore the description thereof is omitted.

【0257】次に、分岐Cの処理である多重化順位3E
Sの多重化判断1及び多重化をフローチャートで示す図
12を参照して多重化順位3ESの多重化判断1及び多
重化について上述の第1の実施の形態との相違点を重点
的に説明すると、多重化順位3ESの多重化判断ステッ
プC1Aで、パック選択回路71Aは、多重化順位3E
Sのバッファ占有量確認回路に対し容量確認を行い、多
重化対象ES量が多重化順位3ESのバッファに存在し
ないことを確認した場合、多重化順位3ESの多重化判
断1を終了し、分岐G以降の多重化順位4ESの多重化
判断1に進む。
Next, the multiplexing order 3E which is the processing of the branch C
12, which is a flowchart showing the multiplexing determination 1 and the multiplexing of S, the differences between the multiplexing determination 1 and the multiplexing of the multiplexing order 3 ES will be mainly described with respect to the first embodiment. In the multiplexing determination step C1A of the multiplexing order 3ES, the pack selection circuit 71A determines that the multiplexing order 3E
When the capacity is confirmed with respect to the buffer occupancy confirmation circuit of S and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer with the multiplexing order of 3ES, the multiplexing judgment 1 of the multiplexing order of 3ES is ended and the branch G After that, the process proceeds to the multiplexing determination 1 of the multiplexing order 4ES.

【0258】ステップC1で、パック選択回路71は、
多重化対象ES量が多重化順位3ESのバッファに存在
することを確認した場合は、第1の実施の形態で説明し
たステップC2〜C11の多重化処理を行う。
At step C1, the pack selection circuit 71
When it is confirmed that the amount of ES to be multiplexed exists in the buffer having the multiplexing order of 3 ES, the multiplexing process of steps C2 to C11 described in the first embodiment is performed.

【0259】次に、分岐Gの処理である多重化順位4E
Sの多重化判断1及び多重化をフローチャートで示す図
14を参照して多重化順位4ESの多重化判断1及び多
重化について上述の多重化順位3ESの多重化判断1及
び多重化との相違点を重点的に説明すると、この多重化
順位4ESの多重化判断1及び多重化は、以下の説明を
除き、多重化順位3ESを多重化順位4ESに、ステッ
プC1〜C11の各々をステップG1〜G11の各々
に、空き容量7,8,9を空き容量17,18,19に
それぞれ読み替えることにより、多重化順位3ESの多
重化判断1及び多重化の動作と同一である。
Next, the multiplexing order 4E which is the processing of the branch G
14 is a flowchart showing the multiplexing determination 1 and the multiplexing of S. With reference to FIG. 14, the multiplexing determination 1 and the multiplexing of 4ES are different from the multiplexing determination 1 and the multiplexing of 3ES described above. The multiplexing determination 1 and the multiplexing of the multiplexing order 4ES will be described with emphasis on the multiplexing order 3ES as the multiplexing order 4ES and steps C1 to C11 as steps G1 to G11 except for the following description. By replacing the free capacities 7, 8 and 9 with the free capacities 17, 18 and 19, respectively, the operations of the multiplexing judgment 1 and the multiplexing of the multiplexing order 3ES are the same.

【0260】まず、多重化順位4ESの多重化判断ステ
ップG1で、パック選択回路71Aは、多重化順位3E
Sのバッファ占有量確認回路に対し容量確認を行い、多
重化対象ES量が多重化順位4ESのバッファに存在し
ないことを確認した場合、多重化順位4ESの多重化判
断1を終了し、分岐D以降の多重化順位1ESの多重化
判断2の処理に進む。
First, in the multiplexing determination step G1 of the multiplexing order 4ES, the pack selection circuit 71A determines the multiplexing order 3E.
When the capacity is confirmed with respect to the buffer occupancy confirmation circuit of S and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer of the multiplexing order 4ES, the multiplexing judgment 1 of the multiplexing order 4ES is ended, and the branch D Thereafter, the process proceeds to the process of the multiplexing determination 2 of the multiplexing order 1ES.

【0261】ステップG1で、パック選択回路71A
は、多重化対象ES量が多重化順位4ESのバッファに
存在することを確認した場合は、多重化順位3ESの多
重化判断1及び多重化のステップC2〜C11と同様な
処理であるステップG2〜G11の多重化処理を行う。
At step G1, the pack selection circuit 71A
When it is confirmed that the amount of ES to be multiplexed exists in the buffer of the multiplexing order 4ES, step G2 which is the same process as the multiplexing judgment 1 of the multiplexing order 3ES and the multiplexing step C2 to C11. G11 multiplexing processing is performed.

【0262】次に、分岐D及び分岐Eの多重化順位1E
Sの多重化判断2及び多重化、多重化順位2ESの多重
化判断2及び多重化の処理は、パック選択回路71をパ
ック選択回路71Aに、多重化回路72を多重化回路7
2Aにそれぞれ読み替える以外は、図6,図7にそれぞ
れ示した第1の実施の形態の処理と同様であるので説明
を省略する。
Next, the multiplexing order 1E of branch D and branch E
The multiplexing determination 2 and multiplexing of S, and the multiplexing determination 2 and multiplexing of the multiplexing order 2 ES are performed by the pack selection circuit 71 to the pack selection circuit 71A and the multiplexing circuit 72 to the multiplexing circuit 7.
2A is the same as the processing of the first embodiment shown in FIGS. 6 and 7 except that it is replaced by 2A, and therefore the description thereof is omitted.

【0263】次に、分岐Fの処理である多重化順位3E
Sの多重化判断2及び多重化をフローチャートで示す図
15を参照して多重化順位3ESの多重化判断2及び多
重化について上述の第1の実施の形態との相違点を重点
的に説明すると、まず、多重化順位3ESの多重化判断
ステップF1Aで、パック選択回路71Aは、多重化順
位3ESのバッファ占有量確認回路に対し容量確認を行
い、多重化対象ES量が多重化順位3ESのバッファに
存在しないことを確認した場合、多重化順位3ESの多
重化判断2を終了し、分岐Hの多重化順位4ESの多重
化判断2に進む。
Next, the multiplexing order 3E which is the processing of the branch F
With reference to FIG. 15, which is a flowchart showing S multiplexing determination 2 and multiplexing, the differences between the multiplexing determination 2 and multiplexing of the multiplexing order 3 ES will be mainly described with respect to the first embodiment. First, in the multiplexing determination step F1A of the multiplexing order 3ES, the pack selection circuit 71A confirms the capacity with respect to the buffer occupancy confirmation circuit of the multiplexing order 3ES and the buffer with the multiplexing target ES amount of the multiplexing order 3ES is confirmed. When it is confirmed that the packet does not exist, the multiplexing judgment 2 of the multiplexing order 3ES is ended, and the process advances to the multiplexing judgment 2 of the multiplexing order 4ES of the branch H.

【0264】ステップF1で、多重化対象ES量が多重
化順位3ESのバッファに存在することを確認した場合
は、第1の実施の形態で説明したステップF12〜F1
7,F4〜F9の多重化処理を行う。
If it is confirmed in step F1 that the amount of ES to be multiplexed exists in the buffer of the multiplexing order 3ES, steps F12 to F1 described in the first embodiment.
7. F4 to F9 multiplexing processing is performed.

【0265】次に、分岐Hの処理である多重化順位4E
Sの多重化判断2及び多重化をフローチャートで示す図
16を参照して多重化順位4ESの多重化判断2及び多
重化について上述の多重化順位3ESの多重化判断2及
び多重化との相違点を重点的に説明すると、この多重化
順位4ESの多重化判断2及び多重化は、以下の説明を
除き、ステップステップF12〜F16,F4〜F9の
各々をステップH12〜H16,H4〜H9の各々に、
多重化順位3ESを多重化順位4ESに、空き容量12
を空き容量22に、仮SCR2を仮SCR3にそれぞれ
読み替えることにより、多重化順位3ESの多重化判断
2及び多重化の動作と同一である。
Next, the multiplexing order 4E which is the processing of the branch H
16 is a flowchart showing the multiplexing judgment 2 and the multiplexing of S. With reference to FIG. 16, the multiplexing judgment 2 of the multiplexing order 4 ES and the multiplexing are different from the multiplexing judgment 2 of the multiplexing order 3 ES and the multiplexing described above. Primarily, the multiplexing determination 2 and the multiplexing of the multiplexing order 4ES will be performed by the steps H12 to F16 and F4 to F9 respectively except the following description. To
Multiplexing order 3ES to multiplex ordering 4ES, free space 12
Are replaced with the free space 22 and the provisional SCR2 is replaced with the provisional SCR3, respectively, and the operations of the multiplexing determination 2 and the multiplexing of the multiplexing order 3ES are the same.

【0266】まず、多重化順位4ESの多重化判断ステ
ップH1で、パック選択回路71Aは、多重化順位3E
Sのバッファ占有量確認回路に対し容量確認を行い、多
重化対象ES量が多重化順位4ESのバッファに存在し
ないことを確認した場合、多重化順位4ESの多重化判
断2を終了し、多重化処理を終了する。
First, in the multiplexing determination step H1 of the multiplexing order 4ES, the pack selection circuit 71A determines the multiplexing order 3E.
When the capacity of the buffer occupancy confirmation circuit of S is confirmed, and it is confirmed that the amount of ES to be multiplexed does not exist in the buffer of the multiplexing order 4ES, the multiplexing judgment 2 of the multiplexing order 4ES is ended, and the multiplexing is performed. The process ends.

【0267】ステップH1で、多重化対象ES量が多重
化順位4ESのバッファに存在することを確認した場合
は、ステップH12〜H18で、SCRを調整して多重
化順位4ESのMBの空き容量を大きくしたときに、多
重化順位1ES,多重化順位2ES及び多重化順位3E
Sの各々のMBがアンダフローしないかを確認する。
If it is confirmed in step H1 that the amount of ES to be multiplexed exists in the buffer of multiplexing order 4ES, the SCR is adjusted in steps H12 to H18 to adjust the free space of the MB of multiplexing order 4ES. When increased, multiplexing order 1ES, multiplexing order 2ES, and multiplexing order 3E
Check if each MB of S does not underflow.

【0268】まず、MB最小値確認ステップH12で、
多重化順位4ESのMBシミュレーション回路から最小
値確認要求に対する応答としてPTS/DTSの最小値
を受領する。この値を仮SCR3と記述する。
First, in the MB minimum value confirmation step H12,
The minimum value of PTS / DTS is received as a response to the minimum value confirmation request from the MB simulation circuit of multiplexing order 4ES. This value is described as provisional SCR3.

【0269】以下、ステップF13〜F16と同様の処
理であるステップH13〜H16の処理を行う。
Thereafter, the processing of steps H13 to H16, which is the same processing as steps F13 to F16, is performed.

【0270】多重化順位2ES/多重化順位3ESのア
ンダフロー発生判断ステップH14/H16で、アンダ
フローが発生した場合、多重化順位4ESの多重化判断
2を終了し、多重化処理を終了する。
Underflow Occurrence Judgment Step H14 / H16 of Multiplexing Order 2ES / Multiplexing Order 3ES If an underflow occurs, the multiplexing judgment 2 of the multiplexing order 4ES is ended and the multiplexing process is ended.

【0271】ステップH16で、多重化順位2ESのM
Bのアンダフローが発生しなかった場合、SCR変更ス
テップH17で、仮SCR3をSCRとして多重化順位
3ESのMBシミュレーション回路に出力する。多重化
順位3ESのMBシミュレーション回路はSCRと保持
しているDTS/PTSが同値及びSCRより小さいと
き、上記MBの空き容量にDTS/PTSに関連するA
U量を加算し、この加算結果と多重化順位2ESのMB
容量とを比較し、加算結果の方が大きいとき上記MBの
アンダフローをパック選択回路71Aに出力する。
At step H16, M of multiplexing order 2ES
When the underflow of B does not occur, the temporary SCR 3 is output as the SCR to the MB simulation circuit of the multiplexing order 3ES in the SCR changing step H17. In the MB simulation circuit of the multiplexing order 3ES, when the DTS / PTS held by the SCR is the same value or smaller than the SCR, the free space of the MB is related to the DTS / PTS.
U amount is added, and the addition result and MB of multiplexing order 2ES
When the addition result is larger than the capacity, the underflow of MB is output to the pack selection circuit 71A.

【0272】アンダフロー発生判断ステップH18で、
多重化順位3ESのMBのアンダフローが発生したかを
判断し、アンダフローが発生した場合、多重化順位4E
Sの多重化判断2を終了し、多重化処理を終了する。
At the underflow occurrence judgment step H18,
It is determined whether an MB underflow of the multiplexing order 3ES occurs, and if an underflow occurs, the multiplexing order 4E
The multiplexing determination 2 of S is terminated, and the multiplexing process is terminated.

【0273】ステップH18で、多重化順位3ESのM
Bのアンダフローが発生しなかった場合、SCRを調整
しても多重化順位1ES、多重化順位2ES及び多重化
順位3ESのMBがアンダフローしないとして、ステッ
プH19,H4に進み、SCRを調整して多重化順位4
ESのMBの空き容量を大きくする。
At step H18, M of multiplexing order 3ES
If the underflow of B does not occur, it is assumed that the MBs of the multiplexing order 1ES, the multiplexing order 2ES, and the multiplexing order 3ES do not underflow even if the SCR is adjusted, and the process proceeds to steps H19 and H4 to adjust the SCR. And multiplexing order 4
Increase the free space of the ES MB.

【0274】SCR変更ステップH19で、仮SCR3
をパック選択回路71Aが保持しているSCRに設定す
ることにより変更すると共に、SCR生成回路79に出
力する。各MBシミュレーション回路は、変更されたS
CRの値に合わせ、保持値の変更を行う。
At the SCR change step H19, the temporary SCR3
Is set to the SCR held by the pack selection circuit 71A to change it and output it to the SCR generation circuit 79. Each MB simulation circuit has a modified S
The held value is changed according to the CR value.

【0275】空き容量確認ステップH4で、パック選択
回路71Aは、多重化順位3ESのMBシミュレーショ
ン回路から空き容量確認要求に対する応答として空き容
量を受領する。この空き容量を空き容量22とする。
At the free space confirmation step H4, the pack selection circuit 71A receives the free space as a response to the free space confirmation request from the MB simulation circuit of the multiplexing order 3ES. This free space is called free space 22.

【0276】空き容量判断ステップH5で、パック選択
回路71Aは、空き容量22が多重化順位4ESの多重
化ES量より大きいかを判断し、空き容量22より多重
化順位4ESの多重化ES量が大きい場合、ステップH
12,H13,H14,H15,H16,H17,H1
8,H19,H4,H5を空き容量22が上記多重化E
S量より大きくなるまで繰り返す。
In the free capacity determination step H5, the pack selection circuit 71A determines whether or not the free capacity 22 is larger than the multiplexing ES amount of the multiplexing order 4ES, and the empty ES 22 determines the multiplexing ES amount of the multiplexing order 4ES. If larger, step H
12, H13, H14, H15, H16, H17, H1
8, H19, H4, H5 are allocated to the empty space 22 by the multiplexing E
Repeat until the amount exceeds S.

【0277】ステップH5で、空き容量22が上記多重
化ES量より大きい場合、多重化順位3ESの場合と同
様の処理であるステップH6〜H9で、多重化順位4E
Sの多重化を行う。
If the free space 22 is larger than the amount of multiplexing ES in step H5, the same processing as in the case of multiplexing order 3ES is performed in steps H6 to H9.
S is multiplexed.

【0278】多重化回路72Aは、入力ES、SCR、
PTS、DTS、AU量、ピクチャタイプにから多重化
を行い、PSを出力する。
The multiplexing circuit 72A has inputs ES, SCR,
The PTS, DTS, AU amount, and picture type are multiplexed, and PS is output.

【0279】各MBシミュレーション回路は、変更され
たSCRの値に合わせ、保持値の変更を行う。
Each MB simulation circuit changes the held value according to the changed SCR value.

【0280】次に、本発明の第3の実施の形態を図1と
共通の構成要素には共通の参照文字/数字を付して同様
にブロックで示す図17を参照すると、この図に示す本
実施の形態のプログラムストリーム多重化装置の前述の
第1の実施の形態との相違点は、多重器7の代わりに、
パック選択回路71とVB占有量確認回路73とVMB
シミュレーション回路74とAB占有量確認回路75,
77とAMBシミュレーション回路76,78とSCR
生成回路79の各々の機能を適切なソフトウェアにより
マイクロコントローラ80に置換した多重器7Bを備え
ることである。
Next, referring to FIG. 17, which shows a block diagram of the third embodiment of the present invention in which components common to those in FIG. The difference between the program stream multiplexer of the present embodiment and the first embodiment described above is that instead of the multiplexer 7,
Pack selection circuit 71, VB occupation amount confirmation circuit 73, and VMB
The simulation circuit 74 and the AB occupation amount confirmation circuit 75,
77 and AMB simulation circuit 76, 78 and SCR
A multiplexer 7B is provided in which each function of the generation circuit 79 is replaced with a microcontroller 80 by appropriate software.

【0281】マイクロコントローラ80は、第1の実施
の形態で説明したプログラムストリーム多重化方法のア
ルゴリズムに対応する処理機能を持たせることにより、
上記機能を実現する。
The microcontroller 80 has a processing function corresponding to the algorithm of the program stream multiplexing method described in the first embodiment,
The above functions are realized.

【0282】[0282]

【発明の効果】以上説明したように、本発明のプログラ
ムストリーム多重化方法及び装置は、P−STDのビデ
オESを保持するVMB及び第1,第2のオーディオE
Sの各々を保持する第1,第2のAMBの各々のメモリ
占有量の状態を管理し、上記VMB及び上記第1,第2
のAMBの空になる順番でビデオES及び第1,第2の
オーディオESを多重化するよう多重化順位付け及び多
重化判断を行い多重化の制御を行うパック選択回路を備
え、メインバッファ(MB)の状態を管理し、複数のE
Sを多重化するとき、MBが空になる順番で各ESの多
重化を行うことにより、MB容量が同一のESを多重化
しても、MBがアンダフローすることなく多重化を可能
とするという効果がある。
As described above, according to the program stream multiplexing method and apparatus of the present invention, the VMB holding the video ES of the P-STD and the first and second audio Es.
The state of the memory occupancy of each of the first and second AMBs holding each S is managed, and the VMB and the first and second AMBs are managed.
Of the main buffer (MB) including a pack selection circuit for performing multiplexing ordering and multiplexing determination to control the multiplexing so that the video ES and the first and second audio ESs are multiplexed in the order in which the AMBs are empty. ) Status is managed and multiple E
When S is multiplexed, each ES is multiplexed in the order in which the MB becomes empty, so that even if ESs having the same MB capacity are multiplexed, the MBs can be multiplexed without underflowing. effective.

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

【図1】本発明のプログラムストリーム多重化装置の第
1の実施の形態を示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of a program stream multiplexing device of the present invention.

【図2】本実施の形態のP−STD(プログラムシステ
ムターゲットデコーダ)を示すブロック図である。
FIG. 2 is a block diagram showing a P-STD (program system target decoder) of the present embodiment.

【図3】本実施の形態のプログラムストリーム多重化装
置の動作である本実施の形態のプログラムストリーム多
重化方法における処理を示すフローチャートである。
FIG. 3 is a flowchart showing a process in the program stream multiplexing method of the present embodiment, which is an operation of the program stream multiplexing apparatus of the present embodiment.

【図4】図3の分岐Bの処理を示すフローチャートであ
る。
FIG. 4 is a flowchart showing a process of branch B in FIG.

【図5】図4の分岐Cの処理を示すフローチャートであ
る。
5 is a flowchart showing a process of branch C of FIG.

【図6】図5の分岐Dの処理を示すフローチャートであ
る。
FIG. 6 is a flowchart showing a process of branch D in FIG.

【図7】図6の分岐Eの処理を示すフローチャートであ
る。
FIG. 7 is a flowchart showing a process of branch E in FIG.

【図8】図7の分岐Fの処理を示すフローチャートであ
る。
8 is a flowchart showing the processing of branch F in FIG. 7. FIG.

【図9】本実施の形態における各回路の多重化前及び多
重化後の状態を示す説明図である。
FIG. 9 is an explanatory diagram showing a state of each circuit before and after multiplexing in the present embodiment.

【図10】本発明のプログラムストリーム多重化装置の
第2の実施の形態を示すブロック図である。
FIG. 10 is a block diagram showing a second embodiment of the program stream multiplexing device of the present invention.

【図11】本実施の形態のP−STDを示すブロック図
である。
FIG. 11 is a block diagram showing a P-STD of the present embodiment.

【図12】本実施の形態のプログラムストリーム多重化
装置の動作である本実施の形態のプログラムストリーム
多重化方法を示すフローチャートである。
FIG. 12 is a flowchart showing an operation of the program stream multiplexing device of the present embodiment, showing a program stream multiplexing method of the present embodiment.

【図13】本実施の形態を特徴付ける分岐Cの処理を示
すフローチャートである。
FIG. 13 is a flowchart showing a process of a branch C that characterizes this embodiment.

【図14】図13の分岐Gの処理を示すフローチャート
である。
FIG. 14 is a flowchart showing a process of branch G in FIG.

【図15】本実施の形態を特徴付ける分岐Fの処理を示
すフローチャートである。
FIG. 15 is a flowchart showing a process of a branch F that characterizes this embodiment.

【図16】図15の分岐Hの処理を示すフローチャート
である。
16 is a flowchart showing the processing of branch H in FIG.

【図17】本発明のプログラムストリーム多重化装置の
第3の実施の形態を示すブロック図である。
FIG. 17 is a block diagram showing a third embodiment of the program stream multiplexing device of the present invention.

【図18】従来の第1のプログラムストリーム多重化装
置の一例を示すブロック図である。
FIG. 18 is a block diagram showing an example of a conventional first program stream multiplexer.

【図19】従来の第1のプログラムストリーム多重化装
置のP−STDを示すブロック図である。
FIG. 19 is a block diagram showing a P-STD of a conventional first program stream multiplexer.

【図20】従来の第1のプログラムストリーム多重化装
置の動作である従来の第1のプログラムストリーム多重
化方法における処理を示すフローチャートである。
FIG. 20 is a flowchart showing a process in a conventional first program stream multiplexing method which is an operation of the conventional first program stream multiplexing apparatus.

【図21】図20の分岐Mの処理を示すフローチャート
である。
21 is a flowchart showing a process of branch M of FIG. 20. FIG.

【図22】図21の分岐Nの処理を示すフローチャート
である。
22 is a flowchart showing a process of branch N in FIG. 21. FIG.

【図23】従来の第2のプログラムストリーム多重化装
置の一例を示すブロック図である。
FIG. 23 is a block diagram showing an example of a second conventional program stream multiplexer.

【図24】従来の第2のプログラムストリーム多重化装
置のP−STDを示すブロック図である。
FIG. 24 is a block diagram showing a P-STD of a second conventional program stream multiplexer.

【図25】従来の第2のプログラムストリーム多重化装
置の動作である従来の第2のプログラムストリーム多重
化方法における処理を示すフローチャートである。
FIG. 25 is a flowchart showing a process in a second conventional program stream multiplexing method which is an operation of the second conventional program stream multiplexing apparatus.

【図26】図25の分岐Pの処理を示すフローチャート
である。
FIG. 26 is a flowchart showing a process of branch P in FIG. 25.

【図27】図26の分岐MAの処理を示すフローチャー
トである。
FIG. 27 is a flowchart showing the processing of the branch MA of FIG. 26.

【図28】図27の分岐Qの処理を示すフローチャート
である。
28 is a flowchart showing a process of branch Q in FIG. 27. FIG.

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

1 ビデオエンコーダ 2,3,8 オーディオエンコーダ 4 ビデオバッファ 5,6,9 オーディオバッファ 7,7A,7B,107,107A 多重器 71,71A,171,171A パック選択回路 72,72A,172 多重化回路 73 VB占有量確認回路 74 VMBシミュレーション回路 75,77,81 AB占有量確認回路 76,78,82 AMBシミュレーション回路 79 SCR生成回路 80 マイクロコントローラ 201,301 デマルチプレクス部 202 システムクロック生成部 203 タイムスタンプ比較部 204 VMB 205 ビデオデコーダ 206,212 セレクタ 207,209 AMB 208,210 オーディオデコーダ 211 再配列バッファ 1 video encoder 2,3,8 audio encoder 4 video buffer 5, 6, 9 audio buffer 7,7A, 7B, 107,107A multiplexer 71, 71A, 171, 171A pack selection circuit 72, 72A, 172 multiplexing circuit 73 VB occupancy confirmation circuit 74 VMB simulation circuit 75,77,81 AB Occupancy Check Circuit 76,78,82 AMB simulation circuit 79 SCR generation circuit 80 Microcontroller 201,301 Demultiplex part 202 system clock generator 203 Timestamp comparison section 204 VMB 205 video decoder 206,212 selector 207,209 AMB 208, 210 audio decoder 211 Rearrangement buffer

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C059 KK35 MA00 PP04 RB01 RB10 RC03 RC04 RC32 UA34 5C063 AB03 AB05 AC01 AC05 AC10 CA11 DA01 DA05 DA07 DA13 5K028 AA14 EE05 EE08 KK01 KK12 SS05 SS15 SS24    ─────────────────────────────────────────────────── ─── Continued front page    F-term (reference) 5C059 KK35 MA00 PP04 RB01 RB10                       RC03 RC04 RC32 UA34                 5C063 AB03 AB05 AC01 AC05 AC10                       CA11 DA01 DA05 DA07 DA13                 5K028 AA14 EE05 EE08 KK01 KK12                       SS05 SS15 SS24

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 ディジタルビデオ信号及び第1,第2の
ディジタルオーディオ信号の各々を入力し所定の圧縮符
号化プロトコルに従って圧縮符号化を行いビデオエレメ
ンタリストリーム(以下、ビデオES)及び第1及び第
2のオーディオエレメンタリストリーム(以下、オーデ
ィオES)の各々を生成し、これらビデオES及び第1
及び第2のオーディオESを多重化してプログラムスト
リームを生成するプログラムストリーム多重化方法にお
いて、 前記プログラムストリームを作成するために符号化で使
用される仮想的な復号器であるプログラムシステムター
ゲットデコーダ(以下、P−STD)の前記ビデオES
を保持するビデオメインバッファ(以下、VMB)及び
前記第1,第2のオーディオESを保持する第1,第2
のオーディオメインバッファ(以下、AMB)の各々の
メモリ占有量の状態を管理し、前記VMB及び第1,第
2のAMBの空になる順番で前記ビデオES及び前記第
1,第2のオーディオESを多重化するよう多重化順位
付け及び多重化判断を行い多重化の制御を行うことを特
徴とするプログラムストリーム多重化方法。
1. A video elementary stream (hereinafter referred to as a video ES) and first and first digital video signals and first and second digital audio signals are inputted and compression-encoded according to a predetermined compression-encoding protocol. Each of the two audio elementary streams (hereinafter, audio ES) is generated, and these video ES and the first ES are generated.
And a program stream multiplexing method for generating a program stream by multiplexing the second audio ES, a program system target decoder (hereinafter, referred to as a virtual decoder used in encoding for creating the program stream). P-STD) video ES
And a video main buffer (hereinafter, VMB) for holding the first and second audio ESs.
Managing the state of memory occupancy of each of the audio main buffers (hereinafter referred to as AMBs) of the video ES and the first and second audio ESs in the empty order of the VMB and the first and second AMBs. A program stream multiplexing method characterized by performing multiplexing ranking and multiplexing determination so as to multiplex, and controlling multiplexing.
【請求項2】 前記VMB及び前記第1,第2のAMB
のメモリ占有量の状態を保持するVMBシミュレーショ
ン回路及び第1,第2のAMBシミュレーション回路を
有し、 前記VMBシミュレーション回路及び第1,第2のAM
Bシミュレーション回路の各々の上記占有量保持内容か
ら、前記P−STD内のメインバッファが空になる順番
である空き順位を把握し、 前記空き順位を前記ビデオES及び第1及び第2のオー
ディオESの多重化順位として多重化順位付けを行い、
その多重化順位で多重化が行えるかの第1の多重化判断
を行い、多重化できる場合多重化を行い、 前記ビデオES及び第1及び第2のオーディオESの全
てが多重化できないときは、前記多重化順位に従い多重
化できない要因である多重化不可能要因を確認し、 前記多重化不可能要因が、該当ESのメインバッファに
空きがない無空バッファ状態による場合、第2の多重化
判断として、前記VMBシミュレーション回路及び前記
第1,第2のAMBシミュレーション回路の各々に保持
している第1,第2のプレゼンテーションタイムスタン
プ(以下、PTS)又は復号タイムスタンプ(以下、D
TS)の最小値を呼び出し、その値をシステムクロック
リファレンス(以下、SCR)に設定することにより、
空きがない前記メインバッファに空きを作成して多重化
を行うことにより、前記メインバッファのサイズに依存
せず、多重化を行うことを特徴とする請求項1記載のプ
ログラムストリーム多重化方法。
2. The VMB and the first and second AMBs
The VMB simulation circuit and the first and second AMB simulation circuits that hold the state of the memory occupancy of the VMB simulation circuit and the first and second AMs.
Based on the content of the occupancy held in each of the B simulation circuits, the empty order, which is the order in which the main buffer in the P-STD becomes empty, is grasped, and the empty order is set to the video ES and the first and second audio ESs. Multiplex ranking is performed as the multiplexing order of
A first multiplexing determination is made as to whether multiplexing can be performed in the multiplexing order, multiplexing is performed when multiplexing is possible, and when the video ES and all of the first and second audio ESs cannot be multiplexed, A non-multiplexing factor that is a factor that cannot be multiplexed according to the multiplexing order is confirmed, and if the non-multiplexing factor is an empty buffer state in which there is no free space in the main buffer of the ES, a second multiplexing determination As the first and second presentation time stamps (hereinafter, PTS) or decoding time stamps (hereinafter, D) held in the VMB simulation circuit and the first and second AMB simulation circuits, respectively.
By calling the minimum value of TS) and setting that value to the system clock reference (hereinafter, SCR),
2. The program stream multiplexing method according to claim 1, wherein the multiplexing is performed without depending on the size of the main buffer by creating a vacancy in the main buffer having no vacancy and performing the multiplexing.
【請求項3】 前記多重化順位付けが、前記VMBシミ
ュレーション回路及び第1,第2のAMBシミュレーシ
ョン回路の各々から呼び出した前記DTS及び前記第
1,第2のPTSの各々の最大値を比較し、前記最大値
が小さい方から大きい方に優先的に多重化するよう順序
付けし、 前記第1の多重化判断が、前記VMB及び前記第1,第
2のAMBの各々のシミュレーション用の前記SCRの
調整を伴わない多重化判断であり、前記第2の多重化判
断が、前記SCRの調整を伴う多重化判断であることを
特徴とする請求項2記載のプログラムストリーム多重化
方法。
3. The multiplexing ordering compares the maximum values of the DTS and the first and second PTS called from the VMB simulation circuit and the first and second AMB simulation circuits, respectively. , Ordering such that the maximum value is preferentially multiplexed from the smallest value to the largest value, and the first multiplexing decision is made on the SCR for simulation of each of the VMB and the first and second AMBs. The program stream multiplexing method according to claim 2, wherein the determination is a multiplexing determination without adjustment, and the second determination is a multiplexing determination with adjustment of the SCR.
【請求項4】 前記VMBシミュレーション回路及び前
記第1,第2のAMBシミュレーション回路の各々が、
前記P−STDのそれぞれ対応する前記VMB又は前記
第1又は第2のAMBの(以下、MB)の空き容量を保
持し、出力ビデオ又は第1又は第2のオーディオESの
データ量(以下、出力ES量)の供給に応答して、前記
MBの空き容量から前記出力ES量を減算し使用可能容
量を求め、 アクセスユニットの数であるAU量及び前記DTS又は
前記第1又は第2のPTSの各々(以下、DTS/PT
S)の供給に応答してこれらAU量及びDTS/PTS
を関連付けて保持し、 前記SCR生成回路が出力する第1のSCRの値と前記
DTS/PTSの値とを比較し、前記DTS/PTS値
の方が小さいとき、前記空き容量に前記DTS/PTS
に関連する前記AU量を加算し、 前記DTS/PTSの値の方が大きいとき、保持してい
た前記DTS/PTS及び前記DTS/PTSに関連す
る前記AU量を削除し、 前記パック選択回路からの第2のSCRの供給に応答し
て、前記第2のSCRの値と前記DTS/PTSの値を
比較し、前記DTS/PTSの値が前記第2のSCR値
と同一又は小さいとき、前記DTS/PTSに関連する
AU量を前記パック選択回路に出力するとともに、前記
MBの空き容量に前記DTS/PTSに関連するAU量
を加算し、 前記加算結果の値である加算値と前記MBの容量とを比
較し、前記加算値の方が大きいとき前記MBのアンダフ
ローを出力し、 最大値確認要求の供給に応答して、前記DTS/PTS
の最大値を出力し、 空き容量確認要求の供給に応答して前記MBの空き容量
を出力し、 最小値確認要求の供給に応答して、前記DTS/PTS
の最小値を出力することを特徴とする請求項2記載のプ
ログラムストリーム多重化方法。
4. The VMB simulation circuit and each of the first and second AMB simulation circuits include:
The free space of the VMB or the first or second AMB (hereinafter, MB) corresponding to the P-STD is held, and the data amount of the output video or the first or second audio ES (hereinafter, output) is held. In response to the supply of the ES amount), the output ES amount is subtracted from the free space of the MB to obtain the usable capacity, and the AU amount, which is the number of access units, and the DTS or the first or second PTS. Each (hereinafter, DTS / PT
S) supply of these AU amounts and DTS / PTS
Are stored in association with each other, and the value of the first SCR output from the SCR generation circuit is compared with the value of the DTS / PTS. When the DTS / PTS value is smaller, the DTS / PTS is added to the free space.
When the DTS / PTS value is larger, the DTS / PTS and the AU amount associated with the DTS / PTS that are held are deleted, In response to the supply of the second SCR, the value of the second SCR and the value of the DTS / PTS are compared, and when the value of the DTS / PTS is the same as or smaller than the second SCR value, The AU amount related to DTS / PTS is output to the pack selection circuit, the AU amount related to DTS / PTS is added to the free space of the MB, and the addition value that is the value of the addition result and the MB The capacity is compared, the underflow of the MB is output when the added value is larger, and the DTS / PTS is sent in response to the supply of the maximum value confirmation request.
Of the DTS / PTS in response to the supply of the free space confirmation request, and the free space of the MB in response to the supply of the free space confirmation request.
3. The program stream multiplexing method according to claim 2, wherein the minimum value of is output.
【請求項5】 ディジタルビデオ信号及び第1,第2の
ディジタルオーディオ信号の各々を入力し所定の圧縮符
号化プロトコルに従って圧縮符号化を行いビデオエレメ
ンタリストリーム(以下、ビデオES)及び第1及び第
2のオーディオエレメンタリストリーム(以下、オーデ
ィオES)の各々を生成し、これらビデオES及び第1
及び第2のオーディオESを多重化してプログラムスト
リームを生成するプログラムストリーム多重化方法にお
いて、 前記プログラムストリームを作成するために符号化で使
用される仮想的な復号器であるプログラムシステムター
ゲットデコーダ(以下、P−STD)の前記ビデオES
を保持するビデオメインバッファ(以下、VMB)及び
前記第1,第2のオーディオESを保持する第1,第2
のオーディオメインバッファ(以下、AMB)の各々の
メモリ占有量の状態を保持するVMBシミュレーション
回路及び第1,第2のAMBシミュレーション回路の各
々が保持している復号タイムスタンプ(以下、DTS)
又は第1,第2のプレゼンテーションタイムスタンプ
(以下、PTS)の各々の最大値を比較し、前記最大値
が1番小さいDTS又は第1,第2のPTSに対応する
ビデオES又は第1又は第2のオーディオES(以下、
ES)を多重化順位1とし、以下、前記最大値が大きく
なる順序で優先的に多重化する多重化順位付けを行う多
重化順位付けステップと、 前記多重化順位1であるES(以下、多重化順位1E
S)の前記P−STDのシミュレーション用のシステム
クロックリファレンス(以下、SCR)の調整を伴わな
い多重化判断である第1の多重化判断及び多重化処理
と、 前記多重化順位が2のES(以下、多重化順位2ES)
の前記第1の多重化判断及び多重化処理と、 前記多重化順位が3のES(以下、多重化順位2ES)
の前記第1の多重化判断及び多重化処理と、 前記多重化順位1ESの前記SCRの調整を伴う多重化
判断である第2の多重化判断及び多重化処理と、 前記多重化順位2ESの前記第2の多重化判断及び多重
化処理と、 前記多重化順位3ESの前記第2の多重化判断及び多重
化処理とを行うことを特徴とするプログラムストリーム
多重化方法。
5. A video elementary stream (hereinafter, referred to as a video ES) and first and first digital video signals and first and second digital audio signals are input and compression-encoded according to a predetermined compression-encoding protocol. Each of the two audio elementary streams (hereinafter, audio ES) is generated, and these video ES and the first ES are generated.
And a program stream multiplexing method for generating a program stream by multiplexing the second audio ES, a program system target decoder (hereinafter, referred to as a virtual decoder used in encoding for creating the program stream). P-STD) video ES
And a video main buffer (hereinafter, VMB) for holding the first and second audio ESs.
Time stamp (hereinafter, DTS) held by each of the VMB simulation circuit and the first and second AMB simulation circuits, which holds the state of memory occupancy of each audio main buffer (hereinafter, AMB)
Alternatively, the maximum value of each of the first and second presentation time stamps (hereinafter, PTS) is compared, and the video ES corresponding to the DTS or the first and second PTS having the smallest maximum value or the first or first 2 audio ES (hereinafter,
ES) as a multiplexing order 1, and a multiplexing ordering step of performing a multiplexing ordering in which the maximum value is preferentially multiplexed in the order of increasing the maximum value; and an ES having the multiplexing order 1 (hereinafter, the multiplexing order). Rank 1E
S), a first multiplexing determination and multiplexing process, which is a multiplexing determination without adjusting a system clock reference (hereinafter, SCR) for simulating the P-STD, and an ES (where the multiplexing order is 2) Below, multiplexing order 2ES)
The first multiplexing judgment and multiplexing process of the ES, and the ES having the multiplexing order of 3 (hereinafter, the multiplexing order 2ES)
Said first multiplexing decision and multiplexing process, said second multiplexing decision and multiplexing process which is a multiplexing decision with said SCR adjustment of said multiplexing order 1ES, and said multiplex order 2ES said A program stream multiplexing method, comprising: performing a second multiplexing determination and multiplexing process and the second multiplexing determination and multiplexing process of the multiplexing order 3ES.
【請求項6】 前記多重化順位1ESの前記第1の多重
化判断及び多重化処理が、多重化するためのデータ量の
ES(以下、多重化対象ES)が前記多重化順位1ES
のバッファに存在するかを判断するため、前記多重化順
位1ESのバッファ占有量を確認し、前記多重化対象E
Sが前記多重化順位1ESのバッファに存在しない場
合、この多重化順位1ESの第1の多重化判断を終了
し、前記多重化順位2ESの第1の多重化判断に進む多
重化順位1ESの多重化判断ステップと、 前記多重化順位1ESの多重化判断ステップで、前記多
重化対象ESが前記多重化順位1ESのバッファに存在
する場合、前記多重化順位1ESの前記メインバッファ
がそのESを入力してもオーバフローもアンダフローも
起こさず多重化が可能であることを判断する多重化順位
1ESの多重化可能性判断処理と、 前記多重化順位1ESの多重化可能性判断処理で、多重
化が可能である場合、前記多重化順位1ESの多重化を
行う多重化順位1ESの多重化処理とを有することを特
徴とする請求項5記載のプログラムストリーム多重化方
法。
6. The ES of the amount of data to be multiplexed in the first multiplexing judgment and the multiplexing process of the multiplexing order 1ES (hereinafter, a multiplexing target ES) is the multiplexing order 1ES.
To determine whether or not it exists in the buffer of the multiplexing target E
If S does not exist in the buffer of the multiplexing order 1ES, the first multiplexing decision of the multiplexing order 1ES is terminated, and the process proceeds to the first multiplexing decision of the multiplexing order 2ES. In the multiplexing determination step and the multiplexing determination step of the multiplexing order 1ES, if the multiplexing target ES exists in the buffer of the multiplexing order 1ES, the main buffer of the multiplexing order 1ES inputs the ES. Even if it does not overflow or underflow, it can be multiplexed by the multiplexing possibility judgment process of the multiplexing order 1ES that judges that multiplexing is possible and the multiplexing possibility judgment process of the multiplexing order 1ES. 6. The program stream multiplexing according to claim 5, further comprising: multiplexing processing of multiplexing order 1ES for performing multiplexing of the multiplexing order 1ES. Law.
【請求項7】 前記多重化順位1ESの多重化可能性判
断処理が、前記多重化順位1ESのMBシミュレーショ
ン回路の空き容量である第1の空き容量を呼び出す第1
の空き容量確認ステップと、 前記第1の空き容量から前記多重化順位1ESの多重化
対象ES量を減算し、第2の空き容量を算出する第2の
空き容量算出ステップと、 多重化を行うときに付加する前記SCRを前記多重化順
位1ESの前記MBシミュレーション回路に出力し、前
記多重化順位1ESの前記MBシミュレーション回路
が、前記SCRで前記多重化順位1ESの前記MBから
削除されるアクセスユニットの数であるAU量を呼び出
す削除AU量呼出ステップと、 前記第2の空き容量に前記AU量を加算し、第3の空き
容量を算出する第3の空き容量算出ステップと、 前記第3の空き容量が、前記多重化順位1ESの前記メ
インバッファの容量内か判断し、前記メインバッファの
容量内である場合は前記多重化順位1ESの多重化処理
に進み、前記メインバッファの容量を超える場合は前記
多重化順位1ESの多重化判断1を終了し、前記多重化
順位2ESの前記第1の多重化判断に進む多重化順位1
ESのMB容量判断ステップとを有し、 前記多重化順位1ESの前記多重化処理が、前記多重化
順位1ESのバッファが出力ESデータ量(以下、ES
量)の指示に応答して指示された前記ES量を出力する
出力ES量指示ステップと、 前記プログラムストリームPSに付加するSCRを出力
し、前記多重化対象ESが前記AUの先頭を含む場合、
前記多重化順位1ESがオーディオESの場合は前記P
TSと前記AU量を出力し、ビデオESの場合は前記P
TSと前記DTSと前記AU量とピクチャタイプを出力
するSCRとESパラメータ出力ステップと、 前記プログラムストリームに付加する前記SCRをSC
R生成回路に出力するシミュレーション用SCR生成ス
テップと、 前記多重化対象ESの前記ES量を前記多重化順位1E
Sの前記MBシミュレーション回路に出力し、前記多重
化対象ESが前記AUの先頭を含む場合、前記多重化順
位1ESがオーディオESの場合は前記PTSと前記A
U量を出力し、ビデオESの場合は前記DTSと前記A
U量とを出力する多重化対象ES量・パラメータ出力ス
テップと、 前記SCRに予め定めたSCR加算値を加算し保持する
SCR加算値の加算ステップとを有し、 前記ESと前記SCRと前記PTSと前記DTSと前記
AU量と前記ピクチャタイプに基づき多重化を行い、前
記プログラムストリームを出力することを特徴とする請
求項6記載のプログラムストリーム多重化方法。
7. A first vacant capacity which is a vacant capacity of the MB simulation circuit having the multiplexing order of 1ES is called in the multiplexing possibility determination process of the multiplexing order of 1ES.
And a second free space calculation step of calculating a second free space by subtracting the multiplexing target ES amount of the multiplexing order 1ES from the first free space, and performing the multiplexing. The access unit which outputs the SCR to be added at the time to the MB simulation circuit of the multiplexing order 1ES, and the MB simulation circuit of the multiplexing order 1ES is deleted from the MB of the multiplexing order 1ES by the SCR. A deletion AU amount calling step for calling an AU amount that is the number of AU numbers, a third free capacity calculating step for adding the AU amount to the second free capacity, and calculating a third free capacity; It is judged whether the free space is within the capacity of the main buffer with the multiplexing order of 1 ES, and if it is within the capacity of the main buffer, the multiplexing with the multiplexing order of 1 ES is performed. If the capacity of the main buffer is exceeded, the multiplexing decision 1 of the multiplexing order 1ES is ended, and the process proceeds to the first multiplexing decision of the multiplexing order 2ES.
And a step of determining the MB capacity of the ES, wherein the buffer of the multiplexing order 1ES outputs the ES data amount (hereinafter, ES
Output ES amount instructing step of outputting the instructed ES amount in response to an instruction of (amount), outputting an SCR to be added to the program stream PS, and the multiplexing target ES including the head of the AU,
If the multiplexing order 1 ES is an audio ES, the P
Outputs TS and the AU amount, and in the case of a video ES, outputs the P
The SCR and the ES parameter output step of outputting the TS, the DTS, the AU amount, and the picture type, and the SCR added to the program stream to the SC
An SCR generation step for simulation that is output to an R generation circuit, and the ES amount of the ES to be multiplexed is the multiplexing order 1E.
When the multiplexing target ES includes the head of the AU, the PTS and the ATS are output to the MB simulation circuit of S.
U amount is output, and in the case of video ES, the DTS and A
The ES includes the ES, the SCR, and the PTS, and a multiplexing target ES amount / parameter output step of outputting a U amount, and an SCR addition value adding step of adding and holding a predetermined SCR addition value to the SCR. 7. The program stream multiplexing method according to claim 6, wherein multiplexing is performed based on the DTS, the AU amount, and the picture type, and the program stream is output.
【請求項8】 ディジタルビデオ信号を入力し所定の圧
縮符号化プロトコルに従って圧縮符号化を行いビデオエ
レメンタリストリーム(以下、ビデオES)を出力する
ビデオエンコーダと、前記ビデオESを保持するビデオ
バッファと、 第1及び第2のディジタルオーディオ信号の各々を入力
しそれぞれ前記圧縮符号化プロトコルに従って圧縮符号
化を行い第1及び第2のオーディオエレメンタリストリ
ーム(以下、オーディオES)の各々を出力する第1及
び第2のオーディオエンコーダと、前記第1及び第2の
オーディオESの各々を保持する第1及び第2のオーデ
ィオバッファと、前記ビデオバッファ及び第1,第2の
オーディオバッファの各々に保持している前記ビデオE
S及び第1,第2のオーディオESを多重化してプログ
ラムストリームとして出力する多重器とを備えるプログ
ラムストリーム多重化装置において、 前記多重器が、前記ビデオバッファ内の前記ビデオES
の占有量を確認し保持するVB占有量確認回路と、 前記プログラムストリームを作成するために符号化で使
用される仮想的な復号器であるプログラムシステムター
ゲットデコーダ(以下、P−STD)のビデオメインバ
ッファ(以下、VMB)のシミュレーションを行うVM
Bシミュレーション回路と、 前記第1,第2のオーディオバッファの各々内の前記第
1,第2のオーディオESの各々の占有量をそれぞれ確
認保持する第1,第2のAB占有量確認回路と、 前記P−STDの前記第1,第2のオーディオメインバ
ッファ(以下、AMB)の各々のシミュレーションを行
う第1,第2のAMBシミュレーション回路と、 前記ビデオES及び第1,第2のオーディオESに対し
前記P−STDの前記VMB及び前記第1,第2のAM
Bの各々のメモリ占有量の状態を管理し、前記VMB及
び第1,第2のAMBの空になる順番で前記ビデオES
及び第1,第2のオーディオESを多重化するよう多重
化順位付け及び多重化判断を行い多重化の制御を行うパ
ック選択回路と、 前記パック選択回路からのデータに基づき前記P−ST
Dの前記VMB及び第1,第2のAMBのシミュレーシ
ョン用のシステムクロックリファレンス(以下、SC
R)を生成するSCR生成回路と、 前記パック選択回路の制御により多重化を行う多重化回
路とを備えることを特徴とするプログラムストリーム多
重化装置。
8. A video encoder for inputting a digital video signal, performing compression encoding according to a predetermined compression encoding protocol and outputting a video elementary stream (hereinafter referred to as video ES), and a video buffer holding the video ES. First and second inputting each of the first and second digital audio signals, performing compression encoding according to the compression encoding protocol, respectively, and outputting each of first and second audio elementary streams (hereinafter referred to as audio ES) A second audio encoder, first and second audio buffers for holding each of the first and second audio ES, and a video buffer and each of the first and second audio buffers Video E
A program stream multiplexer comprising: a multiplexer for multiplexing S and first and second audio ES and outputting the multiplexed program ES as a program stream, wherein the multiplexer includes the video ES in the video buffer.
VB occupancy confirmation circuit that confirms and holds the occupancy of the program, and a video main of a program system target decoder (hereinafter, P-STD) that is a virtual decoder used in encoding to create the program stream. A VM that simulates a buffer (hereinafter, VMB)
A B simulation circuit; first and second AB occupation amount confirmation circuits for confirming and retaining the respective occupation amounts of the first and second audio ES in the first and second audio buffers, respectively. First and second AMB simulation circuits for simulating each of the first and second audio main buffers (hereinafter, AMB) of the P-STD, and the video ES and the first and second audio ES. On the other hand, the VMB of the P-STD and the first and second AMs
Managing the state of the memory occupancy of each of the Bs, and the video ES in the order of emptying the VMB and the first and second AMBs.
And a pack selection circuit for performing multiplexing ranking and multiplexing determination to control the multiplexing so as to multiplex the first and second audio ESs, and the P-ST based on the data from the pack selection circuit.
System clock reference for simulation of the VMB of D and the first and second AMB (hereinafter, SC
A program stream multiplexing device comprising: an SCR generation circuit for generating R); and a multiplexing circuit for performing multiplexing under the control of the pack selection circuit.
【請求項9】 前記多重器が、前記パック選択回路と前
記SCR生成回路と前記VMBシミュレーション回路と
前記VB占有量確認回路と前記第1,第2のAB占有量
確認回路の各々の機能をソフトウェアにより置換したマ
イクロコントローラを備えることを特徴とする請求項8
記載のプログラムストリーム多重化装置。
9. The multiplexer implements the functions of the pack selection circuit, the SCR generation circuit, the VMB simulation circuit, the VB occupation amount confirmation circuit, and the first and second AB occupation amount confirmation circuits by software. 9. The controller according to claim 8, further comprising:
A program stream multiplexer as described.
【請求項10】 前記P−STDが、入力した前記プロ
グラムストリームを前記ビデオESと前記第1,第2の
オーディオESと前記SCRと、プレゼンテーションタ
イムスタンプ(以下、PTS)及び復号タイムスタンプ
(以下、DTS)に分解するデマルチプレクス部と、 前記SCRの供給を受けシステムタイムクロック(ST
C)を生成するシステムクロック生成部と、 前記ビデオESを保持する前記VMBと、 前記第1,第2のオーディオESの各々を保持する前記
AMBと、 前記ビデオESを復号してビデオ信号Vを出力するビデ
オデコーダと、 前記第1,第2のオーディオESの各々を復号して第
1,第2のオーディオ信号の各々を出力する第1,第2
のオーディオデコーダと、 前記STCと前記PTS又は前記DTSとの比較を行い
比較結果に応じて前記VMB又は前記第1又は第2のA
MBに対し前記PTS又はDTSに対応するESを前記
ビデオデコーダ又は第1又は第2のオーディオデコーダ
に出力するよう指示するとともに後述の第1,第2のセ
レクタの制御信号を出力するタイムスタンプ比較部と、 前記ビデオ信号のピクチャの配列順を変更するため再配
列を行う再配列バッファと、 前記制御信号の供給に応答して前記ビデオ信号を前記再
配列バッファに供給するよう切り替える第1,第2のセ
レクタとを備えることを特徴とする請求項8記載のプロ
グラムストリーム多重化装置。
10. The program stream input by the P-STD includes the video ES, the first and second audio ES, the SCR, a presentation time stamp (hereinafter, PTS), and a decoding time stamp (hereinafter, A demultiplexing unit for decomposing into a DTS, and a system time clock (ST) supplied with the SCR.
C), a system clock generating unit, the VMB holding the video ES, the AMB holding each of the first and second audio ES, and the video signal V by decoding the video ES. A video decoder for outputting, and first and second first and second audio signals for decoding the first and second audio ES and outputting the first and second audio signals, respectively.
Of the audio decoder, and the STC and the PTS or the DTS are compared, and the VMB or the first or second A according to the comparison result.
A time stamp comparison unit for instructing the MB to output the ES corresponding to the PTS or DTS to the video decoder or the first or second audio decoder, and for outputting control signals of the first and second selectors described later. A rearrangement buffer for rearranging the pictures of the video signal in order to change the arrangement order of the pictures; and a first and a second switch for supplying the video signal to the rearrangement buffer in response to the supply of the control signal. 9. The program stream multiplexer according to claim 8, further comprising:
JP2002102270A 2002-04-04 2002-04-04 Program stream multiplexing method and apparatus Withdrawn JP2003298544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002102270A JP2003298544A (en) 2002-04-04 2002-04-04 Program stream multiplexing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002102270A JP2003298544A (en) 2002-04-04 2002-04-04 Program stream multiplexing method and apparatus

Publications (1)

Publication Number Publication Date
JP2003298544A true JP2003298544A (en) 2003-10-17

Family

ID=29388889

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002102270A Withdrawn JP2003298544A (en) 2002-04-04 2002-04-04 Program stream multiplexing method and apparatus

Country Status (1)

Country Link
JP (1) JP2003298544A (en)

Similar Documents

Publication Publication Date Title
US5572333A (en) Compressed data recording method using integral logical block size and physical block size ratios
JP2001346201A (en) Image coder and its method, image decoder and its method, image recorder, image transmitter
EP1279292A2 (en) Rate control and buffer protection for variable bit rate video programs over a constant rate channel
JPH0738857A (en) Synchronization system for time-division video and audio signals
US20060239563A1 (en) Method and device for compressed domain video editing
JPH09509035A (en) Audio / video timing mismatch management
JP2003199045A (en) Information-recording-signal generating method and apparatus, information-signal reproducing method and apparatus, information-signal transmitting method, apparatus and program, and information-signal recording medium
JP3040336B2 (en) Data encoder buffer control system and method
JP2005136633A (en) Moving picture coding apparatus and moving picture coding control method
US7940799B2 (en) Code conversion method and device thereof
WO2003039145A1 (en) Time stamp value controller
JP2003169292A (en) After-recording device, computer program, recording medium, transmission method and reproducing device
JPH09509036A (en) Encoder system level buffer management
JP2002094384A (en) Device and method for compressing image and audio over long time period
JP2003259315A (en) Apparatus and method for transmitting image
JP2003298544A (en) Program stream multiplexing method and apparatus
JP3918332B2 (en) Multiplexer, multiplexing method, and recording medium
JPH09312656A (en) Transmitter and method therefor
JPH0898160A (en) Data multiplexing device
JP3709835B2 (en) Code amount conversion method and apparatus
JP2823806B2 (en) Image decoding device
JP2003125400A (en) Method and apparatus for encoding dynamic image, program as well as method and apparatus for multiplexing dynamic image and voice
JP2005198350A (en) After-recording signal reproducing method
JP2005020056A (en) Data encoder, and data encoding control method
JP4192861B2 (en) MPEG image data recording apparatus and MPEG image data recording method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050607