From d6829fbb119e58b6eb56c135b06a76dd46a2a1a0 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 31 May 2008 21:13:48 +0000 Subject: [PATCH] Correct an accidental dereference-before-check in error cleanup in comments. svn path=/trunk/vorbis/; revision=14984 --- doc/Vorbis_I_spec.html | 52 ++++++++++++++++++++--------------------- doc/Vorbis_I_spec.pdf | Bin 409861 -> 409861 bytes lib/info.c | 10 ++++---- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/doc/Vorbis_I_spec.html b/doc/Vorbis_I_spec.html index 4cb52d8..628cf8c 100644 --- a/doc/Vorbis_I_spec.html +++ b/doc/Vorbis_I_spec.html @@ -1,4 +1,4 @@ -Vorbis I specification

Vorbis I specification

Xiph.org Foundation


1. Introduction and Description

+Vorbis I specification

Vorbis I specification

Xiph.org Foundation


1. Introduction and Description

$Id: 01-introduction.xml 7186 2004-07-20 07:19:25Z xiphmont $

1.1. Overview

This document provides a high level description of the Vorbis codec's @@ -1204,7 +1204,7 @@ the 'record label')

ISRC
International Standard Recording Code for the track; see the ISRC intro page for more information on ISRC numbers. -
5.2.2.2. Implications

Field names should not be 'internationalized'; this is a +

5.2.2.2. Implications

Field names should not be 'internationalized'; this is a concession to simplicity not an attempt to exclude the majority of the world that doesn't speak English. Field contents, however, use the UTF-8 character encoding to allow easy representation @@ -1225,7 +1225,7 @@ ARTIST=Sonny Rollins ARTIST=Sonny Stitt

-

5.2.3. Encoding

+

5.2.3. Encoding

The comment header comprises the entirety of the second bitstream header packet. Unlike the first bitstream header packet, it is not generally the only packet on the second page and may not be restricted @@ -1255,17 +1255,17 @@ bitstream octet first): This is actually somewhat easier to describe in code; implementation of the above can be found in vorbis/lib/info.c, _vorbis_pack_comment() and _vorbis_unpack_comment().

6. Floor type 0 setup and decode

$Id: 06-floor0.xml 14529 2008-02-19 10:15:13Z xiphmont $ -

6.1. Overview

+

6.1. Overview

Vorbis floor type zero uses Line Spectral Pair (LSP, also alternately known as Line Spectral Frequency or LSF) representation to encode a smooth spectral envelope curve as the frequency response of the LSP filter. This representation is equivalent to a traditional all-pole infinite impulse response filter as would be used in linear predictive coding; LSP representation may be converted to LPC representation and -vice-versa.

6.2. Floor 0 format

+vice-versa.

6.2. Floor 0 format

Floor zero configuration consists of six integer fields and a list of VQ codebooks for use in coding/decoding the LSP filter coefficient -values used by each frame.

6.2.1. header decode

+values used by each frame.

6.2.1. header decode

Configuration information for instances of floor zero decodes from the codec setup header (third packet). configuration decode proceeds as follows:

@@ -1349,12 +1349,12 @@ Similarly, the below calculation synthesizes the output LSP curve 
[expression for floorval]

  • [iteration_condition] = map element [i]
  • [output] element [i] = [linear_floor_value]
  • increment [i]
  • if ( map element [i] is equal to [iteration_condition] ) continue at step 5
  • if ( [i] is less than [n] ) continue at step 2
  • done
  • 7. Floor type 1 setup and decode

    $Id: 07-floor1.xml 10466 2005-11-28 00:34:44Z giles $ -

    7.1. Overview

    +

    7.1. Overview

    Vorbis floor type one uses a piecewise straight-line representation to encode a spectral envelope curve. The representation plots this curve mechanically on a linear frequency axis and a logarithmic (dB) amplitude axis. The integer plotting algorithm used is similar to -Bresenham's algorithm.

    7.2. Floor 1 format

    7.2.1. model

    +Bresenham's algorithm.

    7.2. Floor 1 format

    7.2.1. model

    Floor type one represents a spectral curve as a series of line segments. Synthesis constructs a floor curve using iterative prediction in a process roughly equivalent to the following simplified @@ -1390,7 +1390,7 @@ A more efficient algorithm with carefully defined integer rounding behavior is used for actual decode, as described later. The actual algorithm splits Y value computation and line plotting into two steps with modifications to the above algorithm to eliminate noise -accumulation through integer roundoff/truncation.

    7.2.2. header decode

    +accumulation through integer roundoff/truncation.

    7.2.2. header decode

    A list of floor X values is stored in the packet header in interleaved format (used in list order during packet decode and synthesis). This list is split into partitions, and each partition is assigned to a @@ -1522,7 +1522,7 @@ Skipping zero-difference values allows a smoother line fit.

    Although some aspects of the below algorithm look like inconsequential optimizations, implementors are warned to follow the details closely. Deviation from implementing a strictly equivalent algorithm can result -in serious decoding errors.

    7.2.2.2.1. step 1: amplitude value synthesis

    +in serious decoding errors.

    7.2.2.2.1. step 1: amplitude value synthesis

    Unwrap the always-positive-or-zero values read from the packet into +/- difference values, then apply to line prediction.

       1) [range] = vector { 256, 128, 86, 64 } element ([floor1_multiplier]-1)
    @@ -1598,7 +1598,7 @@ Unwrap the always-positive-or-zero values read from the packet into
     
      29) done
     
    -
    7.2.2.2.2. step 2: curve synthesis

    +

    7.2.2.2.2. step 2: curve synthesis

    Curve synthesis generates a return vector [floor] of length [n] (where [n] is provided by the decode process calling to floor decode). Floor 1 curve synthesis makes use of the @@ -1649,7 +1649,7 @@ Then compute the final curve in one pass:

     
     

    8. Residue setup and decode

    $Id: 08-residue.xml 14598 2008-03-18 15:39:43Z xiphmont $ -

    8.1. Overview

    +

    8.1. Overview

    A residue vector represents the fine detail of the audio spectrum of one channel in an audio frame after the encoder subtracts the floor curve and performs any channel coupling. A residue vector may @@ -1660,7 +1660,7 @@ Whatever the exact qualities, the Vorbis residue abstraction codes the residue vectors into the bitstream packet, and then reconstructs the vectors during decode. Vorbis makes use of three different encoding variants (numbered 0, 1 and 2) of the same basic vector encoding -abstraction.

    8.2. Residue format

    +abstraction.

    8.2. Residue format

    Residue format partitions each vector in the vector bundle into chunks, classifies each chunk, encodes the chunk classifications and finally encodes the chunks themselves using the the specific VQ arrangement @@ -1695,7 +1695,7 @@ VQ codebook. Thus, each residue value potentially accumulates values from multiple decode passes. The classification value associated with a partition is the same in each pass, thus the classification codeword is coded only in the first pass.

    -

    [illustration of residue vector format]

    8.3. residue 0

    +

    [illustration of residue vector format]

    8.3. residue 0

    Residue 0 and 1 differ only in the way the values within a residue partition are interleaved during partition encoding (visually treated as a black box--or cyan box or brown box--in the above figure).

    @@ -1719,7 +1719,7 @@ codebook dimensions = 1 encoded as: [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [

    It is worth mentioning at this point that no configurable value in the -residue coding setup is restricted to a power of two.

    8.4. residue 1

    +residue coding setup is restricted to a power of two.

    8.4. residue 1

    Residue 1 does not interleave VQ encoding. It represents partition vector scalars in order. As with residue 0, however, partition length must be an integer multiple of the codebook dimension, although @@ -1737,14 +1737,14 @@ codebook dimensions = 2 encoded as: [ 0 1 ], [ 2 3 ], [ 4 5 ], [ 6 7 ] codebook dimensions = 1 encoded as: [ 0 ], [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ] -

    8.5. residue 2

    +

    8.5. residue 2

    Residue type two can be thought of as a variant of residue type 1. Rather than encoding multiple passed-in vectors as in residue type 1, the ch passed in vectors of length n are first interleaved and flattened into a single vector of length ch*n. Encoding then proceeds as in type 1. Decoding is as in type 1 with decode interleave reversed. If operating on a single -vector to begin with, residue type 1 and type 2 are equivalent.

    [illustration of residue type 2]

    8.6. Residue decode

    8.6.1. header decode

    +vector to begin with, residue type 1 and type 2 are equivalent.

    [illustration of residue type 2]

    8.6. Residue decode

    8.6.1. header decode

    Header decode for all three residue types is identical.

       1) [residue_begin] = read 24 bits as unsigned integer
       2) [residue_end] = read 24 bits as unsigned integer
    @@ -1907,7 +1907,7 @@ Packet decode proceeds as follows, matching the description offered earlier in t
     

    An end-of-packet condition during packet decode is to be considered a nominal occurrence. Decode returns the result of vector decode up to -that point.

    8.6.3. format 0 specifics

    +that point.

    8.6.3. format 0 specifics

    Format zero decodes partitions exactly as described earlier in the 'Residue Format: residue 0' section. The following pseudocode presents the same algorithm. Assume:

    @@ -1929,7 +1929,7 @@ presents the same algorithm. Assume:

    6) done -

    8.6.4. format 1 specifics

    +

    8.6.4. format 1 specifics

    Format 1 decodes partitions exactly as described earlier in the 'Residue Format: residue 1' section. The following pseudocode presents the same algorithm. Assume:

    @@ -1949,7 +1949,7 @@ presents the same algorithm. Assume:

    6) if ( [i] is less than [n] ) continue at step 2 7) done -

    8.6.5. format 2 specifics

    +

    8.6.5. format 2 specifics

    Format 2 is reducible to format 1. It may be implemented as an additional step prior to and an additional post-decode step after a normal format 1 decode.

    Format 2 handles 'do not decode' vectors differently than residue 0 or @@ -1972,11 +1972,11 @@ channel. After decode, deinterleave the vector into independent vectors, one fo

    9. Helper equations

    $Id: 09-helper.xml 7186 2004-07-20 07:19:25Z xiphmont $ -

    9.1. Overview

    +

    9.1. Overview

    The equations below are used in multiple places by the Vorbis codec specification. Rather than cluttering up the main specification documents, they are defined here and referenced where appropriate. -

    9.2. Functions

    9.2.1. ilog

    +

    9.2. Functions

    9.2.1. ilog

    The "ilog(x)" function returns the position number (1 through n) of the highest set bit in the two's complement integer value [x]. Values of [x] less than zero are defined to return zero.

       1) [return_value] = 0;
    @@ -2157,7 +2157,7 @@ then top to bottom):

       0.50028648,    0.53279791,    0.56742212,    0.60429640, 
       0.64356699,    0.68538959,    0.72993007,    0.77736504, 
       0.82788260,    0.88168307,    0.9389798,     1.
    -

    1. Embedding Vorbis into an Ogg stream

    1.1. Overview

    +

    1. Embedding Vorbis into an Ogg stream

    1.1. Overview

    This document describes using Ogg logical and physical transport streams to encapsulate Vorbis compressed audio packet data into file form.

    @@ -2168,7 +2168,7 @@ bitstream overview and Ogg logical bitstream and framing spec provide detailed descriptions of Ogg transport streams. This specification document assumes a working knowledge of the concepts covered in these named backround -documents. Please read them first.

    1.1.1. Restrictions

    +documents. Please read them first.

    1.1.1. Restrictions

    The Ogg/Vorbis I specification currently dictates that Ogg/Vorbis streams use Ogg transport streams in degenerate, unmultiplexed form only. That is: @@ -2191,11 +2191,11 @@ audio player' is not required to implement Ogg support beyond the specific support of Vorbis within a degenrate ogg stream (naturally, application authors are encouraged to support full multiplexed Ogg handling). -

    1.1.2. MIME type

    +

    1.1.2. MIME type

    The correct MIME type of any Ogg file is application/ogg. However, if a file is a Vorbis I audio file (which implies a degenerate Ogg stream including only unmultiplexed Vorbis audio), the -mime type audio/x-vorbis is also allowed.

    1.2. Encapsulation

    +mime type audio/x-vorbis is also allowed.

    1.2. Encapsulation

    Ogg encapsulation of a Vorbis packet stream is straightforward.

    • The first Vorbis packet (the identification header), which uniquely identifies a stream as Vorbis audio, is placed alone in the diff --git a/doc/Vorbis_I_spec.pdf b/doc/Vorbis_I_spec.pdf index fdf75e16b8580b1b4d08f7349af51fcec24ec1d3..8823273636f38147f7cc12fa51b35137495803f2 100644 GIT binary patch delta 3923 zcmai1ZEV(86;EGIQ8wDnbkagx9^BZ|B1`}G{a%NLLW@MVxJ_JQ7BQQ{ZfX<_CPuS; zm{}YjjC9ZRep#|F#znIMZC4(kbPPJy0wyjH-_Qg|mHup8 z{Aug7^{xrBzR;ra`=!(LH#c4cqqJT$M(Y!;(Xg4@!ar4>vTsk(doQ)jp^25dZ+k$C&>_8Xf(}4 z>vX@J=wg~Ojd$#UrQ;7ApaZ3E^!laKFL82CO4ryDTBjdf2tU3M+VE?~uLHl%=7m6) z_O4TAs3wf46}5+IgHJx5v=&S%ns5D@?(5j4MHs62!Y^^a`k+8^-c=-B1UXc*PE{mR zNN|~uJv4;|mkA+0@Cw}?cVDB`olJ}S57JOPbC5o_UTO_(E9Agiz@tsPGD&?srZ9j9 zq$>F_-g}4!*Jvl8-I%03e)$mXj_*uTZ;weAC9}~X-aJJ0CycR-)h^o%N#1!_Br~j5 zNFcFd1xYC;g~~`Pj0H&+Imt2@DOz}wwgkZnE8Y0w&bd4z zm!+MhOsg5W%VJ@za~z&HIY)iH8d@Qz#q3;saFXid)_TO<`P>v6V6Y3hDXvJQ%v08J zI=GNycN}OJa_mkqgb+6zMaXoit%TrIY@edRaqDzq$q_hqrY}|?;K2A|1%d$RzQ_@H z!C6z}2!cbJcppdRlM|A*5&>@F%oNo>>|McC?4(x=*LapM$ijPGBho?czvr3XP6 z8ONvT?)dpB`pn0ZD^1}8;7ePD!U)5_glHvd5S+IxA>G7**QnktJZF_EN~`1kX?myw zEhfGnp7#=#HVIxa92pVlsVhzLO_!fRY*XR5bH!05|C0XWtD_RE6M&>GQK)P zYvaBqs!=8RNvGCQ#^EEV`rpjZC|v*G5x5>)w{>d;54D)QiC3BF=_84$qggV2WQ{UX*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$(J^-7YuLr|bX6`pbRO8_e4&o5gKUgGOA(;S2r2O&rWYQnq;18mTwGf9ySS7`FUP<_v}lV?kae9O zc^eR{F4u?zI2tUR;L~_H;{~WqEEa`AO7yvM|FBgHL_3si5%&Ii0ZT-wEFzE#z6u0` zh?`VeGOnG^$_ZXNfqTx=z)Eb^;KG7+?mTVgcNZ`x%a>7H$TGtd=aDvlKTittV(&sZ zRcie%WKsboTaFgDeF0Ix7(k zUK*0{#|!@PB5fK+l$5xosNx4>;(vn9yel6B$w!-%F4}o)Q^}SDQe3r@^$H}JM3(<{ znLbb}b#(+{4t@3lHCM>w$PwLx7wButa?3q`ruFUh7irn52F%M-VJ44%GE9|NXz+Px zkNk!%t+*%tg_2f=)%EaIviZt+OVs zIKRI^U$}Q^pNR{><2UK)S~cwBEaEqB(w^1TD3BE3Ew{i}^`n?g{3?ij68bhw+uhq2 zIiI{u<9))(=iZ}%_SM_;PR|y!;v8jH_(w9`$g)QB?yXNe_srcomments;i++) - if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); - if(vc->user_comments)_ogg_free(vc->user_comments); - if(vc->comment_lengths)_ogg_free(vc->comment_lengths); + if(vc->user_comments){ + for(i=0;icomments;i++) + if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); + _ogg_free(vc->user_comments); + } + if(vc->comment_lengths)_ogg_free(vc->comment_lengths); if(vc->vendor)_ogg_free(vc->vendor); memset(vc,0,sizeof(*vc)); } -- 2.34.1