JP4636267B2 - Encoding device and encoding bit rate switching method - Google Patents

Encoding device and encoding bit rate switching method Download PDF

Info

Publication number
JP4636267B2
JP4636267B2 JP2006052479A JP2006052479A JP4636267B2 JP 4636267 B2 JP4636267 B2 JP 4636267B2 JP 2006052479 A JP2006052479 A JP 2006052479A JP 2006052479 A JP2006052479 A JP 2006052479A JP 4636267 B2 JP4636267 B2 JP 4636267B2
Authority
JP
Japan
Prior art keywords
switching
pointer
packet
write
bit rate
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.)
Active
Application number
JP2006052479A
Other languages
Japanese (ja)
Other versions
JP2007235357A (en
Inventor
直也 辻
健志 福原
俊之 野村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2006052479A priority Critical patent/JP4636267B2/en
Publication of JP2007235357A publication Critical patent/JP2007235357A/en
Application granted granted Critical
Publication of JP4636267B2 publication Critical patent/JP4636267B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、符号化ビットレートの変更が可能な符号化装置に関し、特に、その符号化装置における符号化ビットレート変更時のデータ遅延の制御に関する。   The present invention relates to an encoding device capable of changing an encoding bit rate, and more particularly to control of data delay when changing the encoding bit rate in the encoding device.

映像や音声をデジタル信号で送信する装置では映像や音声の符号化が行われる(特許文献1参照)。例えば音声であれば、単位時間当たりの音声データを1フレームとし、フレーム単位で音声データを符号化し、符号化されたデータをパケット化して送信する。映像についても同様にして処理される。   In an apparatus that transmits video and audio as a digital signal, video and audio are encoded (see Patent Document 1). For example, in the case of voice, the voice data per unit time is set as one frame, the voice data is encoded in units of frames, and the encoded data is packetized and transmitted. The video is processed in the same manner.

この種の符号化装置では、符号化ビットレートは必ずしも固定されたものではなく、映像や音声を符号化している途中で変更されることがある。符号化ビットレートを変更すると、その境界において映像や音声が一時的に途切れることがある。   In this type of encoding apparatus, the encoding bit rate is not necessarily fixed, and may be changed during the encoding of video and audio. When the encoding bit rate is changed, video and audio may be temporarily interrupted at the boundary.

この映像や音声の途切れはユーザにとって好ましいものではない。そのため映像や音声の途切れを防止あるいは低減することが望まれる。すなわち、符号化された音声データを受信する側の装置において復号部から出力される音声の途切れを防止あるいは低減することが望まれる。   This interruption of video and audio is not preferable for the user. Therefore, it is desired to prevent or reduce the interruption of video and audio. That is, it is desired to prevent or reduce the interruption of the sound output from the decoding unit in the device that receives the encoded sound data.

そのために、従来、符号化部で符号化された映像や音声のデータを一時蓄積するバッファの使用可能なバッファサイズを削減することで、符号化ビットレートを切り替える前後の遅延時間の差を無くすあるいは小さくするという方法があった。   Therefore, conventionally, by reducing the usable buffer size of the buffer for temporarily storing the video and audio data encoded by the encoding unit, the difference in delay time before and after switching the encoding bit rate is eliminated or There was a way to make it smaller.

また、符号化ビットレートを切り替えるとき、復号部のバッファを破綻させない、つまりオーバーフローあるいはアンダーフローさせないことが好ましい。そのため、符号化部からのデータを一時蓄積するバッファ内のデータを、復号部のバッファを破綻させないようにしながら清算していた。ここで清算とは、バッファからデータを送出することであり、これにより切り替え前のデータ蓄積状態から切り替え後のデータ蓄積状態に移行させることができる。   Further, when switching the encoding bit rate, it is preferable not to cause the buffer of the decoding unit to fail, that is, to prevent overflow or underflow. Therefore, the data in the buffer that temporarily stores the data from the encoding unit is liquidated while preventing the buffer of the decoding unit from failing. Here, “clearing” refers to sending data from the buffer, whereby the data storage state before switching can be shifted to the data storage state after switching.

バッファ内に蓄積されるデータ量を低減する場合、清算期間中、符号化により発生するデータ量を少なく抑えるような符号化が行なわれていた。
特開2004−140505号公報
When reducing the amount of data stored in the buffer, encoding is performed so as to suppress the amount of data generated by encoding during the settlement period.
JP 2004-140505 A

従来装置では、符号化されたデータを一時蓄積するバッファのサイズを削減したり、符号化部で発生する符号化されたデータの量を少なくしたりすることによる音質の劣化が引き起こされていた。   In the conventional apparatus, the sound quality is deteriorated by reducing the size of the buffer for temporarily storing the encoded data or reducing the amount of the encoded data generated in the encoding unit.

本発明の目的は、符号化ビットレートの切り替え時における音の途切れや音質の劣化を低減した符号化装置を提供することである。   An object of the present invention is to provide an encoding device that reduces sound interruption and deterioration in sound quality when switching the encoding bit rate.

上記目的を達成するために、本発明の符号化装置は、
遅延時間の変更を伴う符号化ビットレートの切り替えが可能な符号化装置であって、
入力データをフレーム毎に符号化しており、要求に応じて符号化ビットレートを切り替える符号化部と、
前記符号化部にて符号化されたフレームを含むパケットを生成するパケット化部と、
前記パケット化部にて生成されたパケットを、書き込みポインタで示される書き込みの位置と読み出しポインタで示される読み出しの位置との差によって所定の遅延時間だけ遅延させており、前記符号化ビットレートの切り替え時、書き込み途中のパケットのパケット長の情報を、通知された、変更されたパケット長に変更することにより該パケットを完結したパケットに修正し、遅延時間の変更によって溢れるフレームがあれば該フレームを破棄し、切り替え前の最後のパケットと切り替え後の最初のパケットの間に無効データを挿入し、通知された切り替え後の最初の書き込みポインタから切り替え後の書き込みを開始する遅延バッファと、
前記符号化ビットレートの切り替え時、切り替え前の遅延時間に関する情報と、切り替え後の遅延時間に関する情報と、書き込み途中のパケットの先頭の位置とから、前記切り替え後の最初の書き込みポインタと、該書き込み途中のパケットの変更されたパケット長を求め、該切り替え後の最初の書き込みポインタと該変更されたパケット長とを前記遅延バッファに通知する遅延バッファ制御部と、
を有している。
In order to achieve the above object, the encoding apparatus of the present invention provides:
An encoding device capable of switching an encoding bit rate with a change in delay time,
An encoding unit that encodes input data for each frame and switches an encoding bit rate according to a request;
A packetizing unit for generating a packet including the frame encoded by the encoding unit;
The packet generated by the packetizer is delayed by a predetermined delay time depending on the difference between the write position indicated by the write pointer and the read position indicated by the read pointer, and the coding bit rate is switched. When the packet length information of the packet being written is changed to the notified and changed packet length, the packet is corrected to a complete packet. A delay buffer that discards, inserts invalid data between the last packet before switching and the first packet after switching, and starts writing after switching from the notified first writing pointer after switching;
At the time of switching the coding bit rate, from the information about the delay time before switching, the information about the delay time after switching, and the start position of the packet in the middle of writing, the first write pointer after the switching, and the writing It obtains the modified packet length in the middle of the packet, a delay buffer control unit and a first write pointer and said modified packet length after the switching notifying the delay buffer,
have.

本発明によれば、符号化ビットレートの切り替え時における音の途切れが低減され、音質の劣化が防止される。   According to the present invention, sound interruption at the time of switching the encoding bit rate is reduced, and deterioration of sound quality is prevented.

本発明を実施するための形態について図面を参照して詳細に説明する。本実施形態では、MPEG2−AAC(Advanced Audio Coding)方式の音声符号化を例示する。   Embodiments for carrying out the present invention will be described in detail with reference to the drawings. In this embodiment, MPEG2-AAC (Advanced Audio Coding) audio coding is exemplified.

図1は、本実施形態の符号化装置の構成を示すブロック図である。図1を参照すると、本実施形態の符号化装置は、符号化部11、符号化バッファ12、パケット化部13、遅延バッファ14、および遅延バッファ制御部15を有している。   FIG. 1 is a block diagram showing the configuration of the encoding apparatus of the present embodiment. Referring to FIG. 1, the encoding apparatus according to the present embodiment includes an encoding unit 11, an encoding buffer 12, a packetizing unit 13, a delay buffer 14, and a delay buffer control unit 15.

符号化部11は、単位時間当たりの音声ベースバンド信号を1ADTS(Audio Data Transport Stream)フレームとし、フレーム単位でMPEG2−AAC方式の符号化を行う。符号化ビットレートは切り替えが可能であり、切り替えを要求されると符号化部11は符号化ビットレートを切り替える。符号化部11は、符号化によって得られた、ADTSフレーム毎のES(Elementary Stream)データE1を符号化バッファ12に送る。ESデータは、複数のESフレームからなるデータのストリームである。   The encoding unit 11 uses the audio baseband signal per unit time as one ADTS (Audio Data Transport Stream) frame, and performs MPEG2-AAC encoding in units of frames. The encoding bit rate can be switched, and when switching is requested, the encoding unit 11 switches the encoding bit rate. The encoding unit 11 sends ES (Elementary Stream) data E1 for each ADTS frame obtained by encoding to the encoding buffer 12. ES data is a data stream composed of a plurality of ES frames.

符号化バッファ12は、符号化部11からのESデータE1を一時蓄積した後にESデータE2としてパケット化部13に送る。   The encoding buffer 12 temporarily stores the ES data E1 from the encoding unit 11 and then sends the ES data E1 to the packetizing unit 13 as ES data E2.

パケット化部13は、符号化バッファ12からのESデータE2を、指定されたパケット長でパケット化し、得られたPES(Packetized Elementary Stream)データP1を遅延バッファ14に送る。PESデータは、複数のPESパケットからなるデータのストリームである。   The packetizing unit 13 packetizes the ES data E2 from the encoding buffer 12 with a designated packet length, and sends the obtained PES (Packetized Elementary Stream) data P1 to the delay buffer 14. PES data is a stream of data composed of a plurality of PES packets.

遅延バッファ14は、指定された遅延時間に相当する差分を有する書き込みポインタと読出しポインタを用いて、パケット化部13からのPESデータP1を指定された遅延時間だけ一時蓄積した後、出力PESデータとして出力する。ここで遅延時間は、遅延バッファ14においてデータを遅延させる時間であり、符号化ビットレートの切り替え時には変更される。また、遅延バッファ14は、現状態情報として、書き込みポインタの位置、読み出しポインタの位置、および最新のPESヘッダの位置を遅延バッファ制御部15に通知する。   The delay buffer 14 temporarily stores the PES data P1 from the packetizing unit 13 for a specified delay time using a write pointer and a read pointer having a difference corresponding to the specified delay time, and then outputs the PES data as output PES data. Output. Here, the delay time is a time for delaying data in the delay buffer 14, and is changed when the coding bit rate is switched. Further, the delay buffer 14 notifies the delay buffer control unit 15 of the write pointer position, the read pointer position, and the latest PES header position as the current state information.

符号化ビットレートの切り替え時には遅延バッファ制御部15から遅延バッファ14に修正情報が通知される。遅延バッファ制御部15からの修正情報には、切り替え後の書き込みポインタの位置の情報と、切り替え前の最後のPESヘッダに付加するパケット長の値とが含まれている。   When the coding bit rate is switched, the delay buffer control unit 15 notifies the delay buffer 14 of the correction information. The correction information from the delay buffer control unit 15 includes information on the position of the write pointer after switching and the value of the packet length added to the last PES header before switching.

遅延バッファ14は、遅延バッファ制御部15から修正情報を通知されると、その通知情報に基づいて、書き込みポインタの位置と切り替え前の最後のPESヘッダのパケット長の値とを修正する。また、遅延バッファ14は、切り替え後の最初のPESパケットに適切なPESヘッダを付与する。さらに、遅延バッファ14は、切り替え前の最後のPESヘッダと切り替え後の最初のPESヘッダの間に間隔があれば無効データを挿入する。また、遅延バッファ14は、切り替え前の最後のPESヘッダと切り替え後の最初のPESヘッダの間で遅延時間を修正するためにESデータが溢れる場合には、その溢れたESデータを破棄する。   When the correction information is notified from the delay buffer control unit 15, the delay buffer 14 corrects the position of the write pointer and the packet length value of the last PES header before switching based on the notification information. In addition, the delay buffer 14 adds an appropriate PES header to the first PES packet after switching. Furthermore, the delay buffer 14 inserts invalid data if there is an interval between the last PES header before switching and the first PES header after switching. Further, when the ES data overflows to correct the delay time between the last PES header before switching and the first PES header after switching, the delay buffer 14 discards the overflowing ES data.

符号化ビットレートの切り替え時には遅延時間が変更されるので遅延バッファ14のポインタの変更が必要となる。また、PESパケットの途中での切り替えに対して、途中までのPESパケットを1つの完結したPESパケットに変換する。途中までのPESパケットのヘッダ内のパケット長を、この修正情報に含まれている切り替え前の最後のPESヘッダに付加するパケット長に書き換えることで、その途中までのPESパケットを完結したPESパケットに変換することができる。   Since the delay time is changed when the encoding bit rate is switched, the pointer of the delay buffer 14 needs to be changed. Further, in response to switching in the middle of the PES packet, the PES packet up to the middle is converted into one complete PES packet. By rewriting the packet length in the header of the PES packet up to the middle to the packet length added to the last PES header before switching included in this correction information, the PES packet up to the middle is converted into a completed PES packet. Can be converted.

また、完結したPESパケットに変換した残りのESフレームについては、遅延バッファ14は、切り替え後の書き込みポインタの位置との関係で書き込みが可能であれば次のPESパケットの先頭に書き込み、書き込みが不可能であれば破棄する。   For the remaining ES frames converted into complete PES packets, the delay buffer 14 writes to the head of the next PES packet if writing is possible in relation to the position of the write pointer after switching, and writing is not possible. Discard if possible.

これにより不完全なPESパケットの廃棄を防止し、遅延時間を大きくする場合には音の途切れを防止し、遅延時間を小さくする場合でも音の途切れを低減することができる。   As a result, incomplete PES packets can be prevented from being discarded, sound interruption can be prevented when the delay time is increased, and sound interruption can be reduced even when the delay time is reduced.

遅延バッファ制御部15は、符号化ビットレートの切り替えが行われるとき、遅延指示情報として与えられた切り替え後の遅延時間と、遅延バッファ14から通知された書き込みポインタの値および読み出しポインタの値とから、切り替え後の書き込みポインタの値を求める。また、遅延バッファ制御部15は、遅延バッファ14から通知された最新のPESヘッダの位置から、切り替え前の最後のESデータのフレームまでを1つのPESパケットとしたパケット長を求める。このパケット長は、切り替え前の最後のPESヘッダのパケット長となる。そして、遅延バッファ制御部15は、切り替え後の書き込みポインタの位置と、切り替え前の最後のPESパケットのパケット長とを遅延バッファ14に通知する。   When the coding bit rate is switched, the delay buffer control unit 15 uses the post-switching delay time given as the delay instruction information and the values of the write pointer and the read pointer notified from the delay buffer 14. Then, the value of the write pointer after switching is obtained. Further, the delay buffer control unit 15 obtains a packet length in which one PES packet is obtained from the position of the latest PES header notified from the delay buffer 14 to the last ES data frame before switching. This packet length is the packet length of the last PES header before switching. Then, the delay buffer control unit 15 notifies the delay buffer 14 of the position of the write pointer after switching and the packet length of the last PES packet before switching.

図2は、PESデータの例を示す図である。図2に示すように、PESデータは、複数のPESパケットからなるデータのストリームである。PESパケットには、PESヘッダと複数のESフレームが含まれている。そして、PESヘッダには不図示のPESパケット長フィールドがあり、そこにはPESヘッダから最後のESフレームまでのPESパケット長が記載される。図2の例ではPESパケットとPESパケットの間に間隔がないが間隔があってもよく、その場合にはその間隔は無効データとなる。   FIG. 2 is a diagram illustrating an example of PES data. As shown in FIG. 2, the PES data is a data stream composed of a plurality of PES packets. The PES packet includes a PES header and a plurality of ES frames. The PES header has a PES packet length field (not shown), in which the PES packet length from the PES header to the last ES frame is described. In the example of FIG. 2, there is no interval between the PES packet and the PES packet, but there may be an interval. In that case, the interval becomes invalid data.

上述したように、符号化ビットレートの切り替えにより遅延時間が変更されるが、遅延時間が長くなる場合と短くなる場合とがある。遅延時間が長くなる場合と短くなる場合とでは符号化装置の動作が異なる。   As described above, the delay time is changed by switching the coding bit rate, but there are cases where the delay time becomes longer or shorter. The operation of the encoding apparatus differs depending on whether the delay time is long or short.

遅延時間が長くなる場合には書き込みポインタと読み出しポインタの差を大きくする必要がある。逆に、遅延時間が短くなる場合には書き込みポインタと読み出しポインタの差を小さくする必要がある。   When the delay time becomes long, it is necessary to increase the difference between the write pointer and the read pointer. Conversely, when the delay time is shortened, it is necessary to reduce the difference between the write pointer and the read pointer.

図3は、書き込みポインタと読み出しポインタの差を大きくするときの遅延バッファ14の状態の変化を説明するための図である。図3(a)は切り替え前の遅延バッファ14の状態を示し、図3(b)は切り替え後の遅延バッファ14の状態を示す。   FIG. 3 is a diagram for explaining a change in the state of the delay buffer 14 when the difference between the write pointer and the read pointer is increased. 3A shows the state of the delay buffer 14 before switching, and FIG. 3B shows the state of the delay buffer 14 after switching.

切り替えの際、遅延バッファ制御部15は、遅延バッファ14から通知された現在の書き込みポインタの位置A1と読み出しポインタの位置B1とから、ポインタの位置の差X1を算出する。   At the time of switching, the delay buffer control unit 15 calculates a pointer position difference X1 from the current write pointer position A1 and the read pointer position B1 notified from the delay buffer 14.

また、遅延バッファ制御部15は、遅延指示情報として入力される切り替え後の遅延時間から切り替え後のポインタの位置の差X2を求める。   Further, the delay buffer control unit 15 obtains the difference X2 in the pointer position after switching from the delay time after switching input as the delay instruction information.

さらに、遅延バッファ制御部15は、現在の読み出しポインタの位置B1と切り替え後のポインタの位置の差X2とから、切り替え後の最初の書き込みポインタの位置A3を決定する。   Further, the delay buffer control unit 15 determines the position A3 of the first write pointer after switching from the current reading pointer position B1 and the difference X2 between the pointer positions after switching.

遅延時間をX2とするために、遅延バッファ14は、書き込みポインタA1からA2まで無効データM1を挿入し、A2からA3までPESヘッダH2とESフレームF1を書き込む。また、切り替え前の最後のPESパケットのヘッダH1に含まれるパケット長の値をA1までの値に修正し、ESデータの切れ目までの1つの完結したパケットにする。   In order to set the delay time to X2, the delay buffer 14 inserts the invalid data M1 from the write pointers A1 to A2, and writes the PES header H2 and the ES frame F1 from A2 to A3. In addition, the packet length value included in the header H1 of the last PES packet before switching is corrected to a value up to A1 to form one complete packet up to the break of ES data.

図4は、図3に示した切り替えにより遅延バッファ14から出力されるPESデータを示す図である。この例では、パケット化部13では、ESフレーム1〜3を含むPESパケットの次にESフレーム4〜6を含むPESパケットが生成され、遅延バッファ14に送られる。しかし、ESフレーム4〜6を含むPESパケットの途中で、符号化ビットレートの切り替えによる遅延時間の変更が指示される。そこで、遅延バッファ制御部15は、ESフレーム4とESフレーム5で1つのPESパケットとして完結させ、次のESフレーム6〜8を含むPESパケットとの間で遅延時間を修正している。その際、遅延バッファ14は、ESフレーム4とESフレーム5を含むPESパケットと、ESフレーム6〜8を含むPESパケットの間に無効データを挿入している。   FIG. 4 is a diagram showing PES data output from the delay buffer 14 by the switching shown in FIG. In this example, the packetizing unit 13 generates a PES packet including the ES frames 4 to 6 after the PES packet including the ES frames 1 to 3 and sends the PES packet to the delay buffer 14. However, in the middle of the PES packet including the ES frames 4 to 6, an instruction to change the delay time by switching the coding bit rate is given. Therefore, the delay buffer control unit 15 completes the ES frame 4 and the ES frame 5 as one PES packet, and corrects the delay time between the PES packets including the next ES frames 6 to 8. At that time, the delay buffer 14 inserts invalid data between the PES packet including the ES frame 4 and the ES frame 5 and the PES packet including the ES frames 6 to 8.

図5は、書き込みポインタと読み出しポインタの差を小さくするときの遅延バッファ14の状態の変化を説明するための図である。図5(a)は切り替え前の遅延バッファ14の状態を示し、図5(b)は切り替え途中の遅延バッファ14の状態を示し、図5(c)は切り替え後の遅延バッファ14の状態を示す。   FIG. 5 is a diagram for explaining a change in the state of the delay buffer 14 when the difference between the write pointer and the read pointer is reduced. 5A shows the state of the delay buffer 14 before switching, FIG. 5B shows the state of the delay buffer 14 in the middle of switching, and FIG. 5C shows the state of the delay buffer 14 after switching. .

切り替えの際、遅延バッファ制御部15は、遅延バッファ14から通知された現在の書き込みポインタの位置A4と読み出しポインタの位置B2とから、ポインタの位置の差X3を算出する。   At the time of switching, the delay buffer control unit 15 calculates a pointer position difference X3 from the current write pointer position A4 and the read pointer position B2 notified from the delay buffer.

また、遅延バッファ制御部15は、遅延指示情報として与えられた切り替え後の遅延時間から切り替え後のポインタの位置の差X4を求める。そして、遅延バッファ制御部15は、切り替え後の最初のPESパケットの先頭A5がA4より後になるように、切り替え後の最初の書き込みポインタの位置A6を定め、そのA6と切り替え後のポインタの位置の差X4とから、読み出しポインタの所定位置B3と読み出しポインタがB2からB3に来るまでのフレーム数とを決定する。   Further, the delay buffer control unit 15 obtains the pointer position difference X4 after switching from the switching delay time given as the delay instruction information. Then, the delay buffer control unit 15 determines the position A6 of the first write pointer after switching so that the head A5 of the first PES packet after switching is after A4, and the position of A6 and the position of the pointer after switching are determined. From the difference X4, a predetermined position B3 of the read pointer and the number of frames until the read pointer reaches B3 from B2 are determined.

そして、読み出しポインタがB2からB3に来るまで符号化部11の停止により書き込みは停止される。書き込みの停止を継続して書き込みポインタをA4に維持したまま読み出しポインタの位置がB3にきたら(図5(b)の状態)、遅延バッファ14は、書き込みポインタの位置をA4からA6に移動させる。   The writing is stopped by stopping the encoding unit 11 until the reading pointer comes from B2 to B3. When the stop of writing is continued and the position of the read pointer comes to B3 while maintaining the write pointer at A4 (the state of FIG. 5B), the delay buffer 14 moves the position of the write pointer from A4 to A6.

そのために、遅延バッファ14は、書き込みポインタA4からA5まで無効データM2を挿入し、A5からA6までPESヘッダH4とESフレームF2を書き込む(図5(c)の状態)。また、切り替え前の最後のPESパケットのPESヘッダH3に含まれているパケット長の値をA4までに修正し、ESデータの切れ目までを1つの完結したPESパケットにする。   Therefore, the delay buffer 14 inserts invalid data M2 from the write pointers A4 to A5, and writes the PES header H4 and the ES frame F2 from A5 to A6 (state shown in FIG. 5C). Further, the packet length value included in the PES header H3 of the last PES packet before switching is corrected to A4, and the ES data break is made one complete PES packet.

図6は、図5に示した切り替えにより遅延バッファ14から出力されるPESデータを示す図である。この例では、パケット化部13では、ESフレーム1〜ESフレーム3を含むPESパケットの次にESフレーム4〜ESフレーム6を含むPESパケットが生成され、遅延バッファ14に送られる。しかし、ESフレーム4〜ESフレーム6を含むPESパケットの途中で、符号化ビットレートの切り替えによる遅延時間の変更が指示される。そこで、遅延バッファ制御部15は、ESフレーム4とESフレーム5で1つのPESパケットとして完結させ、その後ろで遅延時間の修正をしている。その際、ESフレーム6〜9が溢れて破棄されている。また、遅延バッファ14は、ESフレーム4とESフレーム5を含むPESパケットと、ESフレーム10〜12を含むPESパケットの間に無効データを挿入している。   FIG. 6 is a diagram showing PES data output from the delay buffer 14 by the switching shown in FIG. In this example, the packetizing unit 13 generates a PES packet including the ES frame 4 to the ES frame 6 after the PES packet including the ES frame 1 to the ES frame 3 and sends the PES packet to the delay buffer 14. However, in the middle of the PES packet including the ES frame 4 to the ES frame 6, the change of the delay time by switching the coding bit rate is instructed. Therefore, the delay buffer control unit 15 completes the ES frame 4 and the ES frame 5 as one PES packet, and corrects the delay time after that. At that time, the ES frames 6 to 9 overflow and are discarded. The delay buffer 14 inserts invalid data between the PES packet including the ES frame 4 and the ES frame 5 and the PES packet including the ES frames 10 to 12.

以上説明したように、本実施形態では、符号化ビットレートの切り替え時、符号化部11は符号化ビットレートを切り替える。また、遅延バッファ制御部15は、切り替え後の遅延バッファのポインタの情報と切り替え時に変更するPESパケットのパケット長とを求めて遅延バッファ14に通知する。遅延バッファ14は、遅延バッファ制御部15からの通知に基づいて、切り替え前の途中のPESパケットのヘッダ内のパケット長を書き換えることで完結させ、ポインタの位置の差を変更して切り替え後の動作を開始する。したがって、本実施形態によれば、切り替え時に途中のPESパケットが完結しない状態で破棄されるのを防止し、またバッファサイズの削減やデータ量の削減をせずに切り替えが行われるので、符号化ビットレートの切り替え時における音の途切れが低減され、音質の劣化が防止される。   As described above, in the present embodiment, the encoding unit 11 switches the encoding bit rate when the encoding bit rate is switched. Further, the delay buffer control unit 15 obtains information about the pointer of the delay buffer after switching and the packet length of the PES packet to be changed at the time of switching, and notifies the delay buffer 14 of the information. The delay buffer 14 is completed by rewriting the packet length in the header of the PES packet in the middle before switching based on the notification from the delay buffer control unit 15, and changes the pointer position difference to change the operation after switching. To start. Therefore, according to the present embodiment, it is possible to prevent an intermediate PES packet from being discarded in an incomplete state at the time of switching, and to perform switching without reducing the buffer size or the data amount. Sound interruption at the time of bit rate switching is reduced, and deterioration of sound quality is prevented.

なお、本実施形態では音声符号化のビットレート切り替えを例示したが、本発明はこれに限定されるものではなく、他の例として映像符号化のビットレート切り替えであってもよい。   In the present embodiment, the bit rate switching for audio encoding is exemplified, but the present invention is not limited to this, and may be bit rate switching for video encoding as another example.

本実施形態の符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the encoding apparatus of this embodiment. PESデータの例を示す図である。It is a figure which shows the example of PES data. 書き込みポインタと読み出しポインタの差を大きくするときの遅延バッファ14の状態の変化を説明するための図である。It is a figure for demonstrating the change of the state of the delay buffer 14 when enlarging the difference of a write pointer and a read pointer. 図3に示した切り替えにより遅延バッファ14から出力されるPESデータを示す図である。It is a figure which shows the PES data output from the delay buffer 14 by the switching shown in FIG. 書き込みポインタと読み出しポインタの差を小さくするときの遅延バッファ14の状態の変化を説明するための図である。It is a figure for demonstrating the change of the state of the delay buffer 14 when making the difference of a write pointer and a read pointer small. 図5に示した切り替えにより遅延バッファ14から出力されるPESデータを示す図である。It is a figure which shows the PES data output from the delay buffer 14 by the switching shown in FIG.

符号の説明Explanation of symbols

11 符号化部
12 符号化バッファ
13 パケット化部
14 遅延バッファ
15 遅延バッファ制御部
E1、E2 ESデータ
P1 PESデータ
11 Encoding unit 12 Encoding buffer 13 Packetization unit 14 Delay buffer 15 Delay buffer control unit E1, E2 ES data P1 PES data

Claims (8)

遅延時間の変更を伴う符号化ビットレートの切り替えが可能な符号化装置であって、
入力データをフレーム毎に符号化しており、要求に応じて符号化ビットレートを切り替える符号化部と、
前記符号化部にて符号化されたフレームを含むパケットを生成するパケット化部と、
前記パケット化部にて生成されたパケットを、書き込みポインタで示される書き込みの位置と読み出しポインタで示される読み出しの位置との差によって所定の遅延時間だけ遅延させており、前記符号化ビットレートの切り替え時、書き込み途中のパケットのパケット長の情報を、通知された、変更されたパケット長に変更することにより該パケットを完結したパケットに修正し、遅延時間の変更によって溢れるフレームがあれば該フレームを破棄し、切り替え前の最後のパケットと切り替え後の最初のパケットの間に無効データを挿入し、通知された切り替え後の最初の書き込みポインタから切り替え後の書き込みを開始する遅延バッファと、
前記符号化ビットレートの切り替え時、切り替え前の遅延時間に関する情報と、切り替え後の遅延時間に関する情報と、書き込み途中のパケットの先頭の位置とから、前記切り替え後の最初の書き込みポインタと、該書き込み途中のパケットの変更されたパケット長を求め、該切り替え後の最初の書き込みポインタと該変更されたパケット長とを前記遅延バッファに通知する遅延バッファ制御部と、
を有する符号化装置。
An encoding device capable of switching an encoding bit rate with a change in delay time,
An encoding unit that encodes input data for each frame and switches an encoding bit rate according to a request;
A packetizing unit for generating a packet including the frame encoded by the encoding unit;
The packet generated by the packetizer is delayed by a predetermined delay time depending on the difference between the write position indicated by the write pointer and the read position indicated by the read pointer, and the coding bit rate is switched. When the packet length information of the packet being written is changed to the notified and changed packet length, the packet is corrected to a complete packet. A delay buffer that discards, inserts invalid data between the last packet before switching and the first packet after switching, and starts writing after switching from the notified first writing pointer after switching;
At the time of switching the coding bit rate, from the information about the delay time before switching, the information about the delay time after switching, and the start position of the packet in the middle of writing, the first write pointer after the switching, and the writing It obtains the modified packet length in the middle of the packet, a delay buffer control unit and a first write pointer and said modified packet length after the switching notifying the delay buffer,
An encoding device.
前記遅延バッファ制御部は、前記符号化ビットレートの切り替えによって遅延時間が大きくなる場合には、前記遅延バッファにおける現在の書き込みポインタの位置と読み出しポインタの位置とから切り替え前の書き込みと読み出しのポインタの位置の差を算出し、与えられた切り替え後の遅延時間から切り替え後の書き込みと読み出しのポインタの位置の差を求め、前記現在の読み出しポインタの位置と該切り替え後の書き込みと読み出しのポインタの位置の差とから、前記切り替え後の最初の書き込みポインタの位置を決定して前記遅延バッファに通知する、請求項1に記載の符号化装置。 When the delay time increases due to the switching of the encoding bit rate, the delay buffer control unit determines whether the pointers for writing and reading before switching are based on the current write pointer position and read pointer position in the delay buffer. The position difference is calculated, the difference between the position of the write and read pointers after switching is obtained from the given delay time after switching, and the position of the current read pointer and the position of the write and read pointers after the switching The encoding apparatus according to claim 1, wherein the position of the first write pointer after the switching is determined from the difference and notified to the delay buffer. 前記遅延バッファ制御部は、前記符号化ビットレートの切り替えによって遅延時間が小さくなる場合には、前記遅延バッファにおける現在の書き込みポインタの位置と読み出しポインタの位置とから切り替え前の書き込みと読み出しのポインタの位置の差を算出し、与えられた切り替え後の遅延時間から切り替え後の書き込みと読み出しのポインタの位置の差を求め、切り替え後の最初のパケットの先頭が前記現在の書き込みポインタ以降になるように、前記切り替え後の最初の書き込みポインタの位置を定め、該切り替え後の最初の書き込みポインタの位置と前記切り替え後の書き込みと読み出しのポインタの位置の差とから読み出しポインタの所定位置を決定して前記遅延バッファに指示し、
前記遅延バッファは、読み出しポインタが前記所定位置に来るまで書き込みを停止し、前記読み出しポインタが前記所定位置にきたら、書き込みポインタを前記切り替え後の最初の書き込みポインタの位置に移動させる、請求項1または2に記載の符号化装置。
The delay buffer control unit, when the delay time by the switching of the coding bit rate is decreased from the position of the read pointer of the current write pointer in the delay buffer before switching the writing and the reading pointer The position difference is calculated, the position difference between the write and read pointers after switching is obtained from the given delay time after switching, and the head of the first packet after switching is after the current write pointer. Determining the position of the first write pointer after the switching, determining the predetermined position of the read pointer from the position of the first writing pointer after the switching and the difference between the position of the writing and reading pointer after the switching Instruct the delay buffer,
The delay buffer stops writing until a read pointer reaches the predetermined position, and moves the write pointer to the position of the first write pointer after the switching when the read pointer reaches the predetermined position. 2. The encoding device according to 2.
音声信号または映像信号の少なくとも一方を符号化する、請求項1から3のいずれか1項に記載の符号化装置。   The encoding device according to any one of claims 1 to 3, wherein at least one of an audio signal and a video signal is encoded. 遅延時間の変更を伴う符号化ビットレートの切り替えを行う符号化ビットレート切り替え方法であって、
入力データをフレーム毎に符号化し、符号化されたフレームを含むパケットを生成し、該パケットを、書き込みポインタで示される書き込みの位置と読み出しポインタで示される読み出しの位置との差によって所定の遅延時間だけ遅延させており、
前記符号化ビットレートの切り替え時、切り替え前の遅延時間に関する情報と、切り替え後の遅延時間に関する情報と、書き込み途中のパケットの先頭の位置とから、前記切り替え後の最初の書き込みポインタと、該書き込み途中のパケットの変更されたパケット長を求め、
書き込み途中のパケットのパケット長の情報を、前記変更されたパケット長に変更することにより該パケットを完結したパケットに修正し、
遅延時間の変更によって溢れるフレームがあれば該フレームを破棄し、切り替え前の最後のパケットと切り替え後の最初のパケットの間に必要があれば無効データを挿入し、
前記切り替え後の最初の書き込みポインタから切り替え後の書き込みを開始する、
符号化ビットレート切り替え方法。
A coding bit rate switching method for switching a coding bit rate accompanied by a change in delay time,
The input data is encoded for each frame, a packet including the encoded frame is generated, and the packet is subjected to a predetermined delay time depending on the difference between the write position indicated by the write pointer and the read position indicated by the read pointer. Only delayed
At the time of switching the coding bit rate, from the information about the delay time before switching, the information about the delay time after switching, and the start position of the packet in the middle of writing, the first write pointer after the switching, and the writing Find the changed packet length of the midway packet,
Modify the packet length information of the packet in the middle of writing to the completed packet by changing to the changed packet length,
If there is a frame that overflows due to the delay time change, discard the frame, insert invalid data if necessary between the last packet before switching and the first packet after switching,
Start writing after switching from the first writing pointer after switching,
Encoding bit rate switching method.
前記符号化ビットレートの切り替えによって遅延時間が大きくなる場合には、現在の書き込みポインタの位置と読み出しポインタの位置とから切り替え前の書き込みと読み出しのポインタの位置の差を算出し、与えられた切り替え後の遅延時間から切り替え後の書き込みと読み出しのポインタの位置の差を求め、前記現在の読み出しポインタの位置と該切り替え後の書き込みと読み出しのポインタの位置の差とから、前記切り替え後の最初の書き込みポインタの位置を決定する、請求項5に記載の符号化ビットレート切り替え方法。 When the delay time increases due to the switching of the encoding bit rate, the difference between the position of the writing and reading pointer before switching is calculated from the current writing pointer position and the reading pointer position, and the given switching is performed. The difference between the pointer position for writing and reading after switching is obtained from the later delay time, and the first position after switching is calculated from the position of the current reading pointer and the position of the writing and reading pointer after switching. 6. The encoding bit rate switching method according to claim 5, wherein the position of the write pointer is determined. 前記符号化ビットレートの切り替えによって遅延時間が小さくなる場合には、現在の書き込みポインタの位置と読み出しポインタの位置とから切り替え前の書き込みと読み出しのポインタの位置の差を算出し、与えられた切り替え後の遅延時間から切り替え後の書き込みと読み出しのポインタの位置の差を求め、切り替え後の最初のパケットの先頭が前記現在の書き込みポインタ以降になるように、前記切り替え後の最初の書き込みポインタの位置を定め、該切り替え後の最初の書き込みポインタの位置と前記切り替え後の書き込みと読み出しのポインタの位置の差とから読み出しポインタの所定位置を決定し、読み出しポインタが前記所定位置に来るまで書き込みを停止し、前記読み出しポインタが前記所定位置にきたら、書き込みポインタを前記切り替え後の最初の書き込みポインタの位置に移動させる、請求項5または6に記載の符号化ビットレート切り替え方法。 When the delay time is reduced by switching the coding bit rate, the difference between the write and read pointer positions before switching is calculated from the current write pointer position and read pointer position, and the given switch The difference between the positions of the write and read pointers after switching is obtained from the later delay time, and the position of the first write pointer after switching is such that the head of the first packet after switching is after the current write pointer. Determine the predetermined position of the read pointer from the position of the first write pointer after the switching and the difference between the position of the write and read pointer after the switching, and stop writing until the read pointer reaches the predetermined position When the read pointer is at the predetermined position, the write point The move to the position of the first write pointer after the switching, the coding bit rate switching method according to claim 5 or 6. 音声信号または映像信号の少なくとも一方の符号化ビットレートの切り替える、請求項5から7のいずれか1項に記載の符号化ビットレート切り替え方法。   The coding bit rate switching method according to any one of claims 5 to 7, wherein the coding bit rate of at least one of an audio signal and a video signal is switched.
JP2006052479A 2006-02-28 2006-02-28 Encoding device and encoding bit rate switching method Active JP4636267B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006052479A JP4636267B2 (en) 2006-02-28 2006-02-28 Encoding device and encoding bit rate switching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006052479A JP4636267B2 (en) 2006-02-28 2006-02-28 Encoding device and encoding bit rate switching method

Publications (2)

Publication Number Publication Date
JP2007235357A JP2007235357A (en) 2007-09-13
JP4636267B2 true JP4636267B2 (en) 2011-02-23

Family

ID=38555526

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006052479A Active JP4636267B2 (en) 2006-02-28 2006-02-28 Encoding device and encoding bit rate switching method

Country Status (1)

Country Link
JP (1) JP4636267B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10500822A (en) * 1994-05-20 1998-01-20 ジェネラル・インストルメンツ・コーポレイション Statistical multiplexing method for multiple data streams
JPH1028269A (en) * 1995-08-02 1998-01-27 Matsushita Electric Ind Co Ltd Picture-encoding device and picture-transmission system using the same and quantization controlling method and mean through-put calculating method used for the same
JPH10200494A (en) * 1997-01-08 1998-07-31 Digital Vision Lab:Kk Data transmission system and data transmitting method
JP2005277457A (en) * 2004-03-22 2005-10-06 Toshiba Corp Digital broadcast signal broadcasting system and its control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10500822A (en) * 1994-05-20 1998-01-20 ジェネラル・インストルメンツ・コーポレイション Statistical multiplexing method for multiple data streams
JPH1028269A (en) * 1995-08-02 1998-01-27 Matsushita Electric Ind Co Ltd Picture-encoding device and picture-transmission system using the same and quantization controlling method and mean through-put calculating method used for the same
JPH10200494A (en) * 1997-01-08 1998-07-31 Digital Vision Lab:Kk Data transmission system and data transmitting method
JP2005277457A (en) * 2004-03-22 2005-10-06 Toshiba Corp Digital broadcast signal broadcasting system and its control method

Also Published As

Publication number Publication date
JP2007235357A (en) 2007-09-13

Similar Documents

Publication Publication Date Title
US8855145B2 (en) Jitter buffer
US9246644B2 (en) Jitter buffer
JP5409032B2 (en) Transmitting apparatus, method, and program
JP6225446B2 (en) Moving image data distribution apparatus, method, program, and system
US7447983B2 (en) Systems and methods for decoding forward error correcting codes
US8948213B2 (en) Jitter buffer
JP2007221326A (en) Device and method for adjusting transmission rate
US20230091776A1 (en) Data Stream Encoder Configuration
US9654812B2 (en) Encoding apparatus and the method
JP2010238353A (en) Information storage medium storing multi-angle data, and storing method and reproducing apparatus thereof
JP4041137B2 (en) VIDEO ENCODING / TRANSMITTING DEVICE, VIDEO ENCODING / TRANSMITTING METHOD, VIDEO ENCODING / TRANSMITTING PROGRAM, AND RECORDING MEDIUM THEREOF
JP5041844B2 (en) PCR correction circuit
JP4636267B2 (en) Encoding device and encoding bit rate switching method
JP2002223449A (en) Image compression coder and image compression coding method
WO2006011443A1 (en) Reception processing device, receiving device, control program, and recording media having recorded control program
KR102313323B1 (en) Video incoding device and video incoding method
JP2010028574A (en) Information processing apparatus, method of controlling the same, and computer program
JP2004350237A (en) Stream transfer apparatus, stream transfer method, stream transfer program, and display time correcting apparatus
JP2009100206A (en) Image coding and data-decoding device
JP2016144083A (en) Transcoder and PMT update method
JP2008177874A (en) Recorder, recording method, program, and storage medium
JP2005315973A (en) Semiconductor integrated circuit
KR100734376B1 (en) Apparatus for decoding broadcasting signal
JP2008199361A (en) Stream data receiving and reproducing device
JP2007060532A (en) Image processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090115

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100903

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100915

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101012

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101027

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101109

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

Free format text: PAYMENT UNTIL: 20131203

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4636267

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150