JP4212920B2 - Audio / video synchronization control method and apparatus - Google Patents

Audio / video synchronization control method and apparatus Download PDF

Info

Publication number
JP4212920B2
JP4212920B2 JP2003044337A JP2003044337A JP4212920B2 JP 4212920 B2 JP4212920 B2 JP 4212920B2 JP 2003044337 A JP2003044337 A JP 2003044337A JP 2003044337 A JP2003044337 A JP 2003044337A JP 4212920 B2 JP4212920 B2 JP 4212920B2
Authority
JP
Japan
Prior art keywords
audio
video
data
buffer
access unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003044337A
Other languages
Japanese (ja)
Other versions
JP2004254186A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003044337A priority Critical patent/JP4212920B2/en
Publication of JP2004254186A publication Critical patent/JP2004254186A/en
Application granted granted Critical
Publication of JP4212920B2 publication Critical patent/JP4212920B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、MPEG4(Moving Picture Experts Group4)システムに規定されるMP4ファイルにおけるオーディオ・ビデオストリームのように、予め圧縮符号化されたオーディオ・ビデオストリームを同期再生するオーディオ・ビデオ同期制御方法及びその装置に関するものである。
【0002】
【従来の技術】
従来のオーディオ・ビデオ同期制御方式では、あるタイムベースに基づいて圧縮符号化されたオーディオ・ビデオストリームにおけるアクセスユニット(AU)ごとにデコードタイムスタンプ(DTS)を記述し、そのデコードタイムスタンプに従って同期再生を行う方式が利用されている。
【0003】
アクセスユニット(AU)とは、オーディオ・ビデオストリームにおいて独立にアクセスできるデータ単位である。たとえば、ビデオの場合はVOP(ビデオオブジェクトプレーン)の符号化データに相当する。MPEG4では、圧縮符号化されたオーディオ・ビデオストリームの同期制御はアクセスユニット(AU)単位で行われる。
【0004】
図1は、従来のオーディオ・ビデオ同期制御装置の一例を示す。
【0005】
図1のオーディオ・ビデオ同期制御装置において、MP4ファイル10は、MP4ファイルフォーマットで圧縮符号化されたオーディオ・ビデオストリームを含み、AU/DTS分離回路12に入力される。AU/DTS分離回路12は入力ファイル10を、オーディオストリームのアクセスユニット(AU)と、ビデオストリームのアクセスユニット(AU)とに分離して、オーディオAUバッファ14とビデオAUバッファ18にそれぞれ格納する。
【0006】
オーディオAUバッファ14に格納された各アクセスユニット(AU)のオーディオデータ(au_data)は、オーディオデコーダ16へ転送され、オーディオデコーダ16で復号化(デコード)される。ビデオAUバッファ18に格納された各アクセスユニット(AU)のビデオデータ(au_data)は、ビデオデコーダ20へ転送され、ビデオデコーダ20で復号化(デコード)される。 オーディオデコーダ16が復号化したオーディオデータはスピーカで再生されると同時に、ビデオデコーダ20が復号化したビデオデータは表示モニタ上に表示される。
【0007】
また、図1の従来の構成において、AU/DTS分離回路12は、入力ファイル10から、オーディオストリームの各アクセスユニットのDTS時間間隔(au_dts_delta)とビデオストリームの各アクセスユニットのDTS時間間隔(au_dts_delta)とを分離して、オーディオDTSバッファ22とビデオDTSバッファ24にそれぞれ格納する。
【0008】
図1の従来のオーディオ・ビデオ同期制御装置において、同期制御回路26は、オーディオ・ビデオストリームの各DTA時間間隔を監視して、オーディオデータについての復号化処理開始を指示する制御信号a_dec_startと、ビデオデータについての復号化処理開始を指示する制御信号v_dec_startを、オーディオデコーダ16とビデオデコーダ20へそれぞれ出力する。従って、同期制御回路26は、DTS時間間隔にしたがって、対応するデコーダがアクセスユニット単位で復号化処理を開始するように同期制御を行っている。
【0009】
ここで、MP4ファイルは、各エレメントストリームに対して、該当アクセスユニットのDTSとその次のアクセスユニットのDTS間の時間間隔(au_dts_delta)を記述するテーブルを有する。このDTS時間間隔(au_dts_delta)は、各エレメントストリームに対して、次式(1)のように算出される。
【0010】
【数1】

