JPH11155133A - Data multiplexer and its method - Google Patents

Data multiplexer and its method

Info

Publication number
JPH11155133A
JPH11155133A JP32007597A JP32007597A JPH11155133A JP H11155133 A JPH11155133 A JP H11155133A JP 32007597 A JP32007597 A JP 32007597A JP 32007597 A JP32007597 A JP 32007597A JP H11155133 A JPH11155133 A JP H11155133A
Authority
JP
Japan
Prior art keywords
data amount
data
video frame
multiplexing
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP32007597A
Other languages
Japanese (ja)
Inventor
Tomoji Miyazawa
智司 宮澤
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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP32007597A priority Critical patent/JPH11155133A/en
Publication of JPH11155133A publication Critical patent/JPH11155133A/en
Pending legal-status Critical Current

Links

Landscapes

  • Television Systems (AREA)
  • Time-Division Multiplex Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

PROBLEM TO BE SOLVED: To properly multiplex audio data onto a transport stream and to send the multiplexed stream by deciding the amount of voice data to be multiplexed for each video frame period, based on a multiplex object data amount and its correction amount and multiplexing the data on a prescribed transport stream. SOLUTION: A CPU 424 stores the size of data received from data size interfaces IF 30a-30c, an Ethernet(R) IF 420, and a serial IF circuit 422 to a processing RAM 426. Then based on the size of the data to be stored, the order of multiplexing the elementary stream, the timing adjustment and the scheduling or the like are planned to control the multiplexing operation of pitch circuits 34, 36. Based on the multiplexing object data amount and the corrected multiplexing object data amount, a data amount of audio data which are multiplexed for each video frame period is decided, and the audio data with the decided data amount are multiplexed on a prescribed transport stream.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、映像データおよび
音声データを多重化し、MPEG方式(Moving Picture
coding Experts Groupによる高品質動画符号化方式) の
トランスポートストリームを生成するデータ多重化装置
およびその方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for multiplexing video data and audio data and
The present invention relates to a data multiplexing apparatus and method for generating a transport stream of a high quality moving picture coding system by a coding expert group.

【0002】[0002]

【従来の技術】映像データおよび音声データをMPEG
方式などにより圧縮符号化し、所定の伝送パケットに多
重化して視聴者に配信するディジタルテレビジョン放送
が実用化されつつある。MPEG方式においては、音声
・映像データを多重化する場合、送信側で、受信側の伸
長復号装置のバッファ残量を考慮する必要がある。つま
り、MPEG方式の規格に定められている伸長復号装置
の受信バッファに、オーバーフローもアンダーフローも
生じないように、送信側がそのデータ量を管理して、音
声・映像データの多重化し送信することになっており、
さらに、この受信バッファの容量は、音声データに対し
ては4kBと規定されている。
2. Description of the Related Art Video data and audio data are MPEG
Digital television broadcasts, which are compression-encoded by a system or the like, multiplexed into predetermined transmission packets, and distributed to viewers, are being put to practical use. In the MPEG system, when multiplexing audio / video data, it is necessary to consider the remaining buffer capacity of the decompression decoding device on the receiving side on the transmitting side. In other words, the transmitting side manages the data amount and multiplexes and transmits audio / video data so that neither overflow nor underflow occurs in the reception buffer of the decompression decoding device defined in the MPEG standard. Has become
Further, the capacity of the reception buffer is defined as 4 kB for audio data.

【0003】しかし実際には、受信バッファにオーバフ
ローやアンダーフローなどの破綻が生じなくても、たと
えば音声データに1秒以上の時間間隔が空く場合などデ
ータの伝送間隔が長すぎると、受信側で正常に音声デー
タを再生できなくなる可能性があるという問題がある。
また、受信バッファが破綻しないように音声・映像デー
タの圧縮符号化および多重化を管理するための処理は複
雑であり、浮動小数点演算も必要とするため処理時間が
長くかかるという問題もある。そのため、受信側の伸長
復号装置の受信バッファの残り記憶容量を厳密に管理す
る必要なく、浮動小数点演算を用いない整数演算のみの
簡単な処理で、受信バッファに破綻を生じさせず、なお
かつ適切に音声・映像データを再生できるように、音声
・映像データを伝送パケットに多重化し送信することが
できるデータ多重化装置が要望されている。
However, in practice, even if a failure such as an overflow or an underflow does not occur in the reception buffer, if the data transmission interval is too long, for example, when the time interval of one second or more is available in the audio data, the reception side will not operate. There is a problem that audio data may not be able to be normally reproduced.
In addition, there is a problem that processing for managing compression / encoding and multiplexing of audio / video data is complicated so that the reception buffer does not break down, and also requires a floating-point operation, so that processing time is long. Therefore, there is no need to strictly manage the remaining storage capacity of the reception buffer of the decompression decoding device on the reception side, and simple processing of only integer operations without using floating-point operations does not cause a failure in the reception buffer and properly. There is a demand for a data multiplexing device that can multiplex audio / video data into transmission packets and transmit the audio / video data so that the audio / video data can be reproduced.

【0004】そのような要望に応えるデータ多重化装置
として、本願出願人に係わる特願平9−71834号に
記載のデータ多重化装置がある。このデータ多重化装置
においては、1ビデオフレーム期間を単位として各デー
タの多重化を管理することにより、受信バッファを厳密
に管理しなくとも、受信バッファを破綻させることなく
適切に音声・映像データを送信できるようにしている。
またそのために、簡単な演算処理により、1ビデオフレ
ーム期間に送信すべき各データのデータ量を決定できる
ようにしている。
[0004] As a data multiplexing device that meets such a demand, there is a data multiplexing device described in Japanese Patent Application No. 9-71834 to the present applicant. In this data multiplexing apparatus, the multiplexing of each data is managed in units of one video frame period, so that the audio / video data can be appropriately transmitted without losing the reception buffer without strictly managing the reception buffer. You can send.
For this purpose, the data amount of each data to be transmitted in one video frame period can be determined by simple arithmetic processing.

【0005】ここで、このデータ多重化装置において行
われている、オーディオデータの送信データ量を決定す
る最も簡単な方法について、具体的に説明する。たとえ
ば、オーディオストリームのデータレートaudio_
rate_targetが、Akbpsである場合に
は、30映像フレーム周期の間に送信するオーディオス
トリームのデータ量audio_frame_30fr
ameは、式1に示すように算出される。
Here, the simplest method of determining the transmission data amount of audio data, which is performed in the data multiplexing apparatus, will be specifically described. For example, the audio stream data rate audio_
When rate_target is Akbps, the data amount of audio stream to be transmitted during 30 video frame periods audio_frame_30fr
ame is calculated as shown in Equation 1.

【0006】[0006]

【数1】 audio _rate_30frame =A×1000×1001/1000 /8 [Byte] ・・・(1) [Equation 1] audio_rate_30frame = A × 1000 × 1001/1000/8 [Byte] (1)

【0007】MPEG方式においては、オーディオスト
リームのデータレートaudio_rate_targ
etは、図7に示すような固定値に規定されており、い
ずれも8×1000bpsの倍数の値となっている。し
たがって、式1の結果は必ず整数となり、この30フレ
ーム期間を単位として送信オーディオデータのデータ量
を制御すれば簡単かつ適切に制御が行えることになる。
[0007] In the MPEG system, the data rate of audio stream audio_rate_targ
“et” is defined as a fixed value as shown in FIG. 7, and is a multiple of 8 × 1000 bps. Therefore, the result of Expression 1 is always an integer. If the data amount of the transmission audio data is controlled in units of the 30-frame period, the control can be easily and appropriately performed.

【0008】たとえば、オーディオストリームのデータ
レートaudio_rate_targetが、384
kbpsである場合には、30映像フレーム周期の間に
オーディオエンコーダが出力するオーディオストリーム
のデータ量audio_frame_30frame
は、式2により、48048バイトとなる。
[0008] For example, the data rate of audio stream audio_rate_target is 384.
In the case of kbps, the data amount audio_frame_30frame of the audio stream output by the audio encoder during 30 video frame periods
Is 48,048 bytes according to Equation 2.

【0009】[0009]

【数2】 audio _rate_30frame = 384×1000×1001/1000 /8 = 48048 [Byte] ・・・(2) [Equation 2] audio_rate_30frame = 384 × 1000 × 1001/1000/8 = 48048 [Byte] (2)

【0010】これより、1映像フレーム周期ごとにトラ
ンスポートストリームに多重化すべきオーディオストリ
ームのデータ量は、1601バイトまたは1602バイ
トとなる。したがって、過去30映像フレーム周期の間
に多重化したオーディオデータ量を管理しておき、その
データ量が式2により算出したデータ量audio_f
rame_30frame(48048バイト)より多
い場合には、次の1フレーム期間には1601バイト分
のオーディオストリームをその映像フレーム周期のトラ
ンスポートストリームに多重化し、多くない場合には1
602バイト分のオーディオストリームをその映像フレ
ーム周期のトランスポートストリームに多重化するよう
にすればよいことになる。
[0010] Thus, the data amount of the audio stream to be multiplexed into the transport stream for each video frame period is 1601 bytes or 1602 bytes. Therefore, the amount of audio data multiplexed during the past 30 video frame periods is managed, and the amount of data is calculated as the data amount audio_f calculated by Expression 2.
If it is larger than frame_30frame (48048 bytes), the audio stream of 1601 bytes is multiplexed with the transport stream of the video frame period in the next one frame period.
The 602 bytes of the audio stream may be multiplexed with the transport stream of the video frame period.

