JP3731993B2 - Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus - Google Patents

Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus Download PDF

Info

Publication number
JP3731993B2
JP3731993B2 JP31706097A JP31706097A JP3731993B2 JP 3731993 B2 JP3731993 B2 JP 3731993B2 JP 31706097 A JP31706097 A JP 31706097A JP 31706097 A JP31706097 A JP 31706097A JP 3731993 B2 JP3731993 B2 JP 3731993B2
Authority
JP
Japan
Prior art keywords
quantization
data
time
encoding
multiplier
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
JP31706097A
Other languages
Japanese (ja)
Other versions
JPH11150480A (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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP31706097A priority Critical patent/JP3731993B2/en
Publication of JPH11150480A publication Critical patent/JPH11150480A/en
Application granted granted Critical
Publication of JP3731993B2 publication Critical patent/JP3731993B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、たとえば予測符号化技術を用いて音声データなどのディジタルデータを圧縮伸長する適応ビットADPCM符号化方法および適応ビットADPCM符号化装置に関するものである。
【0002】
【従来技術】
ディジタル音声信号の圧縮方式としては、ディジタル音声が近接するサンプル間で高い相関を持つという性質を利用した方式が多く提案されている。この性質を利用し、かつ比較的簡単な処理で音声圧縮を行う従来技術としては、予測符号化技術を挙げることができる。予測符号化技術の応用としては、例えば、DPCM(Differential Pulse Code Modulation)方式やADPCM(Adaptive Differential Pulse Code Modulation)方式等がよく知られており、これらの方式では、実際の音声と予測値の差分値を量子化することで音声圧縮を図っている。
【0003】
音声信号は時間によってレベルが変動するので、量子化するときに一定の量子化単位で量子化するよりも、音声レベルの大小に応じてステップの大きさを変えながら量子化することが望ましい。もし、一定のステップサイズで量子化するならば大きな音声信号に対してはビット数が不足するために過負荷により音質に歪みを生じることになる。
【0004】
一方、小さな信号では粗い量子化になるために耳障りな雑音(量子化雑音)となって知覚される。人間の聴覚は大きな音に対する量子化雑音には鈍感であるが、小さな音にしては敏感になるとい性質がある。従って、大きな信号は大きなステップサイズで量子化し、小さな信号にしては細かく量子化すれば良いことがわかり、このような適応量子化方法を取り入れたのがADPCM方式である。
【0005】
図2に一般的なADPCM方式の符号復号化処理のための機能ブロック図を示す。ADPCMは音声のように相関の強い信号については隣接サンプルの差を取る方式の方が、サンプル値をそのまま符号化する方式(PCM)より圧縮が期待されるため、適応フィルタによる予測値と入力値との差分を、そのレベルに応じて適応的に変化する量子化ステップ幅で量子化して伝送する方式である。
【0006】
このシステムはディジタル音声入力を圧縮するエンコード側Aと、圧縮された信号を基に戻すデコード側Bからなり、両者間は伝送路108によって接続されている。
【0007】
まず、エンコード側Aであるが、nサンプル目の入力値X(n)に対する予測値XP(n)との差分D(n)を加算器101で算出する。すなわち
D(n)=X(n)−XP(n)を求める。
【0008】
予測差分D(n)は量子化部分104で量子化が施され、符号データL(n)として伝送路108に送信される。ここでは伝送路としたが、音声蓄積再生装置に組み込む場合はRAMなどの記憶媒体でも構わない。符号データL(n)はステップ幅決定部102で次サンプルの量子化ステップ幅決定に用いられる。量子化ステップ幅決定についてはまた後述する。
【0009】
符号データL(n)は復号化部105で逆量子化が施され量子化後の予測差分DQ(n)が得られる。量子化後の予測差分DQ(n)は先に得られている予測値XP(n)と加算器106で加算され量子化後のサンプルデータ系列が得られる。すなわち、
XQ(n)=XP(n)+DQ(n)を求める。
【0010】
量子化後のサンプルデータ系列XQ(n)は予測フィルタ107の入力に用いられ、次サンプルの予測値XP(n+1)が算出される。なお、予測フィルタ107の構成は任意であり、通常、数次のIIRフィルタで構成される。
【0011】
次に、量子化について図3の従来のADPCM符号復号化方式による量子化方法の機能ブロックを用いて詳細に説明する。第nサンプル目の予測差分D(n)は、量子化部205で量子化され量子化データQ(n)が得られる。量子化データQ(n)は、符号化部206で符号化され符号データL(n)が得られる。量子化は、レジスタ204に格納されている量子化ステップ幅Δ(n)を用いて行われ、これらの関係を数式で表すと次式のようになる。
【0012】
1)量子化サイズ8値(3ビット符号化)の場合
Q(n)={L(n)+1/4}×Δ(n)
L(n)=[D(n)/{Δ(n)/2}]
2)量子化サイズ16値(4ビット符号化)の場合
Q(n)={L(n)+1/8}×Δ(n)
L(n)=[D(n)/{Δ(n)/4}]
3)量子化サイズ32値(5ビット符号化)の場合
Q(n)={L(n)+1/16}×Δ(n)
L(n)=[D(n)/{Δ(n)/8}]
ただし、Δ(n)は量子化ステップ幅を表し、[*]は中の値を超えない最大整数を表す。また、量子化サイズ8値、16値、32値では符号化データL(n)はそれぞれ−4〜3、−8〜7、−16〜15の範囲の整数に制限される。例えば、量子化サイズ16値の場合について、予測差分D(n)と量子化出力Q(n)の相関を図4に示す。図4における階段の数は16あり、−15Δ(n)/8〜−Δ(n)/8、Δ(n)/8〜15Δ(n)/8の16種類の量子化出力が得られることが分かる。例えば、
0≦D(n)<2Δ(n)/8の時、Q(n)=Δ(n)/8
2Δ(n)/8≦D(n)<4Δ(n)/8の時、Q(n)=3Δ(n)/8
といった具合である。
【0013】
符号L(n)は伝送されるとともに、次サンプルの量子化ステップ幅Δ(n+1)を更新するのに用いられる。図4からも分かるように量子化値は、量子化ステップ幅Δ(n)の1/8〜15/8の範囲に限られている。従って、予測差分D(n)の絶対値が増加する方向にあるときは量子化ステップ幅Δ(n)もそれに応じて増加させ、予測差分D(n)の絶対値が減少する方向にあるときは量子化ステップ幅Δ(n)もそれに応じて減少させてやるのが望ましい。
【0014】
そこで量子化値によって、現サンプルの量子化ステップ幅Δ(n)にある数を乗じて更新するという方法を採る。すなわち、符号L(n)はROM読み出し部202のポインタとして用いられ乗数テーブル201から乗数データM(L(n))が読み出される。量子化出力Q(n)と符号データL(n)、符号L(n)と乗数データM(L(n))はそれぞれ1対1に対応しており、それぞれの関係は次の表1〜3に示されるような値となる。
【0015】
【表1】

