Welcome to mirror list, hosted at ThFree Co, Russian Federation.

draft-valin-codec-prototype.xml « doc - gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 46fdb8fce2d862b56dd658922afb20e164dc6edb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc toc="yes" symrefs="yes" ?>

<rfc ipr="trust200902" category="std" docName="draft-valin-codec-prototype-00">

<front>
<title abbrev="Codec Prototype">Prototype for IETF Interactive Audio Codec</title>


<author initials="JM" surname="Valin" fullname="Jean-Marc Valin">
<organization>Octasic Inc.</organization>
<address>
<postal>
<street>4101, Molson Street</street>
<city>Montreal</city>
<region>Quebec</region>
<code></code>
<country>Canada</country>
</postal>
<phone>+1 514 383-8858</phone>
<email>jean-marc.valin@octasic.com</email>
</address>
</author>

<author initials="K." surname="Vos" fullname="Koen Vos">
<organization>Skype Technologies S.A.</organization>
<address>
<postal>
<street>Stadsgaarden 6</street>
<city>Stockholm</city>
<region></region>
<code>11645</code>
<country>SE</country>
</postal>
<phone>+46 855 921 989</phone>
<email>koen.vos@skype.net</email>
</address>
</author>


<date day="5" month="July" year="2010" />

<area>General</area>

<workgroup></workgroup>

<abstract>
<t>
This document provides a quick overview of a prototype codec combining a linear
prediction layer (SILK) with an MDCT-based layer (CELT).
These codecs are
used because of the authors' familiarity with the source code, but it does
not prevent inclusion of code from other codecs as well. This is a
work in progress.
</t>
</abstract>
</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>
We propose a hybrid codec based on a linear prediction layer (LP) and an
MDCT-based enhancement layer. The main idea behind the proposal is that
the speech low frequencies are usually more efficiently coded using
linear prediction codecs (such as CELP variants), while the higher frequencies
are more efficiently coded in the transform domain (e.g. MDCT). For low 
sampling rates, the MDCT layer is not useful and only the LP-based layer is
used. On the other hand, non-speech signals are sometimes adequately coded
using linear prediction, so for music only the MDCT-based layer is used.
</t>

<t>
In this proposed prototype, the LP layer is based on the 
<eref target='http://developer.skype.com/silk'>SILK</eref> codec 
<xref target="SILK"></xref> and the MDCT layer is based on the 
<eref target='http://www.celt-codec.org/'>CELT</eref>  codec
 <xref target="CELT"></xref>. These codecs are
used because of the authors' familiarity with the source code, but it does
not prevent inclusion of code from other codecs in the future.
</t>

<t>This is a work in progress.</t>
</section>

<section anchor="hybrid" title="Hybrid Codec">

<t>
In hybrid mode, each frame is coded first by the LP layer and then by the MDCT 
layer. In the current prototype, the cutoff frequency is 8 kHz. In the MDCT
layer, all bands below 8 kHz are discarded, such that there is no coding
redundancy between the two layers. Also both layers use the same instance of 
the range coder to encode the signal, which ensures that no "padding bits" are
wasted. The hybrid approach makes it easy to support both constant bit-rate
(CBR) and varaible bit-rate (VBR) coding. Although the SILK layer used is VBR,
it is easy to make the bit allocation of the CELT layer produce a final stream
that is CBR by using all the bits left unused by the SILK layer.
</t>

<t>The implementation of SILK-based LP layer is as described in the
<xref target="SILK">SILK Internet-Draft</xref> with the main exception that 
SILK was modified to 
use the same range coder as CELT. The implementation of the CELT-based MDCT
layer is available from the CELT website and is a more recent version (0.8.0) 
of the (now expired) <xref target="CELT">CELT Internet-Draft</xref>. 
The main changes
include better support for 20 ms frames as well as the ability to encode 
only the higher bands using a range coder partially filled by the SILK layer.</t>
<section title="Source Code">
<t>
The source code is currently available in a
<eref target='git://git.xiph.org/users/jm/ietfcodec.git'>Git repository</eref> 
which references two other
repositories (for SILK and CELT). Some snapshots will be provided for 
convenience at <eref target='http://people.xiph.org/~jm/ietfcodec/'/>.
Although the build system is very primitive
(and inconsistent), some instructions are provided in the toplevel README file.
This is very early development so both the quality and feature set should
greatly improve over time. In the current version, only 48 kHz audio with 20 ms
frames are supported, but support for all configurations listed in 
<xref target="modes"></xref> is planned. 
</t>
</section>

