JP2006186674A - Mpeg stream processing method and processor - Google Patents

Mpeg stream processing method and processor Download PDF

Info

Publication number
JP2006186674A
JP2006186674A JP2004378165A JP2004378165A JP2006186674A JP 2006186674 A JP2006186674 A JP 2006186674A JP 2004378165 A JP2004378165 A JP 2004378165A JP 2004378165 A JP2004378165 A JP 2004378165A JP 2006186674 A JP2006186674 A JP 2006186674A
Authority
JP
Japan
Prior art keywords
packet
output
mpeg
stream
time stamp
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
JP2004378165A
Other languages
Japanese (ja)
Inventor
Yoshinobu Tsuji
良信 辻
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP2004378165A priority Critical patent/JP2006186674A/en
Publication of JP2006186674A publication Critical patent/JP2006186674A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To output one and the same stream at different timing and to multiplex and output different streams. <P>SOLUTION: An MPEG stream processor includes packet generation sections 9-1 to 9-3 which input video/audio information, add time stamps corresponding to output timing, and generate MPEG packets where null packets are inserted for differences between an output rate and effective packets, storage sections 22 to 24 which stores the MPEG packets which have generated time stamps and the inserted null packets, and packet output sections 10-1 and 10-2 which read each MPEG packet reaching output timing based upon the time stamp added to the stored MPEG packet, delete the time stamp added to the MPEG packet, and judge that a null packet is outputted to the outside or discarded, or another packet is outputted replacing the null packet to output an MPEG packet corresponding to the judgment result. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、映像ストリームや音声ストリームなどを処理するMPEGストリーム処理方法および処理装置に関する。   The present invention relates to an MPEG stream processing method and processing apparatus for processing a video stream, an audio stream, and the like.

映像ストリーム、音声ストリームなどを処理するストリーム処理システムとして近年、MPEG−2やMPEG−4に代表されるMPEGシステムが注目されている。   In recent years, MPEG systems represented by MPEG-2 and MPEG-4 have attracted attention as stream processing systems for processing video streams, audio streams, and the like.

これらMPEGシステムでは、映像情報、音声情報、付加データなどの個別ストリームを多重化する方式、それぞれ同期をとりながらこれを再生する方式として2種類の方式を規定している。   In these MPEG systems, two types of schemes are defined: a scheme for multiplexing individual streams such as video information, audio information, and additional data, and a scheme for reproducing each stream while synchronizing them.

その1つはプログラムストリーム(PS:Program Stream)方式であり、従来から使用されているMPEG−1と同様に、1本のストリームの中にただ1つのプログラムだけを含ませることができる。この方式は、誤りが発生しない環境でのデータ伝送、データ蓄積に適用されることを想定し、冗長度を小さくすることができることから、DVDなど強力な誤り訂正符号を用いたデジタルストレージメディアなどで使用されることが多い。   One of them is a program stream (PS: Program Stream) system, and only one program can be included in one stream as in the case of MPEG-1 that has been conventionally used. Since this method can be applied to data transmission and data storage in an error-free environment and can reduce redundancy, it can be used in digital storage media using powerful error correction codes such as DVD. Often used.

もう1つは、トランスポートストリーム(TS:Transport Stream)方式であり、1本のストリームの中に複数のプログラムを含ませることができる。この方式は、データの伝送誤りが発生する環境に適用されることを想定し、その分だけ冗長度も大きく設定されていることから、放送や通信ネットワークなどで使用されることが多い。
特開平8−339630号公報 特許第3466417号公報
The other is a transport stream (TS) system, in which a plurality of programs can be included in one stream. Assuming that this method is applied to an environment where a data transmission error occurs, the redundancy is set to be large correspondingly, so that it is often used in broadcasting, communication networks, and the like.
JP-A-8-339630 Japanese Patent No. 3466417

ところで、このようなMPEGシステムにおいて、映像や音声、付加データなどをエンコードしてプログラムストリーム形式で外部に出力する場合には、システム・クロック・リファレンス(SCR:System Clock Reference)を含んだプログラムストリーム・パケットにする必要がある。また映像や音声、付加データなどをエンコードしてトランスポートストリーム形式で外部に出力する場合には、プログラム・クロック・リファレンス(PCR:Program Clock Reference)を含んだトランスポートストリーム・パケットにする必要がある。   By the way, in such an MPEG system, when video, audio, additional data, etc. are encoded and output to the outside in a program stream format, a program stream including a system clock reference (SCR) is included. Must be a packet. In addition, when video, audio, additional data, etc. are encoded and output to the outside in the transport stream format, it is necessary to form a transport stream packet including a program clock reference (PCR). .

その際、映像や音声、付加データなどをプログラムストリーム形式、またはトランスポートストリーム形式で外部に出力する直前に、システム・クロック・リファレンスやプログラム・クロック・リファレンスを計算してプログラムストリーム・パケット、トランスポートストリーム・パケットを生成し、これを外部に出力するようにしているので、エンコード後から出力までの間ではタイムシフトが困難であり、また、出力時のシステム負荷が大きくなってしまうという問題があった。   At that time, immediately before outputting video, audio, additional data, etc. in the program stream format or transport stream format, the system clock reference or program clock reference is calculated and the program stream packet or transport is calculated. Since stream packets are generated and output to the outside, it is difficult to time shift from encoding to output, and the system load at the time of output increases. It was.

また、このようなMPEGシステムにおいて、単一のプログラムストリーム、または単一のトランスポートストリームを出力する場合、単一の出力タイミングで、単一の出力ポートから出力するようにしているので、単一のプログラムストリーム、または単一のトランスポートストリームのパケット数が多いとき、出力開始から出力完了までに長い時間がかかってしまうばかりでなく、出力の自由度が制限されてしまうという問題があった。   Also, in such an MPEG system, when a single program stream or a single transport stream is output, it is output from a single output port at a single output timing. When there are a large number of packets of a single program stream or a single transport stream, there is a problem that not only does it take a long time from the start of output to the completion of output, but also the degree of freedom of output is limited.