Figure 0004212920
ここで、pはそのストリームにおける該当アクセスユニットを識別する番号である。p=0のときDTS(0)=0とする。DTS時間間隔(au_dts_delta)の時間単位は、(1/time_scale)秒である。
【0011】
DTS時間間隔のテーブルは、図7に示したような構造を有する。図7は、あるMP4ファイルにおけるビデオストリームのアクセスユニット(AU)のDTSテーブルの一例である。図7において、au_countは、同一のDTS時間間隔(au_dts_delta)を有するアクセスユニットの個数を示す。
【0012】
従来のオーディオ・ビデオ同期制御方式では、テーブルに記述したDTS時間間隔に従ってアクセスユニット(AU)を復号化することで同期を確立している。
【0013】
なお、本発明に関連する従来の技術として、特開平11−164256号公報には、オーディオとビデオの処理を独立して行い、基準となる処理時間が異なるオーディオデータとビデオデータの同期再生を行うためのオーディオ・ビデオ同期再生方法が示されている。
【0014】
【特許文献1】
特開平11−164256号公報
【0015】
【発明が解決しようとする課題】
従来のオーディオ・ビデオ同期制御方式では、アクセスユニット単位で同期を制御するため、復号化用バッファをアクセスユニット単位で用意する必要がある。しかし、アクセスユニットの大きさ(au_size)は、様々な要因(例えば、ビットレート)により変化するものである。ディジタルビデオカメラへ適用する場合、例えば、8MbpsVGAのIVOPでは、1つのアクセスユニットの大きさが数百Kバイトになることが頻繁にある。一方、携帯用オーディオ・ビデオ機器では、大容量のバッファを設けることは望ましくない。
【0016】
よって、従来のオーディオ・ビデオ同期制御方式では、復号化用バッファをアクセスユニット単位で用意する必要がため、同期制御回路の規模も大きくなる傾向がある。
【0017】
また、オーディオ・ビデオストリームを同期再生する際に、時間ずれが発生した場合、ビデオアクセスユニットをスキップしたり、リピート表示したりすることにより、時間ずれを補償する必要がある。従来のオーディオ・ビデオ同期制御方式では、時間ずれを効率よく補償するための方法が考慮されていない。
【0018】
本発明は、上記の点に鑑みてなされたものであり、入力ファイルのアクセスユニットの大きさに依存しない小さなサイズの復号化用バッファを用いて、オーディオ・ビデオ同期制御回路の規模を削減することが可能なオーディオ・ビデオ同期制御方法及び装置を提供することを目的とする。
【0019】
【課題を解決するための手段】
上記課題を解決するために、本発明オーディオ・ビデオ同期制御方法は、圧縮符号化されたオーディオデータとビデオデータを含む入力ファイルから得られるオーディオデータとビデオデータの各アクセスユニットのサイズ情報と、各アクセスユニットのデコードタイムスタンプ情報に基づいて一定の時間間隔ごとに転送すべき各アクセスユニットのデータ量を算出する手順と、前記時間間隔ごとに算出された前記データ量の大きさをもつオーディオデータとビデオデータの各アクセスユニットをオーディオバッファとビデオバッファにそれぞれ格納する手順と、前記入力ファイルから得られる各アクセスユニットの前記デコードタイムスタンプ情報に前記時間間隔の逆数を乗じることによりデータ転送回数を算出する手順と、算出された前記データ転送回数にしたがって、前記オーディオバッファとオーディオデコーダ間に設けたバッファスイッチに出力される制御信号、及び前記ビデオバッファとビデオデコーダ間に設けたバッファスイッチに出力される制御信号のオン・オフを切り替えることにより、前記オーディオデータと前記ビデオデータの各アクセスユニット前記オーディオデコーダと前記ビデオデコーダとにそれぞれ転送する手順とを有することを特徴とする。
【0020】
また、上記課題を解決するために、本発明オーディオ・ビデオ同期制御装置は、圧縮符号化されたオーディオデータとビデオデータを含む入力ファイルからオーディオデータとビデオデータの各アクセスユニットを取得するとともに、オーディオデータとビデオデータの同期制御を行う分離部と、取得したオーディオデータの各アクセスユニットを格納するオーディオバッファと、格納されたオーディオデータの各アクセスユニットを復号化するオーディオデコーダと、取得したビデオデータの各アクセスユニットを格納するビデオバッファと、格納されたビデオデータの各アクセスユニットを復号化するビデオデコーダとを有するオーディオ・ビデオ同期制御装置であって、前記分離部は、前記入力ファイルから得られるオーディオデータとビデオデータの各アクセスユニットのサイズ情報と、各アクセスユニットのデコードタイムスタンプ情報に基づいて一定の時間間隔ごとに転送すべき各アクセスユニットのデータ量を算出する手段と、前記時間間隔ごとに、算出された前記データ量の大きさをもつオーディオデータとビデオデータの各アクセスユニットを前記オーディオバッファと前記ビデオバッファにそれぞれ格納する手段と、前記入力ファイルから得られる各アクセスユニットの前記デコードタイムスタンプ情報に前記時間間隔の逆数を乗じることよりデータ転送回数を算出する手段と、算出された前記データ転送回数にしたがって、前記オーディオバッファと前記オーディオデコーダ間に設けたバッファスイッチに出力される制御信号、及び前記ビデオバッファと前記ビデオデコーダ間に設けたバッファスイッチに出力される制御信号のオン・オフを切り替えることにより、前記オーディオデータと前記ビデオデータの各アクセスユニットを前記オーディオデコーダと前記ビデオデコーダとにそれぞれ転送する手段とを備えることを特徴とする。
【0021】
【発明の実施の形態】
以下、本発明の実施の形態について図面を用いて説明する。
【0022】
まず、本発明のオーディオ・ビデオ同期制御方式の基本原理について説明する。
【0023】
前述したように、従来のオーディオ・ビデオ同期制御方式では、MP4ファイルに記述された各アクセスユニットの大きさ(au_size)をもつAUデータを復号化用バッファに格納して、DTS時間間隔(au_dts_delta)で同期を制御している。この代わりに、本発明のオーディオ・ビデオ同期制御方式では、MP4ファイルに記述された、各アクセスユニットの大きさ(au_size)と各アクセスユニットのDTS時間間隔(au_dts_delta)から、算出される一定の時間間隔(Δt)のデータ量(Δdata)をもつオーディオ・ビデオデータを復号化用バッファに格納して、算出される転送回数(scnt)でデコーダへ転送することにより、同期を確立する。
【0024】
データ量(Δdata)と一定の時間間隔(Δt)は、MP4ファイルに記述されたau_sizeとau_dts_deltaから、次式(2)と(3)に従って算出される。
【0025】
【数2】
Figure 0004212920
【0026】
【数3】
Figure 0004212920
ここで、nは任意の整数である(以下、このnをタイムスケール定数という)。また、転送回数(scnt)は、次式(4)に従って算出される。
【0027】
【数4】
Figure 0004212920
図2は、本発明の第1の実施の形態に係るオーディオ・ビデオ同期制御装置を示す。図2のオーディオ・ビデオ同期制御装置は、Δdata/Δt分離回路32と、一対のバッファスイッチ33、43と、一対のオーディオバッファ34、38と、一対のビデオバッファ42、44と、一対のバッファスイッチ35、45と、オーディオデコーダ16と、ビデオデコーダ20とを含む。
【0028】
図2のオーディオ・ビデオ同期制御装置において、バッファスイッチ33、43とバッファスイッチ35、45の切り替え動作は、Δdata/Δt分離回路32の制御部から出力される制御信号により制御される。
【0029】
また、Δdata/Δt分離回路32の制御部からバッファスイッチ33、43への制御信号は、オーディオバッファ34、38と、ビデオバッファ42、44に対して、バッファスイッチ33、43の切り替え動作が交互に行われるように出力される。すなわち、図2に示したように、ある時点でバッファスイッチ33がオーディオバッファ38側と導通する状態であるとき、バッファスイッチ43はビデオバッファ44側と導通する状態になる。次の時点でバッファスイッチ33、43の切り替え動作が行われると、バッファスイッチ33はオーディオバッファ34側と導通する状態となり、同時に、バッファスイッチ43はビデオバッファ42側と導通する状態になる。
【0030】
同様に、Δdata/Δt分離回路32の制御部からバッファスイッチ35、45への制御信号は、オーディオバッファ34、38と、ビデオバッファ42、44に対して、バッファスイッチ35、45の切り替え動作が交互に行われるように出力される。すなわち、図2に示したように、ある時点でバッファスイッチ35がオーディオバッファ34側と導通する状態であるとき、バッファスイッチ45はビデオバッファ42側と導通する状態になる。次の時点でバッファスイッチ35、45の切り替え動作が行われると、バッファスイッチ35はオーディオバッファ38側と導通する状態となり、同時に、バッファスイッチ45はビデオバッファ44側と導通する状態になる。
【0031】
図2に示したように、図1の従来構成におけるAU/DTS分離回路12の代わりに、この実施形態のオーディオ・ビデオ同期制御装置では、Δdata/Δt分離回路32を設けている。MP4ファイル10は、MP4ファイルフォーマットで圧縮符号化されたオーディオ・ビデオストリームを含み、Δdata/Δt分離回路32に入力される。
【0032】
Δdata/Δt分離回路32は、MP4ファイル10から得られる各アクセスユニットについてのau_sizeとau_dts_deltaを用いて、上式(2)と(3)にしたがい一定の時間間隔(Δt)のデータ量(Δdata)を算出する。また、Δdata/Δt分離回路32は、上式(4)にしたがい転送回数(scnt)を算出する。
【0033】
Δdata/Δt分離回路32は、入力ファイル10を、算出した一定の時間間隔(Δt)のデータ量(Δdata)をもつオーディオデータとビデオデータとに分離して、オーディオバッファ34、38のいずれか一方とビデオバッファ42、44のいずれか一方にそれぞれ格納する。
【0034】
図2のオーディオ・ビデオ同期制御装置においては、Δdata/Δt分離回路32が、一定の時間間隔(Δt)でバッファスイッチ33、43の切り替え動作を制御して、データ量(Δdata)の大きさをもつオーディオデータをオーディオバッファ34、38のいずれか一方に、データ量(Δdata)の大きさをもつビデオデータをビデオバッファ42、44のいずれか一方に格納する。
【0035】
また同時に、Δdata/Δt分離回路32は、算出した転送回数(scnt)に基づいてバッファスイッチ35、45の切り替え動作を制御して、オーディオバッファ34、38の他方のバッファにすでに格納されたオーディオデータをオーディオデコーダ16へ転送すると共に、ビデオバッファ42、44の他方のバッファにすでに格納されたビデオデータをビデオデコーダ20へ転送する。
【0036】
上記の実施形態によれば、従来の構成に比べて小さなサイズの復号化用バッファを用いてオーディオ・ビデオ同期制御装置を構成することができ、入力ファイルのアクセスユニットの大きさに依存しないサイズをもつ復号化用バッファを用いることで、オーディオ・ビデオ同期制御回路の規模を削減することが可能である。
【0037】
また、上記の実施形態のオーディオ・ビデオ同期制御装置においては、適用される製品に使用されるビットレート(bitrate)に基づいて、復号化用バッファの大きさ(buffer_size)を近似的に求めることが可能である。その場合には、次式(5)に従って、復号化用バッファの大きさ(buffer_size)を算出することで、図2の構成におけるバッファ34、38、42、44の各バッファサイズを決定すればよい。
【0038】
【数5】
Figure 0004212920
上記のバッファサイズ決定方法によれば、適用される製品のビットレート(bitrate)が非常に大きい場合であっても、上式(5)におけるタイムスケール定数nの値を大きな値に設定することにより、バッファサイズが増大してしまうことを回避することができる。
【0039】
さらに、図2の構成のオーディオ・ビデオ同期制御装置は、Δdata/Δt分離回路32が図6の時間ずれ補償回路(後述する)を含むよう構成することで、Δdata/Δt分離回路32の制御部によるバッファスイッチ切り替え動作における時間ずれを検知して、その時間ずれを補正することができる。
【0040】
以下、この時間ずれの補正方式の原理について説明する。
【0041】
まず、上式(1)を変形することで、次式(6)が得られる。
【0042】
【数6】
Figure 0004212920
上式(6)から明らかなように、p番目のアクセスユニットのデコードタイムスタンプdts(p)とDTS時間間隔au_dts_deltaを加算すれば、(p+1)番目のアクセスユニットのデコードタイムスタンプdts(p+1)が求まる。
【0043】
次式(8)で算出される、p番目のアクセスユニットについてのデータ転送累積時間t_pastの値と、p番目のアクセスユニットのデコードタイムスタンプdts(p)の値とを比較することで、時間ずれが発生したか否かを検知できる。すなわち、次式(7)で算出される、時間ずれt_diffの値がゼロに等しくなければ、時間ずれが発生したと判定する。時間ずれt_diffの算出値が正であれば、データ転送累積時間t_pastの値が大きすぎる場合であり、時間ずれt_diffの算出値が負であれば、データ転送累積時間t_pastの値が小さすぎる場合である。
【0044】
【数7】
Figure 0004212920
【0045】
【数8】
Figure 0004212920
ここで、Δtは各アクセスユニットの一定時間間隔((3)式)の値を示す。
【0046】
さらに、次式(9)にしたがって、時間ずれt_diffを補正することができる。
【0047】
【数9】
Figure 0004212920
この例では、式(9)に従って修正されたau_dts_delta(p)を、図2の構成におけるΔdata/Δt分離回路32の制御部内の、DTS時間間隔を格納するためのレジスタに転送して、前回算出した時間間隔(Δt)の値が調整されることで、時間ずれの補正が行われる。
【0048】
次に、本発明のオーディオ・ビデオ同期制御方式を実際の場合に適用した例について説明する。
【0049】
図8は、図7と同じMP4ファイルに記述される各アクセスユニットのデータ量(au_size)の一例を示す。この例では、time_scale=1000、n=1、bitrate=2Mbps、buffer_size=0X160バイトに設定している。
【0050】
図9は、図7のデコードタイムスタンプ時間間隔(au_dts_delta)と、図8の各アクセスユニットのデータ量(au_size)とに基づき算出されるデータ量(Δdata)の一例を示す。
【0051】
図9の例において、4番目のアクセスユニットについてデコードタイムスタンプDTS(4)=0X85,データ転送累積時間t_pass=0X83とすると、上式(7)及び(8)により、au_dts_delta(5)=0X22−(0X85−0X83)=0X18となる。
【0052】
上記の例で説明したように、従来のオーディオ・ビデオ同期制御方式では、同期を確立するため、10Kバイト以上の容量のバッファを用意する必要がある。しかし、本発明のオーディオ・ビデオ同期制御方式を適用すれば、10パーセント以上のバッファを削減することができる。
【0053】
図3は、図2のオーディオ・ビデオ同期制御装置が実行する同期制御方法の一例を説明するためのフロー図である。とくに、図3の同期制御フローは、図2の構成におけるΔdata/Δt分離回路32の制御部(以下、制御部という)がバッファスイッチ35、45の切り替え動作を制御するために実行される。
【0054】
図3の同期制御フローが開始すると、制御部は、ステップS1において、カウンタのカウント値cntをゼロにリセットして、カウント動作を開始する。
【0055】
ステップS2において、制御部は、経過時間t_intが算出したΔtの時間間隔に達したか否かを判定する。ステップS2は、経過時間t_intがΔtの時間間隔に達するまでくりかえし実行される。
【0056】
ステップS2でΔtの時間間隔に達すると、ステップS3において、制御部は、制御信号switch_on(=1)をバッファスイッチ35、45へ出力するとともに、カウンタのカウント値cntをインクリメントする。
【0057】
ステップS3が完了すると、ステップS4において、制御部は、カウンタのカウント値cntが算出したデータ転送回数scntに達したか否かを判定する。データ転送回数scntに達した場合には、次のアクセスユニットのデータの復号化処理を開始するため、上記ステップS1へ戻って上記処理を繰り返す。
【0058】
データ転送回数scntにまだ達しない場合には、同一アクセスユニットの残りのデータの復号化処理を継続するため、上記ステップS2へ戻って上記処理を繰り返す。
【0059】
図2の構成では、復号化用バッファのオーバフローやアンダーフローを回避するために、ダブルバッファ(オーディオバッファ34、38、及びビデオバッファ42、44)を設けている。入力ファイル10の先頭のアクセスユニットのデータについては、算出したデータ量Δdataをもつデータを、オーディオバッファ34とビデオバッファ42に格納する。次のアクセスユニット以降のデータについては、バッファスイッチ制御によって、交互に、オーディオバッファ34と38のいずれか一方とビデオバッファ42、44のいずれか一方に格納していく。
【0060】
図4は、図2のオーディオ・ビデオ同期制御装置に用いられるバッファスイッチ制御回路を示す。
【0061】
図4のバッファスイッチ制御回路は、図2の構成におけるΔdata/Δt分離回路32内に設けられ、その動作はΔdata/Δt分離回路32の制御部によって制御される。とくに、図4のバッファスイッチ制御回路は、バッファスイッチ33、43の切り替え動作を制御するための制御信号switch_onを出力する。
【0062】
図4において、このバッファスイッチ制御回路50は、クロック生成部(CLK)51と、カウンタ(cnt)52と、クロック数算出部(clk_num)53と、コンパレータ(COMP)54とを含む。
【0063】
クロック生成部51は、所定の周波数(CLK_Hz)をもつクロック信号をカウンタ52とクロック数算出部53へ出力する。
【0064】
カウンタ52は、入力されるクロック信号をカウントして、カウント値(cnt)を示す信号をコンパレータ54の一方の入力に送出する。また、起動時に入力されるリセット信号(reset)に応じて、カウンタ52のカウント値はゼロにリセットされ、カウンタ52はクロック信号のカウント動作を開始する。また、カウンタ52は、コンパレータ54の出力から制御信号switch_on(=1)を受取った場合にも、カウント値がリセットされ、クロック信号のカウント動作を再開する。
【0065】
クロック数算出部53は、次式(10)にしたがってクロック数(clk_num)を算出して、その算出結果をコンパレータ54のもう一方の入力に送出する。
【0066】
【数10】
Figure 0004212920
ここで、ΔtはΔdata/Δt分離回路32が算出した上記の時間間隔を示し、CLK_Hzは入力されるクロック信号の周波数を示す。
【0067】
コンパレータ54は、カウンタ52から受取ったカウント値(cnt)と、クロック数算出部53から受取ったクロック数(clk_num)とを比較する。カウント値(cnt)が増加して、クロック数(clk_num)に等しくなると、コンパレータ54は制御信号switch_on(=1)をバッファスイッチ33、43へ出力する。また、制御信号switch_on(=1)が出力されると、カウンタ52のカウント値がゼロにリセットされ、カウンタ52はクロック信号のカウント動作を再開する。
【0068】
図2の構成においては、バッファスイッチ制御回路50起動後、最初に制御信号switch_on(=1)が出力されると、バッファスイッチ33はオーディオバッファ34側に導通され、バッファスイッチ43はビデオバッファ42側に導通される。その後、バッファスイッチ制御回路50の動作に従い、制御信号switch_on(=1)が出力されるごとに、オーディオバッファ34、38と、ビデオバッファ42、44に対して、バッファスイッチ33、43の切り替え動作が交互に行われる。
【0069】
図5は、図2のオーディオ・ビデオ同期制御装置が実行する同期制御方法の一例を説明するためのフロー図である。とくに、図5の同期制御フローは、図2の構成におけるΔdata/Δt分離回路32の制御部がバッファスイッチ33、43の切り替え動作を制御するために実行される。
【0070】
図5の同期制御フローは、図4に説明したバッファスイッチ制御回路50の動作と同様であるので、その説明を省略する。
【0071】
図6は、本発明の第2の実施の形態に係るオーディオ・ビデオ同期制御装置を示す。とくに、図6のオーディオ・ビデオ同期制御装置は、図2の構成におけるΔdata/Δt分離回路32が、その制御部によるバッファスイッチ切り替え動作に時間ずれが発生した場合にその時間ずれを補正するための時間ずれ補償回路を含むように構成される。
【0072】
図6の時間ずれ補償回路は、クロック生成部(CLK)51と、カウンタ(cnt)52と、カウント数(dts_cnt_num)格納レジスタ53と、コンパレータ(COMP)54と、バッファスイッチ回路61と、カウンタ(cnt)62と、カウント数(dts_cnt_num)格納レジスタ63と、減算器(sub)64と、DTS時間間隔格納レジスタ65と、加算器(add)66とを含む。
【0073】
図6の構成におけるバッファスイッチ回路61は、図4のバッファスイッチ制御回路と同様に構成される。バッファスイッチ回路61が制御信号switch_on(=1)を出力するとき、カウンタ62のカウント値cntがインクリメントされる。カウンタ62は、データ転送累積時間t_pastの値を示す信号(t_pass)を減算器64の一方の入力に送出する。
【0074】
該当するアクセスユニットのdtsをクロック信号の周期で割り算することにより算出したdts_cnt_numの値をレジスタ53とレジスタ63に格納する。レジスタ63は該当するアクセスユニットのdtsの値に相当する信号(dts)を減算器64の他方の入力に出力する。
【0075】
図6のバッファスイッチ制御回路50は、カウンタ52のカウント値cntがレジスタ53に格納されたdts_cnt_numの値に達したとき、制御信号sub_on(=1)を減算器64の制御入力に出力する。このとき、減算器64は、上式(7)に示した時間ずれt_diffの値を示す信号(t_diff)を加算器66の一方の入力に出力する。他方、レジスタ65は、該当するアクセスユニットのDTS時間間隔(au_dts_delta_p)を示す信号を加算器66の他方の入力に出力する。そして、加算器66の出力によって、時間ずれt_diffが補正されて、補正後のDTS時間間隔(au_dts_delta_p)でレジスタ65の格納データが修正される。
【0076】
上記実施形態のオーディオ・ビデオ同期制御装置によれば、図2の構成におけるΔdata/Δt分離回路32の制御部によるバッファスイッチ切り替え動作における時間ずれを検知することができ、簡易な方式で検知された時間ずれを補正することができる。
【0077】
(付記1)
圧縮符号化されたオーディオ・ビデオデータを含む入力ファイルから得られる各アクセスユニットのサイズ情報とタイムスタンプ情報に基づいて一定の時間間隔におけるデータ量を算出する手順と、前記時間間隔にしたがって、前記データ量をもつオーディオデータとビデオデータをオーディオバッファとビデオバッファにそれぞれ格納する手順と、前記タイムスタンプ情報に基づいてデータ転送回数を算出する手順と、前記データ転送回数にしたがって、前記オーディオデータと前記ビデオデータをオーディオデコーダとビデオデコーダへ転送する手順と を有することを特徴とするオーディオ・ビデオ同期制御方法。
【0078】
(付記2)
前記オーディオバッファと前記ビデオバッファの大きさは、適用される製品のビットレートに基づいて算出されることを特徴とする付記1記載のオーディオ・ビデオ同期制御方法。
【0079】
(付記3)
入力ファイルからの圧縮符号化されたオーディオ・ビデオデータをオーディオデータとビデオデータに分離するとともに、オーディオ・ビデオ同期制御を行う分離部と、分離されたオーディオデータを格納するオーディオバッファと、格納されたオーディオデータを復号化するオーディオデコーダと、分離されたビデオデータを格納するビデオバッファと、格納されたビデオデータを復号化するビデオデコーダとを有するオーディオ・ビデオ同期制御装置であって、前記分離部は、 前記入力ファイルから得られる各アクセスユニットのサイズ情報とタイムスタンプ情報に基づいて一定の時間間隔のデータ量を算出する手段と、算出された時間間隔にしたがって、算出されたデータ量をもつオーディオデータとビデオデータを前記オーディオバッファと前記ビデオバッファにそれぞれ格納する手段と、 前記タイムスタンプ情報に基づいてデータ転送回数を算出する手段と、算出されたデータ転送回数にしたがって、格納された前記オーディオデータと前記ビデオデータを、前記オーディオデコーダと前記ビデオデコーダへそれぞれ転送する手段とを備えることを特徴とするオーディオ・ビデオ同期制御装置。
【0080】
(付記4)
前記オーディオバッファと前記ビデオバッファはそれぞれ、同じサイズの2個のバッファを並列に接続して構成されることを特徴とする付記3記載のオーディオ・ビデオ同期制御装置。
【0081】
(付記5)
前記分離部は、当該アクセスユニットのデータ転送累積時間と対応するタイムスタンプ情報を比較することにより時間ずれを検知し、検知された時間ずれに応じて前記データ転送回数を調整することにより前記時間ずれを補正する時間ずれ補償回路を備えることを特徴とする付記3又は4記載のオーディオ・ビデオ同期制御装置。
【0082】
(付記6)
前記分離部は、前記分離部と前記オーディオバッファ間、及び前記分離部と前記ビデオバッファ間にそれぞれ設けた第1のバッファスイッチと、前記オーディオバッファと前記オーディオデコーダ間、及び前記ビデオバッファと前記ビデオデコーダ間にそれぞれ設けた第2のバッファスイッチの切り替え動作を交互に行うよう構成したことを特徴とする付記3記載のオーディオ・ビデオ同期制御装置。
【0083】
(付記7)
前記時間ずれ補償回路は、所定の周波数で入力されるクロック信号のカウント値と、前記時間間隔とに基づいて、前記オーディオバッファ及び前記ビデオバッファと、前記分離部との導通を切り替えるための制御信号を出力するバッファスイッチ制御回路を含むことを特徴とする付記5記載のオーディオ・ビデオ同期制御装置。
【0084】
(付記8)
前記分離部は、所定の周波数で入力されるクロック信号のカウント値と、前記時間間隔とに基づいて、前記オーディオバッファ及び前記ビデオバッファと、前記分離部との導通を切り替えるための制御信号を出力するバッファスイッチ制御回路を含むことを特徴とする付記3記載のオーディオ・ビデオ同期制御装置。
【0085】
【発明の効果】
以上説明したように、本発明のオーディオ・ビデオ同期制御方法及び装置によれば、入力ファイルのアクセスユニットの大きさに依存しないサイズをもつ復号化用バッファを用いることで、オーディオ・ビデオ同期制御回路の規模を削減することが可能である。したがって、オーディオ・ビデオ同期制御方式のコストの低減および処理時間の短縮に寄与することができる。また、本発明のオーディオ・ビデオ同期制御方法及び装置によれば、Δdata/Δt分離回路の制御部によるバッファスイッチ切り替え動作に発生する可能性のある時間ずれを検知することができ、簡易な方式で検知された時間ずれを補正することができる。
【図面の簡単な説明】
【図1】従来のオーディオ・ビデオ同期制御装置の一例を示す図である。
【図2】本発明の第1の実施の形態に係るオーディオ・ビデオ同期制御装置を示す図である。
【図3】図2のオーディオ・ビデオ同期制御装置が実行する同期制御方法の一例を説明するためのフロー図である。
【図4】図3の同期制御方法を実現するために用いられるバッファスイッチ制御回路を示す図である。
【図5】図2のオーディオ・ビデオ同期制御装置が実行する同期制御方法の一例を説明するためのフロー図である。
【図6】本発明の第2の実施の形態に係るオーディオ・ビデオ同期制御装置を示す図である。
【図7】MP4ファイルに記述される各アクセスユニット間のデコードタイムスタンプ時間間隔(au_dts_delta)の一例を示す図である。
【図8】図7と同じMP4ファイルに記述される各アクセスユニットのデータ量(au_size)の一例を示す図である。
【図9】図7のデコードタイムスタンプ時間間隔(au_dts_delta)と、図8の各アクセスユニットのデータ量(au_size)とに基づき算出されるデータ量(Δdata)の一例を示す図である。
【符号の説明】
10 MP4ファイル
12 AU/DTS分離回路
14 オーディオAUバッファ
16 オーディオデコーダ
18 ビデオAUバッファ
20 ビデオデコーダ
22 オーディオDTSバッファ
24 ビデオDTSバッファ
26 同期制御回路
32 Δdata/Δt分離回路
33 バッファスイッチ
34 オーディオバッファ
35 バッファスイッチ
38 オーディオバッファ
42 ビデオバッファ
43 バッファスイッチ
44 ビデオバッファ
45 バッファスイッチ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an audio / video synchronization control method and apparatus for synchronously reproducing an audio / video stream pre-compressed and encoded, such as an audio / video stream in an MP4 file defined in an MPEG4 (Moving Picture Experts Group 4) system. It is about.
[0002]
[Prior art]
In the conventional audio / video synchronization control method, a decoding time stamp (DTS) is described for each access unit (AU) in an audio / video stream compression-encoded based on a certain time base, and synchronous reproduction is performed according to the decoding time stamp. The method of performing is used.
[0003]
An access unit (AU) is a data unit that can be independently accessed in an audio / video stream. For example, in the case of video, it corresponds to encoded data of VOP (video object plane). In MPEG4, synchronization control of a compression-encoded audio / video stream is performed in units of access units (AU).
[0004]
FIG. 1 shows an example of a conventional audio / video synchronization control apparatus.
[0005]
In the audio / video synchronization control apparatus of FIG. 1, the MP4 file 10 includes an audio / video stream compressed and encoded in the MP4 file format, and is input to the AU / DTS separation circuit 12. The AU / DTS separation circuit 12 separates the input file 10 into an audio stream access unit (AU) and a video stream access unit (AU), and stores them in the audio AU buffer 14 and the video AU buffer 18, respectively.
[0006]
The audio data (au_data) of each access unit (AU) stored in the audio AU buffer 14 is transferred to the audio decoder 16 and decoded (decoded) by the audio decoder 16. The video data (au_data) of each access unit (AU) stored in the video AU buffer 18 is transferred to the video decoder 20 and decoded (decoded) by the video decoder 20. The audio data decoded by the audio decoder 16 is reproduced by a speaker, and at the same time, the video data decoded by the video decoder 20 is displayed on a display monitor.
[0007]
Further, in the conventional configuration of FIG. 1, the AU / DTS separation circuit 12 receives, from the input file 10, the DTS time interval (au_dts_delta) of each access unit of the audio stream and the DTS time interval (au_dts_delta) of each access unit of the video stream. Are stored in the audio DTS buffer 22 and the video DTS buffer 24, respectively.
[0008]
In the conventional audio / video synchronization control apparatus of FIG. 1, the synchronization control circuit 26 monitors each DTA time interval of the audio / video stream, and instructs a control signal a_dec_start for instructing to start a decoding process for audio data, and a video. A control signal v_dec_start instructing the start of the decoding process for data is output to the audio decoder 16 and the video decoder 20, respectively. Accordingly, the synchronization control circuit 26 performs synchronization control so that the corresponding decoder starts the decoding process in units of access units according to the DTS time interval.
[0009]
Here, the MP4 file has a table describing the time interval (au_dts_delta) between the DTS of the corresponding access unit and the DTS of the next access unit for each element stream. This DTS time interval (au_dts_delta) is calculated as shown in the following equation (1) for each element stream.
[0010]
[Expression 1]
Figure 0004212920
Here, p is a number for identifying the corresponding access unit in the stream. When p = 0, DTS (0) = 0. The time unit of the DTS time interval (au_dts_delta) is (1 / time_scale) seconds.
[0011]
The DTS time interval table has a structure as shown in FIG. FIG. 7 is an example of a DTS table of an access unit (AU) of a video stream in a certain MP4 file. In FIG. 7, au_count indicates the number of access units having the same DTS time interval (au_dts_delta).
[0012]
In the conventional audio / video synchronization control system, synchronization is established by decoding an access unit (AU) according to the DTS time interval described in the table.
[0013]
As a conventional technique related to the present invention, Japanese Patent Application Laid-Open No. 11-164256 discloses that audio and video processing are performed independently, and audio data and video data having different reference processing times are synchronously reproduced. An audio / video synchronized playback method is shown.
[0014]
[Patent Document 1]
JP-A-11-164256
[0015]
[Problems to be solved by the invention]
In the conventional audio / video synchronization control system, since synchronization is controlled in units of access units, it is necessary to prepare a decoding buffer in units of access units. However, the size (au_size) of the access unit varies depending on various factors (for example, bit rate). When applied to a digital video camera, for example, in an 8 Mbps VGA IVOP, the size of one access unit is often several hundred kilobytes. On the other hand, it is not desirable to provide a large-capacity buffer in portable audio / video equipment.
[0016]
Therefore, in the conventional audio / video synchronization control system, since it is necessary to prepare a decoding buffer for each access unit, the scale of the synchronization control circuit tends to increase.
[0017]
Further, when a time lag occurs during synchronous playback of the audio / video stream, it is necessary to compensate for the time lag by skipping the video access unit or displaying the video access unit repeatedly. In the conventional audio / video synchronization control system, a method for efficiently compensating for the time lag is not considered.
[0018]
The present invention has been made in view of the above points, and reduces the size of an audio / video synchronization control circuit using a decoding buffer having a small size independent of the size of an access unit of an input file. It is an object of the present invention to provide an audio / video synchronization control method and apparatus capable of performing the above.
[0019]
[Means for Solving the Problems]
In order to solve the above problems, the present invention of The audio / video synchronization control method uses compressed and encoded audio. Data and Obtained from an input file containing video data Of audio and video data Size information of each access unit and Decode each access unit Time stamp information When On the basis of the , Regular time interval For each access unit to be transferred Procedure for calculating data amount and the time interval Every , Calculated The amount of data Size of Audio data and video data with Each access unit Storing audio in the audio buffer and video buffer respectively The decoding of each access unit obtained from the input file Time stamp information By multiplying by the inverse of the time interval A procedure for calculating the number of data transfers, Calculated According to the number of data transfers, By switching on and off the control signal output to the buffer switch provided between the audio buffer and the audio decoder and the control signal output to the buffer switch provided between the video buffer and the video decoder, The audio data and the video data Each access unit The Above With audio decoder Above Video decoder And each And a transfer procedure.
[0020]
Further, in order to solve the above problems, the present invention of Audio / video synchronization controller Data and From an input file containing video data Acquire each access unit of audio data and video data With audio Data and video data A separation unit for performing synchronous control; Acquired Audio data Each access unit Audio buffer for storing audio data stored Each access unit An audio decoder for decoding Acquired Video data Each access unit Video buffer to store the stored video data Each access unit An audio / video synchronization control device having a video decoder for decoding Audio data and video data obtained from the input file Size information of each access unit and Decode each access unit Time stamp information When On the basis of the , Regular time interval For each access unit to be transferred Means for calculating the amount of data; Above Time interval Every , Calculated Above amount of data Size of Audio data and video data with Each access unit Means for storing respectively in the audio buffer and the video buffer; The decoding of each access unit obtained from the input file Time stamp information By multiplying the inverse of the time interval According to the means for calculating the number of data transfers, and according to the calculated number of data transfers, By switching on / off a control signal output to a buffer switch provided between the audio buffer and the audio decoder, and a control signal output to a buffer switch provided between the video buffer and the video decoder, The audio data and the video data Each access unit The audio decoder and the video decoder And Each means for transferring.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0022]
First, the basic principle of the audio / video synchronization control system of the present invention will be described.
[0023]
As described above, in the conventional audio / video synchronization control system, the AU data having the size (au_size) of each access unit described in the MP4 file is stored in the decoding buffer, and the DTS time interval (au_dts_delta) is stored. Control synchronization. Instead, in the audio / video synchronization control system of the present invention, a fixed time calculated from the size (au_size) of each access unit and the DTS time interval (au_dts_delta) of each access unit described in the MP4 file. Audio / video data having a data amount (Δdata) of the interval (Δt) is stored in the decoding buffer and transferred to the decoder at the calculated transfer count (scnt) to establish synchronization.
[0024]
The data amount (Δdata) and the fixed time interval (Δt) are calculated according to the following equations (2) and (3) from au_size and au_dts_delta described in the MP4 file.
[0025]
[Expression 2]
Figure 0004212920
[0026]
[Equation 3]
Figure 0004212920
Here, n is an arbitrary integer (hereinafter, n is referred to as a time scale constant). The number of transfers (scnt) is calculated according to the following equation (4).
[0027]
[Expression 4]
Figure 0004212920
FIG. 2 shows an audio / video synchronization control apparatus according to the first embodiment of the present invention. 2 includes a Δdata / Δt separation circuit 32, a pair of buffer switches 33 and 43, a pair of audio buffers 34 and 38, a pair of video buffers 42 and 44, and a pair of buffer switches. 35, 45, an audio decoder 16, and a video decoder 20.
[0028]
In the audio / video synchronization control device of FIG. 2, the switching operation of the buffer switches 33 and 43 and the buffer switches 35 and 45 is controlled by a control signal output from the control unit of the Δdata / Δt separation circuit 32.
[0029]
In addition, the control signal from the control unit of the Δdata / Δt separation circuit 32 to the buffer switches 33 and 43 alternately switches the buffer switches 33 and 43 with respect to the audio buffers 34 and 38 and the video buffers 42 and 44. Output as done. That is, as shown in FIG. 2, when the buffer switch 33 is electrically connected to the audio buffer 38 at a certain time, the buffer switch 43 is electrically connected to the video buffer 44. When the switching operation of the buffer switches 33 and 43 is performed at the next time point, the buffer switch 33 becomes conductive with the audio buffer 34 side, and at the same time, the buffer switch 43 becomes conductive with the video buffer 42 side.
[0030]
Similarly, the control signal from the control unit of the Δdata / Δt separation circuit 32 to the buffer switches 35 and 45 alternately switches the buffer switches 35 and 45 with respect to the audio buffers 34 and 38 and the video buffers 42 and 44. Is output as is done. That is, as shown in FIG. 2, when the buffer switch 35 is electrically connected to the audio buffer 34 side at a certain time, the buffer switch 45 is electrically connected to the video buffer 42 side. When the switching operation of the buffer switches 35 and 45 is performed at the next time point, the buffer switch 35 becomes conductive with the audio buffer 38 side, and at the same time, the buffer switch 45 becomes conductive with the video buffer 44 side.
[0031]
As shown in FIG. 2, in place of the AU / DTS separation circuit 12 in the conventional configuration of FIG. 1, the audio / video synchronization control apparatus of this embodiment is provided with a Δdata / Δt separation circuit 32. The MP4 file 10 includes an audio / video stream compressed and encoded in the MP4 file format, and is input to the Δdata / Δt separation circuit 32.
[0032]
The Δdata / Δt separation circuit 32 uses the au_size and au_dts_delta for each access unit obtained from the MP4 file 10, and uses a data amount (Δdata) at a constant time interval (Δt) according to the above equations (2) and (3). Is calculated. Further, the Δdata / Δt separation circuit 32 calculates the number of transfers (scnt) according to the above equation (4).
[0033]
The Δdata / Δt separation circuit 32 separates the input file 10 into audio data and video data having a data amount (Δdata) of the calculated constant time interval (Δt), and either one of the audio buffers 34 and 38 is separated. And stored in one of the video buffers 42 and 44, respectively.
[0034]
In the audio / video synchronization control device of FIG. 2, the Δdata / Δt separation circuit 32 controls the switching operation of the buffer switches 33 and 43 at a constant time interval (Δt), thereby reducing the size of the data amount (Δdata). The stored audio data is stored in one of the audio buffers 34 and 38, and the video data having a data amount (Δdata) is stored in either one of the video buffers 42 and 44.
[0035]
At the same time, the Δdata / Δt separation circuit 32 controls the switching operation of the buffer switches 35 and 45 based on the calculated number of transfers (scnt), and the audio data already stored in the other buffer of the audio buffers 34 and 38. Is transferred to the audio decoder 16 and the video data already stored in the other buffer of the video buffers 42 and 44 is transferred to the video decoder 20.
[0036]
According to the above embodiment, the audio / video synchronization control apparatus can be configured using a decoding buffer having a size smaller than that of the conventional configuration, and the size independent of the size of the access unit of the input file can be set. By using the decoding buffer, it is possible to reduce the scale of the audio / video synchronization control circuit.
[0037]
In the audio / video synchronization control apparatus of the above embodiment, the size (buffer_size) of the decoding buffer is approximately obtained based on the bit rate used for the product to be applied. Is possible. In that case, the buffer size of each of the buffers 34, 38, 42, and 44 in the configuration of FIG. 2 may be determined by calculating the size of the decoding buffer (buffer_size) according to the following equation (5). .
[0038]
[Equation 5]
Figure 0004212920
According to the above buffer size determination method, even if the bit rate of the product to be applied is very large, the value of the time scale constant n in the above equation (5) is set to a large value. It is possible to avoid an increase in the buffer size.
[0039]
Further, the audio / video synchronization control device having the configuration of FIG. 2 is configured such that the Δdata / Δt separation circuit 32 includes the time shift compensation circuit (described later) of FIG. It is possible to detect a time lag in the buffer switch switching operation by and to correct the time lag.
[0040]
Hereinafter, the principle of this time shift correction method will be described.
[0041]
First, the following equation (6) is obtained by modifying the above equation (1).
[0042]
[Formula 6]
Figure 0004212920
As apparent from the above equation (6), the decoding time stamp dts (p + 1) of the (p + 1) th access unit is obtained by adding the decoding time stamp dts (p) of the pth access unit and the DTS time interval au_dts_delta. I want.
[0043]
By comparing the value of the accumulated data transfer time t_past for the pth access unit calculated by the following equation (8) with the value of the decode time stamp dts (p) of the pth access unit, the time shift Whether or not has occurred can be detected. That is, if the value of the time shift t_diff calculated by the following equation (7) is not equal to zero, it is determined that a time shift has occurred. If the calculated value of the time lag t_diff is positive, the value of the data transfer accumulated time t_past is too large, and if the calculated value of the time lag t_diff is negative, the value of the accumulated data transfer time t_past is too small. is there.
[0044]
[Expression 7]
Figure 0004212920
[0045]
[Equation 8]
Figure 0004212920
Where Δt i Indicates the value of a certain time interval (equation (3)) of each access unit.
[0046]
Furthermore, the time shift t_diff can be corrected according to the following equation (9).
[0047]
[Equation 9]
Figure 0004212920
In this example, au_dts_delta (p) corrected according to the equation (9) is transferred to a register for storing the DTS time interval in the control unit of the Δdata / Δt separation circuit 32 in the configuration of FIG. The time offset is corrected by adjusting the value of the time interval (Δt).
[0048]
Next, an example in which the audio / video synchronization control system of the present invention is applied to an actual case will be described.
[0049]
FIG. 8 shows an example of the data amount (au_size) of each access unit described in the same MP4 file as FIG. In this example, time_scale = 1000, n = 1, bitrate = 2 Mbps, buffer_size = 0X160 bytes are set.
[0050]
FIG. 9 shows an example of the data amount (Δdata) calculated based on the decoding time stamp time interval (au_dts_delta) in FIG. 7 and the data amount (au_size) of each access unit in FIG.
[0051]
In the example of FIG. 9, assuming that the decoding time stamp DTS (4) = 0X85 and the data transfer accumulated time t_pass = 0X83 for the fourth access unit, au_dts_delta (5) = 0X22− according to the above equations (7) and (8). (0X85-0X83) = 0X18.
[0052]
As described in the above example, in the conventional audio / video synchronization control method, it is necessary to prepare a buffer having a capacity of 10 Kbytes or more in order to establish synchronization. However, if the audio / video synchronization control system of the present invention is applied, the buffer of 10% or more can be reduced.
[0053]
FIG. 3 is a flowchart for explaining an example of the synchronization control method executed by the audio / video synchronization control apparatus of FIG. In particular, the synchronization control flow of FIG. 3 is executed in order that the control unit (hereinafter referred to as the control unit) of the Δdata / Δt separation circuit 32 in the configuration of FIG. 2 controls the switching operation of the buffer switches 35 and 45.
[0054]
When the synchronization control flow of FIG. 3 starts, the control unit resets the count value cnt of the counter to zero in step S1, and starts the count operation.
[0055]
In step S2, the control unit determines whether or not the elapsed time t_int has reached the calculated Δt time interval. Step S2 is repeated until the elapsed time t_int reaches the time interval Δt.
[0056]
When the time interval Δt is reached in step S2, in step S3, the control unit outputs a control signal switch_on (= 1) to the buffer switches 35 and 45 and increments the count value cnt of the counter.
[0057]
When step S3 is completed, in step S4, the control unit determines whether or not the count value cnt of the counter has reached the calculated data transfer count scnt. When the data transfer count scnt is reached, the process returns to step S1 and the above process is repeated in order to start the data decoding process for the next access unit.
[0058]
If the data transfer count scnt has not yet been reached, the process returns to step S2 and repeats the above process in order to continue the decoding process of the remaining data of the same access unit.
[0059]
In the configuration of FIG. 2, double buffers (audio buffers 34 and 38 and video buffers 42 and 44) are provided in order to avoid overflow and underflow of the decoding buffer. As for the data of the head access unit of the input file 10, data having the calculated data amount Δdata is stored in the audio buffer 34 and the video buffer 42. Data after the next access unit is alternately stored in one of the audio buffers 34 and 38 and one of the video buffers 42 and 44 by buffer switch control.
[0060]
FIG. 4 shows a buffer switch control circuit used in the audio / video synchronization control apparatus of FIG.
[0061]
The buffer switch control circuit of FIG. 4 is provided in the Δdata / Δt separation circuit 32 in the configuration of FIG. 2, and its operation is controlled by the control unit of the Δdata / Δt separation circuit 32. In particular, the buffer switch control circuit of FIG. 4 outputs a control signal switch_on for controlling the switching operation of the buffer switches 33 and 43.
[0062]
In FIG. 4, the buffer switch control circuit 50 includes a clock generation unit (CLK) 51, a counter (cnt) 52, a clock number calculation unit (clk_num) 53, and a comparator (COMP) 54.
[0063]
The clock generation unit 51 outputs a clock signal having a predetermined frequency (CLK_Hz) to the counter 52 and the clock number calculation unit 53.
[0064]
The counter 52 counts the input clock signal and sends a signal indicating the count value (cnt) to one input of the comparator 54. Further, the count value of the counter 52 is reset to zero in response to a reset signal (reset) input at the time of activation, and the counter 52 starts counting operation of the clock signal. Further, when the counter 52 receives the control signal switch_on (= 1) from the output of the comparator 54, the count value is reset and the count operation of the clock signal is restarted.
[0065]
The clock number calculation unit 53 calculates the clock number (clk_num) according to the following equation (10), and sends the calculation result to the other input of the comparator 54.
[0066]
[Expression 10]
Figure 0004212920
Here, Δt indicates the time interval calculated by the Δdata / Δt separation circuit 32, and CLK_Hz indicates the frequency of the input clock signal.
[0067]
The comparator 54 compares the count value (cnt) received from the counter 52 with the clock number (clk_num) received from the clock number calculation unit 53. When the count value (cnt) increases and becomes equal to the clock number (clk_num), the comparator 54 outputs the control signal switch_on (= 1) to the buffer switches 33 and 43. When the control signal switch_on (= 1) is output, the count value of the counter 52 is reset to zero, and the counter 52 resumes the clock signal counting operation.
[0068]
In the configuration of FIG. 2, when the control signal switch_on (= 1) is first output after the buffer switch control circuit 50 is activated, the buffer switch 33 is turned on to the audio buffer 34 side, and the buffer switch 43 is connected to the video buffer 42 side. Is conducted. Thereafter, in accordance with the operation of the buffer switch control circuit 50, every time the control signal switch_on (= 1) is output, the switching operation of the buffer switches 33 and 43 is performed for the audio buffers 34 and 38 and the video buffers 42 and 44. It is done alternately.
[0069]
FIG. 5 is a flowchart for explaining an example of the synchronization control method executed by the audio / video synchronization control apparatus of FIG. In particular, the synchronization control flow of FIG. 5 is executed in order for the control unit of the Δdata / Δt separation circuit 32 in the configuration of FIG. 2 to control the switching operation of the buffer switches 33 and 43.
[0070]
The synchronization control flow in FIG. 5 is the same as the operation of the buffer switch control circuit 50 described in FIG.
[0071]
FIG. 6 shows an audio / video synchronization control apparatus according to the second embodiment of the present invention. In particular, the audio / video synchronization control apparatus of FIG. 6 is for the Δdata / Δt separation circuit 32 in the configuration of FIG. 2 to correct the time shift when a time shift occurs in the buffer switch switching operation by the control unit. A time shift compensation circuit is configured to be included.
[0072]
6 includes a clock generation unit (CLK) 51, a counter (cnt) 52, a count number (dts_cnt_num) storage register 53, a comparator (COMP) 54, a buffer switch circuit 61, a counter ( cnt) 62, a count number (dts_cnt_num) storage register 63, a subtracter (sub) 64, a DTS time interval storage register 65, and an adder (add) 66.
[0073]
The buffer switch circuit 61 in the configuration of FIG. 6 is configured similarly to the buffer switch control circuit of FIG. When the buffer switch circuit 61 outputs the control signal switch_on (= 1), the count value cnt of the counter 62 is incremented. The counter 62 sends a signal (t_pass) indicating the value of the accumulated data transfer time t_past to one input of the subtractor 64.
[0074]
The value of dts_cnt_num calculated by dividing dts of the corresponding access unit by the period of the clock signal is stored in the register 53 and the register 63. The register 63 outputs a signal (dts) corresponding to the value of dts of the corresponding access unit to the other input of the subtractor 64.
[0075]
The buffer switch control circuit 50 in FIG. 6 outputs the control signal sub_on (= 1) to the control input of the subtractor 64 when the count value cnt of the counter 52 reaches the value of dts_cnt_num stored in the register 53. At this time, the subtractor 64 outputs a signal (t_diff) indicating the value of the time shift t_diff shown in the above equation (7) to one input of the adder 66. On the other hand, the register 65 outputs a signal indicating the DTS time interval (au_dts_delta_p) of the corresponding access unit to the other input of the adder 66. The time shift t_diff is corrected by the output of the adder 66, and the data stored in the register 65 is corrected at the corrected DTS time interval (au_dts_delta_p).
[0076]
According to the audio / video synchronization control apparatus of the above embodiment, it is possible to detect a time lag in the buffer switch switching operation by the control unit of the Δdata / Δt separation circuit 32 in the configuration of FIG. The time lag can be corrected.
[0077]
(Appendix 1)
A procedure for calculating a data amount at a fixed time interval based on the size information and time stamp information of each access unit obtained from the input file including the compression-encoded audio / video data, and according to the time interval, the data A procedure for storing audio data and video data having an amount in an audio buffer and a video buffer, a procedure for calculating the number of data transfers based on the time stamp information, and the audio data and the video according to the number of data transfers. An audio / video synchronization control method comprising: transferring data to an audio decoder and a video decoder.
[0078]
(Appendix 2)
2. The audio / video synchronization control method according to claim 1, wherein the sizes of the audio buffer and the video buffer are calculated based on a bit rate of a product to be applied.
[0079]
(Appendix 3)
The audio / video data compression-encoded from the input file is separated into audio data and video data, and a separation unit that performs audio / video synchronization control, an audio buffer that stores the separated audio data, and An audio / video synchronization control apparatus comprising: an audio decoder for decoding audio data; a video buffer for storing the separated video data; and a video decoder for decoding the stored video data, wherein the separation unit includes: Means for calculating a data amount at a fixed time interval based on size information and time stamp information of each access unit obtained from the input file, and audio data having a data amount calculated according to the calculated time interval And video data Means for storing each in a buffer and the video buffer; means for calculating the number of data transfers based on the time stamp information; and storing the audio data and the video data in accordance with the calculated number of data transfers, An audio / video synchronization control apparatus comprising: an audio decoder; and a means for transferring to each of the video decoders.
[0080]
(Appendix 4)
4. The audio / video synchronization control apparatus according to appendix 3, wherein the audio buffer and the video buffer are each configured by connecting two buffers of the same size in parallel.
[0081]
(Appendix 5)
The separation unit detects a time lag by comparing the time stamp information corresponding to the data transfer accumulated time of the access unit, and adjusts the number of times of data transfer according to the detected time lag. 6. The audio / video synchronization control apparatus according to appendix 3 or 4, further comprising a time shift compensation circuit for correcting the error.
[0082]
(Appendix 6)
The separation unit includes a first buffer switch provided between the separation unit and the audio buffer, and between the separation unit and the video buffer, between the audio buffer and the audio decoder, and between the video buffer and the video. 4. The audio / video synchronization control apparatus according to appendix 3, wherein the switching operation of the second buffer switch provided between the decoders is alternately performed.
[0083]
(Appendix 7)
The time shift compensation circuit is a control signal for switching conduction between the audio buffer and the video buffer and the separation unit based on a count value of a clock signal input at a predetermined frequency and the time interval. 6. The audio / video synchronization control apparatus according to claim 5, further comprising a buffer switch control circuit for outputting
[0084]
(Appendix 8)
The separation unit outputs a control signal for switching conduction between the audio buffer and the video buffer and the separation unit based on a count value of a clock signal input at a predetermined frequency and the time interval. 4. The audio / video synchronization control apparatus according to claim 3, further comprising a buffer switch control circuit for performing the operation.
[0085]
【The invention's effect】
As described above, according to the audio / video synchronization control method and apparatus of the present invention, an audio / video synchronization control circuit is provided by using a decoding buffer having a size independent of the size of the access unit of the input file. It is possible to reduce the scale. Therefore, it is possible to contribute to the reduction of the cost and the processing time of the audio / video synchronization control system. Further, according to the audio / video synchronization control method and apparatus of the present invention, it is possible to detect a time lag that may occur in the buffer switch switching operation by the control unit of the Δdata / Δt separation circuit, and in a simple manner. The detected time lag can be corrected.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an example of a conventional audio / video synchronization control apparatus.
FIG. 2 is a diagram showing an audio / video synchronization control apparatus according to the first embodiment of the present invention;
FIG. 3 is a flowchart for explaining an example of a synchronization control method executed by the audio / video synchronization control apparatus of FIG. 2;
4 is a diagram showing a buffer switch control circuit used for realizing the synchronization control method of FIG. 3; FIG.
FIG. 5 is a flowchart for explaining an example of a synchronization control method executed by the audio / video synchronization control apparatus of FIG. 2;
FIG. 6 is a diagram showing an audio / video synchronization control apparatus according to a second embodiment of the present invention;
FIG. 7 is a diagram illustrating an example of a decoding time stamp time interval (au_dts_delta) between access units described in an MP4 file.
8 is a diagram showing an example of the data amount (au_size) of each access unit described in the same MP4 file as FIG.
9 is a diagram illustrating an example of a data amount (Δdata) calculated based on the decoding time stamp time interval (au_dts_delta) in FIG. 7 and the data amount (au_size) of each access unit in FIG. 8;
[Explanation of symbols]
10 MP4 files
12 AU / DTS separation circuit
14 Audio AU buffer
16 Audio decoder
18 Video AU buffer
20 Video decoder
22 Audio DTS buffer
24 Video DTS buffer
26 Synchronous control circuit
32 Δdata / Δt separation circuit
33 Buffer switch
34 Audio buffer
35 Buffer switch
38 Audio Buffer
42 Video buffer
43 Buffer switch
44 Video buffer
45 Buffer switch

