[XviD-devel] [BUG] BFrame encoder doesn't force intra for 1st frame

Michael Militzer xvid-devel@xvid.org
Sun, 4 Aug 2002 23:40:54 +0200


Hi,

----- Original Message -----
From: "Christoph Lampert" <chl@math.uni-bonn.de>
To: "XviD Devel" <xvid-devel@xvid.org>
Sent: Sunday, August 04, 2002 6:46 PM
Subject: Re: [XviD-devel] [BUG] BFrame encoder doesn't force intra for 1st
frame


> > When you use a freshly  initialized encoder, then you go through the
encoder_encode_bframes function to the line
> >
> > line 874 :
> >     inc_frame_num(pEnc);
> >
> > And here you increase all counters, among then iFrameNum (=1).
> >
> > And when the encoder must decide what type the frame is :
> >
> > line 929 :
> >
> >     if (pEnc->iFrameNum == 0 || pFr...)
> >
> > So we never satisfy the iFrameNum == 0.
>
> Can anybody check on this?

I've committed a patch which (hopefully) fixes the problem, please test!

As a side note: At least on windows our decoder has problems with our divx50
compat. b-frame clips: The first frame (i-frame) is correctly displayed and
then no frame at all is presented anymore until the next keyframe comes in.
Starting from the seconf keyframe everything is fine. Maybe the decoder has
problems with the SKIP frame at the beginning?

At least DivX 5.02 and ffdshow (which uses libavcodec from ffmpeg) decode
our clips (from the very beginning). However, DivX5 displays some wrong
blocks (they are at the right position but simply somehow corrupted) and
ffdshow has also problems. Interestingly the blocks that DivX5 decodes
incorrectly are correctly represented by ffdshow, but ffmpeg decodes a lot
of "jumping" blocks (looks like wrong MVs). Our decoder displays everything
just fine (well, after the second keyframe has been reached ;-)) - I just
wonder if some of you linux guys have tried to decode our clips with ffmpeg
and if everything was ok? ffdshow uses a version of libavcodec that's more
than a month old, maybe those problems have already been fixed in the
meantime...

bye
Michael