一方、従来、設定された出力レートと有効パケットとの間に差がある場合、差分を埋めるために、NULL(ヌル)パケットを挿入する手法が知られている。または、上述した特許文献2に記載のように、ヌルパケットの代わりにPSI(Program Specific Information)を挿入する手法も知られている。   On the other hand, conventionally, when there is a difference between a set output rate and a valid packet, a technique of inserting a NULL (null) packet to fill the difference is known. Alternatively, as described in Patent Document 2 described above, a method of inserting PSI (Program Specific Information) instead of a null packet is also known.

しかしながら、このような従来のヌルパケットを挿入する手法、ヌルパケットに代えてPSIを挿入する手法では、同一のストリームに対してそれぞれのパケット出力部毎に異なるタイミングでの送出が出来ないという不具合があった。また、同一のストリームに対して、それぞれのパケット出力部毎に異なるストリームの多重が出来ないという問題もあった。   However, the conventional method of inserting null packets and the method of inserting PSI instead of null packets have a problem that transmission at different timings for each packet output unit for the same stream is not possible. there were. Another problem is that different streams cannot be multiplexed for each packet output unit for the same stream.

本発明は上記の事情に鑑み、プログラムストリーム・パケット、トランスポートストリーム・パケットを出力するとき、エンコードから出力までのタイムシフトを可能にして出力時のシステム負荷を小さくすることができ、さらに単一のプログラムストリーム、単一のトランスポートストリームを出力するときにも、複数の出力ポート、複数の出力タイミングを使用してパケット数が多い場合でも、出力開始から出力完了までに要する時間を短くすることができるとともに、出力の自由度を高めることができるMPEGストリーム処理方法および処理装置を提供することを目的としている。   In view of the above circumstances, the present invention enables a time shift from encoding to output when outputting a program stream packet and a transport stream packet, thereby reducing a system load at the time of output. Even when a single program stream or a single transport stream is output, even if there are many packets using multiple output ports and multiple output timings, the time required from output start to output completion should be shortened It is an object of the present invention to provide an MPEG stream processing method and a processing apparatus that can increase the degree of freedom of output.

上記の目的を達成するために、請求項1の発明は、映像情報、音声情報をMPEGパケット形式で外部に出力するMPEGストリーム処理方法において、前記映像情報、前記音声情報をMPEGパケットにする際、出力タイミングに対応するタイムスタンプを付加するとともに、出力レートと有効パケットの差分にヌルパケットを挿入して記憶領域に蓄積した後、前記各MPEGパケットに付加されている前記タイムスタンプに基づき、出力タイミングになっているかどうかをチェックし、出力タイミングになっているMPEGパケットがあるとき、当該MPEGパケットを前記記憶領域から読み出し、このMPEGパケットに付加されている前記タイムスタンプを削除するとともに、前記ヌルパケットを外部に出力するか、破棄するか、他のパケットと差し替えて出力するかを判断した後、その判断結果に従ったMPEGパケットを外部に出力することを特徴としている。   In order to achieve the above object, according to the first aspect of the present invention, in the MPEG stream processing method for outputting video information and audio information to the outside in the MPEG packet format, the video information and audio information are converted into MPEG packets. A time stamp corresponding to the output timing is added, a null packet is inserted into the difference between the output rate and the valid packet and stored in the storage area, and then the output timing is determined based on the time stamp added to each MPEG packet. If there is an MPEG packet that is in output timing, the MPEG packet is read from the storage area, the time stamp added to the MPEG packet is deleted, and the null packet Output to the outside, discard, etc. After determining whether to output the replace packet, it is characterized by outputting the MPEG packets in accordance with the determination result to the outside.

また、請求項2の発明は、映像情報、音声情報をMPEGパケット形式で外部に出力するMPEGストリーム処理装置において、前記映像情報、前記音声情報を取り込み、出力タイミングに対応するタイムスタンプを付加するとともに、出力レートと有効パケットの差分にヌルパケットを挿入したMPEGパケットを生成するパケット生成部と、このパケット生成部によって生成されたタイムスタンプ付きで、かつヌルパケットが挿入された前記MPEGパケットを記憶する記憶部と、この記憶部に記憶されている前記各MPEGパケットに付加されたタイムスタンプの内容に基づき、出力タイミングになっているMPEGパケットを読み出し、このMPEGパケットに付加された前記タイムスタンプを削除するとともに、前記ヌルパケットを外部に出力するか、破棄するか、他のパケットと差し替えて出力するかを判断し、その判断結果に従ったMPEGパケットを外部に出力するパケット出力部とを備えたことを特徴としている。   According to a second aspect of the present invention, in the MPEG stream processing apparatus for outputting video information and audio information to the outside in the MPEG packet format, the video information and the audio information are captured, and a time stamp corresponding to the output timing is added. A packet generation unit for generating an MPEG packet in which a null packet is inserted into the difference between the output rate and the effective packet, and a time stamp generated by the packet generation unit and the MPEG packet in which the null packet is inserted is stored Based on the content of the time stamp added to each MPEG packet stored in the storage unit and the storage unit, the MPEG packet at the output timing is read, and the time stamp added to the MPEG packet is deleted. And the null packet Or output to the outside, or discard, is characterized in that it is determined whether to output replaced with other packets, and a packet output unit for outputting the MPEG packets in accordance with the determination result to the outside.

請求項1、2の発明によれば、同一のストリームに対してそれぞれのパケット出力部毎に異なるタイミングでの送出が可能となり、また、同一のストリームに対して、それぞれのパケット出力部毎に異なるストリームの多重が可能となる。   According to the first and second aspects of the invention, it is possible to send the same stream at different timings for each packet output unit, and for the same stream, different for each packet output unit Multiplexing of streams is possible.

《参考例》
図1は本発明の参考例を示すブロック図である。
《Reference example》
FIG. 1 is a block diagram showing a reference example of the present invention.