Claims (5)

圧縮符号化されたオーディオデータとビデオデータを含む入力ファイルから得られるオーディオデータとビデオデータの各アクセスユニットのサイズ情報と、各アクセスユニットのデコードタイムスタンプ情報に基づいて一定の時間間隔ごとに転送すべき各アクセスユニットのデータ量を算出する手順と、
前記時間間隔ごとに算出された前記データ量の大きさをもつオーディオデータとビデオデータの各アクセスユニットをオーディオバッファとビデオバッファにそれぞれ格納する手順と、
前記入力ファイルから得られる各アクセスユニットの前記デコードタイムスタンプ情報に前記時間間隔の逆数を乗じることによりデータ転送回数を算出する手順と、
算出された前記データ転送回数にしたがって、前記オーディオバッファとオーディオデコーダ間に設けたバッファスイッチに出力される制御信号、及び前記ビデオバッファとビデオデコーダ間に設けたバッファスイッチに出力される制御信号のオン・オフを切り替えることにより、前記オーディオデータと前記ビデオデータの各アクセスユニット前記オーディオデコーダと前記ビデオデコーダとにそれぞれ転送する手順と
を有することを特徴とするオーディオ・ビデオ同期制御方法。
Based on the audio data obtained from the input file containing the compression-encoded audio data and video data and the size information of each access unit of the video data, and decoding time stamp information for each access unit for each predetermined time interval A procedure for calculating the amount of data for each access unit to be transferred ;
Storing each access unit of audio data and video data having the calculated amount of data for each time interval in an audio buffer and a video buffer;
Calculating the number of data transfers by multiplying the decode time stamp information of each access unit obtained from the input file by the inverse of the time interval ;
According to the calculated number of times of data transfer, the control signal output to the buffer switch provided between the audio buffer and the audio decoder and the control signal output to the buffer switch provided between the video buffer and the video decoder are turned on. - by switching off the audio and video synchronization control method characterized by having a step of transferring each respective access unit of the video data and the audio data to said video decoder and the audio decoder.
前記オーディオバッファと前記ビデオバッファの大きさは、適用される製品のビットレートに基づいて算出されることを特徴とする請求項1記載のオーディオ・ビデオ同期制御方法。  2. The audio / video synchronization control method according to claim 1, wherein the sizes of the audio buffer and the video buffer are calculated based on a bit rate of an applied product. 圧縮符号化されたオーディオデータとビデオデータを含む入力ファイルからオーディオデータとビデオデータの各アクセスユニットを取得するとともに、オーディオデータとビデオデータの同期制御を行う分離部と、取得したオーディオデータの各アクセスユニットを格納するオーディオバッファと、格納されたオーディオデータの各アクセスユニットを復号化するオーディオデコーダと、取得したビデオデータの各アクセスユニットを格納するビデオバッファと、格納されたビデオデータの各アクセスユニットを復号化するビデオデコーダとを有するオーディオ・ビデオ同期制御装置であって、
前記分離部は、
前記入力ファイルから得られるオーディオデータとビデオデータの各アクセスユニットのサイズ情報と、各アクセスユニットのデコードタイムスタンプ情報に基づいて一定の時間間隔ごとに転送すべき各アクセスユニットのデータ量を算出する手段と、
前記時間間隔ごとに、算出された前記データ量の大きさをもつオーディオデータとビデオデータの各アクセスユニットを前記オーディオバッファと前記ビデオバッファにそれぞれ格納する手段と、
前記入力ファイルから得られる各アクセスユニットの前記デコードタイムスタンプ情報に前記時間間隔の逆数を乗じることよりデータ転送回数を算出する手段と、
算出された前記データ転送回数にしたがって、前記オーディオバッファと前記オーディオデコーダ間に設けたバッファスイッチに出力される制御信号、及び前記ビデオバッファと前記ビデオデコーダ間に設けたバッファスイッチに出力される制御信号のオン・オフを切り替えることにより、前記オーディオデータと前記ビデオデータの各アクセスユニットを前記オーディオデコーダと前記ビデオデコーダとにそれぞれ転送する手段と
を備えることを特徴とするオーディオ・ビデオ同期制御装置。
From the input file containing the compressed encoded audio data and video data to acquire a respective access unit of the audio data and video data, a separating unit that performs synchronous control of the audio and video data, each access of the audio data acquired an audio buffer for storing units, an audio decoder for decoding the access units of the stored audio data, and video buffer for storing each access unit of the obtained video data, each access unit of the stored video data An audio / video synchronization control device having a video decoder for decoding,
The separation unit is
And size information of each access unit of the audio data and video data obtained from the input file on the basis of the decode time stamp information for each access unit, calculate the data amount of each access unit to be transferred at regular time intervals Means to
For each of the time intervals, and means for storing each of the respective access unit of audio data and video data having the calculated magnitude of the amount of data to the video buffer and the audio buffer,
Means for calculating the number of data transfers by multiplying the decode time stamp information of each access unit obtained from the input file by the reciprocal of the time interval ;
A control signal output to a buffer switch provided between the audio buffer and the audio decoder and a control signal output to a buffer switch provided between the video buffer and the video decoder according to the calculated number of times of data transfer An audio / video synchronization control apparatus comprising: means for transferring each access unit of the audio data and the video data to the audio decoder and the video decoder by switching between ON and OFF , respectively.
前記オーディオバッファと前記ビデオバッファはそれぞれ、同じサイズの2個のバッファを並列に接続して構成されることを特徴とする請求項3記載のオーディオ・ビデオ同期制御装置。  4. The audio / video synchronization control apparatus according to claim 3, wherein each of the audio buffer and the video buffer is configured by connecting two buffers of the same size in parallel. 前記分離部は、当該アクセスユニットのデータ転送累積時間と対応するデコードタイムスタンプ情報を比較することにより時間ずれを検知し、検知された時間ずれに応じて前記データ転送回数を調整することにより前記時間ずれを補正する時間ずれ補償回路を備えることを特徴とする請求項3又は4記載のオーディオ・ビデオ同期制御装置。The separation unit detects a time lag by comparing the data transfer accumulated time of the access unit with the corresponding decode time stamp information, and adjusts the number of times of data transfer according to the detected time lag. 5. The audio / video synchronization control apparatus according to claim 3, further comprising a time shift compensation circuit for correcting the shift.
JP2003044337A 2003-02-21 2003-02-21 Audio / video synchronization control method and apparatus Expired - Fee Related JP4212920B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003044337A JP4212920B2 (en) 2003-02-21 2003-02-21 Audio / video synchronization control method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003044337A JP4212920B2 (en) 2003-02-21 2003-02-21 Audio / video synchronization control method and apparatus

