[FFmpeg-devel] H.264 + PAFF: BBC HD recording shows extreme interlacing artefacts

Jeff Downs heydowns
Fri Nov 2 15:13:24 CET 2007


On Thu, 1 Nov 2007, Reinhard Nissl wrote:

[...]

> While looking for a suitable place for the top_field_first
> determination, I found that the current location where interlaced_frame
> is set, is not correct, as it sets this information on a frame in
> display order but derives this information from the current frame which
> is in decoding order. Furthermore, if the frame is returned from the
> code at the beginning of decode_frame(), interlaced_frame wouldn't have
> been set at all. The second attached patch addresses this issues.

Yes, I agree it is wrong the way it is now for the reasons you state.


> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 10822)
> +++ libavcodec/h264.c	(working copy)
> @@ -7763,6 +7763,8 @@
>              *data_size = 0;
>  
>          } else {
> +            out->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
> +
>          //FIXME do something with unavailable reference frames
>  
>  #if 0 //decode order
> @@ -7845,7 +7847,6 @@
>      /* we substract 1 because it is added on utils.c    */
>      avctx->frame_number = s->picture_number - 1;
>  #endif
> -    pict->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
>      return get_consumed_bytes(s, buf_index, buf_size);
>  }
>  #if 0

This looks good to me, except that I would assign through the 'cur' 
pointer rather than 'out' for clarity's sake.

No need to resubmit for that, though -- if Michael approves, I'll apply 
with that change.

	-Jeff




More information about the ffmpeg-devel mailing list