この図に示すMPEGストリーム処理装置1は、映像ストリーム領域2、音声ストリーム領域3、パケット化ストリーム領域4を持ち、メモリバス6を介して映像ストリーム、音声ストリーム、プログラムストリーム・パケット、トランスポートストリーム・パケットなどを取り込んで一時記憶するメモリ5と、メモリバス6を介して出力対象となる映像情報を取り込んでエンコードした後、メモリ5の映像ストリーム領域2に記憶させる映像エンコード部7と、メモリバス6を介して出力対象となる音声情報を取り込んでエンコードした後、メモリ5の音声ストリーム領域3に記憶させる音声エンコード部8と、メモリバス6を介してメモリ5の映像ストリーム領域2、音声ストリーム領域3に一時記憶されている映像ストリーム、音声ストリームを読み出しながら、CPUから出力されるプログラム・クロック・リファレンス(または、システム・クロック・リファレンス)、タイムスタンプなどを用いて、タイムスタンプ付きのトランスポートストリーム・パケット、またはタイムスタンプ付きのプログラムストリーム・パケットを生成し、これをメモリ5のパケット化ストリーム領域4に一時記憶させるパケット生成部9と、メモリバス6を介してメモリ5のパケット化ストリーム領域4に一時記憶されている各トランスポートストリーム・パケット(または各プログラムストリーム・パケット)に付加されたタイムスタンプをチェックし、出力時になったとき、各トランスポートストリーム・パケット(または各プログラムストリーム・パケット)に付加されているタイムスタンプを削除して外部に出力するパケット出力部10とを備えている。   The MPEG stream processing apparatus 1 shown in this figure has a video stream area 2, an audio stream area 3, and a packetized stream area 4, and a video stream, audio stream, program stream packet, transport stream, A memory 5 that captures and temporarily stores packets and the like, a video encoding unit 7 that captures and encodes video information to be output via the memory bus 6, and stores the encoded video information in the video stream area 2 of the memory 5, and a memory bus 6 After the audio information to be output is encoded via the audio encoding unit 8, the audio encoding unit 8 stores the audio information in the audio stream region 3 of the memory 5, and the video stream region 2 and the audio stream region 3 of the memory 5 via the memory bus 6. Video and audio streams temporarily stored in Using a program clock reference (or system clock reference) output from the CPU while reading a stream, a time stamp, etc., a transport stream packet with a time stamp, or a program stream with a time stamp A packet generator 9 for generating a packet and temporarily storing the packet in the packetized stream area 4 of the memory 5; and each transport stream temporarily stored in the packetized stream area 4 of the memory 5 via the memory bus 6. The time stamp added to the packet (or each program stream packet) is checked, and when it is output, the time attached to each transport stream packet (or each program stream packet) And a packet output unit 10 for outputting to the outside to remove the stamp.

パケット生成部9は、図2に示すように、4つの合成器12,13,14,15を備えており、プログラム・クロック・リファレンス(PCR)を付加するとともに、タイムスタンプを挿入してタイムスタンプ付きのトランスポートストリーム・パケットを生成する。   As shown in FIG. 2, the packet generator 9 includes four synthesizers 12, 13, 14, and 15, to which a program clock reference (PCR) is added and a time stamp is inserted. Generate transport stream packets with

パケット出力部10は、図4に示すように、出力タイミングをカウントする出力タイミングカウンタ16と、メモリ5から読み出されたパケットを一時保持するバッファ17と、パケットに挿入されたタイムスタンプと出力タイミングとを比較して出力タイミングが到来したかどうかを判定するタイムスタンプ比較部18とを備えている。持っており、異なるタイミングでトランスポートストリーム・パケットを外部へ出力可能に構成されている。   As shown in FIG. 4, the packet output unit 10 includes an output timing counter 16 that counts output timing, a buffer 17 that temporarily holds a packet read from the memory 5, a time stamp inserted in the packet, and an output timing And a time stamp comparison unit 18 that determines whether or not the output timing has arrived. The transport stream packet can be output to the outside at different timings.

以上の構成において、CPUから映像情報のエンコード指示、音声情報のエンコード指示が出されると、映像エンコード部7、音声エンコード部8によって、メモリバス6を介して映像情報、音声情報が取り込まれて、エンコードされる。これによって得られた映像ストリーム、音声ストリームがメモリ5の映像ストリーム領域2、音声ストリーム領域3にそれぞれ一時記憶される。   In the above configuration, when an instruction for encoding video information and an instruction for encoding audio information is issued from the CPU, video information and audio information are captured via the memory bus 6 by the video encoding unit 7 and the audio encoding unit 8, Encoded. The video stream and audio stream thus obtained are temporarily stored in the video stream area 2 and audio stream area 3 of the memory 5, respectively.

この後、図2に示すように、CPU内に形成された出力タイミング予測算出部11によって、メモリ5の映像ストリーム領域2、音声ストリーム領域3に各々、一時記憶されている映像ストリーム、音声ストリームに対し、プログラムストリーム化指示またはトランスポートストリーム化指示のどちらが指示されているかチェックされる。このとき、トランスポートストリーム化指示がされていれば、出力タイミング予測算出部11によって、トランスポートストリーム・パケットを外部に出力する際に必要なプログラム・クロック・リファレンスが予測算出される。   After that, as shown in FIG. 2, the output timing prediction calculation unit 11 formed in the CPU converts the video stream and the audio stream temporarily stored in the video stream area 2 and the audio stream area 3 of the memory 5, respectively. On the other hand, it is checked whether a program stream instruction or a transport stream instruction is instructed. At this time, if a transport stream instruction is given, the output timing prediction calculation unit 11 predicts and calculates a program clock reference necessary for outputting the transport stream packet to the outside.

次いで、出力タイミング予測算出部11によって、メモリ5上の映像ストリーム領域2、音声ストリーム領域3に一時記憶されている映像ストリーム、音声ストリームをパケット化してこれを指定された時刻に出力するのに必要な各トランスポートストリーム・パケット毎の連続した値となるタイムスタンプと、上述した計算動作で得られたプログラム・クロック・リファレンスの予測結果とがメモリバス6上に出力される。   Next, it is necessary for the output timing prediction calculation unit 11 to packetize the video stream and the audio stream temporarily stored in the video stream area 2 and the audio stream area 3 on the memory 5 and to output the packet at a specified time. A time stamp that is a continuous value for each transport stream packet and a prediction result of the program clock reference obtained by the above-described calculation operation are output on the memory bus 6.

