00001 <?xml version="1.0" standalone="no"?> 00002 <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 00003 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ 00004 00005 ]> 00006 00007 <section id="vorbis-spec-intro"> 00008 <sectioninfo> 00009 <releaseinfo> 00010 $Id: 01-introduction.xml 7186 2004-07-20 07:19:25Z xiphmont $ 00011 </releaseinfo> 00012 </sectioninfo> 00013 <title>Introduction and Description</title> 00014 00015 <section> 00016 <title>Overview</title> 00017 00018 <para> 00019 This document provides a high level description of the Vorbis codec's 00020 construction. A bit-by-bit specification appears beginning in 00021 <xref linkend="vorbis-spec-codec"/>. 00022 The later sections assume a high-level 00023 understanding of the Vorbis decode process, which is 00024 provided here.</para> 00025 00026 <section> 00027 <title>Application</title> 00028 <para> 00029 Vorbis is a general purpose perceptual audio CODEC intended to allow 00030 maximum encoder flexibility, thus allowing it to scale competitively 00031 over an exceptionally wide range of bitrates. At the high 00032 quality/bitrate end of the scale (CD or DAT rate stereo, 16/24 bits) 00033 it is in the same league as MPEG-2 and MPC. Similarly, the 1.0 00034 encoder can encode high-quality CD and DAT rate stereo at below 48kbps 00035 without resampling to a lower rate. Vorbis is also intended for 00036 lower and higher sample rates (from 8kHz telephony to 192kHz digital 00037 masters) and a range of channel representations (monaural, 00038 polyphonic, stereo, quadraphonic, 5.1, ambisonic, or up to 255 00039 discrete channels). 00040 </para> 00041 </section> 00042 00043 <section> 00044 <title>Classification</title> 00045 <para> 00046 Vorbis I is a forward-adaptive monolithic transform CODEC based on the 00047 Modified Discrete Cosine Transform. The codec is structured to allow 00048 addition of a hybrid wavelet filterbank in Vorbis II to offer better 00049 transient response and reproduction using a transform better suited to 00050 localized time events. 00051 </para> 00052 </section> 00053 00054 <section> 00055 <title>Assumptions</title> 00056 00057 <para> 00058 The Vorbis CODEC design assumes a complex, psychoacoustically-aware 00059 encoder and simple, low-complexity decoder. Vorbis decode is 00060 computationally simpler than mp3, although it does require more 00061 working memory as Vorbis has no static probability model; the vector 00062 codebooks used in the first stage of decoding from the bitstream are 00063 packed in their entirety into the Vorbis bitstream headers. In 00064 packed form, these codebooks occupy only a few kilobytes; the extent 00065 to which they are pre-decoded into a cache is the dominant factor in 00066 decoder memory usage. 00067 </para> 00068 00069 <para> 00070 Vorbis provides none of its own framing, synchronization or protection 00071 against errors; it is solely a method of accepting input audio, 00072 dividing it into individual frames and compressing these frames into 00073 raw, unformatted 'packets'. The decoder then accepts these raw 00074 packets in sequence, decodes them, synthesizes audio frames from 00075 them, and reassembles the frames into a facsimile of the original 00076 audio stream. Vorbis is a free-form variable bit rate (VBR) codec and packets have no 00077 minimum size, maximum size, or fixed/expected size. Packets 00078 are designed that they may be truncated (or padded) and remain 00079 decodable; this is not to be considered an error condition and is used 00080 extensively in bitrate management in peeling. Both the transport 00081 mechanism and decoder must allow that a packet may be any size, or 00082 end before or after packet decode expects.</para> 00083 00084 <para> 00085 Vorbis packets are thus intended to be used with a transport mechanism 00086 that provides free-form framing, sync, positioning and error correction 00087 in accordance with these design assumptions, such as Ogg (for file 00088 transport) or RTP (for network multicast). For purposes of a few 00089 examples in this document, we will assume that Vorbis is to be 00090 embedded in an Ogg stream specifically, although this is by no means a 00091 requirement or fundamental assumption in the Vorbis design.</para> 00092 00093 <para> 00094 The specification for embedding Vorbis into 00095 an Ogg transport stream is in <xref linkend="vorbis-over-ogg"/>. 00096 </para> 00097 00098 </section> 00099 00100 <section> 00101 <title>Codec Setup and Probability Model</title> 00102 00103 <para> 00104 Vorbis' heritage is as a research CODEC and its current design 00105 reflects a desire to allow multiple decades of continuous encoder 00106 improvement before running out of room within the codec specification. 00107 For these reasons, configurable aspects of codec setup intentionally 00108 lean toward the extreme of forward adaptive.</para> 00109 00110 <para> 00111 The single most controversial design decision in Vorbis (and the most 00112 unusual for a Vorbis developer to keep in mind) is that the entire 00113 probability model of the codec, the Huffman and VQ codebooks, is 00114 packed into the bitstream header along with extensive CODEC setup 00115 parameters (often several hundred fields). This makes it impossible, 00116 as it would be with MPEG audio layers, to embed a simple frame type 00117 flag in each audio packet, or begin decode at any frame in the stream 00118 without having previously fetched the codec setup header. 00119 </para> 00120 00121 <note><para> 00122 Vorbis <emphasis>can</emphasis> initiate decode at any arbitrary packet within a 00123 bitstream so long as the codec has been initialized/setup with the 00124 setup headers.</para></note> 00125 00126 <para> 00127 Thus, Vorbis headers are both required for decode to begin and 00128 relatively large as bitstream headers go. The header size is 00129 unbounded, although for streaming a rule-of-thumb of 4kB or less is 00130 recommended (and Xiph.Org's Vorbis encoder follows this suggestion).</para> 00131 00132 <para> 00133 Our own design work indicates the primary liability of the 00134 required header is in mindshare; it is an unusual design and thus 00135 causes some amount of complaint among engineers as this runs against 00136 current design trends (and also points out limitations in some 00137 existing software/interface designs, such as Windows' ACM codec 00138 framework). However, we find that it does not fundamentally limit 00139 Vorbis' suitable application space.</para> 00140 00141 </section> 00142 00143 <section><title>Format Specification</title> 00144 <para> 00145 The Vorbis format is well-defined by its decode specification; any 00146 encoder that produces packets that are correctly decoded by the 00147 reference Vorbis decoder described below may be considered a proper 00148 Vorbis encoder. A decoder must faithfully and completely implement 00149 the specification defined below (except where noted) to be considered 00150 a proper Vorbis decoder.</para> 00151 </section> 00152 00153 <section><title>Hardware Profile</title> 00154 <para> 00155 Although Vorbis decode is computationally simple, it may still run 00156 into specific limitations of an embedded design. For this reason, 00157 embedded designs are allowed to deviate in limited ways from the 00158 'full' decode specification yet still be certified compliant. These 00159 optional omissions are labelled in the spec where relevant.</para> 00160 </section> 00161 00162 </section> 00163 00164 <section> 00165 <title>Decoder Configuration</title> 00166 00167 <para> 00168 Decoder setup consists of configuration of multiple, self-contained 00169 component abstractions that perform specific functions in the decode 00170 pipeline. Each different component instance of a specific type is 00171 semantically interchangeable; decoder configuration consists both of 00172 internal component configuration, as well as arrangement of specific 00173 instances into a decode pipeline. Componentry arrangement is roughly 00174 as follows:</para> 00175 00176 <mediaobject> 00177 <imageobject> 00178 <imagedata fileref="components.png" format="PNG"/> 00179 </imageobject> 00180 <textobject> 00181 <phrase>decoder pipeline configuration</phrase> 00182 </textobject> 00183 </mediaobject> 00184 00185 <section><title>Global Config</title> 00186 <para> 00187 Global codec configuration consists of a few audio related fields 00188 (sample rate, channels), Vorbis version (always '0' in Vorbis I), 00189 bitrate hints, and the lists of component instances. All other 00190 configuration is in the context of specific components.</para> 00191 </section> 00192 00193 <section><title>Mode</title> 00194 00195 <para> 00196 Each Vorbis frame is coded according to a master 'mode'. A bitstream 00197 may use one or many modes.</para> 00198 00199 <para> 00200 The mode mechanism is used to encode a frame according to one of 00201 multiple possible methods with the intention of choosing a method best 00202 suited to that frame. Different modes are, e.g. how frame size 00203 is changed from frame to frame. The mode number of a frame serves as a 00204 top level configuration switch for all other specific aspects of frame 00205 decode.</para> 00206 00207 <para> 00208 A 'mode' configuration consists of a frame size setting, window type 00209 (always 0, the Vorbis window, in Vorbis I), transform type (always 00210 type 0, the MDCT, in Vorbis I) and a mapping number. The mapping 00211 number specifies which mapping configuration instance to use for 00212 low-level packet decode and synthesis.</para> 00213 00214 </section> 00215 00216 <section><title>Mapping</title> 00217 00218 <para> 00219 A mapping contains a channel coupling description and a list of 00220 'submaps' that bundle sets of channel vectors together for grouped 00221 encoding and decoding. These submaps are not references to external 00222 components; the submap list is internal and specific to a mapping.</para> 00223 00224 <para> 00225 A 'submap' is a configuration/grouping that applies to a subset of 00226 floor and residue vectors within a mapping. The submap functions as a 00227 last layer of indirection such that specific special floor or residue 00228 settings can be applied not only to all the vectors in a given mode, 00229 but also specific vectors in a specific mode. Each submap specifies 00230 the proper floor and residue instance number to use for decoding that 00231 submap's spectral floor and spectral residue vectors.</para> 00232 00233 <para> 00234 As an example:</para> 00235 00236 <para> 00237 Assume a Vorbis stream that contains six channels in the standard 5.1 00238 format. The sixth channel, as is normal in 5.1, is bass only. 00239 Therefore it would be wasteful to encode a full-spectrum version of it 00240 as with the other channels. The submapping mechanism can be used to 00241 apply a full range floor and residue encoding to channels 0 through 4, 00242 and a bass-only representation to the bass channel, thus saving space. 00243 In this example, channels 0-4 belong to submap 0 (which indicates use 00244 of a full-range floor) and channel 5 belongs to submap 1, which uses a 00245 bass-only representation.</para> 00246 00247 </section> 00248 00249 <section><title>Floor</title> 00250 00251 <para> 00252 Vorbis encodes a spectral 'floor' vector for each PCM channel. This 00253 vector is a low-resolution representation of the audio spectrum for 00254 the given channel in the current frame, generally used akin to a 00255 whitening filter. It is named a 'floor' because the Xiph.Org 00256 reference encoder has historically used it as a unit-baseline for 00257 spectral resolution.</para> 00258 00259 <para> 00260 A floor encoding may be of two types. Floor 0 uses a packed LSP 00261 representation on a dB amplitude scale and Bark frequency scale. 00262 Floor 1 represents the curve as a piecewise linear interpolated 00263 representation on a dB amplitude scale and linear frequency scale. 00264 The two floors are semantically interchangeable in 00265 encoding/decoding. However, floor type 1 provides more stable 00266 inter-frame behavior, and so is the preferred choice in all 00267 coupled-stereo and high bitrate modes. Floor 1 is also considerably 00268 less expensive to decode than floor 0.</para> 00269 00270 <para> 00271 Floor 0 is not to be considered deprecated, but it is of limited 00272 modern use. No known Vorbis encoder past Xiph.org's own beta 4 makes 00273 use of floor 0.</para> 00274 00275 <para> 00276 The values coded/decoded by a floor are both compactly formatted and 00277 make use of entropy coding to save space. For this reason, a floor 00278 configuration generally refers to multiple codebooks in the codebook 00279 component list. Entropy coding is thus provided as an abstraction, 00280 and each floor instance may choose from any and all available 00281 codebooks when coding/decoding.</para> 00282 00283 </section> 00284 00285 <section><title>Residue</title> 00286 <para> 00287 The spectral residue is the fine structure of the audio spectrum 00288 once the floor curve has been subtracted out. In simplest terms, it 00289 is coded in the bitstream using cascaded (multi-pass) vector 00290 quantization according to one of three specific packing/coding 00291 algorithms numbered 0 through 2. The packing algorithm details are 00292 configured by residue instance. As with the floor components, the 00293 final VQ/entropy encoding is provided by external codebook instances 00294 and each residue instance may choose from any and all available 00295 codebooks.</para> 00296 </section> 00297 00298 <section><title>Codebooks</title> 00299 00300 <para> 00301 Codebooks are a self-contained abstraction that perform entropy 00302 decoding and, optionally, use the entropy-decoded integer value as an 00303 offset into an index of output value vectors, returning the indicated 00304 vector of values.</para> 00305 00306 <para> 00307 The entropy coding in a Vorbis I codebook is provided by a standard 00308 Huffman binary tree representation. This tree is tightly packed using 00309 one of several methods, depending on whether codeword lengths are 00310 ordered or unordered, or the tree is sparse.</para> 00311 00312 <para> 00313 The codebook vector index is similarly packed according to index 00314 characteristic. Most commonly, the vector index is encoded as a 00315 single list of values of possible values that are then permuted into 00316 a list of n-dimensional rows (lattice VQ).</para> 00317 00318 </section> 00319 00320 </section> 00321 00322 00323 <section> 00324 <title>High-level Decode Process</title> 00325 00326 <section> 00327 <title>Decode Setup</title> 00328 00329 <para> 00330 Before decoding can begin, a decoder must initialize using the 00331 bitstream headers matching the stream to be decoded. Vorbis uses 00332 three header packets; all are required, in-order, by this 00333 specification. Once set up, decode may begin at any audio packet 00334 belonging to the Vorbis stream. In Vorbis I, all packets after the 00335 three initial headers are audio packets. </para> 00336 00337 <para> 00338 The header packets are, in order, the identification 00339 header, the comments header, and the setup header.</para> 00340 00341 <section><title>Identification Header</title> 00342 <para> 00343 The identification header identifies the bitstream as Vorbis, Vorbis 00344 version, and the simple audio characteristics of the stream such as 00345 sample rate and number of channels.</para> 00346 </section> 00347 00348 <section><title>Comment Header</title> 00349 <para> 00350 The comment header includes user text comments ("tags") and a vendor 00351 string for the application/library that produced the bitstream. The 00352 encoding and proper use of the comment header is described in 00353 <xref linkend="vorbis-spec-comment"/>.</para> 00354 </section> 00355 00356 <section><title>Setup Header</title> 00357 <para> 00358 The setup header includes extensive CODEC setup information as well as 00359 the complete VQ and Huffman codebooks needed for decode.</para> 00360 </section> 00361 00362 </section> 00363 00364 <section><title>Decode Procedure</title> 00365 00366 <highlights> 00367 <para> 00368 The decoding and synthesis procedure for all audio packets is 00369 fundamentally the same. 00370 <orderedlist> 00371 <listitem><simpara>decode packet type flag</simpara></listitem> 00372 <listitem><simpara>decode mode number</simpara></listitem> 00373 <listitem><simpara>decode window shape (long windows only)</simpara></listitem> 00374 <listitem><simpara>decode floor</simpara></listitem> 00375 <listitem><simpara>decode residue into residue vectors</simpara></listitem> 00376 <listitem><simpara>inverse channel coupling of residue vectors</simpara></listitem> 00377 <listitem><simpara>generate floor curve from decoded floor data</simpara></listitem> 00378 <listitem><simpara>compute dot product of floor and residue, producing audio spectrum vector</simpara></listitem> 00379 <listitem><simpara>inverse monolithic transform of audio spectrum vector, always an MDCT in Vorbis I</simpara></listitem> 00380 <listitem><simpara>overlap/add left-hand output of transform with right-hand output of previous frame</simpara></listitem> 00381 <listitem><simpara>store right hand-data from transform of current frame for future lapping</simpara></listitem> 00382 <listitem><simpara>if not first frame, return results of overlap/add as audio result of current frame</simpara></listitem> 00383 </orderedlist> 00384 </para> 00385 </highlights> 00386 00387 <para> 00388 Note that clever rearrangement of the synthesis arithmetic is 00389 possible; as an example, one can take advantage of symmetries in the 00390 MDCT to store the right-hand transform data of a partial MDCT for a 00391 50% inter-frame buffer space savings, and then complete the transform 00392 later before overlap/add with the next frame. This optimization 00393 produces entirely equivalent output and is naturally perfectly legal. 00394 The decoder must be <emphasis>entirely mathematically equivalent</emphasis> to the 00395 specification, it need not be a literal semantic implementation.</para> 00396 00397 <section><title>Packet type decode</title> 00398 00399 <para> 00400 Vorbis I uses four packet types. The first three packet types mark each 00401 of the three Vorbis headers described above. The fourth packet type 00402 marks an audio packet. All other packet types are reserved; packets 00403 marked with a reserved type should be ignored.</para> 00404 00405 <para> 00406 Following the three header packets, all packets in a Vorbis I stream 00407 are audio. The first step of audio packet decode is to read and 00408 verify the packet type; <emphasis>a non-audio packet when audio is expected 00409 indicates stream corruption or a non-compliant stream. The decoder 00410 must ignore the packet and not attempt decoding it to 00411 audio</emphasis>.</para> 00412 00413 </section> 00414 00415 00416 <section><title>Mode decode</title> 00417 <para> 00418 Vorbis allows an encoder to set up multiple, numbered packet 'modes', 00419 as described earlier, all of which may be used in a given Vorbis 00420 stream. The mode is encoded as an integer used as a direct offset into 00421 the mode instance index. </para> 00422 </section> 00423 00424 <section id="vorbis-spec-window"> 00425 <title>Window shape decode (long windows only)</title> 00426 00427 <para> 00428 Vorbis frames may be one of two PCM sample sizes specified during 00429 codec setup. In Vorbis I, legal frame sizes are powers of two from 64 00430 to 8192 samples. Aside from coupling, Vorbis handles channels as 00431 independent vectors and these frame sizes are in samples per channel.</para> 00432 00433 <para> 00434 Vorbis uses an overlapping transform, namely the MDCT, to blend one 00435 frame into the next, avoiding most inter-frame block boundary 00436 artifacts. The MDCT output of one frame is windowed according to MDCT 00437 requirements, overlapped 50% with the output of the previous frame and 00438 added. The window shape assures seamless reconstruction. </para> 00439 00440 <para> 00441 This is easy to visualize in the case of equal sized-windows:</para> 00442 00443 <mediaobject> 00444 <imageobject> 00445 <imagedata fileref="window1.png" format="PNG"/> 00446 </imageobject> 00447 <textobject> 00448 <phrase>overlap of two equal-sized windows</phrase> 00449 </textobject> 00450 </mediaobject> 00451 00452 <para> 00453 And slightly more complex in the case of overlapping unequal sized 00454 windows:</para> 00455 00456 <mediaobject> 00457 <imageobject> 00458 <imagedata fileref="window2.png" format="PNG"/> 00459 </imageobject> 00460 <textobject> 00461 <phrase>overlap of a long and a short window</phrase> 00462 </textobject> 00463 </mediaobject> 00464 00465 <para> 00466 In the unequal-sized window case, the window shape of the long window 00467 must be modified for seamless lapping as above. It is possible to 00468 correctly infer window shape to be applied to the current window from 00469 knowing the sizes of the current, previous and next window. It is 00470 legal for a decoder to use this method. However, in the case of a long 00471 window (short windows require no modification), Vorbis also codes two 00472 flag bits to specify pre- and post- window shape. Although not 00473 strictly necessary for function, this minor redundancy allows a packet 00474 to be fully decoded to the point of lapping entirely independently of 00475 any other packet, allowing easier abstraction of decode layers as well 00476 as allowing a greater level of easy parallelism in encode and 00477 decode.</para> 00478 00479 <para> 00480 A description of valid window functions for use with an inverse MDCT 00481 can be found in the paper 00482 <citetitle pubwork="article"> 00483 <ulink url="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps"> 00484 The use of multirate filter banks for coding of high quality digital 00485 audio</ulink></citetitle>, by T. Sporer, K. Brandenburg and B. Edler. Vorbis windows 00486 all use the slope function 00487 <inlineequation> 00488 00489 <alt>y=sin(.5*PI*sin^2((x+.5)/n*pi))</alt> 00490 <inlinemediaobject> 00491 <textobject> 00492 <phrase>$y = \sin(.5*\pi \, \sin^2((x+.5)/n*\pi))$</phrase> 00493 </textobject> 00494 </inlinemediaobject> 00495 </inlineequation>. 00496 </para> 00497 00498 </section> 00499 00500 <section><title>floor decode</title> 00501 <para> 00502 Each floor is encoded/decoded in channel order, however each floor 00503 belongs to a 'submap' that specifies which floor configuration to 00504 use. All floors are decoded before residue decode begins.</para> 00505 </section> 00506 00507 <section><title>residue decode</title> 00508 00509 <para> 00510 Although the number of residue vectors equals the number of channels, 00511 channel coupling may mean that the raw residue vectors extracted 00512 during decode do not map directly to specific channels. When channel 00513 coupling is in use, some vectors will correspond to coupled magnitude 00514 or angle. The coupling relationships are described in the codec setup 00515 and may differ from frame to frame, due to different mode numbers.</para> 00516 00517 <para> 00518 Vorbis codes residue vectors in groups by submap; the coding is done 00519 in submap order from submap 0 through n-1. This differs from floors 00520 which are coded using a configuration provided by submap number, but 00521 are coded individually in channel order.</para> 00522 00523 </section> 00524 00525 <section><title>inverse channel coupling</title> 00526 00527 <para> 00528 A detailed discussion of stereo in the Vorbis codec can be found in 00529 the document <ulink url="stereo.html"><citetitle>Stereo Channel Coupling in the 00530 Vorbis CODEC</citetitle></ulink>. Vorbis is not limited to only stereo coupling, but 00531 the stereo document also gives a good overview of the generic coupling 00532 mechanism.</para> 00533 00534 <para> 00535 Vorbis coupling applies to pairs of residue vectors at a time; 00536 decoupling is done in-place a pair at a time in the order and using 00537 the vectors specified in the current mapping configuration. The 00538 decoupling operation is the same for all pairs, converting square 00539 polar representation (where one vector is magnitude and the second 00540 angle) back to Cartesian representation.</para> 00541 00542 <para> 00543 After decoupling, in order, each pair of vectors on the coupling list, 00544 the resulting residue vectors represent the fine spectral detail 00545 of each output channel.</para> 00546 00547 </section> 00548 00549 <section><title>generate floor curve</title> 00550 00551 <para> 00552 The decoder may choose to generate the floor curve at any appropriate 00553 time. It is reasonable to generate the output curve when the floor 00554 data is decoded from the raw packet, or it can be generated after 00555 inverse coupling and applied to the spectral residue directly, 00556 combining generation and the dot product into one step and eliminating 00557 some working space.</para> 00558 00559 <para> 00560 Both floor 0 and floor 1 generate a linear-range, linear-domain output 00561 vector to be multiplied (dot product) by the linear-range, 00562 linear-domain spectral residue.</para> 00563 00564 </section> 00565 00566 <section><title>compute floor/residue dot product</title> 00567 00568 <para> 00569 This step is straightforward; for each output channel, the decoder 00570 multiplies the floor curve and residue vectors element by element, 00571 producing the finished audio spectrum of each channel.</para> 00572 00573 <para> 00574 One point is worth mentioning about this dot product; a common mistake 00575 in a fixed point implementation might be to assume that a 32 bit 00576 fixed-point representation for floor and residue and direct 00577 multiplication of the vectors is sufficient for acceptable spectral 00578 depth in all cases because it happens to mostly work with the current 00579 Xiph.Org reference encoder.</para> 00580 00581 <para> 00582 However, floor vector values can span ~140dB (~24 bits unsigned), and 00583 the audio spectrum vector should represent a minimum of 120dB (~21 00584 bits with sign), even when output is to a 16 bit PCM device. For the 00585 residue vector to represent full scale if the floor is nailed to 00586 -140dB, it must be able to span 0 to +140dB. For the residue vector 00587 to reach full scale if the floor is nailed at 0dB, it must be able to 00588 represent -140dB to +0dB. Thus, in order to handle full range 00589 dynamics, a residue vector may span -140dB to +140dB entirely within 00590 spec. A 280dB range is approximately 48 bits with sign; thus the 00591 residue vector must be able to represent a 48 bit range and the dot 00592 product must be able to handle an effective 48 bit times 24 bit 00593 multiplication. This range may be achieved using large (64 bit or 00594 larger) integers, or implementing a movable binary point 00595 representation.</para> 00596 00597 </section> 00598 00599 <section><title>inverse monolithic transform (MDCT)</title> 00600 00601 <para> 00602 The audio spectrum is converted back into time domain PCM audio via an 00603 inverse Modified Discrete Cosine Transform (MDCT). A detailed 00604 description of the MDCT is available in the paper <ulink 00605 url="http://www.iocon.com/resource/docs/ps/eusipco_corrected.ps"><citetitle pubwork="article">The use of multirate filter banks for coding of high quality digital 00606 audio</citetitle></ulink>, by T. Sporer, K. Brandenburg and B. Edler.</para> 00607 00608 <para> 00609 Note that the PCM produced directly from the MDCT is not yet finished 00610 audio; it must be lapped with surrounding frames using an appropriate 00611 window (such as the Vorbis window) before the MDCT can be considered 00612 orthogonal.</para> 00613 00614 </section> 00615 00616 <section><title>overlap/add data</title> 00617 <para> 00618 Windowed MDCT output is overlapped and added with the right hand data 00619 of the previous window such that the 3/4 point of the previous window 00620 is aligned with the 1/4 point of the current window (as illustrated in 00621 the window overlap diagram). At this point, the audio data between the 00622 center of the previous frame and the center of the current frame is 00623 now finished and ready to be returned. </para> 00624 </section> 00625 00626 <section><title>cache right hand data</title> 00627 <para> 00628 The decoder must cache the right hand portion of the current frame to 00629 be lapped with the left hand portion of the next frame. 00630 </para> 00631 </section> 00632 00633 <section><title>return finished audio data</title> 00634 00635 <para> 00636 The overlapped portion produced from overlapping the previous and 00637 current frame data is finished data to be returned by the decoder. 00638 This data spans from the center of the previous window to the center 00639 of the current window. In the case of same-sized windows, the amount 00640 of data to return is one-half block consisting of and only of the 00641 overlapped portions. When overlapping a short and long window, much of 00642 the returned range is not actually overlap. This does not damage 00643 transform orthogonality. Pay attention however to returning the 00644 correct data range; the amount of data to be returned is: 00645 00646 <programlisting> 00647 window_blocksize(previous_window)/4+window_blocksize(current_window)/4 00648 </programlisting> 00649 00650 from the center of the previous window to the center of the current 00651 window.</para> 00652 00653 <para> 00654 Data is not returned from the first frame; it must be used to 'prime' 00655 the decode engine. The encoder accounts for this priming when 00656 calculating PCM offsets; after the first frame, the proper PCM output 00657 offset is '0' (as no data has been returned yet).</para> 00658 </section> 00659 </section> 00660 00661 </section> 00662 00663 </section> 00664 <!-- end Vorbis I specification introduction and description --> 00665