Figure 0003731993
【表2】
Figure 0003731993
【表3】
Figure 0003731993
この表1は量子化サイズ8値の場合を示し、表2は量子化サイズ16値の場合を示し、表3は量子化サイズ32値の場合を示している。
【0016】
予測差分D(n)の絶対値が量子化ステップ幅Δ(n)の絶対値を超える場合、次サンプルの量子化ステップ幅Δ(n+1)の絶対値を増大させる方向に働き、そうでない場合には縮小させる方向に働くように設定されている。表1〜3に示す乗数データM(L(n))は音声の統計的な性質に基づいて経験的に定められたものであり、あくまで設定例である。この表1〜3の数値は「N.S.Jayant,"Adaptive Quantization With a One-Word Memory", in The Bell System Technical Journal Vol.52, No.7, Sep.1973, pp.1119-1144」に基づいている。乗数テーブル201から読み出された乗数データM(L(n))は、レジスタ204に格納されている現サンプルの量子化ステップ幅Δ(n)と乗算器203で乗算され、ふたたびレジスタ204に格納される。この値は次サンプルの量子化ステップ幅Δ(n+1)となる。以上の演算が各サンプル毎に逐次ディジタル的に行われる。
【0017】
一方デコード側Bであるが、伝送路108を介してエンコード側Aより送信された符号データL(n)は復号化部110で復号化が施される。この時の量子化ステップ幅は前サンプルの符号データL(n−1)で求められたものを用いる。復号処理が終了すると、現サンプルの符号データL(n)を用いて次サンプルの量子化ステップ幅が決定される。決定方法およびその構成はエンコード側と全く同一である。復号された差分データDQ(n)は予測フィルタ112の出力XP(n)と加算器111で加算され、復号サンプルデータ系列XQ(n)として出力される。言うまでもなく、予測フィルタ112は符号化用予測フィルタ107と同一の構成である。従って、入力サンプルデータX(n)と復号化サンプルデータXQ(n)との差が量子化誤差ε(n)となる。すなわちε(n)=X(n)−XQ(n)である。
【0018】
量子化誤差は予測差分D(n)の量子化に伴う誤差であり、これは図4より明らかなように、量子化サイズをmとすると高々量子化ステップ幅の2/ である。(ただし、符号化データの絶対値が最大の場合は除く)すなわち、量子化誤差は、3ビット符号化の場合Δ(n)/4、4ビット符号化の場合Δ(n)/8、5ビット符号化の場合Δ(n)/16となる。
【0019】
より忠実に波形を再生するためには、量子化誤差を少なくすることが必要である。従って、高品質な符号化を行う場合は、3ビット符号化よりも4ビット符号化、4ビット符号化よりも5ビット符号化の方がよい。
【0020】
しかしながら、上記の従来技術は次に述べる問題点があった。すなわち、入力サンプル16ビットに対し16値符号化を行うと、1サンプルあたり4ビットの符号が生成されるわけであるから圧縮率は1/4となり効率はあまり良くない。しかも、CD(コンパクト・ディスク)並みの高品質な楽音(サンプリング周波数が40KHzを超えるようなサンプル)を符号化すると、高周波を含む部分でどうしても量子化ノイズが耳についてしまうといった問題があった。
【0021】
上記問題の発生原因は、高周波成分を含むために隣接サンプル値の変動が大きく、結果として、量子化ステップ幅が大きくなるためである。(前述したように量子化誤差は4ビット符号化の場合Δ(n)/8である。)そこで、量子化ノイズ低減のために量子化ステップ幅Δ(n)に上限を設けることも提案されたが、そうすると逆に予測誤差が大きい場合にはオーバーフローした情報の喪失を招き、過負荷ノイズ等の原因となっていた。また、過負荷ノイズを防ぐために、予測差分の量子化サイズ(量子化ビット数)を増加させると、伝送ビットレートが増加して圧縮率の低下を招くといった不都合があった。
【0022】
これを解決するために従来では、例えば特開昭64−39840号公報において開示されているように、量子化ステップ幅Δ(n)が所定閾値を超える場合に、符号多重化して量子化サイズを増やして量子化誤差の増加を抑制する方法が提案されている。
【0023】
【発明が解決しようとする課題】
しかしながら、この方法によれば、予測差分が所定閾値を超えた場合に、量子化ステップ幅Δ(n)が固定されてしまい、ADPCM符号化方式の本来の特徴である「予測誤差に適応して量子化を行う」ことによる量子化誤差低減効果が期待通りに得られなかった。すなわち予測誤差がある値以上になると量子化誤差が急増し、音質劣化を招くといった問題があった。
【0024】
本発明は上記従来技術が持っていた音質の悪さを改善するためのものであり、圧縮率を悪化させることなく、また量子化誤差の増加を押さえつつ音質を改善する方法および符号化装置を提供することを目的とする。
【0025】
【課題を解決するための手段】
上記目的を達成するために、第1の発明では、ディジタル入力データのある時刻nのサンプル値と適応予測フィルタで生成されたその時刻nの予測値との差分をとり、得られた差分データを、その時刻nでの量子化ステップ幅に基づいて、量子化し、符号化して出力する適応ビットADPCM符号化方法において、量子化段階数である量子化サイズの種類ごとに、量子化又は符号化後の差分データと乗数データとの対応関係を記述している複数の乗数データ記憶部を備え、時刻nで選択されている前記乗数データ記憶部に記憶されている乗数データの中から、時刻nの前記差分データに応じた乗数データを取り出して、時刻nの量子化ステップ幅に乗算することにより時刻n+1での量子化ステップ幅を得ると共に、時刻nでの所定パラメータの値が属する範囲に応じ、その範囲で定まる前記乗数データ記憶部を時刻n+1で選択させ、かつ、選択された乗数データ記憶部に対応する量子化サイズを時刻n+1の量子化サイズとし、符号化による符号データを出力データに含めると共に、量子化ステップ幅及び量子化サイズを出力データに含めない事を特徴とする。
【0026】
また、第2の発明の適応ビットADPCM符号化装置は、(1)時刻nでのディジタル入力データのサンプル値と予測値との差分を取り差分データを出力する差分手段と、(2)前記予測値を生成する適応予測フィルタと、(3)時刻nの前記差分データを、時刻nでの量子化ステップ幅、及び、時刻nでの量子化段階数である量子化サイズに基づいて、量子化する量子化手段と、(4)前記量子化手段からの時刻nでの量子化データを、時刻nでの量子化サイズに基づいて、符号化する符号化手段と、(5)前記量子化サイズの種類ごとに、量子化又は符号化後の差分データと乗数データとの対応関係を記述している複数の乗数データ記憶部と、(6)時刻nで選択されている前記乗数データ記憶部に記憶されている乗数データの中から、時刻nの前記差分データに応じた乗数データを取り出して、時刻nの量子化ステップ幅に乗算することにより時刻n+1での量子化ステップ幅を得る量子化ステップ幅制御手段と、(7)時刻nでの所定パラメータの値が属する範囲に応じ、その範囲で定まる前記乗数データ記憶部を時刻n+1で選択させ、かつ、選択された乗数データ記憶部に対応する量子化サイズを時刻n+1の量子化サイズとする量子化サイズ制御手段とを備え、符号化による符号データを出力データに含めると共に、量子化ステップ幅及び量子化サイズを出力データに含めない事を特徴とする。
【0027】
【発明の実施の形態】
本発明の実施形態を図面を用いて説明する。
【0028】
(A)第1の実施形態
図1は本発明の第1の実施形態を説明する機能ブロック図である。本実施形態における符号化・復号化システム全体の構成は図2の一般的なADPCM方式の符号化・復号化装置と同じであるのでその全体動作についての詳細な説明は省略する。図1に示す本発明の第1の実施形態を説明する機能ブロック図は図2に示す従来の構成と異なる量子化部分104を説明するものである。
【0029】
この量子化部分では従来と異なり、次サンプルの量子化ステップ幅決定の為に用いる乗数テーブルを3ビット符号化用、4ビット符号化用、5ビット符号化用と数種類有し、現サンプルの量子化ステップ幅に応じてこれらから1つを選択して使用する構成になっている。
【0030】
本実施形態のADPCM方式の符号復号化装置では、量子化部分104は、予測差分D(n)を量子化するために量子化部405を備え、この量子化部405には量子化サイズB(n)を指定する制御信号がセレクタ407から供給されている。量子化部405は入力された予測差分D(n)を量子化サイズB(n)で量子化し、その出力値である量子化値Q(n)を伝送符号に変換するための符号化部406に供給する。
【0031】
符号化部406には量子化部405と同様にセレクタ407から量子化サイズB(n)を指定する制御信号が供給されており、量子化サイズB(n)で符号化を行う。符号化部406の出力、すなわち符号データL(n)は伝送路に出力されるとともに次サンプルの量子化ステップ幅を決定するためにROM読み出し部402に供給される。
【0032】
ROM読み出し部402はセレクタ407を介して乗数テーブル401a〜401cに接続されており、符号化部406から供給された現サンプルの符号データL(n)に応じて乗数データM(L(n))を乗数テーブル401a〜401cの1つから読み出し、乗算器403の一方の入力に供給する。
【0033】
セレクタ407はレジスタ404に保持された現サンプルの量子化ステップ幅によって制御され、現サンプルの量子化ステップ幅Δ(n)に応じて乗数テーブル401a〜401cのいずれか1つの乗数テーブルを選択的にROM読み出し部402に接続する。
【0034】
乗算器403の他方の入力はレジスタ404に接続されており、乗数テーブル401a〜401cの1つから読み出された乗数データM(L(n))とレジスタ404に保持されている現サンプルの量子化ステップ幅Δ(n)を乗算して出力をレジスタ404に保持する。レジスタ404に新たに保持されたデータは次サンプルの量子化ステップ幅Δ(n+1)として用いられることになる。
【0035】
量子化値Q(n)、符号化データL(n)と乗数データM(L(n))の関係は先述の表1〜3に示される通りである
次に動作を説明する。第nサンプル目における予測差分D(n)は、量子化部405で量子化され量子化データQ(n)が得られる。量子化部405はレジスタ404に設定されている量子化ステップ幅Δ(n)とセレクタ407から供給される量子化サイズB(n)を指定する制御信号を基に次式によって量子化データQ(n)を求める。
【0036】
Q(n)={[D(n)/{Δ(n)/{B(n)/4}}]+2/B(n)}×Δ(n)
ただし[*]はかっこの中の値を超えない最大の整数でかつ、最大値(B(n)/2−1)〜最小値(−B(n)/2)までの範囲に制限される。例えば3ビット符号化(B(n)=8)の場合は−4〜3、4ビット符号化(B(n)=16)の場合は−8〜7、5ビット符号化(B(n)=32)の場合は−16〜15の範囲の整数値となる。
【0037】
従って、量子化出力値Q(n)は上式から明らかなように、−2(B(n)−1)Δ(n)/B(n)から2(B(n)−1)Δ(n)/B(n)まで4Δ(n)/B(n)刻みで(n)種類得られることになる。4ビット符号化の場合について、予測差分D(n)と量子化データQ(n)の変換関係を図4に示す。
【0038】
図4をみて分かるように4ビット符号化は16値の量子化値を出力するので段階が16あり、−15Δ(n)/8〜−Δ(n)/8、Δ(n)/8〜15Δ(n)/8の16種類の量子化出力が得られることが分かる。例えば、予測差分D(n)が
0≦D(n)<2Δ(n)/8の時、Q(n)=Δ(n)/8
2Δ(n)/8≦D(n)<4Δ(n)/8の時、Q(n)=3Δ(n)/8
と言った具合である。
【0039】
次に、量子化データQ(n)は符号化部406において量子化サイズB(n)で符号化され符号データL(n)が得られる。これらの変換関係は表1〜3に示される通りである。符号データL(n)は伝送路108に伝送されるとともに次サンプルの量子化サイズB(n+1)を求める為に用いられる。
【0040】
符号データL(n)はROM読み出し部402のポインタとして用いられ、セレクタ407を介して乗数テーブル401a〜401cのいずれかひとつから乗数データM(L(n))が読み出される。どの乗数テーブルを選択するかはセレクタ407によって決定される。セレクタ407はレジスタ404から供給される現サンプルの量子化ステップ幅Δ(n)の値に基づいて乗数テーブルの選択を行う。その例を以下に示す。
【0041】
0≦Δ(n)<16の場合
量子化テーブル401aを選択(B(n)=8)
16≦Δ(n)<64の場合
量子化テーブル401bを選択(B(n)=16)
64≦Δ(n)の場合
量子化テーブル401cを選択(B(n)=32)
乗数テーブルから読み出された乗数データM(L(n))は、レジスタ404の値すなわちΔ(n)と乗算器403で乗算され、乗算結果が次サンプルの量子化ステップ幅Δ(n+1)となる。
【0042】
すなわちΔ(n+1)=M(L(n))×Δ(n)で表わされる。
【0043】
乗数データM(L(n))の設定例を表1〜3に示す。この設定値は、予測差分D(n)の絶対値が量子化ステップ幅Δ(n)の絶対値を超える場合、次サンプルの量子化ステップ幅Δ(n+1)を増加させる方向に働き、そうでない場合には、次サンプルの量子化ステップ幅Δ(n+1)を減少させる方向に働くように設定されている。すなわち量子化ステップ幅は入力サンプル値の変動に追従していることになる。
【0044】
従来のADPCM方式では、量子化誤差は、入力サンプルのレベルの大きい部分または、高周波成分が多く含まれるサンプルの変動が大きい部分において知覚されていた。そのため、この実施形態では、上記のように量子化ステップ幅の値によって量子化サイズを変動させることにより、すなわち、量子化誤差の目立つサンプルの変動が大きい部分では量子化サイズを大きく設定し、逆に量子化誤差のあまり目立たないサンプル変動の小さい部分では量子化サイズを小さく設定することにより平均的なビットレートを抑えながら音質の向上を図ることができる。
【0045】
このように本実施形態では、聴感上量子化誤差の影響が少ないサンプルのレベルの小さい部分や隣接するサンプルの変動値の小さい部分は低ビットで、聴感上量子化誤差の影響の大きいサンプルのレベルの大きい部分や隣接するサンプルの変動値の大きい部分は高ビットで符号化すると言う構成を有し、しかも、量子化サイズ決定を現サンプルの量子化ステップ幅のみによって行っているので、量子化サイズ指定のための付加ビットも必要なく、平均的なビットレートを上げる事なく音質を向上させる効果がある。
【0046】
例えば、音質を客観的に計る指標としてセグメンタルSN比を用いるとすると、あるサンプル(ピアノ音楽)で以下のような実験結果が得られている。すなわち
従来のADPCM方式(3ビット符号化) 39.5dB
従来のADPCM方式(4ビット符号化) 45.3dB
従来のADPCM方式(5ビット符号化) 49.9dB
第1の実施形態によるADPCM方式(平均4.2ビット) 47.5dB
1サンプル当たり0.2(=4.2−4)ビットの情報を増加させるだけで、従来の4ビットADPCM符号化方式に比べて2.2(=47.5−45.3)dBもSN比を改善することができた。これは聴感上においては従来の5ビットADPCM方式に極めて近い音質である。
【0047】
また上記乗数テーブルの選択を以下のように行うことにより、すなわち、
0≦Δ(n)<16の場合
量子化テーブル401aを選択(B(n)=8)
16≦Δ(n)<100の場合
量子化テーブル401bを選択(B(n)=16)
100≦Δ(n)の場合
量子化テーブル401cを選択(B(n)=32)
することにより、先と同一のサンプル(ピアノ音楽)において以下の結果が得られている。すなわち、
第1の実施形態によるADPCM方式(平均4.02ビット) 46.5dB
である。
【0048】
このような量子化テーブルの選択方法では従来の4ビットADPCM符号化方式とほぼ同じビットレート(4.02ビット)であるにもかかわらず、セグメンタルSN比を1.2(=46.5−45.3)dBも改善することができている。
【0049】
(B)第2の実施形態
次に、本発明の第2の実施形態を説明する。上記第1の実施形態では、平均的なビットレートをあげる事なく音質を向上させる効果があるが、そのビットレートを確定することは困難であった。例えば、ある音楽ではビットレートが平均4.2ビットであるが、別の音楽になると平均4.3ビットになってしまうといった現象が発生してしまう。
【0050】
すなわち、ビットレートが幾つになるかは符号化が終了してみないと分からないと言う問題が発生してしまう。ビットレートは、伝送路の伝送速度や記憶媒体の記憶容量に密接に関係しているため、伝送路や記憶媒体の物理的制約が厳しい場合には、上記第1の実施形態では十分とは言えなかった。そこで、この第2の実施形態ではビットレートを確定させつつ音質の向上を図る。
【0051】
第2の実施形態を図5、6を基に説明する。第2の実施形態のADPCM符号復号化装置の機能ブロック図を図5に示す。この装置は、エンコード側Aのエンコーダ514の入力に、入力サンプルを数サンプル(20〜30サンプル)に渡ってバッファリングするためのメモリ501を有する。
【0052】
この例では30サンプルとして説明を進める。このサンプル数を1フレームと定義する。すなわち1フレームが30サンプルで構成されるものとする。一旦メモリに書き込まれた入力サンプルは、1サンプルずつエンコーダ514で符号化が行われる。エンコーダ514の基本的な構成、予測値XP(m,n)の求め方や予測フィルタ506の構成などは第1の実施形態と変わらないが、先に述べたフレームと言う単位で符号化が行われるという点が異なる。
【0053】
パラメータをいろいろ変化させてフレーム単位で符号化を行ってみて、音質あるいはビットレートが最適なパラメータを選択してデータ伝送を行うと言う点が、従来の技術あるいは第1の実施形態と大きく異なる点である。
【0054】
従って、同一フレームを数回、パラメータを変えて符号化を行うことになり、そのためにメモリ501のバッファを用意して演算がサンプル入力に間に合うようにしている。また、メモリ501の容量はそれに間に合うサイズに設定する必要がある。
【0055】
このようにして、フレーム単位で符号化を行った後、当該フレームにおける最適なパラメータである選択データS(m)と符号データL(m,n)がマルチプレクサ507で多重化されて伝送路508を介してデコード側Bに送信される。ここでは伝送路としたが、音声蓄積装置に組み込む場合はRAMなどの記憶媒体でも構わない。適応量子化部503の構成を図6に示す。
【0056】
第1の実施形態と異なる点は、選択テーブル608およびカウンタ609が新たに付け加えられている点と、量子化誤差算出部610、判定部611および判定結果を格納するためのレジスタB612、C613、D614を設けた点である。乗数テーブル601a〜601cの選択を行うためのセレクタ607の制御が、量子化ステップ幅Δ(m,n)が格納されているレジスタA604から信号と選択テーブル608から供給される信号によって行われる。
【0057】
適応量子化部503の入力は、予測差分D(m,n)であり、出力は符号データ系列L(m,n)(n=0、・・、29)と選択データS(m)である。 適応量子化部503は入力である予測差分D(m,n)を量子化するための量子化部605を有し、量子化サイズB(m,n)を指定する制御信号がセレクタ607から供給されている。
【0058】
量子化部605は量子化サイズB(m,n)で量子化を行い、その出力値である量子化値Q(m,n)は伝送用符号に変換するための符号化部606に出力される。符号化部606には量子化部605と同様に、セレクタ607から量子化サイズB(m,n)を指定する制御信号が供給されており、量子化サイズB(m,n)で符号化が行われる。
【0059】
符号化部606の出力すなわち符号データL(m,n)は、現時点では伝送されずに次サンプルの量子化ステップ幅決定に用いられるためROM読み出し部602に送られる。ROM読み出し部602はセレクタ607に接続されており、これを介して乗数テーブル601a〜601cのいずれか1つから乗数データM(L(m,n))の読み出しを行い、読み出された結果を、乗算器603の一方の入力に供給する。
【0060】
セレクタ607はレジスタA604に保持された現サンプルの量子化ステップ幅Δ(m,n)と選択テーブル608の値によって制御され、これらの値に応じて、乗数テーブル601a〜601cの1つをROM読み出し部602に接続する。
【0061】
選択テーブル608はカウンタ609により制御されており、カウンタ609の値が選択テーブル608の読み出しアドレスとなっている。したがって、カウンタ609の値が「3」の場合、選択テーブル608のアドレス「3」に対応したデータが選択テーブル608から読み出され、セレクタ607の制御信号としてセレクタ607に供給されることになる。
【0062】
また、カウンタ609は1フレーム分の符号化が終了する度に、すなわち30サンプルの符号化が終了する度に、1インクリメントされ、選択テーブル608のデータ量分だけ増加する。選択テーブル608には、レジスタAに格納されている量子化ステップ幅Δ(m,n)のしきい値のデータが数組格納されており、この数だけカウンタ609が増加することになる。
【0063】
例えば選択テーブル608が次の表4に示すデータ構造の場合、アドレスは0〜7までの8種類存在するので、カウンタ609は初期値0からフレームごとに1インクリメントされ、アドレスの符号化が終了して初めて1フレーム分の符号化が終了することになる。
【0064】
【表4】
Figure 0003731993
さて乗算器603は、乗数テーブル601a〜601cからROM読み出し部602を介して得られた乗数データM(L(m,n))と、レジスタA604の出力値を入力として乗算を行い、その結果を再びレジスタA604に書き込むようになっている。
【0065】
レジスタA604に書き込まれたデータは、次サンプルの量子化ステップ幅Δ(m,n+1)として用いられる。量子化データQ(m,n)と符号化データL(m,n)と、乗数データM(L(m,n))の関係は表1〜3に示される通りである
この第2の実施形態では、量子化誤差算出部610を有する。これは、予測差分D(m,n)と量子化データQ(m,n)との差分の絶対値を1フレーム(すなわち30サンプル分)加算する機能を持つとともに、セレクタ607から出力される量子化サイズB(m,n)も1フレーム分加算する機能を持つ。
【0066】
これらの加算結果は1フレーム分の演算が終了した時点で判定部611に送られる。判定部611はレジスタB612、レジスタC613、レジスタD614と3種類のレジスタを有し、送られてきたデータが最適値かどうかを判定して、最適値ならばカウンタ609の値をレジスタB612に格納し、量子化誤差をレジスタC613に格納する。
【0067】
最適値であるかどうかの判定は、現カウンタ609値よりも前において求められた量子化誤差よりもその値が小さく、かつ所望のビットレートの範囲内であるかどうかが基準である。
【0068】
また、レジスタD614には、サンプル入力開始から前フレームまでの総ビット数が格納されている。所望のビットレートにおさまるかどうかはこのレジスタの値を参照することにより可能となる。
【0069】
このように第2の実施形態では、選択テーブル608に格納されているパラメータを用いて、1フレーム(30サンプル)の符号化を行い量子化誤差が小さくかつ、所望のビットレートの範囲内であるか判定を行っていき、用意されたパラメータの中で最も最適なデータを用いて符号化を行うと言う構成を採る。
【0070】
デコーダ側Bでは、伝送路508を介して送られてきた多重化データは、デマルチプレクサ509で符号データ系列L(m,n)と選択データS(m)に分離され適応量子化部510に供給される。
【0071】
図7に適応量子化部510の構成を示す。
【0072】
選択データS(m)がこの図7に示す選択テーブル708のアドレスポインタになる。すなわち、第1の実施形態と異なる点は、乗数テーブル選択のための量子化ステップ幅のしきい値がデータとして伝送されているか、固定であるかだけであるのでここでは説明を省略する。
【0073】
第mフレームの第nサンプル目における予測差分D(m,n)は、量子化部605で量子化され量子化データQ(m,n)が得られる。量子化部605は、レジスタA604に設定されている量子化ステップ幅Δ(m,n)と、セレクタ607からの量子化サイズを表す制御信号B(m,n)とから次式により量子化データQ(m,n)を出力する。
【0074】
Q(m,n)={[D(m,n)/{Δ(m,n)/{B(m,n)/4}}]+2/B(m,n)}×Δ(m,n)
ただし[*]は中の値を超えない最大整数で、かつ最大値(B(m,n)/2−1)〜最小値(−B(m,n)/2)までの範囲に制限される。次に、量子化データQ(m,n)は符号化部606で量子化サイズB(m,n)で符号化され符号データL(m,n)が得られる。
【0075】
これらの関係は先述の表1〜3に示された通りである。符号データL(m,n)は次サンプルの量子化ステップ幅Δ(m,n+1)を求めるのに用いられる。L(m,n)はROM読み出し部602のアドレスポインタとして用いられ、セレクタ607を介して乗数テーブル601a、601b、601cのいずれか1つから乗数データM(L(m,n))が読み出される。
【0076】
どの乗数テーブルからデータが読み出されるかはセレクタ607により決定されるレジスタA604と選択テーブル608からの信号によりこのセレクタ607が駆動される。現サンプルの量子化ステップ幅Δ(m,n)の値によって次のように乗数テーブルの選択が行われる。
【0077】
0≦Δ(m,n)<TH1の場合
乗数テーブル601aを選択(B(m,n)=8)
TH1≦Δ(m,n)<TH2の場合
乗数テーブル601bを選択(B(m,n))=16)
TH2≦Δ(m,n)の場合
乗数テーブル601cを選択(B(m,n)=32)
ここで、(TH1,TH2)の組は選択テーブルROM608に格納されているデータであり、表4に示す通りである。選択テーブル608はカウンタ609の値をアドレスポインタとしてデータを出力しているので、
カウンタ609の値が0の場合は TH1=32768,TH2=32768
カウンタ609の値が1の場合は TH1=0,TH2=32768
といった具合になる。
【0078】
カウンタ609の値は、この場合、初期値を0としてフレーム単位に1ずつインクリメントされ7まで増加する。したがって、1フレーム当たり(8×30=240)サンプル分の符号化を行って最適解を算出している。ちなみに選択テーブル608のアドレスが0の時は常に乗数テーブル601aが選択され、アドレス1の時は常に乗数テーブル601bが選択され、アドレス2の時は常に乗数テーブル601cが選択され、それ以外の時は3種類の乗数テーブルのどれかが選択されるようになっている。
【0079】
乗数テーブルから読み出されたデータM(L(m,n))は、レジスタA604の値すなわちΔ(m,n)と乗算器603で乗算され再びレジスタA604に格納され、これが次サンプルの量子化ステップ幅Δ(m,n+1)となる。すなわち
Δ(m,n+1)=M(L(m,n))×Δ(m,n)
乗数データM(L(m,n))の設定例は表1〜3に示される通りである。
【0080】
予測差分Q(m,n)の絶対値が量子化ステップ幅Δ(m,n)の絶対値を超える場合には、次サンプルの量子化ステップ幅Δ(m,n+1)の絶対値を増加させる方向に働き、そうでない場合には減少の方向に働くように設定されている。すなわち量子化ステップ幅は、入力サンプルの変動値に追従していく事になる。
【0081】
一方量子化誤差算出部610ではフレーム単位に累計量子化誤差εsum(m)と累計ビットBsum(m)の計算を行っている。すなわち
εsum(m)=Σabs(D(m,n)−Q(m,n))
Bsum(m)=ΣB(m,n)+3
ただし、これら2つの式においてΣはnについて0から29の範囲の総和を示す。
【0082】
累計ビットBsum(m)の算出式において(+3)の項は、選択データS(m)分のビット数である。この場合、0〜7までの2の3乗通りであるからである。
【0083】
1フレームの符号化処理が終了した時点でこの結果は判定部611に送られる。判定部611では所望のビット数以内でかつ、累計量子化誤差εsum(m)が最小であればεsum(m)の値をレジスタC613に格納し、この時のカウンタ609の値をレジスタB612に格納する。このようにしてフレーム処理を8回行った後にレジスタB612に格納されているデータが最適な選択テーブルのアドレスポインタとなる。このポインタ値を用いて再び一連の符号化処理を行う。
【0084】
図8に、以上のような第2の実施形態のADPCM符号化のフローチャートを示す。
【0085】
復号化は以下の通り実行される。所望のビットレート内で一番量子化誤差の小さくなるカウンタ609値すなわち、選択データS(m)と多重化されて送られて来たデータは、デマルチプレクサで選択データS(m)と符号データL(m,n)に分離され復号化が行われる。選択データS(m)が、図7における選択テーブル708のアドレスポインタとなってセレクタを制御するほかは第1の実施形態と同様なので説明は省略する。
【0086】
図8のフローを簡単に説明する。図8に示すように、ステップ800〜802までは初期化処理である。ステップ804でサンプル入力の終了を判定するまでm×nサンプルのデータに対する処理を継続する。ステップ807でレジスタ(Reg)Cに10e50の初期値を設定し、ステップ808〜ステップ814までの8ビット毎の処理を繰り返す。
【0087】
この中でフレーム処理は図9に示す通りのサブルーチンとなっている。フレーム処理810を行った後、ステップ811またはステップ812に示す条件を満たさない場合を除いて量子化誤差ε(n)をレジスタCにセットし(ステップ813)カウンタ値をレジスタBにセットする(ステップ813)。
【0088】
8ビット毎の処理が終了すると、ステップ815でレジスタBの値をカウンタ値とし、フレーム処理を1回行った後、ステップ817でレジスタDの値を現フレームの累計ビット数だけ増加させる。
【0089】
フレーム処理は図9に示すように予測差分D(m,n)の計算(ステップ824)、量子化(ステップ825)、符号化(ステップ826)、乗数テーブルから乗数の読み出し(ステップ827)、量子化ステップ幅の決定(ステップ828)、量子化誤差ε(m)の算出(ステップ829)等の処理をnが30を超えるまで、すなわち1フレーム分の処理が終了するまで繰り返し行う。尚、図8においてbitは現フレームの累計ビット数、BITはフレーム当たりの所望ビット総数を意味する。
【0090】
このように、第2の実施形態によれば、予測符号化技術を用いた音声圧縮方式において、聴感上量子化誤差の影響が少ない、サンプルのレベルの小さい部分や隣接するサンプルの変動値の小さい部分は低ビットで、聴感上量子化誤差の影響が大きい、サンプルのレベルの大きい部分や隣接するサンプルの変動値の大きい部分は高ビットで符号化するという構成を有し、しかも所望のビット数以内において量子化誤差が最小になるようにビット割り当てを行っているので、ある決まったビットレートにおける最高の音質を提供することが可能となる。
【0091】
なお、上記第1、第2の実施形態では表1〜3で量子化サイズ8値、16値、32値の場合についてそれぞれ、量子化データQ(n)と符号データL(n)と乗数データM(L(n))との関係を示しているが、この値に限定されるものではない。例えば、量子化データQ(n)は等間隔としているが非線形な量子化でも構わないし、符号化データL(n)もこれに限らない。また乗数データM(L(n))の値も、統計的なデータに基づいて作られているものであり、あくまでも一例に過ぎない。さらに乗数テーブル601a〜601cの選択条件としてΔ(n)の数値を示しているが、これも一例に過ぎず、他の値でも良い。
【0092】
また量子化ステップ幅Δ(n)で乗数テーブルの選択を行っているが、これに代えて入力値X(n)あるいは予測差分D(n)あるいは符号化データL(n)あるいは量子化後の予測差分DQ(n)あるいは、量子化後のサンプルデータXP(n)あるいは、量子化誤差ε(n)で選択を行うという構成でも構わない。
【0093】
さらに、本発明の適応ビットADPCM符号化方法および適応ビットADPCM符号化装置が取り扱うデータは、上述した音声データに限らず、他の種類のディジタルデータであってもよい。
【0094】
【発明の効果】
以上のように、本発明の適応ビットADPCM符号化方法および適応ビットADPCM符号化装置によれば、圧縮率の悪化を防ぎながら量子化誤差の増加を押さえることが可能となる。
【図面の簡単な説明】
【図1】 第1の実施形態の量子化部分を説明する機能ブロック図である。
【図2】 従来および本発明の符号化・復号化システムの全体構成を示すブロック図である。
【図3】 従来の量子化方法を説明する機能ブロック図である。
【図4】 信号レベルと量子化値の関係を説明する図である。
【図5】 第2の実施形態の符号化・復号化システムの全体構成を示すブロック図である。
【図6】 第2の実施形態の量子化部分を説明する機能ブロック図である。
【図7】 第2の実施形態の復号化部における量子化部分を説明する機能ブロック図である。
【図8】 第2の実施形態の符号化動作を説明するフローチャートである。
【図9】 第2の実施形態の符号化動作のなかのフレーム処理を説明するフローチャートである。
【符号の説明】
401a〜401c…乗数テーブル、402…ROM読み出し部、403…乗算器、404…レジスタ、405…量子化部、406…符号化部、407…セレクタ、601a〜401c…乗数テーブル、602…ROM読み出し部、603…乗算器、604…レジスタ、605…量子化部、606…符号化部、607…セレクタ、608…選択テーブル、609…カウンタ、610…量子化誤差算出部、611…判定部、612…レジスタB、612…レジスタC、612…レジスタD。[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to an adaptive bit ADPCM encoding method and an adaptive bit ADPCM encoding apparatus that compress and decompress digital data such as speech data using, for example, predictive encoding technology.
[0002]
[Prior art]
  As a digital audio signal compression method, many methods using the property that digital audio has a high correlation between adjacent samples are proposed. As a conventional technique that uses this property and performs voice compression by a relatively simple process, there is a predictive coding technique. For example, DPCM (Differential Pulse Code Modulation) method and ADPCM (Adaptive Differential Pulse Code Modulation) method are well known as applications of predictive coding technology. In these methods, the difference between actual speech and predicted value is known. Audio compression is achieved by quantizing the value.
[0003]
  Since the level of the audio signal varies with time, it is preferable to quantize the audio signal while changing the step size in accordance with the level of the audio level, rather than quantizing the audio signal in a certain quantization unit. If quantization is performed with a constant step size, the number of bits is insufficient for a large audio signal, so that the sound quality is distorted due to overload.
[0004]
  On the other hand, since a small signal is coarsely quantized, it is perceived as annoying noise (quantization noise). Human hearing is insensitive to quantization noise for loud sounds, but small soundsversusAs a result, it has the property of becoming sensitive. Therefore, a large signal is quantized with a large step size to make a small signal.versusTherefore, it can be understood that fine quantization is sufficient, and the ADPCM system adopts such an adaptive quantization method.
[0005]
  FIG. 2 shows a functional block diagram for a general ADPCM encoding / decoding process. In ADPCM, for a signal having strong correlation such as speech, the method of taking the difference between adjacent samples is expected to compress more than the method of encoding the sample value as it is (PCM). And the difference is quantized with a quantization step width that adaptively changes according to the level and transmitted.
[0006]
  This system comprises an encoding side A for compressing a digital audio input and a decoding side B for returning the compressed signal, and the two are connected by a transmission line 108.
[0007]
  First, on the encoding side A, the adder 101 calculates a difference D (n) between the n-sample input value X (n) and the predicted value XP (n). Ie
D (n) = X (n) −XP (n) is obtained.
[0008]
  Prediction difference D (n) is quantizedportionQuantization is performed at 104 and transmitted to the transmission path 108 as code data L (n). Although a transmission path is used here, a storage medium such as a RAM may be used when incorporated in an audio storage / playback apparatus. The code data L (n) is used by the step width determination unit 102 to determine the quantization step width of the next sample. The determination of the quantization step width will be described later.
[0009]
  The code data L (n) is inversely quantized by the decoding unit 105 to obtain a quantized prediction difference DQ (n). The quantized prediction difference DQ (n) is added to the previously obtained predicted value XP (n) by the adder 106 to obtain a quantized sample data sequence. That is,
XQ (n) = XP (n) + DQ (n) is obtained.
[0010]
  The quantized sample data series XQ (n) is used as an input to the prediction filter 107, and a predicted value XP (n + 1) of the next sample is calculated. Note that the configuration of the prediction filter 107 is arbitrary, and is typically composed of a several-order IIR filter.
[0011]
  Next, quantization will be described in detail using functional blocks of a quantization method according to the conventional ADPCM code decoding method of FIG. The prediction difference D (n) of the nth sample is quantized by the quantization unit 205 to obtain quantized data Q (n). The quantized data Q (n) is encoded by the encoding unit 206 to obtain code data L (n). Quantization is performed using the quantization step width Δ (n) stored in the register 204, and these relationships are expressed by the following equations.
[0012]
1) In the case of 8-level quantization size (3-bit encoding)
    Q (n) = {L (n) +1/4} × Δ (n)
    L (n) = [D (n) / {Δ (n) / 2}]
2) 16-value quantization size (4-bit encoding)
    Q (n) = {L (n) +1/8} × Δ (n)
    L (n) = [D (n) / {Δ (n) / 4}]
3) In the case of 32 quantization sizes (5-bit encoding)
    Q (n) = {L (n) +1/16} × Δ (n)
    L (n) = [D (n) / {Δ (n) / 8}]
Here, Δ (n) represents a quantization step width, and [*] represents a maximum integer that does not exceed a medium value. In addition, the coded data L (n) is limited to integers in the range of -4 to 3, -8 to 7, and -16 to 15 in the quantization sizes of 8, 16 and 32. For example, the correlation between the prediction difference D (n) and the quantization output Q (n) is shown in FIG. The number of steps in FIG. 4 is 16, and 16 types of quantized outputs of −15Δ (n) / 8 to −Δ (n) / 8 and Δ (n) / 8 to 15Δ (n) / 8 can be obtained. I understand. For example,
When 0 ≦ D (n) <2Δ (n) / 8, Q (n) = Δ (n) / 8
When 2Δ (n) / 8 ≦ D (n) <4Δ (n) / 8, Q (n) = 3Δ (n) / 8
And so on.
[0013]
  The code L (n) is transmitted and used to update the quantization step width Δ (n + 1) of the next sample. As can be seen from FIG. 4, the quantization value is limited to a range of 1/8 to 15/8 of the quantization step width Δ (n). Therefore, when the absolute value of the prediction difference D (n) is in the increasing direction, the quantization step width Δ (n) is increased accordingly, and when the absolute value of the prediction difference D (n) is in the decreasing direction. It is desirable to reduce the quantization step width Δ (n) accordingly.
[0014]
  Therefore, a method is used in which the quantization value is updated by multiplying the quantization step width Δ (n) of the current sample by a certain number. That is, the code L (n) is used as a pointer of the ROM reading unit 202 and is a multiplier table.Le 2Multiplier data M (L (n)) is read from 01. The quantization output Q (n) and the code data L (n), the code L (n), and the multiplier data M (L (n)) have a one-to-one correspondence with each other. The value shown in FIG.
[0015]
[Table 1]
Figure 0003731993
[Table 2]
Figure 0003731993
[Table 3]
Figure 0003731993
  Table 1 shows a case where the quantization size is 8 values, Table 2 shows a case where the quantization size is 16 values, and Table 3 shows a case where the quantization size is 32 values.
[0016]
  When the absolute value of the prediction difference D (n) exceeds the absolute value of the quantization step width Δ (n), the absolute value of the quantization step width Δ (n + 1) of the next sample is increased. Is set to work in the direction of reduction. Multiplier data M (L (n)) shown in Tables 1 to 3 is empirically determined based on the statistical properties of speech and is merely a setting example. The values in Tables 1 to 3 are based on “NSJayant,“ Adaptive Quantization With a One-Word Memory ”, in The Bell System Technical Journal Vol.52, No.7, Sep.1973, pp.1119-1144”. Yes. Multiplier tableLe 2Multiplier data M (L (n)) read from 01 is multiplied by the quantization step width Δ (n) of the current sample stored in the register 204 by the multiplier 203 and stored again in the register 204. . This value is the quantization step width Δ (n + 1) of the next sample. The above calculation is sequentially performed digitally for each sample.
