[theora-dev] question about ogg mapping

Mauricio Piacentini mauricio at tabuleiro.com
Thu Jun 12 10:04:49 PDT 2003

Are you sure about this, Dan? Because I got from ogg.h

typedef struct {
  unsigned char *packet;
  long  bytes;
  long  b_o_s;
  long  e_o_s;

  ogg_int64_t  granulepos;

  ogg_int64_t  packetno;     /* sequence number for decode; the framing
    knows where there's a hole in the data,
    but we need coupling so that the codec
    (which is in a seperate abstraction
    layer) also knows about the gap */
} ogg_packet;

And in theora_decode_packetin there is:

int theora_decode_packetin(theora_state *th,ogg_packet *op){
..stuff deleted..

So at least it looks like theora_decode is setting the current theora_state
granulepos from information encoded in the ogg_packet structure. However as
I said I am not sure this is set correctly by the current encoder.


----- Original Message ----- 
From: "Dan Miller" <dan at on2.com>
To: <theora-dev at xiph.org>
Sent: Thursday, June 12, 2003 1:49 PM
Subject: RE: [theora-dev] question about ogg mapping

<p>> > From: Mauricio Piacentini [mailto:mauricio at tabuleiro.com]
> > Answering my own question: by walking through the code I can
> > see that each
> > packet has its own granulepos, so it should not be a big
> > issue , provided
> Incorrect -- each *page* has a granulepos.  The data packet itself starts
with a zero (one == header packet), then there's a 'predicted' bit
(0=keyframe), etc -- no granulepos at all, that's an Ogg thing.
> It occurs to me that as it stands, there is actually no way to even get to
the second frame in a page without parsing through the whole first frame and
so on.  There isn't even a bytecount or anything to skip frames -- that info
is buried deep within the bitstream structure.
> > those are being set correctly. Not sure however if there are
> > implications
> > for seeking, we have to try and see what happens. I suspect
> > we can simply
> > stuff more packets in a page, up to the optimal 4-8k number.
> >
> > Regards,
> > Mauricio

--- >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 'theora-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 Theora-dev mailing list