[FFmpeg-devel] [RFC] Error concealment for B-frames/fixing issue 824

Michael Niedermayer michaelni
Thu Apr 9 22:52:32 CEST 2009


On Thu, Apr 09, 2009 at 10:41:39PM +0200, Reimar D?ffinger wrote:
> On Thu, Apr 09, 2009 at 10:11:04PM +0200, Michael Niedermayer wrote:
> > On Thu, Apr 09, 2009 at 11:37:32AM +0200, Reimar D?ffinger wrote:
> > > Hello,
> > > please be kind, I do not know much about the code...
> > > My idea was that we already have error concealment code and it could be
> > > used instead of just dropping B-frame, which attached patch should do.
> > > I do admit though that I am not sure about the full consequence of this
> > > change, in particular if it might make error concealment worse in some
> > > cases.
> > 
> > [...]
> > > Index: libavcodec/mpeg12.c
> > > ===================================================================
> > > --- libavcodec/mpeg12.c	(revision 18382)
> > > +++ libavcodec/mpeg12.c	(working copy)
> > > @@ -2385,10 +2385,7 @@
> > >                  start_code <= SLICE_MAX_START_CODE) {
> > >                  int mb_y= start_code - SLICE_MIN_START_CODE;
> > >  
> > > -                if(s2->last_picture_ptr==NULL){
> > > -                /* Skip B-frames if we do not have reference frames. */
> > > -                    if(s2->pict_type==FF_B_TYPE) break;
> > > -                }
> > > +                /* B-frames with missing reference frames are handled by error concealment code. */
> > >                  if(s2->next_picture_ptr==NULL){
> > >                  /* Skip P-frames if we do not have a reference frame or we have an invalid header. */
> > >                      if(s2->pict_type==FF_P_TYPE && (s2->first_field || s2->picture_structure==PICT_FRAME)) break;
> > 
> > does this also let B frames before I frames pass? its very unlikely
> > that such frames are decodeable that is with neither reference frame
> 
> Yes it does. Can't B-frames contain intra coded blocks? If yes running

mpeg1/2 yes, mpeg4 no, they removed it in mpeg4 because it wasnt used/usefull


> it through error concealment still seems to make most sense to me,
> particularly since in the long term error concealment could of course
> be extended to detect "beyond repair" frames and skip them independent
> of this - it's just my feeling that this code never belonged here and
> should have been handled in error_concealment.c all along...
> Though skipping B-frames only when
> !s2->last_picture_ptr && !s2->next_picture_ptr
> would be an option, too, if you prefer.

there are 2 very seperate things
1. errors
2. b frames without reference frames after seeking

normal users dont want to see randomly trashed frames after seeking
in undamged files

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090409/d1e1f385/attachment.pgp>



More information about the ffmpeg-devel mailing list