【0011】このような送信オーディオデータの管理を
行うデータ多重化装置の動作について、図8をさらに参
照して具体的に説明する。まず、オーディオストリーム
のデータレートaudio_rate_targetを
設定し(ステップS300)、これに基づいて、1映像
フレーム周期ごとにトランスポートストリームに多重化
すべきオーディオストリームのデータ量frame_a
udio_rate_preを、式3により算出する
(ステップS302)。
The operation of the data multiplexing device for managing such transmission audio data will be specifically described with reference to FIG. First, the data rate audio_rate_target of the audio stream is set (step S300), and based on this, the data amount frame_a of the audio stream to be multiplexed into the transport stream for each video frame period.
The audio_rate_pre is calculated by Expression 3 (Step S302).

【0012】[0012]

【数3】 frame _audio _rate_pre = audio_rate_target /8×1001/1000/30 ・・・(3) ただし、frame _audio _rate_pre の小数点以下は切
り捨てる。
[Equation 3] frame_audio_rate_pre = audio_rate_target / 8 × 1001/1000/30 (3) However, the fractional part of frame_audio_rate_pre is discarded.

【0013】次に、式1により、30映像フレーム周期
当たりのオーディオストリームのデータ量audio_
frame_30frameを算出する(ステップS3
04)。そして、ビデオエンコーダから入力される映像
フレーム信号を受信し、映像フレーム周期が開始された
か否かを判断し(ステップS306)、映像フレーム周
期が開始された場合には、過去30映像フレーム周期の
間に多重化したオーディオストリームのデータ量が、ス
テップS304において算出したデータ量audio_
frame_30frameより多いか否かを判断する
(ステップS308)。
[0013] Next, according to Equation 1, the data amount of audio stream audio_
Calculate frame_30frame (Step S3)
04). Then, the video frame signal input from the video encoder is received, and it is determined whether or not the video frame period has been started (step S306). Is the data amount of the audio stream multiplexed in the audio stream calculated in step S304.
It is determined whether the number is greater than frame_30frame (step S308).

【0014】多かった場合には、その映像フレーム周期
において多重化するオーディオフレームのデータ量fr
ame_audio_rateを、ステップS302に
おいて算出したデータ量frame_audio_ra
te_preとし(ステップS310)、多くなかった
場合には、その映像フレーム周期において多重化するオ
ーディオフレームのデータ量frame_audio_
rateを、ステップS302において算出したデータ
量frame_audio_rate_preより1バ
イト多い値とする(ステップS312)。そして、その
求められたデータ量のオーディオデータを、ビデオスト
リームなどのトランスポートストリームに多重化させる
(ステップS314)。
If the number is large, the data volume fr of audio frames to be multiplexed in the video frame period
ame_audio_rate is set to the data amount frame_audio_ra calculated in step S302.
te_pre (step S310), and if not large, the data amount of the audio frame to be multiplexed in the video frame period frame_audio_
The rate is set to a value that is one byte larger than the data amount frame_audio_rate_pre calculated in step S302 (step S312). Then, the audio data having the obtained data amount is multiplexed into a transport stream such as a video stream (step S314).

【0015】[0015]

【発明が解決しようとする課題】ところで、近年、MP
EGオーディオによる圧縮されたオーディオストリーム
ではなく、圧縮前のまま、すなわちいわゆるLPCMの
ままのオーディオストリームを伝送したいという要求が
増えている。これは、放送局間やSNG(サテライトニ
ュースギャザリング)などの素材伝送を行う場合におい
て、高画質なMPEG4:2:2P@MPによるビデオ
符号化に対応するような、より高音質な音声データの伝
送が望まれてきているからである。
By the way, in recent years, MP
There is an increasing demand to transmit an audio stream that has not been compressed by EG audio but has been compressed, that is, remains LPCM. This means that when material is transmitted between broadcasting stations or in SNG (Satellite News Gathering), transmission of audio data of higher sound quality corresponding to video encoding by MPEG 4: 2: 2P @ MP of high image quality is performed. Is desired.

【0016】しかしながら、そのようなLPCMされた
オーディオデータは、MPEGオーディオと異なり、デ
ータレートが8×1000[bps]の整数倍に規定さ
れているわけではない。そのため、たとえば44.1k
Hzでサンプリングされたオーディオデータなどは、前
述したような方法では、適切にトランスポートストリー
ムに多重化することができないという問題がある。サン
プリング周期が44.1kHzの16ビットステレオオ
ーディオデータにおいては、そのビットレートは、17
6400(=44100×2×16/8)[Byte/
sec]となり、前述したような30映像フレーム当た
りのデータ量を求めると、176576.4(=176
400×1001/1000)[バイト]となる。すな
わち、結果が整数値にならないためである。
However, unlike the MPEG audio, the data rate of such LPCM-processed audio data is not specified to be an integral multiple of 8 × 1000 [bps]. Therefore, for example, 44.1k
There is a problem that audio data sampled at Hz cannot be appropriately multiplexed into a transport stream by the above-described method. For 16-bit stereo audio data with a sampling period of 44.1 kHz, the bit rate is 17 bits.
6400 (= 44100 × 2 × 16/8) [Byte /
sec], and the amount of data per 30 video frames as described above is obtained, 1765766.4 (= 176
400 × 1001/1000) [bytes]. That is, the result is not an integer value.

【0017】したがって、本発明の目的は、データレー
トが8×1000[bps]の整数倍になっていないよ
うなオーディオデータに対しても、受信装置の受信バッ
ファの記憶容量を厳密に管理する必要なく、整数演算の
みの簡単な処理で受信バッファに破綻を生じさせないよ
うに送信データの制御が行え、音声データをトランスポ
ートストリームに適切に多重化し送信することができる
データ多重化装置およびその方法を提供することにあ
る。
Therefore, an object of the present invention is to strictly manage the storage capacity of the receiving buffer of the receiving device even for audio data whose data rate is not an integral multiple of 8 × 1000 [bps]. And a data multiplexing apparatus and method that can control transmission data so as not to cause a failure in a reception buffer by simple processing of only integer arithmetic and can appropriately multiplex and transmit audio data to a transport stream. To provide.

【0018】[0018]

【課題を解決するための手段】前記課題を解決するため
に、前述したたとえば30映像フレームというような所
定数ごとの映像フレーム期間の音声データの端数のデー
タを累積し、端数のないデータ量となった時に一緒に多
重化するようにした。
In order to solve the above-mentioned problem, the above-described fractional data of audio data in a predetermined number of video frame periods, for example, 30 video frames, is accumulated, and a data amount without a fraction is accumulated. When they become multiplexed together.

【0019】したがって本発明のデータ多重化装置は、
音声データのビットレートに基づいて、対応する映像デ
ータのたとえば30フレーム期間などの所定数の映像フ
レーム期間の音声データ量を算出するデータ量算出手段
と、その音声データ量に基づいて、所定の単位データ量
の整数倍となるような、その所定数の映像フレーム期間
の音声データの多重化目標データ量を求める多重化目標
データ量検出手段と、算出した音声データ量と多重化目
標データ量の差の累積値を求め、その累積値が単位デー
タ量の整数倍となる前記所定数の映像フレーム期間の数
を検出する補正単位検出手段と、その検出した数ごと
に、その所定数の映像フレーム期間の多重化目標データ
量を、元の多重化目標データ量に単位データ量の整数倍
となる前記累積値を加えたデータ量に補正する目標値補
正手段とを有する。
Therefore, the data multiplexing device of the present invention
Data amount calculating means for calculating the audio data amount of a corresponding number of video frame periods, such as 30 frame periods, of the corresponding video data based on the bit rate of the audio data, and a predetermined unit based on the audio data amount Multiplex target data amount detection means for obtaining a multiplex target data amount of audio data for the predetermined number of video frame periods so as to be an integral multiple of the data amount, and a difference between the calculated audio data amount and the multiplex target data amount. And a correction unit detecting means for detecting the number of the predetermined number of video frame periods in which the cumulative value is an integral multiple of the unit data amount, and for each of the detected numbers, the predetermined number of video frame periods Target value correcting means for correcting the multiplexed target data amount to a data amount obtained by adding the cumulative value which is an integral multiple of the unit data amount to the original multiplexed target data amount.