これにより、パケット生成部9によって、メモリ5の映像ストリーム領域2、音声ストリーム領域3に一時記憶されている映像ストリーム、音声ストリームの取り込みが開始されて、これら映像ストリーム、音声ストリームがパケット単位長毎に分割され、分割ストリームが生成される。各合成器12〜15上では、各分割ストリームに対し、出力タイミング予測算出部11から出力されたプログラム・クロック・リファレンスが付加されてトランスポートストリーム・パケットが生成されるとともに、図3に示すように、各トランスポートストリーム・パケットに対し、出力タイミング予測算出部11から出力されたタイムスタンプがそれぞれ付加されて、メモリ5上のパケット化ストリーム領域4に一時記憶される。   Thereby, the packet generation unit 9 starts to capture the video stream and the audio stream temporarily stored in the video stream area 2 and the audio stream area 3 of the memory 5, and the video stream and the audio stream are set for each packet unit length. And a divided stream is generated. On each synthesizer 12-15, a transport stream packet is generated by adding the program clock reference output from the output timing prediction calculation unit 11 to each divided stream, as shown in FIG. Further, the time stamp output from the output timing prediction calculation unit 11 is added to each transport stream packet, and is temporarily stored in the packetized stream area 4 on the memory 5.

また、この処理と並行し、パケット出力部10によって、メモリ5上のパケット化ストリーム領域4に一時記憶されている各トランスポートストリーム・パケットが読み出され、バッファ17に一時記憶され、タイムスタンプ比較器18によって、各トランスポートストリーム・パケットに付加されているタイムスタンプの値と、出力タイミングカウンタ16から出力される、現在の時刻と対応した出力タイミング値とが比較される。タイムスタンプの値と出力タイミング値とが一致しているとき、バッファ17内のトランスポートストリーム・パケットからタイムスタンプが削除されて、外部に出力される。   In parallel with this processing, each transport stream packet temporarily stored in the packetized stream area 4 on the memory 5 is read out by the packet output unit 10, temporarily stored in the buffer 17, and compared with the time stamp. The unit 18 compares the value of the time stamp added to each transport stream packet with the output timing value corresponding to the current time output from the output timing counter 16. When the time stamp value matches the output timing value, the time stamp is deleted from the transport stream packet in the buffer 17 and output to the outside.

このように、この参考例では、メモリ5上に形成された映像ストリーム領域2と、音声ストリーム領域3とに各々、一時記憶されている映像ストリーム、音声ストリームに対する実際の出力タイミングより前に、CPUによって、トランスポートストリームを外部に出力する際のプログラム・クロック・リファレンス、またはプログラムストリームを外部に出力する際のシステム・クロック・リファレンスを予測算出する。そして、この予測算出結果と、指定された時刻に出力するのに必要なタイムスタンプとを使用して図5の模式図に示すように、パケット生成部9にて映像ストリーム、音声ストリームをパケット化し、メモリ5上のパケット化ストリーム領域4に一時記憶する。この後、指定された時刻になったとき、パケット出力部10がこれを検知してパケット化ストリーム領域4に一時記憶されている各トランスポートストリーム・パケット、または各プログラムストリーム・パケットに付加されているタイムスタンプを削除して外部に出力するようにした。そのため、トランスポートストリーム・パケット、またはプログラムストリーム・パケットを外部に出力するとき、エンコードから出力までのタイムシフトを可能にして出力時のシステム負荷を小さくすることができる。   Thus, in this reference example, before the actual output timing for the video stream and the audio stream temporarily stored in the video stream area 2 and the audio stream area 3 formed on the memory 5, respectively, the CPU Thus, the program clock reference when the transport stream is output to the outside or the system clock reference when the program stream is output to the outside is predicted and calculated. Then, using this prediction calculation result and the time stamp necessary for output at the specified time, as shown in the schematic diagram of FIG. 5, the packet generation unit 9 packetizes the video stream and the audio stream. , Temporarily stored in the packetized stream area 4 on the memory 5. Thereafter, when the designated time comes, the packet output unit 10 detects this and adds it to each transport stream packet or each program stream packet temporarily stored in the packetized stream area 4. Deleted the time stamp that is present and output it to the outside. Therefore, when transport stream packets or program stream packets are output to the outside, it is possible to shift the time from encoding to output, thereby reducing the system load during output.

《他の参考例》
上述した参考例では、パケット生成部9によって生成されたタイムスタンプ付きの各トランスポートストリーム・パケット、または各プログラムストリーム・パケットをメモリ5のパケット化ストリーム領域4に一時記憶し、指定された時刻になったとき、パケット出力部10がこれを検知してパケット化ストリーム領域4に一時記憶されている各トランスポートストリーム・パケット、または各プログラムストリーム・パケットに付加されているタイムスタンプを削除して外部に出力するようにした。
《Other reference examples》
In the reference example described above, each transport stream packet with a time stamp generated by the packet generation unit 9 or each program stream packet is temporarily stored in the packetized stream area 4 of the memory 5 at a specified time. The packet output unit 10 detects this and deletes each transport stream packet temporarily stored in the packetized stream area 4 or a time stamp added to each program stream packet to externally Output to.

しかし、複数の映像ストリーム、音声ストリームを連続的にパケット化するときには、図6の模式図に示すように、パケット生成部9によって生成されたタイムスタンプ付きの各トランスポートストリーム・パケット、プログラムストリーム・パケットをメモリ5のパケット化ストリーム領域4に一時記憶した後、ハードディスクなどの外部記憶装置19に移動する。   However, when a plurality of video streams and audio streams are continuously packetized, as shown in the schematic diagram of FIG. 6, each transport stream packet with a time stamp generated by the packet generator 9, a program stream, The packet is temporarily stored in the packetized stream area 4 of the memory 5 and then moved to the external storage device 19 such as a hard disk.

