[vorbis-dev] packet rearranging questions
Joshua Haberman
joshua at haberman.com
Mon Oct 27 23:49:58 PST 2003
Hello again. If you recall, I am the guy working on enabling Audacity
to losslessly rearrange Ogg Vorbis files for my senior thesis. I have
more or less completed the required modifications to Audacity to support
this. You can read more about the work this entailed by reading my
journal:
http://www.reverberate.org/computers/thesis/journal
Now my attention moves to the Ogg Vorbis code necessary to do all this
splicing. From reading the Ogg documentation and the vcut source I have
a good understanding of the Ogg format and how I will go about
rearranging Vorbis packets. However I have a few questions I would like
to clarify:
1. how exactly will the overlap/add nature of Vorbis packets affect me
as I attempt to rearrange them? Is it correct to say that for any
Vorbis packet I take from an existing stream (other than the first
packet) I must also take the packet preceding it?
2. When I am grabbing an extra preceding packet as described above,
should I set the granulepos of this preceding packet to 0 so that this
packet itself does not produce any sample data? Will that confuse the
decoder if this is in the middle of a stream?
3. I notice that you can get decoders to discard some of the samples
from the end of a packet by subtracting from the granulepos the number
of samples you want discarded. A similar way to do this for discarding
samples from the beginning of a packet (used by vcut) is to set the
granulepos to -x, where x is the number of samples you want discarded
from the beginning. But will this work in the middle of a stream, where
the granulepos should reflect the total sample offset of the stream?
4. Is it just a special case that it is not possible to discard one
sample from the beginning of a block using this method, since -1 implies
that no packets finish in this block?
I have a few more, but I'll hold off in hopes of getting these answered
for now. :)
Josh
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list