</section>

<section anchor="modes" title="Codec Modes">
<t>
There are three possible operating modes for the proposed prototype:
<list style="numbers">
<t>A linear prediction (LP) mode for use in low bit-rate connections with up to 8 kHz audio bandwidth (16 kHz sampling rate)</t>
<t>A hybrid (LP+MDCT) mode for full-bandwidth speech at medium bitrates</t>
<t>An MDCT-only mode for very low delay speech transmission as well as music transmission.</t>
</list>
Each of these modes supports a number of difference frame sizes and sampling
rates. In order to distinguish between the various modes and configurations,
we need to define a simple header that can used in the transport layer 
(e.g RTP) to signal this information. The following describes the proposed
header.
</t>

<t>
The LP mode supports the following configurations (numbered from 00000...01011 in binary):
<list style="symbols">
<t>16 kHz: 10, 20, 40, 60 ms (00000...00011)</t>
<t>12 kHz: 10, 20, 40, 60 ms (00100...00111)</t>
<t>8 kHz:  10, 20, 40, 60 ms (01000...01011)</t>
</list>
for a total of 12 configurations.
</t>

<t>
The hybrid mode supports the following configurations (numbered from 01100...01111):
<list style="symbols">
<t>48 kHz: 10, 20 ms (01100...01101)</t>
<t>32 kHz: 10, 20 ms (01110...01111)</t>
</list>
for a total of 4 configurations.
</t>

<t>
The MDCT-only mode supports the following configurations (numbered from 10000...11101):
<list style="symbols">
<t>48 kHz: 2.5, 5, 10, 20 ms (10000...10011)</t>
<t>32 kHz: 2.5, 5, 10, 20 ms (10100...10111)</t>
<t>16 kHz:      5, 10, 20 ms (11000...11010)</t>
<t>8 kHz:       5, 10, 20 ms (11011...11101)</t>
</list>
for a total of 14 configurations.
</t>

<t>
There is thus a total of 30 configurations, so 5 bits are necessary (with 2 codes unused) to 
indicate the mode, frame size and sampling rate (MFS). This leaves 3 bits for the number of frames per packets (codes 0 to 7):
<list style="symbols">
<t>0-3:  1-4 frames in the packet, each with equal compressed size</t>
<t>4-6:  1-3 frames in the packet, with different compressed sizes, which need to be encoded</t>
<t>7:     The first frame has this MFS, but others have different MFS. Compressed sizes need to be encoded.</t>
</list>
</t>

<t>
The compressed size of the frames (if needed) is indicated -- usually -- with one byte, with the following meaning:
<list style="symbols">
<t>0:          No frame (DTX)</t>
<t>1-251:    Size of the frame in bytes</t>
<t>252-255: A second byte is needed. The total size is (size[1]*4)+(size[0]%4)+252</t>
</list>
</t>

<t>
The maximum size representable is 255*4+3+252=1275 bytes. For 20 ms frames, that 
represents a bit-rate of 510 kb/s, which is really the highest rate anyone would want 
to use in stereo mode (beyond that point, lossless codecs would be more appropriate).
</t>

<section anchor="examples" title="Examples">
<t>
Simplest case: one packet
</t>

<t>
<figure>
<artwork><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MFS   |0|0|0|               compressed data...              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>

<t>
Four frames of the same compressed size:
</t>

<t>
<figure>
<artwork><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MFS   |0|1|1|               compressed data...              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>