[0017]
  On the other hand, on the decoding side B, the code data L (n) transmitted from the encoding side A via the transmission path 108 is decoded by the decoding unit 110. The quantization step width at this time is obtained from the code data L (n-1) of the previous sample. When the decoding process ends, the quantization step width of the next sample is determined using the code data L (n) of the current sample. The determination method and its configuration are exactly the same as those on the encoding side. The decoded difference data DQ (n) is added by the adder 111 with the output XP (n) of the prediction filter 112 and output as a decoded sample data sequence XQ (n). Needless to say, the prediction filter 112 has the same configuration as the encoding prediction filter 107. Therefore, the difference between the input sample data X (n) and the decoded sample data XQ (n) is the quantization error ε (n). That is, ε (n) = X (n) −XQ (n).
[0018]
  The quantization error is an error associated with the quantization of the prediction difference D (n). As is clear from FIG. 4, when the quantization size is m, the quantization step width is 2 / at most.2 m It is. (However, the case where the absolute value of the encoded data is the maximum is excluded) That is, the quantization error is Δ (n) / 4 in the case of 3-bit encoding, Δ (n) / 8, 5 in the case of 4-bit encoding. In the case of bit encoding, Δ (n) / 16.
[0019]
  In order to reproduce the waveform more faithfully, it is necessary to reduce the quantization error. Therefore, when performing high-quality encoding, 4-bit encoding is better than 3-bit encoding, and 5-bit encoding is better than 4-bit encoding.
[0020]
  However, the above prior art has the following problems. That is, if 16-value encoding is performed on 16 bits of input samples, a 4-bit code is generated per sample, so the compression rate becomes 1/4 and the efficiency is not very good. In addition, when a high-quality musical tone (a sample having a sampling frequency exceeding 40 KHz) similar to a CD (compact disc) is encoded, there is a problem that quantization noise is audible in a portion including a high frequency.
[0021]
  The cause of the above problem is that since the high-frequency component is included, the fluctuation of the adjacent sample value is large, and as a result, the quantization step width becomes large. (As described above, the quantization error is Δ (n) / 8 in the case of 4-bit encoding.) Therefore, it has also been proposed to set an upper limit on the quantization step width Δ (n) in order to reduce quantization noise. However, on the contrary, if the prediction error is large, the overflowed information is lost, which causes overload noise and the like. Further, when the quantization size (number of quantization bits) of the prediction difference is increased in order to prevent overload noise, there is a disadvantage that the transmission bit rate increases and the compression rate is lowered.
[0022]
  In order to solve this problem, conventionally, as disclosed in, for example, Japanese Patent Application Laid-Open No. 64-39840, when the quantization step width Δ (n) exceeds a predetermined threshold value, the code size is multiplexed to obtain the quantization size. A method has been proposed in which the increase in the quantization error is suppressed.
[0023]
[Problems to be solved by the invention]
  However, according to this method, when the prediction difference exceeds a predetermined threshold, the quantization step width Δ (n) is fixed, and “Adaptation to prediction error” is an original characteristic of the ADPCM coding method. The effect of reducing the quantization error due to “quantization” was not obtained as expected. That is, when the prediction error exceeds a certain value, the quantization error increases rapidly, resulting in a problem of sound quality degradation.
[0024]
  The present invention provides a method and an encoding apparatus for improving the sound quality without deteriorating the compression rate and suppressing an increase in quantization error, and for improving the poor sound quality that the above-mentioned prior art has. The purpose is to do.
[0025]
[Means for Solving the Problems]
  In order to achieve the above object, in the first invention, digital input data is provided.Sample value at time n withAnd generated by adaptive prediction filterAt time nObtained by taking the difference from the predicted valueBased on the quantization step width at time n, the difference data isIn an adaptive bit ADPCM encoding method for quantizing, encoding and outputting,For each type of quantization size, which is the number of quantization steps, a plurality of multiplier data storage units describing the correspondence between quantized or encoded difference data and multiplier data are provided, and selected at time n Quantization at time n + 1 by taking out the multiplier data corresponding to the difference data at time n from the multiplier data stored in the multiplier data storage unit and multiplying it by the quantization step width at time n A step width is obtained, and the multiplier data storage unit determined in the range is selected at time n + 1 according to the range to which the value of the predetermined parameter at time n belongs, and the quantization corresponding to the selected multiplier data storage unit The size is the quantization size at time n + 1, the encoded data is included in the output data, and the quantization step width and the quantization size are not included in the output data.It is characterized by things.
[0026]
  Also, the adaptive bit ADPCM encoding device of the second invention is provided.Is, (1)Time nDigital input data atSample valuesThe difference between the predicted value and the differencedata(2) an adaptive prediction filter that generates the prediction value; and (3)Based on the quantization step width at time n and the quantization size, which is the number of quantization steps at time n, for the difference data at time n,A quantization means for quantizing;(4) encoding means for encoding the quantized data at the time n from the quantization means based on the quantization size at the time n; and (5) a quantum for each type of the quantization size. A plurality of multiplier data storage units describing the correspondence between the difference data and the multiplier data after encoding or encoding, and (6) multiplier data stored in the multiplier data storage unit selected at time n To obtain the quantization step width at time n + 1 by taking out the multiplier data corresponding to the difference data at time n and multiplying the quantization step width at time nA quantization step width control means;(7) According to the range to which the value of the predetermined parameter at time n belongs, the multiplier data storage unit determined in that range is selected at time n + 1, and the quantization size corresponding to the selected multiplier data storage unit is set to time n + 1 quantization sizeQuantizationsizeControl means,The encoded data by encoding is included in the output data, and the quantization step width and the quantization size are not included in the output data.
[0027]
DETAILED DESCRIPTION OF THE INVENTION
  Embodiments of the present invention will be described with reference to the drawings.
[0028]
  (A) First embodiment
  FIG. 1 is a functional block diagram for explaining a first embodiment of the present invention. Since the overall configuration of the encoding / decoding system in the present embodiment is the same as that of the general ADPCM encoding / decoding device in FIG. 2, detailed description of the overall operation is omitted. The functional block diagram for explaining the first embodiment of the present invention shown in FIG. 1 explains a quantizing portion 104 different from the conventional configuration shown in FIG.
[0029]
  Unlike the conventional method, this quantization part is a multiplier table used to determine the quantization step width of the next sample.LeThere are several types for 3-bit encoding, 4-bit encoding, and 5-bit encoding, and one of these is selected and used according to the quantization step width of the current sample.
[0030]
  In the ADPCM encoding / decoding device of this embodiment, quantization is performed.portion104 includes a quantization unit 405 for quantizing the prediction difference D (n), and a control signal for specifying the quantization size B (n) is supplied from the selector 407 to the quantization unit 405. The quantization unit 405 quantizes the input prediction difference D (n) with the quantization size B (n), and converts the quantization value Q (n), which is the output value, into a transmission code. To supply.
[0031]
  The encoding unit 406 is supplied with a control signal designating the quantization size B (n) from the selector 407 as in the quantization unit 405, and performs encoding with the quantization size B (n). The output of the encoding unit 406, that is, the code data L (n) is output to the transmission line and supplied to the ROM reading unit 402 to determine the quantization step width of the next sample.
[0032]
  The ROM reading unit 402 is connected to the multiplier tables 401a to 401c via the selector 407, and the multiplier data M (L (n)) according to the code data L (n) of the current sample supplied from the encoding unit 406. Is read from one of the multiplier tables 401 a to 401 c and supplied to one input of the multiplier 403.
[0033]
  The selector 407 is controlled by the quantization step width of the current sample held in the register 404, and selectively selects any one of the multiplier tables 401a to 401c according to the quantization step width Δ (n) of the current sample. Connected to the ROM reading unit 402.
[0034]
  The other input of the multiplier 403 is connected to the register 404, and the multiplier data M (L (n)) read from one of the multiplier tables 401 a to 401 c and the quantum of the current sample held in the register 404. The output is held in the register 404 by multiplying the step width Δ (n). The data newly held in the register 404 is used as the quantization step width Δ (n + 1) of the next sample.
[0035]
  The relationship between the quantized value Q (n), the encoded data L (n), and the multiplier data M (L (n)) is as shown in Tables 1 to 3 described above..
  Next, the operation will be described. The prediction difference D (n) at the nth sample is quantized by the quantization unit 405 to obtain quantized data Q (n). The quantization unit 405 uses the following expression to calculate the quantized data Q ((n) based on the quantization step width Δ (n) set in the register 404 and the control signal specifying the quantization size B (n) supplied from the selector 407. n).
