[theora-dev] further debugging of my ogg/theora decoder

salsaman salsaman at gmail.com
Tue Nov 18 02:21:39 PST 2008


On Tue, Nov 18, 2008 at 12:27 AM, Ralph Giles <giles at xiph.org> wrote:

> On Sun, Nov 16, 2008 at 5:54 PM, salsaman <salsaman at gmail.com> wrote:
>
> > I am finding something very strange in my test ogg files.
> >
> > For example: I have a shift of 64, and I get a granulepos of 5130.
> >
> > 5130 == 80*64 + 10
> >
> > which suggests that frame 80 is a keyframe.
>
> That's right.
>
> > However, if I start decoding from the beginning, the 81st frame is a
> > keyframe.
>
> Really? Someone has an off-by-one somewhere.
>
> > This suggests that the first frame should be 0. But if I try to search
> for
> > frame 0, it fails.
>
> Correct. The granulepos is derived from the count of decodeable
> frames. So the granulepos is:
>
> first frame 1:0 (keyframe)
> second frame 1:1
> third frame 1:2
>  ...
> 80th frame 80:0 (keyframe)
> 81st frame 80:1
>  ...
> 90th frame 80:10
>
> > Any suggestions ?
>
> Are you counting frames from 0 instead of 1 somewhere? I try to think
> of 'frame index' which starts from zero and 'frame count' which starts
> from 1, similar to the normal index and bounds in C 'for' loops. The
> granulepos records the count, not the index.
>
> FWIW,
>  -r
>


Right, that is what I would expect. I think I will write an ogg file checker
that checks all granulepos and keyframes to make sure the problem is not in
my test files. Some of the files were created with older versions of the
encoder. For example I have one file where I need to subtract 2 from all
keyframe values in order for it to decode properly.

Regards,
Gabriel.
http://lives.sourceforge.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20081118/5a0435a2/attachment.htm 


More information about the theora-dev mailing list