From 0f9551cdb6a764780c56dcddefbe52671acaa8d5 Mon Sep 17 00:00:00 2001
From: Monty
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()
.
Vorbis floor type zero uses Line Spectral Pair (LSP, also alternately known as Line Spectral Frequency or LSF) representation to encode a @@ -2215,13 +2215,21 @@ Ogg encapsulation of a Vorbis packet stream is straightforward.
+ The granule position of a page represents the end PCM sample + position of the last packet completed on that + page. The 'last PCM sample' is the last complete sample returned by + decode, not an internal sample awaiting lapping with a + subsequent block. A page that is entirely spanned by a single + packet (that completes on a subsequent page) has no granule + position, and the granule position is set to '-1'.
+ Note that the last decoded (fully lapped) PCM sample from a packet + is not necessarily the middle sample from that block. If, eg, the + current Vorbis packet encodes a "long block" and the next Vorbis + packet encodes a "short block", the last decodable sample from the + current packet be at position (3*long_block_length/4) - + (short_block_length/4). +
The granule (PCM) position of the first page need not indicate
that the stream started at position zero. Although the granule
position belongs to the last completed packet on the page and a
diff --git a/doc/xml/a1-encapsulation_ogg.xml b/doc/xml/a1-encapsulation_ogg.xml
index 51e2681..676b983 100644
--- a/doc/xml/a1-encapsulation_ogg.xml
+++ b/doc/xml/a1-encapsulation_ogg.xml
@@ -134,11 +134,23 @@ Ogg encapsulation of a Vorbis packet stream is straightforward.