【0020】このようなデータ多重化装置においては、
まず多重化対象の音声データに対して、データ量算出手
段において、対応する映像データのたとえば30フレー
ム期間などの所定数の映像フレーム期間の音声データ量
をその音声データのビットレートに基づいて算出し、そ
のデータ量に基づいて、多重化目標データ量検出手段に
おいて、その所定数の映像フレーム期間の音声データの
多重化目標データ量を、このデータ量が所定の単位デー
タ量の整数倍となるように求める。次に、補正単位検出
手段において、算出した音声データ量と多重化目標デー
タ量の差の累積値を求め、その累積値が単位データ量の
整数倍となる前記所定数の映像フレーム期間の数を検出
する。そして、その検出した数の所定数の映像フレーム
期間ごとに、目標値補正手段において、その多重化目標
データ量を、元の多重化目標データ量に単位データ量の
整数倍となる前記累積値を加えたデータ量に補正する。
以後は、それら多重化目標データ量および補正された多
重化目標データ量に基づいて、その所定数の映像フレー
ム期間の各映像フレーム期間に多重化する音声データの
データ量を決定し、その決定されたデータ量に基づいて
多重化を行う。
In such a data multiplexing device,
First, for the audio data to be multiplexed, the data amount calculation means calculates the audio data amount of the corresponding video data in a predetermined number of video frame periods, for example, 30 frame periods, based on the bit rate of the audio data. Based on the data amount, the multiplexing target data amount detecting means sets the multiplexing target data amount of the audio data in the predetermined number of video frame periods such that the data amount becomes an integral multiple of the predetermined unit data amount. Ask for. Next, in the correction unit detecting means, an accumulated value of a difference between the calculated audio data amount and the multiplexed target data amount is obtained, and the number of the predetermined number of video frame periods in which the accumulated value is an integral multiple of the unit data amount is calculated. To detect. Then, for each predetermined number of video frame periods of the detected number, the target value correcting means calculates the accumulated value, which is an integer multiple of the unit data amount, as the original multiplexed target data amount. Correct to the added data amount.
Thereafter, based on the multiplexed target data amount and the corrected multiplexed target data amount, the data amount of audio data to be multiplexed in each video frame period of the predetermined number of video frame periods is determined. Multiplexing is performed based on the data amount.

【0021】また本発明のデータ多重化方法は、多重化
対象の音声データのビットレートに基づいて、対応する
映像データの所定数の映像フレーム期間の音声データ量
を算出し、その算出した音声データ量に基づいて、所定
の単位データ量の整数倍となるその所定数の映像フレー
ム期間の音声データの多重化目標データ量を求め、音声
データ量と多重化目標データ量の差の累積値が、所定の
単位データ量の整数倍となる所定数の映像フレーム期間
の数を検出し、その検出した前記所定数の映像フレーム
期間の数ごとに、所定数の映像フレーム期間の前記多重
化目標データ量を、元の多重化目標データ量にその単位
データ量の整数倍となる前記累積値を加えたデータ量に
補正する。そして、その求めた多重化目標データ量およ
び補正された多重化目標データ量に基づいて、所定数の
映像フレーム期間の各映像フレーム期間に多重化する前
記音声データのデータ量を算出し、算出されたデータ量
の音声データを、所定のトランスポートストリームに多
重化する。
Further, according to the data multiplexing method of the present invention, based on a bit rate of audio data to be multiplexed, an audio data amount of a predetermined number of video frame periods of corresponding video data is calculated, and the calculated audio data is calculated. Based on the amount, the multiplexed target data amount of the audio data of the predetermined number of video frame periods that is an integral multiple of the predetermined unit data amount is obtained, and the accumulated value of the difference between the audio data amount and the multiplexed target data amount is A predetermined number of video frame periods, which is an integral multiple of a predetermined unit data amount, is detected, and for each of the detected number of the predetermined number of video frame periods, the multiplex target data amount of a predetermined number of video frame periods is detected. Is corrected to a data amount obtained by adding the accumulated value that is an integral multiple of the unit data amount to the original multiplexed target data amount. Then, based on the obtained multiplexing target data amount and the corrected multiplexing target data amount, the data amount of the audio data to be multiplexed in each video frame period of the predetermined number of video frame periods is calculated and calculated. The audio data having the data amount is multiplexed into a predetermined transport stream.

【0022】好適には、多重化目標データ量の補正は、
当該映像フレーム期間前の前記所定数の前記映像フレー
ム期間の間に多重化した前記音声データのデータ量を計
数し、前記計数した前記音声データのデータ量に基づい
て、当該映像フレーム期間の多重化目標データ量を補正
するか否かを決定して行う。特定的には、前記所定の単
位データ量はバイト単位であり、前記所定数の映像フレ
ーム期間は30映像フレーム期間であり、前記音声デー
タ量のバイトに満たない端数のデータの累積値が、バイ
トを単位とするデータとなる30映像フレーム期間の数
は、100である。また特定的には、前記音声データ
は、44.1kHzのサンプリング周波数でパルス符号
変調(PCM)した音声データである。
Preferably, the correction of the multiplex target data amount is
Counting the data amount of the audio data multiplexed during the predetermined number of the video frame periods before the video frame period, and multiplexing the video frame period based on the counted data amount of the audio data. It is determined whether or not to correct the target data amount. Specifically, the predetermined unit data amount is a byte unit, the predetermined number of video frame periods is 30 video frame periods, and the cumulative value of fractional data less than bytes of the audio data amount is a byte. The number of 30 video frame periods that are data in units of is 100. More specifically, the audio data is audio data subjected to pulse code modulation (PCM) at a sampling frequency of 44.1 kHz.

【0023】[0023]

【発明の実施の形態】本発明の一実施の形態のデータ多
重化装置について、図1〜図6を参照して説明する。ま
ず、そのデータ多重化装置の構成について説明する。図
1は、本実施の形態のデータ多重化装置2の構成を示す
ブロック図であり、データ多重化装置2は、ビデオエン
コーダ20、オーディオエンコーダ24、サブタイトル
エンコーダ28、多重化系12および制御系42を有す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A data multiplexing apparatus according to one embodiment of the present invention will be described with reference to FIGS. First, the configuration of the data multiplexing device will be described. FIG. 1 is a block diagram illustrating a configuration of a data multiplexing device 2 according to the present embodiment. The data multiplexing device 2 includes a video encoder 20, an audio encoder 24, a subtitle encoder 28, a multiplexing system 12, and a control system 42. Having.

【0024】ビデオエンコーダ20の構成を図2に示
す。ビデオエンコーダ20は、加算回路202、DCT
回路204、量子化回路206、逆量子化回路208、
逆DCT回路210、加算回路212、フレームメモリ
回路216、可変長符号化回路(VLC)218、ビッ
トレート制御回路220、可変長符号バッファ(VLC
バッファ)222を有し、外部機器から入力される映像
データをMPEG2方式により圧縮符号化し、目標デー
タ量video_rate_targetとほぼ等しい
データ量のビデオストリームを生成し、データ多重化装
置2のデータサイズIF30aおよびFIFOメモリ3
2aに対して出力する。
FIG. 2 shows the configuration of the video encoder 20. The video encoder 20 includes an addition circuit 202, a DCT
Circuit 204, quantization circuit 206, inverse quantization circuit 208,
Inverse DCT circuit 210, addition circuit 212, frame memory circuit 216, variable length coding circuit (VLC) 218, bit rate control circuit 220, variable length code buffer (VLC)
Buffer) 222, compresses and encodes video data input from an external device by the MPEG2 method, generates a video stream having a data amount substantially equal to the target data amount video_rate_target, and generates a data size IF 30a and a FIFO of the data multiplexing device 2. Memory 3
Output to 2a.

【0025】ビットレート制御回路220に対しては、
データ多重化装置2のCPU424より、目標データ量
video_rate_targetが設定される。ビ
ットレート制御回路220は、可変長符号化回路218
が実際に生成したビデオストリームのデータ量に基づい
て、圧縮符号化後のデータ量が、設定された目標データ
量video_rate_targetと等しくなるよ
うに量子化回路206を制御する。
For the bit rate control circuit 220,
The target data amount video_rate_target is set by the CPU 424 of the data multiplexing device 2. The bit rate control circuit 220 includes a variable length encoding circuit 218
Controls the quantization circuit 206 based on the data amount of the video stream actually generated, so that the data amount after the compression encoding becomes equal to the set target data amount video_rate_target.

【0026】オーディオエンコーダ24の構成を図3に
示す。オーディオエンコーダ24は、サブバンド分析フ
ィルタバンク240、線形量子化回路242、ビット圧
縮回路244、FFT(fast fourier transfer) 回路2
46、心理聴覚モデル248、動的ビット割り当て回路
250、スケールファクタ選択情報記憶回路252、ス
ケールファクタ抽出回路254、サイド情報符号化回路
256およびビットストリーム生成回路258を有し、
外部機器から入力された音声データを、MPEG2方式
により圧縮符号化し、オーディオストリームを生成し、
データ多重化装置2のデータサイズIF30bおよびF
IFOメモリ32bに対して出力する。
FIG. 3 shows the configuration of the audio encoder 24. The audio encoder 24 includes a subband analysis filter bank 240, a linear quantization circuit 242, a bit compression circuit 244, an FFT (fast fourier transfer) circuit 2
46, a psychoacoustic model 248, a dynamic bit allocation circuit 250, a scale factor selection information storage circuit 252, a scale factor extraction circuit 254, a side information encoding circuit 256, and a bit stream generation circuit 258.
Audio data input from an external device is compression-encoded by the MPEG2 method to generate an audio stream,
Data size IF 30b and F of data multiplexer 2
Output to the IFO memory 32b.