[0036]
  Q (n) = {[D (n) / {Δ (n) / {B (n) / 4}}] + 2 / B (n)} × Δ (n)
However, [*] is the maximum integer that does not exceed the value in parentheses, and is limited to a range from the maximum value (B (n) / 2-1) to the minimum value (-B (n) / 2). . For example, in the case of 3-bit encoding (B (n) = 8), -4 to 3, and in the case of 4-bit encoding (B (n) = 16), -8 to 7, 5-bit encoding (B (n) = 32), an integer value in the range of -16 to 15 is obtained.
[0037]
  Accordingly, as is apparent from the above equation, the quantized output value Q (n) is −2 (B (n) −1) Δ (n) / B (n) to 2 (B (n) −1) Δ ( n) / B (n) in increments of 4Δ (n) / B (n)B(N) Kinds will be obtained. FIG. 4 shows the conversion relationship between the prediction difference D (n) and the quantized data Q (n) in the case of 4-bit encoding.
[0038]
  FIG.As you can see, 4-bit encoding outputs 16-value quantization values.StageIt can be seen that 16 types of quantization outputs of −15Δ (n) / 8 to −Δ (n) / 8 and Δ (n) / 8 to 15Δ (n) / 8 are obtained. For example, the prediction difference D (n) is
When 0 ≦ D (n) <2Δ (n) / 8, Q (n) = Δ (n) / 8
When 2Δ (n) / 8 ≦ D (n) <4Δ (n) / 8, Q (n) = 3Δ (n) / 8
That's how it said.
[0039]
  Next, the quantized data Q (n) is encoded with the quantization size B (n) in the encoding unit 406 to obtain code data L (n). These conversion relationships are as shown in Tables 1-3. The code data L (n) is transmitted to the transmission path 108 and used to obtain the quantization size B (n + 1) of the next sample.
[0040]
  The code data L (n) is used as a pointer of the ROM reading unit 402 and is passed through a selector table 407 through a multiplier table.Le 4Multiplier data M (L (n)) is read from any one of 01a to 401c. Which multiplier tableLeThe selector 407 determines whether to select. The selector 407 is a multiplier table based on the quantization step width Δ (n) of the current sample supplied from the register 404.LeMake a selection. An example is shown below.
[0041]
When 0 ≦ Δ (n) <16
    Quantization tableLe 4Select 01a (B (n) = 8)
When 16 ≦ Δ (n) <64
    Quantization tableLe 4Select 01b (B (n) = 16)
In the case of 64 ≦ Δ (n)
    Quantization tableLe 4Select 01c (B (n) = 32)
  Multiplier tableLeThe multiplier data M (L (n)) read out from the data is multiplied by the value of the register 404, that is, Δ (n) by the multiplier 403, and the multiplication result becomes the quantization step width Δ (n + 1) of the next sample.
[0042]
That is, Δ (n + 1) = M (L (n)) × Δ (n)IThe
[0043]
  Tables 1 to 3 show setting examples of the multiplier data M (L (n)). This set value works to increase the quantization step width Δ (n + 1) of the next sample when the absolute value of the prediction difference D (n) exceeds the absolute value of the quantization step width Δ (n); In this case, the quantization step width Δ (n + 1) of the next sample is set so as to decrease. That is, the quantization step width follows the fluctuation of the input sample value.
[0044]
  In the conventional ADPCM method, the quantization error is perceived in a portion where the level of the input sample is large or in a portion where the fluctuation of the sample containing many high frequency components is large.Therefore, in this embodiment,By changing the quantization size according to the value of the quantization step width as described above, that is, the quantization size is set to be large in the portion where the variation of the sample where the quantization error is conspicuous is large, and conversely, the quantization error is not so noticeable In a portion where there is little sample fluctuation, the sound quality can be improved while suppressing the average bit rate by setting the quantization size small.
[0045]
  As described above, in this embodiment, the portion of the sample that is less affected by the quantization error on the auditory level and the portion that the fluctuation value of the adjacent sample is smaller are low bits, and the level of the sample on which the influence of the quantization error is larger on the hearing. The part with a large value and the part with a large fluctuation value of adjacent samples are encoded with high bits, and the quantization size is determined only by the quantization step width of the current sample. There is no need for additional bits for designation, and the sound quality is improved without increasing the average bit rate.
[0046]
  For example, if the segmental signal-to-noise ratio is used as an index for objectively measuring sound quality, the following experimental results are obtained with a certain sample (piano music). Ie
  Conventional ADPCM method (3-bit encoding) 39.5 dB
  Conventional ADPCM method (4-bit encoding) 45.3 dB
  Conventional ADPCM method (5-bit encoding) 49.9 dB
  First embodimentADPCM method (average 4.2 bits) 47.5 dB
0.2 per sample(= 4.2-4)Just increase the bit information,4 bits2.2 compared to ADPCM encoding(= 47.5-45.3)dB was also able to improve the SN ratio. This is a sound quality very close to that of the conventional 5-bit ADPCM system in terms of hearing.
[0047]
  Also,Multiplier table aboveSelectionBy doing the following:
When 0 ≦ Δ (n) <16
    Quantization tableLe 4Select 01a (B (n) = 8)
16 ≦ Δ (n) <100in the case of
    Quantization tableLe 4Select 01b (B (n) = 16)
100≤ Δ (n)
    Quantization tableLe 4Select 01c (B (n) = 32)
By doingSame sample as above(Piano music)The following results were obtained. That is,
  First embodimentADPCM method (average 4.02 bits) 46.5 dB
It is.
[0048]
  like thisWith a simple quantization table selection methodIs almost the same bit rate as the conventional 4-bit ADPCM encoding method(4.02 bits)Despite this, the segmental signal-to-noise ratio is 1.2.(= 46.5-45.3)dB can also be improved.
[0049]
(B) Second embodiment
   Next, a second embodiment of the present invention will be described. The first embodiment has the effect of improving the sound quality without increasing the average bit rate, but it is difficult to determine the bit rate. For example, a certain music has an average bit rate of 4.2 bits, but another music has an average of 4.3 bits.
[0050]
  That is, there is a problem that the bit rate is not known unless encoding is completed. Since the bit rate is closely related to the transmission speed of the transmission path and the storage capacity of the storage medium, the first embodiment may be sufficient when physical restrictions on the transmission path and the storage medium are severe. There wasn't. Therefore, in the second embodiment, the sound quality is improved while the bit rate is determined.
[0051]
  A second embodiment will be described with reference to FIGS. FIG. 5 shows a functional block diagram of the ADPCM code decoding apparatus according to the second embodiment. This apparatus has a memory 501 for buffering input samples over several samples (20 to 30 samples) at the input of the encoder 514 on the encoding side A.
[0052]
  In this example, the description will be given with 30 samples. This number of samples is defined as one frame. That is, one frame is composed of 30 samples. The input samples once written in the memory are encoded by the encoder 514 sample by sample. The basic configuration of the encoder 514, the method for obtaining the predicted value XP (m, n), the configuration of the prediction filter 506, and the like are the same as in the first embodiment, but encoding is performed in units of frames described above. Is different.
[0053]
  The point that encoding is performed in units of frames with various parameters being changed, and data transmission is performed by selecting a parameter having the best sound quality or bit rate is different from the prior art or the first embodiment. It is.
[0054]
  Accordingly, the same frame is encoded several times with different parameters. For this purpose, a buffer of the memory 501 is prepared so that the operation can be performed in time for sample input. Also, the capacity of the memory 501 needs to be set to a size in time.
[0055]
  After encoding is performed in units of frames in this way, selection data S (m) and code data L (m, n), which are optimum parameters in the frame, are multiplexed by the multiplexer 507 and transmitted through the transmission path 508. To the decoding side B. Here, the transmission path is used, but a storage medium such as a RAM may be used when the transmission path is incorporated. The configuration of adaptive quantization section 503 is shown in FIG.
[0056]
  The difference from the first embodiment is that a selection table 608 and a counter 609 are newly added, a quantization error calculation unit 610, a determination unit 611, and registers B612, C613, and D614 for storing determination results. This is the point. Control of the selector 607 for selecting the multiplier tables 601a to 601c starts from the register A 604 in which the quantization step width Δ (m, n) is stored.ofThis is performed by the signal and the signal supplied from the selection table 608.
[0057]
  The input of the adaptive quantization unit 503 is a prediction difference D (m, n), and the output is a code data sequence L (m, n) (n = 0,... 29) and selection data S (m). . The adaptive quantization unit 503 has a quantization unit 605 for quantizing the prediction difference D (m, n) as an input, and a control signal specifying the quantization size B (m, n) is supplied from the selector 607. Has been.
[0058]
  The quantization unit 605 performs quantization with the quantization size B (m, n), and the output quantization value Q (m, n) is output to the encoding unit 606 for conversion to a transmission code. The Similar to the quantization unit 605, the encoding unit 606 is supplied with a control signal designating the quantization size B (m, n) from the selector 607, and the quantization size B (m, n).SignIs done.
[0059]
  The output of the encoding unit 606, that is, the code data L (m, n) is not transmitted at this time but is sent to the ROM reading unit 602 for use in determining the quantization step width of the next sample. The ROM reading unit 602 is connected to the selector 607, through which the multiplier data M (L (m, n)) is read from any one of the multiplier tables 601a to 601c, and the read result is displayed. , And supplied to one input of the multiplier 603.
[0060]
  The selector 607 selects the quantization step width Δ (m, n) of the current sample held in the register A 604 and the selection table.Le 6Controlled by the value of 08, one of the multiplier tables 601a to 601c is connected to the ROM reading unit 602 according to these values.
[0061]
  Selection tableLe 608 is controlled by the counter 609, and the value of the counter 609 is the selected table.Le 6The read address is 08. Therefore, when the value of the counter 609 is “3”, the selected tableLe 6Data corresponding to address “3” of 08 is selected tableLe 6The data is read from 08 and supplied to the selector 607 as a control signal for the selector 607.
[0062]
  The counter 609 is incremented by 1 every time encoding for one frame is completed, that is, every time 30 samples are encoded, and the selected table is selected.Le 6It increases by the data amount of 08. Selection tableLe 6In 08, several sets of threshold value data of the quantization step width Δ (m, n) stored in the register A are stored, and the counter 609 is increased by this number.
[0063]
  For example, select tableLe 6When 08 has the data structure shown in Table 4 below, there are 8 types of addresses from 0 to 7, so that the counter 609 is incremented by 1 from the initial value 0 for each frame, and the address becomes 1 only after the address encoding is completed. The encoding for the frame ends.
[0064]
[Table 4]
Figure 0003731993
  Now, the multiplier 603 has, SquaredSeveral tablesLe 6The multiplier data M (L (m, n)) obtained from the ROM reading unit 602 from 01a to 601c and the output value of the register A604 are input, and the result is written to the register A604 again. ing.
