[FFmpeg-devel] [PATCH] h264: Correctly initialize interlaced_frame if tff is set

Michael Niedermayer michael at niedermayer.cc
Sat Feb 11 03:56:32 EET 2017


On Fri, Feb 10, 2017 at 05:21:00PM -0500, Vittorio Giovara wrote:
> In particular cases, it is possible to initialize top_field_first
> but not interlaced_frame. Make sure to correctly tag a frame
> as interlaced when this happens.
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
> ---
> Please CC.
> Vittorio
> 
>  libavcodec/h264_slice.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 91a3b25..eeb5202 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1174,20 +1174,23 @@ static int h264_export_frame_props(H264Context *h)
>  
>      if (cur->field_poc[0] != cur->field_poc[1]) {
>          /* Derive top_field_first from field pocs. */
> -        cur->f->top_field_first = cur->field_poc[0] < cur->field_poc[1];
> +        cur->f->interlaced_frame =
> +        cur->f->top_field_first  = cur->field_poc[0] < cur->field_poc[1];

this looks like it would set interlaced_frame = 0 if
cur->field_poc[0] > cur->field_poc[1];

also, do you have a sample that is affected by this ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170211/b55ae822/attachment.sig>


More information about the ffmpeg-devel mailing list