【0027】サブタイトルエンコーダ28は、外部機器
から入力されるサブタイトルデータ等のプライベートデ
ータをエンコードする。なお、サブタイトルエンコーダ
28は、エンコード済みサブタイトルデータを外部機器
から直接、受け取ってもよい。その場合、たとえば、E
NIF回路420がイーサネットワーク等のLANを介
して、または、SIF422がシリアルラインを介して
エンコード済みサブタイトルデータを受け取り、CPU
バスを介してRAM430に対して出力する。
The subtitle encoder 28 encodes private data such as subtitle data input from an external device. Note that the subtitle encoder 28 may directly receive the encoded subtitle data from an external device. In that case, for example, E
The NIF circuit 420 receives encoded subtitle data via a LAN such as an Ethernet network, or the SIF 422 receives encoded subtitle data via a serial line.
The data is output to the RAM 430 via the bus.

【0028】この場合、エンコード済みのサブタイトル
データに付されているヘッダに書かれたヘッダサイズを
ENIF回路420またはSIF422が検出し、検出
したヘッダサイズをCPUバスを介してCPU424に
対して出力する。また、RAM430は、CPU424
の制御に従って、入力されたエンコード済みのサブコー
ドデータをスイッチ回路34の入力端子dに対して出力
する。
In this case, the ENIF circuit 420 or the SIF 422 detects the header size written in the header attached to the encoded subtitle data, and outputs the detected header size to the CPU 424 via the CPU bus. In addition, the RAM 430 includes a CPU 424
According to the control of (1), the input encoded subcode data is output to the input terminal d of the switch circuit 34.

【0029】多重化系12は、入力用のFIFOメモリ
32a,32b,32c、第1のスイッチ回路34、第
2のスイッチ回路36、出力用のFIFOメモリ38お
よびSCSI(small computer system interface) イン
ターフェース回路(SCSIIF回路)40を有する。
The multiplexing system 12 includes an input FIFO memory 32a, 32b, 32c, a first switch circuit 34, a second switch circuit 36, an output FIFO memory 38, and a SCSI (small computer system interface) interface circuit. (SCSI IF circuit) 40.

【0030】FIFOメモリ32a,32b,32cは
それぞれ、ビデオエンコーダ20、オーディオエンコー
ダ24およびサブタイトルエンコーダ28から入力され
るビデオストリーム、オーディオストリームおよびサブ
タイトルストリームをバッファリングし、スイッチ回路
34の入力端子a,b,cに対して出力する。
The FIFO memories 32a, 32b, and 32c buffer the video stream, the audio stream, and the subtitle stream input from the video encoder 20, the audio encoder 24, and the subtitle encoder 28, respectively, and input terminals a, b of the switch circuit 34. , C.

【0031】第1のスイッチ回路34は、制御信号を介
した制御系42の制御に従って、入力端子a,b,c,
dのいずれかを選択し、これらの入力端子それぞれに入
力されるエレメンタリストリームのいずれかを選択して
多重化し、スイッチ回路36の入力端子bに対して出力
する。なお、スイッチ回路34は、入力端子のいずれに
も入力されるエレメンタリストリームがない場合、ある
いは、スタッフィング処理を行う場合等は、入力端子
a,b,c,dのいずれをも選択せず、所定のブランク
データ(連続した論理値1または0)を出力する。
The first switch circuit 34 controls the input terminals a, b, c, and c according to the control of the control system 42 through the control signal.
d, any one of the elementary streams input to each of these input terminals is selected and multiplexed, and output to the input terminal b of the switch circuit 36. The switch circuit 34 does not select any of the input terminals a, b, c, and d when there is no elementary stream to be input to any of the input terminals, or when performing a stuffing process. Outputs predetermined blank data (continuous logical value 1 or 0).

【0032】第2のスイッチ回路36は、制御信号を介
した制御系42の制御に従って、入力端子a,bのいず
れかを選択し、入力端子bにスイッチ回路34から入力
されるエレメンタリストリーム、または、入力端子aに
処理用RAM426から入力されるプライベートデータ
ストリームを選択して多重化し、FIFOメモリ38お
よびSCSIIF回路40に対して出力する。
The second switch circuit 36 selects one of the input terminals a and b according to the control of the control system 42 via the control signal, and outputs an elementary stream input from the switch circuit 34 to the input terminal b. Alternatively, a private data stream input from the processing RAM 426 to the input terminal a is selected and multiplexed, and output to the FIFO memory 38 and the SCSIIF circuit 40.

【0033】FIFOメモリ38は、スイッチ回路36
が多重化したデータストリームをバッファリングし、ト
ランスポートストリームとして図示しない通信回線等の
外部機器に対して出力する。
The FIFO memory 38 includes a switch circuit 36
Buffers the multiplexed data stream and outputs it as a transport stream to an external device such as a communication line (not shown).

【0034】SCSIIF回路40は、スイッチ回路3
6が多重化したデータストリームを、ハードディスク装
置(HDD) あるいは光磁気ディスク装置(MOD) 等の記録装
置(図示せず)に対して出力し、記録させる。
The SCSIIF circuit 40 includes a switch circuit 3
The multiplexed data stream 6 is output to a recording device (not shown) such as a hard disk device (HDD) or a magneto-optical disk device (MOD) and recorded.

【0035】制御系42は、データサイズ計数用インタ
ーフェース回路30a,30b,30c、RAM43
0、イーサネットインターフェース回路(ENIF)4
20、シリアルインターフェース回路(SIF)42
2、CPU424、処理用RAM426、制御データ用
RAM428およびカウンタ432を有する。
The control system 42 includes a data size counting interface circuit 30a, 30b, 30c, and a RAM 43.
0, Ethernet interface circuit (ENIF) 4
20, serial interface circuit (SIF) 42
2, a CPU 424, a processing RAM 426, a control data RAM 428, and a counter 432.

【0036】データサイズIF30a,30b,30c
はそれぞれ、ビデオエンコーダ20、オーディオエンコ
ーダ24およびサブタイトルエンコーダ28から入力さ
れるビデオストリーム、オーディオストリームおよびサ
ブタイトルストリームのフレームごとのデータサイズを
計数し、CPUバスを介してCPU424に対して出力
する。
Data size IF 30a, 30b, 30c
Respectively, counts the data size of each frame of the video stream, audio stream, and subtitle stream input from the video encoder 20, the audio encoder 24, and the subtitle encoder 28, and outputs the data size to the CPU 424 via the CPU bus.

【0037】なお、データサイズの計数は、データサイ
ズIF30a,30b,30cに内蔵されたカウンタに
より行われる。また、データサイズの計数は、ビデオエ
ンコーダ20、オーディオエンコーダ24およびサブタ
イトルエンコーダ28が出力する各エレメンタリースト
リームのフレームごとのデータサイズを、データサイズ
IF30a,30b,30cが検出することによっても
可能である。
The counting of the data size is performed by a counter built in the data size IF 30a, 30b, 30c. Further, the data size can be counted by detecting the data size of each frame of each elementary stream output by the video encoder 20, the audio encoder 24, and the subtitle encoder 28 by the data size IFs 30a, 30b, 30c. .

【0038】ENIF回路420は、イーサネット等の
LAN(図示せず)を介して入力されてくるプライベー
トデータ(private data)を受け入れ、CPUバスを介し
てCPU424に対して出力する。
The ENIF circuit 420 receives private data input via a LAN (not shown) such as Ethernet, and outputs it to the CPU 424 via the CPU bus.

【0039】SIF回路422は、例えばコンピュータ
から入力されるシリアル形式のプライベートデータを受
け入れ、CPU424に対して出力する。なお、プライ
ベートデータの例として、上述したサブタイトルデー
タ、クローズドキャプションデータおよびユーザーデー
タを挙げることができる。
The SIF circuit 422 accepts, for example, serial private data input from a computer and outputs it to the CPU 424. Note that examples of the private data include the above-described subtitle data, closed caption data, and user data.

【0040】CPU424は、たとえば、マイクロプロ
セッサおよびプログラム格納用のROMおよびこれらの
周辺回路から構成され、データサイズIF30a,30
b,30c、ENIF回路420およびSIF回路42
2から入力されるデータサイズを処理用RAM426に
記憶し、FIFOメモリ32a,32b,32c等の残
り記憶容量(バッファ残量)および処理用RAM426
に記憶したデータサイズに基づいて、エレメンタリスト
リームの多重化の順番、多重化のタイミング調整および
スケジューリング等の多重化方法の計画を行い、計画し
た多重化方法に従ってスイッチ回路34,36の多重化
動作をCPUバスを介して制御する。
CPU 424 is composed of, for example, a microprocessor, a ROM for storing programs and peripheral circuits thereof, and has a data size IF 30a, 30B.
b, 30c, ENIF circuit 420 and SIF circuit 42
2 is stored in the processing RAM 426, and the remaining storage capacity (remaining buffer capacity) of the FIFO memories 32a, 32b, 32c, etc. and the processing RAM 426 are stored.
Based on the data size stored in the multiplexing method, a multiplexing method such as a multiplexing order of elementary streams, multiplexing timing adjustment and scheduling is planned, and the multiplexing operation of the switch circuits 34 and 36 according to the planned multiplexing method. Is controlled via a CPU bus.

【0041】なお、制御データ用RAM428には、C
PU424の処理にかかわる制御用のデータが記憶され
ており、CPU424は、制御データ用RAM428に
記憶された制御データを用いたスケジューリングに従っ
て、ヘッダデータを処理用RAM426上に作成し、ス
イッチ回路36の入力端子aに対して出力する。また、
ヘッダデータの一部は、ENIF回路240またはSI
F回路422を介して入力され、RAM426に記憶さ
れたプライベートデータ(ユーザーデータ)に基づいて
作成される場合もある。
The control data RAM 428 has C
Control data related to the processing of the PU 424 is stored. The CPU 424 creates header data on the processing RAM 426 in accordance with the scheduling using the control data stored in the control data RAM 428, and Output to terminal a. Also,
Part of the header data is stored in ENIF circuit 240 or SI
In some cases, it is created based on private data (user data) input via the F circuit 422 and stored in the RAM 426.

【0042】カウンタ432は、多重化したフレーム数
を計数するカウンタcount _frameと、所定基準時間か
らの多重化した秒数(30フレームを多重化した数)を
計数するカウンタcount _secondの2つのカウンタを有
し、各々CPU424からの制御信号によりカウントア
ップおよびリセットが行われる。
The counter 432 has two counters, a counter count_frame for counting the number of multiplexed frames and a counter count_second for counting the number of multiplexed seconds from a predetermined reference time (the number of multiplexed 30 frames). And count-up and reset are performed by control signals from the CPU 424.

【0043】次に、このデータ多重化装置2において、
NTSC方式のビデオストリームを多重化する場合の多
重化方法について説明する。まず、CPU424は、デ
ータ量IF30aから入力されるビデオエンコーダ20
のビデオストリームのデータレートvideo_rat
e_orgを、式4に示す固定値(frame_vid
eo_rate)に近似して多重化計画を行う。
Next, in the data multiplexing apparatus 2,
A multiplexing method for multiplexing NTSC video streams will be described. First, the CPU 424 controls the video encoder 20 input from the data amount IF 30a.
Data rate of the video stream video_rat
e_org is a fixed value (frame_vid) shown in Expression 4.
eo_rate) to perform a multiplexing plan.

【0044】[0044]

【数4】 frame _video _rate (byte) = video_rate_org (bps) /8×1001/1000/30 ・・・(4) ただし、video _rate_org は、ビデオエンコーダ20
が生成するビデオストリームのデータレートであり、fr
ame _video _rateは小数点以下を切り捨てる。
[Equation 4] frame_video_rate (byte) = video_rate_org (bps) / 8 × 1001/1000/30 (4) where video_rate_org is the video encoder 20
Is the data rate of the video stream generated by fr
ame_video_rate rounds down decimal places.

【0045】ただし、式4により算出されるビデオース
トリームの映像フレーム周期当たりのデータレートfr
ame_video_rateの値は離散的になるが、
制約がない限り、通常、ビデオストリームのデータレー
トは任意の値とすることができるので、特に問題が生じ
ることはない。また、式4が、演算〔1001/(10
00×30)〕を含むのは、NTSC方式の1秒あたり
のフレーム数29.97を、整数演算により扱い得るよ
うにするためである。
Here, the data rate fr per video frame period of the video stream calculated by equation (4)
The value of ame_video_rate is discrete,
As long as there is no restriction, the data rate of the video stream can be any value, so that there is no particular problem. In addition, Expression 4 calculates the operation [1001 / (10
00 × 30)] so that the number of frames per second of the NTSC system, 29.97, can be handled by integer arithmetic.

【0046】また、CPU424が、ビデオエンコーダ
20のビットレート制御回路220に設定する目標デー
タ量video_rate_targetの値は、式5
により算出される。
The value of the target data amount video_rate_target set by the CPU 424 in the bit rate control circuit 220 of the video encoder 20 is given by the following equation (5).
Is calculated by

【0047】[0047]

【数5】 video _rate_target(bps) = frame_video _rate(byte) /8/30/1000×1001 ・・・(5)[Equation 5] video_rate_target (bps) = frame_video_rate (byte) / 8/30/1000 × 1001 (5)

【0048】例えば、ビデオエンコーダ20が生成する
ビデオストリームのデータレートvideo_rate
_orgが4Mbpsの場合には、目標データ量vid
eo_rate_targetの値は3.999920
1Mbpsである。なお、この場合には、両者の値の間
の差はごくわずかであり、CPU424が、目標データ
量video_rate_targetとして、データ
レートvideo_rate_orgをビットレート制
御回路220に設定しても、実用上、何らの問題も生じ
ない。
For example, the data rate of a video stream generated by the video encoder 20 is video_rate.
When _org is 4 Mbps, the target data amount vid
The value of eo_rate_target is 3.999920
1 Mbps. In this case, the difference between the two values is very small, and even if the CPU 424 sets the data rate video_rate_org as the target data amount video_rate_target in the bit rate control circuit 220, there is no practical problem. Does not occur.

【0049】以下、図4をさらに参照して、CPU42
4がビデオエンコーダ20のビットレート制御回路22
0に設定する目標データ量video_rate_ta
rgetの算出方法を説明する。図4は、本実施例にお
いて、データ多重化装置2のビデオエンコーダ20のビ
ットレート制御回路220に設定される目標データ量v
ideo_rate_targetの算出方法を示すフ
ローチャート図である。
Hereinafter, with further reference to FIG.
4 is a bit rate control circuit 22 of the video encoder 20
Target data amount video_rate_ta set to 0
A method for calculating rget will be described. FIG. 4 shows the target data amount v set in the bit rate control circuit 220 of the video encoder 20 of the data multiplexing apparatus 2 in the present embodiment.
It is a flowchart figure which shows the calculation method of video_rate_target.

【0050】図4に示すように、ステップS240にお
いて、CPU424は、データ量IF30aから、ビデ
オエンコーダ20が生成するビデオストリームのデータ
レートvideo_rate_orgを受けて、RAM
428に設定する。ステップS242において、CPU
424は、式6により、映像フレーム周期当たりのビデ
オストリームのデータレートframe_video_
rateを算出する。そして、ステップS244におい
て、CPU424は、式7により、ビデオエンコーダ2
0のビットレート制御回路220に設定する目標データ
量video_rate_targetを算出する。
As shown in FIG. 4, in step S240, the CPU 424 receives the data rate video_rate_org of the video stream generated by the video encoder 20 from the data amount IF 30a, and
Set to 428. In step S242, the CPU
424 is the data rate of the video stream per video frame period frame_video_
Calculate rate. Then, in step S244, the CPU 424 determines that the video encoder 2
A target data amount video_rate_target to be set in the 0 bit rate control circuit 220 is calculated.

【0051】次に、このデータ多重化装置2において、
44.1kHzでサンプリングされたLPCMのオーデ
ィオデータを多重化する方法について説明する。前述し
たように44.1kHzでサンプリングされたLPCM
オーディオデータは、その30映像フレーム当たりのデ
ータ量が8×1000の倍数となっていない。本実施の
形態においては、このデータ量の端数を、所定の周期ご
とに補正することを考える。
Next, in the data multiplexing device 2,
A method of multiplexing LPCM audio data sampled at 44.1 kHz will be described. LPCM sampled at 44.1 kHz as described above
The audio data has a data amount per 30 video frames that is not a multiple of 8 × 1000. In the present embodiment, it is considered that the fraction of the data amount is corrected at predetermined intervals.

【0052】図5に、44.1kHzのオーディオデー
タの各種の条件下での、ビットレート、30映像フレー
ム当たりのビットレート、および、そのあまりを100
倍した値を示す。図5に示すremainの値は、10
0secごとに補正が必要となるバイト数を示す。換言
すれば、この数だけ補正をおこなっておけば、他の期間
は、従来と同じく、30映像フレームを単位として単純
に制御を行えばよい。したがって、本実施の形態のデー
タ多重化装置2においては、この100secをカウン
トするカウンタ432を設け、このカウンタ432が所
定の値の時、そのremain分のバイト数を追加して
送信するようにしている。
FIG. 5 shows that the bit rate, the bit rate per 30 video frames, and the rest under various conditions of 44.1 kHz audio data are set to 100.
Shows the multiplied value. The value of “remain” shown in FIG.
Indicates the number of bytes that need to be corrected every 0 seconds. In other words, if the correction is performed by this number, the control may be simply performed in units of 30 video frames in other periods as in the related art. Therefore, in the data multiplexing apparatus 2 of the present embodiment, the counter 432 for counting this 100 sec is provided, and when the counter 432 has a predetermined value, the number of bytes for the remain is added and transmitted. I have.