[0065]
  The data written in the register A 604 is used as a quantization step width Δ (m, n + 1) for the next sample. QuantizationdataThe relationship between Q (m, n), encoded data L (m, n), and multiplier data M (L (m, n)) is as shown in Tables 1-3..
  In the second embodiment, a quantization error calculation unit 610 is provided. This has a function of adding the absolute value of the difference between the prediction difference D (m, n) and the quantized data Q (m, n) by one frame (that is, 30 samples) and the quantum output from the selector 607. The normalized size B (m, n) also has a function of adding one frame.
[0066]
  These addition results are sent to the determination unit 611 when the calculation for one frame is completed. The determination unit 611 has three types of registers, a register B 612, a register C 613, and a register D 614. The determination unit 611 determines whether or not the transmitted data is an optimum value. The quantization error is stored in the register C613.
[0067]
  The determination of whether or not the value is optimal is greater than the current counter 609 value.,The criterion is whether the value is smaller than the previously obtained quantization error and within the desired bit rate range.
[0068]
  The register D614 stores the total number of bits from the start of sample input to the previous frame. Whether or not the bit rate is desired can be determined by referring to the value of this register.
[0069]
  Thus, in the second embodiment, the selection tableLe 6Using the parameters stored in 08, one frame (30 samples) is encoded to determine whether the quantization error is small and within the desired bit rate range. A configuration is adopted in which encoding is performed using the most optimal data among them.
[0070]
  On the decoder side B, the multiplexed data sent via the transmission path 508 is separated into a code data sequence L (m, n) and selection data S (m) by the demultiplexer 509 and supplied to the adaptive quantization unit 510. Is done.
[0071]
  FIG. 7 shows the configuration of adaptive quantization section 510.
[0072]
  The selection data S (m) is the selection table shown in FIG.Le 7The address pointer becomes 08. That is, the difference from the first embodiment is only whether the threshold value of the quantization step width for selecting the multiplier table is transmitted as data or is fixed, and the description thereof is omitted here.
[0073]
  The prediction difference D (m, n) at the nth sample of the mth frame is quantized by the quantization unit 605 to obtain quantized data Q (m, n). The quantization unit 605 obtains the quantized data from the quantization step width Δ (m, n) set in the register A 604 and the control signal B (m, n) representing the quantization size from the selector 607 according to the following equation. Q (m, n) is output.
[0074]
  Q (m, n) = {[D (m, n) / {Δ (m, n) / {B (m, n) / 4}}] + 2 / B (m, n)} × Δ (m, n)
However, [*] is the maximum integer that does not exceed the medium value and is limited to the range from the maximum value (B (m, n) / 2-1) to the minimum value (-B (m, n) / 2). The Next, the quantized data Q (m, n) is encoded by the encoding unit 606 with the quantization size B (m, n) to obtain code data L (m, n).
[0075]
  These relationships are as shown in Tables 1 to 3 above. The code data L (m, n) is used to obtain the quantization step width Δ (m, n + 1) of the next sample. L (m, n) is used as an address pointer of the ROM reading unit 602 and is multiplied by a multiplier table via a selector 607.Le 6Multiplier data M (L (m, n)) is read from any one of 01a, 601b, and 601c.
[0076]
  Which multiplier tableLeWhether the data is read from the register A604 determined by the selector 607 and the selection tableLe 6The selector 607 is driven by a signal from 08. Depending on the quantization step width Δ (m, n) of the current sample, the multiplier table is as follows:LeA selection is made.
[0077]
When 0 ≦ Δ (m, n) <TH1
    multiplierTableLe 6Select 01a (B (m, n) = 8)
When TH1 ≦ Δ (m, n) <TH2
    multiplierTableLe 601b is selected (B (m, n)) = 16)
When TH2 ≦ Δ (m, n)
    multiplierTableLe 6Select 01c (B (m, n) = 32)
Here, the set of (TH1, TH2) is data stored in the selection table ROM 608, as shown in Table 4. Selection tableLe 6Since 08 outputs data using the value of the counter 609 as an address pointer,
When the value of the counter 609 is 0, TH1 = 32768, TH2 = 32768
When the value of the counter 609 is 1, TH1 = 0, TH2 = 32768
And so on.
[0078]
  counter609In this case, the initial value is incremented by 1 in increments of 1 with the initial value being 0 and increases to 7. Therefore, the optimal solution is calculated by encoding (8 × 30 = 240) samples per frame. By the way, the selection tableLe 6Whenever the address of 08 is 0multiplierTableLe 601a is selected and is always address 1multiplierTableLe 601b is selected and is always address 2multiplierTableLe 601c is selected, otherwise three typesmultiplierTableLeOne is selected.
[0079]
  Multiplier tableLeThe data M (L (m, n)) read out from the register is multiplied by the value of the register A604, that is, Δ (m, n) by the multiplier 603 and stored again in the register A604, which is the quantization step width of the next sample. Δ (m, n + 1). Ie
Δ (m, n + 1) = M (L (m, n)) × Δ (m, n)
Examples of setting the multiplier data M (L (m, n)) are as shown in Tables 1-3.
[0080]
  When the absolute value of the prediction difference Q (m, n) exceeds the absolute value of the quantization step width Δ (m, n), the absolute value of the quantization step width Δ (m, n + 1) of the next sample is increased. Work in the direction, otherwiseDecreaseIt is set to work in the direction. That is, the quantization step width follows the fluctuation value of the input sample.
[0081]
  On the other hand, the quantization error calculation unit 610 calculates a cumulative quantization error εsum (m) and a cumulative bit Bsum (m) for each frame. Ie
  εsum (m) = Σabs (D (m, n) −Q (m, n))
  Bsum (m) = ΣB (m, n) +3
  However, in these two formulas, Σ represents the sum in the range from 0 to 29 for n.
[0082]
  In the formula for calculating the cumulative bit Bsum (m), (+3)The term is, The number of bits corresponding to the selection data S (m). In this case, it is because it is 2 3 to 0-7.
[0083]
  This result is sent to the determination unit 611 when the encoding process for one frame is completed. If the determination unit 611 is within the desired number of bits and the cumulative quantization error εsum (m) is minimum, the value of εsum (m) is stored in the register C613, and the value of the counter 609 at this time is stored in the register B612. To do. The data stored in the register B 612 after the frame processing is performed eight times in this way is the optimum selection table.LeIt becomes an address pointer. A series of encoding processes are performed again using this pointer value.
[0084]
  FIG.No, like the aboveADPCM of the second embodimentSignA flowchart of the conversion is shown.
[0085]
  Decoding is performed as follows.The counter 609 value with the smallest quantization error within the desired bit rate, that is, the data multiplexed and sent with the selection data S (m) is sent to the selection data S (m) and the code data by the demultiplexer. Decoding into L (m, n) is performed. Since the selection data S (m) is the same as that of the first embodiment except that the selector is controlled by the address data of the selection table 708 in FIG.
[0086]
  The flow of FIG. 8 will be briefly described. As shown in FIG. 8, steps 800 to 802 are initialization processes. Until the end of the sample input is determined in step 804, the processing for the m × n sample data is continued. In step 807, an initial value of 10e50 is set in the register (Reg) C, and the processing for every 8 bits from step 808 to step 814 is repeated.
[0087]
  Among them, the frame processing is a subroutine as shown in FIG. After performing the frame processing 810, the quantization error ε (n) is set in the register C except when the condition shown in step 811 or step 812 is not satisfied (step 813).,The counter value is set in register B (step 813).
[0088]
  When the processing for every 8 bits is completed, the value of the register B is set as a counter value in step 815 and the frame processing is performed once. Then, in step 817, the value of the register D is increased by the cumulative number of bits of the current frame.
[0089]
  As shown in FIG. 9, the frame processing includes calculation of a prediction difference D (m, n) (step 824), quantization (step 825), encoding (step 826),Multiplier tableRead out the multiplier (step 827), determine the quantization step width (step 828), calculate the quantization error ε (m) (step 829), and so on until n exceeds 30, that is, processing for one frame Repeat until is finished. In FIG. 8, bit means the total number of bits in the current frame, and BIT means the desired total number of bits per frame.
[0090]
  in this wayThe secondAccording to the second embodiment, in the audio compression method using the predictive coding technique, a portion with a small sample level or a portion with a small fluctuation value of an adjacent sample having a small influence on the audibility is low bits. In addition, the influence of quantization error on auditory perception is large, and the portion where the sample level is large or the portion where the fluctuation value of the adjacent sample is large is encoded with high bits, and the quantization error is within the desired number of bits. Since the bit allocation is performed so as to minimize the noise, it is possible to provide the highest sound quality at a predetermined bit rate.
[0091]
  In the first and second embodiments, the quantization sizes in Tables 1 to 3 are respectively quantized for 8-value, 16-value, and 32-value quantization.dataThe relationship between Q (n), code data L (n), and multiplier data M (L (n)) is shown.LimitedIt is not something. For example, quantizationdataAlthough Q (n) is equally spaced, nonlinear quantization may be used, and the encoded data L (n) is not limited to this. The value of multiplier data M (L (n)) is also created based on statistical data, and is merely an example. furtherMultiplier tableAlthough the numerical value of Δ (n) is shown as the selection condition of 601a to 601c, this is only an example, and other values may be used.
[0092]
  Further, the multiplier table is selected with the quantization step width Δ (n), but instead of this, the input value X (n), the prediction difference D (n), the encoded data L (n), or the quantized data is obtained. The configuration may be such that selection is performed using the prediction difference DQ (n), the sample data XP (n) after quantization, or the quantization error ε (n).
[0093]
  Furthermore, the data handled by the adaptive bit ADPCM encoding method and the adaptive bit ADPCM encoding apparatus of the present invention are not limited to the above-described audio data, and may be other types of digital data.
[0094]
【The invention's effect】
  As described above, according to the adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus of the present invention, it is possible to suppress an increase in quantization error while preventing the compression rate from deteriorating.
[Brief description of the drawings]
FIG. 1 is a functional block diagram illustrating a quantization portion of a first embodiment.
FIG. 2 is a block diagram showing an overall configuration of a conventional encoding / decoding system according to the present invention.
FIG. 3 is a functional block diagram illustrating a conventional quantization method.
FIG. 4 is a diagram illustrating a relationship between a signal level and a quantization value.
FIG. 5 is a block diagram showing an overall configuration of an encoding / decoding system according to a second embodiment.
FIG. 6 is a functional block diagram illustrating a quantization part of the second embodiment.
FIG. 7 is a functional block diagram illustrating a quantization part in a decoding unit according to the second embodiment.
FIG. 8 is a second embodiment.EncodingIt is a flowchart explaining operation | movement.
FIG. 9 is a second embodiment.EncodingIt is a flowchart explaining the frame process in operation | movement.
[Explanation of symbols]
  401a to 401c ... multiplier table, 402 ... ROM reading unit, 403 ... multiplier, 404 ... register, 405 ... quantization unit, 406 ... encoding unit, 407 ... selector, 601a-401c ... multiplier table, 602 ... ROM reading unit 603, a multiplier, 604, a register, 605, a quantization unit, 606, a coding unit, 607, a selector, 608, a selection table, 609, a counter, 610, a quantization error calculation unit, 611, a determination unit, 612, Register B, 612... Register C, 612.

