JP3725876B2 - Audio encoder and its encoding processing program - Google Patents
Audio encoder and its encoding processing program Download PDFInfo
- Publication number
- JP3725876B2 JP3725876B2 JP2003033915A JP2003033915A JP3725876B2 JP 3725876 B2 JP3725876 B2 JP 3725876B2 JP 2003033915 A JP2003033915 A JP 2003033915A JP 2003033915 A JP2003033915 A JP 2003033915A JP 3725876 B2 JP3725876 B2 JP 3725876B2
- Authority
- JP
- Japan
- Prior art keywords
- bits
- scale factor
- audio signal
- masking level
- quantization
- 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
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、例えばMPEG(Moving Picture Coding Experts Group)オーディオレコーダに設けられるオーディオ符号化器と、この符号化器においてオーディオ信号を符号化するために使用される符号化処理プログラムに関する。
【0002】
【従来の技術】
MPEGオーディオレコーダでは、心理聴覚分析を採用したオーディオ符号化器が用いられている。この種の符号化器は、入力されたオーディオ信号を、先ず時間/周波数変換部により時間領域の信号から周波数領域の信号に変換する。またそれと共に心理聴覚分析部により、高速フーリエ変換(FFT)分析等を用いてスケールファクタバンドごとの信号対マスク比(SMR)及び心理聴覚エントロピーをそれぞれ算出する。次に、量子化/可変長符号化/バッファ制御の繰り返しループにより、スケールファクタバンドごとのSMRから心理聴覚に基づいた量子化誤差のマスキングレベルを算出する。そして、利用可能なビット数の範囲内で量子化処理及び可変長符号化処理を繰り返し実行し、これにより量子化誤差がマスキングレベル以下になるような最適なスケールファクタを求める。
【0003】
また上記繰り返しループでは、符号化方式として可変長符号化方式を用いているため、各フレームで発生する符号化量は変化する。このため、ビット保存(bit reservoir)技術を用いている。すなわち、符号化発生量が少ないフレームでは、余ったビットを最大保存量を超えない範囲でビット保存に蓄積する。そして、この蓄積したビットを、オーディオ信号の立ち上がり等のように多くの符号化用のビットを必要とするフレームで利用する。多くのビットを必要とするか否かは、心理聴覚エントロピーに基づいて判定する。
【0004】
上記繰り返しループにより得られたスケールファクタは、ビットストリーム形成部に入力される。ビットストリーム形成部では、上記繰り返しループにより得られた最適なスケールファクタの符号と、そのときの量子化値の可変長符号と、サイド情報とをもとに、所定のフォーマットのオーディオビットストリームを形成する。そして、この形成されたオーディオビットストリームを送信又は記録メディアへの蓄積に供する(例えば、非特許文献1参照。)。
【0005】
ところで、上記量子化/可変長符号化/バッファ制御の繰り返しループでは、次のような処理が行われる。すなわち、先ず先に述べたスケールファクタバンドごとのSMRから、心理聴覚に基づいた量子化誤差のマスキングレベルがスケールファクタバンドごとに計算される。続いて、ビット保存に蓄積されているビット数と、心理聴覚エントロピーとを考慮して、付加するビット数(add_bits)が求められる。そして、この算出された付加ビット数(add_bits)は、設定されたビットレートに基づく1フレームあたりの平均ビット数(mean_bits)に加算され、これにより利用可能な最大ビット数(max_bits)が決定される。
【0006】
そうして、利用可能な最大ビット数(max_bits)が決定されると、スケールファクタ等を初期設定するための処理が行われ、続いて実際の周波数サンプルが現在のスケールファクタに基づき量子化される。その量子化値は可変長符号化され、これにより必要なビット数が求められる。もし、必要なビット数が利用可能な最大ビット数を超えている場合には、必要なビット数が利用可能なビット数以下になるまで量子化ステップサイズが大きな値に変更され、これにより必要なビット数が抑制される。
【0007】
続いて、以上のように求められた量子化値と元の周波数サンプルとが比較され、スケールファクタバンドごとの量子化歪みが求められる。そして、量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)を求める。その結果、すべてのスケールファクタバンドにおいてその量子化歪みがマスキングレベル以下であれば(over=0)、繰り返しループから抜け出してそのときのスケールファクタが保存され、符号化に使用されたビット数が計算される。そして、この計算された使用ビット数と利用可能な最大ビット数との間に差(未使用ビット数)があれば、この未使用ビットが次フレーム以降のフレームの符号化処理に使用するためにビット保存に蓄積される。
【0008】
一方、あるスケールファクタバンドにおいてその量子化歪みがマスキングレベルを超えていれば(over!=0)、それらすべてのスケールファクタが上限を超えずに修正可能であるか否かが判定される。そして、修正可能であればそれらのスケールファクタが増加される。以後、以上のループが繰り返し実行される。
【0009】
設定されたビットレートが高く、利用可能な最大ビット数が十分にあるときには、量子化歪みが許容範囲以下のスケールファクタの組み合わせが見つかる。利用可能なビット数が少ないときにはループが繰り返し実行され、スケールファクタが上限値に達してしまう。この場合には、スケールファクタが修正不可能と判断され、準最適なスケールファクタの組み合わせが保存される。そして、符号化に使用されたビット数が計算され、この使用されたビット数と利用可能な最大ビット数との間に差(未使用ビット数)があれば、この未使用ビットが次フレーム以降のフレームの符号化処理に使用するためにビット保存に蓄積される。
【0010】
入力されたオーディオ信号がステレオ信号の場合には、左右の各チャネルの信号ごとに、上述した量子化/可変長符号化/バッファ制御の繰り返しループの過程が繰り返し実行される。
【0011】
【非特許文献1】
総合マルチメディア選書 「MPEG」 映像情報メディア学会 編
第6章 MPEGオーディオ符号化(特にP141〜P153)
【0012】
【発明が解決しようとする課題】
ところが、このような従来のオーディオ符号化器では、入力されたオーディオ信号のフレームごとに、ビット保存に蓄積されたビット数から利用可能な最大ビット数が順次計算され、この計算されたビット数が当該フレームの符号化処理のために割り当てられる。この処理は、入力されたオーディオ信号がステレオ信号の場合にも、一方のチャネルについての処理結果を他方のチャネルの処理に引き継ぐかたちで行われる。
【0013】
このため、設定されたビットレートが低く、利用可能な最大ビット数が十分でない場合には、ステレオ信号の左右各チャネルのうち先に符号化処理されるチャネルの方に多くのビット数が割り当てられてしまい、後に符号化されるチャネルの符号化品質が劣化し易くなるという不具合を生じる。
【0014】
この発明は上記事情に着目してなされたもので、その目的とするところは、ステレオ信号のように複数チャネルを有するオーディオ信号を符号化する場合に、設定されたビットレートが低い場合でも、複数のチャネルの各々についてそれぞれ適当なビット数を割り当てることを可能にし、これによりチャネル間における符号化品質のばらつきを低減したオーディオ符号化器とその符号化処理プログラムを提供することにある。
【0015】
【課題を解決するための手段】
上記目的を達成するためにこの発明は、複数チャネルからなるオーディオ信号を、可変長符号化方式とビット保存技術を使用して符号化するオーディオ符号化器とその符号化プログラムにおいて、入力された上記オーディオ信号の各チャネル間における情報量の相違を検出し、その検出結果に基づいて、上記オーディオ信号の各フレームに割り当てる利用可能ビット数を補正する。そして、上記各チャネルのオーディオ信号をそれぞれスケールファクタに基づいて量子化及び可変長符号化する処理を、上記補正された利用可能ビット数の範囲内で、量子化歪みがマスキングレベル以下になるまで繰り返し実行し、この量子化処理及び可変長符号化処理により得られた結果をオーディオビットストリームにフォーマット化するようにしたものである。
【0016】
具体的には、オーディオ信号のチャネル間におけるパワー比を検出し、この検出されたパワー比に基づいて、上記ビット割当てにより決定される利用可能ビット数を補正する。
【0017】
また別の手段としては、心理聴覚分析によりオーディオ信号から求められる心理聴覚エントロピーのチャネル間の比を検出し、この検出された心理聴覚エントロピーの比に基づいて、上記ビット割当てにより決定される利用可能ビット数を補正する。
【0018】
したがってこの発明によれば、量子化/可変長符号化/バッファ制御の繰り返しループの処理に先立ち、オーディオ信号のチャネル間における情報量の相違が検出され、その検出結果に基づいてビット割当てにより決定される利用可能ビット数が補正される。このため、設定されたビットレートが低く、利用可能な最大ビット数が十分でない場合であっても、複数のチャネルにそれぞれ適切なビット数が割り当てられる。したがって、先に符号化されるチャネルは勿論のこと、後に符号化されるチャネルについても、品質の劣化を招くことなく符号化を行うことが可能となり、これによりチャネル間の符号化品質のばらつきを低減することができる。
【0019】
またこの発明は、上記繰り返しループにおいて、スケールファクタを繰り返し修正して量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせを求める際に、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、準最適なスケールファクタの組み合わせを求めることを特徴とする。
【0020】
準最適なスケールファクタの組み合わせを求める手段としては、次の各手段が考えられる。
第1の手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンド数が最小となるときのスケールファクタを保持しておく。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合に、上記保持されているスケールファクタをもとに準最適なスケールファクタの組み合わせを求めるものである。
【0021】
第2の手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンドのバンド幅に応じて重み付けされた値の合計、つまり量子化歪みがマスキングレベルを超えるスケールファクタバンドのバンド幅の合計が最小となるときのスケールファクタを保持しておく。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合に、上記保持されているスケールファクタをもとに準最適なスケールファクタの組み合わせを求めるものである。
第3の手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンドの、量子化歪みとマスキングレベルとの差の合計、つまり量子化歪みがマスキングレベルを超えるスケールファクタバンドの量子化歪みの誤差の合計が最小のときのスケールファクタを保持しておく。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されているスケールファクタをもとに準最適なスケールファクタの組み合わせを求めるものである。
【0022】
以上のように、準最適なスケールファクタを用意することによって、設定ビットレートが低く、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタバンドの組み合わせが見つからなかった場合でも、符号化されたオーディオ信号の品質劣化を抑制することが可能となる。
【0023】
【発明の実施の形態】
(第1の実施形態)
図1は、この発明に係わるオーディオ符号化器の第1の実施形態を示す機能ブロック図である。このオーディオ符号化器は、ハイブリッドフィルタバンク1と、心理聴覚分析部2と、繰り返しループ3と、ビットストリーム形成部4とを備えている。
【0024】
先ず心理聴覚分析部2は、高速フーリエ変換(FFT:First Fourier Transform)部21と、非予測可能性測定部22と、信号対マスク比(SMR:Signal-to-Mask Ratio)計算部23と、心理聴覚エントロピー評価部24とを有している。
【0025】
心理聴覚分析部2には、例えば図示しないPCM(Pulse Code Modulation)符号化部により16ビット直線量子化されたPCMステレオオーディオ信号ASが入力される。入力されたPCMステレオオーディオ信号ASは、高速フーリエ変換部21でFFT分析されたのち、非予測可能性測定部22により予測不可能性(Unpredictability)が測定される。SMR計算部23は、上記FFT分析に基づいて、入力されたPCMステレオオーディオ信号ASのサブバンド(スケールファクタバンド)ごとのSMRを計算する。心理聴覚エントロピー評価部24は、上記計算されたSMRをもとに心理聴覚エントロピーを求める。
【0026】
なお、心理聴覚分析のモデルについては、杉山:“音響信号の高能率符号化”,連載講座「ディジタルテレビ放送の基礎技術」,テレビ誌,48,4,pp.447-454(Apr.1994)に詳しく述べられている。
【0027】
ハイブリッドフィルタバンク1は、サブバンド分析フィルタバンク11と、適応ブロック長の変形離散コサイン変換(MDCT:Modified Discrete Cosine Transform)部12と、折り返し歪み削減バタフライ13とを有している。
【0028】
入力された上記PCMステレオオーディオ信号ASは、サブバンド分析フィルタバンク11により時間領域の信号から周波数領域の信号に変換されたのち、例えば32帯域のサブバンド(スケールファクタバンド)の信号に分割される。サブバンド分析には、例えば512タップのポリフェーズフィルタバンク(PFB:Polyphase Filter Bank)が用いられる。
【0029】
適応ブロック長MDCT部12は、プリエコーを抑圧するためのもので、上記分割された各サブバンド信号をさらに細かいスペクトルラインに写像する。このとき、適応ブロック長MDCT部12のブロック長は、上記心理聴覚エントロピー評価部24により求められる、予測不可能性を用いた心理聴覚エントロピーに基づいて決定される。折り返し歪み削減バタフライ13は、上記適応ブロック長MDCT部12により得られた写像信号に含まれる、周波数領域の折り返し歪みを除去する。
【0030】
繰り返しループ3は、非線形量子化部31と、スケールファクタ計算部32と、バッファ制御部33と、ハフマン符号化部34と、サイド情報符号化部35とを有している。
【0031】
スケールファクタ計算部32は、上記SMR計算部23により求められたスケールファクタバンドごとの信号対マスク比(SMR)をもとに、心理聴覚モデルに基づいた量子化誤差のマスキングレベルをスケールファクタバンドごとに計算する。また、バッファ制御部33のビット保存に蓄えられているビット数と、上記心理聴覚エントロピー評価部24により求められた心理聴覚エントロピーとに基づいて、非線形量子化に利用可能な最大ビット数を決定する。さらにスケールファクタ計算部32は、この利用可能な最大ビット数の決定に先立ち、前記入力されるオーディオ信号の左右各チャネル間のパワー比を算出する。算出されたパワー比は、上記利用可能な最大ビット数を補正するために用いられる。この補正された利用可能ビット数は、非線形量子化処理のために非線形量子化部31に与えられる。
【0032】
非線形量子化部31は、上記スケールファクタ計算部32によるビット割当てに従い、上記折り返し歪み削減バタフライ13から出力された写像信号の非線形量子化を行う。この非線形量子化により得られた量子化値はハフマン符号化部34により可変長符号化され、必要なビット数が求められる。この求められた必要ビット数は利用可能な最大ビット数と比較され、その比較結果をもとに量子化ステップサイズの変更が行われる。
【0033】
以上の非線形量子化及び可変長符号化は繰り返しループを伴っており、すべてのスケールファクタバンドで量子化誤差がマスキングレベル以下になるまで繰り返される。そして、すべてのスケールファクタバンドで量子化誤差がマスキングレベル以下になると、このとき得られたスケールファクタが用いられる。またこの繰り返しループでは、符号化に使用されたビット数が計算され、未使用ビット数は次フレーム以降の符号化のためにバッファ制御部33のビット保存に蓄積される。
【0034】
サイド情報符号化部35は、上記繰り返しループの終了後に、スケールファクタ計算部32により算出されたスケールファクタをビット割当て情報やハフマンテーブルと共にサイド情報として符号化する。
【0035】
ビットストリーム生成部4は、ヘッダと、上記ハフマン符号化部34により符号化されたデータと、上記サイド情報符号化部35により符号化されたサイド情報とを、所定のフォーマットに従い多重化してビットストリームを形成する。そして、この生成されたビットストリームを蓄積メディアへの蓄積に供するか、或いは通信路への送信に供する。
【0036】
次に、以上のように構成されたオーディオ符号化器におけるステレオ信号の量子化/可変長符号化/バッファ制御の繰り返しループ3による処理動作を説明する。この処理動作は、プログラムをマイクロコンピュータ或いはDSP(Digital Signal Processor)に実行させることにより実現される。
【0037】
図2は、その全体の処理手順と処理内容(メインルーチン)を示すフローチャートである。繰り返しループ3では、先ずステップ2aにより、入力されるステレオオーディオ信号ASの左右各チャネル間のパワー比が算出される。このパワー比の算出は次式により行われる。
【数1】
【0038】
繰り返しループ3では次に、入力されたステレオオーディオ信号ASの左右両チャネルについて順次、量子化/可変長符号化/バッファ制御の繰り返しループ処理が行われる。
【0039】
すなわち、ステップ2bで先ずチャネル番号chが初期化(ch=0)される。そして、この初期化したチャネル番号ch=0に対応するチャネル、例えば左チャネルの入力オーディオ信号について、ステップ2dにより量子化/可変長符号化/バッファ制御の繰り返しループ処理が実行される。
【0040】
この左チャネルに対する繰り返しループ処理が終了すると、ステップ2eでチャネル番号chがインクリメント(ch++)され、続いてこのインクリメントされたチャネル番号ch=1に対応するチャネル、例えば右チャネルについて、ステップ2dにより量子化/可変長符号化/バッファ制御の繰り返しループ処理が実行される。そうして左右両チャネルに対する繰り返しループ処理が終了すると、ステップ2cでこの処理の終了が確認されて繰り返しループ処理は終了となる。
【0041】
ところで、上記左右各チャネルに対する量子化/可変長符号化/バッファ制御の繰り返しループ処理は、次のように行われる。図3は、そのサブルーチンの処理手順と処理内容を示すフローチャートである。
【0042】
すなわち、先ずステップ3aでは、SMR計算部3により計算されたスケールファクタバンドごとのSMRから、心理聴覚に基づいた量子化誤差のマスキングレベルがスケールファクタバンドごとに計算される。続いてステップ3bでは、バッファ制御部33のビット保存に蓄積されているビット数と、心理聴覚エントロピーとを考慮して、付加するビット数(add_bits)が求められる。この求められた付加ビット(add_bits)は、先にステップ2aで算出された左右各チャネル間のパワー比(x_ratio[ch] )をもとに、次のように補正される。
add_bits=add_bits*x_ratio[ch] (4)
【0043】
そして、この補正された付加ビット数(add_bits)は、設定されたビットレートに基づく1フレームあたりの平均ビット数(mean_bits)に加算され、これにより利用可能な最大ビット数(max_bits)が決定される。その計算式を以下に示す。
max_bits=mean_bits+add_bits (5)
【0044】
そうして利用可能な最大ビット数(max_bits)が算出されると、ステップ3cにおいてスケールファクタ等の初期設定が行われ、しかる後ステップ3dにより量子化及び可変長符号化処理が実行される。このステップ3dでは、実際の周波数サンプルを現在のスケールファクタに基づき量子化する処理が行われる。そして、その量子化値がハフマン符号化部34により可変長符号化され、これにより符号化に必要なビット数が求められる。
【0045】
この求められた必要ビット数は上記利用可能な最大ビット数(max_bits)と比較される。この比較の結果、符号化に必要な必要ビット数が利用可能な最大ビット数(max_bits)を超えている場合には、符号化に必要な必要ビット数が利用可能な最大ビット数(max_bits)以下になるまで量子化ステップサイズを大きくして必要ビット数を抑制する。
【0046】
ステップ3eでは、上記ステップ3dにより決定された量子化値と元の周波数サンプルとが比較され、スケールファクタバンドごとの量子化歪みが求められる。ステップ3mでは、上記求められた量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)が求められる。そして、この求められたoverが0であるか否か(over=0?)がステップ3fで判定される。
【0047】
この判定の結果、overが0であれば、すなわちすべてのスケールファクタバンドの量子化歪みがマスキングレベル以下であれば、繰り返しループから抜け出してステップ3gに移行する。そして、このステップ3gにおいて、このときのスケールファクタが保存される。また、符号化に使用されたビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降の符号化のためにビット保存に蓄積される。
【0048】
一方、上記ステップ3fの比較の結果、あるスケールファクタバンドで量子化歪みがマスキングレベルを超えていた(over!=0)とする。この場合には、ステップ3iによりスケールファクタの修正が可能であるか否かが判定される。そして、すべてのスケールファクタが上限を越えずに修正可能ならば、ステップ3jによりこれらのスケールファクタを増加するように修正が行われる。そして、この修正後にステップ3dに戻り、以後すべてのスケールファクタバンドの量子化歪みが許容範囲内になるまで、ステップ3d乃至ステップ3jによる量子化および可変長符号化処理の繰り返しループが実行される。
【0049】
上記繰り返しループにおいては、設定ビットレートが高く利用可能な最大ビット数が十分にある場合には、量子化歪みが許容範囲内のスケールファクタの組み合わせが見つかる。これに対し、設定ビットレートが低く利用可能なビット数が少ない場合には、上記ループが繰り返されてスケールファクタが上限値に達してしまう。ステップ3iにおいてスケールファクタが上限値を超えて修正不可能と判定された場合には、ステップ3kにより準最適なスケールファクタの組み合わせが選択されて保存される。またそれと共に、符号化に使用したビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降の符号化のためにバッファ制御部33のビット保存に蓄積される。
【0050】
以上述べたように第1の実施形態では、繰り返しループ3において、先ずステレオオーディオ信号ASの左右各チャネル間のパワー比(x_ratio[ch])を算出する。そして、このチャネル間のパワー比(x_ratio[ch])をもとに付加ビット数(add_bits)を補正することにより、ステレオオーディオ信号ASのフレームごとに利用可能な最大ビット数(max_bits)を決定する。そして、この決定された利用可能な最大ビット数(max_bits)の範囲内で、ステレオオーディオ信号ASのフレームに対し量子化及び可変長符号化を行い、量子化歪みがマスキングレベル以下となるスケールファクタを求めている。
【0051】
したがって、利用可能な最大ビット数(max_bits)が入力オーディオ信号ASの左右両チャネル間のパワー比(x_ratio[ch])をもとに制御される。このため、設定ビットレートが低く利用可能な最大ビット数(max_bits)が十分でない場合でも、先に符号化されるチャネルに多くのビットが割り当てられて、後に符号化されるチャネルに利用可能なビット数が不足気味になる不具合は解消される。この結果、先に符号化されるチャネルは勿論のこと、後から符号化されるチャネルについても、品質の劣化を生じることなく符号化を行うことが可能となり、これによりチャネル間の符号化品質のばらつきを低減することができる。
【0052】
(第2の実施形態)
この発明の第2の実施形態は、量子化/可変長符号化/バッファ制御の繰り返しループにおいて、スケールファクタを繰り返し修正して量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせを求める際に、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、量子化歪みがマスキングレベルを超えるスケールファクタバンド数が最小となるときのスケールファクタをもとに、準最適なスケールファクタの組み合わせを求めるものである。
【0053】
図4は、この第2の実施形態に係わるオーディオ符号化器による、量子化/可変長符号化/バッファ制御の繰り返しループのサブルーチンの処理手順と処理内容を示すフローチャートである。なお、同図において前記図3と同一部分には同一符号を付して詳しい説明は省略する。また、オーディオ符号化器の構成についても図1と同一なので、ここでの説明は省略する。
【0054】
ステップ3mにおいて量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)が算出されると、続いてステップ3nにおいて、上記ステップ3mで求められたoverがスケールファクタバンド数の最小値(over_min)と比較される。この比較の結果、上記求められたoverがover_minより小さければ、ステップ3oにおいてスケールファクタバンド数の最小値(over_min)がいま求められたoverに更新される。またそれと共にステップ3oでは、現在のスケールファクタが準最適なスケールファクタとして保存される。
【0055】
続いてステップ3fでは、上記ステップ3mで求められたoverが0であるか否か(over=0?)が判定される。この判定の結果、over=0、つまりすべてのスケールファクタバンドの量子化歪みがマスキングレベル以下であれば、繰り返しループから抜け出してステップ3gに移行する。そして、このステップ3gにおいて、このときのスケールファクタが保存される。また、符号化に使用されたビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降の符号化のためにビット保存に蓄積される。
【0056】
一方、上記ステップ3fの比較の結果、あるスケールファクタバンドで量子化歪みがマスキングレベルを超えていた(over!=0)とする。この場合には、ステップ3iによりスケールファクタの修正が可能であるか否かが判定される。そして、すべてのスケールファクタが上限を越えずに修正可能ならば、ステップ3jによりこれらのスケールファクタを増加するように修正が行われる。そして、この修正後にステップ3dに戻り、以後すべてのスケールファクタバンドの量子化歪みが許容範囲内になるまで、ステップ3d乃至ステップ3jによる量子化及び可変長符号化処理の繰り返しループが実行される。
【0057】
上記繰り返しループにおいて、設定ビットレートが高く利用可能な最大ビット数が十分にある場合には、量子化歪みが許容範囲内のスケールファクタの組み合わせが見つかる。これに対し、設定ビットレートが低く利用可能なビット数が少ない場合には、上記ループが繰り返されてスケールファクタが上限値に達してしまう。ステップ3iにおいてスケールファクタが上限値を超えて修正不可能と判定された場合には、ステップ3pにより準最適なスケールファクタの組み合わせが元の値に復帰される。またそれと共に、符号化に使用したビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降のフレームの符号化のためにビット保存に蓄積される。
【0058】
以上述べたように第2の実施形態では、ステップ3n、ステップ3o、ステップ3f、ステップ3i及びステップ3pを実行することにより、ループ内において量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)が最小(over_min)となるときのスケールファクタが保存され、すべてのスケールファクタバンドにおいて量子化歪みをマスキングレベル以下にするスケールファクタの組み合わせが見つからない場合には、上記保存されたスケールファクタから準最適なスケールファクタの組み合わせが得られる。
【0059】
このため、設定ビットレートが低く、かつ利用可能な最大ビット数が十分でないことが原因で、すべてのスケールファクタバンドにおいて量子化歪みをマスキングレベル以下にするスケールファクタの組み合わせが見つからない場合でも、準最適なスケールファクタを用いて符号化が行われる。
【0060】
したがって、第2の実施形態によれば、第1の実施形態で述べた左右両チャネル間における利用可能最大ビット数(max_bits)の偏重の解消と相俟って、入力オーディオ信号ASのオーディオ符号化の品質劣化をさらに効果的に回避することができる。また、第2の実施形態であれば、スケールファクタバンド数を比較するだけの比較的簡単な処理により、準最適なスケールファクタの組み合わせが得られる利点がある。
【0061】
(第3の実施形態)
この発明の第3の実施形態は、マスキングレベルを満たさない帯域を少なくするためにスケールファクタバンド幅は非一様、つまり低域が狭く広域になるほど広くなるように設定される点に着目する。そして、量子化/可変長符号化/バッファ制御の繰り返しループにおいて、スケールファクタを繰り返し修正して量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせを求める際に、量子化歪みがマスキングレベルを超えるスケールファクタバンドのバンド幅の合計が最小となるときのスケールファクタを保持しておく。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合に、上記保持されているスケールファクタをもとに準最適なスケールファクタの組み合わせを求めるようにしたものである。
【0062】
図5は、この第3の実施形態に係わるオーディオ符号化器による、量子化/可変長符号化/バッファ制御の繰り返しループの処理手順と処理内容を示すフローチャートである。なお、同図において前記図3と同一部分には同一符号を付して詳しい説明は省略する。また、オーディオ符号化器の構成についても図1と同一なので、ここでの説明は省略する。
【0063】
ステップ3mにおいて量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)が算出されると、ステップ5aでは、上記量子化歪みがマスキングレベルを超えているすべてのスケールファクタバンドのバンド幅の合計(width)が算出される。次にステップ5bにおいて、上記算出されたwidthが最小値(width_min)と比較される。この比較の結果、width<width_minであれば、ステップ5cによりwidth_minが上記算出されたwidthに更新される。またそれと共に、ステップ5cにおいて、現在のスケールファクタが準最適なスケールファクタとして保存される。
【0064】
続いてステップ3fでは、上記ステップ3mで求められたoverが0であるか否か(over=0?)が判定される。この判定の結果、over=0、つまりすべてのスケールファクタバンドの量子化歪みがマスキングレベル以下であれば、繰り返しループから抜け出してステップ3gに移行する。そして、このステップ3gにおいて、このときのスケールファクタが保存される。また、符号化に使用されたビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降の符号化のためにビット保存に蓄積される。
【0065】
一方、上記ステップ3fの比較の結果、あるスケールファクタバンドで量子化歪みがマスキングレベルを超えていた(over!=0)とする。この場合には、ステップ3iによりスケールファクタの修正が可能であるか否かが判定される。そして、すべてのスケールファクタが上限を越えずに修正可能ならば、ステップ3jによりこれらのスケールファクタを増加するように修正が行われる。そして、この修正後にステップ3dに戻り、以後すべてのスケールファクタバンドの量子化歪みが許容範囲内になるまで、ステップ3d乃至ステップ3jによる量子化及び可変長符号化処理の繰り返しループが実行される。
【0066】
上記繰り返しループにおいて、設定ビットレートが高く利用可能な最大ビット数が十分にある場合には、量子化歪みが許容範囲内のスケールファクタの組み合わせが見つかる。これに対し、設定ビットレートが低く利用可能なビット数が少ない場合には、上記ループが繰り返されてスケールファクタが上限値に達してしまう。ステップ3iにおいてスケールファクタが上限値を超えて修正不可能と判定された場合には、ステップ5dにより準最適なスケールファクタの組み合わせが元の値に復帰される。またそれと共に、符号化に使用したビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降のフレームの符号化のためにビット保存に蓄積される。
【0067】
以上のように第3の実施形態では、ステップ5a、ステップ5b及びステップ5cを実行することにより、ループ内において量子化歪みがマスキングレベルを超えているすべてのスケールファクタバンドのバンド幅の合計(width)が最小(width_min)となるときのスケールファクタが保存される。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、上記保存されたスケールファクタが準最適なスケールファクタの組み合わせとして量子化及び符号化の処理に供される。
【0068】
このため、前記第2の実施形態と同様に、設定ビットレートが低く、かつ利用可能な最大ビット数が十分でないことが原因で、すべてのスケールファクタバンドにおいて量子化歪みをマスキングレベル以下にするスケールファクタの組み合わせが見つからない場合でも、準最適なスケールファクタを用いて符号化が行われることになる。
【0069】
したがって、第3の実施形態においても、第1の実施形態で述べた左右両チャネル間における利用可能最大ビット数(max_bits)の偏重の解消と相俟って、入力オーディオ信号ASのオーディオ符号化の品質劣化を効果的に回避することができる。また、バンド幅の狭いスケールファクタバンド、つまりオーディオ信号の低域成分を重要視した量子化及び符号化処理を行うことが可能となる。
【0070】
(第4の実施形態)
この発明の第4の実施形態は、量子化/可変長符号化/バッファ制御の繰り返しループにおいて、スケールファクタを繰り返し修正して量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせを求める際に、量子化歪みがマスキングレベルを超えるスケールファクタバンドの量子化歪みの誤差の合計が最小のときのスケールファクタを保持しておく。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されているスケールファクタをもとに準最適なスケールファクタの組み合わせを求めるものである。
【0071】
図6は、この第4の実施形態に係わるオーディオ符号化器による、量子化/可変長符号化/バッファ制御の繰り返しループの処理手順と処理内容を示すフローチャートである。なお、同図において前記図3と同一部分には同一符号を付して詳しい説明は省略する。また、オーディオ符号化器の構成についても図1と同一なので、ここでの説明は省略する。
【0072】
ステップ3mにおいて量子化歪みがマスキングレベルを超えているスケールファクタバンド数(over)が算出されると、ステップ6aでは、上記量子化歪みがマスキングレベルを超えているすべてのスケールファクタバンドの、量子化歪みとマスキングレベルとの差の絶対値(|量子化歪み−マスキングレベル|)の合計(maskerr)が算出される。すなわち、量子化歪みがマスキングレベルを超えるスケールファクタバンドの量子化歪みの誤差の合計が算出される。次にステップ6bにおいて、上記算出されたmaskerrが最小値(maskerr_min)と比較される。この比較の結果、maskerr<maskerr_minであれば、ステップ6cによりmaskerr_minが上記算出されたmaskerrに更新される。またそれと共に、ステップ6cにおいて、現在のスケールファクタが準最適なスケールファクタとして保存される。
【0073】
続いてステップ3fでは、上記ステップ3mで求められたoverが0であるか否か(over=0?)が判定される。この判定の結果、over=0、つまりすべてのスケールファクタバンドの量子化歪みがマスキングレベル以下であれば、繰り返しループから抜け出してステップ3gに移行する。そして、このステップ3gにおいて、このときのスケールファクタが保存される。また、符号化に使用されたビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降の符号化のためにビット保存に蓄積される。
【0074】
一方、上記ステップ3fの比較の結果、あるスケールファクタバンドで量子化歪みがマスキングレベルを超えていた(over!=0)とする。この場合には、ステップ3iによりスケールファクタの修正が可能であるか否かが判定される。そして、すべてのスケールファクタが上限を越えずに修正可能ならば、ステップ3jによりこれらのスケールファクタを増加するように修正が行われる。そして、この修正後にステップ3dに戻り、以後すべてのスケールファクタバンドの量子化歪みが許容範囲内になるまで、ステップ3d乃至ステップ3jによる量子化及び可変長符号化処理の繰り返しループが実行される。
【0075】
上記繰り返しループにおいて、設定ビットレートが高く利用可能な最大ビット数が十分にある場合には、量子化歪みが許容範囲内のスケールファクタの組み合わせが見つかる。これに対し、設定ビットレートが低く利用可能なビット数が少ない場合には、上記ループが繰り返されてスケールファクタが上限値に達してしまう。ステップ3iにおいてスケールファクタが上限値を超えて修正不可能と判定された場合には、ステップ6dにより準最適なスケールファクタの組み合わせが元の値に復帰される。またそれと共に、符号化に使用したビット数がステップ3hで計算され、この使用ビット数と利用可能な最大ビット数との差(未使用ビット数)が、次フレーム以降のフレームの符号化のためにビット保存に蓄積される。
【0076】
以上のように第4の実施形態では、ステップ6a、ステップ6b及びステップ6cを実行することにより、ループ内において量子化歪みがマスキングレベルを超えているすべてのスケールファクタバンドの|量子化歪み−マスキングレベル|の合計(maskerr)が最小(maskerr_min)となるときのスケールファクタが保存される。そして、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合に、上記保存されたスケールファクタが準最適なスケールファクタの組み合わせとして量子化及び符号化の処理に供される。
【0077】
このため、前記第2及び第3の実施形態と同様に、設定ビットレートが低く、かつ利用可能な最大ビット数が十分でないことが原因で、すべてのスケールファクタバンドにおいて量子化歪みをマスキングレベル以下にするスケールファクタの組み合わせが見つからない場合でも、準最適なスケールファクタを用いて符号化が行われることになる。
【0078】
したがって、第4の実施形態においても、第1の実施形態で述べた左右両チャネル間における利用可能最大ビット数(max_bits)の偏重の解消と相俟って、入力オーディオ信号ASのオーディオ符号化の品質劣化を効果的に回避することができる。また、量子化歪みが最適化され、量子化歪みが最小となるように量子化及び符号化処理が行われることになる。
【0079】
(その他の実施形態)
上記第1の実施形態では、左右両チャネル間のパワー比を求め、このパワー比をもとにフレームごとに利用可能な最大ビット数を制御するようにした。しかし、それに限るものではなく、左右両チャネル間の心理聴覚エントロピーの比を求め、この求められた心理聴覚エントロピーの比をもとにフレームごとに利用可能な最大ビット数を制御するようにしてもよい。このとき、上記心理聴覚エントロピーの比は、以下の式により求めることが可能である。
sum_pe = x_pe[0] + x_pe[1] (6)
x_ratio[ch] = x_pe[ch] / sum_pe ch=0 ,1 (7)
【0080】
なお、チャネル間の情報量の相違を検出する手段は、パワー比や心理聴覚エントロピーの比以外に、パワーの差や心理聴覚エントロピーの差を求めるようにしてもよく、さらにはその他の要素の相違を検出するようにしてもよい。
【0081】
また、前記各実施形態では、左右2チャネルからなるオーディオ信号を符号化する場合を例にとって説明したが、3チャネル以上のオーディオ信号を符号化する場合にもこの発明は適用可能である。
【0082】
さらに、前記各実施形態では、繰り返しループの処理をプログラムの実行により実現する場合を例にとって説明したが、ハードウエアで実現することも可能である。
【0083】
その他、オーディオ符号化器の構成、繰り返しループの処理手順とその内容、チャネル間の情報量の相違を検出する手段などについても、この発明の要旨を逸脱しない範囲で種々変形して実施できる。
【0084】
【発明の効果】
以上詳述したようにこの発明では、複数チャネルからなるオーディオ信号を、可変長符号化方式とビット保存技術を使用して符号化するオーディオ符号化器とその符号化プログラムにおいて、入力された上記オーディオ信号の各チャネル間における情報量の相違を検出し、その検出結果に基づいて、上記オーディオ信号の各フレームに割り当てる利用可能ビット数を補正する。そして、上記各チャネルの信号に対し、上記補正された利用可能ビット数の範囲内で量子化処理及び可変長符号化処理を量子化歪みが所定量以下になるまで繰り返し実行し、この量子化処理及び可変長符号化処理により得られた結果をオーディオビットストリームにフォーマット化するようにしている。
【0085】
したがってこの発明によれば、ステレオ信号のように複数チャネルを有するオーディオ信号を符号化する場合に、設定されたビットレートが低く利用可能な最大ビット数が十分でない場合であっても、複数のチャネルの各々にそれぞれ適当なビット数を割り当てることができ、これによりチャネル間における符号化品質のばらつきを低減することができるオーディオ符号化器とその符号化処理プログラムを提供することができる。
【図面の簡単な説明】
【図1】 この発明に係わるオーディオ符号化器の第1の実施形態を示す機能ブロック図。
【図2】 図1に示したオーディオ符号化器による繰り返しループの全体の処理手順と処理内容を示すフローチャート。
【図3】 図1に示したオーディオ符号化器による繰り返しループのサブルーチンの処理手順と処理内容を示すフローチャート。
【図4】 この発明に係わるオーディオ符号化器の第2の実施形態による量子化/可変長符号化/バッファ制御の繰り返しループの処理手順と処理内容を示すフローチャート。
【図5】 この発明に係わるオーディオ符号化器の第3の実施形態による量子化/可変長符号化/バッファ制御の繰り返しループのサブルーチンの処理手順と処理内容を示すフローチャート。
【図6】 この発明に係わるオーディオ符号化器の第4の実施形態による量子化/可変長符号化/バッファ制御の繰り返しループのサブルーチンの処理手順と処理内容を示すフローチャート。
【符号の説明】
1…ハイブリッドフィルタバンク、2…心理聴覚分析部、3…繰り返しループ、4…ビットストリーム形成部、11…サブバンド分析フィルタバンク、12…適応ブロック長MDCT、13…折り返し歪み削減バタフライ、21…高速フーリエ変換部(FFT)、22…非予測可能性測定部、23…SMR計算部、24…心理聴覚エントロピー評価部、31…非線形量子化部、32…スケールファクタ計算部、33…バッファ制御部、34…ハフマン符号化部、35…サイド情報符号化部。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an audio encoder provided in, for example, an MPEG (Moving Picture Coding Experts Group) audio recorder, and an encoding processing program used for encoding an audio signal in the encoder.
[0002]
[Prior art]
MPEG audio recorders use audio encoders that employ psychoacoustic analysis. This type of encoder first converts an input audio signal from a time domain signal to a frequency domain signal by a time / frequency conversion unit. At the same time, the psychoacoustic analysis unit calculates a signal-to-mask ratio (SMR) and psychoacoustic entropy for each scale factor band using fast Fourier transform (FFT) analysis or the like. Next, a quantization error masking level based on psychoacoustic perception is calculated from the SMR for each scale factor band by a repetition loop of quantization / variable length coding / buffer control. Then, the quantization process and the variable length coding process are repeatedly executed within the range of the usable number of bits, thereby obtaining an optimum scale factor so that the quantization error is less than the masking level.
[0003]
Further, since the variable length coding method is used as the coding method in the above repeating loop, the coding amount generated in each frame changes. For this reason, bit reservoir technology is used. That is, in a frame with a small amount of encoding, the surplus bits are stored in bit storage within a range not exceeding the maximum storage amount. The accumulated bits are used in a frame that requires many bits for encoding, such as the rising edge of an audio signal. Whether many bits are required is determined based on psychoacoustic entropy.
[0004]
The scale factor obtained by the repetition loop is input to the bit stream forming unit. The bit stream forming unit forms an audio bit stream of a predetermined format based on the code of the optimum scale factor obtained by the above loop, the variable length code of the quantized value at that time, and the side information. To do. Then, the formed audio bit stream is used for transmission or storage in a recording medium (for example, see Non-Patent Document 1).
[0005]
By the way, in the repetition loop of the quantization / variable length coding / buffer control, the following processing is performed. That is, first, the masking level of the quantization error based on psychoacoustics is calculated for each scale factor band from the SMR for each scale factor band described above. Subsequently, the number of bits to be added (add_bits) is obtained in consideration of the number of bits stored in the bit storage and psychoacoustic entropy. The calculated number of additional bits (add_bits) is added to the average number of bits per frame (mean_bits) based on the set bit rate, thereby determining the maximum number of available bits (max_bits). .
[0006]
Thus, when the maximum number of available bits (max_bits) is determined, a process for initializing the scale factor and the like is performed, and then the actual frequency samples are quantized based on the current scale factor. . The quantized value is subjected to variable length coding, whereby the required number of bits is obtained. If the required number of bits exceeds the maximum number of available bits, the quantization step size is changed to a large value until the required number of bits is less than or equal to the available number of bits. The number of bits is suppressed.
[0007]
Subsequently, the quantization value obtained as described above is compared with the original frequency sample, and the quantization distortion for each scale factor band is obtained. Then, the number of scale factor bands (over) at which the quantization distortion exceeds the masking level is obtained. As a result, if the quantization distortion is less than the masking level in all scale factor bands (over = 0), the loop factor is exited and the current scale factor is stored, and the number of bits used for encoding is calculated. Is done. If there is a difference (the number of unused bits) between the calculated number of used bits and the maximum number of available bits, the unused bits are used for the encoding process of the subsequent frames. Accumulated in bit save.
[0008]
On the other hand, if the quantization distortion in a certain scale factor band exceeds the masking level (over! = 0), it is determined whether or not all the scale factors can be corrected without exceeding the upper limit. And if it can be modified, those scale factors are increased. Thereafter, the above loop is repeatedly executed.
[0009]
When the set bit rate is high and the maximum number of available bits is sufficient, a combination of scale factors with a quantization distortion below an acceptable range is found. When the number of available bits is small, the loop is repeatedly executed and the scale factor reaches the upper limit value. In this case, it is determined that the scale factor cannot be corrected, and a suboptimal combination of scale factors is stored. Then, the number of bits used for encoding is calculated, and if there is a difference (number of unused bits) between the number of used bits and the maximum number of available bits, the unused bits will be used after the next frame. Are stored in the bit storage for use in the encoding process of the frame.
[0010]
When the input audio signal is a stereo signal, the above-described quantization / variable length encoding / buffer control loop process is repeatedly performed for each of the left and right channel signals.
[0011]
[Non-Patent Document 1]
Comprehensive multimedia book "MPEG" The Institute of Image Information and Television Engineers
Chapter 6 MPEG Audio Coding (especially P141 to P153)
[0012]
[Problems to be solved by the invention]
However, in such a conventional audio encoder, for each frame of the input audio signal, the maximum number of bits that can be used is sequentially calculated from the number of bits stored in the bit storage, and the calculated number of bits is calculated. Allocated for encoding processing of the frame. This processing is performed in such a manner that the processing result for one channel is succeeded to the processing for the other channel even when the input audio signal is a stereo signal.
[0013]
For this reason, when the set bit rate is low and the maximum usable number of bits is not sufficient, a larger number of bits are assigned to the channel to be encoded first among the left and right channels of the stereo signal. As a result, there is a problem that the encoding quality of a channel to be encoded later tends to deteriorate.
[0014]
The present invention has been made paying attention to the above circumstances, and its purpose is to encode an audio signal having a plurality of channels such as a stereo signal, even when the set bit rate is low. Therefore, it is possible to provide an audio encoder and an encoding processing program thereof that can allocate an appropriate number of bits to each of the channels, thereby reducing variations in encoding quality between channels.
[0015]
[Means for Solving the Problems]
In order to achieve the above object, the present invention provides an audio encoder that encodes an audio signal composed of a plurality of channels using a variable-length encoding scheme and a bit storage technique, and an encoding program for the audio encoder. A difference in the amount of information between each channel of the audio signal is detected, and the number of usable bits assigned to each frame of the audio signal is corrected based on the detection result. Then, the process of quantizing and variable-length coding the audio signal of each channel based on the scale factor is repeated until the quantization distortion falls below the masking level within the range of the corrected usable number of bits. The result obtained by the quantization process and the variable length coding process is formatted into an audio bitstream.
[0016]
Specifically, the power ratio between the channels of the audio signal is detected, and the number of usable bits determined by the bit assignment is corrected based on the detected power ratio.
[0017]
As another means, it is possible to detect a ratio between channels of psychoacoustic entropy obtained from an audio signal by psychoacoustic analysis, and to determine whether the bit allocation is determined based on the ratio of the detected psychoacoustic entropy. Correct the number of bits.
[0018]
Therefore, according to the present invention, prior to the repetition loop of quantization / variable length coding / buffer control, a difference in information amount between channels of an audio signal is detected, and is determined by bit allocation based on the detection result. The number of available bits is corrected. For this reason, even when the set bit rate is low and the maximum number of available bits is not sufficient, an appropriate number of bits is assigned to each of the plurality of channels. Therefore, not only the channel encoded earlier but also the channel encoded later can be encoded without degrading the quality, thereby reducing the encoding quality variation between channels. Can be reduced.
[0019]
In addition, in the above iterative loop, when the scale factor is repeatedly corrected to obtain an optimal combination of scale factors in which the quantization distortion is less than the masking level, the quantization distortion is less than the masking level in all scale factor bands. When an optimal combination of scale factors is not found, a sub-optimal combination of scale factors is obtained.
[0020]
The following means can be considered as means for obtaining a suboptimal combination of scale factors.
The first means holds the scale factor when the number of scale factor bands in which the quantization distortion exceeds the masking level is minimized. If no optimal scale factor combination with quantization distortion below the masking level is found in all scale factor bands, a sub-optimal scale factor combination is obtained based on the stored scale factors. Is.
[0021]
The second means is that the sum of values weighted according to the bandwidth of the scale factor band in which the quantization distortion exceeds the masking level, that is, the sum of the bandwidth of the scale factor band in which the quantization distortion exceeds the masking level is the minimum. The scale factor when it becomes is retained. If no optimal scale factor combination with quantization distortion below the masking level is found in all scale factor bands, a sub-optimal scale factor combination is obtained based on the stored scale factors. Is.
The third means is the sum of the difference between the quantization distortion and the masking level in the scale factor band in which the quantization distortion exceeds the masking level, that is, the error in the quantization distortion in the scale factor band in which the quantization distortion exceeds the masking level. The scale factor when the sum is minimum is retained. If an optimal combination of scale factors with quantization distortion below the masking level is not found in all scale factor bands, a sub-optimal combination of scale factors is selected based on the stored scale factors. It is what you want.
[0022]
As described above, by preparing a sub-optimal scale factor, even when the set bit rate is low and the optimum combination of scale factor bands with quantization distortion below the masking level is not found in all scale factor bands, Thus, it is possible to suppress the quality deterioration of the encoded audio signal.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
(First embodiment)
FIG. 1 is a functional block diagram showing a first embodiment of an audio encoder according to the present invention. The audio encoder includes a hybrid filter bank 1, a
[0024]
First, the
[0025]
For example, a PCM stereo audio signal AS that is 16-bit linearly quantized by a PCM (Pulse Code Modulation) encoding unit (not shown) is input to the
[0026]
For the model of psychoacoustic analysis, Sugiyama: “Highly efficient encoding of acoustic signals”, serial lecture “Basic Technology of Digital Television Broadcasting”, TV Magazine, 48, 4, pp.447-454 (Apr.1994) Is described in detail.
[0027]
The hybrid filter bank 1 includes a subband
[0028]
The input PCM stereo audio signal AS is converted from a time domain signal to a frequency domain signal by the subband
[0029]
The adaptive block
[0030]
The
[0031]
The scale
[0032]
The
[0033]
The above nonlinear quantization and variable length coding are accompanied by an iterative loop, and are repeated until the quantization error is below the masking level in all scale factor bands. When the quantization error is less than or equal to the masking level in all scale factor bands, the scale factor obtained at this time is used. In this iterative loop, the number of bits used for encoding is calculated, and the number of unused bits is stored in the bit storage of the
[0034]
The side
[0035]
The bit stream generation unit 4 multiplexes the header, the data encoded by the
[0036]
Next, the processing operation by the
[0037]
FIG. 2 is a flowchart showing the entire processing procedure and processing contents (main routine). In the
[Expression 1]
[0038]
In the
[0039]
That is, in
[0040]
When the loop processing for the left channel is completed, the channel number ch is incremented (ch ++) in step 2e, and the channel corresponding to the incremented channel number ch = 1, for example, the right channel, is quantized in
[0041]
By the way, the iterative loop processing of quantization / variable length coding / buffer control for the left and right channels is performed as follows. FIG. 3 is a flowchart showing the processing procedure and processing contents of the subroutine.
[0042]
That is, in
add_bits = add_bits * x_ratio [ch] (4)
[0043]
The corrected number of additional bits (add_bits) is added to the average number of bits per frame (mean_bits) based on the set bit rate, thereby determining the maximum number of usable bits (max_bits). . The calculation formula is shown below.
max_bits = mean_bits + add_bits (5)
[0044]
When the maximum number of bits (max_bits) that can be used is calculated in this way, initial settings such as a scale factor are performed in
[0045]
The obtained necessary number of bits is compared with the maximum number of available bits (max_bits). As a result of this comparison, if the required number of bits required for encoding exceeds the maximum number of available bits (max_bits), the required number of bits required for encoding is less than the maximum number of available bits (max_bits). The required number of bits is suppressed by increasing the quantization step size until.
[0046]
In
[0047]
As a result of this determination, if over is 0, that is, if the quantization distortion of all scale factor bands is less than or equal to the masking level, the process exits the loop repeatedly and proceeds to step 3g. In
[0048]
On the other hand, as a result of the comparison in
[0049]
In the iterative loop, when the set bit rate is high and the maximum number of usable bits is sufficient, a combination of scale factors in which the quantization distortion is within an allowable range is found. On the other hand, when the set bit rate is low and the number of usable bits is small, the above loop is repeated and the scale factor reaches the upper limit value. If it is determined in
[0050]
As described above, in the first embodiment, in the
[0051]
Therefore, the maximum number of available bits (max_bits) is controlled based on the power ratio (x_ratio [ch]) between the left and right channels of the input audio signal AS. For this reason, even if the set bit rate is low and the maximum number of bits (max_bits) that can be used is not sufficient, many bits are allocated to the channel that is encoded first, and bits that can be used for the channel that is encoded later The problem of shortage of numbers is solved. As a result, not only the channel encoded earlier but also the channel encoded later can be encoded without degrading the quality. Variations can be reduced.
[0052]
(Second Embodiment)
In the second embodiment of the present invention, in the iteration loop of quantization / variable length coding / buffer control, when the scale factor is iteratively corrected to obtain the optimum combination of scale factors so that the quantization distortion is below the masking level. If the optimal combination of scale factors with quantization distortion below the masking level is not found in all scale factor bands, the scale at which the number of scale factor bands with quantization distortion exceeding the masking level is minimized A sub-optimal combination of scale factors is obtained based on the factors.
[0053]
FIG. 4 is a flowchart showing a processing procedure and processing contents of a subroutine of an iterative loop of quantization / variable length encoding / buffer control by the audio encoder according to the second embodiment. In the figure, the same parts as those in FIG. The configuration of the audio encoder is also the same as that shown in FIG.
[0054]
When the scale factor band number (over) in which the quantization distortion exceeds the masking level is calculated in
[0055]
Subsequently, in
[0056]
On the other hand, as a result of the comparison in
[0057]
When the set bit rate is high and the maximum number of usable bits is sufficient in the above-described repetitive loop, a combination of scale factors whose quantization distortion is within an allowable range is found. On the other hand, when the set bit rate is low and the number of usable bits is small, the above loop is repeated and the scale factor reaches the upper limit value. If it is determined in
[0058]
As described above, in the second embodiment, by executing Step 3n, Step 3o,
[0059]
For this reason, even if a combination of scale factors that makes quantization distortion below the masking level is not found in all scale factor bands due to a low set bit rate and insufficient maximum number of available bits, Encoding is performed using an optimal scale factor.
[0060]
Therefore, according to the second embodiment, the audio coding of the input audio signal AS is coupled with the cancellation of the deviation of the maximum number of available bits (max_bits) between the left and right channels described in the first embodiment. Quality degradation can be avoided more effectively. In the second embodiment, there is an advantage that a suboptimal combination of scale factors can be obtained by a relatively simple process of simply comparing the number of scale factor bands.
[0061]
(Third embodiment)
The third embodiment of the present invention pays attention to the fact that the scale factor bandwidth is non-uniform in order to reduce the band that does not satisfy the masking level, that is, the band is set to become wider as the low band becomes narrower and wider. In an iterative loop of quantization / variable length coding / buffer control, when the scale factor is iteratively corrected to find an optimal combination of scale factors that results in a quantization distortion that is less than or equal to the masking level, the quantization distortion becomes the masking level. The scale factor when the sum of the bandwidths of the scale factor bands exceeding the minimum is kept. If no optimal scale factor combination with quantization distortion below the masking level is found in all scale factor bands, a sub-optimal scale factor combination is obtained based on the stored scale factors. It is what I did.
[0062]
FIG. 5 is a flowchart showing the processing procedure and processing contents of an iterative loop of quantization / variable length encoding / buffer control by the audio encoder according to the third embodiment. In the figure, the same parts as those in FIG. The configuration of the audio encoder is also the same as that shown in FIG.
[0063]
When the scale factor band number (over) in which the quantization distortion exceeds the masking level is calculated in
[0064]
Subsequently, in
[0065]
On the other hand, as a result of the comparison in
[0066]
When the set bit rate is high and the maximum number of usable bits is sufficient in the above-described repetitive loop, a combination of scale factors whose quantization distortion is within an allowable range is found. On the other hand, when the set bit rate is low and the number of usable bits is small, the above loop is repeated and the scale factor reaches the upper limit value. When it is determined in
[0067]
As described above, in the third embodiment, by executing
[0068]
For this reason, as in the second embodiment, the scale that makes the quantization distortion equal to or lower than the masking level in all scale factor bands due to the low set bit rate and the insufficient maximum number of bits available. Even if a combination of factors is not found, encoding is performed using a sub-optimal scale factor.
[0069]
Therefore, also in the third embodiment, coupled with the cancellation of the deviation of the maximum usable number of bits (max_bits) between the left and right channels described in the first embodiment, the audio encoding of the input audio signal AS is performed. Quality degradation can be effectively avoided. In addition, it is possible to perform quantization and encoding processing that places importance on a narrow scale factor band, that is, a low frequency component of an audio signal.
[0070]
(Fourth embodiment)
According to the fourth embodiment of the present invention, in an iterative loop of quantization / variable length coding / buffer control, the scale factor is repeatedly corrected to obtain an optimal combination of scale factors with which the quantization distortion is below the masking level. In addition, the scale factor at the time when the sum of the quantization distortion errors in the scale factor band in which the quantization distortion exceeds the masking level is minimum is held. If an optimal combination of scale factors with quantization distortion below the masking level is not found in all scale factor bands, a sub-optimal combination of scale factors is selected based on the stored scale factors. It is what you want.
[0071]
FIG. 6 is a flowchart showing the processing procedure and processing contents of an iterative loop of quantization / variable length encoding / buffer control by the audio encoder according to the fourth embodiment. In the figure, the same parts as those in FIG. The configuration of the audio encoder is also the same as that shown in FIG.
[0072]
When the scale factor band number (over) in which the quantization distortion exceeds the masking level is calculated in
[0073]
Subsequently, in
[0074]
On the other hand, as a result of the comparison in
[0075]
When the set bit rate is high and the maximum number of usable bits is sufficient in the above-described repetitive loop, a combination of scale factors whose quantization distortion is within an allowable range is found. On the other hand, when the set bit rate is low and the number of usable bits is small, the above loop is repeated and the scale factor reaches the upper limit value. If it is determined in
[0076]
As described above, in the fourth embodiment, by executing
[0077]
For this reason, as in the second and third embodiments, because the set bit rate is low and the maximum number of available bits is not sufficient, the quantization distortion is less than the masking level in all scale factor bands. Even when a combination of scale factors to be found is not found, encoding is performed using a sub-optimal scale factor.
[0078]
Therefore, also in the fourth embodiment, in combination with the cancellation of the deviation of the maximum number of usable bits (max_bits) between the left and right channels described in the first embodiment, the audio encoding of the input audio signal AS is performed. Quality degradation can be effectively avoided. Further, the quantization distortion is optimized, and the quantization and encoding processing is performed so that the quantization distortion is minimized.
[0079]
(Other embodiments)
In the first embodiment, the power ratio between the left and right channels is obtained, and the maximum number of bits that can be used for each frame is controlled based on this power ratio. However, the present invention is not limited to this, and the ratio of psychoacoustic entropy between the left and right channels is obtained, and the maximum number of bits that can be used for each frame is controlled based on the obtained ratio of psychoacoustic entropy. Good. At this time, the ratio of the psychoacoustic auditory entropy can be obtained by the following equation.
sum_pe = x_pe [0] + x_pe [1] (6)
x_ratio [ch] = x_pe [ch] / sum_pe ch = 0, 1 (7)
[0080]
Note that the means for detecting the difference in the amount of information between channels may be to obtain a difference in power or psychoacoustic entropy in addition to the ratio of power ratio or psychoacoustic entropy. May be detected.
[0081]
Further, although cases have been described with the above embodiments as examples where audio signals consisting of two channels on the left and right are encoded, the present invention is also applicable when encoding audio signals of three or more channels.
[0082]
Further, although cases have been described with the above embodiments as an example where the processing of the repetitive loop is realized by execution of a program, it can also be realized by hardware.
[0083]
In addition, the configuration of the audio encoder, the processing procedure and contents of the iterative loop, the means for detecting the difference in the amount of information between channels, and the like can be variously modified without departing from the scope of the present invention.
[0084]
【The invention's effect】
As described above in detail, according to the present invention, an audio encoder that encodes an audio signal composed of a plurality of channels using a variable-length encoding scheme and a bit storage technique and the audio program input thereto are used. A difference in the amount of information between each channel of the signal is detected, and the number of usable bits allocated to each frame of the audio signal is corrected based on the detection result. Then, the quantization process and the variable length coding process are repeatedly performed on the signal of each channel within the range of the corrected usable number of bits until the quantization distortion becomes a predetermined amount or less. The result obtained by the variable length coding process is formatted into an audio bitstream.
[0085]
Therefore, according to the present invention, when an audio signal having a plurality of channels, such as a stereo signal, is encoded, even if the set bit rate is low and the maximum number of usable bits is not sufficient, a plurality of channels Therefore, it is possible to provide an audio encoder and an encoding processing program that can reduce the variation in encoding quality between channels.
[Brief description of the drawings]
FIG. 1 is a functional block diagram showing a first embodiment of an audio encoder according to the present invention.
FIG. 2 is a flowchart showing the entire processing procedure and processing contents of an iterative loop performed by the audio encoder shown in FIG. 1;
FIG. 3 is a flowchart showing a processing procedure and processing contents of a repetitive loop subroutine by the audio encoder shown in FIG. 1;
FIG. 4 is a flowchart showing a processing procedure and processing contents of a repetition loop of quantization / variable length coding / buffer control according to a second embodiment of the audio encoder according to the present invention;
FIG. 5 is a flowchart showing a processing procedure and processing contents of a subroutine of a repetition loop of quantization / variable length coding / buffer control according to a third embodiment of the audio encoder according to the present invention;
FIG. 6 is a flowchart showing a processing procedure and processing contents of a subroutine of a repetition loop of quantization / variable length encoding / buffer control according to a fourth embodiment of the audio encoder according to the present invention;
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Hybrid filter bank, 2 ... Psychoacoustic analysis part, 3 ... Repetitive loop, 4 ... Bit stream formation part, 11 ... Subband analysis filter bank, 12 ... Adaptive block length MDCT, 13 ... Bending distortion reduction butterfly, 21 ... High speed Fourier transform unit (FFT), 22 ... Non-predictability measurement unit, 23 ... SMR calculation unit, 24 ... Psychological auditory entropy evaluation unit, 31 ... Non-linear quantization unit, 32 ... Scale factor calculation unit, 33 ... Buffer control unit, 34: Huffman encoding unit, 35: Side information encoding unit.
Claims (10)
前記ビット保存に蓄えられているビット数と、入力された前記オーディオ信号に対する心理聴覚分析の結果に基づき付加ビット数を求め、この求められた付加ビット数を、設定されたビットレートに基づく1フレームあたりの平均ビット数に加算することにより、前記オーディオ信号のフレームごとに符号化に利用可能なビット数を決定するビット割当て手段と、
前記入力されたオーディオ信号のチャネル間におけるパワー比を検出する検出手段と、
前記検出手段により検出されたチャネル間のパワー比を、前記ビット割当て手段により決定される利用可能ビット数のうちの前記付加ビット数に乗算することにより、当該付加ビット数を補正する補正手段と、
前記入力されたオーディオ信号をスケールファクタに基づいて量子化及び可変長符号化する処理を、前記補正された利用可能ビット数の範囲内で、量子化歪みがマスキングレベル以下になるまで繰り返し実行する繰り返しループ手段と、
前記量子化処理及び可変長符号化処理の繰り返し実行により得られた結果を含むオーディオビットストリームを形成する手段とを具備したことを特徴とするオーディオ符号化器。In an audio encoder that encodes an audio signal composed of a plurality of channels using bit storage by a variable-length encoding method,
The number of additional bits is obtained based on the number of bits stored in the bit storage and the result of psychoacoustic analysis on the input audio signal, and the obtained additional number of bits is calculated as one frame based on a set bit rate. Bit allocation means for determining the number of bits available for encoding for each frame of the audio signal by adding to the average number of bits per frame;
Detecting means for detecting a power ratio between channels of the input audio signal;
Correction means for correcting the number of additional bits by multiplying the power ratio between channels detected by the detection means by the number of additional bits of the number of available bits determined by the bit allocation means;
Iteratively executing the process of quantizing and variable-length coding the input audio signal based on a scale factor, within a range of the corrected usable number of bits, until a quantization distortion becomes a masking level or less. Loop means;
An audio encoder comprising: means for forming an audio bitstream including a result obtained by repeatedly executing the quantization process and the variable length encoding process.
前記ビット保存に蓄えられているビット数と、入力された前記オーディオ信号に対する心理聴覚分析の結果に基づき、付加ビット数を求め、この求められた付加ビット数を、設定されたビットレートに基づく1フレームあたりの平均ビット数に加算することにより、前記オーディオ信号のフレームごとに符号化に利用可能なビット数を決定するビット割当て手段と、
前記心理聴覚分析の結果に基づいて、入力された前記オーディオ信号の各チャネル間の心理聴覚エントロピーの比を検出する検出手段と、
前記検出手段により検出されたチャネル間の心理聴覚エントロピーの比を、前記ビット割当て手段により決定される利用可能ビット数のうち前記付加ビット数に乗算することにより当該付加ビット数を補正する補正手段と、
入力された前記オーディオ信号をスケールファクタに基づいて量子化及び可変長符号化する処理を、前記補正された利用可能ビット数の範囲内で、量子化歪みがマスキングレベル以下になるまで繰り返し実行する繰り返しループ手段と、
前記量子化処理及び可変長符号化処理の繰り返し実行により得られた結果を含むオーディオビットストリームを形成する手段とを具備したことを特徴とするオーディオ符号化器。In an audio encoder that encodes an audio signal composed of a plurality of channels using bit storage by a variable-length encoding method,
Based on the number of bits stored in the bit storage and the result of psychoacoustic analysis on the input audio signal, the number of additional bits is obtained, and the obtained number of additional bits is calculated based on a set bit rate. Bit allocation means for determining the number of bits available for encoding for each frame of the audio signal by adding to the average number of bits per frame;
Detecting means for detecting a ratio of psychoacoustic entropy between each channel of the input audio signal based on a result of the psychoacoustic analysis;
Correction means for correcting the number of additional bits by multiplying the number of additional bits among the number of available bits determined by the bit allocation means by a ratio of psychoacoustic entropy between channels detected by the detection means; ,
Iteratively repeats the process of quantizing and variable-length coding the input audio signal based on a scale factor, within a range of the corrected usable number of bits, until quantization distortion falls below a masking level. Loop means;
An audio encoder comprising: means for forming an audio bitstream including a result obtained by repeatedly executing the quantization process and the variable length encoding process.
前記処理手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンド数が最小となるときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項1又は2記載のオーディオ符号化器。The iterative loop means comprises processing means for repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than the masking level,
The processing means retains the scale factor when the number of scale factor bands at which the quantization distortion exceeds the masking level is minimum, and the optimum combination of scale factors that causes the quantization distortion to be below the masking level in all scale factor bands 3. The audio encoder according to claim 1, wherein a sub-optimal combination of scale factors is obtained based on the held scale factor when no is found.
前記処理手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンドのバンド幅に応じて重み付けされた値の合計が最小となるときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項1又は2記載のオーディオ符号化器。The iterative loop means comprises processing means for repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than the masking level,
The processing means holds the scale factor when the sum of values weighted according to the bandwidth of the scale factor band in which the quantization distortion exceeds the masking level is minimum, and the quantization distortion is present in all scale factor bands. 3. The suboptimal scale factor combination is obtained based on the held scale factor when an optimal combination of scale factors that falls below the masking level is not found. Audio encoder.
前記処理手段は、量子化歪みがマスキングレベルを超えるスケールファクタバンドの、量子化歪みとマスキングレベルとの差の合計が最小のときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項1又は2記載のオーディオ符号化器。The iterative loop means comprises processing means for repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than the masking level,
The processing means holds the scale factor when the sum of the difference between the quantization distortion and the masking level of the scale factor band in which the quantization distortion exceeds the masking level is minimum, and the quantization distortion is present in all the scale factor bands. 3. The suboptimal scale factor combination is obtained based on the held scale factor when an optimal combination of scale factors that falls below the masking level is not found. Audio encoder.
前記入力されたオーディオ信号のチャネル間におけるパワー比を検出する処理ステップと、
前記ビット保存に蓄えられているビット数と、入力された前記オーディオ信号に対する心理聴覚分析の結果に基づき、付加ビット数を求め、この求められた付加ビット数を、設定されたビットレートに基づく1フレームあたりの平均ビット数に加算することにより、前記オーディオ信号のフレームごとに符号化に利用可能なビット数を決定する処理ステップと、
前記検出されたチャネル間のパワー比を、前記決定される利用可能ビット数のうちの前記付加ビット数に乗算することにより、当該付加ビット数を補正する処理ステップと、
前記入力されたオーディオ信号をスケールファクタに基づいて量子化及び可変長符号化する処理を、前記補正された利用可能ビット数の範囲内で、量子化歪みがマスキングレベル以下になるまで繰り返し実行する処理ステップと、
前記量子化処理及び可変長符号化処理の繰り返し実行により得られた結果を含むオーディオビットストリームを形成する処理ステップと
を、前記コンピュータに実行させることを特徴とするオーディオ信号の符号化処理プログラム。In an encoding processing program used in an audio encoder that uses a computer and encodes an audio signal composed of a plurality of channels using bit storage by a variable-length encoding method,
A processing step of detecting a power ratio between channels of the input audio signal;
Based on the number of bits stored in the bit storage and the result of psychoacoustic analysis on the input audio signal, the number of additional bits is obtained, and the obtained number of additional bits is calculated based on a set bit rate. Processing steps for determining the number of bits available for encoding for each frame of the audio signal by adding to the average number of bits per frame;
By multiplying the power ratio between the detected channels, the number of additional bits of the number of available bits to the determined, and the process step of correcting the number of the additional bits,
Processing for repeatedly performing quantization and variable length coding on the input audio signal based on a scale factor, within a range of the corrected usable number of bits, until quantization distortion is equal to or lower than a masking level. Steps,
An audio signal encoding processing program that causes the computer to execute a processing step of forming an audio bitstream including a result obtained by repeatedly executing the quantization processing and the variable length encoding processing.
心理聴覚分析の結果に基づいて、入力された前記オーディオ信号の各チャネル間の心理聴覚エントロピーの比を検出する処理ステップと、
前記ビット保存に蓄えられているビット数と、入力された前記オーディオ信号に対する心理聴覚分析の結果に基づき、付加ビット数を求め、この求められた付加ビット数を、設定されたビットレートに基づく1フレームあたりの平均ビット数に加算することにより、前記オーディオ信号のフレームごとに符号化に利用可能なビット数を決定する処理ステップと、
前記検出されたチャネル間の心理聴覚エントロピーの比を、前記決定される利用可能ビット数のうちの前記付加ビット数に乗算することにより当該付加ビット数を補正する処理ステップと、
前記入力されたオーディオ信号をスケールファクタに基づいて量子化及び可変長符号化する処理を、前記補正された利用可能ビット数の範囲内で、量子化歪みがマスキングレベル以下になるまで繰り返し実行する処理ステップと、
前記量子化処理及び可変長符号化処理の繰り返し実行により得られた結果を含むオーディオビットストリームを形成する処理ステップと
を、前記コンピュータに実行させることを特徴とするオーディオ信号の符号化処理プログラム。In an encoding processing program used in an audio encoder that uses a computer and encodes an audio signal composed of a plurality of channels using bit storage by a variable-length encoding method,
A processing step of detecting a ratio of psychoacoustic entropy between each channel of the input audio signal based on a result of psychoacoustic analysis;
Based on the number of bits stored in the bit storage and the result of psychoacoustic analysis on the input audio signal, the number of additional bits is obtained, and the obtained number of additional bits is calculated based on a set bit rate. Processing steps for determining the number of bits available for encoding for each frame of the audio signal by adding to the average number of bits per frame;
A processing step of correcting the number of the additional bits by multiplying the ratio of the perceptual entropy between the detected channels, the number of additional bits of the available number of bits the determined,
Processing for repeatedly performing quantization and variable length coding on the input audio signal based on a scale factor, within a range of the corrected usable number of bits, until quantization distortion is equal to or lower than a masking level. Steps,
An audio signal encoding processing program that causes the computer to execute a processing step of forming an audio bitstream including a result obtained by repeatedly executing the quantization processing and the variable length encoding processing.
前記最適なスケールファクタの組み合わせを求めるステップは、量子化歪みがマスキングレベルを超えるスケールファクタバンド数が最小となるときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項6又は7記載のオーディオ信号の符号化処理プログラム。The repetitive processing step includes the step of repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than a masking level,
The step of obtaining the optimum combination of scale factors retains the scale factor when the number of scale factor bands in which the quantization distortion exceeds the masking level is minimum, and the quantization distortion is less than or equal to the masking level in all scale factor bands. 8. The sign of an audio signal according to claim 6 or 7, wherein a sub-optimal scale factor combination is obtained based on the held scale factor when no optimal scale factor combination is found. Program.
前記最適なスケールファクタの組み合わせを求めるステップは、量子化歪みがマスキングレベルを超えるスケールファクタバンドのバンド幅に応じて重み付けされた値の合計が最小となるときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項6又は7記載のオーディオ信号の符号化処理プログラム。The repetitive processing step includes the step of repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than a masking level,
The step of obtaining the optimum combination of scale factors holds the scale factors when the sum of values weighted according to the bandwidth of the scale factor band in which the quantization distortion exceeds the masking level is minimized, When an optimum combination of scale factors with quantization distortion below the masking level is not found in the factor band, a sub-optimal combination of scale factors is obtained based on the stored scale factors. 8. The audio signal encoding processing program according to claim 6 or 7.
前記最適なスケールファクタの組み合わせを求めるステップは、量子化歪みがマスキングレベルを超えるスケールファクタバンドの、量子化歪みとマスキングレベルとの差の合計が最小のときのスケールファクタを保持し、すべてのスケールファクタバンドにおいて量子化歪みがマスキングレベル以下になる最適なスケールファクタの組み合わせが見つからなかった場合には、前記保持されたスケールファクタをもとに準最適なスケールファクタの組み合わせを求めることを特徴とする請求項6又は7記載のオーディオ信号の符号化処理プログラム。The repetitive processing step includes the step of repeatedly correcting the scale factor to obtain an optimal combination of scale factors that results in a quantization distortion equal to or less than a masking level,
The step of obtaining the optimum combination of scale factors includes the scale factors when the sum of the differences between the quantization distortion and the masking level of the scale factor band in which the quantization distortion exceeds the masking level is minimum, and for all the scales. When an optimum combination of scale factors with quantization distortion below the masking level is not found in the factor band, a sub-optimal combination of scale factors is obtained based on the stored scale factors. 8. The audio signal encoding processing program according to claim 6 or 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003033915A JP3725876B2 (en) | 2002-03-27 | 2003-02-12 | Audio encoder and its encoding processing program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002089947 | 2002-03-27 | ||
JP2003033915A JP3725876B2 (en) | 2002-03-27 | 2003-02-12 | Audio encoder and its encoding processing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004004554A JP2004004554A (en) | 2004-01-08 |
JP3725876B2 true JP3725876B2 (en) | 2005-12-14 |
Family
ID=30446173
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003033915A Expired - Fee Related JP3725876B2 (en) | 2002-03-27 | 2003-02-12 | Audio encoder and its encoding processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3725876B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7516064B2 (en) * | 2004-02-19 | 2009-04-07 | Dolby Laboratories Licensing Corporation | Adaptive hybrid transform for signal analysis and synthesis |
-
2003
- 2003-02-12 JP JP2003033915A patent/JP3725876B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004004554A (en) | 2004-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8612219B2 (en) | SBR encoder with high frequency parameter bit estimating and limiting | |
JP4212591B2 (en) | Audio encoding device | |
JP5539203B2 (en) | Improved transform coding of speech and audio signals | |
US7283967B2 (en) | Encoding device decoding device | |
US8019601B2 (en) | Audio coding device with two-stage quantization mechanism | |
US8032371B2 (en) | Determining scale factor values in encoding audio data with AAC | |
JP4142292B2 (en) | Method for improving encoding efficiency of audio signal | |
US20070078646A1 (en) | Method and apparatus to encode/decode audio signal | |
JP5175028B2 (en) | Digital signal encoding method and apparatus, and decoding method and apparatus | |
JP2011013560A (en) | Audio encoding device, method of the same, computer program for audio encoding, and video transmission device | |
TW201324500A (en) | Lossless-encoding method, audio encoding method, lossless-decoding method and audio decoding method | |
US9131290B2 (en) | Audio coding device, audio coding method, and computer-readable recording medium storing audio coding computer program | |
KR20160055266A (en) | Encoding method and apparatus | |
US20100239027A1 (en) | Method of and apparatus for encoding/decoding digital signal using linear quantization by sections | |
JP2004029761A (en) | Digital encoding method and architecture for transmitting and packing audio signals | |
JP5609591B2 (en) | Audio encoding apparatus, audio encoding method, and audio encoding computer program | |
WO2006054583A1 (en) | Audio signal encoding apparatus and method | |
US20010050959A1 (en) | Encoder and communication device | |
JP4734859B2 (en) | Signal encoding apparatus and method, and signal decoding apparatus and method | |
JP3725876B2 (en) | Audio encoder and its encoding processing program | |
JP2000151413A (en) | Method for allocating adaptive dynamic variable bit in audio encoding | |
JP4062971B2 (en) | Audio signal encoding method | |
JP3616307B2 (en) | Voice / musical sound signal encoding method and recording medium storing program for executing the method | |
JP4024185B2 (en) | Digital data encoding device | |
JP3454394B2 (en) | Quasi-lossless audio encoding device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20041221 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050215 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050418 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050621 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050819 |
|
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: 20050920 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050922 |
|
LAPS | Cancellation because of no payment of annual fees |