Publications (2)

Publication Number Publication Date
JP2004254186A JP2004254186A (en) 2004-09-09
JP4212920B2 true JP4212920B2 (en) 2009-01-21

Family

ID=33027066

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003044337A Expired - Fee Related JP4212920B2 (en) 2003-02-21 2003-02-21 Audio / video synchronization control method and apparatus

Country Status (1)

Country Link
JP (1) JP4212920B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4693427B2 (en) * 2005-01-27 2011-06-01 京セラ株式会社 Digital broadcast receiver
JP4900299B2 (en) * 2008-01-30 2012-03-21 オンキヨー株式会社 Stream playback apparatus, streaming system, and stream playback program
CN110943932B (en) * 2019-11-14 2022-11-11 锐捷网络股份有限公司 Information processing method and device

Also Published As

Publication number Publication date
JP2004254186A (en) 2004-09-09

Similar Documents

Publication Publication Date Title
JP3932059B2 (en) Signal processing device
JP3976759B2 (en) Device for synchronizing audio and video signals
JP4066058B2 (en) Programmable audio-video synchronization method and apparatus for multimedia systems
JP6287315B2 (en) Video / audio synchronization apparatus, video / audio synchronization method, and computer program for video / audio synchronization
JP4322851B2 (en) Video distribution system and video distribution server
JP4983923B2 (en) Decoder device and decoding method
JPH10511238A (en) Synchronization method and apparatus for playback system
JPH10511513A (en) Method and apparatus for synchronizing audio and video in an MPEG playback system
JP2005318502A (en) Video recording device for recording variable frame rate, multiplexing method, video coding method, program, and recording medium
CN106792154B (en) Frame skipping synchronization system of video player and control method thereof
JP2009268129A (en) Video recording apparatus, multiplexing method, program, and recording medium
CN108810656B (en) Real-time live broadcast TS (transport stream) jitter removal processing method and processing system
US7158187B2 (en) Audio video reproduction apparatus, audio video reproduction method, program, and medium
JP2003143550A (en) Time stamp value controller
US20090147842A1 (en) Video processing
JP4212920B2 (en) Audio / video synchronization control method and apparatus
JP4903930B2 (en) Signal processing device
WO2003067881A1 (en) Information processing apparatus and method
JP3637823B2 (en) Video signal switching device and video signal switching method thereof
JP5046907B2 (en) Recording apparatus, control method therefor, and program
JP6776126B2 (en) Image processing device, image processing method, and program
JP2004266724A (en) Real time voice buffer control apparatus
JP4900945B2 (en) Recording apparatus and recording method
JP2008054159A (en) Video-audio multiplexing apparatus
JP2001231035A (en) Decoding synchronous controller, decoder, and decode synchronization control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080729

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080929

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: 20081021

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: 20081029

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20111107

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121107

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20131107

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees