[FFmpeg-devel] [PATCH] Enable PAFF decoding

Neil Brown neilb
Wed Oct 10 09:46:22 CEST 2007


On Tuesday October 9, heydowns at borg.com wrote:
> On Tue, 9 Oct 2007, Carl Eugen Hoyos wrote:
> 
> > Applied.
> > May I suggest an update of the homepage?
> 
> Thanks for getting this all enabled and such. I'm glad its finally all in 
> svn  :)  Look for some additional fixes and such over the next week.
> 

I just checked current SVN on my test files and it is looks soooo much
better!!!!

3 issues:

1/ The first few frames are in the wrong order.

The first 3 field-pairs in my files are:
  I+P  (poc 0 and 1)
  B+B  (poc -4 and -3)
  B+B  (poc -2 and -1)

I'm getting the first pair out first, then the second decodes
imperfectly.  I haven't figured out why yet.  The same thing doesn't
happen when you cross an IDR frame, so there must be something
"special" about the very start.

2/ The frames are not 100% identical to those generated by the
   reference decoder.

 I use
    ffmpeg -i test.mts -t 0.2 /tmp/ff%d.ppm
 and
    ffmpeg -s 1440x1080 -i test.yuv -t 0.2 /tmp/ref%d.ppm

 to collect the frames, find two that look the same (i.e. compensate
 for the ordering problems), load them as two different layers into
 GIMP, and use the "Difference" Mode to find the difference.

 The result looks black, but when you look at the histogram or adjust
 the thresholds, there are differences, mostly 1 or 2, but as much as
 10.
 I won't be losing sleep over this, but I thought you should know.

3/ I'm getting the error message:
  [h264 @ 0xa638a0]MBAFF + spatial direct mode is not implemented

  a lot. As the file doesn't use MBAFF (only PAFF) I suspect this is
  wrong.

  Maybe this patch is correct?

Thanks,

NeilBrown

---
 libavcodec/h264.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- ffmpeg.orig/libavcodec/h264.c
+++ ffmpeg/libavcodec/h264.c
@@ -4396,7 +4396,7 @@ static int decode_slice_header(H264Conte
     if(h->slice_type == P_TYPE || h->slice_type == SP_TYPE || h->slice_type == B_TYPE){
         if(h->slice_type == B_TYPE){
             h->direct_spatial_mv_pred= get_bits1(&s->gb);
-            if(h->sps.mb_aff && h->direct_spatial_mv_pred)
+            if(h->mb_aff_frame && h->direct_spatial_mv_pred)
                 av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF + spatial direct mode is not implemented\n");
         }
         num_ref_idx_active_override_flag= get_bits1(&s->gb);





More information about the ffmpeg-devel mailing list