Claims (11)

ディジタル入力データのある時刻nのサンプル値と適応予測フィルタで生成されたその時刻nの予測値との差分をとり、得られた差分データを、その時刻nでの量子化ステップ幅に基づいて、量子化し、符号化して出力する適応ビットADPCM符号化方法において、
量子化段階数である量子化サイズの種類ごとに、量子化又は符号化後の差分データと乗数データとの対応関係を記述している複数の乗数データ記憶部を備え、
時刻nで選択されている前記乗数データ記憶部に記憶されている乗数データの中から、時刻nの前記差分データに応じた乗数データを取り出して、時刻nの量子化ステップ幅に乗算することにより時刻n+1での量子化ステップ幅を得ると共に、
時刻nでの所定パラメータの値が属する範囲に応じ、その範囲で定まる前記乗数データ記憶部を時刻n+1で選択させ、かつ、選択された乗数データ記憶部に対応する量子化サイズを時刻n+1の量子化サイズとし、
符号化による符号データを出力データに含めると共に、量子化ステップ幅及び量子化サイズを出力データに含めない
事を特徴とする適応ビットADPCM符号化方法。
Taking a difference between a sample value at a certain time n in the digital input data and the predicted value at the time n generated by the adaptive prediction filter, and obtaining the obtained difference data based on the quantization step width at the time n, In an adaptive bit ADPCM encoding method for quantizing, encoding and outputting,
For each type of quantization size, which is the number of quantization steps, includes a plurality of multiplier data storage units describing the correspondence between the quantized or encoded difference data and the multiplier data,
By extracting multiplier data corresponding to the difference data at time n from the multiplier data stored in the multiplier data storage unit selected at time n, and multiplying the quantization step width at time n by While obtaining the quantization step width at time n + 1,
According to the range to which the value of the predetermined parameter at time n belongs, the multiplier data storage unit determined in that range is selected at time n + 1, and the quantization size corresponding to the selected multiplier data storage unit is set to the quantum at time n + 1 Size and
An adaptive bit ADPCM encoding method characterized by including code data obtained by encoding in output data and not including a quantization step width and a quantization size in output data .
請求項1において、
前記所定のパラメータが量子化ステップ幅である事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
Adaptive bit ADPCM coding method which the predetermined parameter, characterized in that the quantization step width.
請求項1において、
前記所定のパラメータがディジタル入力データのサンプル値である事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
An adaptive bit ADPCM encoding method, wherein the predetermined parameter is a sample value of digital input data .
請求項1において、
前記所定のパラメータが量子化前の差分データである事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
An adaptive bit ADPCM encoding method, wherein the predetermined parameter is differential data before quantization .
請求項1において、
前記所定のパラメータが符号データである事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
An adaptive bit ADPCM encoding method, wherein the predetermined parameter is code data .
請求項1において、
前記所定のパラメータが量子化サイズを前サンプルの符号化後の予測差分値であるに応じて変化させる事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
Adaptive bit ADPCM coding method which the predetermined parameter, characterized in that it is changed according to a predicted difference value after encoding of the previous sample quantization size.
請求項1において、
前記所定のパラメータが量子化後符号化前の差分データである事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
Adaptive bit ADPCM coding method which the predetermined parameter, characterized in that a differential data before encoding the quantized.
請求項1において、
前記所定のパラメータが量子化誤差である事を特徴とする適応ビットADPCM符号化方法。
In claim 1,
Adaptive bit ADPCM coding method which the predetermined parameter, characterized in that a quantization error.
請求項1ないし8のいずれかにおいて、
前記乗数データ記憶部の選択基準となる前記所定のパラメータの範囲を規定する範囲境界値であるパラメータしきい値の組合せのそれぞれについて、その組合せのパラメータしきい値を適用した場合における量子化誤差を、前記ディジタル入力データの複数サンプル値でなる同一フレームに対して求め、求めた量子化誤差が最小となるパラメータしきい値の組合せをそのフレームに適用するものに決定し、
決定されたパラメータしきい値の組合せを適用して、量子化、符号化を行うと共に、フレーム毎に、適用したパラメータしきい値の組合せの情報をも出力データに含める
事を特徴とする適応ビットADPCM符号化方法。
In any one of claims 1 to 8,
For each combination of parameter threshold values that are range boundary values that define a range of the predetermined parameter that is a selection criterion of the multiplier data storage unit, a quantization error when the parameter threshold value of the combination is applied , Determined for the same frame consisting of a plurality of sample values of the digital input data , determined to apply to the frame a combination of parameter thresholds that minimize the obtained quantization error ,
An adaptive bit characterized in that the determined parameter threshold combination is applied to perform quantization and encoding, and for each frame, information on the applied parameter threshold combination is also included in the output data. ADPCM encoding method.
時刻nでのディジタル入力データのサンプル値と予測値との差分を取り差分データを出力する差分手段と、
前記予測値を生成する適応予測フィルタと、
時刻nの前記差分データを、時刻nでの量子化ステップ幅、及び、時刻nでの量子化段階数である量子化サイズに基づいて、量子化する量子化手段と、
前記量子化手段からの時刻nでの量子化データを、時刻nでの量子化サイズに基づいて、符号化する符号化手段と、
前記量子化サイズの種類ごとに、量子化又は符号化後の差分データと乗数データとの対応関係を記述している複数の乗数データ記憶部と、
時刻nで選択されている前記乗数データ記憶部に記憶されている乗数データの中から、時刻nの前記差分データに応じた乗数データを取り出して、時刻nの量子化ステップ幅に乗算することにより時刻n+1での量子化ステップ幅を得る量子化ステップ幅制御手段と、
時刻nでの所定パラメータの値が属する範囲に応じ、その範囲で定まる前記乗数データ記憶部を時刻n+1で選択させ、かつ、選択された乗数データ記憶部に対応する量子化サイズを時刻n+1の量子化サイズとする量子化サイズ制御手段とを備え、
符号化による符号データを出力データに含めると共に、量子化ステップ幅及び量子化サイズを出力データに含めない
事を特徴とする適応ビットADPCM符号化装置。
Difference means for taking the difference between the sample value and the predicted value of the digital input data at time n and outputting difference data ;
An adaptive prediction filter for generating the prediction value;
Quantization means for quantizing the difference data at time n based on a quantization step width at time n and a quantization size that is the number of quantization steps at time n ;
Encoding means for encoding the quantized data at time n from the quantization means based on the quantization size at time n;
For each type of quantization size, a plurality of multiplier data storage units that describe the correspondence between the quantized or encoded difference data and multiplier data;
By extracting multiplier data corresponding to the difference data at time n from the multiplier data stored in the multiplier data storage unit selected at time n, and multiplying the quantization step width at time n by Quantization step width control means for obtaining a quantization step width at time n + 1 ;
According to the range to which the value of the predetermined parameter at time n belongs, the multiplier data storage unit determined in that range is selected at time n + 1, and the quantization size corresponding to the selected multiplier data storage unit is set to the quantum at time n + 1 A quantization size control means for converting to a normalized size ,
Code data by encoding is included in output data, and quantization step width and quantization size are not included in output data.
An adaptive bit ADPCM encoding device characterized by the above.
請求項10において、
前記乗数データ記憶部の選択基準となる前記所定のパラメータの範囲を規定する範囲境界値であるパラメータしきい値の組合せのそれぞれについて、その組合せのパラメータしきい値を適用した場合における量子化誤差を、前記ディジタル入力データの複数サンプル値でなる同一フレームに対して求め、求めた量子化誤差が最小となるパラメータしきい値の組合せをそのフレームに適用するものに決定し、決定したパラメータしきい値の組合せを適用させて、量子化、符号化を実行させるしきい値選択手段と、
フレーム毎に決定されたパラメータしきい値の組合せの情報を、符号データに多重して出力データとする信号多重化手段
さらに有する事を特徴とする適応ビットADPCM符号化装置。
In claim 10 ,
For each combination of parameter threshold values that are range boundary values that define a range of the predetermined parameter that is a selection criterion of the multiplier data storage unit, a quantization error when the parameter threshold value of the combination is applied The parameter threshold value is determined for the same frame composed of a plurality of sample values of the digital input data, the combination of the parameter threshold values that minimizes the obtained quantization error is applied to the frame, and the determined parameter threshold value Threshold selection means for executing quantization and encoding by applying a combination of
Information of a combination of the determined parameter threshold for each frame, adaptive, characterized in that it further comprises a signal multiplexing means to multiplex and output the data to the code data bit ADPCM encoder.
JP31706097A 1997-11-18 1997-11-18 Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus Expired - Fee Related JP3731993B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31706097A JP3731993B2 (en) 1997-11-18 1997-11-18 Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31706097A JP3731993B2 (en) 1997-11-18 1997-11-18 Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus

Publications (2)

Publication Number Publication Date
JPH11150480A JPH11150480A (en) 1999-06-02
JP3731993B2 true JP3731993B2 (en) 2006-01-05

Family

ID=18083980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31706097A Expired - Fee Related JP3731993B2 (en) 1997-11-18 1997-11-18 Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus

Country Status (1)

Country Link
JP (1) JP3731993B2 (en)

Also Published As

Publication number Publication date
JPH11150480A (en) 1999-06-02

Similar Documents

Publication Publication Date Title
JP6207404B2 (en) How to enhance the performance of coding systems that use high-frequency reconstruction methods
US5299240A (en) Signal encoding and signal decoding apparatus
JP4219551B2 (en) Method and apparatus for encoding a signal based on a perceptual model
KR100840439B1 (en) Audio coding apparatus and audio decoding apparatus
US6028541A (en) Lossless data compression with low complexity
US6121904A (en) Lossless data compression with low complexity
US20030215013A1 (en) Audio encoder with adaptive short window grouping
JPH08190764A (en) Method and device for processing digital signal and recording medium
IL158102A (en) Scalable audio/coding method and apparatus
JP2796673B2 (en) Digital coding method
JPH05122166A (en) Method of coding signal
US6009386A (en) Speech playback speed change using wavelet coding, preferably sub-band coding
JP5446013B2 (en) Coding apparatus and decoding apparatus for adaptive differential pulse code modulation
US5524170A (en) Vector-quantizing device having a capability of adaptive updating of code book
US6212495B1 (en) Coding method, coder, and decoder processing sample values repeatedly with different predicted values
JPS6175623A (en) Encoding method
JP3731993B2 (en) Adaptive bit ADPCM encoding method and adaptive bit ADPCM encoding apparatus
JP2000151413A (en) Method for allocating adaptive dynamic variable bit in audio encoding
JP2965788B2 (en) Audio gain control device and audio recording / reproducing device
JP3301886B2 (en) Variable rate speech coding method and apparatus
JP2001148632A (en) Encoding device, encoding method and recording medium
JPH0888525A (en) Automatic gain controller by detection of silent tone
JP3269089B2 (en) Speech synthesizer
JP3747357B2 (en) Music signal encoding apparatus and decoding apparatus
JPS6235680B2 (en)

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040827

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050708

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050719

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050920

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051011

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20091021

Year of fee payment: 4

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20091021

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20091021

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101021

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees