[vorbis-dev] Vorbis 1.0 spec notes, part 1

Kenneth Arnold ken at arnoldnet.net
Sat Jul 20 10:13:03 PDT 2002


I have undertaken a small project of writing a Vorbis decoder
completely from the spec, with the goal of catching any errors, both
typographically and algorithmically, in the spec. My "reference"
decoder is also being written in an extremely methodical style, with
practically no algorithmic optimization, such that it will be clear
that every step has been copied exactly from the spec. During this
project, I have promised myself that I will not look at the xiph.org
decoder whatsoever, except for copying codec.h for the API so that it
conforms to the same API. If my decoder produces bit-identical results
to the xiph encoder, it can thus be concluded that the spec is
accurate and that the xiph decoder conforms to the spec.

I figured I'd publish my notes here as I go along, after I'm done
working for one session. I'm going very slowly to help ensure that
everything is exactly correct, but I already have a few relatively
minor notes: (these will be mostly for Monty, but I'm sure others may
have comments)

helper.html:
* Overview
-  "int he" -> "in the"
* ilog
- "returns the *number of* the highest set bit ..."
- (reference vorbis-spec-bitpack.html)
- "greater than nonzero" -> "greater than zero"
- question: ilog defines behavior for signed values. However, it is
called sometimes with 32-bit unsigned values
(e.g. codebook_decode). Should I (a) cast all these unsigned values to
signed, (b) alter ilog to take 32-bit unsigned only, or (c) implement
ilog as 64-bit?
* float32_unpack
- step 3: "shifted left" -> "shifted right" (right?)
- step 4: "if ( [mantissa] is nonzero )" -> "if ( [sign] is nonzero )"
- question: What are the tolerances on this function? Is it acceptable
for me to cast mantissa to double, multiply it by the double returned
from pow(2,(dobule)(exponent-788)), and cast the result to float?
* lookup1_values
- given:
  return_value ^ codebook_dimensions = codebook_entries
-> is this correct: ? (I'm out of school so my algebra is slacking...)
-> return_value = log(codebook_entires) / log(codebook_dimensions)
-> where return_value truncates the double result to int?

<p>vorbis-spec-codebook.html
* introduce the variable codebook_codeword_lengths earlier
* ordered read, step 4, [n] -> [number]
*               step 4, put commas around 'inclusive'
* ordered read, step 6, increment *by 1* (nitpick)

<p>That's all for now. I may have another set later today.


-- 
Kenneth Arnold <ken at arnoldnet.net>
- "Know thyself."


-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20020720/475d6204/part.pgp


More information about the Vorbis-dev mailing list