【0053】以下、図6を参照して、データ多重化装置
2においてオーディオデータを多重化する方法について
詳細に説明する。図6は、データ多重化装置2が、映像
フレーム周期ごとにトランスポートストリームに多重化
するオーディオストリームのデータ量を算出し、さらに
所定の周期ごとにそのデータ量に補正用データ量を加え
て、オーディオデータをビデオストリーム等と多重化す
る処理を示すフローチャート図である。
Hereinafter, a method of multiplexing audio data in the data multiplexing device 2 will be described in detail with reference to FIG. FIG. 6 shows that the data multiplexing device 2 calculates the data amount of the audio stream to be multiplexed into the transport stream for each video frame period, and further adds the correction data amount to the data amount for each predetermined period. It is a flowchart figure which shows the process which multiplexes audio data with a video stream etc.

【0054】まず、ステップS400において、CPU
424は、オーディオエンコーダ24が生成したオーデ
ィオストリームのデータレートを、データ量IF30b
から受け、RAM428に設定する。ステップS402
において、CPU424は、1映像フレーム周期ごとに
トランスポートストリームに多重化すべきオーディオス
トリームのデータ量frame_audio_rate
_preを、式6により算出する。
First, in step S400, the CPU
424 indicates the data rate of the audio stream generated by the audio encoder 24,
And sets it in the RAM 428. Step S402
In, the CPU 424 controls the data amount frame_audio_rate of the audio stream to be multiplexed into the transport stream for each video frame period.
_Pre is calculated by Expression 6.

【0055】[0055]

【数6】 frame _audio _rate_pre = audio_rate_target /8×1001/1000/30 ・・・(6) ただし、frame _audio _rate_pre の小数点以下は切
り捨てる。
[Equation 6] frame_audio_rate_pre = audio_rate_target / 8 × 1001/1000/30 (6) However, the fractional part of frame_audio_rate_pre is rounded down.

【0056】ステップS404において、CPU424
は、式7により、通常の30映像フレーム周期当たりの
オーディオストリームのデータ量audio_fram
e_30frame_preを算出する。
In step S404, CPU 424
Is the data amount of audio stream audio_frame per 30 normal video frame periods according to Equation 7.
e_30frame_pre is calculated.

【0057】[0057]

【数7】 audio _rate_30frame _pre = audio_rate_target /8×1001/1000 ・・・(7) Audio_rate_30frame_pre = audio_rate_target / 8 × 1001/1000 (7)

【0058】そして、ステップS406において、CP
U424は、カウンタ423のフレームカウンタcount
_frame 、秒カウンタcount _secondおよび付加補正値
add_remainをクリアし、100secごとの補正デー
タ量remainを、式8により求める。
Then, in step S406, the CP
U424 is a frame counter count of the counter 423
_Frame, second counter count_second and additional correction value
The add_remain is cleared, and the correction data amount remain every 100 seconds is obtained by Expression 8.

【0059】[0059]

【数8】 remain = (audio _rate_target/8*1001*100/1000 )%100 ・・・(8) ただし、%100は100のあまりを示す。## EQU8 ## remain = (audio_rate_target / 8 * 1001 * 100/1000)% 100 (8) However,% 100 indicates too much of 100.

【0060】次にステップS408において、CPU4
24は、ビデオエンコーダ20から入力される映像フレ
ーム信号を受信し、映像フレーム周期が開始したか否か
を判断する。映像フレーム周期が開始した場合には、C
PU424はステップS410の処理に進み、開始しな
い場合にはステップS408の処理に留まる。
Next, at step S408, the CPU 4
24 receives the video frame signal input from the video encoder 20, and determines whether or not the video frame period has started. If the video frame period starts, C
The PU 424 proceeds to the process of step S410, and if not started, stays in the process of step S408.

【0061】映像フレームの受信が開始されたら、ステ
ップS410において、CPU424は、カウンタ43
2のフレームカウンタcount _frame 値を1カウントア
ップしておき、ステップS412において、その値が3
0になったか否かをチェックする。ステップS412に
おいて、30フレームに達していた場合には、ステップ
S414に移り、フレームカウンタcount _frame をリ
セットし、秒カウンタcount _secondを1カウントアッ
プする。
When the reception of the video frame is started, in step S410, the CPU 424
The value of the frame counter count_frame of 2 is incremented by one, and the value becomes 3 in step S412.
Check whether it has become 0. If 30 frames have been reached in step S412, the process proceeds to step S414, where the frame counter count_frame is reset and the second counter count_second is incremented by one.

【0062】そして、その秒カウンタcount _secondが
100に達しているか否かをステップS416でチェッ
クし、100に達していた場合には、ステップS418
においてその秒カウンタcount _secondをリセットし、
付加補正値add _remainとして、ステップS406で求
めた補正値remainをセットする。また、ステップS41
6で、秒カウンタcount _secondが100に達していな
かった場合には、ステップS420で、付加補正値add
_remainには0をセットする。
Then, it is checked in step S416 whether or not the second counter count_second has reached 100, and if it has reached 100, step S418 is executed.
Resets its second counter, count_second,
The correction value “remain” obtained in step S406 is set as the additional correction value “add_remain”. Step S41
In step S420, if the second counter count_second has not reached 100, an additional correction value add is added in step S420.
_Remain is set to 0.

【0063】ステップS412で、フレームカウンタco
unt _frame が30に達していない場合、および、ステ
ップS418およびステップS420で付加補正値add
_remainがセットされた後は、ステップS422におい
て、ステップS404で求められたデータ量audio
_frame_30frame_preの値に付加補正
値add _remainを加えて、比較用のデータ量audio
_frame_30frameを生成する。
In step S412, the frame counter co
When unt_frame has not reached 30, and in steps S418 and S420, the additional correction value add
After _remain is set, in step S422, the data amount audio obtained in step S404
_Frame_30 Frame_pre is added with an additional correction value add_remain, and the data amount for comparison audio
Generate _frame_30frame.

【0064】そして、ステップS424において、CP
U424は、過去30映像フレーム周期の間に多重化し
たオーディオストリームのデータ量が、S422の処理
において算出したデータ量audio_frame_3
0frameより多いか否かを判断し、多い場合にはS
426の処理に進み、多くない場合にはS428の処理
に進む。ステップS426において、CPU424は、
その映像フレーム周期において多重化するオーディオフ
レームのデータ量frame_audio_rate
を、S402の処理において算出したデータ量fram
e_audio_rate_preとする。
Then, in step S424, the CP
U424 indicates that the data amount of the audio stream multiplexed during the past 30 video frame periods is the data amount audio_frame_3 calculated in the process of S422.
It is determined whether or not the number is greater than 0 frame.
The process proceeds to the process of S426, and if not, proceeds to the process of S428. In step S426, the CPU 424 determines
Data amount of audio frames to be multiplexed in the video frame period frame_audio_rate
Is the data amount fram calculated in the process of S402.
Let e_audio_rate_pre.

【0065】ステップS428において、CPU424
は、その映像フレーム周期において多重化するオーディ
オフレームのデータ量frame_audio_rat
eを、S302の処理において算出したデータ量fra
me_audio_rate_pre+1とする。
At step S428, CPU 424
Is the data amount of audio frames to be multiplexed in the video frame period frame_audio_rat
e is the data amount fra calculated in the process of S302.
Set to me_audio_rate_pre + 1.

【0066】そしてCPU424は、ステップS430
において、スイッチ回路34など、データ多重化装置2
の各構成部分を制御して、図4に示した処理により算出
されたビデオデータ量frame_video_rat
eのビデオストリーム、ステップS426またはステッ
プS428において算出されたデータ量frame_a
udio_rateのオーディオストリームおよびプラ
イベートデータストリームを多重化させる。
Then, the CPU 424 determines in step S430
, The data multiplexer 2 such as the switch circuit 34
Of the video data frame_video_rat calculated by the processing shown in FIG.
e, the data amount frame_a calculated in step S426 or S428
The audio stream and the private data stream of the audio_rate are multiplexed.

【0067】以上説明したように、本実施の形態のデー
タ多重化装置2によれば、オーディオデータのビットレ
ートが8×1000bpsの倍数になっていないような
レートであっても、浮動小数点演算などを用いない簡単
な方法で、映像フレーム期間に同期したビデオストリー
ムおよびオーディオストリーム等の多重化を行うことが
できる。
As described above, according to the data multiplexing apparatus 2 of the present embodiment, even if the bit rate of the audio data is not a multiple of 8 × 1000 bps, the floating-point operation or the like can be performed. Multiplexing of a video stream, an audio stream, and the like synchronized with a video frame period can be performed by a simple method that does not use.