そして、外部記憶装置19に格納されているタイムスタンプ付きの各トランスポートストリーム・パケット、または各プログラムストリーム・パケットを再度、メモリ5に移動した後、パケット出力部10によって、指定した出力タイミングで外部に出力するようにしても良い。   Then, after transporting each transport stream packet with a time stamp or each program stream packet stored in the external storage device 19 to the memory 5 again, the packet output unit 10 externally transmits the transport stream packet at a designated output timing. May be output.

このように構成することにより、メモリ5の容量が小さいときにも、複数の映像ストリーム、音声ストリームを連続的にパケット化して外部に出力することができる。   With this configuration, even when the capacity of the memory 5 is small, a plurality of video streams and audio streams can be continuously packetized and output to the outside.

また、上述した参考例では、1つのパケット出力部10を用いて、メモリ5のパケット化ストリーム領域4に一時記憶されているタイムスタンプ付きの各トランスポートストリーム・パケット、または各プログラムストリーム・パケットを読み込ませ、指定された出力タイミングで外部に出力するようにしているが、図7に示すように、複数の出力ポートに対応する複数のパケット出力部10a〜10nを起動してメモリ5のパケット化ストリーム領域4に一時記憶されているタイムスタンプ付きの各トランスポートストリーム・パケット、または各プログラムストリーム・パケットを読み込み、指定された出力タイミングで外部に出力するようにしても良い。   Further, in the above-described reference example, each transport stream packet with a time stamp or each program stream packet temporarily stored in the packetized stream area 4 of the memory 5 is transmitted using one packet output unit 10. The data is read and output to the outside at a specified output timing. However, as shown in FIG. Each transport stream packet with a time stamp or program stream packet temporarily stored in the stream area 4 may be read and output to the outside at a specified output timing.

このように構成することにより、複数のトランスポートストリーム・パケット、またはプログラムストリーム・パケットを同時、並列的に読み出して外部に出力することができる。また、単一のトランスポートストリーム、単一のプログラムストリームを出力するときにも、複数の出力ポート、複数の出力タイミングを使用することができ、パケット数が多い場合でも、出力開始から出力完了までに要する時間を短縮することができるとともに、出力の自由度を高めることができる。   With this configuration, a plurality of transport stream packets or program stream packets can be read simultaneously and in parallel and output to the outside. Also, when outputting a single transport stream or a single program stream, multiple output ports and multiple output timings can be used. Even when the number of packets is large, from the start of output to the end of output. Can be shortened and the degree of freedom of output can be increased.

《実施形態》
図8は本発明の実施形態を示すブロック図である。
<Embodiment>
FIG. 8 is a block diagram showing an embodiment of the present invention.

この実施形態では、メモリ5は、映像ストリーム領域2、音声ストリーム領域3に加えて、複数の他ストリーム領域21と、第1パケット領域22、第2パケット領域23,および第3パケット領域24とを備えて構成されている。   In this embodiment, the memory 5 includes a plurality of other stream areas 21, a first packet area 22, a second packet area 23, and a third packet area 24 in addition to the video stream area 2 and the audio stream area 3. It is prepared for.

また、この実施形態では、映像エンコード部7と音声エンコード部8に加えて、映像情報や音声情報とは異なる他の情報を取り込んでエンコードした後、メモリ5の他ストリーム領域21に記憶させる他エンコード部20と、メモリバス6を介してメモリ5の映像ストリーム領域2、音声ストリーム領域3に一時記憶されている映像ストリーム、音声ストリーム、および他ストリーム領域21に一時記憶されている他ストリームを読み出し、出力レートとの差分に相当するヌルパケットを挿入するとともに、CPUから出力されるプログラム・クロック・リファレンス(PCR)(または、システム・クロック・リファレンス)、タイムスタンプなどを用いて、タイムスタンプ付きのトランスポートストリーム・パケット、またはタイムスタンプ付きのプログラムストリーム・パケットを生成し、これをメモリ5の第1パケット領域22,第2パケット領域、第3パケット領域に一時記憶させる第1パケット生成部9−1、第2パケット生成部9−2、第3パケット生成部9−3とを備えている。 In this embodiment, in addition to the video encoding unit 7 and the audio encoding unit 8, other information different from video information and audio information is captured and encoded, and then stored in the other stream area 21 of the memory 5. The video stream temporarily stored in the video stream area 2 and the audio stream area 3 of the memory 5 and the other stream temporarily stored in the other stream area 21 via the memory bus 6 and the unit 20; A null packet corresponding to the difference from the output rate is inserted, and a time stamped transformer is used by using a program clock reference (PCR) (or system clock reference) output from the CPU, a time stamp, and the like. Port stream packet or time Generates a program stream packet with flop, which first packet region 22 of the memory 5, a second packet region, first packet generating unit 9-1 is temporarily stored in the third packet region, the second packet generating unit 9 -2 and a third packet generator 9-3 .

さらに、メモリ5の第1パケット領域22、第2パケット領域23,第3パケット領域24に一時記憶されている各プログラムストリーム・パケット(または各トランスポートストリーム・パケット)に付加されたタイムスタンプをチェックし、出力時になったとき、各プログラムストリーム・パケット(または各トランスポートストリーム・パケット)に付加されているタイムスタンプを削除するとともに、ヌルパケットをそのままの状態で出力させるか、破棄するか、他のパケットに置き換えるかを選択してそれぞれ出力する第1パケット出力部10−1、第2パケット出力部10−2とを備えている。 Further, the time stamp added to each program stream packet (or each transport stream packet) temporarily stored in the first packet area 22, the second packet area 23, and the third packet area 24 of the memory 5 is checked. At the time of output, the time stamp added to each program stream packet (or each transport stream packet) is deleted, and the null packet is output as it is, discarded, or others The first packet output unit 10 -1 and the second packet output unit 10 -2 are provided to select and replace each packet.

各パケット生成部9−1,9−2,9−3は、図9に示すように、4つの合成器12,13,14,15を備えており、メモリから映像、音声、その他のストリームを読み出すとともに、適宜ヌルパケットを挿入し、また、PCRとタイムスタンプを付加したタイムスタンプ付きのトランスポートストリーム・パケットを生成する。 As shown in FIG. 9, each packet generation unit 9 −1 , 9 −2 , 9 −3 includes four synthesizers 12, 13, 14, and 15, and outputs video, audio, and other streams from the memory. While reading, a null packet is appropriately inserted, and a transport stream packet with a time stamp to which a PCR and a time stamp are added is generated.

各パケット出力部10−1,10−2は、それぞれ異なる出力タイミングが設定される出力タイミングカウンタ16と、パケットに挿入されたタイムスタンプと出力タイミングとを比較して出力タイミングが到来したかどうかを判定するタイムスタンプ比較部18とを備えており、異なるタイミングでトランスポートストリーム・パケットを外部へ出力可能に構成されている。 Each of the packet output units 10 -1 and 10 -2 compares the output timing counter 16 in which different output timings are set with the time stamp inserted in the packet and the output timing to determine whether the output timing has arrived. And a time stamp comparing unit 18 for judging, and configured to be able to output a transport stream packet to the outside at different timings.

以上の構成において、CPUから映像情報のエンコード指示、音声情報のエンコード指示および他の情報のエンコード指示が出されると、映像エンコード部7、音声エンコード部8および他エンコード部20によって、メモリバス6を介して映像情報、音声情報および他の情報が取り込まれて、エンコードされる。これによって得られた映像ストリーム、音声ストリームおよび他ストリームがメモリ5の映像ストリーム領域2、音声ストリーム領域3および他ストリーム領域21にそれぞれ一時記憶される。   In the above configuration, when an instruction for encoding video information, an instruction for encoding audio information, and an instruction for encoding other information are issued from the CPU, the video encoder 7, the audio encoder 8, and the other encoder 20 connect the memory bus 6. Video information, audio information, and other information are taken in through and encoded. The video stream, audio stream, and other stream obtained in this way are temporarily stored in the video stream area 2, audio stream area 3, and other stream area 21 of the memory 5, respectively.

この後、図9に示すように、CPU内に形成された出力タイミング予測算出部11によって、メモリ5の映像ストリーム領域2、音声ストリーム領域3および他ストリーム領域21に各々、一時記憶されている映像ストリーム、音声ストリームおよび他ストリームに対し、プログラムストリーム化指示またはトランスポートストリーム化指示のどちらが指示されているかチェックされる。このとき、トランスポートストリーム化指示がされていれば、出力タイミング予測算出部11によって、トランスポートストリーム・パケットを外部に出力する際に必要なプログラム・クロック・リファレンス(PCR)が予測算出される。   Thereafter, as shown in FIG. 9, the video temporarily stored in the video stream area 2, the audio stream area 3, and the other stream area 21 of the memory 5 by the output timing prediction calculation unit 11 formed in the CPU, respectively. It is checked whether a program stream instruction or a transport stream instruction is instructed for a stream, an audio stream, and another stream. At this time, if a transport stream instruction is given, the output timing prediction calculation unit 11 predicts and calculates a program clock reference (PCR) necessary for outputting a transport stream packet to the outside.

次いで、出力タイミング予測算出部11によって、メモリ5上の映像ストリーム領域2、音声ストリーム領域3に一時記憶されている映像ストリーム、音声ストリームをパケット化してこれを指定された時刻に出力するのに必要な各トランスポートストリーム・パケット毎の連続した値となるタイムスタンプと、上述した計算動作で得られたプログラム・クロック・リファレンス(PCR)の予測結果とがメモリバス6上に出力される。   Next, it is necessary for the output timing prediction calculation unit 11 to packetize the video stream and the audio stream temporarily stored in the video stream area 2 and the audio stream area 3 on the memory 5 and to output the packet at a specified time. A time stamp that is a continuous value for each transport stream packet and a prediction result of the program clock reference (PCR) obtained by the above-described calculation operation are output on the memory bus 6.

これにより、各パケット生成部9−1,9−2,9−3によって、メモリ5の映像ストリーム領域2、音声ストリーム領域3、および他ストリーム領域21に一時記憶されている映像ストリーム、音声ストリームおよび他ストリームの取り込みが開始されて、これら映像ストリーム、音声ストリームおよび他ストリームがパケット単位長毎に分割され、分割ストリームが生成される。また、このとき、出力レートと有効パケットとの差分が求められる。各合成器12〜15上では、各分割ストリームに対し、出力タイミング予測算出部11から出力されたプログラム・クロック・リファレンスが付加されるとともに、前記差分にヌルパケットが挿入されてトランスポートストリーム・パケットが生成されるとともに、各トランスポートストリーム・パケットに対し、出力タイミング予測算出部11から出力されたタイムスタンプがそれぞれ付加されて、メモリ5上の各パケット領域22,23,24に一時記憶される。 Accordingly, the video stream, the audio stream, and the video stream temporarily stored in the video stream area 2, the audio stream area 3, and the other stream area 21 of the memory 5 by the packet generators 9 −1 , 9 −2 , and 9 −3 . The capture of the other stream is started, and the video stream, the audio stream, and the other stream are divided for each packet unit length, and a divided stream is generated. At this time, the difference between the output rate and the valid packet is obtained. On each synthesizer 12 to 15, a program clock reference output from the output timing prediction calculation unit 11 is added to each divided stream, and a null packet is inserted into the difference to generate a transport stream packet. Is generated, and the time stamp output from the output timing prediction calculation unit 11 is added to each transport stream packet, and is temporarily stored in each packet area 22, 23, 24 on the memory 5. .

また、この処理と並行し、各パケット出力部10−1,10−2によって、メモリ5上のパケット領域4に一時記憶されている各トランスポートストリーム・パケットが読み出され、バッファ17に一時記憶され、タイムスタンプ比較器18によって、各トランスポートストリーム・パケットに付加されているタイムスタンプの値と、出力タイミングカウンタ16から出力される、現在の時刻と対応した出力タイミング値とが比較される。タイムスタンプの値と出力タイミング値とが一致しているとき、バッファ17内のトランスポートストリーム・パケットからタイムスタンプが削除されて、外部に出力される。 In parallel with this processing, the transport stream packets temporarily stored in the packet area 4 on the memory 5 are read out by the packet output units 10 −1 and 10 −2 and temporarily stored in the buffer 17. The time stamp comparator 18 compares the value of the time stamp added to each transport stream packet with the output timing value corresponding to the current time output from the output timing counter 16. When the time stamp value matches the output timing value, the time stamp is deleted from the transport stream packet in the buffer 17 and output to the outside.

特に、この実施形態においては、ヌルパケットをそのまま出力するか、ヌルパケットを破棄するか、バッファ25に一時記憶されたパケットで置き換えて出力するかを選択することができる。例えば、図11(a)のパケット1では、2つのヌルパケットはそのまま出力されるが、他の2つのヌルパケットはパケットP1(0)、パケットP1(1)に置き換えられて出力されている。同(b)のパケット2も同様、2つのヌルパケットはそのまま出力されるが、他の2つのヌルパケットがパケットP2(0)、パケットP2(1)に置き換えられて出力されて、各パケット出力部10−1,10−2ごとに異なるストリームパケットの多重ができる。 In particular, in this embodiment, it is possible to select whether to output a null packet as it is, discard the null packet, or replace it with a packet temporarily stored in the buffer 25 and output it. For example, in packet 1 in FIG. 11A, two null packets are output as they are, but the other two null packets are output by being replaced with packet P1 (0) and packet P1 (1). In the same way as packet 2 in (b), the two null packets are output as they are, but the other two null packets are replaced with the packet P2 (0) and the packet P2 (1) and output. Different stream packets can be multiplexed for each of the units 10 −1 and 10 −2 .

また、図11に示すように、パケット1を出力する第1パケット出力部10−1の出力タイミングとパケット2を出力する第2パケット出力部10−2の出力タイミングはそれぞれ異なっており、所定の時間差を持って異なるタイミングでパケットを出力することができる。 Further, as shown in FIG. 11, the output timing of the first packet output unit 10-1 that outputs the packet 1 and the output timing of the second packet output unit 10-2 that outputs the packet 2 are different from each other. Packets can be output at different timings with a time difference.

このように、この実施形態によれば、同一のストリームに対して、それぞれ異なるタイミングで出力することができる。また、同一のストリームに対してそれぞれ異なるストリームを多重して出力することができる。   As described above, according to this embodiment, the same stream can be output at different timings. Also, different streams can be multiplexed and output for the same stream.

《変形例》
なお、図12に示すように、第2パケット生成部9−1、第3パケット生成部9−2はメモリバス6に接続されていなくても良く、直接、パケット出力部10−1,10−2に接続されるように構成しても同様の効果を得ることができる。
<Modification>
As shown in FIG. 12, the second packet generation unit 9 −1 and the third packet generation unit 9-2 do not have to be connected to the memory bus 6 and are directly connected to the packet output units 10 −1 and 10 −. Even if it is configured to be connected to 2 , the same effect can be obtained.

MPEGストリーム処理方法およびその装置の参考例を示すブロック図である。It is a block diagram which shows the reference example of an MPEG stream processing method and its apparatus. 図1に示すパケット生成部の動作例を示す模式図である。It is a schematic diagram which shows the operation example of the packet generation part shown in FIG. 図1に示すパケット生成部によって生成されるタイムスタンプ付きトランスポートストリームパケットの一例を示す模式図である。It is a schematic diagram which shows an example of the transport stream packet with a time stamp produced | generated by the packet production | generation part shown in FIG. 図1に示すパケット出力部の動作例を示す模式図である。It is a schematic diagram which shows the operation example of the packet output part shown in FIG. 図1に示すMPEGストリーム処理装置の動作概要例を示す模式図である。FIG. 2 is a schematic diagram illustrating an outline of an operation of the MPEG stream processing apparatus illustrated in FIG. 1. MPEGストリーム処理方法およびその装置の他の参考例を示す模式図である。It is a schematic diagram which shows the other reference example of an MPEG stream processing method and its apparatus. MPEGストリーム処理方法およびその装置のさらに他の参考例を示す模式図である。It is a schematic diagram which shows the further another reference example of an MPEG stream processing method and its apparatus. 本発明によるMPEGストリーム処理方法およびその装置の実施形態を示すブロック図である。1 is a block diagram illustrating an embodiment of an MPEG stream processing method and apparatus according to the present invention. FIG. 図8に示すパケット生成部の動作例を示す模式図である。It is a schematic diagram which shows the operation example of the packet generation part shown in FIG. 図8に示すパケット出力部の動作例を示す模式図である。It is a schematic diagram which shows the operation example of the packet output part shown in FIG. パケット出力部の動作例を示す模式図である。It is a schematic diagram which shows the operation example of a packet output part. 本発明によるMPEGストリーム処理方法およびその装置の実施形態の変形例を示す模式図である。FIG. 6 is a schematic diagram showing a modification of the embodiment of the MPEG stream processing method and apparatus according to the present invention.

符号の説明Explanation of symbols

1:MPEGストリーム処理装置
2:映像ストリーム領域
3:音声ストリーム領域
4:パケット化ストリーム領域
5:メモリ
6:メモリバス
7:映像エンコード部
8:音声エンコード部
9,9−1,9−2,9−3:パケット生成部
10,10−1,10−2:パケット出力部
11:出力タイミング予測算出部
12〜15:合成器
16:出力タイミングカウンタ
17,25:バッファ
18:タイムスタンプ比較器
19:外部記憶装置
20:他エンコード部
21:他ストリーム領域
22:第1パケット領域
22:第2パケット領域
23:第3パケット領域
1: MPEG stream processing apparatus 2: a video stream area 3: audio stream area 4: packetized stream area 5: Memory 6: memory bus 7: image encoding section 8: audio encoding unit 9, 9 -1, 9 -2, 9 -3: packet generating unit 10, 10 -1, 10 -2: packet output unit 11: output timing prediction calculating unit 12-15: combiner 16: output timing counter 17, 25: buffer 18: timestamp comparison 19: External storage device 20: Other encoding unit 21: Other stream area 22: First packet area 22: Second packet area 23: Third packet area

Claims (2)

映像情報、音声情報をMPEGパケット形式で外部に出力するMPEGストリーム処理方法において、
前記映像情報、前記音声情報をMPEGパケットにする際、出力タイミングに対応するタイムスタンプを付加するとともに、出力レートと有効パケットの差分にヌルパケットを挿入して記憶領域に蓄積した後、前記各MPEGパケットに付加されている前記タイムスタンプに基づき、出力タイミングになっているかどうかをチェックし、
出力タイミングになっているMPEGパケットがあるとき、当該MPEGパケットを前記記憶領域から読み出し、このMPEGパケットに付加されている前記タイムスタンプを削除するとともに、前記ヌルパケットを外部に出力するか、破棄するか、他のパケットと差し替えて出力するかを判断した後、その判断結果に従ったMPEGパケットを外部に出力する、
ことを特徴とするMPEGストリーム処理方法。
In an MPEG stream processing method for outputting video information and audio information to the outside in MPEG packet format,
When the video information and the audio information are converted into MPEG packets, a time stamp corresponding to the output timing is added, a null packet is inserted into the difference between the output rate and the effective packet, and stored in the storage area. Based on the time stamp added to the packet, check whether it is the output timing,
When there is an MPEG packet at the output timing, the MPEG packet is read from the storage area, the time stamp added to the MPEG packet is deleted, and the null packet is output to the outside or discarded. Or after deciding whether to output by replacing with other packets, output the MPEG packet according to the judgment result to the outside,
An MPEG stream processing method.
映像情報、音声情報をMPEGパケット形式で外部に出力するMPEGストリーム処理装置において、
前記映像情報、前記音声情報を取り込み、出力タイミングに対応するタイムスタンプを付加するとともに、出力レートと有効パケットの差分にヌルパケットを挿入したMPEGパケットを生成するパケット生成部と、
このパケット生成部によって生成されたタイムスタンプ付きで、かつヌルパケットが挿入された前記MPEGパケットを記憶する記憶部と、
この記憶部に記憶されている前記各MPEGパケットに付加されたタイムスタンプの内容に基づき、出力タイミングになっているMPEGパケットを読み出し、このMPEGパケットに付加された前記タイムスタンプを削除するとともに、前記ヌルパケットを外部に出力するか、破棄するか、他のパケットと差し替えて出力するかを判断し、その判断結果に従ったMPEGパケットを外部に出力するパケット出力部と、
を備えたことを特徴とするMPEGストリーム処理装置。
In an MPEG stream processing apparatus that outputs video information and audio information to the outside in MPEG packet format,
A packet generation unit that captures the video information and the audio information, adds a time stamp corresponding to the output timing, and generates an MPEG packet in which a null packet is inserted in the difference between the output rate and the valid packet;
A storage unit for storing the MPEG packet with a time stamp generated by the packet generation unit and a null packet inserted;
Based on the content of the time stamp added to each MPEG packet stored in the storage unit, the MPEG packet at the output timing is read, the time stamp added to the MPEG packet is deleted, and the A packet output unit that determines whether to output a null packet to the outside, discard it, or replace it with another packet and output the MPEG packet according to the determination result,
An MPEG stream processing apparatus comprising:
JP2004378165A 2004-12-27 2004-12-27 Mpeg stream processing method and processor Pending JP2006186674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004378165A JP2006186674A (en) 2004-12-27 2004-12-27 Mpeg stream processing method and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004378165A JP2006186674A (en) 2004-12-27 2004-12-27 Mpeg stream processing method and processor

Publications (1)

Publication Number Publication Date
JP2006186674A true JP2006186674A (en) 2006-07-13

Family

ID=36739442

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004378165A Pending JP2006186674A (en) 2004-12-27 2004-12-27 Mpeg stream processing method and processor

Country Status (1)

Country Link
JP (1) JP2006186674A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011024437A1 (en) * 2009-08-25 2011-03-03 パナソニック株式会社 Recording device and playback device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011024437A1 (en) * 2009-08-25 2011-03-03 パナソニック株式会社 Recording device and playback device

Similar Documents

Publication Publication Date Title
RU2273111C2 (en) Method for transformation of packet stream of information signals to stream of information signals with time stamps and vice versa
US7349410B2 (en) Data transmission device and data transmission method
US7227899B2 (en) Method and system for re-multiplexing of content-modified MPEG-2 transport streams using interpolation of packet arrival times
JP4746998B2 (en) Transmission rate adjusting device and transmission rate adjusting method
JP5409032B2 (en) Transmitting apparatus, method, and program
CN101098209A (en) FEC encoding method, FEC decoding method, and FEC decoding apparatus
JP2009177447A (en) Moving image transmitting and receiving system
US5832256A (en) System clock recovery apparatus for MPEG decoding system
JP2000174819A (en) Signal format, encoder, decoder and signal transmission device
US7693222B2 (en) Method and system for re-multiplexing of content-modified MPEG-2 transport streams using PCR interpolation
JP2007028241A (en) Video image coding/transmitting device, video image coding/transmitting method, video image coding/transmitting program, and its record medium
US7729383B2 (en) Multiplexer and multiplexing method
KR20100027136A (en) System and method for transport of a constant bit rate stream
JP2008245050A (en) Pcr correction circuit
JP2006186674A (en) Mpeg stream processing method and processor
JP2009290768A (en) Video processing apparatus and video processing method
JP5939884B2 (en) Error correction coding device
JP2005333412A (en) Multiple-stream generating device
JP2010028642A (en) Image transmission system
JP6684433B2 (en) Transmission device, transmission method, and program
CA2535457C (en) Method and system for re-multiplexing of content-modified mpeg-2 transport streams using pcr interpolation
JP4212794B2 (en) Stream multiplexing transmission method
JPH09270994A (en) Stream control system
JP2006270595A (en) Image encoding circuit, image encoding device, and multiplexing circuit
KR0138123B1 (en) An apparatus for coding time-stamp in mpeg-2 system