<t>
Two frames of different compressed size:
</t>

<t>
<figure>
<artwork><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MFS   |1|0|1|   frame size  |        compressed data...     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>

<t>
Three frames of different *durations*:

</t>

<t>
<figure>
<artwork><![CDATA[
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 1st MFS |1|1|1|   frame size  | 2nd MFS |1|1|1|   frame size  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 3rd MFS |1|1|1|   frame size  |      compressed data...       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
</figure>
</t>
</section>


</section>

<section anchor="security" title="Security Considerations">

<t>
The codec needs to take appropriate
security considerations into account, for example as outlined in 
<xref target="DOS"/> and <xref target="SECGUIDE"/>.
</t>

</section> 


<section title="IANA Considerations ">
<t>
This document has no actions for IANA.
</t>
</section>

<!--
<section anchor="Acknowledgments" title="Acknowledgments">
<t>
</t>
</section> 
-->

</middle>

<back>

<references title="Informative References">

<reference anchor='SILK'>
<front>
<title>SILK Speech Codec</title>
<author initials='K.' surname='Koen' fullname='K. Vos'>
<organization /></author>
<author initials='S.' surname='Soeren Skak' fullname='S. Jensen'>
<organization /></author>
<author initials='K.' surname='Karsten Vandborg' fullname='K. Soerensen'>
<organization /></author>
<date year='2010' month='March' />
<abstract>
<t></t>
</abstract></front>
<seriesInfo name='Internet-Draft' value='draft-vos-silk-01' />
<format type='TXT' target='http://tools.ietf.org/html/draft-vos-silk-01' />
</reference>

<reference anchor='CELT'>
<front>
<title>Constrained-Energy Lapped Transform (CELT) Codec</title>
<author initials='J.' surname='Jean-Marc' fullname='J. Valin'>
<organization /></author>
<author initials='T.' surname='Timothy' fullname='T. Terriberry'>
<organization /></author>
<author initials='G.' surname='Gregory' fullname='G. Maxwell'>
<organization /></author>
<author initials='C.' surname='Christopher' fullname='C. Montgomery'>
<organization /></author>
<date year='2009' month='July' />
<abstract>
<t></t>
</abstract></front>
<seriesInfo name='Internet-Draft' value='draft-valin-celt-codec-01' />
<format type='TXT' target='http://tools.ietf.org/html/draft-valin-celt-codec-01' />
</reference>

<reference anchor='DOS'>
<front>
<title>Internet Denial-of-Service Considerations</title>
<author initials='M.' surname='Handley' fullname='M. Handley'>
<organization /></author>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
<organization /></author>
<author>
<organization>IAB</organization></author>
<date year='2006' month='December' />
<abstract>
<t>This document provides an overview of possible avenues for denial-of-service (DoS) attack on Internet systems.  The aim is to encourage protocol designers and network engineers towards designs that are more robust.  We discuss partial solutions that reduce the effectiveness of attacks, and how some solutions might inadvertently open up alternative vulnerabilities.  This memo provides information for the Internet community.</t></abstract></front>
<seriesInfo name='RFC' value='4732' />
<format type='TXT' octets='91844' target='ftp://ftp.isi.edu/in-notes/rfc4732.txt' />
</reference>

<reference anchor='SECGUIDE'>
<front>
<title>Guidelines for Writing RFC Text on Security Considerations</title>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
<organization /></author>
<author initials='B.' surname='Korver' fullname='B. Korver'>
<organization /></author>
<date year='2003' month='July' />
<abstract>
<t>All RFCs are required to have a Security Considerations section.  Historically, such sections have been relatively weak.  This document provides guidelines to RFC authors on how to write a good Security Considerations section.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract></front>

<seriesInfo name='BCP' value='72' />
<seriesInfo name='RFC' value='3552' />
<format type='TXT' octets='110393' target='ftp://ftp.isi.edu/in-notes/rfc3552.txt' />
</reference>


</references> 

</back>

</rfc>