【0068】なお、本発明は本実施の形態に限られるも
のではなく、種々の改変が可能である。たとえば、本実
施の形態においては、映像フレーム周期当たりに多重化
するビデオストリームのデータ量video_fram
e_rateを、映像フレーム周期ごとに変更したが、
30映像フレーム周期(所定の制御周期)ごとに、デー
タ量frame_audio_rateを、データ量f
rame_audio_rate_preおよびデータ
量frame_audio_rate_pre+1のい
ずれかに変更する方法を採ってもよい。
The present invention is not limited to the present embodiment, and various modifications are possible. For example, in the present embodiment, the data amount video_frame of the video stream to be multiplexed per video frame period.
e_rate was changed for each video frame cycle,
The data amount frame_audio_rate is changed every 30 video frame periods (predetermined control periods) by the data amount f
A method of changing to one of frame_audio_rate_pre and data amount frame_audio_rate_pre + 1 may be adopted.

【0069】また、ビデオストリームおよびオーディオ
ストリームのデータレート、および、データ量の単位
(バイト)は例示であって、適切な変更を施してよい。
The data rates of the video stream and the audio stream and the unit (byte) of the data amount are mere examples, and may be changed appropriately.

【0070】[0070]

【発明の効果】以上説明したように、本発明によれば、
データレートが8×1000[bps]の整数倍になっ
ていないようなオーディオデータに対しても、受信装置
の受信バッファの記憶容量を厳密に管理する必要なく、
整数演算のみの簡単な処理で受信バッファに破綻を生じ
させないように送信データの制御が行え、音声データを
トランスポートストリームに適切に多重化し送信するこ
とができるデータ多重化装置およびその方法を提供する
ことができる。
As described above, according to the present invention,
Even for audio data whose data rate is not an integral multiple of 8 × 1000 [bps], there is no need to strictly manage the storage capacity of the receiving buffer of the receiving device,
Provided is a data multiplexing apparatus and method capable of performing control of transmission data so as not to cause a failure in a reception buffer by simple processing of only an integer operation, and appropriately multiplexing and transmitting audio data to a transport stream. be able to.

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

【図1】本発明の一実施の形態のデータ多重化装置の構
成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a data multiplexing device according to an embodiment of the present invention.

【図2】図1に示したビデオエンコーダの構成を示すブ
ロック図である。
FIG. 2 is a block diagram showing a configuration of a video encoder shown in FIG.

【図3】図1に示したオーディオエンコーダの構成を示
すブロック図である。
FIG. 3 is a block diagram showing a configuration of the audio encoder shown in FIG.

【図4】図2に示したデータ多重化装置のビデオエンコ
ーダのビットレート制御回路に設定される目標データ量
video_rate_targetの算出方法を示す
フローチャート図である。
4 is a flowchart illustrating a method of calculating a target data amount video_rate_target set in a bit rate control circuit of a video encoder of the data multiplexer illustrated in FIG. 2;

【図5】44.1kHzでサンプリングされたオーディ
オデータの各種条件の時のビットレート、30映像フレ
ーム間のデータ数、および、補正値などを示す図であ
る。
FIG. 5 is a diagram showing a bit rate under various conditions of audio data sampled at 44.1 kHz, the number of data between 30 video frames, a correction value, and the like.

【図6】図2に示したデータ多重化装置が、映像フレー
ム周期ごとにトランスポートストリームに多重化するオ
ーディオストリームのデータ量を算出し、ビデオストリ
ーム等と多重化する処理を示すフローチャート図であ
る。
FIG. 6 is a flowchart showing a process in which the data multiplexing apparatus shown in FIG. 2 calculates a data amount of an audio stream to be multiplexed on a transport stream for each video frame period, and multiplexes the data stream with a video stream or the like. .

【図7】MPEG方式において規定されているオーディ
オデータの転送符号レートを示す図である。
FIG. 7 is a diagram showing a transfer code rate of audio data specified in the MPEG system.

【図8】これまでのデータ多重化装置が、映像フレーム
周期ごとにトランスポートストリームに多重化するオー
ディオストリームのデータ量を算出し、ビデオストリー
ム等と多重化する処理を示すフローチャート図である。
FIG. 8 is a flowchart showing a process in which the data multiplexing device calculates a data amount of an audio stream to be multiplexed to a transport stream for each video frame period, and multiplexes the data amount with a video stream or the like.

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

2…データ多重化装置、12…多重化系、20…ビデオ
エンコーダ、24…オーディオエンコーダ、28…サブ
タイトルエンコーダ、32a,32b,32c…FIF
Oメモリ、34,36…スイッチ回路、38…FIFO
メモリ、40…SCSIIF回路、42…制御系、30
a,30b,30c…データ量IF、420…ENIF
回路、422…SIF回路、424…CPU、426…
処理用RAM、428…制御データ用RAM、430…
RAM、432…カウンタ
2 Data multiplexing device, 12 Multiplexing system, 20 Video encoder, 24 Audio encoder, 28 Subtitle encoder, 32a, 32b, 32c FIF
O memory, 34, 36: switch circuit, 38: FIFO
Memory, 40: SCSIIF circuit, 42: Control system, 30
a, 30b, 30c ... data amount IF, 420 ... ENIF
Circuit, 422 ... SIF circuit, 424 ... CPU, 426 ...
RAM for processing, 428 ... RAM for control data, 430 ...
RAM, 432 ... Counter

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】多重化対象の音声データのビットレートに
基づいて、対応する映像データの所定数の映像フレーム
期間の音声データ量を算出するデータ量算出手段と、 前記算出した音声データ量に基づいて、所定の単位デー
タ量の整数倍となる前記所定数の映像フレーム期間の音
声データの多重化目標データ量を求める多重化目標デー
タ量検出手段と、 前記算出した音声データ量と前記求めた多重化目標デー
タ量の差の累積値が、前記所定の単位データ量の整数倍
となる前記所定数の映像フレーム期間の数を検出する補
正単位検出手段と、 前記検出した前記所定数の映像フレーム期間の数ごと
に、前記所定数の映像フレーム期間の前記多重化目標デ
ータ量を、当該多重化目標データ量に、前記所定の単位
データ量の整数倍となる前記累積値を加えたデータ量に
補正する目標値補正手段と、 前記求めた多重化目標データ量および前記補正された多
重化目標データ量に基づいて、当該所定数の映像フレー
ム期間の各映像フレーム期間に多重化する前記音声デー
タのデータ量を決定する多重化データ量決定手段と、 前記決定されたデータ量の音声データを、所定のトラン
スポートストリームに多重化する多重化手段とを有する
データ多重化装置。
1. A data amount calculating means for calculating an audio data amount of a predetermined number of video frame periods of corresponding video data based on a bit rate of audio data to be multiplexed, based on the calculated audio data amount. Multiplexing target data amount detecting means for obtaining a multiplexing target data amount of audio data of the predetermined number of video frame periods, which is an integral multiple of a predetermined unit data amount, and the calculated audio data amount and the obtained multiplexing. Correction unit detecting means for detecting the number of the predetermined number of video frame periods in which the cumulative value of the difference between the normalized target data amounts is an integral multiple of the predetermined unit data amount; and the detected predetermined number of video frame periods For each number, the multiplex target data amount for the predetermined number of video frame periods is calculated by adding the cumulative value, which is an integral multiple of the predetermined unit data amount, to the multiplex target data amount. A target value correcting unit for correcting the obtained multiplexed target data amount and the corrected multiplexed target data amount, and multiplexing in each video frame period of the predetermined number of video frame periods. A data multiplexing apparatus comprising: a multiplexed data amount determining unit that determines a data amount of the audio data; and a multiplexing unit that multiplexes the determined amount of audio data into a predetermined transport stream.
【請求項2】前記目標値補正手段は、 当該映像フレーム期間前の前記所定数の前記映像フレー
ム期間の間に多重化した前記音声データのデータ量を計
数する音声データ計数手段と、 前記計数した前記音声データのデータ量に基づいて、当
該映像フレーム期間の多重化目標データ量を補正するか
否かを決定する補正制御手段とを有する請求項1記載の
データ多重化装置。
2. An audio data counting means for counting a data amount of the audio data multiplexed during the predetermined number of the video frame periods before the video frame period; 2. The data multiplexing device according to claim 1, further comprising: a correction control unit that determines whether to correct a multiplexing target data amount in the video frame period based on a data amount of the audio data.
【請求項3】前記所定の単位データ量は1バイトであっ
て、 前記多重化目標データ量検出手段は、前記算出した音声
データ量に基づいて、バイトを単位とする前記多重化目
標データ量を求め、 前記補正単位検出手段は、前記算出した音声データ量の
バイトに満たない端数のデータの累積値が、バイトを単
位とするデータ量となる前記所定数の映像フレーム期間
の数を検出する請求項1記載のデータ多重化装置。
3. The predetermined unit data amount is 1 byte, and the multiplexing target data amount detecting means calculates the multiplexing target data amount in bytes based on the calculated audio data amount. The correction unit detecting means detects the number of the predetermined number of video frame periods in which the cumulative value of fractional data less than bytes of the calculated audio data amount is the data amount in bytes. Item 2. The data multiplexing device according to Item 1.
【請求項4】前記データ量算出手段は、多重化対象の音
声データのビットレートに基づいて、対応する映像デー
タの30映像フレーム期間の音声データ量を算出し、 前記多重化目標データ量検出手段は、前記算出した音声
データ量に基づいて、バイトを単位とする前記30映像
フレーム期間の音声データの多重化目標データ量を求
め、 前記補正単位検出手段は、前記算出した音声データ量お
よび前記求めた多重化目標データ量の差の累積値が、バ
イトを単位としたデータ量となる30映像フレーム期間
の数を100とし、 前記目標値補正手段は、前記30映像フレーム期間10
0個ごとに、当該30映像フレーム期間の前記多重化目
標データ量を、当該多重化目標データ量に、前記バイト
単位となるようにした前記音声データ量および前記多重
化目標データ量の差の累積値を加えたデータ量に補正
し、 前記多重化データ量決定手段は、前記求めた多重化目標
データ量および前記補正された多重化目標データ量に基
づいて、当該30映像フレーム期間の各映像フレーム期
間に多重化する前記音声データのデータ量を決定し、 前記多重化手段は、前記決定されたデータ量の音声デー
タを、所定のトランスポートストリームに多重化する請
求項3記載のデータ多重化装置。
4. The multiplexing target data amount detecting means, wherein the data amount calculating means calculates the audio data amount of the corresponding video data in 30 video frame periods based on the bit rate of the audio data to be multiplexed. Calculates a multiplexing target data amount of the audio data in the 30 video frame periods in units of bytes based on the calculated audio data amount. The correction unit detecting means calculates the calculated audio data amount and the calculated The number of 30 video frame periods in which the cumulative value of the difference between the multiplexed target data amounts becomes the data amount in units of bytes is assumed to be 100, and the target value correction means sets the 30 video frame periods 10
For every 0 pieces, the multiplexing target data amount for the 30 video frame periods is added to the multiplexing target data amount, and the accumulation of the difference between the audio data amount and the multiplexing target data amount in the byte unit. The multiplexed data amount determining means, based on the obtained multiplexed target data amount and the corrected multiplexed target data amount, for each video frame of the 30 video frame period. The data multiplexing apparatus according to claim 3, wherein a data amount of the audio data to be multiplexed during a period is determined, and the multiplexing unit multiplexes the determined amount of audio data into a predetermined transport stream. .
【請求項5】前記音声データは、44.1kHzのサン
プリング周波数でパルス符号変調(PCM)した音声デ
ータであることを特徴とする請求項4記載のデータ多重
化装置。
5. The data multiplexing apparatus according to claim 4, wherein said audio data is audio data subjected to pulse code modulation (PCM) at a sampling frequency of 44.1 kHz.
【請求項6】多重化対象の音声データのビットレートに
基づいて、対応する映像データの所定数の映像フレーム
期間の音声データ量を算出し、 前記算出した音声データ量に基づいて、所定の単位デー
タ量の整数倍となる前記所定数の映像フレーム期間の音
声データの多重化目標データ量を求め、 前記算出した音声データ量と前記求めた多重化目標デー
タ量の差の累積値が、前記所定の単位データ量の整数倍
となる前記所定数の映像フレーム期間の数を検出し、 前記検出した前記所定数の映像フレーム期間の数ごと
に、前記所定数の映像フレーム期間の前記多重化目標デ
ータ量を、当該多重化目標データ量に、前記所定の単位
データ量の整数倍となる前記累積値を加えたデータ量に
補正し、 前記求めた多重化目標データ量および前記補正された多
重化目標データ量に基づいて、当該所定数の映像フレー
ム期間の各映像フレーム期間に多重化する前記音声デー
タのデータ量を算出し、 前記算出されたデータ量の音声データを、所定のトラン
スポートストリームに多重化するデータ多重化方法。
6. An audio data amount for a predetermined number of video frame periods of corresponding video data is calculated based on a bit rate of audio data to be multiplexed, and a predetermined unit is calculated based on the calculated audio data amount. A multiplexing target data amount of the audio data of the predetermined number of video frame periods that is an integral multiple of the data amount is obtained, and a cumulative value of a difference between the calculated audio data amount and the obtained multiplexing target data amount is the predetermined value. Detecting the number of the predetermined number of video frame periods that is an integral multiple of the unit data amount of the multiplexed target data of the predetermined number of video frame periods for each of the detected number of the predetermined number of video frame periods. The amount is corrected to a data amount obtained by adding the cumulative value that is an integral multiple of the predetermined unit data amount to the multiplexed target data amount, and the obtained multiplexed target data amount and the corrected Calculating a data amount of the audio data to be multiplexed in each video frame period of the predetermined number of video frame periods on the basis of the multiplexed target data amount, and converting the audio data of the calculated data amount into a predetermined transformer. Data multiplexing method for multiplexing to port stream.
【請求項7】前記多重化目標データ量の補正は、 当該映像フレーム期間前の前記所定数の前記映像フレー
ム期間の間に多重化した前記音声データのデータ量を計
数し、 前記計数した前記音声データのデータ量に基づいて、当
該映像フレーム期間の多重化目標データ量を補正するか
否かを決定して行うことを特徴とする請求項6記載のデ
ータ多重化方法。
7. The correction of the multiplex target data amount includes counting a data amount of the audio data multiplexed during the predetermined number of the video frame periods before the video frame period, and 7. The data multiplexing method according to claim 6, wherein whether to correct the multiplexing target data amount in the video frame period is determined based on the data amount of the data.
【請求項8】前記所定の単位データ量は1バイトであ
り、 前記所定数の映像フレーム期間は30映像フレーム期間
であり、 前記音声データ量のバイトに満たない端数のデータの累
積値が、バイトを単位とするデータとなる30映像フレ
ーム期間の数は、100であることを特徴とする請求項
7記載のデータ多重化方法。
8. The predetermined unit data amount is 1 byte, the predetermined number of video frame periods is 30 video frame periods, and the cumulative value of fractional data less than bytes of the audio data amount is bytes. 8. The data multiplexing method according to claim 7, wherein the number of 30 video frame periods which are data in units of 100 is 100.
【請求項9】前記音声データは、44.1kHzのサン
プリング周波数でパルス符号変調(PCM)した音声デ
ータであることを特徴とする請求項8記載のデータ多重
化方法。
9. The data multiplexing method according to claim 8, wherein said audio data is audio data subjected to pulse code modulation (PCM) at a sampling frequency of 44.1 kHz.
JP32007597A 1997-11-20 1997-11-20 Data multiplexer and its method Pending JPH11155133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32007597A JPH11155133A (en) 1997-11-20 1997-11-20 Data multiplexer and its method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32007597A JPH11155133A (en) 1997-11-20 1997-11-20 Data multiplexer and its method

Publications (1)

Publication Number Publication Date
JPH11155133A true JPH11155133A (en) 1999-06-08

Family

ID=18117447

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32007597A Pending JPH11155133A (en) 1997-11-20 1997-11-20 Data multiplexer and its method

Country Status (1)

Country Link
JP (1) JPH11155133A (en)

Similar Documents

Publication Publication Date Title
US6542518B1 (en) Transport stream generating device and method, and program transmission device
US5790745A (en) Variable transfer rate control coding apparatus, reproducing apparatus and recording medium
US7379497B2 (en) Encoded data outputting apparatus and method
JP4186935B2 (en) Multiplexer, multiplexing method, and multiplexed data transmission / reception system
CN1781295A (en) Redundant transmission of programmes
EP0826289B1 (en) Data multiplexing apparatus
JP2004056809A (en) Synchronizing system of data buffer
JP3045715B2 (en) Transmission system, transmitting device, recording / reproducing device, and recording device
JP2008061150A (en) Receiver and information processing method
KR100814431B1 (en) Apparatus for transmitting broadcast signal, encoding system for encoding broadcast signal adapted variable bit rate and decoding system thereof
JP3679606B2 (en) Encoding apparatus and method, and computer-readable recording medium on which an encoding program is recorded
JP2005151463A (en) Device and method for receiving stream data
JPH11155133A (en) Data multiplexer and its method
JPH1013826A (en) Picture encoder, its method, picture decoder, its method, picture transmitter, picture receiver and recording medium
JP4016215B2 (en) Digital signal encoding method and apparatus, and digital signal transmission method and apparatus
JPH09312625A (en) Data multiplexer and its method
JPH11112947A (en) Device and method for data multiplexing, device and method for data processing, and transmission medium
JPH09312656A (en) Transmitter and method therefor
JPH11187364A (en) Data multiplexing device and its method
JPH10271463A (en) Data multiplexer and method therefor
JP2002171529A (en) Video encoder and method, recording medium, and decoder
JPH09284732A (en) Device and method for generating audio and video data
JPH1051769A (en) Synchronization data generator and its method
KR100915798B1 (en) Method for recording digital broadcasting by enhanced compressing format
JPH0974547A (en) Data multiplexer