(原文)
If you use the ADPCM coder to build network packets and
you want your protocol to be stateless (i.e. to be able
to tolerate packet loss) you should not only transmit
the data but also the state. Note that you should send
the initial state (the one you passed to lin2adpcm())
along to the decoder, not the final state (as returned
by the coder).
(原文)
If you use the ADPCM coder to build network packets and
you want your protocol to be stateless (i.e. to be able
to tolerate packet loss) you should not only transmit
the data but also the state. Note that you should send
the initial state (the one you passed to lin2adpcm())
along to the decoder, not the final state (as returned
by the coder).
(現状)
もしネットワークパケットを構築してADPCMフォーマットを
使って、プロトコールの説明なしにしたいなら(つまりパ
ケットの損失を我慢できるなら)、データだけでなくstateも
送信するべきです。注意してほしいのは、(コーダーによっ
て返される)最後のstateでなく、initialのstate
(lin2adpcm()に渡す引数)をコーダーに渡すことです。
(参考訳)
もしADPCMコーダを使って(パケットロスに耐えるために)
statelessなネットワークプロトコルを作りたいなら、データ
だけではなく、stateも送る必要があります。デコーダに送る
のは、初期state(lin2adpcm()に渡す値)であって、最終state
(lin2adpcm()が返す値)ではないことに注意してください。
---
老婆心ながら付け加えると、statelessなプロトコルとは、あ
るメッセージ(パケット)が文脈(以前のメッセージ)に依
存しないプロトコルのことです。
つまり、パケットに差分のデータを送るだけでは以前のデー
タが必要になる(文脈依存になる)ので、stateをつけること
でパケットひとつで完結するようにしましょう、ということ
です。