JP2006254039A - System decoder - Google Patents
System decoder Download PDFInfo
- Publication number
- JP2006254039A JP2006254039A JP2005067028A JP2005067028A JP2006254039A JP 2006254039 A JP2006254039 A JP 2006254039A JP 2005067028 A JP2005067028 A JP 2005067028A JP 2005067028 A JP2005067028 A JP 2005067028A JP 2006254039 A JP2006254039 A JP 2006254039A
- Authority
- JP
- Japan
- Prior art keywords
- data
- unit
- pes
- section
- packet
- 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
Links
- 230000015654 memory Effects 0.000 claims abstract description 173
- 238000003860 storage Methods 0.000 claims abstract description 58
- 238000000605 extraction Methods 0.000 claims description 82
- 238000000926 separation method Methods 0.000 claims description 58
- 239000000284 extract Substances 0.000 claims description 3
- 238000001914 filtration Methods 0.000 abstract description 16
- 238000004458 analytical method Methods 0.000 description 167
- 230000006978 adaptation Effects 0.000 description 80
- 238000000034 method Methods 0.000 description 47
- 238000010586 diagram Methods 0.000 description 29
- 238000004519 manufacturing process Methods 0.000 description 11
- 238000012217 deletion Methods 0.000 description 5
- 230000037430 deletion Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000007405 data analysis Methods 0.000 description 2
- 238000013075 data extraction Methods 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 101100243456 Arabidopsis thaliana PES2 gene Proteins 0.000 description 1
- 101001073193 Homo sapiens Pescadillo homolog Proteins 0.000 description 1
- 102100035816 Pescadillo homolog Human genes 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Time-Division Multiplex Systems (AREA)
Abstract
Description
本発明は、DTV−S等に適用されるシステムデコーダの構成に関する。 The present invention relates to a configuration of a system decoder applied to DTV-S or the like.
MPEG方式で圧縮されたストリームの処理をするMPEGパケット処理装置であって、ストリームのTS(Transport Stream)解析部と、TS解析部の出力をデコードするPES(Packetized Elementary Stream)デコーダと、このPESデコーダの部分に記憶手段を設け、PESデコーダを単一化することを特徴としたMPEGパケット処理装置が、下記特許文献1に開示されている。
An MPEG packet processing apparatus for processing a stream compressed by the MPEG method, a TS (Transport Stream) analysis unit of the stream, a PES (Packetized Elementary Stream) decoder for decoding the output of the TS analysis unit, and the PES
上記特許文献に開示された従来のMPEGパケット処理装置では、PESのデコード用に、専用の記憶手段が設けられている。ここで、TSパケットに比べてPESのデータ単位は一般に大規模になることが知られている。従って、PESデコード用の記憶手段をLSIに搭載すると、製造コストが高くなる。一方、LSIの外部に出すと、PESデコーダ専用のアクセスが必要となる。この場合、外部アクセスのバス帯域に余裕が無いことが多いため、バスの破綻を招く要因となる。また、TSパケット単位(188バイト単位)での処理ができないため、一時記憶するメモリ容量がPES単位になるなど、LSIに搭載するメモリ規模が大きくなり、LSIのコストの増大を招くという問題がある。 In the conventional MPEG packet processing apparatus disclosed in the above patent document, a dedicated storage means is provided for decoding the PES. Here, it is known that the data unit of PES is generally larger than that of TS packets. Therefore, if the storage means for PES decoding is mounted on an LSI, the manufacturing cost increases. On the other hand, when it goes out of the LSI, a dedicated access for the PES decoder is required. In this case, the bus band for external access often has no margin, which causes a bus failure. Further, since processing in TS packet units (188 byte units) cannot be performed, there is a problem that the memory capacity to be mounted on the LSI becomes large, such as temporarily storing memory capacity in PES units, leading to an increase in LSI cost. .
本発明はかかる問題を解決するために成されたものであり、TSパケット単位でデータ処理を行うことにより、コストの低減を実現し得るシステムデコーダを得ることを目的とする。 The present invention has been made to solve such a problem, and an object of the present invention is to obtain a system decoder that can realize cost reduction by performing data processing in units of TS packets.
第1の発明に係るシステムデコーダは、TS(Transport Stream)データを同期捕捉する同期捕捉部と、前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出したTSデータに対してスクランブル解除処理を行うデスクランブル部と、前記デスクランブル部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記デスクランブル部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第2の記憶部と、前記第2の記憶部の後段に接続され、前記第2の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、前記抽出分離部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記抽出分離部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第3の記憶部と、前記第3の記憶部の後段に接続され、前記第3の記憶部から読み出したTSデータを外部メモリに書き込む書き込み部とを備える、TSパケット単位での4段パイプライン構成のシステムデコーダである。 A system decoder according to a first aspect of the present invention is connected to a synchronization acquisition unit that synchronously acquires TS (Transport Stream) data and a subsequent stage of the synchronization acquisition unit, and each memory has a storage capacity corresponding to a data unit of TS data. And a first storage unit including a memory set that alternately performs a write operation and a read operation of TS data input from the synchronization acquisition unit, and is connected to a subsequent stage of the first storage unit, A descrambling unit that performs descrambling processing on the TS data read from the storage unit, and a subsequent stage of the descrambling unit, each memory having a storage capacity corresponding to a data unit of TS data, and A second storage unit including a memory set that alternately performs a write operation and a read operation of TS data input from the scramble unit and a subsequent stage of the second storage unit are connected. Connected to an extraction / separation unit that extracts and separates necessary TS data from a plurality of TS data read from the second storage unit, and a subsequent stage of the extraction / separation unit, and each memory is a TS data A third storage unit having a storage capacity equivalent to a unit and including a memory set that alternately performs a write operation and a read operation of TS data input from the extraction / separation unit; and a subsequent stage of the third storage unit And a writing unit for writing TS data read from the third storage unit to an external memory. The system decoder has a four-stage pipeline structure in units of TS packets.
第2の発明に係るシステムデコーダは、TS(Transport Stream)データを同期捕捉する同期捕捉部と、前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、前記抽出分離部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記抽出分離部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第2の記憶部と、前記第2の記憶部の後段に接続され、前記第2の記憶部から読み出したTSデータを外部メモリに書き込む書き込み部とを備える、TSパケット単位での3段パイプライン構成のシステムデコーダである。 A system decoder according to a second aspect of the present invention is connected to a synchronization acquisition unit that synchronously acquires TS (Transport Stream) data and a subsequent stage of the synchronization acquisition unit, and each memory has a storage capacity corresponding to a data unit of TS data. And a first storage unit including a memory set that alternately performs a write operation and a read operation of TS data input from the synchronization acquisition unit, and is connected to a subsequent stage of the first storage unit, An extraction / separation unit for extracting and separating necessary TS data from a plurality of TS data read from the storage unit, and a subsequent stage of the extraction / separation unit, each memory having a storage capacity corresponding to a data unit of TS data Including a memory set that alternately performs a write operation and a read operation of TS data input from the extraction / separation unit, and is connected to a subsequent stage of the second storage unit, A system decoder having a three-stage pipeline structure in units of TS packets, including a writing unit that writes TS data read from the second storage unit to an external memory.
第3の発明に係るシステムデコーダは、TS(Transport Stream)データを同期捕捉する同期捕捉部と、前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、前記抽出分離部の後段に接続され、前記抽出分離部から入力されたTSデータを外部メモリに書き込む書き込み部とを備える、TSパケット単位での2段パイプライン構成のシステムデコーダである。 A system decoder according to a third aspect of the present invention is connected to a synchronization acquisition unit that synchronously acquires TS (Transport Stream) data and a subsequent stage of the synchronization acquisition unit, and each memory has a storage capacity corresponding to a data unit of TS data. And a first storage unit including a memory set that alternately performs a write operation and a read operation of TS data input from the synchronization acquisition unit, and is connected to a subsequent stage of the first storage unit, An extraction / separation unit that extracts and separates necessary TS data from a plurality of TS data read from the storage unit, and is connected to a subsequent stage of the extraction / separation unit, and the TS data input from the extraction / separation unit is stored in an external memory. A system decoder having a two-stage pipeline structure in units of TS packets, including a writing unit for writing.
第1〜第3の発明に係るシステムデコーダによれば、TSパケット単位でデータ処理を行うことにより、コストの低減を図ることができる。 According to the system decoders of the first to third aspects, the cost can be reduced by performing data processing in units of TS packets.
まず、本発明の概要について説明する。 First, an outline of the present invention will be described.
本発明に係るシステムデコーダは、TS(Transport Stream)パケット単位で、ストリームの分離、指定データの抽出、及び外部メモリへの書き込みを行うことを特徴としている。PESのデータであることを判断し、PESのヘッダ部を削除する機能も搭載されているが、PESヘッダ部を一時記憶するためだけの12バイト程度のメモリを、PES系フィルタ数分のみ搭載する構成にしている。 The system decoder according to the present invention is characterized by performing stream separation, extraction of designated data, and writing to an external memory in units of TS (Transport Stream) packets. A function to determine that the data is PES data and delete the header part of the PES is also installed, but only about 12 bytes of memory for temporarily storing the PES header part is installed for the number of PES filters. It has a configuration.
TSパケット単位でデマルチプレクス処理(以下「Demux処理」と称す)を行うことで、必要となるワークメモリは188バイト単位のメモリのみとなる。この188バイトのデータから、抽出分離指定されているデータのみを外部メモリへ書き込む構成をとっている。この際、PES単位のデータを、ES(elementary stream)単位のデータへ変換する処理も実施している。これにより、PES単位でのデータ蓄積を行う必要がなくなり、PES単位のデータを一時記憶するメモリ、及びこのメモリへのアクセスを削除できることとなった。 By performing demultiplex processing (hereinafter referred to as “Demux processing”) in units of TS packets, the required work memory is only 188 bytes. From this 188-byte data, only the data designated for extraction / separation is written to the external memory. At this time, a process of converting data in PES units into data in ES (elementary stream) units is also performed. As a result, there is no need to accumulate data in units of PES, and the memory for temporarily storing data in units of PES and access to this memory can be deleted.
(1)第1の発明に係るシステムデコーダ
図1は、第1の発明に係るシステムデコーダ100aの構成を概略的に示すブロック図である。図1を参照して、TS−IF部5において、TSの同期をとり、188バイト×2個のメモリ1にデータを書き込む。次に、デスクランブル部6において、スクランブルされたデータの解読(デスクランブル)を行い、その結果を188バイト×2個のメモリ2へ書き込む。次に、DEMUX部7において、PID値と追加情報(α部分)とを用いて、TSパケットのフィルタリングを行う。このフィルタにヒットしたパケットデータは、データタイプによりSection系又はPES系フォーマットのデータとしてデコードされ、その結果が188バイト×2個のメモリ3へ書き込まれる。ここで、PES系データであった場合は、PESからESへのデコードも実施される。その後、抽出分離されてメモリ3へ書き込まれたデータは、外部記憶装置(SDRAM)4へ書き込まれて一時保持される。
(1) System Decoder According to the First Invention FIG. 1 is a block diagram schematically showing the configuration of the
図2は、システムデコーダ100aのパイプライン処理を示すタイミングチャートである。図2を参照して、システムデコーダ100aは、TSパケット単位での4段のパイプライン動作を行うことを特徴としている。詳細は後述の実施の形態1において説明するが、1段目はMPEG2−TSのストリーミングデータの同期を取るIFステージであり、2段目はデスクランブルを行うSステージであり、3段目はDemux処理を行うDステージであり、4段目はSDRAM4への書き込みを行うWステージである。
FIG. 2 is a timing chart showing pipeline processing of the
ここで、TSパケット単位とは、MPEG2−TSのデータ単位のことであり、188バイトとなる。システムデコーダ100aでは、188バイトのパケットデータの同期を取り、188バイトの2面メモリ1〜3へのデータの取り込みが完了するたびに、パイプライン処理が進められる。
Here, the TS packet unit is a data unit of MPEG2-TS and is 188 bytes. The
また、パイプライン動作はTSパケット単位なので、システムデコーダ100aに入力されるデータの入力レートに依存して、パイプラインの動作は変動する。換言すれば、188バイトのデータを全て受け取るまでの時間間隔の変動が、そのままパイプライン動作に反映される。
Since the pipeline operation is in units of TS packets, the pipeline operation varies depending on the input rate of data input to the
(2)第2の発明に係るシステムデコーダ
図3は、第2の発明に係るシステムデコーダ100bの構成を概略的に示すブロック図であり、図4は、システムデコーダ100bのパイプライン処理を示すタイミングチャートである。スクランブルが不要な用途では、Sステージを削除して、3段のパイプライン構成にすることができる。この場合、188バイトの2面メモリ2を1セット省略できる。図3,4に示すように、パイプラインは、3段から構成されている。1段目はMPEG2−TSのストリーミングデータの同期を取るIFステージであり、2段目はDemux処理を行うDステージであり、3段目はSDRAM4への書き込みを行うWステージである。
(2) System Decoder According to Second Invention FIG. 3 is a block diagram schematically showing the configuration of the
DステージとWステージとを分離することで、DステージでのDemux処理に必要とされるクロック数(所要時間)と、WステージでSDRAM4に書き込むまでに必要とされる所要時間とが分離されている。各ステージは1TSパケット期間となるため、最短でも約40μsecの期間が必要である。システムデコーダ100bの処理クロック周波数を100MHzとした場合、少なくとも約2000クロックをDemux処理に割り当てることが可能となる。第2の発明に係るDemux処理では、マルチセクション処理が最も処理サイクルを要し、最大1000クロック程度でDemux処理を終了するが、まだ十分な余裕がある。Wステージを設けているため、SDRAM4へのライトトランザクションで用いる外部バス競合待ち時間を含めた処理系に対する、待ち時間耐性が向上されている。
By separating the D stage and the W stage, the number of clocks (required time) required for the Demux processing at the D stage and the required time required for writing to the
なお、図3ではSDRAM4へアクセスするのはシステムデコーダ100bだけの場合を示しているが、実際には、ほかにもSDRAM4にアクセスするブロックが多数存在するため、システムデコーダ100bがアクセスできるバス帯域は非常に限られたものになる。この限られたバス帯域でも、SDRAM4へのライトトランザクションが破綻しないように、SDRAM4への書き込み期間のためだけにWステージが設けられている。
Although FIG. 3 shows the case where only the
(3)第3の発明に係るシステムデコーダ
図5は、第3の発明に係るシステムデコーダ100eの構成を概略的に示すブロック図であり、図6は、システムデコーダ100eのパイプライン処理を示すタイミングチャートである。SDRAM4へのアクセスするのがシステムデコーダ100eだけである場合、又は、システムデコーダ100eから発行されるライトトランザクションが最優先で処理されることが分かっている場合は、Wステージも不要となる。この場合、Dステージで抽出分離したデータを、そのままDステージの期間内にSDRAM4へ書き込むことができる。一方、Demux処理には1500クロック程度のクロック数が必要となるため、少なくともIFステージ及びDステージは個別に設ける必要がある。従って、第3の発明に係るシステムデコーダ100eにおけるパイプライン構成は、図6に示すように2段となる。1段目はMPEG2−TSのストリーミングデータの同期を取るIFステージであり、2段目はDemux処理及びSDRAM4への書き込みを行うDステージである。
(3) System Decoder According to Third Invention FIG. 5 is a block diagram schematically showing the configuration of the system decoder 100e according to the third invention, and FIG. 6 is a timing showing pipeline processing of the system decoder 100e. It is a chart. If only the system decoder 100e has access to the
(4)不連続PCR受信時のタイムスタンプの無効化処理
通常、システムデコーダには、デコード時刻を管理するための時計が装備されている。この時計は、MPEG2−TSに埋め込まれているPCR(Program Clock Reference)と呼ばれる時刻データを基準に時刻を更新している時計である。MPEG2−TSで送られてくるビデオES及びオーディオESには、タイムスタンプ(PTS/DTS)と呼ばれる時刻情報が付加されていて、このタイムスタンプ値とシステムデコーダの時計とが一致すれば、ビデオES及びオーディオESを、システムデコーダから出力する動作が行われる。
(4) Time stamp invalidation processing at the time of discontinuous PCR reception Normally, the system decoder is equipped with a clock for managing the decoding time. This clock is a clock whose time is updated based on time data called PCR (Program Clock Reference) embedded in MPEG2-TS. Time information called a time stamp (PTS / DTS) is added to the video ES and audio ES sent in MPEG2-TS, and if the time stamp value matches the clock of the system decoder, the video ES The audio ES is output from the system decoder.
ここで、このタイムスタンプ値は、SDRAM4に蓄えられているフレームデータ単位にそれぞれ対応している。また、同時に複数個の時計(STC:System Time Clock)を扱う場合には、複数の時間軸上のタイムスタンプ(PCR_PID毎に対応、分類されたタイムスタンプ)として管理されている。
Here, this time stamp value corresponds to each frame data unit stored in the
この状態で、不連続PCRを受信すると、まず、どのPID対応のPCRが不連続であるかを確認する。その後、格納しているビデオ、オーディオのタイムスタンプ値のうち、不連続となったPCRに対応するビデオ、オーディオのタイムスタンプ値のバリッドビットを0にクリアする。 When discontinuous PCR is received in this state, first, it is confirmed which PID-compatible PCR is discontinuous. Thereafter, the valid bit of the time stamp value of the video and audio corresponding to the discontinuous PCR among the stored video and audio time stamp values is cleared to 0.
AV同期ES出力部では、システムデコーダから出力しようとしているESデータに対応したタイムスタンプ値と、対応するSTCとの比較が行われる。この際、タイムスタンプ値のバリッドビットがセット(値が1)されていれば、ES出力を行う際に、STCとタイムスタンプ値との比較を行うことで、ES出力制御が行われる。一方、タイムスタンプ値のバリッドビットがクリア(値が0)されていれば、ES出力を行う際に、STCとタイムスタンプ値との比較を行わず、ES出力が行われる。 The AV synchronous ES output unit compares the time stamp value corresponding to the ES data to be output from the system decoder with the corresponding STC. At this time, if the valid bit of the time stamp value is set (value is 1), the ES output control is performed by comparing the STC with the time stamp value when performing ES output. On the other hand, if the valid bit of the time stamp value is cleared (value is 0), the ES output is performed without comparing the STC with the time stamp value when performing ES output.
このタイムスタンプ値のクリア処理により、不連続PCR(時刻が数分間分巻き戻る等の場合)を受信した後においても、システムデコーダからのES出力が停止(数分間停止)する事態が回避される。 This time stamp value clear process avoids a situation where ES output from the system decoder stops (stops for several minutes) even after receiving discontinuous PCR (when the time is rewound for several minutes, etc.). .
実施の形態1.
(1)システムデコーダ100aの基本構成
図7は、本発明の実施の形態1に係るシステムデコーダ100aの前半処理部の構成を示すブロック図である。図7に示すように、システムデコーダ100aの前半処理部は、MPEG2−TS入力を受けて188バイトの同期をとるTS−IF部5と、TS−IF部5の出力を受けて暗号を解読するデスクランブル部6と、デスクランブル部6の出力を受けてDemux処理を行うDEMUX部7と、DEMUX部7から出力されたデータをSDRAM4に書き込むMediaI/F部8とを備えて構成されている。MediaI/F部8は、書き込み部8aとMediaBusI/F部8bとを有している。
(1) Basic Configuration of
まず、システムデコーダ100aにおけるTSパケット単位でのパイプライン構成を説明し、その後、PESデコーダまで含めたDemux処理を可能としているアーキテクチャについて説明する。
First, a pipeline configuration in units of TS packets in the
(2)システムデコーダ100aのパイプライン構成
システムデコーダ100aのTSパケット単位でのパイプライン動作としては、TS−IF部5の後段に片面188バイトの2面メモリ1を配備し、IFステージを構成している。
(2) Pipeline configuration of
IFステージでは、以下の処理が行われる。 In the IF stage, the following processing is performed.
入力クロック(TSCLK)と共に送られてくるMPEG2−TSデータ(TSDATA)を、TSCLKで取り込む。この際、TSDATAと同時に送られてくるデータバリッド(TSVALID)を参照し、有効なデータである場合にのみ取り込みを行う。また、取り込み単位は、1バイト単位又は1ビット単位となり、選択が可能である。 MPEG2-TS data (TSDATA) sent together with the input clock (TSCLK) is captured by TSCLK. At this time, the data valid (TSVALID) sent simultaneously with TSDATA is referred to, and the data is taken in only when it is valid data. In addition, the capture unit can be selected in units of 1 byte or 1 bit.
MPEG2−TSパケットの先頭データである「47」コードを検索し、188バイト毎に「47」コードが存在することを確認し、同期捕捉を行う。 The “47” code which is the head data of the MPEG2-TS packet is searched, and it is confirmed that the “47” code exists every 188 bytes.
同期捕捉候補処理を高速化させるため、独立で動作する複数個のカウンタを搭載し、複数個の同期捕捉候補を扱う。いずれかの同期捕捉候補の同期捕捉が成立した段階で、他の同期捕捉候補をキャンセルする。 In order to speed up the synchronization acquisition candidate processing, a plurality of counters that operate independently are mounted to handle a plurality of synchronization acquisition candidates. When the synchronization acquisition of any one of the synchronization acquisition candidates is established, the other synchronization acquisition candidates are canceled.
同期捕捉が成立すると、MPEG2−TSパケットのデータを、先頭の「47」コードから順に、188バイトのメモリ1に格納し始める。
When synchronization acquisition is established, data of the MPEG2-TS packet starts to be stored in the 188-
188バイトのメモリ1は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
デスクランブル部6の後段にも片面188バイトの2面メモリ2を配備し、Sステージを構成している。
A two-
Sステージでは、以下の処理が行われる。 In the S stage, the following processing is performed.
IFステージの後段に設けられている188バイトの2面メモリ1のうち、書き込みが終了している面からMPEG2−TSデータを順次読み出す。
The MPEG2-TS data is sequentially read from the side where writing has been completed in the two-
スクランブル解除指定のPIDを持っているMPEG2−TSパケットであるか否かの判定を実施する。 It is determined whether the packet is an MPEG2-TS packet having a descrambling designation PID.
スクランブル解除指定のPIDを持っているMPEG2−TSパケットであった場合は、MPEG2−TSパケットのPayloadに対して、スクランブル解除処理を実施する。 In the case of an MPEG2-TS packet having a PID for descrambling designation, a descrambling process is performed on the payload of the MPEG2-TS packet.
1バイト単位に複数クロックかけてデスクランブル処理を行うことにより、188バイトのデータのスクランブル解除処理を行う。 By performing descrambling over a plurality of clocks in units of 1 byte, descrambling of 188 bytes of data is performed.
スクランブル解除されたデータを、MPEG2−TSの先頭バイトから、188バイトのメモリ2に格納し始める。
The descrambled data starts to be stored in the 188-
188バイトのメモリ2は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
デスクランブル処理対象外のMPEG2−TSデータである場合は、スクランブル解除処理を実施しないで、188バイトのメモリ2へ書き込む。例えば、TSパケットのヘッダ情報や、PIDで指定されていないMPEG2−TSパケットの場合は、スクランブル解除処理を実施しないで、188バイトのメモリ2へ書き込まれる。
In the case of MPEG2-TS data that is not subject to descrambling processing, the descrambling processing is not performed and the data is written into the 188-
デスクランブル処理対象外のデータは、デスクランブル処理対象のデータと同じレイテンシとする。換言すれば、MPEG2−TSデータのデスクランブル部6を通過する時間は、デスクランブル処理を実施した場合も実施しなかった場合も、いずれも同じ所要時間となる。
The data not subject to descrambling processing has the same latency as the data subject to descrambling processing. In other words, the time required for the MPEG2-TS data to pass through the
さらに、DEMUX部7の後段にも片面188バイトの2面メモリ3a〜3cを配備し、Dステージを構成している。
Further, a single-sided 188-byte two-
Dステージでは、以下の処理が行われる。 In the D stage, the following processing is performed.
デスクランブルステージの後段に設けられている188バイトの2面メモリ2のうち、書き込みが終了している面から、スクランブル解除されたMPEG2−TSデータを順次読み出す。
The scrambled MPEG2-TS data is sequentially read from the 188-byte two-
読み出したMPEG2−TSパケットデータのうち、TSヘッダ部と、もし存在すればアダプテーション領域の制御データを、TS解析用レジスタ7a1に順次セットする。 Among the read MPEG2-TS packet data, the TS header portion and, if present, the control data of the adaptation area are sequentially set in the TS analysis register 7a1.
この読み出しアドレスは、MPEG2−TSパケットの188バイトのうち、どのバイトを読み出しているかの識別に用いられる。 This read address is used to identify which one of the 188 bytes of the MPEG2-TS packet is being read.
DステージでのMPEG2−TS解析、抽出分離のベースは、上記188バイトの2面メモリ2からの読み出しアドレスと、上記TS解析用レジスタ7a1の値とを参照し、MPEG2−TSパケットのデータ構造の解析が進められる。
The base of MPEG2-TS analysis and extraction / separation at the D stage refers to the read address from the 188-byte two-
2面メモリ2からの読み出しアドレスが、PIDを読み出し終了時点まで進んだ段階で、抽出分離指定されているPIDであるかどうかの判定が行われる。
At the stage where the read address from the two-
このPID判定では、セクション系かPES系か、PES系である場合は、独立PES系か、オーディオ系か、ビデオ系かの判定が行われる。 In this PID determination, if it is a section system, a PES system, or a PES system, it is determined whether it is an independent PES system, an audio system, or a video system.
トランスポートスクランブルコントロール、アダプテーションフィールドコントロール、コンティニュティカウンター値を、TS解析用レジスタ7a1にセットする。 The transport scramble control, adaptation field control, and continuity counter value are set in the TS analysis register 7a1.
コンティニュティカウンター値とアダプテーションフィールドコントロール値とをチェックし、廃棄対象のペイロードを持ったMPEG2−TSパケットであるかどうかの判定と、アダプテーション領域の有無、ペイロードの有無が判断される。 The continuity counter value and the adaptation field control value are checked to determine whether the packet is an MPEG2-TS packet having a payload to be discarded, whether there is an adaptation area, and whether there is a payload.
次に、アダプテーションフィールドが存在する場合は、引き続きTS解析用レジスタ7a1にアダプテーション領域のデータをセットする。 Next, if there is an adaptation field, the data in the adaptation area is continuously set in the TS analysis register 7a1.
アダプテーション領域の先頭はアダプテーションレングスであり、このレングスをチェックして、その値が0でなければ、アダプテーションレングス値をアダプテーションレングスカウンタへセットし、ダウンカウントを開始する。アダプテーションレングスが0である場合は、次のバイトは、セクション系データの場合はポインタフィールドとなり、PES系データの場合はPESの先頭バイトであると判断する。 The beginning of the adaptation area is the adaptation length, and this length is checked. If the value is not 0, the adaptation length value is set in the adaptation length counter, and down-counting is started. When the adaptation length is 0, it is determined that the next byte is a pointer field in the case of section data, and the first byte of the PES in the case of PES data.
アダプテーションレングスが0でない場合は、次のバイトが、PCRフラグ(PCRを含んだMPEG2−TSパケットかどうかの識別子)とか、含んでいるPCRが不連続PCRであるかどうかの識別子であるディスコンティニュティインディケータを、TS解析用レジスタ7a1にセットする。 If the adaptation length is not 0, the next byte includes a PCR flag (identifier indicating whether the packet is an MPEG2-TS packet including PCR) or a discontinuity indicating whether the included PCR is a discontinuous PCR. The tee indicator is set in the TS analysis register 7a1.
PCRフラグで、PCRがあることが判明すれば、PCRの抽出を行う。この時、システムデコーダ100aの時計であるSTCへPCR値をロードするか否かは、PCRのロード制御レジスタ値によって制御される。
If the PCR flag indicates that there is a PCR, the PCR is extracted. At this time, whether or not to load the PCR value to the STC which is the clock of the
ディスコンティニュティインディケータがセットされていれば、MPEG2−TSパケットに含まれているPCRが、不連続PCRであると判断する。不連続PCRのSTCへのロード制御は、PCRのロード制御レジスタ値によって制御される。 If the discontinuity indicator is set, it is determined that the PCR included in the MPEG2-TS packet is a discontinuous PCR. The load control of the discontinuous PCR to the STC is controlled by the PCR load control register value.
不連続PCRのSTCへのロードは、SDRAM4に既に蓄えられているビデオES、オーディオESのタイムスタンプ値との関係が不連続になることも意味しているので、既に蓄えられているAVフレームデータ(ビデオES/オーディオES)に対応したタイムスタンプのValidビットを無効化する。ここで、このValidビットは、タイムスタンプ値が有効か無効かの識別に用いられる。有効な場合は、システムデコーダ100aからフレームデータを出力すべき時刻まで待たせる処理を行う時に、STCとの比較に用いるタイムスタンプ値として利用される。無効な場合は、出力すべき時刻まで待たせる処理は行われない。
The loading of the discontinuous PCR into the STC also means that the relationship with the time stamp values of the video ES and audio ES already stored in the
アダプテーションフィールドが終了すると、PIDフィルタリングの結果が、セクション系であるか、PES系であるかで、処理が分岐される。 When the adaptation field ends, the process branches depending on whether the PID filtering result is a section system or a PES system.
TSヘッダ部のユニットスタートインディケータがセットされている場合は、セクション系の場合はセクションの先頭データを含むため、ペイロードの前に1バイトのポインタフィールドがあると判断される。また、PES系の場合はペイロードの先頭からPESデータが格納されていると判断される。 When the unit start indicator of the TS header is set, it is determined that there is a 1-byte pointer field in front of the payload because the section head includes section start data. In the case of the PES system, it is determined that PES data is stored from the beginning of the payload.
セクション系の場合は、セクション解析用レジスタ7a2に、セクションヘッダ部がセットされる。 In the case of a section system, a section header part is set in the section analysis register 7a2.
セクションの先頭バイトはテーブルIDである。セクションのフィルタリングは、セクションヘッダ部が揃ってから実施されるが、テーブルIDでMPEG2−TSパケットが終了する場合もある。この場合は、PIDとテーブルIDとでのフィルタリングを実施し、継続フラグが立っているかどうかを確認した後、継続フラグがセットされていなければ、セクション用フィルタのどの番号のフィルタでMPEG2−TSパケットを跨いだセクションを受信したかを記憶しておくための継続フラグをセットする。 The first byte of the section is a table ID. Section filtering is performed after the section headers are aligned, but the MPEG2-TS packet may end with a table ID. In this case, filtering by PID and table ID is performed and it is confirmed whether or not the continuation flag is set. Sets a continuation flag for storing whether or not a section straddling has been received.
ここで、継続フラグは、全てのフィルタに対で装備される。 Here, the continuation flag is provided in pairs for all the filters.
継続フラグのクリアは、継続フラグがセットされているフィルタにヒットしたMPEG2−TSパケットに格納されている、TSヘッダ部のユニットスタートインディケータが1であった場合に実施する。このMPEG2−TSパケットで継続してきたセクションが終了し、新たなセクションが格納されていると判断し、継続フラグがクリアされる。 The continuation flag is cleared when the unit start indicator in the TS header portion stored in the MPEG2-TS packet that hits the filter for which the continuation flag is set is 1. The section continued in the MPEG2-TS packet ends, and it is determined that a new section is stored, and the continuation flag is cleared.
ここで、MPEG2−TSパケットが、セクションヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、セクション解析用レジスタ7a2は、レジスタセットとしてセクションフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the section header portion, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the section analysis register 7a2 is a section filter as a register set. Installed for a few minutes.
PES系の場合、PES解析用レジスタ7a3に、PESヘッダ部がセットされる。 In the case of the PES system, the PES header portion is set in the PES analysis register 7a3.
PESヘッダの先頭は、パケットスタートコードプリフィックスの固定コード「000001」となっている。PESヘッダの先頭から8バイト目がPTSDTSフラグ(PTS,DTSであるタイムスタンプを含んでいるか否かの識別子)であり、タイムスタンプを含んでいる場合は、抽出を行う予定とされる。 The head of the PES header is a fixed code “000001” of the packet start code prefix. The 8th byte from the beginning of the PES header is a PTSDTS flag (an identifier indicating whether or not a time stamp that is PTS or DTS is included). If the time stamp is included, extraction is scheduled to be performed.
次のバイトがPESヘッダ長であり、PESヘッダ長の値が0でない場合は、PESヘッダ長ダウンカウンタに値がセットされ、ダウンカウントが行われる。 When the next byte is the PES header length and the value of the PES header length is not 0, a value is set in the PES header length down counter, and down counting is performed.
PESヘッダ長のダウンカウントが終了した時点に、ESデータの先頭バイトが存在する。 At the time when the PES header length down-count is completed, the first byte of the ES data exists.
ESデータの抽出では、このPESヘッダ部の削除処理を実施することで、ES抽出が実現される。 In the extraction of ES data, the ES extraction is realized by performing the deletion process of the PES header part.
MPEG2−TSパケットが、PESヘッダ部の途中で終了した場合は、PESヘッダ部のどのバイトから再開すればよいかは、PESヘッダ長のダウンカウンタ値と、継続フラグとによって判別されることとなる。 When the MPEG2-TS packet ends in the middle of the PES header part, it is determined from the PES header length down counter value and the continuation flag which byte of the PES header part should be resumed. .
ここで、MPEG2−TSパケットが、PESヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、PESヘッダ解析用レジスタ7a3は、レジスタセットとして、PID設定できるPESフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the PES header part, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the PES header analysis register 7a3 is a register set. There are as many PES filters as PID setting.
セクション系、PES系いずれの場合も、188バイトのメモリ2からの読み出しアドレスで、MPEG2−TSパケットのどのバイトを処理しているか、MPEG2−TSの終了を認識し、継続フラグをセットするか否かの判定が行われる。
Whether the section system or the PES system is used, the 188-byte read address from the
その後、MediaI/F部8からSDRAM4への書き込みが、SDRAM書き込みステージ(Wステージ)となる。
Thereafter, the writing from the Media I /
Wステージでは、以下の処理が行われる。 In the W stage, the following processing is performed.
Dステージの後段に設けられている188バイトの2面メモリ3a〜3cのうち、書き込みが終了している面のデータが、SDRAM4へ書き込まれる。
Of the two-
書き込み単位は、セクション、PES、ESいずれも、MPEG2−TSパケットの188バイトから抽出分離したデータ単位となる。ここで、セクションの場合は、13バイトのものもあり、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、14個となる。PES系の場合、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、1個となる。これは、PES系の場合は一つのMPEG2−TSパケットに複数個のPESパケットが格納されていることがないためである。 The writing unit is a data unit extracted and separated from 188 bytes of the MPEG2-TS packet for all sections, PES, and ES. Here, some sections have 13 bytes, and the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is 14. In the case of the PES system, the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is one. This is because in the case of the PES system, a plurality of PES packets are not stored in one MPEG2-TS packet.
Wステージの期間内に、SDRAM4への書き込みが終了しない場合は、188バイトの2面メモリ3a〜3cが破綻するので、バスエラー割り込みが発生される。
If the writing to the
これら各ステージに存在する2面メモリ1,2,3a〜3cで、TSパケット単位(188バイト単位)のパイプライン動作が区切られている。以上が、システムデコーダ100aの前半処理部となる。システムデコーダ100aの前半処理部の4段パイプライン動作は、図2に示した通りである。
Pipeline operations in units of TS packets (in units of 188 bytes) are divided by the two-
(3)システムデコーダ100aの後半処理部
図8は、システムデコーダ100aの後半処理部の基本構成を示すブロック図である。システムデコーダ100aの後半処理部では、SDRAM4に書き込まれたデータが読み出され、AV同期をとって、システムデコーダ100aから出力される。ここで、SDRAM4からの読み出し以降の処理は、TSパケット単位のパイプライン動作とは無関係に動作する。
(3) Second Half Processing Unit of
(4)Demux処理
(4−1)DEMUX部7の構成
以下、主にPESデコーダからES抽出処理を含めたDemux処理について説明する。ここでは、DEMUX部7のDステージの動作説明を行う。Dステージには、PIDフィルタ動作部7b、TS解析部7a、Section解析部7a2、PES解析部7a3、及び分離結果を一時記憶しておくためのSRAM部3a〜3cがある。図9は、Dステージ及びWステージの動作を示すタイミングチャートである。
(4) Demux Processing (4-1) Configuration of
(4−2)DEMUX部7の処理
デスクランブル部6の後段に接続されている2面メモリ2から、TSパケットデータが1パケット分(0バイト目から187バイト目まで)読み出される。この読み出しのアドレスで、TSパケットの先頭から何番目のデータであるかが識別される。このTSパケットは、読み出しアドレス値に応じて、TS解析部7aに設けられているレジスタ7a1に格納される。TS解析部7aで格納対象とされているTSデータは、TSヘッダ部のデータと、アダプテーションに相当するデータの一部、及び、セクションの場合はポインタフィールドが保持される。
(4-2) Processing of
ここで、TS解析部7aのレジスタ7a1にPIDまでの情報が書き込まれた段階で、TSパケットの種別の大分類(セクションか、ビデオか、オーディオか、独立PESか)が行われる。この結果によって、セクション系かPES系(ビデオ、オーディオ、独立PES)かの識別が可能である。この結果を利用して、セクション解析部のレジスタ7a2を用いるのか、PES解析部のレジスタ7a3を用いるのかが判断される。
Here, when the information up to the PID is written in the register 7a1 of the
PES系であった場合、このPES解析部のレジスタ7a3に、PESヘッダに対応する情報のうち必要な部分(PES先頭から13バイトで、PESヘッダ長を含む)のみが格納される。ここで、アダプテーションのサイズによっては、PESのヘッダがTSパケットの単位(188バイト)よりも大きい場合があり得る。従って、PESデコードを行うフィルタ数分のレジスタ7a3が搭載されており、各レジスタ7a3は、書き込んだ位置を把握できるPESヘッダライトポインタを有している。TSパケットを跨いだ場合は、このPESヘッダライトポインタが停止される。ここで、TSパケットが終了するまでにPESヘッダ長のダウンカウンタ値が終了しなかった場合には、PESヘッダ部でTSパケットを跨ったことになる。一方、TSパケットが終了するまでにPESヘッダ長のダウンカウンタが終了した場合には、PESヘッダ部以降でTSパケットを跨いだことになる。PESヘッダ長のダウンカウンタ終了時点で、PESヘッダライトポインタはクリアされる。継続して受信再開する場合の動作は、PIDでのフィルタヒット判定と、PID別で管理しているPESヘッダライトポインタとを参照することで、PESヘッダの情報抽出を再開可能となる。なお、PESはPIDのみでフィルタリングが可能なため、特に継続フラグは必要ない。 In the case of the PES system, only the necessary portion (13 bytes from the beginning of the PES and including the PES header length) of the information corresponding to the PES header is stored in the register 7a3 of the PES analysis unit. Here, depending on the size of the adaptation, the PES header may be larger than the TS packet unit (188 bytes). Therefore, registers 7a3 corresponding to the number of filters for performing PES decoding are mounted, and each register 7a3 has a PES header write pointer that can grasp the written position. When straddling TS packets, this PES header write pointer is stopped. Here, when the down counter value of the PES header length does not end by the end of the TS packet, the TS packet is straddled by the PES header portion. On the other hand, when the PES header length down counter is completed before the TS packet is completed, the TS packet is straddled after the PES header part. At the end of the PES header length down counter, the PES header write pointer is cleared. In the case of continuous reception restart, the PES header information extraction can be restarted by referring to the filter hit determination by PID and the PES header write pointer managed for each PID. Since PES can be filtered only by PID, no continuation flag is required.
セクション系であった場合、セクション解析部のレジスタ7a2に、セクションヘッダに対応する情報のうち必要な部分(セクションの先頭から6バイト分。但しセクション長にも依存する)のみが格納される。ここで、アダプテーションのサイズに依存して、セクションヘッダ部に相当するデータをセクション解析部のレジスタ7a2に格納終了する前に、TSパケットが終了してしまうことがあり得る。そのため、セクション解析部でも、セクションヘッダをどこまで書き込んだかを把握できるように、セクションヘッダライトポインタを各々持つとともに、フィルタ番号毎に継続フラグが設けられている。セクションヘッダライトポインタ値と継続フラグとを参照することで、TSパケットを跨いだ後、暫くして後続のセクション部のデータを受信した場合であっても、セクションヘッダの情報抽出を再開可能となる。 In the case of a section system, only the necessary portion (for 6 bytes from the beginning of the section, depending on the section length) of the information corresponding to the section header is stored in the register 7a2 of the section analysis section. Here, depending on the size of the adaptation, the TS packet may end before the data corresponding to the section header section is stored in the register 7a2 of the section analysis section. For this reason, each section analysis unit has a section header write pointer and a continuation flag for each filter number so that the section analysis unit can grasp how much the section header has been written. By referring to the section header write pointer value and the continuation flag, the section header information extraction can be resumed even if the data of the subsequent section is received for a while after straddling the TS packet. .
次に、TSパケット単位を超えた場合の処理について説明する。 Next, processing when the TS packet unit is exceeded will be described.
セクション系の場合、受信したセクションデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、(a)セクションヘッダ部をセクション解析部のレジスタ7a2に格納終了できたかどうかの判断と、(b)セクションヘッダ部に存在するセクション長情報により、TSパケット終了時点(188バイト目)で、セクション長のダウンカウントが終了しているかどうかとの判断とによって行われる。TSパケットに納まっていないと判断された場合は、フィルタにヒットしている番号の継続フラグをセットするとともに、セクション長のダウンカウンタ値をクリアする。 In the case of the section system, the determination as to whether the received section data is data that can be contained in the TS packet or not can be made as follows: The determination is made based on the determination and (b) whether or not the section length down-count is completed at the end of the TS packet (at the 188th byte) based on the section length information existing in the section header section. If it is determined that it is not contained in the TS packet, the continuation flag of the number hitting the filter is set and the section length down counter value is cleared.
なお、継続フラグのクリアは、同一フィルタにヒットしたTSパケットの、TSヘッダ情報部にあるunit_start_indicatorの値が1である場合、このTSパケットで、継続してきたセクションが終了するとともに、新たなセクションが格納されていると判断する。ここで、新たなセクションの開始位置は、pointer_fieldで示される。 In addition, when the value of unit_start_indicator in the TS header information part of the TS packet that hits the same filter is 1, the continuation flag is cleared. Judge that stored. Here, the start position of the new section is indicated by pointer_field.
PES系の場合、受信したPESデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、PESヘッダ部についてのみ実施される。 In the case of the PES system, the determination as to whether the received PES data is data that fits in the TS packet or data that does not fit is performed only for the PES header part.
PESヘッダライトポインタ(PESヘッダをどこまでPES解析部のレジスタ7a3に格納できたかを示すポインタ。PESヘッダ長による終了で、PESヘッダ終了と判断される。)が終了していない状態で、TSパケットが終了(188バイト目)した場合、PESヘッダがTSパケットを跨ったと判断し、フィルタにヒットしている番号の継続フラグがセットされる。この継続フラグは、PES解析部で複数セット設けられているレジスタセットのうちのどのレジスタセットかを識別するのに用いられる。 In a state where the PES header write pointer (pointer indicating how far the PES header has been stored in the register 7a3 of the PES analysis unit. It is determined that the PES header has ended due to the end of the PES header length) has not ended. When the process ends (at the 188th byte), it is determined that the PES header has straddled the TS packet, and the continuation flag of the number hitting the filter is set. This continuation flag is used to identify which register set of a plurality of register sets provided in the PES analysis unit.
PESヘッダ解析部が持っている継続フラグは、PESヘッダ部をPES解析部のレジスタ7a3に格納終了すると、クリアされる。 The continuation flag possessed by the PES header analysis unit is cleared when the PES header unit is stored in the register 7a3 of the PES analysis unit.
PESヘッダ部以降のPESデータ自体は、PIDのみで分離識別可能であるため、PESの長さ情報は参照されない。その代わり、TSパケットヘッダ部にあるunit_start_indicatorでPESの先頭を識別し、PESデータの先頭から分離抽出が行われる。 Since the PES data itself after the PES header part can be separated and identified only by the PID, the PES length information is not referred to. Instead, the beginning of the PES is identified by unit_start_indicator in the TS packet header portion, and separation and extraction are performed from the beginning of the PES data.
セクション解析用レジスタ7a2周辺のブロック図を図10に示し、PES解析用レジスタ7a3周辺のブロック図を図11に示す。TSデータの解析から、セクションの分離(先頭セクションの抽出)までの動作は、図12に示したタイミングチャートの通りである。TSデータの解析から、マルチセクションの抽出分離動作は、図13に示したタイミングチャートの通りである。TSデータの解析から、セクションの分離抽出時、セクションヘッダ部においてTSパケット(188バイト)が終了した場合の動作は、図14に示したタイミングチャートの通りである。TSデータの解析から、セクションの分離抽出時、セクションの途中でTSパケット(188バイト)が終了した場合の動作は、図15に示したタイミングチャートの通りである。TSデータの解析から、ポインタフィールドで示されるデータより手前のデータの抽出分離動作は、図16に示したタイミングチャートの通りである。セクションの抽出時、ポインタフィールドがない場合の動作は、図17に示したタイミングチャートの通りである。セクションを含むMPEG2−TSの例を図18に示し、PESヘッダ部の例を図19に示す。 A block diagram around the section analysis register 7a2 is shown in FIG. 10, and a block diagram around the PES analysis register 7a3 is shown in FIG. The operations from TS data analysis to section separation (leading section extraction) are as shown in the timing chart of FIG. From the analysis of TS data, the multi-section extraction / separation operation is as shown in the timing chart of FIG. From the analysis of the TS data, the operation when the TS packet (188 bytes) ends in the section header at the time of section separation and extraction is as shown in the timing chart of FIG. From the analysis of TS data, the operation when the TS packet (188 bytes) ends in the middle of a section during section separation and extraction is as shown in the timing chart of FIG. From the analysis of the TS data, the data extraction / separation operation before the data indicated by the pointer field is as shown in the timing chart of FIG. The operation when there is no pointer field when extracting a section is as shown in the timing chart of FIG. An example of MPEG2-TS including a section is shown in FIG. 18, and an example of a PES header part is shown in FIG.
以下、抽出分離結果を一時保持するためのSRAM(2面メモリ)3a〜3cについて説明する。 Hereinafter, SRAMs (two-plane memories) 3a to 3c for temporarily holding the extraction / separation results will be described.
188バイトの塊であるTSパケットから必要なデータがフィルタリングされ、分離抽出対象と判断されたデータが、SRAM3a〜3cに格納される。図7には、セクション/独立PES系に対して2面SRAM(188バイトのメモリ×2個)3a、オーディオ系に対して2面SRAM(188バイトのメモリ×2個)3b、ビデオ系に対して2面SRAM(188バイトのメモリ×2個)3cが設けられた構成が示されているが、後述の実施の形態3で説明する通り、本質的には188バイトのSRAMが2個あれば十分である。
Necessary data is filtered from the TS packet which is a lump of 188 bytes, and data determined to be separated and extracted are stored in the
次に、TSデータから、セクション、オーディオES、ビデオES、独立PES1、及び独立PES2に分離したデータを、Dステージに設けられているSRAM3a〜3cに一時格納する管理部9について説明する。
Next, the
管理部9で扱う情報及び機能を、下記に列挙する。
Information and functions handled by the
・フィルタ番号(SDRAM4格納先領域識別番号:マルチセクション時はセクション別に管理)
・SRAM3a〜3cへのデータ書き込みをカウントし、SRAM3a〜3cで一時保持する総バイト数(マルチセクション時はセクション別に管理)
・PES/ESの先頭データを含むTSデータであったかどうかの情報(PES/ESの先頭の場合、PTS/DTS抽出とともに、SDRAM4格納時に、PES/ESの先頭バイトを格納したアドレスを記憶するために、後々使用されることになる)
・PTS/DTSの情報をTS解析部7aから受け取る。
-Filter number (SDRAM4 storage area identification number: managed by section when multi-section)
-Count the number of data writes to
Information on whether or not the TS data includes the head data of PES / ES (in the case of the head of PES / ES, in order to store the address storing the head byte of PES / ES when SDRAM4 is stored together with PTS / DTS extraction) Will be used later)
Receives PTS / DTS information from the
・SRAM3a〜3cからSDRAM4への転送時、PES/ESの先頭バイトを格納したアドレスとセットで、PTS/DTS情報及びフレーム番号を管理する。
When transferring from the
・TS解析入力部のSRAM2から読み出したデータを、直接DEMUX出力部のSRAM3a〜3cへ書き込み開始できるタイミングを知らせるタイミング情報を、セクション解析部7a2及びPES解析部7a3から受け取る。
Timing information notifying the timing at which data read from the
・TS解析入力部のSRAM2のTSデータ読み出しカウンタ値を受け取る(DEMUX出力部SRAM3a〜3cは2面あるが、この面切り換えの管理に使用される)。
The TS data reading counter value of the
次に、Dステージの後段に接続されている2面メモリ3a〜3cの動作について説明する。
Next, the operation of the two-
(イ)セクションのヘッダ部(識別情報部)データのSRAM3aへの書き込み
セクションヘッダ部のデータは、セクション解析部に設けられているレジスタ7a2に積み上げられている。これらのデータは、図12に示したタイミングチャートの最下段の信号で示す期間の間に、セクション/PES系共用のSRAM3aに書き込まれる。
(A) Writing section header (identification information) data to
この際、SRAM管理部9では、確定したフィルタ番号を用いて、SDRAM4への格納領域を識別するとともに、SDRAM4への書き込みに使用するライトポインタ(セクション用には32本あるが、基本的にはこのうちの1本を使用する。推定ヒット動作時は、複数領域への書き込みとなるため、複数本のライトポインタを使用するケースも存在する)を特定する。
At this time, the
(ロ)セクション本体データのSRAM3aへの書き込み
図12のタイミングチャートに示すように、セクションのヘッダ部情報を格納しているDFFからSRAM3aへのデータ転送が終了すると、続けてTS解析入力部のSRAM2から読み出したデータを、DEMUX出力部のSRAM3a〜3cへ直接転送する。
(B) Writing of section body data to
(ハ)独立PESのSRAM3aへの書き込み
TSヘッダのみ削除し、PESの先頭か、PESの途中かを、payload_unit_start_indicatorで確認し、PESの先頭からSRAM3aへの書き込みを行う。TSを跨るケースもあるので、セクションのTS跨ぎ処理と同様に、継続フラグを用いて、継続フラグがセットされていれば、PESの途中データとしてSRAM3aへ格納する(SDRAM4上では、切れ目の無い連続データとして書き込まれることとなる)。
(C) Writing to the
(ニ)オーディオPESのSRAM3bへの書き込み
TSヘッダのみ削除し、PESの先頭か、PESの途中かを、payload_unit_start_indicatorで確認し、PESの先頭からSRAM3bへの書き込みを行う。TSを跨るケースもあるので、セクションのTS跨ぎ処理と同様に、継続フラグを用いて、継続フラグがセットされていれば、PESの途中データとしてSRAM3bへ格納する(SDRAM4上では、切れ目の無い連続データとして書き込まれることとなる)。
(D) Writing of audio PES to
また、PESの先頭である場合は、対応するPTS/DTS、PES先頭バイトの書き込み先アドレス、及びフレーム番号も同時に保持する。このデータ(PTS/DTS/アドレス、フレーム番号)の保存先には、AV同期制御用SRAM10(図8参照)が使用される。 If it is at the head of the PES, the corresponding PTS / DTS, the write destination address of the PES head byte, and the frame number are simultaneously held. As a storage destination of this data (PTS / DTS / address, frame number), an AV synchronization control SRAM 10 (see FIG. 8) is used.
(ホ)ビデオESのSRAM3cへの書き込み
TSヘッダとPESヘッダとを削除し、ESの先頭か、ESの途中かを、payload_unit_start_indicatorで確認し、ESの先頭からSRAM3cへの書き込みを行う。TSを跨るケースもあるので、セクションのTS跨ぎ処理と同様に、継続フラグを用いて、継続フラグがセットされていれば、ESの途中データとしてSRAM3cへ格納する(SDRAM4上では、切れ目の無い連続データとして書き込まれることとなる)。
(E) Writing to the
また、ESの先頭である場合は、対応するPTS/DTS、ES先頭バイトの書き込み先アドレス、及びフレーム番号も同時に保持する。このデータ(PTS/DTS/アドレス、フレーム番号)の保存先には、AV同期制御用SRAM10(図8参照)が使用される。 If it is the head of the ES, the corresponding PTS / DTS, the write destination address of the ES head byte, and the frame number are simultaneously held. As a storage destination of this data (PTS / DTS / address, frame number), an AV synchronization control SRAM 10 (see FIG. 8) is used.
(5)Wステージの処理
Wステージでは、Dステージの最終段にある188バイトの2面メモリ3a〜3cからSDRAM4へのデータの転送及び書き込みが行われる。Wステージも、1TSパケット期間のステージとなる。SRAM3a〜3cからSDRAM4へ書き込まれるデータには、セクション、独立PES、オーディオPES、及びビデオESがある。
(5) Processing of W stage In the W stage, data is transferred and written to the
セクションの書き込みでは、SDRAM4の複数領域への書き込みが発生する場合がある。マルチセクションにおいては、1TSパケット内に複数個の異なるセクションが格納されている場合があり、この場合はSDRAM4への書き込み領域がセクションごとに異なるためである。
In section writing, writing to a plurality of areas of the
独立PES、オーディオPES、及びビデオESの場合は、1TSパケット期間単位の動作において、SDRAM4への書き込み領域が異なる事態は発生しない。
In the case of an independent PES, an audio PES, and a video ES, a situation in which the write area to the
SDRAM4への書き込み制御(Storeトランザクション発行処理)で扱う情報及び機能を下記に列挙する。 Information and functions handled in the write control to the SDRAM 4 (Store transaction issuance process) are listed below.
・2面あるDEMUX出力SRAM3a〜3cのうち、SDRAM4転送側の面の確認を行う。
Of the two
・記憶されているフィルタ番号(SDRAM4格納先領域識別番号:マルチセクション時はセクション別に管理)を用いて、使用すべき書き込みライトポインタを特定する。
A write write pointer to be used is specified using the stored filter number (
・PES/ESの先頭の場合、PTS/DTS抽出結果をAV同期制御SRAM10a(図8参照)へ格納するとともに、PES/ESの先頭バイトを格納したアドレスを、AV同期制御用SRAM10aに書き込む。この際、アドレスは、PTS/DTSと同じアドレスで管理しているAV同期制御用SRAM10bに書き込む。さらに、この際、フレーム番号なる識別番号を、DEMUX部7が独自に番号付けし、0から63までの識別を行う。
In the case of the head of PES / ES, the PTS / DTS extraction result is stored in the AV
・フレーム番号は、PES単位(ES単位)と対応した意味を持っている。ここでは、1フレームは1PESパケットデータに対応していることと解釈する。換言すれば、1フレームは1ESデータにも対応していることとなる。 The frame number has a meaning corresponding to the PES unit (ES unit). Here, it is interpreted that one frame corresponds to one PES packet data. In other words, one frame corresponds to 1 ES data.
・フレーム番号を用いて、SDRAM4に格納しているオーディオPES、ビデオESの管理を行う。
Management of audio PES and video ES stored in the
・フレーム番号は、オーディオPESで64種類、ビデオESで64種類であり、合計で128種類の識別が可能である。 There are 64 types of frame numbers for audio PES and 64 types for video ES, and a total of 128 types can be identified.
・フレーム番号、PTS/DTS、PES/ES先頭アドレスの一時記憶方法については、図8に示す通りである。 The method for temporarily storing the frame number, PTS / DTS, and PES / ES head address is as shown in FIG.
・SRAM3a〜3cに一時保持しているES/PES/セクションデータの総バイト数(マルチセクション時にはセクション別のバイト総数)を、トランザクションへ変換する。ここでは、DTV−S対応としてサポートされている範囲のトランザクションを用いることとする。このため、使用するStore系トランザクションは、8バイトと、バイトイネーブルを用いたトランザクションへの変換とする。1バイトの転送には、8バイトのトランザクションとバイトイネーブルとを用いることとする。
The total number of bytes of ES / PES / section data temporarily stored in the
・8バイトのライト動作は、8バイト境界に合わせて(アラインして)、トランザクションを発行する。 -An 8-byte write operation issues a transaction in alignment (aligned) with an 8-byte boundary.
・TS入力部位の2面メモリ2の動作に合わせて、TSパケット単位での、DEMUX出力2面メモリ3a〜3cの面切り替えを行う。面の切り替え動作は、概ね40μsec(1TSパケットの受信レート)のスピードで切り替えになる。SDRAM4へのライト動作は、この40μsec単位(2面メモリ3a〜3cの切り替え単位)に合わせて完了する必要がある。この期間内にライト動作が完了しない場合には、DEMUX動作として連続データを保証できないので、バスエラー割り込みを発生させる。
In accordance with the operation of the two-
・SDRAM4への書き込み開始タイミングは、2面メモリ3a〜3cの切り替えタイミング(TS入力部のSRAM2からの読み出しカウンタの、TS0のタイミング)から、トランザクション生成準備が完了するタイミングで、SDRAM4への書き込み処理を開始する(換言すればStoreトランザクションを発行する)。
The write start timing to the
・TS解析入力部SRAM2のTSデータ読み出しカウンタ値を受け取る。DEMUX出力部SRAM3a〜3cは2面あるが、この面切り替え管理に使用される。
The TS analysis input unit SRAM2 receives the TS data read counter value. The DEMUX
以上により、PESデータからPESヘッダ部を削除した後のESデータを抽出してSDRAM4に蓄えることができ、時刻管理を行いながらSDRAM4から必要なデータを読み出して、後段のビデオデコーダやオーディオデコーダにESを提供できるシステムデコーダ100aを構成することができる。
As described above, the ES data after the PES header portion is deleted from the PES data can be extracted and stored in the
本実施の形態1に係るシステムデコーダ100aによると、TSパケット単位で処理が完結するパイプライン動作が可能であるため、PESデコーダ専用の大規模なメモリが不要となる。そのため、オンチップ又はオフチップでPESデコード用メモリを構成した場合と比較して、チップ製造コストを低減できる効果がある。また、PESデコーダ専用の大規模メモリが不要となるため、このメモリへのアクセスが削減できる。そのため、外部バスの帯域を他のアクセスへ割り振ることが可能となる。例えば、CPUがSDRAM4をワークメモリとして用いるためのアクセス帯域として割り振ることも可能となる。しかも、外部メモリアクセスが低減したので、外部アクセス周波数を下げることが可能となって消費電力が低減されるとともに、外部ピン数を削減できるためチップ製造コストを低減できる。
According to the
実施の形態2.
(1)システムデコーダ100bの基本構成
図20は、本発明の実施の形態2に係るシステムデコーダ100bの前半処理部の構成を示すブロック図である。図20に示すように、システムデコーダ100bの前半処理部は、MPEG2−TS入力を受けて188バイトの同期をとるTS−IF部5と、TS−IF部5の出力を受けてDemux処理を行うDEMUX部7と、DEMUX部7から出力されたデータをSDRAM4に書き込むMediaI/F部8とを備えて構成されている。MediaI/F部8は、書き込み部8aとMediaBusI/F部8bとを有している。つまり、図7に示した上記実施の形態1に係るシステムデコーダ100aから、デスクランブル部6を省略したものが、本実施の形態2に係るシステムデコーダ100bに相当する。
(1) Basic Configuration of
まず、システムデコーダ100bにおけるTSパケット単位でのパイプライン構成を説明し、その後、PESデコーダまで含めたDemux処理を可能としているアーキテクチャについて説明する。
First, a pipeline configuration in units of TS packets in the
(2)システムデコーダ100bのパイプライン構成
システムデコーダ100bのTSパケット単位でのパイプライン動作としては、TS−IF部5の後段に片面188バイトの2面メモリ1を配備し、IFステージを構成している。
(2) Pipeline configuration of
IFステージでは、以下の処理が行われる。 In the IF stage, the following processing is performed.
入力クロック(TSCLK)と共に送られてくるMPEG2−TSデータ(TSDATA)を、TSCLKで取り込む。この際、TSDATAと同時に送られてくるデータバリッド(TSVALID)を参照し、有効なデータである場合にのみ取り込みを行う。また、取り込み単位は、1バイト単位又は1ビット単位となり、選択が可能である。 MPEG2-TS data (TSDATA) sent together with the input clock (TSCLK) is captured by TSCLK. At this time, the data valid (TSVALID) sent simultaneously with TSDATA is referred to, and the data is taken in only when it is valid data. In addition, the capture unit can be selected in units of 1 byte or 1 bit.
MPEG2−TSパケットの先頭データである「47」コードを検索し、188バイト毎に「47」コードが存在することを確認し、同期捕捉を行う。 The “47” code which is the head data of the MPEG2-TS packet is searched, and it is confirmed that the “47” code exists every 188 bytes.
同期捕捉候補処理を高速化させるため、独立で動作する複数個のカウンタを搭載し、複数個の同期捕捉候補を扱う。いずれかの同期捕捉候補の同期捕捉が成立した段階で、他の同期捕捉候補をキャンセルする。 In order to speed up the synchronization acquisition candidate processing, a plurality of counters that operate independently are mounted to handle a plurality of synchronization acquisition candidates. When the synchronization acquisition of any one of the synchronization acquisition candidates is established, the other synchronization acquisition candidates are canceled.
同期捕捉が成立すると、MPEG2−TSパケットのデータを、先頭の「47」コードから順に、188バイトのメモリ1に格納し始める。
When synchronization acquisition is established, data of the MPEG2-TS packet starts to be stored in the 188-
188バイトのメモリ1は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
DEMUX部7の後段にも片面188バイトの2面メモリ3a〜3cを配備し、Dステージを構成している。
Two-
Dステージでは、以下の処理が行われる。 In the D stage, the following processing is performed.
IFステージの後段に設けられている188バイトの2面メモリ1のうち、書き込みが終了している面から、MPEG2−TSデータを順次読み出す。
The MPEG2-TS data is sequentially read from the side where writing has been completed in the two-
読み出したMPEG2−TSパケットデータのうち、TSヘッダ部と、もし存在すればアダプテーション領域の制御データを、TS解析用レジスタ7a1に順次セットする。 Among the read MPEG2-TS packet data, the TS header portion and, if present, the control data of the adaptation area are sequentially set in the TS analysis register 7a1.
この読み出しアドレスは、MPEG2−TSパケットの188バイトのうち、どのバイトを読み出しているかの識別に用いられる。 This read address is used to identify which one of the 188 bytes of the MPEG2-TS packet is being read.
DステージでのMPEG2−TS解析、抽出分離のベースは、上記188バイトの2面メモリ1からの読み出しアドレスと、上記TS解析用レジスタ7a1の値とを参照し、MPEG2−TSパケットのデータ構造の解析が進められる。
The base of MPEG2-TS analysis and extraction / separation in the D stage refers to the read address from the 188-byte two-
2面メモリ1からの読み出しアドレスが、PIDを読み出し終了時点まで進んだ段階で、抽出分離指定されているPIDであるかどうかの判定が行われる。
At the stage where the read address from the two-
このPID判定では、セクション系かPES系か、PES系である場合は、独立PES系か、オーディオ系か、ビデオ系かの判定が行われる。 In this PID determination, if it is a section system, a PES system, or a PES system, it is determined whether it is an independent PES system, an audio system, or a video system.
トランスポートスクランブルコントロール、アダプテーションフィールドコントロール、コンティニュティカウンター値を、TS解析用レジスタ7a1にセットする。 The transport scramble control, adaptation field control, and continuity counter value are set in the TS analysis register 7a1.
コンティニュティカウンター値とアダプテーションフィールドコントロール値とをチェックし、廃棄対象のペイロードを持ったMPEG2−TSパケットであるかどうかの判定と、アダプテーション領域の有無、ペイロードの有無が判断される。 The continuity counter value and the adaptation field control value are checked to determine whether the packet is an MPEG2-TS packet having a payload to be discarded, whether there is an adaptation area, and whether there is a payload.
次に、アダプテーションフィールドが存在する場合は、引き続きTS解析用レジスタ7a1にアダプテーション領域のデータをセットする。 Next, if there is an adaptation field, the data in the adaptation area is continuously set in the TS analysis register 7a1.
アダプテーション領域の先頭はアダプテーションレングスであり、このレングスをチェックして、その値が0でなければ、アダプテーションレングス値をアダプテーションレングスカウンタへセットし、ダウンカウントを開始する。アダプテーションレングスが0である場合は、次のバイトは、セクション系データの場合はポインタフィールドとなり、PES系データの場合はPESの先頭バイトであると判断する。 The beginning of the adaptation area is the adaptation length, and this length is checked. If the value is not 0, the adaptation length value is set in the adaptation length counter, and down-counting is started. When the adaptation length is 0, it is determined that the next byte is a pointer field in the case of section data, and the first byte of the PES in the case of PES data.
アダプテーションレングスが0でない場合は、次のバイトが、PCRフラグ(PCRを含んだMPEG2−TSパケットかどうかの識別子)とか、含んでいるPCRが不連続PCRであるかどうかの識別子であるディスコンティニュティインディケータを、TS解析用レジスタ7a1にセットする。 If the adaptation length is not 0, the next byte includes a PCR flag (identifier indicating whether the packet is an MPEG2-TS packet including PCR) or a discontinuity indicating whether the included PCR is a discontinuous PCR. The tee indicator is set in the TS analysis register 7a1.
PCRフラグで、PCRがあることが判明すれば、PCRの抽出を行う。この時、システムデコーダ100bの時計であるSTCへPCR値をロードするか否かは、PCRのロード制御レジスタ値によって制御される。
If the PCR flag indicates that there is a PCR, the PCR is extracted. At this time, whether or not to load the PCR value to the STC which is the clock of the
ディスコンティニュティインディケータがセットされていれば、MPEG2−TSパケットに含まれているPCRが、不連続PCRであると判断する。不連続PCRのSTCへのロード制御は、PCRのロード制御レジスタ値によって制御される。 If the discontinuity indicator is set, it is determined that the PCR included in the MPEG2-TS packet is a discontinuous PCR. The load control of the discontinuous PCR to the STC is controlled by the PCR load control register value.
不連続PCRのSTCへのロードは、SDRAM4に既に蓄えられているビデオES、オーディオESのタイムスタンプ値との関係が不連続になることも意味しているので、既に蓄えられているAVフレームデータ(ビデオES/オーディオES)に対応したタイムスタンプのValidビットを無効化する。ここで、このValidビットは、タイムスタンプ値が有効か無効かの識別に用いられる。有効な場合は、システムデコーダ100bからフレームデータを出力すべき時刻まで待たせる処理を行う時に、STCとの比較に用いるタイムスタンプ値として利用される。無効な場合は、出力すべき時刻まで待たせる処理は行われない。
The loading of the discontinuous PCR into the STC also means that the relationship with the time stamp values of the video ES and audio ES already stored in the
アダプテーションフィールドが終了すると、PIDフィルタリングの結果が、セクション系であるか、PES系であるかで、処理が分岐される。 When the adaptation field ends, the process branches depending on whether the PID filtering result is a section system or a PES system.
TSヘッダ部のユニットスタートインディケータがセットされている場合は、セクション系の場合はセクションの先頭データを含むため、ペイロードの前に1バイトのポインタフィールドがあると判断される。また、PES系の場合はペイロードの先頭からPESデータが格納されていると判断される。 When the unit start indicator of the TS header is set, it is determined that there is a 1-byte pointer field in front of the payload because the section head includes section start data. In the case of the PES system, it is determined that PES data is stored from the beginning of the payload.
セクション系の場合は、セクション解析用レジスタ7a2に、セクションヘッダ部がセットされる。 In the case of a section system, a section header part is set in the section analysis register 7a2.
セクションの先頭バイトはテーブルIDである。セクションのフィルタリングは、セクションヘッダ部が揃ってから実施されるが、テーブルIDでMPEG2−TSパケットが終了する場合もある。この場合は、PIDとテーブルIDとでのフィルタリングを実施し、継続フラグが立っているかどうかを確認した後、継続フラグがセットされていなければ、セクション用フィルタのどの番号のフィルタでMPEG2−TSパケットを跨いだセクションを受信したかを記憶しておくための継続フラグをセットする。 The first byte of the section is a table ID. Section filtering is performed after the section headers are aligned, but the MPEG2-TS packet may end with a table ID. In this case, filtering by PID and table ID is performed and it is confirmed whether or not the continuation flag is set. Sets a continuation flag for storing whether or not a section straddling has been received.
ここで、継続フラグは、全てのフィルタに対で装備される。 Here, the continuation flag is provided in pairs for all the filters.
継続フラグのクリアは、継続フラグがセットされているフィルタにヒットしたMPEG2−TSパケットに格納されている、TSヘッダ部のユニットスタートインディケータが1であった場合に実施する。このMPEG2−TSパケットで継続してきたセクションが終了し、新たなセクションが格納されていると判断し、継続フラグがクリアされる。 The continuation flag is cleared when the unit start indicator in the TS header portion stored in the MPEG2-TS packet that hits the filter for which the continuation flag is set is 1. The section continued in the MPEG2-TS packet ends, and it is determined that a new section is stored, and the continuation flag is cleared.
ここで、MPEG2−TSパケットが、セクションヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、セクション解析用レジスタ7a2は、レジスタセットとしてセクションフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the section header portion, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the section analysis register 7a2 is a section filter as a register set. Installed for a few minutes.
PES系の場合、PES解析用レジスタ7a3に、PESヘッダ部がセットされる。 In the case of the PES system, the PES header portion is set in the PES analysis register 7a3.
PESヘッダの先頭は、パケットスタートコードプリフィックスの固定コード「000001」となっている。PESヘッダの先頭から8バイト目がPTSDTSフラグ(PTS,DTSであるタイムスタンプを含んでいるか否かの識別子)であり、タイムスタンプを含んでいる場合は、抽出を行う予定とされる。 The head of the PES header is a fixed code “000001” of the packet start code prefix. The 8th byte from the beginning of the PES header is a PTSDTS flag (an identifier indicating whether or not a time stamp that is PTS or DTS is included). If the time stamp is included, extraction is scheduled to be performed.
次のバイトがPESヘッダ長であり、PESヘッダ長の値が0でない場合は、PESヘッダ長ダウンカウンタに値がセットされ、ダウンカウントが行われる。 When the next byte is the PES header length and the value of the PES header length is not 0, a value is set in the PES header length down counter, and down counting is performed.
PESヘッダ長のダウンカウントが終了した時点に、ESデータの先頭バイトが存在する。 At the time when the PES header length down-count is completed, the first byte of the ES data exists.
ESデータの抽出では、このPESヘッダ部の削除処理を実施することで、ES抽出が実現される。 In the extraction of ES data, the ES extraction is realized by performing the deletion process of the PES header part.
MPEG2−TSパケットが、PESヘッダ部の途中で終了した場合は、PESヘッダ部のどのバイトから再開すればよいかは、PESヘッダ長のダウンカウンタ値と、継続フラグとによって判別されることとなる。 When the MPEG2-TS packet ends in the middle of the PES header part, it is determined from the PES header length down counter value and the continuation flag which byte of the PES header part should be resumed. .
ここで、MPEG2−TSパケットが、PESヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、PESヘッダ解析用レジスタ7a3は、レジスタセットとして、PID設定できるPESフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the PES header part, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the PES header analysis register 7a3 is a register set. There are as many PES filters as PID setting.
セクション系、PES系いずれの場合も、188バイトのメモリ1からの読み出しアドレスで、MPEG2−TSパケットのどのバイトを処理しているか、MPEG2−TSの終了を認識し、継続フラグをセットするか否かの判定が行われる。
Whether the section system or the PES system is used, the 188-byte read address from the
その後、MediaI/F部8からSDRAM4への書き込みが、SDRAM書き込みステージ(Wステージ)となる。
Thereafter, the writing from the Media I /
Wステージでは、以下の処理が行われる。 In the W stage, the following processing is performed.
Dステージの後段に設けられている188バイトの2面メモリ3a〜3cのうち、書き込みが終了している面のデータが、SDRAM4へ書き込まれる。
Of the two-
書き込み単位は、セクション、PES、ESいずれも、MPEG2−TSパケットの188バイトから抽出分離したデータ単位となる。ここで、セクションの場合は、13バイトのものもあり、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、14個となる。PES系の場合、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、1個となる。これは、PES系の場合は一つのMPEG2−TSパケットに複数個のPESパケットが格納されていることがないためである。 The writing unit is a data unit extracted and separated from 188 bytes of the MPEG2-TS packet for all sections, PES, and ES. Here, some sections have 13 bytes, and the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is 14. In the case of the PES system, the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is one. This is because in the case of the PES system, a plurality of PES packets are not stored in one MPEG2-TS packet.
Wステージの期間内に、SDRAM4への書き込みが終了しない場合は、188バイトの2面メモリ3a〜3cが破綻するので、バスエラー割り込みが発生される。
If the writing to the
これら各ステージに存在する2面メモリ1,3a〜3cで、TSパケット単位(188バイト単位)のパイプライン動作が区切られている。以上が、システムデコーダ100bの前半処理部となる。システムデコーダ100bの前半処理部の3段パイプライン動作は、図4に示した通りである。
Pipeline operations in units of TS packets (in units of 188 bytes) are delimited by the two-
(3)システムデコーダ100bの後半処理部
図21は、システムデコーダ100bの後半処理部の基本構成を示すブロック図である。システムデコーダ100bの後半処理部では、SDRAM4に書き込まれたデータが読み出され、AV同期をとって、システムデコーダ100bから出力される。ここで、SDRAM4からの読み出し以降の処理は、TSパケット単位のパイプライン動作とは無関係に動作する。
(3) Second Half Processing Unit of
(4)Demux処理
(4−1)DEMUX部7の構成
以下、主にPESデコーダからES抽出処理を含めたDemux処理について説明する。ここでは、DEMUX部7のDステージの動作説明を行う。Dステージには、PIDフィルタ動作部7b、TS解析部7a、Section解析部7a2、PES解析部7a3、及び分離結果を一時記憶しておくためのSRAM部3a〜3cがある。Dステージ及びWステージの動作を示すタイミングチャートは、図9に示した通りである。
(4) Demux Processing (4-1) Configuration of
(4−2)DEMUX部7の処理
TS−IF部5の後段に接続されている2面メモリ1から、TSパケットデータが1パケット分(0バイト目から187バイト目まで)読み出される。この読み出しのアドレスで、TSパケットの先頭から何番目のデータであるかが識別される。このTSパケットは、読み出しアドレス値に応じて、TS解析部7aに設けられているレジスタ7a1に格納される。TS解析部7aで格納対象とされているTSデータは、TSヘッダ部のデータと、アダプテーションに相当するデータの一部、及び、セクションの場合はポインタフィールドが保持される。
(4-2) Processing of
ここで、TS解析部7aのレジスタ7a1にPIDまでの情報が書き込まれた段階で、TSパケットの種別の大分類(セクションか、ビデオか、オーディオか、独立PESか)が行われる。この結果によって、セクション系かPES系(ビデオ、オーディオ、独立PES)かの識別が可能である。この結果を利用して、セクション解析部のレジスタ7a2を用いるのか、PES解析部のレジスタ7a3を用いるのかが判断される。
Here, when the information up to the PID is written in the register 7a1 of the
PES系であった場合、このPES解析部のレジスタ7a3に、PESヘッダに対応する情報のうち必要な部分(PES先頭から13バイトで、PESヘッダ長を含む)のみが格納される。ここで、アダプテーションのサイズによっては、PESのヘッダがTSパケットの単位(188バイト)よりも大きい場合があり得る。従って、PESデコードを行うフィルタ数分のレジスタ7a3が搭載されており、各レジスタ7a3は、書き込んだ位置を把握できるPESヘッダライトポインタを有している。TSパケットを跨いだ場合は、このPESヘッダライトポインタが停止される。ここで、TSパケットが終了するまでにPESヘッダ長のダウンカウンタ値が終了しなかった場合には、PESヘッダ部でTSパケットを跨ったことになる。一方、TSパケットが終了するまでにPESヘッダ長のダウンカウンタが終了した場合には、PESヘッダ部以降でTSパケットを跨いだことになる。PESヘッダ長のダウンカウンタ終了時点で、PESヘッダライトポインタはクリアされる。継続して受信再開する場合の動作は、PIDでのフィルタヒット判定と、PID別で管理しているPESヘッダライトポインタとを参照することで、PESヘッダの情報抽出を再開可能となる。なお、PESはPIDのみでフィルタリングが可能なため、特に継続フラグは必要ない。 In the case of the PES system, only the necessary portion (13 bytes from the beginning of the PES and including the PES header length) of the information corresponding to the PES header is stored in the register 7a3 of the PES analysis unit. Here, depending on the size of the adaptation, the PES header may be larger than the TS packet unit (188 bytes). Therefore, registers 7a3 corresponding to the number of filters for performing PES decoding are mounted, and each register 7a3 has a PES header write pointer that can grasp the written position. When straddling TS packets, this PES header write pointer is stopped. Here, when the down counter value of the PES header length does not end by the end of the TS packet, the TS packet is straddled by the PES header portion. On the other hand, when the PES header length down counter is completed before the TS packet is completed, the TS packet is straddled after the PES header part. At the end of the PES header length down counter, the PES header write pointer is cleared. In the case of continuous reception restart, the PES header information extraction can be restarted by referring to the filter hit determination by PID and the PES header write pointer managed for each PID. Since PES can be filtered only by PID, no continuation flag is required.
セクション系であった場合、セクション解析部のレジスタ7a2に、セクションヘッダに対応する情報のうち必要な部分(セクションの先頭から6バイト分。但しセクション長にも依存する)のみが格納される。ここで、アダプテーションのサイズに依存して、セクションヘッダ部に相当するデータをセクション解析部のレジスタ7a2に格納終了する前に、TSパケットが終了してしまうことがあり得る。そのため、セクション解析部でも、セクションヘッダをどこまで書き込んだかを把握できるように、セクションヘッダライトポインタを各々持つとともに、フィルタ番号毎に継続フラグが設けられている。セクションヘッダライトポインタ値と継続フラグとを参照することで、TSパケットを跨いだ後、暫くして後続のセクション部のデータを受信した場合であっても、セクションヘッダの情報抽出を再開可能となる。 In the case of a section system, only the necessary portion (for 6 bytes from the beginning of the section, depending on the section length) of the information corresponding to the section header is stored in the register 7a2 of the section analysis section. Here, depending on the size of the adaptation, the TS packet may end before the data corresponding to the section header section is stored in the register 7a2 of the section analysis section. For this reason, each section analysis unit has a section header write pointer and a continuation flag for each filter number so that the section analysis unit can grasp how much the section header has been written. By referring to the section header write pointer value and the continuation flag, the section header information extraction can be resumed even if the data of the subsequent section is received for a while after straddling the TS packet. .
次に、TSパケット単位を超えた場合の処理について説明する。 Next, processing when the TS packet unit is exceeded will be described.
セクション系の場合、受信したセクションデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、(a)セクションヘッダ部をセクション解析部のレジスタ7a2に格納終了できたかどうかの判断と、(b)セクションヘッダ部に存在するセクション長情報により、TSパケット終了時点(188バイト目)で、セクション長のダウンカウントが終了しているかどうかとの判断とによって行われる。TSパケットに納まっていないと判断された場合は、フィルタにヒットしている番号の継続フラグをセットするとともに、セクション長のダウンカウンタ値をクリアする。 In the case of the section system, the determination as to whether the received section data is data that can be contained in the TS packet or not can be made as follows: The determination is made based on the determination and (b) whether or not the section length down-count is completed at the end of the TS packet (at the 188th byte) based on the section length information existing in the section header section. If it is determined that it is not contained in the TS packet, the continuation flag of the number hitting the filter is set and the section length down counter value is cleared.
なお、継続フラグのクリアは、同一フィルタにヒットしたTSパケットの、TSヘッダ情報部にあるunit_start_indicatorの値が1である場合、このTSパケットで、継続してきたセクションが終了するとともに、新たなセクションが格納されていると判断する。ここで、新たなセクションの開始位置は、pointer_fieldで示される。 In addition, when the value of unit_start_indicator in the TS header information part of the TS packet that hits the same filter is 1, the continuation flag is cleared. Judge that stored. Here, the start position of the new section is indicated by pointer_field.
PES系の場合、受信したPESデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、PESヘッダ部についてのみ実施される。 In the case of the PES system, the determination as to whether the received PES data is data that fits in the TS packet or data that does not fit is performed only for the PES header part.
PESヘッダライトポインタ(PESヘッダをどこまでPES解析部のレジスタ7a3に格納できたかを示すポインタ。PESヘッダ長による終了で、PESヘッダ終了と判断される。)が終了していない状態で、TSパケットが終了(188バイト目)した場合、PESヘッダがTSパケットを跨ったと判断し、フィルタにヒットしている番号の継続フラグがセットされる。この継続フラグは、PES解析部で複数セット設けられているレジスタセットのうちのどのレジスタセットかを識別するのに用いられる。 In a state where the PES header write pointer (pointer indicating how far the PES header has been stored in the register 7a3 of the PES analysis unit. It is determined that the PES header has ended due to the end of the PES header length) has not ended. When the process ends (at the 188th byte), it is determined that the PES header has straddled the TS packet, and the continuation flag of the number hitting the filter is set. This continuation flag is used to identify which register set of a plurality of register sets provided in the PES analysis unit.
PESヘッダ解析部が持っている継続フラグは、PESヘッダ部をPES解析部のレジスタ7a3に格納終了すると、クリアされる。 The continuation flag possessed by the PES header analysis unit is cleared when the PES header unit is stored in the register 7a3 of the PES analysis unit.
PESヘッダ部以降のPESデータ自体は、PIDのみで分離識別可能であるため、PESの長さ情報は参照されない。その代わり、TSパケットヘッダ部にあるunit_start_indicatorでPESの先頭を識別し、PESデータの先頭から分離抽出が行われる。 Since the PES data itself after the PES header part can be separated and identified only by the PID, the PES length information is not referred to. Instead, the beginning of the PES is identified by unit_start_indicator in the TS packet header portion, and separation and extraction are performed from the beginning of the PES data.
以下、抽出分離結果を一時保持するためのSRAM(2面メモリ)3a〜3cについて説明する。 Hereinafter, SRAMs (two-plane memories) 3a to 3c for temporarily holding the extraction / separation results will be described.
188バイトの塊であるTSパケットから必要なデータがフィルタリングされ、分離抽出対象と判断されたデータが、SRAM3a〜3cに格納される。図20には、セクション/独立PES系に対して2面SRAM(188バイトのメモリ×2個)3a、オーディオ系に対して2面SRAM(188バイトのメモリ×2個)3b、ビデオ系に対して2面SRAM(188バイトのメモリ×2個)3cが設けられた構成が示されているが、後述の実施の形態3で説明する通り、本質的には188バイトのSRAMが2個あれば十分である。
Necessary data is filtered from the TS packet which is a lump of 188 bytes, and data determined to be separated and extracted are stored in the
(5)Wステージの処理
Wステージでは、Dステージの最終段にある188バイトの2面メモリ3a〜3cからSDRAM4へのデータの転送及び書き込みが行われる。Wステージも、1TSパケット期間のステージとなる。SRAM3a〜3cからSDRAM4へ書き込まれるデータには、セクション、独立PES、オーディオPES、及びビデオESがある。
(5) Processing of W stage In the W stage, data is transferred and written to the
セクションの書き込みでは、SDRAM4の複数領域への書き込みが発生する場合がある。マルチセクションにおいては、1TSパケット内に複数個の異なるセクションが格納されている場合があり、この場合はSDRAM4への書き込み領域がセクションごとに異なるためである。
In section writing, writing to a plurality of areas of the
独立PES、オーディオPES、及びビデオESの場合は、1TSパケット期間単位の動作において、SDRAM4への書き込み領域が異なる事態は発生しない。
In the case of an independent PES, an audio PES, and a video ES, a situation in which the write area to the
以上により、PESデータからPESヘッダ部を削除した後のESデータを抽出してSDRAM4に蓄えることができ、時刻管理を行いながらSDRAM4から必要なデータを読み出して、後段のビデオデコーダやオーディオデコーダにESを提供できるシステムデコーダ100bを構成することができる。
As described above, the ES data after the PES header portion is deleted from the PES data can be extracted and stored in the
本実施の形態2に係るシステムデコーダ100bによると、TSパケット単位で処理が完結するパイプライン動作が可能であるため、PESデコーダ専用の大規模なメモリが不要となる。そのため、オンチップ又はオフチップでPESデコード用メモリを構成した場合と比較して、チップ製造コストを低減できる効果がある。また、PESデコーダ専用の大規模メモリが不要となるため、このメモリへのアクセスが削減できる。そのため、外部バスの帯域を他のアクセスへ割り振ることが可能となる。例えば、CPUがSDRAM4をワークメモリとして用いるためのアクセス帯域として割り振ることも可能となる。しかも、外部メモリアクセスが低減したので、外部アクセス周波数を下げることが可能となって消費電力が低減されるとともに、外部ピン数を削減できるためチップ製造コストを低減できる。
According to the
しかも、図7に示した上記実施の形態1に係るシステムデコーダ100aから、デスクランブル部6及び2面メモリ2が省略されているため、システムデコーダ100aと比較して回路規模を削減することができる。
In addition, since the
実施の形態3.
(1)システムデコーダ100cの基本構成
図22は、本発明の実施の形態3に係るシステムデコーダ100cの前半処理部の構成を示すブロック図である。図22に示すように、システムデコーダ100cの前半処理部は、MPEG2−TS入力を受けて188バイトの同期をとるTS−IF部5と、TS−IF部5の出力を受けて暗号を解読するデスクランブル部6と、デスクランブル部6の出力を受けてDemux処理を行うDEMUX部7と、DEMUX部7から出力されたデータをSDRAM4に書き込むMediaI/F部8とを備えて構成されている。MediaI/F部8は、書き込み部8aとMediaBusI/F部8bとを有している。
(1) Basic Configuration of System Decoder 100c FIG. 22 is a block diagram showing the configuration of the first half processing unit of the system decoder 100c according to
まず、システムデコーダ100cにおけるTSパケット単位でのパイプライン構成を説明し、その後、PESデコーダまで含めたDemux処理を可能としているアーキテクチャについて説明する。 First, a pipeline configuration in units of TS packets in the system decoder 100c will be described, and then an architecture that enables Demux processing including the PES decoder will be described.
(2)システムデコーダ100cのパイプライン構成
システムデコーダ100cのTSパケット単位でのパイプライン動作としては、TS−IF部5の後段に片面188バイトの2面メモリ1を配備し、IFステージを構成している。
(2) Pipeline configuration of the system decoder 100c As a pipeline operation in units of TS packets of the system decoder 100c, a two-
IFステージでは、以下の処理が行われる。 In the IF stage, the following processing is performed.
入力クロック(TSCLK)と共に送られてくるMPEG2−TSデータ(TSDATA)を、TSCLKで取り込む。この際、TSDATAと同時に送られてくるデータバリッド(TSVALID)を参照し、有効なデータである場合にのみ取り込みを行う。また、取り込み単位は、1バイト単位又は1ビット単位となり、選択が可能である。 MPEG2-TS data (TSDATA) sent together with the input clock (TSCLK) is captured by TSCLK. At this time, the data valid (TSVALID) sent simultaneously with TSDATA is referred to, and the data is taken in only when it is valid data. In addition, the capture unit can be selected in units of 1 byte or 1 bit.
MPEG2−TSパケットの先頭データである「47」コードを検索し、188バイト毎に「47」コードが存在することを確認し、同期捕捉を行う。 The “47” code which is the head data of the MPEG2-TS packet is searched, and it is confirmed that the “47” code exists every 188 bytes.
同期捕捉候補処理を高速化させるため、独立で動作する複数個のカウンタを搭載し、複数個の同期捕捉候補を扱う。いずれかの同期捕捉候補の同期捕捉が成立した段階で、他の同期捕捉候補をキャンセルする。 In order to speed up the synchronization acquisition candidate processing, a plurality of counters that operate independently are mounted to handle a plurality of synchronization acquisition candidates. When the synchronization acquisition of any one of the synchronization acquisition candidates is established, the other synchronization acquisition candidates are canceled.
同期捕捉が成立すると、MPEG2−TSパケットのデータを、先頭の「47」コードから順に、188バイトのメモリ1に格納し始める。
When synchronization acquisition is established, data of the MPEG2-TS packet starts to be stored in the 188-
188バイトのメモリ1は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
デスクランブル部6の後段にも片面188バイトの2面メモリ2を配備し、Sステージを構成している。
A two-
Sステージでは、以下の処理が行われる。 In the S stage, the following processing is performed.
IFステージの後段に設けられている188バイトの2面メモリ1のうち、書き込みが終了している面からMPEG2−TSデータを順次読み出す。
The MPEG2-TS data is sequentially read from the side where writing has been completed in the two-
スクランブル解除指定のPIDを持っているMPEG2−TSパケットであるか否かの判定を実施する。 It is determined whether the packet is an MPEG2-TS packet having a descrambling designation PID.
スクランブル解除指定のPIDを持っているMPEG2−TSパケットであった場合は、MPEG2−TSパケットのPayloadに対して、スクランブル解除処理を実施する。 In the case of an MPEG2-TS packet having a PID for descrambling designation, a descrambling process is performed on the payload of the MPEG2-TS packet.
1バイト単位に複数クロックかけてデスクランブル処理を行うことにより、188バイトのデータのスクランブル解除処理を行う。 By performing descrambling over a plurality of clocks in units of 1 byte, descrambling of 188 bytes of data is performed.
スクランブル解除されたデータを、MPEG2−TSの先頭バイトから、188バイトのメモリ2に格納し始める。
The descrambled data starts to be stored in the 188-
188バイトのメモリ2は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
デスクランブル処理対象外のMPEG2−TSデータである場合は、スクランブル解除処理を実施しないで、188バイトのメモリ2へ書き込む。例えば、TSパケットのヘッダ情報や、PIDで指定されていないMPEG2−TSパケットの場合は、スクランブル解除処理を実施しないで、188バイトのメモリ2へ書き込まれる。
In the case of MPEG2-TS data that is not subject to descrambling processing, the descrambling processing is not performed and the data is written into the 188-
デスクランブル処理対象外のデータは、デスクランブル処理対象のデータと同じレイテンシとする。換言すれば、MPEG2−TSデータのデスクランブル部6を通過する時間は、デスクランブル処理を実施した場合も実施しなかった場合も、いずれも同じ所要時間となる。
The data not subject to descrambling processing has the same latency as the data subject to descrambling processing. In other words, the time required for the MPEG2-TS data to pass through the
さらに、DEMUX部7の後段にも片面188バイトの2面メモリ3aを配備し、Dステージを構成している。
Further, a two-
Dステージでは、以下の処理が行われる。 In the D stage, the following processing is performed.
デスクランブルステージの後段に設けられている188バイトの2面メモリ2のうち、書き込みが終了している面から、スクランブル解除されたMPEG2−TSデータを順次読み出す。
The scrambled MPEG2-TS data is sequentially read from the 188-byte two-
読み出したMPEG2−TSパケットデータのうち、TSヘッダ部と、もし存在すればアダプテーション領域の制御データを、TS解析用レジスタ7a1に順次セットする。 Among the read MPEG2-TS packet data, the TS header portion and, if present, the control data of the adaptation area are sequentially set in the TS analysis register 7a1.
この読み出しアドレスは、MPEG2−TSパケットの188バイトのうち、どのバイトを読み出しているかの識別に用いられる。 This read address is used to identify which one of the 188 bytes of the MPEG2-TS packet is being read.
DステージでのMPEG2−TS解析、抽出分離のベースは、上記188バイトの2面メモリ2からの読み出しアドレスと、上記TS解析用レジスタ7a1の値とを参照し、MPEG2−TSパケットのデータ構造の解析が進められる。
The base of MPEG2-TS analysis and extraction / separation at the D stage refers to the read address from the 188-byte two-
2面メモリ2からの読み出しアドレスが、PIDを読み出し終了時点まで進んだ段階で、抽出分離指定されているPIDであるかどうかの判定が行われる。
At the stage where the read address from the two-
このPID判定では、セクション系かPES系か、PES系である場合は、独立PES系か、オーディオ系か、ビデオ系かの判定が行われる。 In this PID determination, if it is a section system, a PES system, or a PES system, it is determined whether it is an independent PES system, an audio system, or a video system.
トランスポートスクランブルコントロール、アダプテーションフィールドコントロール、コンティニュティカウンター値を、TS解析用レジスタ7a1にセットする。 The transport scramble control, adaptation field control, and continuity counter value are set in the TS analysis register 7a1.
コンティニュティカウンター値とアダプテーションフィールドコントロール値とをチェックし、廃棄対象のペイロードを持ったMPEG2−TSパケットであるかどうかの判定と、アダプテーション領域の有無、ペイロードの有無が判断される。 The continuity counter value and the adaptation field control value are checked to determine whether the packet is an MPEG2-TS packet having a payload to be discarded, whether there is an adaptation area, and whether there is a payload.
次に、アダプテーションフィールドが存在する場合は、引き続きTS解析用レジスタ7a1にアダプテーション領域のデータをセットする。 Next, if there is an adaptation field, the data in the adaptation area is continuously set in the TS analysis register 7a1.
アダプテーション領域の先頭はアダプテーションレングスであり、このレングスをチェックして、その値が0でなければ、アダプテーションレングス値をアダプテーションレングスカウンタへセットし、ダウンカウントを開始する。アダプテーションレングスが0である場合は、次のバイトは、セクション系データの場合はポインタフィールドとなり、PES系データの場合はPESの先頭バイトであると判断する。 The beginning of the adaptation area is the adaptation length, and this length is checked. If the value is not 0, the adaptation length value is set in the adaptation length counter, and down-counting is started. When the adaptation length is 0, it is determined that the next byte is a pointer field in the case of section data, and the first byte of the PES in the case of PES data.
アダプテーションレングスが0でない場合は、次のバイトが、PCRフラグ(PCRを含んだMPEG2−TSパケットかどうかの識別子)とか、含んでいるPCRが不連続PCRであるかどうかの識別子であるディスコンティニュティインディケータを、TS解析用レジスタ7a1にセットする。 If the adaptation length is not 0, the next byte includes a PCR flag (identifier indicating whether the packet is an MPEG2-TS packet including PCR) or a discontinuity indicating whether the included PCR is a discontinuous PCR. The tee indicator is set in the TS analysis register 7a1.
PCRフラグで、PCRがあることが判明すれば、PCRの抽出を行う。この時、システムデコーダ100cの時計であるSTCへPCR値をロードするか否かは、PCRのロード制御レジスタ値によって制御される。 If the PCR flag indicates that there is a PCR, the PCR is extracted. At this time, whether or not to load the PCR value to the STC which is the clock of the system decoder 100c is controlled by the PCR load control register value.
ディスコンティニュティインディケータがセットされていれば、MPEG2−TSパケットに含まれているPCRが、不連続PCRであると判断する。不連続PCRのSTCへのロード制御は、PCRのロード制御レジスタ値によって制御される。 If the discontinuity indicator is set, it is determined that the PCR included in the MPEG2-TS packet is a discontinuous PCR. The load control of the discontinuous PCR to the STC is controlled by the PCR load control register value.
不連続PCRのSTCへのロードは、SDRAM4に既に蓄えられているビデオES、オーディオESのタイムスタンプ値との関係が不連続になることも意味しているので、既に蓄えられているAVフレームデータ(ビデオES/オーディオES)に対応したタイムスタンプのValidビットを無効化する。ここで、このValidビットは、タイムスタンプ値が有効か無効かの識別に用いられる。有効な場合は、システムデコーダ100cからフレームデータを出力すべき時刻まで待たせる処理を行う時に、STCとの比較に用いるタイムスタンプ値として利用される。無効な場合は、出力すべき時刻まで待たせる処理は行われない。
The loading of the discontinuous PCR into the STC also means that the relationship with the time stamp values of the video ES and audio ES already stored in the
アダプテーションフィールドが終了すると、PIDフィルタリングの結果が、セクション系であるか、PES系であるかで、処理が分岐される。 When the adaptation field ends, the process branches depending on whether the PID filtering result is a section system or a PES system.
TSヘッダ部のユニットスタートインディケータがセットされている場合は、セクション系の場合はセクションの先頭データを含むため、ペイロードの前に1バイトのポインタフィールドがあると判断される。また、PES系の場合はペイロードの先頭からPESデータが格納されていると判断される。 When the unit start indicator of the TS header is set, it is determined that there is a 1-byte pointer field in front of the payload because the section head includes section start data. In the case of the PES system, it is determined that PES data is stored from the beginning of the payload.
セクション系の場合は、セクション解析用レジスタ7a2に、セクションヘッダ部がセットされる。 In the case of a section system, a section header part is set in the section analysis register 7a2.
セクションの先頭バイトはテーブルIDである。セクションのフィルタリングは、セクションヘッダ部が揃ってから実施されるが、テーブルIDでMPEG2−TSパケットが終了する場合もある。この場合は、PIDとテーブルIDとでのフィルタリングを実施し、継続フラグが立っているかどうかを確認した後、継続フラグがセットされていなければ、セクション用フィルタのどの番号のフィルタでMPEG2−TSパケットを跨いだセクションを受信したかを記憶しておくための継続フラグをセットする。 The first byte of the section is a table ID. Section filtering is performed after the section headers are aligned, but the MPEG2-TS packet may end with a table ID. In this case, filtering by PID and table ID is performed and it is confirmed whether or not the continuation flag is set. Sets a continuation flag for storing whether or not a section straddling has been received.
ここで、継続フラグは、全てのフィルタに対で装備される。 Here, the continuation flag is provided in pairs for all the filters.
継続フラグのクリアは、継続フラグがセットされているフィルタにヒットしたMPEG2−TSパケットに格納されている、TSヘッダ部のユニットスタートインディケータが1であった場合に実施する。このMPEG2−TSパケットで継続してきたセクションが終了し、新たなセクションが格納されていると判断し、継続フラグがクリアされる。 The continuation flag is cleared when the unit start indicator in the TS header portion stored in the MPEG2-TS packet that hits the filter for which the continuation flag is set is 1. The section continued in the MPEG2-TS packet ends, and it is determined that a new section is stored, and the continuation flag is cleared.
ここで、MPEG2−TSパケットが、セクションヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、セクション解析用レジスタ7a2は、レジスタセットとしてセクションフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the section header portion, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the section analysis register 7a2 is a section filter as a register set. Installed for a few minutes.
PES系の場合、PES解析用レジスタ7a3に、PESヘッダ部がセットされる。 In the case of the PES system, the PES header portion is set in the PES analysis register 7a3.
PESヘッダの先頭は、パケットスタートコードプリフィックスの固定コード「000001」となっている。PESヘッダの先頭から8バイト目がPTSDTSフラグ(PTS,DTSであるタイムスタンプを含んでいるか否かの識別子)であり、タイムスタンプを含んでいる場合は、抽出を行う予定とされる。 The head of the PES header is a fixed code “000001” of the packet start code prefix. The 8th byte from the beginning of the PES header is a PTSDTS flag (an identifier indicating whether or not a time stamp that is PTS or DTS is included). If the time stamp is included, extraction is scheduled to be performed.
次のバイトがPESヘッダ長であり、PESヘッダ長の値が0でない場合は、PESヘッダ長ダウンカウンタに値がセットされ、ダウンカウントが行われる。 When the next byte is the PES header length and the value of the PES header length is not 0, a value is set in the PES header length down counter, and down counting is performed.
PESヘッダ長のダウンカウントが終了した時点に、ESデータの先頭バイトが存在する。 At the time when the PES header length down-count is completed, the first byte of the ES data exists.
ESデータの抽出では、このPESヘッダ部の削除処理を実施することで、ES抽出が実現される。 In the extraction of ES data, the ES extraction is realized by performing the deletion process of the PES header part.
MPEG2−TSパケットが、PESヘッダ部の途中で終了した場合は、PESヘッダ部のどのバイトから再開すればよいかは、PESヘッダ長のダウンカウンタ値と、継続フラグとによって判別されることとなる。 When the MPEG2-TS packet ends in the middle of the PES header part, it is determined from the PES header length down counter value and the continuation flag which byte of the PES header part should be resumed. .
ここで、MPEG2−TSパケットが、PESヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、PESヘッダ解析用レジスタ7a3は、レジスタセットとして、PID設定できるPESフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the PES header part, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the PES header analysis register 7a3 is a register set. There are as many PES filters as PID setting.
セクション系、PES系いずれの場合も、188バイトのメモリ2からの読み出しアドレスで、MPEG2−TSパケットのどのバイトを処理しているか、MPEG2−TSの終了を認識し、継続フラグをセットするか否かの判定が行われる。
Whether the section system or the PES system is used, the 188-byte read address from the
その後、MediaI/F部8からSDRAM4への書き込みが、SDRAM書き込みステージ(Wステージ)となる。
Thereafter, the writing from the Media I /
Wステージでは、以下の処理が行われる。 In the W stage, the following processing is performed.
Dステージの後段に設けられている188バイトの2面メモリ3aのうち、書き込みが終了している面のデータが、SDRAM4へ書き込まれる。
Of the two-
書き込み単位は、セクション、PES、ESいずれも、MPEG2−TSパケットの188バイトから抽出分離したデータ単位となる。ここで、セクションの場合は、13バイトのものもあり、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、14個となる。PES系の場合、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、1個となる。これは、PES系の場合は一つのMPEG2−TSパケットに複数個のPESパケットが格納されていることがないためである。 The writing unit is a data unit extracted and separated from 188 bytes of the MPEG2-TS packet for all sections, PES, and ES. Here, some sections have 13 bytes, and the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is 14. In the case of the PES system, the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is one. This is because in the case of the PES system, a plurality of PES packets are not stored in one MPEG2-TS packet.
Wステージの期間内に、SDRAM4への書き込みが終了しない場合は、188バイトの2面メモリ3aが破綻するので、バスエラー割り込みが発生される。
If writing to the
これら各ステージに存在する2面メモリ1,2,3aで、TSパケット単位(188バイト単位)のパイプライン動作が区切られている。以上が、システムデコーダ100cの前半処理部となる。システムデコーダ100cの前半処理部の4段パイプライン動作は、図2に示した通りである。
Pipeline operations in units of TS packets (in units of 188 bytes) are divided by the two-
(3)システムデコーダ100cの後半処理部
システムデコーダ100cの後半処理部の基本構成は、図21に示したブロック図の通りである。システムデコーダ100cの後半処理部では、SDRAM4に書き込まれたデータが読み出され、AV同期をとって、システムデコーダ100cから出力される。ここで、SDRAM4からの読み出し以降の処理は、TSパケット単位のパイプライン動作とは無関係に動作する。
(3) Second Half Processing Unit of System Decoder 100c The basic configuration of the second half processing unit of the system decoder 100c is as shown in the block diagram of FIG. In the latter half processing section of the system decoder 100c, the data written in the
(4)Demux処理
(4−1)DEMUX部7の構成
以下、主にPESデコーダからES抽出処理を含めたDemux処理について説明する。ここでは、DEMUX部7のDステージの動作説明を行う。Dステージには、PIDフィルタ動作部7b、TS解析部7a、Section解析部7a2、PES解析部7a3、及び分離結果を一時記憶しておくためのSRAM部3aがある。Dステージ及びWステージの動作を示すタイミングチャートは、図9に示した通りである。
(4) Demux Processing (4-1) Configuration of
(4−2)DEMUX部7の処理
デスクランブル部6の後段に接続されている2面メモリ2から、TSパケットデータが1パケット分(0バイト目から187バイト目まで)読み出される。この読み出しのアドレスで、TSパケットの先頭から何番目のデータであるかが識別される。このTSパケットは、読み出しアドレス値に応じて、TS解析部7aに設けられているレジスタ7a1に格納される。TS解析部7aで格納対象とされているTSデータは、TSヘッダ部のデータと、アダプテーションに相当するデータの一部、及び、セクションの場合はポインタフィールドが保持される。
(4-2) Processing of
ここで、TS解析部7aのレジスタ7a1にPIDまでの情報が書き込まれた段階で、TSパケットの種別の大分類(セクションか、ビデオか、オーディオか、独立PESか)が行われる。この結果によって、セクション系かPES系(ビデオ、オーディオ、独立PES)かの識別が可能である。この結果を利用して、セクション解析部のレジスタ7a2を用いるのか、PES解析部のレジスタ7a3を用いるのかが判断される。
Here, when the information up to the PID is written in the register 7a1 of the
PES系であった場合、このPES解析部のレジスタ7a3に、PESヘッダに対応する情報のうち必要な部分(PES先頭から13バイトで、PESヘッダ長を含む)のみが格納される。ここで、アダプテーションのサイズによっては、PESのヘッダがTSパケットの単位(188バイト)よりも大きい場合があり得る。従って、PESデコードを行うフィルタ数分のレジスタ7a3が搭載されており、各レジスタ7a3は、書き込んだ位置を把握できるPESヘッダライトポインタを有している。TSパケットを跨いだ場合は、このPESヘッダライトポインタが停止される。ここで、TSパケットが終了するまでにPESヘッダ長のダウンカウンタ値が終了しなかった場合には、PESヘッダ部でTSパケットを跨ったことになる。一方、TSパケットが終了するまでにPESヘッダ長のダウンカウンタが終了した場合には、PESヘッダ部以降でTSパケットを跨いだことになる。PESヘッダ長のダウンカウンタ終了時点で、PESヘッダライトポインタはクリアされる。継続して受信再開する場合の動作は、PIDでのフィルタヒット判定と、PID別で管理しているPESヘッダライトポインタとを参照することで、PESヘッダの情報抽出を再開可能となる。なお、PESはPIDのみでフィルタリングが可能なため、特に継続フラグは必要ない。 In the case of the PES system, only the necessary portion (13 bytes from the beginning of the PES and including the PES header length) of the information corresponding to the PES header is stored in the register 7a3 of the PES analysis unit. Here, depending on the size of the adaptation, the PES header may be larger than the TS packet unit (188 bytes). Therefore, registers 7a3 corresponding to the number of filters for performing PES decoding are mounted, and each register 7a3 has a PES header write pointer that can grasp the written position. When straddling TS packets, this PES header write pointer is stopped. Here, when the down counter value of the PES header length does not end by the end of the TS packet, the TS packet is straddled by the PES header portion. On the other hand, when the PES header length down counter is completed before the TS packet is completed, the TS packet is straddled after the PES header part. At the end of the PES header length down counter, the PES header write pointer is cleared. In the case of continuous reception restart, the PES header information extraction can be restarted by referring to the filter hit determination by PID and the PES header write pointer managed for each PID. Since PES can be filtered only by PID, no continuation flag is required.
セクション系であった場合、セクション解析部のレジスタ7a2に、セクションヘッダに対応する情報のうち必要な部分(セクションの先頭から6バイト分。但しセクション長にも依存する)のみが格納される。ここで、アダプテーションのサイズに依存して、セクションヘッダ部に相当するデータをセクション解析部のレジスタ7a2に格納終了する前に、TSパケットが終了してしまうことがあり得る。そのため、セクション解析部でも、セクションヘッダをどこまで書き込んだかを把握できるように、セクションヘッダライトポインタを各々持つとともに、フィルタ番号毎に継続フラグが設けられている。セクションヘッダライトポインタ値と継続フラグとを参照することで、TSパケットを跨いだ後、暫くして後続のセクション部のデータを受信した場合であっても、セクションヘッダの情報抽出を再開可能となる。 In the case of a section system, only the necessary portion (for 6 bytes from the beginning of the section, depending on the section length) of the information corresponding to the section header is stored in the register 7a2 of the section analysis section. Here, depending on the size of the adaptation, the TS packet may end before the data corresponding to the section header section is stored in the register 7a2 of the section analysis section. For this reason, each section analysis unit has a section header write pointer and a continuation flag for each filter number so that the section analysis unit can grasp how much the section header has been written. By referring to the section header write pointer value and the continuation flag, the section header information extraction can be resumed even if the data of the subsequent section is received for a while after straddling the TS packet. .
次に、TSパケット単位を超えた場合の処理について説明する。 Next, processing when the TS packet unit is exceeded will be described.
セクション系の場合、受信したセクションデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、(a)セクションヘッダ部をセクション解析部のレジスタ7a2に格納終了できたかどうかの判断と、(b)セクションヘッダ部に存在するセクション長情報により、TSパケット終了時点(188バイト目)で、セクション長のダウンカウントが終了しているかどうかとの判断とによって行われる。TSパケットに納まっていないと判断された場合は、フィルタにヒットしている番号の継続フラグをセットするとともに、セクション長のダウンカウンタ値をクリアする。 In the case of the section system, the determination as to whether the received section data is data that can be contained in the TS packet or not can be made as follows: The determination is made based on the determination and (b) whether or not the section length down-count is completed at the end of the TS packet (at the 188th byte) based on the section length information existing in the section header section. If it is determined that it is not contained in the TS packet, the continuation flag of the number hitting the filter is set and the section length down counter value is cleared.
なお、継続フラグのクリアは、同一フィルタにヒットしたTSパケットの、TSヘッダ情報部にあるunit_start_indicatorの値が1である場合、このTSパケットで、継続してきたセクションが終了するとともに、新たなセクションが格納されていると判断する。ここで、新たなセクションの開始位置は、pointer_fieldで示される。 In addition, when the value of unit_start_indicator in the TS header information part of the TS packet that hits the same filter is 1, the continuation flag is cleared. Judge that stored. Here, the start position of the new section is indicated by pointer_field.
PES系の場合、受信したPESデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、PESヘッダ部についてのみ実施される。 In the case of the PES system, the determination as to whether the received PES data is data that fits in the TS packet or data that does not fit is performed only for the PES header part.
PESヘッダライトポインタ(PESヘッダをどこまでPES解析部のレジスタ7a3に格納できたかを示すポインタ。PESヘッダ長による終了で、PESヘッダ終了と判断される。)が終了していない状態で、TSパケットが終了(188バイト目)した場合、PESヘッダがTSパケットを跨ったと判断し、フィルタにヒットしている番号の継続フラグがセットされる。この継続フラグは、PES解析部で複数セット設けられているレジスタセットのうちのどのレジスタセットかを識別するのに用いられる。 In a state where the PES header write pointer (pointer indicating how far the PES header has been stored in the register 7a3 of the PES analysis unit. It is determined that the PES header has ended due to the end of the PES header length) has not ended. When the process ends (at the 188th byte), it is determined that the PES header has straddled the TS packet, and the continuation flag of the number hitting the filter is set. This continuation flag is used to identify which register set of a plurality of register sets provided in the PES analysis unit.
PESヘッダ解析部が持っている継続フラグは、PESヘッダ部をPES解析部のレジスタ7a3に格納終了すると、クリアされる。 The continuation flag possessed by the PES header analysis unit is cleared when the PES header unit is stored in the register 7a3 of the PES analysis unit.
PESヘッダ部以降のPESデータ自体は、PIDのみで分離識別可能であるため、PESの長さ情報は参照されない。その代わり、TSパケットヘッダ部にあるunit_start_indicatorでPESの先頭を識別し、PESデータの先頭から分離抽出が行われる。 Since the PES data itself after the PES header part can be separated and identified only by the PID, the PES length information is not referred to. Instead, the beginning of the PES is identified by unit_start_indicator in the TS packet header portion, and separation and extraction are performed from the beginning of the PES data.
セクション解析用レジスタ7a2周辺のブロック図を図10に示し、PES解析用レジスタ7a3周辺のブロック図を図11に示す。TSデータの解析から、セクションの分離(先頭セクションの抽出)までの動作は、図12に示したタイミングチャートの通りである。TSデータの解析から、マルチセクションの抽出分離動作は、図13に示したタイミングチャートの通りである。TSデータの解析から、セクションの分離抽出時、セクションヘッダ部においてTSパケット(188バイト)が終了した場合の動は、図14に示したタイミングチャートの通りである。TSデータの解析から、セクションの分離抽出時、セクションの途中でTSパケット(188バイト)が終了した場合の動作は、図15に示したタイミングチャートの通りである。TSデータの解析から、ポインタフィールドで示されるデータより手前のデータの抽出分離動作は、図16に示したタイミングチャートの通りである。セクションの抽出時、ポインタフィールドがない場合の動作は、図17に示したタイミングチャートの通りである。セクションを含むMPEG2−TSの例を図18に示し、PESヘッダ部の例を図19に示す。 A block diagram around the section analysis register 7a2 is shown in FIG. 10, and a block diagram around the PES analysis register 7a3 is shown in FIG. The operations from TS data analysis to section separation (leading section extraction) are as shown in the timing chart of FIG. From the analysis of TS data, the multi-section extraction / separation operation is as shown in the timing chart of FIG. From the analysis of TS data, when a section is separated and extracted, the operation when the TS packet (188 bytes) ends in the section header is as shown in the timing chart of FIG. From the analysis of TS data, the operation when the TS packet (188 bytes) ends in the middle of a section during section separation and extraction is as shown in the timing chart of FIG. From the analysis of the TS data, the data extraction / separation operation before the data indicated by the pointer field is as shown in the timing chart of FIG. The operation when there is no pointer field when extracting a section is as shown in the timing chart of FIG. An example of MPEG2-TS including a section is shown in FIG. 18, and an example of a PES header part is shown in FIG.
以下、抽出分離結果を一時保持するためのSRAM(2面メモリ)3aについて説明する。 Hereinafter, the SRAM (two-sided memory) 3a for temporarily holding the extraction / separation result will be described.
188バイトの塊であるTSパケットから必要なデータがフィルタリングされ、分離抽出対象と判断されたデータが、SRAM3aに格納される。本実施の形態3に係るシステムデコーダ100cでは、図22に示したように、セクション/独立PES系、オーディオ系、及びビデオ系に共通する2面SRAM(188バイトのメモリ×2個)3aが設けられている。
Necessary data is filtered from the TS packet which is a lump of 188 bytes, and the data determined to be separated and extracted is stored in the
(5)Wステージの処理
Wステージでは、Dステージの最終段にある188バイトの2面メモリ3aからSDRAM4へのデータの転送及び書き込みが行われる。Wステージも、1TSパケット期間のステージとなる。SRAM3aからSDRAM4へ書き込まれるデータには、セクション、独立PES、オーディオPES、及びビデオESがある。
(5) W Stage Processing In the W stage, data is transferred and written from the 188-byte two-
セクションの書き込みでは、SDRAM4の複数領域への書き込みが発生する場合がある。マルチセクションにおいては、1TSパケット内に複数個の異なるセクションが格納されている場合があり、この場合はSDRAM4への書き込み領域がセクションごとに異なるためである。
In section writing, writing to a plurality of areas of the
独立PES、オーディオPES、及びビデオESの場合は、1TSパケット期間単位の動作において、SDRAM4への書き込み領域が異なる事態は発生しない。
In the case of an independent PES, an audio PES, and a video ES, a situation in which the write area to the
以上により、PESデータからPESヘッダ部を削除した後のESデータを抽出してSDRAM4に蓄えることができ、時刻管理を行いながらSDRAM4から必要なデータを読み出して、後段のビデオデコーダやオーディオデコーダにESを提供できるシステムデコーダ100cを構成することができる。
As described above, the ES data after the PES header portion is deleted from the PES data can be extracted and stored in the
本実施の形態3に係るシステムデコーダ100cによると、TSパケット単位で処理が完結するパイプライン動作が可能であるため、PESデコーダ専用の大規模なメモリが不要となる。そのため、オンチップ又はオフチップでPESデコード用メモリを構成した場合と比較して、チップ製造コストを低減できる効果がある。また、PESデコーダ専用の大規模メモリが不要となるため、このメモリへのアクセスが削減できる。そのため、外部バスの帯域を他のアクセスへ割り振ることが可能となる。例えば、CPUがSDRAM4をワークメモリとして用いるためのアクセス帯域として割り振ることも可能となる。しかも、外部メモリアクセスが低減したので、外部アクセス周波数を下げることが可能となって消費電力が低減されるとともに、外部ピン数を削減できるためチップ製造コストを低減できる。
According to the system decoder 100c according to the third embodiment, since a pipeline operation that completes processing in units of TS packets is possible, a large-scale memory dedicated to the PES decoder is not necessary. Therefore, there is an effect that the chip manufacturing cost can be reduced as compared with the case where the PES decoding memory is configured on-chip or off-chip. Further, since a large-scale memory dedicated to the PES decoder is not necessary, access to this memory can be reduced. Therefore, it is possible to allocate the bandwidth of the external bus to other access. For example, it is possible to allocate an access band for the CPU to use the
しかも、図7に示した上記実施の形態1に係るシステムデコーダ100aから、2面メモリ3b,3cが省略されているため、システムデコーダ100aと比較して回路規模を削減することができる。
Moreover, since the two-
実施の形態4.
(1)システムデコーダ100dの基本構成
図23は、本発明の実施の形態4に係るシステムデコーダ100dの前半処理部の構成を示すブロック図である。図23に示すように、システムデコーダ100dの前半処理部は、MPEG2−TS入力を受けて188バイトの同期をとるTS−IF部5と、TS−IF部5の出力を受けてDemux処理を行うDEMUX部7と、DEMUX部7から出力されたデータをSDRAM4に書き込むMediaI/F部8とを備えて構成されている。MediaI/F部8は、書き込み部8aとMediaBusI/F部8bとを有している。つまり、図22に示した上記実施の形態3に係るシステムデコーダ100cから、デスクランブル部6を省略したものが、本実施の形態4に係るシステムデコーダ100dに相当する。
(1) Basic Configuration of
まず、システムデコーダ100dにおけるTSパケット単位でのパイプライン構成を説明し、その後、PESデコーダまで含めたDemux処理を可能としているアーキテクチャについて説明する。
First, a pipeline configuration in units of TS packets in the
(2)システムデコーダ100dのパイプライン構成
システムデコーダ100dのTSパケット単位でのパイプライン動作としては、TS−IF部5の後段に片面188バイトの2面メモリ1を配備し、IFステージを構成している。
(2) Pipeline configuration of
IFステージでは、以下の処理が行われる。 In the IF stage, the following processing is performed.
入力クロック(TSCLK)と共に送られてくるMPEG2−TSデータ(TSDATA)を、TSCLKで取り込む。この際、TSDATAと同時に送られてくるデータバリッド(TSVALID)を参照し、有効なデータである場合にのみ取り込みを行う。また、取り込み単位は、1バイト単位又は1ビット単位となり、選択が可能である。 MPEG2-TS data (TSDATA) sent together with the input clock (TSCLK) is captured by TSCLK. At this time, the data valid (TSVALID) sent simultaneously with TSDATA is referred to, and the data is taken in only when it is valid data. In addition, the capture unit can be selected in units of 1 byte or 1 bit.
MPEG2−TSパケットの先頭データである「47」コードを検索し、188バイト毎に「47」コードが存在することを確認し、同期捕捉を行う。 The “47” code which is the head data of the MPEG2-TS packet is searched, and it is confirmed that the “47” code exists every 188 bytes.
同期捕捉候補処理を高速化させるため、独立で動作する複数個のカウンタを搭載し、複数個の同期捕捉候補を扱う。いずれかの同期捕捉候補の同期捕捉が成立した段階で、他の同期捕捉候補をキャンセルする。 In order to speed up the synchronization acquisition candidate processing, a plurality of counters that operate independently are mounted to handle a plurality of synchronization acquisition candidates. When the synchronization acquisition of any one of the synchronization acquisition candidates is established, the other synchronization acquisition candidates are canceled.
同期捕捉が成立すると、MPEG2−TSパケットのデータを、先頭の「47」コードから順に、188バイトのメモリ1に格納し始める。
When synchronization acquisition is established, data of the MPEG2-TS packet starts to be stored in the 188-
188バイトのメモリ1は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
DEMUX部7の後段にも片面188バイトの2面メモリ3aを配備し、Dステージを構成している。
A two-
Dステージでは、以下の処理が行われる。 In the D stage, the following processing is performed.
IFステージの後段に設けられている188バイトの2面メモリ1のうち、書き込みが終了している面から、MPEG2−TSデータを順次読み出す。
The MPEG2-TS data is sequentially read from the side where writing has been completed in the two-
読み出したMPEG2−TSパケットデータのうち、TSヘッダ部と、もし存在すればアダプテーション領域の制御データを、TS解析用レジスタ7a1に順次セットする。 Among the read MPEG2-TS packet data, the TS header portion and, if present, the control data of the adaptation area are sequentially set in the TS analysis register 7a1.
この読み出しアドレスは、MPEG2−TSパケットの188バイトのうち、どのバイトを読み出しているかの識別に用いられる。 This read address is used to identify which one of the 188 bytes of the MPEG2-TS packet is being read.
DステージでのMPEG2−TS解析、抽出分離のベースは、上記188バイトの2面メモリ1からの読み出しアドレスと、上記TS解析用レジスタ7a1の値とを参照し、MPEG2−TSパケットのデータ構造の解析が進められる。
The base of MPEG2-TS analysis and extraction / separation in the D stage refers to the read address from the 188-byte two-
2面メモリ1からの読み出しアドレスが、PIDを読み出し終了時点まで進んだ段階で、抽出分離指定されているPIDであるかどうかの判定が行われる。
At the stage where the read address from the two-
このPID判定では、セクション系かPES系か、PES系である場合は、独立PES系か、オーディオ系か、ビデオ系かの判定が行われる。 In this PID determination, if it is a section system, a PES system, or a PES system, it is determined whether it is an independent PES system, an audio system, or a video system.
トランスポートスクランブルコントロール、アダプテーションフィールドコントロール、コンティニュティカウンター値を、TS解析用レジスタ7a1にセットする。 The transport scramble control, adaptation field control, and continuity counter value are set in the TS analysis register 7a1.
コンティニュティカウンター値とアダプテーションフィールドコントロール値とをチェックし、廃棄対象のペイロードを持ったMPEG2−TSパケットであるかどうかの判定と、アダプテーション領域の有無、ペイロードの有無が判断される。 The continuity counter value and the adaptation field control value are checked to determine whether the packet is an MPEG2-TS packet having a payload to be discarded, whether there is an adaptation area, and whether there is a payload.
次に、アダプテーションフィールドが存在する場合は、引き続きTS解析用レジスタ7a1にアダプテーション領域のデータをセットする。 Next, if there is an adaptation field, the data in the adaptation area is continuously set in the TS analysis register 7a1.
アダプテーション領域の先頭はアダプテーションレングスであり、このレングスをチェックして、その値が0でなければ、アダプテーションレングス値をアダプテーションレングスカウンタへセットし、ダウンカウントを開始する。アダプテーションレングスが0である場合は、次のバイトは、セクション系データの場合はポインタフィールドとなり、PES系データの場合はPESの先頭バイトであると判断する。 The beginning of the adaptation area is the adaptation length, and this length is checked. If the value is not 0, the adaptation length value is set in the adaptation length counter, and down-counting is started. When the adaptation length is 0, it is determined that the next byte is a pointer field in the case of section data, and the first byte of the PES in the case of PES data.
アダプテーションレングスが0でない場合は、次のバイトが、PCRフラグ(PCRを含んだMPEG2−TSパケットかどうかの識別子)とか、含んでいるPCRが不連続PCRであるかどうかの識別子であるディスコンティニュティインディケータを、TS解析用レジスタ7a1にセットする。 If the adaptation length is not 0, the next byte includes a PCR flag (identifier indicating whether the packet is an MPEG2-TS packet including PCR) or a discontinuity indicating whether the included PCR is a discontinuous PCR. The tee indicator is set in the TS analysis register 7a1.
PCRフラグで、PCRがあることが判明すれば、PCRの抽出を行う。この時、システムデコーダ100dの時計であるSTCへPCR値をロードするか否かは、PCRのロード制御レジスタ値によって制御される。
If the PCR flag indicates that there is a PCR, the PCR is extracted. At this time, whether or not to load the PCR value to the STC which is the clock of the
ディスコンティニュティインディケータがセットされていれば、MPEG2−TSパケットに含まれているPCRが、不連続PCRであると判断する。不連続PCRのSTCへのロード制御は、PCRのロード制御レジスタ値によって制御される。 If the discontinuity indicator is set, it is determined that the PCR included in the MPEG2-TS packet is a discontinuous PCR. The load control of the discontinuous PCR to the STC is controlled by the PCR load control register value.
不連続PCRのSTCへのロードは、SDRAM4に既に蓄えられているビデオES、オーディオESのタイムスタンプ値との関係が不連続になることも意味しているので、既に蓄えられているAVフレームデータ(ビデオES/オーディオES)に対応したタイムスタンプのValidビットを無効化する。ここで、このValidビットは、タイムスタンプ値が有効か無効かの識別に用いられる。有効な場合は、システムデコーダ100dからフレームデータを出力すべき時刻まで待たせる処理を行う時に、STCとの比較に用いるタイムスタンプ値として利用される。無効な場合は、出力すべき時刻まで待たせる処理は行われない。
The loading of the discontinuous PCR into the STC also means that the relationship with the time stamp values of the video ES and audio ES already stored in the
アダプテーションフィールドが終了すると、PIDフィルタリングの結果が、セクション系であるか、PES系であるかで、処理が分岐される。 When the adaptation field ends, the process branches depending on whether the PID filtering result is a section system or a PES system.
TSヘッダ部のユニットスタートインディケータがセットされている場合は、セクション系の場合はセクションの先頭データを含むため、ペイロードの前に1バイトのポインタフィールドがあると判断される。また、PES系の場合はペイロードの先頭からPESデータが格納されていると判断される。 When the unit start indicator of the TS header is set, it is determined that there is a 1-byte pointer field in front of the payload because the section head includes section start data. In the case of the PES system, it is determined that PES data is stored from the beginning of the payload.
セクション系の場合は、セクション解析用レジスタ7a2に、セクションヘッダ部がセットされる。 In the case of a section system, a section header part is set in the section analysis register 7a2.
セクションの先頭バイトはテーブルIDである。セクションのフィルタリングは、セクションヘッダ部が揃ってから実施されるが、テーブルIDでMPEG2−TSパケットが終了する場合もある。この場合は、PIDとテーブルIDとでのフィルタリングを実施し、継続フラグが立っているかどうかを確認した後、継続フラグがセットされていなければ、セクション用フィルタのどの番号のフィルタでMPEG2−TSパケットを跨いだセクションを受信したかを記憶しておくための継続フラグをセットする。 The first byte of the section is a table ID. Section filtering is performed after the section headers are aligned, but the MPEG2-TS packet may end with a table ID. In this case, filtering by PID and table ID is performed and it is confirmed whether or not the continuation flag is set. Sets a continuation flag for storing whether or not a section straddling has been received.
ここで、継続フラグは、全てのフィルタに対で装備される。 Here, the continuation flag is provided in pairs for all the filters.
継続フラグのクリアは、継続フラグがセットされているフィルタにヒットしたMPEG2−TSパケットに格納されている、TSヘッダ部のユニットスタートインディケータが1であった場合に実施する。このMPEG2−TSパケットで継続してきたセクションが終了し、新たなセクションが格納されていると判断し、継続フラグがクリアされる。 The continuation flag is cleared when the unit start indicator in the TS header portion stored in the MPEG2-TS packet that hits the filter for which the continuation flag is set is 1. The section continued in the MPEG2-TS packet ends, and it is determined that a new section is stored, and the continuation flag is cleared.
ここで、MPEG2−TSパケットが、セクションヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、セクション解析用レジスタ7a2は、レジスタセットとしてセクションフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the section header portion, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the section analysis register 7a2 is a section filter as a register set. Installed for a few minutes.
PES系の場合、PES解析用レジスタ7a3に、PESヘッダ部がセットされる。 In the case of the PES system, the PES header portion is set in the PES analysis register 7a3.
PESヘッダの先頭は、パケットスタートコードプリフィックスの固定コード「000001」となっている。PESヘッダの先頭から8バイト目がPTSDTSフラグ(PTS,DTSであるタイムスタンプを含んでいるか否かの識別子)であり、タイムスタンプを含んでいる場合は、抽出を行う予定とされる。 The head of the PES header is a fixed code “000001” of the packet start code prefix. The 8th byte from the beginning of the PES header is a PTSDTS flag (an identifier indicating whether or not a time stamp that is PTS or DTS is included). If the time stamp is included, extraction is scheduled to be performed.
次のバイトがPESヘッダ長であり、PESヘッダ長の値が0でない場合は、PESヘッダ長ダウンカウンタに値がセットされ、ダウンカウントが行われる。 When the next byte is the PES header length and the value of the PES header length is not 0, a value is set in the PES header length down counter, and down counting is performed.
PESヘッダ長のダウンカウントが終了した時点に、ESデータの先頭バイトが存在する。 At the time when the PES header length down-count is completed, the first byte of the ES data exists.
ESデータの抽出では、このPESヘッダ部の削除処理を実施することで、ES抽出が実現される。 In the extraction of ES data, the ES extraction is realized by performing the deletion process of the PES header part.
MPEG2−TSパケットが、PESヘッダ部の途中で終了した場合は、PESヘッダ部のどのバイトから再開すればよいかは、PESヘッダ長のダウンカウンタ値と、継続フラグとによって判別されることとなる。 When the MPEG2-TS packet ends in the middle of the PES header part, it is determined from the PES header length down counter value and the continuation flag which byte of the PES header part should be resumed. .
ここで、MPEG2−TSパケットが、PESヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、PESヘッダ解析用レジスタ7a3は、レジスタセットとして、PID設定できるPESフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the PES header part, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the PES header analysis register 7a3 is a register set. There are as many PES filters as PID setting.
セクション系、PES系いずれの場合も、188バイトのメモリ1からの読み出しアドレスで、MPEG2−TSパケットのどのバイトを処理しているか、MPEG2−TSの終了を認識し、継続フラグをセットするか否かの判定が行われる。
Whether the section system or the PES system is used, the 188-byte read address from the
その後、MediaI/F部8からSDRAM4への書き込みが、SDRAM書き込みステージ(Wステージ)となる。
Thereafter, the writing from the Media I /
Wステージでは、以下の処理が行われる。 In the W stage, the following processing is performed.
Dステージの後段に設けられている188バイトの2面メモリ3aのうち、書き込みが終了している面のデータが、SDRAM4へ書き込まれる。
Of the two-
書き込み単位は、セクション、PES、ESいずれも、MPEG2−TSパケットの188バイトから抽出分離したデータ単位となる。ここで、セクションの場合は、13バイトのものもあり、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、14個となる。PES系の場合、Wステージでの最大書き込み先(SDRAM4での書き込み先領域)数は、1個となる。これは、PES系の場合は一つのMPEG2−TSパケットに複数個のPESパケットが格納されていることがないためである。 The writing unit is a data unit extracted and separated from 188 bytes of the MPEG2-TS packet for all sections, PES, and ES. Here, some sections have 13 bytes, and the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is 14. In the case of the PES system, the maximum number of write destinations (write destination areas in the SDRAM 4) in the W stage is one. This is because in the case of the PES system, a plurality of PES packets are not stored in one MPEG2-TS packet.
Wステージの期間内に、SDRAM4への書き込みが終了しない場合は、188バイトの2面メモリ3aが破綻するので、バスエラー割り込みが発生される。
If writing to the
これら各ステージに存在する2面メモリ1,3aで、TSパケット単位(188バイト単位)のパイプライン動作が区切られている。以上が、システムデコーダ100dの前半処理部となる。システムデコーダ100dの前半処理部の3段パイプライン動作は、図4に示した通りである。
Pipeline operations in units of TS packets (in units of 188 bytes) are delimited by the two-
(3)システムデコーダ100dの後半処理部
システムデコーダ100dの後半処理部の基本構成は、図21に示したブロック図の通りである。システムデコーダ100dの後半処理部では、SDRAM4に書き込まれたデータが読み出され、AV同期をとって、システムデコーダ100dから出力される。ここで、SDRAM4からの読み出し以降の処理は、TSパケット単位のパイプライン動作とは無関係に動作する。
(3) Second Half Processing Unit of
(4)Demux処理
(4−1)DEMUX部7の構成
以下、主にPESデコーダからES抽出処理を含めたDemux処理について説明する。ここでは、DEMUX部7のDステージの動作説明を行う。Dステージには、PIDフィルタ動作部7b、TS解析部7a、Section解析部7a2、PES解析部7a3、及び分離結果を一時記憶しておくためのSRAM部3aがある。Dステージ及びWステージの動作を示すタイミングチャートは、図9に示した通りである。
(4) Demux Processing (4-1) Configuration of
(4−2)DEMUX部7の処理
TS−IF部5の後段に接続されている2面メモリ1から、TSパケットデータが1パケット分(0バイト目から187バイト目まで)読み出される。この読み出しのアドレスで、TSパケットの先頭から何番目のデータであるかが識別される。このTSパケットは、読み出しアドレス値に応じて、TS解析部7aに設けられているレジスタ7a1に格納される。TS解析部7aで格納対象とされているTSデータは、TSヘッダ部のデータと、アダプテーションに相当するデータの一部、及び、セクションの場合はポインタフィールドが保持される。
(4-2) Processing of
ここで、TS解析部7aのレジスタ7a1にPIDまでの情報が書き込まれた段階で、TSパケットの種別の大分類(セクションか、ビデオか、オーディオか、独立PESか)が行われる。この結果によって、セクション系かPES系(ビデオ、オーディオ、独立PES)かの識別が可能である。この結果を利用して、セクション解析部のレジスタ7a2を用いるのか、PES解析部のレジスタ7a3を用いるのかが判断される。
Here, when the information up to the PID is written in the register 7a1 of the
PES系であった場合、このPES解析部のレジスタ7a3に、PESヘッダに対応する情報のうち必要な部分(PES先頭から13バイトで、PESヘッダ長を含む)のみが格納される。ここで、アダプテーションのサイズによっては、PESのヘッダがTSパケットの単位(188バイト)よりも大きい場合があり得る。従って、PESデコードを行うフィルタ数分のレジスタ7a3が搭載されており、各レジスタ7a3は、書き込んだ位置を把握できるPESヘッダライトポインタを有している。TSパケットを跨いだ場合は、このPESヘッダライトポインタが停止される。ここで、TSパケットが終了するまでにPESヘッダ長のダウンカウンタ値が終了しなかった場合には、PESヘッダ部でTSパケットを跨ったことになる。一方、TSパケットが終了するまでにPESヘッダ長のダウンカウンタが終了した場合には、PESヘッダ部以降でTSパケットを跨いだことになる。PESヘッダ長のダウンカウンタ終了時点で、PESヘッダライトポインタはクリアされる。継続して受信再開する場合の動作は、PIDでのフィルタヒット判定と、PID別で管理しているPESヘッダライトポインタとを参照することで、PESヘッダの情報抽出を再開可能となる。なお、PESはPIDのみでフィルタリングが可能なため、特に継続フラグは必要ない。 In the case of the PES system, only the necessary portion (13 bytes from the beginning of the PES and including the PES header length) of the information corresponding to the PES header is stored in the register 7a3 of the PES analysis unit. Here, depending on the size of the adaptation, the PES header may be larger than the TS packet unit (188 bytes). Therefore, registers 7a3 corresponding to the number of filters for performing PES decoding are mounted, and each register 7a3 has a PES header write pointer that can grasp the written position. When straddling TS packets, this PES header write pointer is stopped. Here, when the down counter value of the PES header length does not end by the end of the TS packet, the TS packet is straddled by the PES header portion. On the other hand, when the PES header length down counter is completed before the TS packet is completed, the TS packet is straddled after the PES header part. At the end of the PES header length down counter, the PES header write pointer is cleared. In the case of continuous reception restart, the PES header information extraction can be restarted by referring to the filter hit determination by PID and the PES header write pointer managed for each PID. Since PES can be filtered only by PID, no continuation flag is required.
セクション系であった場合、セクション解析部のレジスタ7a2に、セクションヘッダに対応する情報のうち必要な部分(セクションの先頭から6バイト分。但しセクション長にも依存する)のみが格納される。ここで、アダプテーションのサイズに依存して、セクションヘッダ部に相当するデータをセクション解析部のレジスタ7a2に格納終了する前に、TSパケットが終了してしまうことがあり得る。そのため、セクション解析部でも、セクションヘッダをどこまで書き込んだかを把握できるように、セクションヘッダライトポインタを各々持つとともに、フィルタ番号毎に継続フラグが設けられている。セクションヘッダライトポインタ値と継続フラグとを参照することで、TSパケットを跨いだ後、暫くして後続のセクション部のデータを受信した場合であっても、セクションヘッダの情報抽出を再開可能となる。 In the case of a section system, only the necessary portion (for 6 bytes from the beginning of the section, depending on the section length) of the information corresponding to the section header is stored in the register 7a2 of the section analysis section. Here, depending on the size of the adaptation, the TS packet may end before the data corresponding to the section header section is stored in the register 7a2 of the section analysis section. For this reason, each section analysis unit has a section header write pointer and a continuation flag for each filter number so that the section analysis unit can grasp how much the section header has been written. By referring to the section header write pointer value and the continuation flag, the section header information extraction can be resumed even if the data of the subsequent section is received for a while after straddling the TS packet. .
次に、TSパケット単位を超えた場合の処理について説明する。 Next, processing when the TS packet unit is exceeded will be described.
セクション系の場合、受信したセクションデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、(a)セクションヘッダ部をセクション解析部のレジスタ7a2に格納終了できたかどうかの判断と、(b)セクションヘッダ部に存在するセクション長情報により、TSパケット終了時点(188バイト目)で、セクション長のダウンカウントが終了しているかどうかとの判断とによって行われる。TSパケットに納まっていないと判断された場合は、フィルタにヒットしている番号の継続フラグをセットするとともに、セクション長のダウンカウンタ値をクリアする。 In the case of the section system, the determination as to whether the received section data is data that can be contained in the TS packet or not can be made as follows: The determination is made based on the determination and (b) whether or not the section length down-count is completed at the end of the TS packet (at the 188th byte) based on the section length information existing in the section header section. If it is determined that it is not contained in the TS packet, the continuation flag of the number hitting the filter is set and the section length down counter value is cleared.
なお、継続フラグのクリアは、同一フィルタにヒットしたTSパケットの、TSヘッダ情報部にあるunit_start_indicatorの値が1である場合、このTSパケットで、継続してきたセクションが終了するとともに、新たなセクションが格納されていると判断する。ここで、新たなセクションの開始位置は、pointer_fieldで示される。 In addition, when the value of unit_start_indicator in the TS header information part of the TS packet that hits the same filter is 1, the continuation flag is cleared. Judge that stored. Here, the start position of the new section is indicated by pointer_field.
PES系の場合、受信したPESデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、PESヘッダ部についてのみ実施される。 In the case of the PES system, the determination as to whether the received PES data is data that fits in the TS packet or data that does not fit is performed only for the PES header part.
PESヘッダライトポインタ(PESヘッダをどこまでPES解析部のレジスタ7a3に格納できたかを示すポインタ。PESヘッダ長による終了で、PESヘッダ終了と判断される。)が終了していない状態で、TSパケットが終了(188バイト目)した場合、PESヘッダがTSパケットを跨ったと判断し、フィルタにヒットしている番号の継続フラグがセットされる。この継続フラグは、PES解析部で複数セット設けられているレジスタセットのうちのどのレジスタセットかを識別するのに用いられる。 In a state where the PES header write pointer (pointer indicating how far the PES header has been stored in the register 7a3 of the PES analysis unit. It is determined that the PES header has ended due to the end of the PES header length) has not ended. When the process ends (at the 188th byte), it is determined that the PES header has straddled the TS packet, and the continuation flag of the number hitting the filter is set. This continuation flag is used to identify which register set of a plurality of register sets provided in the PES analysis unit.
PESヘッダ解析部が持っている継続フラグは、PESヘッダ部をPES解析部のレジスタ7a3に格納終了すると、クリアされる。 The continuation flag possessed by the PES header analysis unit is cleared when the PES header unit is stored in the register 7a3 of the PES analysis unit.
PESヘッダ部以降のPESデータ自体は、PIDのみで分離識別可能であるため、PESの長さ情報は参照されない。その代わり、TSパケットヘッダ部にあるunit_start_indicatorでPESの先頭を識別し、PESデータの先頭から分離抽出が行われる。 Since the PES data itself after the PES header part can be separated and identified only by the PID, the PES length information is not referred to. Instead, the beginning of the PES is identified by unit_start_indicator in the TS packet header portion, and separation and extraction are performed from the beginning of the PES data.
以下、抽出分離結果を一時保持するためのSRAM(2面メモリ)3aについて説明する。 Hereinafter, the SRAM (two-sided memory) 3a for temporarily holding the extraction / separation result will be described.
188バイトの塊であるTSパケットから必要なデータがフィルタリングされ、分離抽出対象と判断されたデータが、SRAM3aに格納される。本実施の形態4に係るシステムデコーダ100dでは、図23に示したように、セクション/独立PES系、オーディオ系、及びビデオ系に共通する2面SRAM(188バイトのメモリ×2個)3aが設けられている。
Necessary data is filtered from the TS packet which is a lump of 188 bytes, and the data determined to be separated and extracted is stored in the
(5)Wステージの処理
Wステージでは、Dステージの最終段にある188バイトの2面メモリ3aからSDRAM4へのデータの転送及び書き込みが行われる。Wステージも、1TSパケット期間のステージとなる。SRAM3aからSDRAM4へ書き込まれるデータには、セクション、独立PES、オーディオPES、及びビデオESがある。
(5) W Stage Processing In the W stage, data is transferred and written from the 188-byte two-
セクションの書き込みでは、SDRAM4の複数領域への書き込みが発生する場合がある。マルチセクションにおいては、1TSパケット内に複数個の異なるセクションが格納されている場合があり、この場合はSDRAM4への書き込み領域がセクションごとに異なるためである。
In section writing, writing to a plurality of areas of the
独立PES、オーディオPES、及びビデオESの場合は、1TSパケット期間単位の動作において、SDRAM4への書き込み領域が異なる事態は発生しない。
In the case of an independent PES, an audio PES, and a video ES, a situation in which the write area to the
以上により、PESデータからPESヘッダ部を削除した後のESデータを抽出してSDRAM4に蓄えることができ、時刻管理を行いながらSDRAM4から必要なデータを読み出して、後段のビデオデコーダやオーディオデコーダにESを提供できるシステムデコーダ100dを構成することができる。
As described above, the ES data after the PES header portion is deleted from the PES data can be extracted and stored in the
本実施の形態4に係るシステムデコーダ100dによると、TSパケット単位で処理が完結するパイプライン動作が可能であるため、PESデコーダ専用の大規模なメモリが不要となる。そのため、オンチップ又はオフチップでPESデコード用メモリを構成した場合と比較して、チップ製造コストを低減できる効果がある。また、PESデコーダ専用の大規模メモリが不要となるため、このメモリへのアクセスが削減できる。そのため、外部バスの帯域を他のアクセスへ割り振ることが可能となる。例えば、CPUがSDRAM4をワークメモリとして用いるためのアクセス帯域として割り振ることも可能となる。しかも、外部メモリアクセスが低減したので、外部アクセス周波数を下げることが可能となって消費電力が低減されるとともに、外部ピン数を削減できるためチップ製造コストを低減できる。
According to the
しかも、図22に示した上記実施の形態3に係るシステムデコーダ100cから、デスクランブル部6及び2面メモリ2が省略されているため、システムデコーダ100cと比較して回路規模を削減することができる。
In addition, since the
実施の形態5.
(1)システムデコーダ100eの基本構成
図24は、本発明の実施の形態5に係るシステムデコーダ100eの前半処理部の構成を示すブロック図である。図24に示すように、システムデコーダ100eの前半処理部は、MPEG2−TS入力を受けて188バイトの同期をとるTS−IF部5と、TS−IF部5の出力を受けてDemux処理を行うDEMUX部7と、DEMUX部7から出力されたデータをSDRAM4に書き込むMediaI/F部8とを備えて構成されている。MediaI/F部8は、書き込み部8aとMediaBusI/F部8bとを有している。
(1) Basic Configuration of System Decoder 100e FIG. 24 is a block diagram showing the configuration of the first half processing unit of the system decoder 100e according to
まず、システムデコーダ100eにおけるTSパケット単位でのパイプライン構成を説明し、その後、PESデコーダまで含めたDemux処理を可能としているアーキテクチャについて説明する。 First, a pipeline configuration in units of TS packets in the system decoder 100e will be described, and then an architecture that enables Demux processing including the PES decoder will be described.
(2)システムデコーダ100eのパイプライン構成
システムデコーダ100eのTSパケット単位でのパイプライン動作としては、TS−IF部5の後段に片面188バイトの2面メモリ1を配備し、IFステージを構成している。
(2) Pipeline configuration of system decoder 100e As a pipeline operation in units of TS packets of the system decoder 100e, a two-
IFステージでは、以下の処理が行われる。 In the IF stage, the following processing is performed.
入力クロック(TSCLK)と共に送られてくるMPEG2−TSデータ(TSDATA)を、TSCLKで取り込む。この際、TSDATAと同時に送られてくるデータバリッド(TSVALID)を参照し、有効なデータである場合にのみ取り込みを行う。また、取り込み単位は、1バイト単位又は1ビット単位となり、選択が可能である。 MPEG2-TS data (TSDATA) sent together with the input clock (TSCLK) is captured by TSCLK. At this time, the data valid (TSVALID) sent simultaneously with TSDATA is referred to, and the data is taken in only when it is valid data. In addition, the capture unit can be selected in units of 1 byte or 1 bit.
MPEG2−TSパケットの先頭データである「47」コードを検索し、188バイト毎に「47」コードが存在することを確認し、同期捕捉を行う。 The “47” code which is the head data of the MPEG2-TS packet is searched, and it is confirmed that the “47” code exists every 188 bytes.
同期捕捉候補処理を高速化させるため、独立で動作する複数個のカウンタを搭載し、複数個の同期捕捉候補を扱う。いずれかの同期捕捉候補の同期捕捉が成立した段階で、他の同期捕捉候補をキャンセルする。 In order to speed up the synchronization acquisition candidate processing, a plurality of counters that operate independently are mounted to handle a plurality of synchronization acquisition candidates. When the synchronization acquisition of any one of the synchronization acquisition candidates is established, the other synchronization acquisition candidates are canceled.
同期捕捉が成立すると、MPEG2−TSパケットのデータを、先頭の「47」コードから順に、188バイトのメモリ1に格納し始める。
When synchronization acquisition is established, data of the MPEG2-TS packet starts to be stored in the 188-
188バイトのメモリ1は2面あり、1面全ての書き込みが終了した面は、後段のパイプラインステージからの読み出し面に切り替わる。
The 188-
DEMUX部7の後段にレジスタセット20を配備し、Dステージを構成している。
A register set 20 is provided at the subsequent stage of the
Dステージでは、以下の処理が行われる。 In the D stage, the following processing is performed.
IFステージの後段に設けられている188バイトの2面メモリ1のうち、書き込みが終了している面から、MPEG2−TSデータを順次読み出す。
The MPEG2-TS data is sequentially read from the side where writing has been completed in the two-
読み出したMPEG2−TSパケットデータのうち、TSヘッダ部と、もし存在すればアダプテーション領域の制御データを、TS解析用レジスタ7a1に順次セットする。 Among the read MPEG2-TS packet data, the TS header portion and, if present, the control data of the adaptation area are sequentially set in the TS analysis register 7a1.
この読み出しアドレスは、MPEG2−TSパケットの188バイトのうち、どのバイトを読み出しているかの識別に用いられる。 This read address is used to identify which one of the 188 bytes of the MPEG2-TS packet is being read.
DステージでのMPEG2−TS解析、抽出分離のベースは、上記188バイトの2面メモリ1からの読み出しアドレスと、上記TS解析用レジスタ7a1の値とを参照し、MPEG2−TSパケットのデータ構造の解析が進められる。
The base of MPEG2-TS analysis and extraction / separation in the D stage refers to the read address from the 188-byte two-
2面メモリ1からの読み出しアドレスが、PIDを読み出し終了時点まで進んだ段階で、抽出分離指定されているPIDであるかどうかの判定が行われる。
At the stage where the read address from the two-
このPID判定では、セクション系かPES系か、PES系である場合は、独立PES系か、オーディオ系か、ビデオ系かの判定が行われる。 In this PID determination, if it is a section system, a PES system, or a PES system, it is determined whether it is an independent PES system, an audio system, or a video system.
トランスポートスクランブルコントロール、アダプテーションフィールドコントロール、コンティニュティカウンター値を、TS解析用レジスタ7a1にセットする。 The transport scramble control, adaptation field control, and continuity counter value are set in the TS analysis register 7a1.
コンティニュティカウンター値とアダプテーションフィールドコントロール値とをチェックし、廃棄対象のペイロードを持ったMPEG2−TSパケットであるかどうかの判定と、アダプテーション領域の有無、ペイロードの有無が判断される。 The continuity counter value and the adaptation field control value are checked to determine whether the packet is an MPEG2-TS packet having a payload to be discarded, whether there is an adaptation area, and whether there is a payload.
次に、アダプテーションフィールドが存在する場合は、引き続きTS解析用レジスタ7a1にアダプテーション領域のデータをセットする。 Next, if there is an adaptation field, the data in the adaptation area is continuously set in the TS analysis register 7a1.
アダプテーション領域の先頭はアダプテーションレングスであり、このレングスをチェックして、その値が0でなければ、アダプテーションレングス値をアダプテーションレングスカウンタへセットし、ダウンカウントを開始する。アダプテーションレングスが0である場合は、次のバイトは、セクション系データの場合はポインタフィールドとなり、PES系データの場合はPESの先頭バイトであると判断する。 The beginning of the adaptation area is the adaptation length, and this length is checked. If the value is not 0, the adaptation length value is set in the adaptation length counter, and down-counting is started. When the adaptation length is 0, it is determined that the next byte is a pointer field in the case of section data, and the first byte of the PES in the case of PES data.
アダプテーションレングスが0でない場合は、次のバイトが、PCRフラグ(PCRを含んだMPEG2−TSパケットかどうかの識別子)とか、含んでいるPCRが不連続PCRであるかどうかの識別子であるディスコンティニュティインディケータを、TS解析用レジスタ7a1にセットする。 If the adaptation length is not 0, the next byte includes a PCR flag (identifier indicating whether the packet is an MPEG2-TS packet including PCR) or a discontinuity indicating whether the included PCR is a discontinuous PCR. The tee indicator is set in the TS analysis register 7a1.
PCRフラグで、PCRがあることが判明すれば、PCRの抽出を行う。この時、システムデコーダ100eの時計であるSTCへPCR値をロードするか否かは、PCRのロード制御レジスタ値によって制御される。 If the PCR flag indicates that there is a PCR, the PCR is extracted. At this time, whether or not to load the PCR value to the STC which is the clock of the system decoder 100e is controlled by the load control register value of the PCR.
ディスコンティニュティインディケータがセットされていれば、MPEG2−TSパケットに含まれているPCRが、不連続PCRであると判断する。不連続PCRのSTCへのロード制御は、PCRのロード制御レジスタ値によって制御される。 If the discontinuity indicator is set, it is determined that the PCR included in the MPEG2-TS packet is a discontinuous PCR. The load control of the discontinuous PCR to the STC is controlled by the PCR load control register value.
不連続PCRのSTCへのロードは、SDRAM4に既に蓄えられているビデオES、オーディオESのタイムスタンプ値との関係が不連続になることも意味しているので、既に蓄えられているAVフレームデータ(ビデオES/オーディオES)に対応したタイムスタンプのValidビットを無効化する。ここで、このValidビットは、タイムスタンプ値が有効か無効かの識別に用いられる。有効な場合は、システムデコーダ100eからフレームデータを出力すべき時刻まで待たせる処理を行う時に、STCとの比較に用いるタイムスタンプ値として利用される。無効な場合は、出力すべき時刻まで待たせる処理は行われない。
The loading of the discontinuous PCR into the STC also means that the relationship with the time stamp values of the video ES and audio ES already stored in the
アダプテーションフィールドが終了すると、PIDフィルタリングの結果が、セクション系であるか、PES系であるかで、処理が分岐される。 When the adaptation field ends, the process branches depending on whether the PID filtering result is a section system or a PES system.
TSヘッダ部のユニットスタートインディケータがセットされている場合は、セクション系の場合はセクションの先頭データを含むため、ペイロードの前に1バイトのポインタフィールドがあると判断される。また、PES系の場合はペイロードの先頭からPESデータが格納されていると判断される。 When the unit start indicator of the TS header is set, it is determined that there is a 1-byte pointer field in front of the payload because the section head includes section start data. In the case of the PES system, it is determined that PES data is stored from the beginning of the payload.
セクション系の場合は、セクション解析用レジスタ7a2に、セクションヘッダ部がセットされる。 In the case of a section system, a section header part is set in the section analysis register 7a2.
セクションの先頭バイトはテーブルIDである。セクションのフィルタリングは、セクションヘッダ部が揃ってから実施されるが、テーブルIDでMPEG2−TSパケットが終了する場合もある。この場合は、PIDとテーブルIDとでのフィルタリングを実施し、継続フラグが立っているかどうかを確認した後、継続フラグがセットされていなければ、セクション用フィルタのどの番号のフィルタでMPEG2−TSパケットを跨いだセクションを受信したかを記憶しておくための継続フラグをセットする。 The first byte of the section is a table ID. Section filtering is performed after the section headers are aligned, but the MPEG2-TS packet may end with a table ID. In this case, filtering by PID and table ID is performed and it is confirmed whether or not the continuation flag is set. Sets a continuation flag for storing whether or not a section straddling has been received.
ここで、継続フラグは、全てのフィルタに対で装備される。 Here, the continuation flag is provided in pairs for all the filters.
継続フラグのクリアは、継続フラグがセットされているフィルタにヒットしたMPEG2−TSパケットに格納されている、TSヘッダ部のユニットスタートインディケータが1であった場合に実施する。このMPEG2−TSパケットで継続してきたセクションが終了し、新たなセクションが格納されていると判断し、継続フラグがクリアされる。 The continuation flag is cleared when the unit start indicator in the TS header portion stored in the MPEG2-TS packet that hits the filter for which the continuation flag is set is 1. The section continued in the MPEG2-TS packet ends, and it is determined that a new section is stored, and the continuation flag is cleared.
ここで、MPEG2−TSパケットが、セクションヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、セクション解析用レジスタ7a2は、レジスタセットとしてセクションフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the section header portion, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the section analysis register 7a2 is a section filter as a register set. Installed for a few minutes.
PES系の場合、PES解析用レジスタ7a3に、PESヘッダ部がセットされる。 In the case of the PES system, the PES header portion is set in the PES analysis register 7a3.
PESヘッダの先頭は、パケットスタートコードプリフィックスの固定コード「000001」となっている。PESヘッダの先頭から8バイト目がPTSDTSフラグ(PTS,DTSであるタイムスタンプを含んでいるか否かの識別子)であり、タイムスタンプを含んでいる場合は、抽出を行う予定とされる。 The head of the PES header is a fixed code “000001” of the packet start code prefix. The 8th byte from the beginning of the PES header is a PTSDTS flag (an identifier indicating whether or not a time stamp that is PTS or DTS is included). If the time stamp is included, extraction is scheduled to be performed.
次のバイトがPESヘッダ長であり、PESヘッダ長の値が0でない場合は、PESヘッダ長ダウンカウンタに値がセットされ、ダウンカウントが行われる。 When the next byte is the PES header length and the value of the PES header length is not 0, a value is set in the PES header length down counter, and down counting is performed.
PESヘッダ長のダウンカウントが終了した時点に、ESデータの先頭バイトが存在する。 At the time when the PES header length down-count is completed, the first byte of the ES data exists.
ESデータの抽出では、このPESヘッダ部の削除処理を実施することで、ES抽出が実現される。 In the extraction of ES data, the ES extraction is realized by performing the deletion process of the PES header part.
MPEG2−TSパケットが、PESヘッダ部の途中で終了した場合は、PESヘッダ部のどのバイトから再開すればよいかは、PESヘッダ長のダウンカウンタ値と、継続フラグとによって判別されることとなる。 When the MPEG2-TS packet ends in the middle of the PES header part, it is determined from the PES header length down counter value and the continuation flag which byte of the PES header part should be resumed. .
ここで、MPEG2−TSパケットが、PESヘッダ部の途中で終了する場合、次のMPEG2−TSパケットデータが、続きのパケットデータとは限らないため、PESヘッダ解析用レジスタ7a3は、レジスタセットとして、PID設定できるPESフィルタ数分搭載されている。 Here, when the MPEG2-TS packet ends in the middle of the PES header part, the next MPEG2-TS packet data is not necessarily the subsequent packet data, so the PES header analysis register 7a3 is a register set. There are as many PES filters as PID setting.
セクション系、PES系いずれの場合も、188バイトのメモリ2からの読み出しアドレスで、MPEG2−TSパケットのどのバイトを処理しているか、MPEG2−TSの終了を認識し、継続フラグをセットするか否かの判定が行われる。
Whether the section system or the PES system is used, the 188-byte read address from the
その後、MediaI/F部8からSDRAM4への書き込みが随時行われる。ここでは、以下の処理が行われる。
Thereafter, writing from the Media I /
Dステージの後段に設けられているレジスタセット20のうち、書き込みが終了しているレジスタのデータが、SDRAM4へ書き込まれる。ここで、レジスタセット20は2個のレジスタから成り、各レジスタの容量は、SDRAM4への書き込みトランザクション単位である。
Of the register set 20 provided after the D stage, the data of the register for which writing has been completed is written to the
書き込み単位は、Storeトランザクションで発行可能なサイズとなる。セクション、PES、ESいずれも、MPEG2−TSパケットの188バイトから抽出分離した数バイト程度のデータ単位となる。 The write unit is a size that can be issued by a Store transaction. Each of the section, PES, and ES is a data unit of about several bytes extracted and separated from 188 bytes of the MPEG2-TS packet.
SDRAM4への書き込み処理はDステージで実行されるが、Dステージの期間内にSDRAM4への書き込みが終了しない場合は、バスエラー割り込みが発生される。
The writing process to the
IFステージの後段に接続されている2面メモリ1で、TSパケット単位(188バイト単位)のパイプライン動作が区切られている。以上が、システムデコーダ100eの前半処理部となる。システムデコーダ100eの前半処理部の2段パイプライン動作は、図6に示した通りである。
Pipeline operations in units of TS packets (in units of 188 bytes) are delimited in the two-
(3)システムデコーダ100eの後半処理部
システムデコーダ100eの後半処理部の基本構成は、図21に示したブロック図の通りである。システムデコーダ100eの後半処理部では、SDRAM4に書き込まれたデータが読み出され、AV同期をとって、システムデコーダ100eから出力される。ここで、SDRAM4からの読み出し以降の処理は、TSパケット単位のパイプライン動作とは無関係に動作する。
(3) Second Half Processing Unit of System Decoder 100e The basic configuration of the second half processing unit of the system decoder 100e is as shown in the block diagram of FIG. In the latter half processing unit of the system decoder 100e, the data written in the
(4)Demux処理
(4−1)DEMUX部7の構成
以下、主にPESデコーダからES抽出処理を含めたDemux処理について説明する。ここでは、DEMUX部7のDステージの動作説明を行う。Dステージには、PIDフィルタ動作部7b、TS解析部7a、Section解析部7a2、PES解析部7a3、及び分離結果を一時記憶しておくためのレジスタセット20がある。図25は、Dステージの動作を示すタイミングチャートである。
(4) Demux Processing (4-1) Configuration of
(4−2)DEMUX部7の処理
TS−IF部5の後段に接続されている2面メモリ1から、TSパケットデータが1パケット分(0バイト目から187バイト目まで)読み出される。この読み出しのアドレスで、TSパケットの先頭から何番目のデータであるかが識別される。このTSパケットは、読み出しアドレス値に応じて、TS解析部7aに設けられているレジスタ7a1に格納される。TS解析部7aで格納対象とされているTSデータは、TSヘッダ部のデータと、アダプテーションに相当するデータの一部、及び、セクションの場合はポインタフィールドが保持される。
(4-2) Processing of
ここで、TS解析部7aのレジスタ7a1にPIDまでの情報が書き込まれた段階で、TSパケットの種別の大分類(セクションか、ビデオか、オーディオか、独立PESか)が行われる。この結果によって、セクション系かPES系(ビデオ、オーディオ、独立PES)かの識別が可能である。この結果を利用して、セクション解析部のレジスタ7a2を用いるのか、PES解析部のレジスタ7a3を用いるのかが判断される。
Here, when the information up to the PID is written in the register 7a1 of the
PES系であった場合、このPES解析部のレジスタ7a3に、PESヘッダに対応する情報のうち必要な部分(PES先頭から13バイトで、PESヘッダ長を含む)のみが格納される。ここで、アダプテーションのサイズによっては、PESのヘッダがTSパケットの単位(188バイト)よりも大きい場合があり得る。従って、PESデコードを行うフィルタ数分のレジスタ7a3が搭載されており、各レジスタ7a3は、書き込んだ位置を把握できるPESヘッダライトポインタを有している。TSパケットを跨いだ場合は、このPESヘッダライトポインタが停止される。ここで、TSパケットが終了するまでにPESヘッダ長のダウンカウンタ値が終了しなかった場合には、PESヘッダ部でTSパケットを跨ったことになる。一方、TSパケットが終了するまでにPESヘッダ長のダウンカウンタが終了した場合には、PESヘッダ部以降でTSパケットを跨いだことになる。PESヘッダ長のダウンカウンタ終了時点で、PESヘッダライトポインタはクリアされる。継続して受信再開する場合の動作は、PIDでのフィルタヒット判定と、PID別で管理しているPESヘッダライトポインタとを参照することで、PESヘッダの情報抽出を再開可能となる。なお、PESはPIDのみでフィルタリングが可能なため、特に継続フラグは必要ない。 In the case of the PES system, only the necessary portion (13 bytes from the beginning of the PES and including the PES header length) of the information corresponding to the PES header is stored in the register 7a3 of the PES analysis unit. Here, depending on the size of the adaptation, the PES header may be larger than the TS packet unit (188 bytes). Therefore, registers 7a3 corresponding to the number of filters for performing PES decoding are mounted, and each register 7a3 has a PES header write pointer that can grasp the written position. When straddling TS packets, this PES header write pointer is stopped. Here, when the down counter value of the PES header length does not end by the end of the TS packet, the TS packet is straddled by the PES header portion. On the other hand, when the PES header length down counter is completed before the TS packet is completed, the TS packet is straddled after the PES header part. At the end of the PES header length down counter, the PES header write pointer is cleared. In the case of continuous reception restart, the PES header information extraction can be restarted by referring to the filter hit determination by PID and the PES header write pointer managed for each PID. Since PES can be filtered only by PID, no continuation flag is required.
セクション系であった場合、セクション解析部のレジスタ7a2に、セクションヘッダに対応する情報のうち必要な部分(セクションの先頭から6バイト分。但しセクション長にも依存する)のみが格納される。ここで、アダプテーションのサイズに依存して、セクションヘッダ部に相当するデータをセクション解析部のレジスタ7a2に格納終了する前に、TSパケットが終了してしまうことがあり得る。そのため、セクション解析部でも、セクションヘッダをどこまで書き込んだかを把握できるように、セクションヘッダライトポインタを各々持つとともに、フィルタ番号毎に継続フラグが設けられている。セクションヘッダライトポインタ値と継続フラグとを参照することで、TSパケットを跨いだ後、暫くして後続のセクション部のデータを受信した場合であっても、セクションヘッダの情報抽出を再開可能となる。 In the case of a section system, only the necessary portion (for 6 bytes from the beginning of the section, depending on the section length) of the information corresponding to the section header is stored in the register 7a2 of the section analysis section. Here, depending on the size of the adaptation, the TS packet may end before the data corresponding to the section header section is stored in the register 7a2 of the section analysis section. For this reason, each section analysis unit has a section header write pointer and a continuation flag for each filter number so that the section analysis unit can grasp how much the section header has been written. By referring to the section header write pointer value and the continuation flag, the section header information extraction can be resumed even if the data of the subsequent section is received for a while after straddling the TS packet. .
次に、TSパケット単位を超えた場合の処理について説明する。 Next, processing when the TS packet unit is exceeded will be described.
セクション系の場合、受信したセクションデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、(a)セクションヘッダ部をセクション解析部のレジスタ7a2に格納終了できたかどうかの判断と、(b)セクションヘッダ部に存在するセクション長情報により、TSパケット終了時点(188バイト目)で、セクション長のダウンカウントが終了しているかどうかとの判断とによって行われる。TSパケットに納まっていないと判断された場合は、フィルタにヒットしている番号の継続フラグをセットするとともに、セクション長のダウンカウンタ値をクリアする。 In the case of the section system, the determination as to whether the received section data is data that can be contained in the TS packet or not can be made as follows: The determination is made based on the determination and (b) whether or not the section length down-count is completed at the end of the TS packet (at the 188th byte) based on the section length information existing in the section header section. If it is determined that it is not contained in the TS packet, the continuation flag of the number hitting the filter is set and the section length down counter value is cleared.
なお、継続フラグのクリアは、同一フィルタにヒットしたTSパケットの、TSヘッダ情報部にあるunit_start_indicatorの値が1である場合、このTSパケットで、継続してきたセクションが終了するとともに、新たなセクションが格納されていると判断する。ここで、新たなセクションの開始位置は、pointer_fieldで示される。 In addition, when the value of unit_start_indicator in the TS header information part of the TS packet that hits the same filter is 1, the continuation flag is cleared. Judge that stored. Here, the start position of the new section is indicated by pointer_field.
PES系の場合、受信したPESデータが、TSパケットに納まるデータであるか、納まらないデータであるかの判断は、PESヘッダ部についてのみ実施される。 In the case of the PES system, the determination as to whether the received PES data is data that fits in the TS packet or data that does not fit is performed only for the PES header part.
PESヘッダライトポインタ(PESヘッダをどこまでPES解析部のレジスタ7a3に格納できたかを示すポインタ。PESヘッダ長による終了で、PESヘッダ終了と判断される。)が終了していない状態で、TSパケットが終了(188バイト目)した場合、PESヘッダがTSパケットを跨ったと判断し、フィルタにヒットしている番号の継続フラグがセットされる。この継続フラグは、PES解析部で複数セット設けられているレジスタセットのうちのどのレジスタセットかを識別するのに用いられる。 In a state where the PES header write pointer (pointer indicating how far the PES header has been stored in the register 7a3 of the PES analysis unit. It is determined that the PES header has ended due to the end of the PES header length) has not ended. When the process ends (at the 188th byte), it is determined that the PES header has straddled the TS packet, and the continuation flag of the number hitting the filter is set. This continuation flag is used to identify which register set of a plurality of register sets provided in the PES analysis unit.
PESヘッダ解析部が持っている継続フラグは、PESヘッダ部をPES解析部のレジスタ7a3に格納終了すると、クリアされる。 The continuation flag possessed by the PES header analysis unit is cleared when the PES header unit is stored in the register 7a3 of the PES analysis unit.
PESヘッダ部以降のPESデータ自体は、PIDのみで分離識別可能であるため、PESの長さ情報は参照されない。その代わり、TSパケットヘッダ部にあるunit_start_indicatorでPESの先頭を識別し、PESデータの先頭から分離抽出が行われる。 Since the PES data itself after the PES header part can be separated and identified only by the PID, the PES length information is not referred to. Instead, the beginning of the PES is identified by unit_start_indicator in the TS packet header portion, and separation and extraction are performed from the beginning of the PES data.
以下、抽出分離結果を一時保持するためのレジスタセット20について説明する。 Hereinafter, the register set 20 for temporarily holding the extraction / separation result will be described.
188バイトの塊であるTSパケットから必要なデータがフィルタリングされ、分離抽出対象と判断されたデータが、Storeトランザクション単位でレジスタセット20に格納される。従って、各数バイト(一例として8バイト)程度の2個のレジスタによってレジスタセット20を構成すれば十分となる。 Necessary data is filtered from the TS packet that is a lump of 188 bytes, and the data determined to be separated and extracted is stored in the register set 20 in units of Store transactions. Accordingly, it is sufficient to configure the register set 20 with two registers each having a few bytes (eight bytes as an example).
(5)DステージのSDRAM書き込み処理
Dステージの最終段にある各8バイトの2面レジスタセット20からSDRAM4へのデータの転送及び書き込みが行われる。SDRAM4への書き込みは、Dステージの1TSパケット期間内に処理される。レジスタセット20からSDRAM4へ書き込まれるデータには、セクション、独立PES、オーディオPES、及びビデオESがある。
(5) D-stage SDRAM write processing Data is transferred and written from the 8-byte two-sided register set 20 in the final stage of the D stage to the
セクションの書き込みでは、SDRAM4の複数領域への書き込みが発生する場合がある。マルチセクションにおいては、1TSパケット内に複数個の異なるセクションが格納されている場合があり、この場合はSDRAM4への書き込み領域がセクションごとに異なるためである。
In section writing, writing to a plurality of areas of the
独立PES、オーディオPES、及びビデオESの場合は、1TSパケット期間単位の動作において、SDRAM4への書き込み領域が異なる事態は発生しない。
In the case of an independent PES, an audio PES, and a video ES, a situation in which the write area to the
以上により、PESデータからPESヘッダ部を削除した後のESデータを抽出してSDRAM4に蓄えることができ、時刻管理を行いながらSDRAM4から必要なデータを読み出して、後段のビデオデコーダやオーディオデコーダにESを提供できるシステムデコーダ100aを構成することができる。
As described above, the ES data after the PES header portion is deleted from the PES data can be extracted and stored in the
本実施の形態5に係るシステムデコーダ100eによると、TSパケット単位で処理が完結するパイプライン動作が可能であるため、PESデコーダ専用の大規模なメモリが不要となる。そのため、オンチップ又はオフチップでPESデコード用メモリを構成した場合と比較して、チップ製造コストを低減できる効果がある。また、PESデコーダ専用の大規模メモリが不要となるため、このメモリへのアクセスが削減できる。そのため、外部バスの帯域を他のアクセスへ割り振ることが可能となる。例えば、CPUがSDRAM4をワークメモリとして用いるためのアクセス帯域として割り振ることも可能となる。しかも、外部メモリアクセスが低減したので、外部アクセス周波数を下げることが可能となって消費電力が低減されるとともに、外部ピン数を削減できるためチップ製造コストを低減できる。
According to the system decoder 100e according to the fifth embodiment, since a pipeline operation that completes processing in units of TS packets is possible, a large-scale memory dedicated to the PES decoder is not necessary. Therefore, there is an effect that the chip manufacturing cost can be reduced as compared with the case where the PES decoding memory is configured on-chip or off-chip. Further, since a large-scale memory dedicated to the PES decoder is not necessary, access to this memory can be reduced. Therefore, it is possible to allocate the bandwidth of the external bus to other access. For example, it is possible to allocate an access band for the CPU to use the
しかも、図7に示した上記実施の形態1に係るシステムデコーダ100aから、デスクランブル部6及び2面メモリ2,3a〜3cが省略されているため、システムデコーダ100aと比較して回路規模を大幅に削減することができる。
In addition, since the
1〜3,3a〜3c メモリ、4 外部記憶装置、5 TS−IF部、6 デスクランブル部、7 DEMUX部。
1-3, 3a-3c Memory, 4 External storage device, 5 TS-IF part, 6 Descramble part, 7 DEMUX part.
Claims (4)
前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、
前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出したTSデータに対してスクランブル解除処理を行うデスクランブル部と、
前記デスクランブル部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記デスクランブル部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第2の記憶部と、
前記第2の記憶部の後段に接続され、前記第2の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、
前記抽出分離部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記抽出分離部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第3の記憶部と、
前記第3の記憶部の後段に接続され、前記第3の記憶部から読み出したTSデータを外部メモリに書き込む書き込み部と
を備える、TSパケット単位での4段パイプライン構成のシステムデコーダ。 A synchronization acquisition unit that synchronously acquires TS (Transport Stream) data;
A memory set connected to the subsequent stage of the synchronization acquisition unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of TS data input from the synchronization acquisition unit Including a first storage unit,
A descrambling unit connected to a subsequent stage of the first storage unit and performing descrambling processing on the TS data read from the first storage unit;
A memory set connected to the subsequent stage of the descramble unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of the TS data input from the descramble unit A second storage unit including:
An extraction / separation unit that is connected to the subsequent stage of the second storage unit and extracts and separates necessary TS data from a plurality of TS data read from the second storage unit;
A memory set connected to the subsequent stage of the extraction / separation unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of the TS data input from the extraction / separation unit A third storage unit including:
A system decoder having a four-stage pipeline structure in units of TS packets, comprising a writing unit connected to a subsequent stage of the third storage unit and writing TS data read from the third storage unit to an external memory.
前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、
前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、
前記抽出分離部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記抽出分離部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第2の記憶部と、
前記第2の記憶部の後段に接続され、前記第2の記憶部から読み出したTSデータを外部メモリに書き込む書き込み部と
を備える、TSパケット単位での3段パイプライン構成のシステムデコーダ。 A synchronization acquisition unit that synchronously acquires TS (Transport Stream) data;
A memory set connected to the subsequent stage of the synchronization acquisition unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of TS data input from the synchronization acquisition unit Including a first storage unit,
An extraction / separation unit connected to a subsequent stage of the first storage unit, for extracting and separating necessary TS data from a plurality of TS data read from the first storage unit;
A memory set connected to the subsequent stage of the extraction / separation unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of the TS data input from the extraction / separation unit A second storage unit including:
A system decoder having a three-stage pipeline structure in units of TS packets, the system decoder including a writing unit connected to a subsequent stage of the second storage unit and writing TS data read from the second storage unit to an external memory.
前記同期捕捉部の後段に接続され、各々のメモリがTSデータのデータ単位相当の記憶容量を有し、前記同期捕捉部から入力されたTSデータの書き込み動作と読み出し動作とを交互に行うメモリセットを含む、第1の記憶部と、
前記第1の記憶部の後段に接続され、前記第1の記憶部から読み出した複数のTSデータの中から必要なTSデータを抽出分離する抽出分離部と、
前記抽出分離部の後段に接続され、前記抽出分離部から入力されたTSデータを外部メモリに書き込む書き込み部と
を備える、TSパケット単位での2段パイプライン構成のシステムデコーダ。 A synchronization acquisition unit that synchronously acquires TS (Transport Stream) data;
A memory set connected to the subsequent stage of the synchronization acquisition unit, each memory having a storage capacity corresponding to a data unit of TS data, and alternately performing a write operation and a read operation of TS data input from the synchronization acquisition unit Including a first storage unit,
An extraction / separation unit connected to a subsequent stage of the first storage unit, for extracting and separating necessary TS data from a plurality of TS data read from the first storage unit;
A system decoder having a two-stage pipeline structure in units of TS packets, comprising a writing unit connected to a subsequent stage of the extraction / separation unit and writing TS data input from the extraction / separation unit to an external memory.
The extraction / separation unit invalidates a time stamp added to the TS data when PCR (Program Clock Reference) of the extracted and separated TS data is discontinuous. The system decoder according to one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005067028A JP2006254039A (en) | 2005-03-10 | 2005-03-10 | System decoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005067028A JP2006254039A (en) | 2005-03-10 | 2005-03-10 | System decoder |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006254039A true JP2006254039A (en) | 2006-09-21 |
Family
ID=37094053
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005067028A Pending JP2006254039A (en) | 2005-03-10 | 2005-03-10 | System decoder |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006254039A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1198098A (en) * | 1995-11-30 | 1999-04-09 | Hitachi Ltd | Data separation device |
JP2003101765A (en) * | 2001-09-25 | 2003-04-04 | Ricoh Co Ltd | Image processing device |
JP2004289240A (en) * | 2003-03-19 | 2004-10-14 | Matsushita Electric Ind Co Ltd | Packet data processing device |
JP2006128907A (en) * | 2004-10-27 | 2006-05-18 | Nec Micro Systems Ltd | Packet processor, packet processing method, and program |
-
2005
- 2005-03-10 JP JP2005067028A patent/JP2006254039A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1198098A (en) * | 1995-11-30 | 1999-04-09 | Hitachi Ltd | Data separation device |
JP2003101765A (en) * | 2001-09-25 | 2003-04-04 | Ricoh Co Ltd | Image processing device |
JP2004289240A (en) * | 2003-03-19 | 2004-10-14 | Matsushita Electric Ind Co Ltd | Packet data processing device |
JP2006128907A (en) * | 2004-10-27 | 2006-05-18 | Nec Micro Systems Ltd | Packet processor, packet processing method, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3883637B2 (en) | Method for operating the reception of program counter criteria, and apparatus and method for operating the reception of discontinuity indicators | |
JP3641336B2 (en) | Data separator | |
US7889864B2 (en) | Data processing system and method | |
US6278838B1 (en) | Peak-ahead FIFO for DVD system stream parsing | |
EP1335604A2 (en) | MPEG error concealment | |
JP2001069106A (en) | Stream demultiplexer | |
US7149230B2 (en) | Transport processor for processing multiple transport streams | |
US7817721B2 (en) | Posting status data in digital transport stream processing | |
US6831931B2 (en) | System and method for remultiplexing of a filtered transport stream | |
US8358312B2 (en) | Multi-pass system and method supporting multiple streams of video | |
US7054959B2 (en) | Isochronous data transfer control method including packet configuration of thus-read isochronous header and data | |
US7697537B2 (en) | System and method for using generic comparators with firmware interface to assist video/audio decoders in achieving frame sync | |
KR100810288B1 (en) | Information processing apparatus and method and recording medium | |
JP2004179854A (en) | Format conversion circuit | |
US6625218B1 (en) | Audio/video separator including a user data start address register | |
JP2006254039A (en) | System decoder | |
US8571053B2 (en) | Method and system for architecture of a fast programmable transport demultiplexer using double buffered approach | |
CN100388776C (en) | digital video storage device and method for storing digital video data | |
US6341198B1 (en) | System for byte packing multiple data channels in an MPEG/DVD system | |
Fujii et al. | Implementation of MPEG transport demultiplexer with a RISC-based microcontroller | |
US7773863B2 (en) | Data decoding device, data decoding method, semiconductor integrated circuit and data decoding system, using tag added to data pack | |
Zheng et al. | Design and implementation of twin transport stream demultiplexor in HDTV decoder | |
US8094712B2 (en) | Apparatus for processing a data stream having a hierarchical layer structure and including encoded data sets and raw data sets and method thereof | |
JP2003163900A (en) | Transport stream decoder and transport stream decoding method | |
KR20060098017A (en) | Method and apparatus for filtering section data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071122 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20071122 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20100524 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100927 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101005 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101203 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20101221 |