JP4403403B2 - Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method - Google Patents

Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method Download PDF

Info

Publication number
JP4403403B2
JP4403403B2 JP2004321761A JP2004321761A JP4403403B2 JP 4403403 B2 JP4403403 B2 JP 4403403B2 JP 2004321761 A JP2004321761 A JP 2004321761A JP 2004321761 A JP2004321761 A JP 2004321761A JP 4403403 B2 JP4403403 B2 JP 4403403B2
Authority
JP
Japan
Prior art keywords
data
unit
buffer
access unit
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2004321761A
Other languages
Japanese (ja)
Other versions
JP2006135603A (en
Inventor
哲士 梅田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2004321761A priority Critical patent/JP4403403B2/en
Publication of JP2006135603A publication Critical patent/JP2006135603A/en
Application granted granted Critical
Publication of JP4403403B2 publication Critical patent/JP4403403B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Time-Division Multiplex Systems (AREA)

Description

本発明は、複数の符号化ストリームを多重化するストリーム多重化装置、これを備えたストリーム記録装置、およびストリーム多重化方法に関し、特に、符号化ストリームを生成するエンコーダとは独立して動作することが可能なストリーム多重化装置、これを備えたストリーム記録装置、およびストリーム多重化方法に関する。   The present invention relates to a stream multiplexing apparatus that multiplexes a plurality of encoded streams, a stream recording apparatus including the same, and a stream multiplexing method, and in particular, operates independently of an encoder that generates an encoded stream. The present invention relates to a stream multiplexing apparatus capable of performing the above, a stream recording apparatus including the same, and a stream multiplexing method.

近年、MPEG(Moving Picture Experts Group)方式などの画像圧縮技術の進歩などに伴い、画像信号をデジタル化して取り扱うことが一般的になっている。例えば、光ディスクなどの各種記録媒体に対して動画像をデジタルデータとして記録するデジタルビデオレコーダなどが広く普及している。   In recent years, with the progress of image compression technology such as the MPEG (Moving Picture Experts Group) system, it has become common to digitize and handle image signals. For example, digital video recorders that record moving images as digital data on various recording media such as optical disks are widely used.

MPEG方式では、圧縮符号化したビデオやオーディオのデータ(ES:Elementary Stream)を時分割多重化して、1つのストリーム(PS:Program Stream)が生成される。PSは、パックおよびパケットという階層構造により構成されており、ビデオES,オーディオESのデータはそれぞれビデオパケット,オーディオパケットに分割して格納され、これらの複数のパケットによってパックが構成される。また、パケットのヘッダには、復号時刻や再生時刻などの時刻管理情報が記録され、これによりエンコーダ側で意図したタイミングでストリームを同期再生することが可能となる。   In the MPEG method, compression-coded video and audio data (ES: Elementary Stream) is time-division multiplexed to generate one stream (PS: Program Stream). The PS has a hierarchical structure of packs and packets. The video ES and audio ES data is divided into video packets and audio packets, respectively, and a pack is constituted by the plurality of packets. In addition, time management information such as a decoding time and a reproduction time is recorded in the header of the packet, so that a stream can be synchronously reproduced at an intended timing on the encoder side.

図6は、MPEG方式を用いた従来のストリーム生成装置の要部構成を示す図である。
ストリーム生成装置は、図6に示すように、ビデオエンコーダ101、オーディオエンコーダ102、ビデオESバッファ103、ビデオInfoバッファ104、オーディオESバッファ105、オーディオInfoバッファ106、およびMUX(Multiplexer)107を備える。
FIG. 6 is a diagram showing a main configuration of a conventional stream generation apparatus using the MPEG method.
As shown in FIG. 6, the stream generation device includes a video encoder 101, an audio encoder 102, a video ES buffer 103, a video Info buffer 104, an audio ES buffer 105, an audio Info buffer 106, and a MUX (Multiplexer) 107.

ビデオエンコーダ101およびオーディオエンコーダ102は、それぞれビデオデータおよびオーディオデータを圧縮符号化し、符号化後のESのデータをアクセスユニット(AU)単位でビデオESバッファ103およびオーディオESバッファ105に順次格納する。1つのアクセスユニットは、ビデオでは1フレームまたは1フィールドのピクチャ、オーディオではオーディオフレームによりそれぞれ構成される。   The video encoder 101 and the audio encoder 102 respectively compress and encode video data and audio data, and sequentially store the encoded ES data in the video ES buffer 103 and the audio ES buffer 105 in units of access units (AU). One access unit is composed of one frame or one field picture for video and an audio frame for audio.

また、ビデオエンコーダ101およびオーディオエンコーダ102は、出力したAUに関する情報(AU_Info)をそれぞれビデオInfoバッファ104、オーディオInfoバッファ106に格納する。AU_Infoとしては、AUの各Infoバッファ上の位置情報、データサイズ、再生出力時刻の管理情報であるPTS(Presentation Time Stamp)、デコード時刻の管理情報であるDTS(Decoding Time Stamp)などが記録される。   In addition, the video encoder 101 and the audio encoder 102 store the output information (AU_Info) relating to the AU in the video Info buffer 104 and the audio Info buffer 106, respectively. As AU_Info, position information on each AU Info buffer, data size, PTS (Presentation Time Stamp) that is management information of reproduction output time, DTS (Decoding Time Stamp) that is management information of decoding time, and the like are recorded. .

MUX107は、各Infoバッファの情報を参照しながら、ビデオESバッファ103およびオーディオESバッファ105からデータを読み出してそれぞれビデオパケット、オーディオパケットに格納していき、これらのパケットをパックに多重化してPSを完成させ、出力する。このとき、AUの先頭データを含むパケットヘッダに時刻管理情報(DTS,PTS)を記録するとともに、これらの時刻の基準参照値であるSCR(System Clock Reference)をパックのシステムヘッダに記録する。   The MUX 107 reads out data from the video ES buffer 103 and the audio ES buffer 105 while referring to the information of each Info buffer, stores the data in a video packet and an audio packet, respectively, multiplexes these packets into a pack, and PS. Complete and output. At this time, time management information (DTS, PTS) is recorded in the packet header including the head data of the AU, and SCR (System Clock Reference) which is a reference reference value of these times is recorded in the system header of the pack.

このような情報をストリーム中に記録しておくことにより、再生装置は、SCRの値を参照して、符号器側で意図した基準時刻を復号器内部のSTC(System Time Clock)といわれる同期信号において再現し、このSTCの値とPTSおよびDTSとを基に対応するAUのデコードおよび再生出力のタイミングを制御して、ビデオおよびオーディオの同期再生を行うことが可能となる。   By recording such information in the stream, the playback device refers to the SCR value and sets the reference time intended on the encoder side as a synchronization signal called STC (System Time Clock) inside the decoder. The video and audio can be synchronized and reproduced by controlling the decoding and reproduction output timing of the corresponding AU based on the STC value and the PTS and DTS.

また、ESの多重化に際しては、P−STD(Program-System Target Decoder)といわれる標準的なデコーダのモデルが定義されており、符号器側ではこのP−STDにおいて正しくデコード処理できるようにする必要がある。具体的には、MUX107は、符号器側で想定されているP−STDバッファがオーバフローしたりアンダフローしたりしないように符号量を管理しながら多重化する(例えば、特許文献1参照)。さらに、上記のバッファ管理のためのスケジューリング処理と、その処理に従ったデータの多重化処理との処理時間の差を吸収するために、スケジュール情報と多重化すべき付加データとをスケジューラとMUXとの間の中間バッファを格納するようにしたものがあった(例えば、特許文献2参照)。
特開平8−335371号公報(段落番号〔0013〕〜〔0017〕、図11) 特開平10−276164号公報(段落番号〔0057〕〜〔0076〕、図1)
In addition, for ES multiplexing, a standard decoder model called P-STD (Program-System Target Decoder) is defined, and it is necessary for the encoder side to be able to correctly decode the P-STD. There is. Specifically, the MUX 107 multiplexes while managing the code amount so that the P-STD buffer assumed on the encoder side does not overflow or underflow (see, for example, Patent Document 1). Furthermore, in order to absorb the difference in processing time between the scheduling process for buffer management and the data multiplexing process according to the above process, schedule information and additional data to be multiplexed are exchanged between the scheduler and the MUX. In some cases, an intermediate buffer is stored (for example, see Patent Document 2).
JP-A-8-335371 (paragraph numbers [0013] to [0017], FIG. 11) JP-A-10-276164 (paragraph numbers [0057] to [0076], FIG. 1)

ところで、上述したようなストリーム生成装置を具備するビデオレコーダなどの機器では、多くの機能が要求され、制御処理が徐々に複雑化する傾向にある。このため、例えばエンコーダやMUXなどの個々の機能の制御をそれぞれリアルタイムOS(Operating System)上のタスクとして実装し、各機能の開発や検証の効率を向上させることが考えられている。   By the way, in a device such as a video recorder provided with the above-described stream generation device, many functions are required, and control processing tends to be gradually complicated. For this reason, for example, it is considered to implement control of individual functions such as an encoder and MUX as tasks on a real-time OS (Operating System) to improve the efficiency of development and verification of each function.

しかし、エンコーダとMUXの各制御を個別のタスクとした場合には、エンコーダは入力データに応じて決まるタイミングで動作するのに対し、MUXは多重化レートに基づくタイミングで動作する。このため、多重化すべきデータがESバッファにない場合でも、MUXはこのことに関係なく動作し続けて、データの格納されていない不要なパケットを出力し続けるといった異常な事態が生じてしまう。   However, when each control of the encoder and MUX is an individual task, the encoder operates at a timing determined according to input data, whereas the MUX operates at a timing based on the multiplexing rate. For this reason, even when there is no data to be multiplexed in the ES buffer, the MUX continues to operate regardless of this, and an abnormal situation occurs in which an unnecessary packet in which no data is stored is continuously output.

例えば、ビデオデータやオーディオデータのエンコード中は、基本的に、エンコーダに対する入力データが途切れることはない。このため、MUXの動作が遅い場合、MUXで何らかの障害が発生した場合、ESバッファの容量が足りない場合などには、エンコードしたAUのデータをESバッファに格納することができない、あるいは読み出し前のデータを上書きしてしまうといった障害が発生する。このような障害はシステムにとって致命的なものであるため、その発生を防止するためには、ESバッファの容量を増やすか、あるいは十分な速度でESバッファからデータを取り出して多重化ストリームを生成するようにMUXを設計する必要がある。   For example, during the encoding of video data or audio data, input data to the encoder is basically not interrupted. For this reason, when the operation of the MUX is slow, when some trouble occurs in the MUX, or when the capacity of the ES buffer is insufficient, the encoded AU data cannot be stored in the ES buffer, or before the read Failures such as overwriting data occur. Since such a failure is fatal to the system, in order to prevent its occurrence, the capacity of the ES buffer is increased, or data is extracted from the ES buffer at a sufficient speed to generate a multiplexed stream. Thus, it is necessary to design the MUX.

しかし、MUXの読み出し速度を高めた場合には、AUごとのエンコード処理に要する時間の変動により、ESバッファに多重化すべきAUが存在しない状態が生じる可能性がある。従来のMUXでは、エンコーダ側と通信して同期動作することでこのような状態を検出し、不要なパケットの生成を防止していたが、それでは各部の制御を個別のタスクとすることができない。また例えば、MUXがESバッファ内の入力データサイズなどを検出して管理しながら動作することで、各部が通信することなく上記事態を回避できるが、この場合にはMUXによるESバッファへのアクセス回数が増加し、異常判定の処理が複雑になることが問題となる。   However, when the MUX reading speed is increased, there is a possibility that a state in which there is no AU to be multiplexed exists in the ES buffer due to a variation in time required for the encoding process for each AU. In the conventional MUX, such a state is detected by communicating with the encoder side and performing a synchronous operation to prevent generation of an unnecessary packet. However, it is not possible to control each part as an individual task. Further, for example, the MUX operates while detecting and managing the input data size in the ES buffer, so that the above situation can be avoided without communication of each unit. In this case, however, the number of accesses to the ES buffer by the MUX This increases the complexity of the abnormality determination process.

本発明はこのような点に鑑みてなされたものであり、多重化すべきデータの入力が途絶えた場合にも、エンコーダとの間で互いに情報をやり取りすることなく、独立して正常に動作し続けることが可能なストリーム多重化装置を提供することを目的とする。   The present invention has been made in view of such points, and even when input of data to be multiplexed is interrupted, it continues to operate normally independently without exchanging information with the encoder. It is an object of the present invention to provide a stream multiplexing apparatus that can perform the above-described process.

また、本発明の他の目的は、多重化すべきデータの入力が途絶えた場合にも、エンコーダとの間で互いに情報をやり取りすることなく、独立して正常に動作し続けることが可能なストリーム多重化装置を備えたストリーム記録装置を提供することである。   Another object of the present invention is to provide stream multiplexing that can continue to operate normally without exchanging information with the encoder even when input of data to be multiplexed is interrupted. A stream recording apparatus including the converting apparatus.

さらに、本発明の他の目的は、多重化すべきデータの入力が途絶えた場合にも、エンコーダとの間で互いに情報をやり取りすることなく、独立して正常に動作し続けることが可能なストリーム多重化方法を提供することである。   Furthermore, another object of the present invention is to provide stream multiplexing that can continue to operate normally without exchanging information with an encoder even when input of data to be multiplexed is interrupted. Is to provide a method.

本発明では上記課題を解決するために、複数のエンコーダによってそれぞれ生成された符号化ストリームが、デコード時のアクセス単位であるアクセスユニットごとに一時的に格納される符号化ストリームバッファと、前記符号化ストリームバッファに格納された前記アクセスユニットに関するユニット情報が格納されるユニット情報バッファとから、データを受け取って多重化ストリームを生成するストリーム多重化装置において、前記ユニット情報バッファから読み出した前記ユニット情報のうち、対応する前記アクセスユニットのデータサイズの情報を基にして、前記多重化ストリームを構成するデータ群のペイロード領域を満たすだけの前記アクセスユニットのデータが前記符号化ストリームバッファに格納されているか否かを判定するデータサイズ判定手段と、前記データサイズ判定手段により条件を満たすと判定された場合に、必要な前記アクセスユニットのデータを前記符号化ストリームバッファから読み出し、1つの前記データ群を生成して出力するデータ群生成手段とを有し、前記データサイズ判定手段は、前記符号化ストリームバッファ内の現在の先頭の前記アクセスユニットのデータにより前記データ群のペイロード領域を満たすことができないと判定した場合には、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報および先頭の前記アクセスユニットに対応する前記ユニット情報に基づいて、先頭およびその次の前記アクセスユニットの各データにより前記ペイロード領域を満たすか否かを判定することを特徴とするストリーム多重化装置が提供される。 In the present invention, in order to solve the above problems, an encoded stream buffer in which encoded streams respectively generated by a plurality of encoders are temporarily stored for each access unit as an access unit at the time of decoding, and the encoding Among the unit information read from the unit information buffer in a stream multiplexing device that receives data from a unit information buffer that stores unit information related to the access unit stored in the stream buffer and generates a multiplexed stream Whether or not the data of the access unit sufficient to satisfy the payload area of the data group constituting the multiplexed stream is stored in the encoded stream buffer based on the data size information of the corresponding access unit Judgment When the data size determination means and the data size determination means determine that the condition is satisfied, the necessary access unit data is read from the encoded stream buffer, and one data group is generated and output. have a data group generation unit, the data size determining unit, when the data of the current head of the access unit in the coded stream buffer is determined not to be able to meet the payload area of the data groups And waiting for the unit information corresponding to the next access unit to be stored in the unit information buffer, and when the unit information is stored, the unit information corresponding to the unit information and the first access unit Each of the first and next access units based on Stream multiplexing apparatus is provided which is characterized by determining whether they meet the payload area by over data.

このようなストリーム多重化装置では、データサイズ判定手段によって、多重化ストリームを構成するデータ群のペイロード領域を満たすだけのアクセスユニットのデータが符号化ストリームバッファに格納されていると判定された場合にのみ、データ群生成手段が、そのアクセスユニットのデータを符号化ストリームバッファから読み出して1つのデータ群を生成する。また、符号化ストリームバッファ内の現在の先頭のアクセスユニットのデータによりデータ群のペイロード領域を満たすことができないと判定された場合には、次のアクセスユニットに対応するユニット情報がユニット情報バッファに格納されるのを待機する。そして、次のアクセスユニットに対応するユニット情報が格納されると、このユニット情報および先頭のアクセスユニットに対応するユニット情報に基づいて、先頭およびその次のアクセスユニットの各データによりペイロード領域を満たすか否かを判定する。このため、エンコーダとの処理速度の違いやエンコーダでの障害発生などにより、多重化するための十分なアクセスユニットが生成されていない場合に、余分なデータ群を出力し続けるという異常な動作を行うことがなくなる。そして、データサイズ判定手段は、上記の判定をユニット情報バッファ内のユニット情報を基にして行うので、エンコーダとの間でデータのやり取りを行うことなく、エンコーダとは独立して多重化処理を正常に実行し続けるようになる。 In such a stream multiplexing device, when it is determined by the data size determination means that the data of the access unit that satisfies the payload area of the data group constituting the multiplexed stream is stored in the encoded stream buffer. Only, the data group generation means reads the data of the access unit from the encoded stream buffer and generates one data group. In addition, when it is determined that the payload area of the data group cannot be filled with the data of the current head access unit in the encoded stream buffer, the unit information corresponding to the next access unit is stored in the unit information buffer. Wait to be done. When the unit information corresponding to the next access unit is stored, whether the payload area is filled with each data of the head and the next access unit based on the unit information and the unit information corresponding to the head access unit. Determine whether or not. For this reason, when a sufficient access unit for multiplexing is not generated due to a difference in processing speed with the encoder or a failure in the encoder, an abnormal operation of continuing to output an extra data group is performed. There will be nothing. Since the data size determination means performs the above determination based on the unit information in the unit information buffer, normal multiplexing processing is performed independently of the encoder without exchanging data with the encoder. Will continue to run.

また、本発明では、複数のエンコーダによってそれぞれ生成された符号化ストリームが、デコード時のアクセス単位であるアクセスユニットごとに一時的に格納される符号化ストリームバッファと、前記符号化ストリームバッファに格納された前記アクセスユニットに関するユニット情報が格納されるユニット情報バッファとから、データを受け取って多重化ストリームを生成するためのストリーム多重化方法において、データサイズ判定手段が、前記ユニット情報バッファから読み出した前記ユニット情報のうち、対応する前記アクセスユニットのデータサイズの情報を基にして、前記多重化ストリームを構成するデータ群のペイロード領域を満たすだけの前記アクセスユニットのデータが前記符号化ストリームバッファに格納されているか否かを判定するデータサイズ判定ステップと、前記データサイズ判定ステップで条件を満たすと判定された場合に、データ群生成手段が、必要な前記アクセスユニットのデータを前記符号化ストリームバッファから読み出し、1つの前記データ群を生成して出力するデータ群生成ステップとみ、前記データサイズ判定ステップでは、前記符号化ストリームバッファ内の現在の先頭の前記アクセスユニットのデータにより前記データ群のペイロード領域を満たすことができないと判定した場合には、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報および先頭の前記アクセスユニットに対応する前記ユニット情報に基づいて、先頭およびその次の前記アクセスユニットの各データにより前記ペイロード領域を満たすか否かを判定することを特徴とするストリーム多重化方法が提供される。 In the present invention, the encoded streams respectively generated by the plurality of encoders are stored in the encoded stream buffer that is temporarily stored for each access unit that is an access unit at the time of decoding, and the encoded stream buffer. In a stream multiplexing method for receiving data from a unit information buffer in which unit information related to the access unit is stored and generating a multiplexed stream, the unit read by the data size determination unit from the unit information buffer Of the information , based on the information on the data size of the corresponding access unit, the data of the access unit sufficient to satisfy the payload area of the data group constituting the multiplexed stream is stored in the encoded stream buffer. Have When it is determined that the condition is satisfied in the data size determination step for determining whether or not and the data size determination step, the data group generation means reads the necessary access unit data from the encoded stream buffer, One of viewing contains a data group generation step of generating and outputting the data set, in the data size determination step, the current first payload area of the data group by the data of the access unit in the coded stream buffer If it is determined that the unit information cannot be satisfied, it waits for the unit information corresponding to the next access unit to be stored in the unit information buffer, and when the unit information is stored, the unit information and the head Based on the unit information corresponding to the access unit , The top and the stream multiplexing method characterized by determining whether they meet the payload area by the data of the next of said access unit is provided.

このようなストリーム多重化方法では、データサイズ判定ステップにおいて、多重化ストリームを構成するデータ群のペイロード領域を満たすだけのアクセスユニットのデータが符号化ストリームバッファに格納されていると判定された場合にのみ、データ群生成ステップが実行されて、アクセスユニットのデータが符号化ストリームバッファから読み出されて1つのデータ群が生成される。また、データサイズ判定ステップでは、符号化ストリームバッファ内の現在の先頭のアクセスユニットのデータによりデータ群のペイロード領域を満たすことができないと判定した場合には、次のアクセスユニットに対応するユニット情報がユニット情報バッファに格納されるのを待機する。そして、次のアクセスユニットに対応するユニット情報が格納されると、このユニット情報および先頭のアクセスユニットに対応するユニット情報に基づいて、先頭およびその次のアクセスユニットの各データによりペイロード領域を満たすか否かを判定する。このため、エンコーダとの処理速度の違いやエンコーダでの障害発生などにより、多重化するための十分なアクセスユニットが生成されていない場合に、余分なデータ群を出力し続けるという異常な動作を行うことがなくなる。そして、データサイズ判定ステップでは、上記の判定をユニット情報バッファ内のユニット情報を基にして行うので、エンコーダとの間でデータのやり取りを行うことなく、エンコーダとは独立して多重化処理を正常に実行し続けるようになる。
In such a stream multiplexing method, when it is determined in the data size determination step that access unit data sufficient to satisfy the payload area of the data group constituting the multiplexed stream is stored in the encoded stream buffer. Only the data group generation step is executed, and the data of the access unit is read from the encoded stream buffer to generate one data group. In the data size determination step, when it is determined that the payload area of the data group cannot be filled with the data of the current head access unit in the encoded stream buffer, unit information corresponding to the next access unit is obtained. Wait for storage in the unit information buffer. When the unit information corresponding to the next access unit is stored, whether the payload area is filled with each data of the head and the next access unit based on the unit information and the unit information corresponding to the head access unit. Determine whether or not. For this reason, when a sufficient access unit for multiplexing is not generated due to a difference in processing speed with the encoder or a failure in the encoder, an abnormal operation of continuing to output an extra data group is performed. Nothing will happen. In the data size determination step, since the above determination is performed based on the unit information in the unit information buffer, the multiplexing process is normally performed independently of the encoder without exchanging data with the encoder. Will continue to run.

本発明によれば、データ群のペイロード領域を満たすだけのアクセスユニットのデータが用意されていると判定された場合にのみ、アクセスユニットのデータを符号化ストリームバッファから読み出して1つのデータ群を生成するため、エンコーダとの処理速度の違いやエンコーダでの障害発生などにより、多重化するための十分なアクセスユニットが生成されていない場合に、余分なデータ群を出力し続けるという異常な動作を行うことがなくなる。そして、上記の判定をユニット情報バッファ内のユニット情報を基にして行うので、エンコーダとの間でデータのやり取りを行うことなく、エンコーダとは独立して多重化処理を正常に実行し続けることができる。   According to the present invention, only when it is determined that access unit data sufficient to satisfy the payload area of the data group is prepared, the access unit data is read from the encoded stream buffer and one data group is generated. Therefore, when an access unit sufficient for multiplexing is not generated due to a difference in processing speed with the encoder or a failure in the encoder, an abnormal operation of continuing to output an extra data group is performed. Nothing will happen. Since the above determination is performed based on the unit information in the unit information buffer, the multiplexing process can be normally executed independently of the encoder without exchanging data with the encoder. it can.

以下、本発明の実施の形態について図面を参照して詳細に説明する。
ここでは、MPEGストリームを生成して記録媒体に記録するストリーム記録装置に、本発明を適用した場合を想定して説明する。このようなストリーム記録装置としては、例えば、デジタルビデオレコーダ、デジタルビデオカメラなどがある。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
Here, the case where the present invention is applied to a stream recording apparatus that generates an MPEG stream and records it on a recording medium will be described. Examples of such a stream recording apparatus include a digital video recorder and a digital video camera.

図1は、実施の形態に係るストリーム記録装置の構成を示すブロック図である。
図1に示すストリーム記録装置は、ビデオ信号、オーディオ信号をそれぞれMPEG方式で圧縮符号化するビデオエンコーダ11およびオーディオエンコーダ12、生成されたビデオES、オーディオESをそれぞれ一時的に記憶するビデオESバッファ13およびオーディオESバッファ14と、ビデオESおよびオーディオESに関する情報がそれぞれ格納されるビデオInfoバッファ15およびオーディオInfoバッファ16と、ビデオESおよびオーディオESを時分割多重化するMUX20と、多重化されたMPEGストリームの記録処理を行う記録処理部31と、MPEGストリームが記録される記録媒体32と、これらを統括的に制御するシステムコントローラ40とを具備する。
FIG. 1 is a block diagram showing a configuration of a stream recording apparatus according to the embodiment.
The stream recording apparatus shown in FIG. 1 includes a video encoder 11 and an audio encoder 12 that compress and encode a video signal and an audio signal, respectively, using an MPEG method, and a video ES buffer 13 that temporarily stores the generated video ES and audio ES. The audio ES buffer 14, the video info buffer 15 and the audio info buffer 16 in which information about the video ES and the audio ES are stored, the MUX 20 for time-division multiplexing the video ES and the audio ES, and the multiplexed MPEG stream A recording processing unit 31 that performs the recording process, a recording medium 32 on which an MPEG stream is recorded, and a system controller 40 that controls these in an integrated manner.

ビデオエンコーダ11およびオーディオエンコーダ12には、例えばテレビチューナや外部入力端子、ネットワークI/Fなどからのビデオ信号、オーディオ信号が、それぞれデジタルデータとして入力される。あるいは、固体撮像素子により撮像されたビデオ信号や、マイクにより収音されたオーディオ信号がそれぞれ入力されてもよい。   For example, a video signal and an audio signal from a TV tuner, an external input terminal, a network I / F, and the like are input to the video encoder 11 and the audio encoder 12 as digital data, respectively. Alternatively, a video signal picked up by a solid-state image sensor and an audio signal picked up by a microphone may be input.

ビデオエンコーダ11は、入力されたビデオ信号を圧縮符号化し、符号化したビデオESのAU(ピクチャ)をビデオESバッファ13に順次格納する。これとともに、出力したAUに関する情報(AU_Info)をビデオInfoバッファ15に格納する。オーディオエンコーダ12は、入力されたオーディオ信号を圧縮符号化し、符号化したオーディオESのAU(オーディオフレーム)をオーディオESバッファ14に順次格納する。これとともに、出力したAUに関するAU_InfoをオーディオInfoバッファ16に格納する。なお、AU_Infoとしては、AUの各Infoバッファ上の位置情報、データサイズ、PTS、DTSなどが記録される。   The video encoder 11 compresses and encodes the input video signal, and sequentially stores the encoded AU (picture) of the video ES in the video ES buffer 13. At the same time, the information (AU_Info) relating to the output AU is stored in the video Info buffer 15. The audio encoder 12 compresses and encodes the input audio signal, and sequentially stores the encoded audio ES AU (audio frame) in the audio ES buffer 14. At the same time, AU_Info related to the output AU is stored in the audio Info buffer 16. As AU_Info, position information, data size, PTS, DTS and the like on each AU Info buffer are recorded.

MUX20は、ビデオESバッファ13およびオーディオESバッファ14からのビデオESおよびオーディオESをAU単位で読み出し、パケットに分割して格納し、さらに複数のパケットによりパックを生成して各ESを多重化し、多重化ストリーム(PS)を出力する。このとき、必要に応じてビデオInfoバッファ15およびオーディオInfoバッファ16内のAU_Infoを読み出し、さらにSCRやストリームIDなどの情報を生成して、パケットヘッダやパックヘッダに格納する。   The MUX 20 reads the video ES and audio ES from the video ES buffer 13 and the audio ES buffer 14 in units of AUs, divides them into packets, stores them, generates a pack with a plurality of packets, multiplexes each ES, and multiplexes them. Stream (PS) is output. At this time, AU_Info in the video Info buffer 15 and the audio Info buffer 16 is read as necessary, and information such as SCR and stream ID is generated and stored in the packet header or pack header.

記録処理部31は、MUX20からのPSに対して誤り訂正符号などを付加し、さらに記録媒体32に記録可能な形式にデータを変換・変調して、PSを記録媒体32に順次格納する。記録媒体32としては、DVD(Digital Versatile Disk)などの光ディスク、HDD(Hard Disk Drive)、磁気テープ、半導体メモリなどが適用可能である。   The recording processing unit 31 adds an error correction code or the like to the PS from the MUX 20, converts and modulates data into a format that can be recorded on the recording medium 32, and sequentially stores the PS in the recording medium 32. As the recording medium 32, an optical disc such as a DVD (Digital Versatile Disk), an HDD (Hard Disk Drive), a magnetic tape, a semiconductor memory, or the like is applicable.

システムコントローラ40は、CPUやメモリなどからなり、上記の各ブロックを統括的に制御する。本実施の形態では、システムコントローラ40はリアルタイムOS上で各ブロックの制御処理を実行し、特に、ビデオエンコーダ11、オーディオエンコーダ12、MUX20のそれぞれの制御機能をリアルタイムOSの個別のタスクとして実装している。   The system controller 40 includes a CPU, a memory, and the like, and comprehensively controls each of the above blocks. In the present embodiment, the system controller 40 executes control processing for each block on the real-time OS, and in particular, implements the control functions of the video encoder 11, audio encoder 12, and MUX 20 as individual tasks of the real-time OS. Yes.

このような構成により、ビデオエンコーダ11、オーディオエンコーダ12、MUX20のそれぞれはお互いの同期をとることなく動作する。このため例えば、ビデオエンコーダ11やオーディオエンコーダ12が、MUX20との処理速度の差や障害の発生、録画の一時停止への移行などにより、ビデオESおよびオーディオESを後段のバッファに出力しなくなったときにも、MUX20がこのことを検出することなく、パケットを生成し続けるという事態が発生しうる。   With this configuration, each of the video encoder 11, the audio encoder 12, and the MUX 20 operates without synchronizing with each other. For this reason, for example, when the video encoder 11 or the audio encoder 12 stops outputting the video ES and audio ES to the subsequent buffer due to a difference in processing speed with the MUX 20, the occurrence of a failure, or the transition to recording pause. In addition, a situation may occur in which the MUX 20 continues to generate packets without detecting this.

このような事態を防止するために、MUX20は、データサイズ判定部21およびパック生成部22を備えている。データサイズ判定部21は、ビデオInfoバッファ15およびオーディオInfoバッファ16にアクセスして、データサイズなどのAU_Infoを取得し、取得した情報を基に、出力するパックを満たすだけのAUがESバッファ内に用意されているか否かを判定する。   In order to prevent such a situation, the MUX 20 includes a data size determination unit 21 and a pack generation unit 22. The data size determination unit 21 accesses the video Info buffer 15 and the audio Info buffer 16, acquires AU_Info such as the data size, and based on the acquired information, AUs that satisfy the pack to be output are stored in the ES buffer. It is determined whether it is prepared.

パック生成部22は、データサイズ判定部21によって十分なAUがESバッファ内に用意されていると判定された場合に、各ESバッファから必要なAUを読み出し、またデータサイズ判定部21からヘッダに格納すべき情報を取得してパックを生成し、記録処理部31に出力する。逆に、データサイズ判定部21により十分なAUがESバッファに用意されていないと判定された場合には、パック生成部22はパックの生成を停止する「ES待ち状態」となる。   When the data size determination unit 21 determines that sufficient AUs are prepared in the ES buffer, the pack generation unit 22 reads the necessary AUs from each ES buffer, and from the data size determination unit 21 to the header. Information to be stored is acquired, a pack is generated, and output to the recording processing unit 31. Conversely, if the data size determination unit 21 determines that sufficient AUs are not prepared in the ES buffer, the pack generation unit 22 enters an “ES wait state” in which pack generation is stopped.

このように、MUX20は、実際にパックを生成する前に、各Infoバッファに記録されたAU_Infoを基に、次のパックを満たすだけのAUのデータがESバッファに用意されているか否かを判定する。これにより、ビデオエンコーダ11およびオーディオエンコーダ12とデータのやり取りをすることなく、ESの生成停止状態を検出できるので、常に正常な動作をし続けるようになる。   In this way, before actually generating a pack, the MUX 20 determines whether AU data sufficient to satisfy the next pack is prepared in the ES buffer based on the AU_Info recorded in each Info buffer. To do. As a result, the ES generation stop state can be detected without exchanging data with the video encoder 11 and the audio encoder 12, so that the normal operation is always continued.

以下、MUX20の処理について詳しく説明する。
図2は、MUX20による多重化処理全体の流れを示すフローチャートである。
〔ステップS101〕MUX20は、P−STDバッファモデルのシミュレートを行う。その結果、ビデオのパック(Vパック)を生成することが可能と判定した場合には、ステップS103以後の処理を実行する。また、不可能と判定した場合にはステップS102に進む。
Hereinafter, the processing of the MUX 20 will be described in detail.
FIG. 2 is a flowchart showing a flow of the entire multiplexing process by the MUX 20.
[Step S101] The MUX 20 simulates a P-STD buffer model. As a result, if it is determined that a video pack (V pack) can be generated, the processing from step S103 is executed. If determined to be impossible, the process proceeds to step S102.

〔ステップS102〕多重化処理を終了するか否かを判定する。例えば、ユーザの操作入力などによりビデオ録画が停止された場合などに処理の終了と判定し、また終了要求がない場合にはステップS101に戻る。   [Step S102] It is determined whether or not to end the multiplexing process. For example, it is determined that the process is finished when the video recording is stopped due to a user operation input or the like, and when there is no termination request, the process returns to step S101.

〔ステップS103〕データサイズ判定部21は、前回の多重化処理(パック生成処理)で、AU内のデータを最後までパックのペイロードの領域に格納したか否かを判定する。格納したと判定した場合にはステップS105に進む。また、AUのデータのうち未格納のデータが残っていると判定した場合はステップS104に進む。   [Step S103] The data size determination unit 21 determines whether or not the data in the AU has been stored in the pack payload area to the end in the previous multiplexing process (pack generation process). If it is determined that the data has been stored, the process proceeds to step S105. If it is determined that unstored data remains among the AU data, the process proceeds to step S104.

〔ステップS104〕ペイロードに格納されなかったAUの残りのデータサイズが、ペイロードの容量以上であるか否かを判定する。ペイロードの容量以上である場合には、その残りのAUのデータにより新たなパックのペイロードを満たしたパックを生成することができるので、ステップS109に進んで、パック生成部22に新たなパックの生成処理を開始させる。また、残りのデータサイズがペイロードより小さい場合には、ステップS105に進む。   [Step S104] It is determined whether or not the remaining data size of the AU not stored in the payload is equal to or greater than the payload capacity. If the payload capacity is greater than or equal to the capacity of the payload, a pack satisfying the payload of the new pack can be generated from the remaining AU data, so the process proceeds to step S109 and the pack generation unit 22 generates a new pack. Start processing. If the remaining data size is smaller than the payload, the process proceeds to step S105.

〔ステップS105〕データサイズ判定部21は、Infoバッファに次のAUについてのAU_Infoが存在するか否かを判定する。これはすなわち、次に多重化すべきAUがESバッファに存在するか否かを判定することを意味する。AU_Infoが存在する場合はステップS106に進む。また、存在しない場合はES待ち状態となって、ステップS108に進む。   [Step S105] The data size determination unit 21 determines whether or not AU_Info for the next AU exists in the Info buffer. This means that it is determined whether or not the AU to be multiplexed next exists in the ES buffer. If AU_Info exists, the process proceeds to step S106. On the other hand, if it does not exist, it enters the ES waiting state and proceeds to step S108.

〔ステップS106〕データサイズ判定部21は、Infoバッファを検索して、次のAUについてのDTS、PTS、データサイズなどの情報を取得する。
〔ステップS107〕データサイズ判定部21は、ステップS106で取得したデータサイズに基づき、次のAUを格納した場合にペイロードが満たされるか否かを判定する。満たされる場合はパックを生成することができるので、ステップS109に進んで、パック生成部22に新たなパックの生成を開始させる。また、満たされない場合はステップS105に戻り、ペイロードの残りの領域に格納すべき次のAUのAU_InfoがInfoバッファに存在するか否かを再び判定する。
[Step S106] The data size determination unit 21 searches the Info buffer to acquire information such as DTS, PTS, and data size for the next AU.
[Step S107] The data size determination unit 21 determines whether or not the payload is satisfied when the next AU is stored based on the data size acquired in step S106. If it is satisfied, a pack can be generated. Therefore, the process proceeds to step S109, and the pack generation unit 22 starts generating a new pack. If not satisfied, the process returns to step S105, and it is determined again whether AU_Info of the next AU to be stored in the remaining area of the payload exists in the Info buffer.

〔ステップS108〕ES待ち状態になると、データサイズ判定部21は、多重化処理を終了するか否かを判定する。例えば、ユーザの操作入力などによりビデオ録画が停止された場合などに処理の終了と判定する。また、終了要求がない場合にはステップS105に戻って、次のAUのAU_InfoがInfoバッファに格納されたか否かを判定し、これにより、残りのペイロードに格納すべき新たなAUがエンコーダによって生成されるまで判定動作が停止され、ES待ち状態が継続される。   [Step S108] In the ES waiting state, the data size determination unit 21 determines whether or not to end the multiplexing process. For example, it is determined that the process is finished when the video recording is stopped due to a user operation input or the like. If there is no termination request, the process returns to step S105 to determine whether or not the AU_Info of the next AU has been stored in the Info buffer, whereby a new AU to be stored in the remaining payload is generated by the encoder. The determination operation is stopped until it is made, and the ES waiting state is continued.

〔ステップS109〕パック生成部22は、上記ステップでペイロードに格納すると判定されたAUをESバッファから読み出し、パックを生成して出力する。このとき、データサイズ判定部21がステップS106で取得した情報のうち必要なものをヘッダに格納する。なお、このステップS109の処理については、次の図3において詳しく説明する。   [Step S109] The pack generation unit 22 reads the AU determined to be stored in the payload in the above step from the ES buffer, generates a pack, and outputs the pack. At this time, the data size determination unit 21 stores necessary information among the information acquired in step S106 in the header. The processing in step S109 will be described in detail with reference to FIG.

〔ステップS110〕MUX20は、ステップS109で格納した時刻管理情報に対応するように現在時刻(SCR)を進める。そして、ステップS101に戻る。
図3は、パック生成部22によるパック生成処理(ステップS109に対応)の流れを示すフローチャートである。
[Step S110] The MUX 20 advances the current time (SCR) so as to correspond to the time management information stored in Step S109. Then, the process returns to step S101.
FIG. 3 is a flowchart showing the flow of pack generation processing (corresponding to step S109) by the pack generation unit 22.

〔ステップS201〕パックヘッダやパケットヘッダ、システムヘッダなどが必要か否かを判定し、必要である場合はステップS202に進み、そうでない場合はステップS203に進む。   [Step S201] It is determined whether a pack header, a packet header, a system header, or the like is necessary. If necessary, the process proceeds to step S202. If not, the process proceeds to step S203.

〔ステップS202〕ヘッダを作成する。例えば、図2のステップS106でデータサイズ判定部21が取得したデータのうち必要なデータをヘッダに格納する。また、必要に応じて新たなデータを作成して格納する。   [Step S202] A header is created. For example, necessary data among the data acquired by the data size determination unit 21 in step S106 of FIG. 2 is stored in the header. Further, new data is created and stored as necessary.

〔ステップS203〕ESバッファにアクセスして新たなAUを読み出し、取得する。
〔ステップS204〕取得したAUのデータをペイロードに格納する。
〔ステップS205〕ペイロードが完成したか(データが満たされたか)を判定する。完成してない場合はステップS203に戻り、次のAUをESバッファから取得する。また、ペイロードが完成した場合にはステップS206に進む。
[Step S203] The ES buffer is accessed to read out and acquire a new AU.
[Step S204] The acquired AU data is stored in the payload.
[Step S205] It is determined whether the payload is completed (data is filled). If not completed, the process returns to step S203, and the next AU is obtained from the ES buffer. If the payload is completed, the process proceeds to step S206.

〔ステップS206〕生成されたパックを出力する。このパックは、常にペイロードにAUのデータが満たされたものになる。
次に、ES待ち状態となる場合の具体的なパック生成例を挙げ、上記のフローチャートの処理に対応付けてその動作を説明する。以下の例では、ISO/IEC(International Organization for Standardization/International Electrotechnical Commission)13818−1で規定された“The System Part of the MPEG−2 Standard”に準拠した2Kbyte(2048byte)の固定長のパックを生成するものとする。このようなパックでは、パックヘッダおよびパケットヘッダを除いた残りの2020byteが、AUのデータを格納するペイロードとされる。なお、ここでは説明を簡単にするために、ビデオデータが格納されるVパックの生成についてのみ説明する。
[Step S206] The generated pack is output. In this pack, the AU data is always filled in the payload.
Next, a specific example of pack generation in the ES waiting state will be given, and the operation will be described in association with the processing of the above flowchart. In the following example, a fixed-length pack of 2 Kbytes (2048 bytes) conforming to “The System Part of the MPEG-2 Standard” defined by ISO / IEC (International Organization for Standardization / International Electrotechnical Commission) 13818-1 is generated. It shall be. In such a pack, the remaining 2020 bytes excluding the pack header and packet header are used as a payload for storing AU data. For the sake of simplicity, only the generation of a V pack that stores video data will be described here.

図4は、エンコードされたAUのサイズが十分に大きい場合のパック生成の様子を示す図である。
図4では、ビデオESバッファ13に、n番目のAUであるAU(n)が格納されている。このAU(n)はパック内のペイロードより大きなデータサイズを有している。MUX20は、このAU(n)を多重化するにあたって、まず、AU(n)のうちの先頭の2020byteのデータを読み出し、最初のVパックに格納して出力する。この場合、ステップS101でのP−STDのシミュレートによりパックの生成可能と判定すると、以後、ステップS103、S105、S106、S107と進み、ステップS107でペイロードが満たされると判定して、ステップS109で最初のVパックを生成する。
FIG. 4 is a diagram showing how a pack is generated when the encoded AU size is sufficiently large.
In FIG. 4, the video ES buffer 13 stores AU (n) which is the nth AU. This AU (n) has a larger data size than the payload in the pack. In multiplexing this AU (n), the MUX 20 first reads the first 2020 bytes of the AU (n), stores it in the first V pack, and outputs it. In this case, if it is determined that a pack can be generated by simulating the P-STD in step S101, the process proceeds to steps S103, S105, S106, and S107. In step S107, it is determined that the payload is satisfied, and in step S109. Create the first V-pack.

この後さらに、次のパックを生成するための処理を開始するが、このときは、ステップS101の判定後に、ステップS103でAU(n)の残りがビデオESバッファ13に存在すると判定してステップS104に進み、残りのAU(n)のデータサイズが2020byte以上である間は、そのままステップS109に進む。すなわち、ビデオESバッファ13内のAU(n)の残りから2020byteずつデータを読み出し、Vパックを順次満たして出力していく。   Thereafter, processing for generating the next pack is started. At this time, after the determination in step S101, it is determined in step S103 that the remainder of AU (n) is present in the video ES buffer 13, and step S104 is performed. The process proceeds to step S109 as long as the data size of the remaining AU (n) is 2020 bytes or more. That is, data is read out from the remainder of AU (n) in the video ES buffer 13 by 2020 bytes, and V packs are sequentially filled and output.

ここで、AU(n)の最後の760byteのデータがビデオESバッファ13に残ったものとすると、MUX20は、その残りの760byteのデータを次のVパックに格納しようとする。このとき、ステップS101、S103、S104と進み、ステップS104において残りのAU(n)が2020byte未満と判定されて、ステップS105に進む。そして、ステップS105でのビデオInfoバッファ15の検索により、次のAUであるAU(n+1)(図示せず)がビデオESバッファ13に格納されていないと判定した場合には、ペイロードの残りの領域を満たせないので、ES待ち状態となって処理を一旦停止する。   Here, assuming that the last 760 bytes of data of AU (n) remain in the video ES buffer 13, the MUX 20 tries to store the remaining 760 bytes of data in the next V pack. At this time, the process proceeds to steps S101, S103, and S104. In step S104, it is determined that the remaining AU (n) is less than 2020 bytes, and the process proceeds to step S105. If it is determined by the search of the video Info buffer 15 in step S105 that the next AU, AU (n + 1) (not shown), is not stored in the video ES buffer 13, the remaining area of the payload Since the process cannot be satisfied, the process is temporarily stopped in the ES waiting state.

この後、ステップS105でのビデオInfoバッファ15の検索により新たなAU(n+1)の生成が確認されると、ステップS106に進んでそのAU(n+1)についてのAU_Infoを取得し、ペイロードを満たすだけのAUのデータ量がビデオESバッファ13に格納されたことを確認すると(ステップS107)、それらのデータを用いてパックの生成を開始する(ステップS109)。   Thereafter, when the generation of a new AU (n + 1) is confirmed by the search of the video Info buffer 15 in step S105, the process proceeds to step S106 to acquire AU_Info for the AU (n + 1), and only to fill the payload. When it is confirmed that the amount of AU data is stored in the video ES buffer 13 (step S107), pack generation is started using these data (step S109).

図5は、エンコードされたAUのサイズが小さい場合のパック生成の様子を示す図である。
図5では、n番目から(n+3)番目までのAU(n)〜AU(n+3)がビデオESバッファ13に格納されているが、これらの総データサイズはペイロードの容量よりも小さいものとする。MUX20は、これらを多重化するにあたって、まず先頭のAU(n)によりペイロードを満たすことができるか否かを判定する。すなわち、ステップS101、S103、S105、S106と進み、ステップS106においてビデオInfoバッファ15から取得したデータサイズに基づき、ステップS107でペイロードを満たすことができないと判定する。
FIG. 5 is a diagram showing how a pack is generated when the encoded AU size is small.
In FIG. 5, nth to (n + 3) th AU (n) to AU (n + 3) are stored in the video ES buffer 13, but the total data size is assumed to be smaller than the payload capacity. In multiplexing these, the MUX 20 first determines whether or not the payload can be filled with the head AU (n). That is, the process proceeds to steps S101, S103, S105, and S106, and based on the data size acquired from the video Info buffer 15 in step S106, it is determined that the payload cannot be filled in step S107.

これにより、再びステップS105に戻ってビデオInfoバッファ15を検索し、次のAU(n+1)の存在を確認して、ステップS106で対応するAU_Infoを取得する。これにより、ステップS107では再びペイロードを満たすことができないと判定され、ステップS105に戻る。以後、AU(n+2)およびAU(n+3)について同様の処理を繰り返し、これらのデータでもペイロードを満たすことができないので、ステップS105に戻り、次のAU(n+4)(図示せず)がビデオESバッファ13に存在するか否かを判定する。ここで、次のAU(n+4)が存在しない場合に、ES待ち状態となって処理を一旦停止する。   As a result, the process returns to step S105 to search the video Info buffer 15 again, confirms the presence of the next AU (n + 1), and acquires the corresponding AU_Info in step S106. Thereby, it is determined in step S107 that the payload cannot be filled again, and the process returns to step S105. Thereafter, the same processing is repeated for AU (n + 2) and AU (n + 3), and these data cannot fill the payload. Therefore, the process returns to step S105, and the next AU (n + 4) (not shown) is the video ES buffer. 13 is determined. Here, when there is no next AU (n + 4), the process waits for the ES and temporarily stops.

この後、ステップS105でのビデオInfoバッファ15の検索により新たなAU(n+4)の生成が確認されると、ステップS106に進んでそのAU(n+4)についてのAU_Infoを取得する。そして、AU(n)〜AU(n+4)によりペイロードを満たすと判定した場合に(ステップS107)、それらのデータを用いてパックの生成を開始する(ステップS109)。   Thereafter, when generation of a new AU (n + 4) is confirmed by searching the video Info buffer 15 in step S105, the process proceeds to step S106, and AU_Info for the AU (n + 4) is acquired. When it is determined that the payload is satisfied by AU (n) to AU (n + 4) (step S107), pack generation is started using those data (step S109).

以上説明したように、本実施の形態では、次のパックのペイロードがAUのデータで満たされることが保証されるまで、すなわち、パックのペイロードの領域を満たすだけのAUがエンコーダにより生成され、ESバッファに格納されたことを確認するまでは、それらのAUの多重化を行わず、パックを出力しない。このため、MUX20との処理速度の違いによりビデオエンコーダ11やオーディオエンコーダ12によるESのエンコードタイミングが遅れた場合や、障害発生や録画停止命令などによりESのエンコードが停止した場合にも、MUX20が動作し続けて余分なパックを出力される事態が回避される。   As described above, in the present embodiment, until it is guaranteed that the payload of the next pack is filled with AU data, that is, AUs that only satisfy the pack payload area are generated by the encoder, and ES Until it is confirmed that the data is stored in the buffer, the AU is not multiplexed and the pack is not output. Therefore, the MUX 20 operates even when the ES encoding timing by the video encoder 11 or the audio encoder 12 is delayed due to a difference in processing speed from the MUX 20 or when the ES encoding is stopped due to a failure or a recording stop command. The situation where an extra pack is output continuously is avoided.

これとともに、多重化すべきデータを事前に認識しているので、MUX20がESバッファから同じデータを何度も読み出すことがなくなり、MUX20からESバッファへのアクセス回数が最小限に留められ、データ転送に要する時間が短縮されて、処理が効率化される。   At the same time, since the data to be multiplexed is recognized in advance, the MUX 20 does not read the same data from the ES buffer many times, and the number of accesses from the MUX 20 to the ES buffer is kept to a minimum. The time required is shortened and the processing is made efficient.

また、MUX20は、多重化するAUのデータサイズを、InfoバッファのAU_Infoから取得することにより、そのAUでペイロードが満たされるか否かを判定する。このため、MUX20はビデオエンコーダ11やオーディオエンコーダ12との間で通信することなく、余分なパックを出力する事態を回避して正常に動作し続けることが可能となる。   Also, the MUX 20 acquires the data size of the AU to be multiplexed from the AU_Info of the Info buffer, and determines whether or not the payload is satisfied with the AU. For this reason, the MUX 20 can continue to operate normally without communicating with the video encoder 11 and the audio encoder 12 while avoiding the situation of outputting an extra pack.

従って、各エンコーダとMUX20とを完全に独立して正常動作させることができ、各エンコーダとMUX20のそれぞれの制御をリアルタイムOS上の個別タスクとして実装することが可能となる。各制御を個別タスクとすることにより、エンコーダやMUX20の機能を個別に開発することが可能となり、仕様変更などに柔軟に対応し、また制御対象の機能ごとに不具合を検証して検証効率を高めることもできる。   Accordingly, each encoder and the MUX 20 can be operated normally and completely independently, and control of each encoder and the MUX 20 can be implemented as individual tasks on the real-time OS. By making each control an individual task, it becomes possible to develop the functions of the encoder and MUX20 individually, flexibly responding to specification changes, etc., and verifying defects for each function to be controlled to increase verification efficiency You can also.

また、Infoバッファの情報を基に上記判定処理を行うことにより、例えばESバッファ上のAUを読み出してデータサイズを調べることで上記判定処理を行う場合と比較して、処理を単純化し、データの転送時間や処理時間を短縮することができる。   In addition, by performing the determination process based on the information in the Info buffer, for example, the process is simplified compared to the case where the determination process is performed by reading the AU on the ES buffer and checking the data size. Transfer time and processing time can be shortened.

なお、以上の実施の形態では、ストリーム記録装置に本発明を適用した場合について説明したが、これに限らず、例えば、ストリームを生成してネットワークなどを通じて伝送、配信する装置などにも本発明を適用することができる。   In the above embodiment, the case where the present invention is applied to a stream recording apparatus has been described. However, the present invention is not limited to this. Can be applied.

実施の形態に係るストリーム記録装置の構成を示すブロック図である。It is a block diagram which shows the structure of the stream recording apparatus which concerns on embodiment. MUXによる多重化処理全体の流れを示すフローチャートである。It is a flowchart which shows the flow of the whole multiplexing process by MUX. パック生成部によるパック生成処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the pack production | generation process by a pack production | generation part. エンコードされたAUのサイズが十分に大きい場合のパック生成の様子を示す図である。It is a figure which shows the mode of a pack production | generation when the size of encoded AU is large enough. エンコードされたAUのサイズが小さい場合のパック生成の様子を示す図である。It is a figure which shows the mode of the pack production | generation when the size of encoded AU is small. MPEG方式を用いた従来のストリーム生成装置の要部構成を示す図である。It is a figure which shows the principal part structure of the conventional stream production | generation apparatus using an MPEG system.

符号の説明Explanation of symbols

11……ビデオエンコーダ、22……オーディオエンコーダ、13……ビデオESバッファ、14……オーディオESバッファ、15……ビデオInfoバッファ、16……オーディオInfoバッファ、20……MUX、21……データサイズ判定部、22……パック生成部、31……記録処理部、32……記録媒体、40……システムコントローラ   11 ... Video encoder, 22 ... Audio encoder, 13 ... Video ES buffer, 14 ... Audio ES buffer, 15 ... Video Info buffer, 16 ... Audio Info buffer, 20 ... MUX, 21 ... Data size Judgment unit, 22 ... pack generation unit, 31 ... recording processing unit, 32 ... recording medium, 40 ... system controller

Claims (4)

複数のエンコーダによってそれぞれ生成された符号化ストリームが、デコード時のアクセス単位であるアクセスユニットごとに一時的に格納される符号化ストリームバッファと、前記符号化ストリームバッファに格納された前記アクセスユニットに関するユニット情報が格納されるユニット情報バッファとから、データを受け取って多重化ストリームを生成するストリーム多重化装置において、
前記ユニット情報バッファから読み出した前記ユニット情報のうち、対応する前記アクセスユニットのデータサイズの情報を基にして、前記多重化ストリームを構成するデータ群のペイロード領域を満たすだけの前記アクセスユニットのデータが前記符号化ストリームバッファに格納されているか否かを判定するデータサイズ判定手段と、
前記データサイズ判定手段により条件を満たすと判定された場合に、必要な前記アクセスユニットのデータを前記符号化ストリームバッファから読み出し、1つの前記データ群を生成して出力するデータ群生成手段と、
を有し、
前記データサイズ判定手段は、前記符号化ストリームバッファ内の現在の先頭の前記アクセスユニットのデータにより前記データ群のペイロード領域を満たすことができないと判定した場合には、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報および先頭の前記アクセスユニットに対応する前記ユニット情報に基づいて、先頭およびその次の前記アクセスユニットの各データにより前記ペイロード領域を満たすか否かを判定することを特徴とするストリーム多重化装置。
An encoded stream buffer in which encoded streams respectively generated by a plurality of encoders are temporarily stored for each access unit that is an access unit at the time of decoding, and a unit related to the access unit stored in the encoded stream buffer In a stream multiplexing apparatus that receives data from a unit information buffer in which information is stored and generates a multiplexed stream,
Of the unit information read from the unit information buffer, based on the data size information of the corresponding access unit, the data of the access unit sufficient to fill the payload area of the data group constituting the multiplexed stream is present. Data size determination means for determining whether or not stored in the encoded stream buffer;
A data group generation unit that reads out the necessary data of the access unit from the encoded stream buffer and generates and outputs one data group when the data size determination unit determines that the condition is satisfied;
I have a,
When the data size determination unit determines that the payload area of the data group cannot be filled with the data of the current head access unit in the encoded stream buffer, the data size determination unit corresponds to the next access unit. Waiting for the unit information to be stored in the unit information buffer, and when the unit information is stored, based on the unit information and the unit information corresponding to the head access unit, the head and the next A stream multiplexing apparatus for determining whether or not the payload area is filled with each data of the access unit .
前記データ群生成手段により前記アクセスユニットのデータの一部が前記データ群のペイロード領域に格納しきれなかった場合、前記データサイズ判定手段は、格納されなかった残りのデータが次の前記データ群のペイロード領域を満たすか否かを判定し、満たす場合は、前記データサイズ判定手段が前記残りのデータを用いて前記データ群を生成し、満たさない場合は、前記データサイズ判定手段が、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報に対応する前記アクセスユニットのデータと前記残りのデータとにより前記ペイロード領域を満たすか否かを判定することを特徴とする請求項1記載のストリーム多重化装置。When a part of the data of the access unit cannot be stored in the payload area of the data group by the data group generation unit, the data size determination unit determines that the remaining data that has not been stored is the next data group. It is determined whether or not the payload area is satisfied, and if so, the data size determination means generates the data group using the remaining data, and if not, the data size determination means Waiting for the unit information corresponding to the access unit to be stored in the unit information buffer, and when the unit information is stored, the data of the access unit corresponding to the unit information and the remaining data 2. The stream multiplexing apparatus according to claim 1, wherein it is determined whether or not the payload area is satisfied. 多重化ストリームを生成して記録媒体に記録するストリーム記録装置において、In a stream recording apparatus that generates a multiplexed stream and records it on a recording medium,
個別の符号化ストリームをそれぞれ生成する複数の符号化手段と、  A plurality of encoding means for generating individual encoded streams respectively;
前記符号化手段によって生成された前記符号化ストリームを、デコード時のアクセス単位であるアクセスユニットごとに一時的に記憶する符号化ストリームバッファと、  An encoded stream buffer that temporarily stores the encoded stream generated by the encoding means for each access unit that is an access unit at the time of decoding;
前記符号化ストリームバッファに格納された前記アクセスユニットに関するユニット情報を前記符号化手段から受け取って一時的に記憶するユニット情報バッファと、  A unit information buffer for temporarily storing unit information related to the access unit stored in the encoded stream buffer received from the encoding means;
前記ユニット情報バッファから読み出した前記ユニット情報のうち、対応する前記アクセスユニットのデータサイズの情報を基にして、前記多重化ストリームを構成するデータ群のペイロード領域を満たすだけの前記アクセスユニットのデータが前記符号化ストリームバッファに格納されているか否かを判定するデータサイズ判定手段と、  Of the unit information read from the unit information buffer, based on the data size information of the corresponding access unit, the data of the access unit sufficient to fill the payload area of the data group constituting the multiplexed stream is present. Data size determination means for determining whether or not stored in the encoded stream buffer;
前記データサイズ判定手段により条件を満たすと判定された場合に、必要な前記アクセスユニットのデータを前記符号化ストリームバッファから読み出し、1つの前記データ群を生成して前記多重化ストリームとして出力するデータ群生成手段と、  A data group that reads out the necessary data of the access unit from the encoded stream buffer and generates one data group and outputs it as the multiplexed stream when the data size determining unit determines that the condition is satisfied Generating means;
を有し、  Have
前記データサイズ判定手段は、前記符号化ストリームバッファ内の現在の先頭の前記アクセスユニットのデータにより前記データ群のペイロード領域を満たすことができないと判定した場合には、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報および先頭の前記アクセスユニットに対応する前記ユニット情報に基づいて、先頭およびその次の前記アクセスユニットの各データにより前記ペイロード領域を満たすか否かを判定することを特徴とするストリーム記録装置。  When the data size determination unit determines that the payload area of the data group cannot be filled with the data of the current head access unit in the encoded stream buffer, the data size determination unit corresponds to the next access unit. Waiting for the unit information to be stored in the unit information buffer, and when the unit information is stored, based on the unit information and the unit information corresponding to the head access unit, the head and the next A stream recording apparatus for determining whether or not the payload area is filled with each data of the access unit.
複数のエンコーダによってそれぞれ生成された符号化ストリームが、デコード時のアクセス単位であるアクセスユニットごとに一時的に格納される符号化ストリームバッファと、前記符号化ストリームバッファに格納された前記アクセスユニットに関するユニット情報が格納されるユニット情報バッファとから、データを受け取って多重化ストリームを生成するためのストリーム多重化方法において、An encoded stream buffer in which encoded streams respectively generated by a plurality of encoders are temporarily stored for each access unit that is an access unit at the time of decoding, and a unit related to the access unit stored in the encoded stream buffer In a stream multiplexing method for receiving data from a unit information buffer in which information is stored and generating a multiplexed stream,
データサイズ判定手段が、前記ユニット情報バッファから読み出した前記ユニット情報のうち、対応する前記アクセスユニットのデータサイズの情報を基にして、前記多重化ストリームを構成するデータ群のペイロード領域を満たすだけの前記アクセスユニットのデータが前記符号化ストリームバッファに格納されているか否かを判定するデータサイズ判定ステップと、  The data size determination means only fills the payload area of the data group constituting the multiplexed stream based on the data size information of the corresponding access unit among the unit information read from the unit information buffer. A data size determination step for determining whether data of the access unit is stored in the encoded stream buffer;
前記データサイズ判定ステップで条件を満たすと判定された場合に、データ群生成手段が、必要な前記アクセスユニットのデータを前記符号化ストリームバッファから読み出し、1つの前記データ群を生成して出力するデータ群生成ステップと、  Data determined when the data size determining step determines that the condition is satisfied, data group generation means reads the necessary access unit data from the encoded stream buffer, and generates and outputs one data group A group generation step;
を含み、  Including
前記データサイズ判定ステップでは、前記符号化ストリームバッファ内の現在の先頭の前記アクセスユニットのデータにより前記データ群のペイロード領域を満たすことができないと判定した場合には、次の前記アクセスユニットに対応する前記ユニット情報が前記ユニット情報バッファに格納されるのを待機し、当該ユニット情報が格納されると、当該ユニット情報および先頭の前記アクセスユニットに対応する前記ユニット情報に基づいて、先頭およびその次の前記アクセスユニットの各データにより前記ペイロード領域を満たすか否かを判定することを特徴とするストリーム多重化方法。  In the data size determination step, when it is determined that the payload area of the data group cannot be filled with the data of the current top access unit in the encoded stream buffer, it corresponds to the next access unit. Waiting for the unit information to be stored in the unit information buffer, and when the unit information is stored, based on the unit information and the unit information corresponding to the head access unit, the head and the next A stream multiplexing method comprising determining whether or not the payload area is filled with each data of the access unit.
JP2004321761A 2004-11-05 2004-11-05 Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method Expired - Fee Related JP4403403B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004321761A JP4403403B2 (en) 2004-11-05 2004-11-05 Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004321761A JP4403403B2 (en) 2004-11-05 2004-11-05 Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method

Publications (2)

Publication Number Publication Date
JP2006135603A JP2006135603A (en) 2006-05-25
JP4403403B2 true JP4403403B2 (en) 2010-01-27

Family

ID=36728748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004321761A Expired - Fee Related JP4403403B2 (en) 2004-11-05 2004-11-05 Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method

Country Status (1)

Country Link
JP (1) JP4403403B2 (en)

Also Published As

Publication number Publication date
JP2006135603A (en) 2006-05-25

Similar Documents

Publication Publication Date Title
US8401367B2 (en) Method for generating additional information for guaranteeing seamless playback between data streams, recording medium storing the information, and recording, editing and/or playback apparatus using the same
JPWO2006033279A1 (en) Data processing device
EP2012322B1 (en) Recording/reproducing apparatus, recording apparatus, reproducing apparatus, recording method, reproducing method and computer program
TW200301061A (en) A method and an apparatus for stream conversion, a method and an apparatus for data recording, and data recording medium
JP2008053763A (en) Av data recording device and method, av data reproducing device and method, and recording medium recorded by the av data recording device or the method
TW579506B (en) A recording device and a recording method
JP4791969B2 (en) Data processing device
JP4552802B2 (en) Recording apparatus, recording method, recording method program, and recording medium recording the recording method program
CN101123108B (en) Recording apparatus, recording method
JP4403403B2 (en) Stream multiplexing apparatus, stream recording apparatus, and stream multiplexing method
JP4426800B2 (en) AV data recording / reproducing apparatus and method, and recording medium recorded by the AV data recording / reproducing apparatus or method
JP3986973B2 (en) AV data recording method, AV data recording apparatus, data recording medium, and program
JP2005198350A (en) After-recording signal reproducing method
KR100633805B1 (en) Audio/video information recording/reproducing apparatus and method, and recording medium in which information is recorded by using the audio/video information recording/reproducing apparatus and method
JP4312783B2 (en) AV data reproducing method, AV data reproducing apparatus, program, and recording medium
WO2004030358A1 (en) Data processing device
JP2006121184A (en) Data separation apparatus, stream reproducing apparatus, and data separation method
CN101116332A (en) Data recording/reproducing device
JP2007519141A (en) Method and apparatus for handling a group of at least one data object
JP2005198349A (en) Recording medium
JP2000339860A (en) Data recording and reproducing device
JP2005237021A (en) After-recording signal reproduction program
JP2005245006A (en) Postrecording signal reproducing apparatus
JP2005260978A (en) Program for generating after-recording signal
JP2005198348A (en) Transmission method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070517

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090710

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090714

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090904

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091006

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091019

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

Free format text: PAYMENT UNTIL: 20121113

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121113

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131113

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees